src/HOLCF/Tr.thy
author haftmann
Mon, 05 Jul 2010 15:12:20 +0200
changeset 37715 44b27ea94a16
parent 36452 d37c6eed8117
child 40322 707eb30e8a53
permissions -rw-r--r--
tuned proof
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
     1
(*  Title:      HOLCF/Tr.thy
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
     2
    Author:     Franz Regensburger
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
     3
*)
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
     4
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
     5
header {* The type of lifted booleans *}
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
     6
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
     7
theory Tr
16228
9b5b0c92230a import Fix is unnecessary
huffman
parents: 16121
diff changeset
     8
imports Lift
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
     9
begin
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
    10
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    11
subsection {* Type definition and constructors *}
16631
58b4a689ae85 defaultsort pcpo
huffman
parents: 16228
diff changeset
    12
2782
5e8771682c73 tr is (again) type abbrev;
wenzelm
parents: 2766
diff changeset
    13
types
5e8771682c73 tr is (again) type abbrev;
wenzelm
parents: 2766
diff changeset
    14
  tr = "bool lift"
5e8771682c73 tr is (again) type abbrev;
wenzelm
parents: 2766
diff changeset
    15
2766
3e90c5187ce1 "bool lift" now syntax instead of type abbrev;
wenzelm
parents: 2719
diff changeset
    16
translations
35431
8758fe1fc9f8 cleanup type translations;
wenzelm
parents: 31076
diff changeset
    17
  (type) "tr" <= (type) "bool lift"
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    18
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    19
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    20
  TT :: "tr" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    21
  "TT = Def True"
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
    22
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    23
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    24
  FF :: "tr" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    25
  "FF = Def False"
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
    26
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    27
text {* Exhaustion and Elimination for type @{typ tr} *}
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    28
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    29
lemma Exh_tr: "t = \<bottom> \<or> t = TT \<or> t = FF"
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    30
unfolding FF_def TT_def by (induct t) auto
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    31
35783
38538bfe9ca6 declare case_names for various induction rules
huffman
parents: 35431
diff changeset
    32
lemma trE [case_names bottom TT FF]:
38538bfe9ca6 declare case_names for various induction rules
huffman
parents: 35431
diff changeset
    33
  "\<lbrakk>p = \<bottom> \<Longrightarrow> Q; p = TT \<Longrightarrow> Q; p = FF \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    34
unfolding FF_def TT_def by (induct p) auto
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    35
35783
38538bfe9ca6 declare case_names for various induction rules
huffman
parents: 35431
diff changeset
    36
lemma tr_induct [case_names bottom TT FF]:
38538bfe9ca6 declare case_names for various induction rules
huffman
parents: 35431
diff changeset
    37
  "\<lbrakk>P \<bottom>; P TT; P FF\<rbrakk> \<Longrightarrow> P x"
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    38
by (cases x rule: trE) simp_all
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    39
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    40
text {* distinctness for type @{typ tr} *}
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    41
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
    42
lemma dist_below_tr [simp]:
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    43
  "\<not> TT \<sqsubseteq> \<bottom>" "\<not> FF \<sqsubseteq> \<bottom>" "\<not> TT \<sqsubseteq> FF" "\<not> FF \<sqsubseteq> TT"
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    44
unfolding TT_def FF_def by simp_all
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    45
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    46
lemma dist_eq_tr [simp]:
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    47
  "TT \<noteq> \<bottom>" "FF \<noteq> \<bottom>" "TT \<noteq> FF" "\<bottom> \<noteq> TT" "\<bottom> \<noteq> FF" "FF \<noteq> TT"
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    48
unfolding TT_def FF_def by simp_all
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    49
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
    50
lemma TT_below_iff [simp]: "TT \<sqsubseteq> x \<longleftrightarrow> x = TT"
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    51
by (induct x rule: tr_induct) simp_all
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    52
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
    53
lemma FF_below_iff [simp]: "FF \<sqsubseteq> x \<longleftrightarrow> x = FF"
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    54
by (induct x rule: tr_induct) simp_all
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    55
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
    56
lemma not_below_TT_iff [simp]: "\<not> (x \<sqsubseteq> TT) \<longleftrightarrow> x = FF"
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    57
by (induct x rule: tr_induct) simp_all
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    58
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
    59
lemma not_below_FF_iff [simp]: "\<not> (x \<sqsubseteq> FF) \<longleftrightarrow> x = TT"
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    60
by (induct x rule: tr_induct) simp_all
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    61
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    62
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    63
subsection {* Case analysis *}
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    64
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 35783
diff changeset
    65
