src/HOLCF/One.thy
author huffman
Wed Nov 10 17:56:08 2010 -0800 (2010-11-10)
changeset 40502 8e92772bc0e8
parent 40212 20df78048db5
child 40767 a3e505b236e7
permissions -rw-r--r--
move map functions to new theory file Map_Functions; add theory file Plain_HOLCF
     1 (*  Title:      HOLCF/One.thy
     2     Author:     Oscar Slotosch
     3 *)
     4 
     5 header {* The unit domain *}
     6 
     7 theory One
     8 imports Lift
     9 begin
    10 
    11 types one = "unit lift"
    12 translations
    13   (type) "one" <= (type) "unit lift" 
    14 
    15 definition
    16   ONE :: "one"
    17 where
    18   "ONE == Def ()"
    19 
    20 text {* Exhaustion and Elimination for type @{typ one} *}
    21 
    22 lemma Exh_one: "t = \<bottom> \<or> t = ONE"
    23 unfolding ONE_def by (induct t) simp_all
    24 
    25 lemma oneE [case_names bottom ONE]: "\<lbrakk>p = \<bottom> \<Longrightarrow> Q; p = ONE \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
    26 unfolding ONE_def by (induct p) simp_all
    27 
    28 lemma one_induct [case_names bottom ONE]: "\<lbrakk>P \<bottom>; P ONE\<rbrakk> \<Longrightarrow> P x"
    29 by (cases x rule: oneE) simp_all
    30 
    31 lemma dist_below_one [simp]: "\<not> ONE \<sqsubseteq> \<bottom>"
    32 unfolding ONE_def by simp
    33 
    34 lemma below_ONE [simp]: "x \<sqsubseteq> ONE"
    35 by (induct x rule: one_induct) simp_all
    36 
    37 lemma ONE_below_iff [simp]: "ONE \<sqsubseteq> x \<longleftrightarrow> x = ONE"
    38 by (induct x rule: one_induct) simp_all
    39 
    40 lemma ONE_defined [simp]: "ONE \<noteq> \<bottom>"
    41 unfolding ONE_def by simp
    42 
    43 lemma one_neq_iffs [simp]:
    44   "x \<noteq> ONE \<longleftrightarrow> x = \<bottom>"
    45   "ONE \<noteq> x \<longleftrightarrow> x = \<bottom>"
    46   "x \<noteq> \<bottom> \<longleftrightarrow> x = ONE"
    47   "\<bottom> \<noteq> x \<longleftrightarrow> x = ONE"
    48 by (induct x rule: one_induct) simp_all
    49 
    50 lemma compact_ONE: "compact ONE"
    51 by (rule compact_chfin)
    52 
    53 text {* Case analysis function for type @{typ one} *}
    54 
    55 definition
    56   one_case :: "'a::pcpo \<rightarrow> one \<rightarrow> 'a" where
    57   "one_case = (\<Lambda> a x. strict\<cdot>x\<cdot>a)"
    58 
    59 translations
    60   "case x of XCONST ONE \<Rightarrow> t" == "CONST one_case\<cdot>t\<cdot>x"
    61   "\<Lambda> (XCONST ONE). t" == "CONST one_case\<cdot>t"
    62 
    63 lemma one_case1 [simp]: "(case \<bottom> of ONE \<Rightarrow> t) = \<bottom>"
    64 by (simp add: one_case_def)
    65 
    66 lemma one_case2 [simp]: "(case ONE of ONE \<Rightarrow> t) = t"
    67 by (simp add: one_case_def)
    68 
    69 lemma one_case3 [simp]: "(case x of ONE \<Rightarrow> ONE) = x"
    70 by (induct x rule: one_induct) simp_all
    71 
    72 end