src/HOL/HOLCF/One.thy
author huffman
Sun Dec 19 18:11:20 2010 -0800 (2010-12-19)
changeset 41295 5b5388d4ccc9
parent 41182 717404c7d59a
child 42151 4da4fc77664b
permissions -rw-r--r--
types -> type_synonym
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@41295
    11
type_synonym
huffman@41295
    12
  one = "unit lift"
nipkow@243
    13
huffman@41295
    14
translations
huffman@41295
    15
  (type) "one" <= (type) "unit lift"
huffman@41295
    16
huffman@41295
    17
definition ONE :: "one"
huffman@41295
    18
  where "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@41182
    31
lemma dist_below_one [simp]: "ONE \<notsqsubseteq> \<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
huffman@40212
    56
  one_case :: "'a::pcpo \<rightarrow> one \<rightarrow> 'a" where
huffman@40767
    57
  "one_case = (\<Lambda> a x. seq\<cdot>x\<cdot>a)"
huffman@18080
    58
huffman@18080
    59
translations
huffman@40212
    60
  "case x of XCONST ONE \<Rightarrow> t" == "CONST one_case\<cdot>t\<cdot>x"
huffman@40212
    61
  "\<Lambda> (XCONST ONE). t" == "CONST one_case\<cdot>t"
huffman@18080
    62
huffman@40212
    63
lemma one_case1 [simp]: "(case \<bottom> of ONE \<Rightarrow> t) = \<bottom>"
huffman@40212
    64
by (simp add: one_case_def)
huffman@18080
    65
huffman@40212
    66
lemma one_case2 [simp]: "(case ONE of ONE \<Rightarrow> t) = t"
huffman@40212
    67
by (simp add: one_case_def)
huffman@18080
    68
huffman@40212
    69
lemma one_case3 [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