default_sort pcpo
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    66
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    67
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    68
  trifte :: "'c \<rightarrow> 'c \<rightarrow> tr \<rightarrow> 'c" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    69
  ifte_def: "trifte = (\<Lambda> t e. FLIFT b. if b then t else e)"
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    70
abbreviation
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    71
  cifte_syn :: "[tr, 'c, 'c] \<Rightarrow> 'c"  ("(3If _/ (then _/ else _) fi)" 60)  where
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    72
  "If b then e1 else e2 fi == trifte\<cdot>e1\<cdot>e2\<cdot>b"
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    73
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    74
translations
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    75
  "\<Lambda> (XCONST TT). t" == "CONST trifte\<cdot>t\<cdot>\<bottom>"
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    76
  "\<Lambda> (XCONST FF). t" == "CONST trifte\<cdot>\<bottom>\<cdot>t"
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    77
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    78
lemma ifte_thms [simp]:
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    79
  "If \<bottom> then e1 else e2 fi = \<bottom>"
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    80
  "If FF then e1 else e2 fi = e2"
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    81
  "If TT then e1 else e2 fi = e1"
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    82
by (simp_all add: ifte_def TT_def FF_def)
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    83
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    84
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    85
subsection {* Boolean connectives *}
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    86
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    87
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    88
  trand :: "tr \<rightarrow> tr \<rightarrow> tr" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    89
  andalso_def: "trand = (\<Lambda> x y. If x then y else FF fi)"
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    90
abbreviation
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    91
  andalso_syn :: "tr \<Rightarrow> tr \<Rightarrow> tr"  ("_ andalso _" [36,35] 35)  where
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    92
  "x andalso y == trand\<cdot>x\<cdot>y"
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    93
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    94
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    95
  tror :: "tr \<rightarrow> tr \<rightarrow> tr" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    96
  orelse_def: "tror = (\<Lambda> x y. If x then TT else y fi)"
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    97
abbreviation
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    98
  orelse_syn :: "tr \<Rightarrow> tr \<Rightarrow> tr"  ("_ orelse _"  [31,30] 30)  where
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    99
  "x orelse y == tror\<cdot>x\<cdot>y"
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   100
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   101
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   102
  neg :: "tr \<rightarrow> tr" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   103
  "neg = flift2 Not"
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   104
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   105
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   106
  If2 :: "[tr, 'c, 'c] \<Rightarrow> 'c" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   107
  "If2 Q x y = (If Q then x else y fi)"
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   108
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   109
text {* tactic for tr-thms with case split *}
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   110
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   111
lemmas tr_defs = andalso_def orelse_def neg_def ifte_def TT_def FF_def
27148
5b78e50adc49 removed dead code;
wenzelm
parents: 25135
diff changeset
   112
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   113
text {* lemmas about andalso, orelse, neg and if *}
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   114
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   115
lemma andalso_thms [simp]:
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   116
  "(TT andalso y) = y"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   117
  "(FF andalso y) = FF"
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   118
  "(\<bottom> andalso y) = \<bottom>"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   119
  "(y andalso TT) = y"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   120
  "(y andalso y) = y"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   121
apply (unfold andalso_def, simp_all)
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
   122
apply (cases y rule: trE, simp_all)
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
   123
apply (cases y rule: trE, simp_all)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   124
done
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   125
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   126
lemma orelse_thms [simp]:
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   127
  "(TT orelse y) = TT"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   128
  "(FF orelse y) = y"
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   129
  "(\<bottom> orelse y) = \<bottom>"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   130
  "(y orelse FF) = y"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   131
  "(y orelse y) = y"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   132
apply (unfold orelse_def, simp_all)
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
   133
apply (cases y rule: trE, simp_all)
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
   134
apply (cases y rule: trE, simp_all)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   135
done
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   136
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   137
lemma neg_thms [simp]:
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   138
  "neg\<cdot>TT = FF"
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   139
  "neg\<cdot>FF = TT"
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   140
  "neg\<cdot>\<bottom> = \<bottom>"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   141
by (simp_all add: neg_def TT_def FF_def)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   142
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   143
text {* split-tac for If via If2 because the constant has to be a constant *}
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   144
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   145
lemma split_If2:
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   146
  "P (If2 Q x y) = ((Q = \<bottom> \<longrightarrow> P \<bottom>) \<and> (Q = TT \<longrightarrow> P x) \<and> (Q = FF \<longrightarrow> P y))"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   147
apply (unfold If2_def)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   148
apply (rule_tac p = "Q" in trE)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   149
apply (simp_all)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   150
done
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   151
16121
wenzelm
parents: 16070
diff changeset
   152
ML {*
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   153
val split_If_tac =
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   154
  simp_tac (HOL_basic_ss addsimps [@{thm If2_def} RS sym])
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   155
    THEN' (split_tac [@{thm split_If2}])
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   156
*}
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   157
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   158
subsection "Rewriting of HOLCF operations to HOL functions"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   159
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   160
lemma andalso_or:
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   161
  "t \<noteq> \<bottom> \<Longrightarrow> ((t andalso s) = FF) = (t = FF \<or> s = FF)"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   162
apply (rule_tac p = "t" in trE)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   163
apply simp_all
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   164
done
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   165
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   166
lemma andalso_and:
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   167
  "t \<noteq> \<bottom> \<Longrightarrow> ((t andalso s) \<noteq> FF) = (t \<noteq> FF \<and> s \<noteq> FF)"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   168
apply (rule_tac p = "t" in trE)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   169
apply simp_all
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   170
done
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   171
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   172
lemma Def_bool1 [simp]: "(Def x \<noteq> FF) = x"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   173
by (simp add: FF_def)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   174
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   175
lemma Def_bool2 [simp]: "(Def x = FF) = (\<not> x)"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   176
by (simp add: FF_def)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   177
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   178
lemma Def_bool3 [simp]: "(Def x = TT) = x"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   179
by (simp add: TT_def)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   180
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   181
lemma Def_bool4 [simp]: "(Def x \<noteq> TT) = (\<not> x)"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   182
by (simp add: TT_def)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   183
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   184
lemma If_and_if:
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   185
  "(If Def P then A else B fi) = (if P then A else B)"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   186
apply (rule_tac p = "Def P" in trE)
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   187
apply (auto simp add: TT_def[symmetric] FF_def[symmetric])
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   188
done
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   189
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   190
subsection {* Compactness *}
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   191
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
   192
lemma compact_TT: "compact TT"
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   193
by (rule compact_chfin)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   194
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
   195
lemma compact_FF: "compact FF"
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   196
by (rule compact_chfin)
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
   197
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
   198
end