src/HOLCF/One.thy
author huffman
Sat Mar 13 22:00:34 2010 -0800 (2010-03-13)
changeset 35783 38538bfe9ca6
parent 35431 8758fe1fc9f8
child 40046 ba2e41c8b725
permissions -rw-r--r--
declare case_names for various induction rules
slotosch@2640
     1
(*  Title:      HOLCF/One.thy
slotosch@2640
     2
    Author:     Oscar Slotosch
nipkow@243
     3
*)
nipkow@243
     4
huffman@15577
     5
header {* The unit domain *}
huffman@15577
     6
huffman@15577
     7
theory One
huffman@15577
     8
imports Lift
huffman@15577
     9
begin
nipkow@243
    10
huffman@15576
    11
types one = "unit lift"
wenzelm@25131
    12
translations
wenzelm@35431
    13
  (type) "one" <= (type) "unit lift" 
nipkow@243
    14
huffman@29141
    15
definition
wenzelm@3717
    16
  ONE :: "one"
huffman@29141
    17
where
wenzelm@25131
    18
  "ONE == Def ()"
nipkow@243
    19
huffman@16747
    20
text {* Exhaustion and Elimination for type @{typ one} *}
huffman@15576
    21
huffman@16747
    22
lemma Exh_one: "t = \<bottom> \<or> t = ONE"
huffman@27293
    23
unfolding ONE_def by (induct t) simp_all
huffman@15576
    24
huffman@35783
    25
lemma oneE [case_names bottom ONE]: "\<lbrakk>p = \<bottom> \<Longrightarrow> Q; p = ONE \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
huffman@27293
    26
unfolding ONE_def by (induct p) simp_all
huffman@27293
    27
huffman@35783
    28
lemma one_induct [case_names bottom ONE]: "\<lbrakk>P \<bottom>; P ONE\<rbrakk> \<Longrightarrow> P x"
huffman@27293
    29
by (cases x rule: oneE) simp_all
huffman@15576
    30
huffman@31076
    31
lemma dist_below_one [simp]: "\<not> ONE \<sqsubseteq> \<bottom>"
huffman@27293
    32
unfolding ONE_def by simp
huffman@27293
    33
huffman@31076
    34
lemma below_ONE [simp]: "x \<sqsubseteq> ONE"
huffman@27293
    35
by (induct x rule: one_induct) simp_all
huffman@27293
    36
huffman@31076
    37
lemma ONE_below_iff [simp]: "ONE \<sqsubseteq> x \<longleftrightarrow> x = ONE"
huffman@27293
    38
by (induct x rule: one_induct) simp_all
huffman@15576
    39
huffman@30911
    40
lemma ONE_defined [simp]: "ONE \<noteq> \<bottom>"
huffman@30911
    41
unfolding ONE_def by simp
huffman@15576
    42
huffman@27293
    43
lemma one_neq_iffs [simp]:
huffman@27293
    44
  "x \<noteq> ONE \<longleftrightarrow> x = \<bottom>"
huffman@27293
    45
  "ONE \<noteq> x \<longleftrightarrow> x = \<bottom>"
huffman@27293
    46
  "x \<noteq> \<bottom> \<longleftrightarrow> x = ONE"
huffman@27293
    47
  "\<bottom> \<noteq> x \<longleftrightarrow> x = ONE"
huffman@27293
    48
by (induct x rule: one_induct) simp_all
huffman@27293
    49
huffman@27293
    50
lemma compact_ONE: "compact ONE"
huffman@17838
    51
by (rule compact_chfin)
huffman@17838
    52
huffman@18080
    53
text {* Case analysis function for type @{typ one} *}
huffman@18080
    54
wenzelm@25131
    55
definition
wenzelm@25131
    56
  one_when :: "'a::pcpo \<rightarrow> one \<rightarrow> 'a" where
wenzelm@25131
    57
  "one_when = (\<Lambda> a. strictify\<cdot>(\<Lambda> _. a))"
huffman@18080
    58
huffman@18080
    59
translations
huffman@27293
    60
  "case x of XCONST ONE \<Rightarrow> t" == "CONST one_when\<cdot>t\<cdot>x"
huffman@27293
    61
  "\<Lambda> (XCONST ONE). t" == "CONST one_when\<cdot>t"
huffman@18080
    62
huffman@18111
    63
lemma one_when1 [simp]: "(case \<bottom> of ONE \<Rightarrow> t) = \<bottom>"
huffman@18080
    64
by (simp add: one_when_def)
huffman@18080
    65
huffman@18111
    66
lemma one_when2 [simp]: "(case ONE of ONE \<Rightarrow> t) = t"
huffman@18080
    67
by (simp add: one_when_def)
huffman@18080
    68
huffman@18111
    69
lemma one_when3 [simp]: "(case x of ONE \<Rightarrow> ONE) = x"
huffman@27293
    70
by (induct x rule: one_induct) simp_all
huffman@18080
    71
nipkow@243
    72
end