src/HOL/HOLCF/Tr.thy
author wenzelm
Sat, 27 Feb 2021 13:20:52 +0100
changeset 73310 6e155bb1516d
parent 69597 ff784d5a5bfb
permissions -rw-r--r--
clarified message;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42151
4da4fc77664b tuned headers;
wenzelm
parents: 41295
diff changeset
     1
(*  Title:      HOL/HOLCF/Tr.thy
2640
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
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
     5
section \<open>The type of lifted booleans\<close>
15649
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
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
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
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
    11
subsection \<open>Type definition and constructors\<close>
16631
58b4a689ae85 defaultsort pcpo
huffman
parents: 16228
diff changeset
    12
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    13
type_synonym tr = "bool lift"
2782
5e8771682c73 tr is (again) type abbrev;
wenzelm
parents: 2766
diff changeset
    14
2766
3e90c5187ce1 "bool lift" now syntax instead of type abbrev;
wenzelm
parents: 2719
diff changeset
    15
translations
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    16
  (type) "tr" \<leftharpoondown> (type) "bool lift"
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    17
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    18
definition TT :: "tr"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    19
  where "TT = Def True"
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
    20
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    21
definition FF :: "tr"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    22
  where "FF = Def False"
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
    23
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 67312
diff changeset
    24
text \<open>Exhaustion and Elimination for type \<^typ>\<open>tr\<close>\<close>
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    25
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    26
lemma Exh_tr: "t = \<bottom> \<or> t = TT \<or> t = FF"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    27
  by (induct t) (auto simp: FF_def TT_def)
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    28
48659
40a87b4dac19 declare trE and tr_induct as default cases and induct rules for type tr
huffman
parents: 42151
diff changeset
    29
lemma trE [case_names bottom TT FF, cases type: tr]:
35783
38538bfe9ca6 declare case_names for various induction rules
huffman
parents: 35431
diff changeset
    30
  "\<lbrakk>p = \<bottom> \<Longrightarrow> Q; p = TT \<Longrightarrow> Q; p = FF \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    31
  by (induct p) (auto simp: FF_def TT_def)
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    32
48659
40a87b4dac19 declare trE and tr_induct as default cases and induct rules for type tr
huffman
parents: 42151
diff changeset
    33
lemma tr_induct [case_names bottom TT FF, induct type: tr]:
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    34
  "P \<bottom> \<Longrightarrow> P TT \<Longrightarrow> P FF \<Longrightarrow> P x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    35
  by (cases x) simp_all
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    36
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 67312
diff changeset
    37
text \<open>distinctness for type \<^typ>\<open>tr\<close>\<close>
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    38
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
    39
lemma dist_below_tr [simp]:
41182
717404c7d59a add notsqsubseteq syntax
huffman
parents: 40774
diff changeset
    40
  "TT \<notsqsubseteq> \<bottom>" "FF \<notsqsubseteq> \<bottom>" "TT \<notsqsubseteq> FF" "FF \<notsqsubseteq> TT"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    41
  by (simp_all add: TT_def FF_def)
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    42
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    43
lemma dist_eq_tr [simp]: "TT \<noteq> \<bottom>" "FF \<noteq> \<bottom>" "TT \<noteq> FF" "\<bottom> \<noteq> TT" "\<bottom> \<noteq> FF" "FF \<noteq> TT"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    44
  by (simp_all add: TT_def FF_def)
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    45
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
    46
lemma TT_below_iff [simp]: "TT \<sqsubseteq> x \<longleftrightarrow> x = TT"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    47
  by (induct x) simp_all
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    48
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
    49
lemma FF_below_iff [simp]: "FF \<sqsubseteq> x \<longleftrightarrow> x = FF"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    50
  by (induct x) simp_all
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    51
41182
717404c7d59a add notsqsubseteq syntax
huffman
parents: 40774
diff changeset
    52
lemma not_below_TT_iff [simp]: "x \<notsqsubseteq> TT \<longleftrightarrow> x = FF"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    53
  by (induct x) simp_all
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    54
41182
717404c7d59a add notsqsubseteq syntax
huffman
parents: 40774
diff changeset
    55
lemma not_below_FF_iff [simp]: "x \<notsqsubseteq> FF \<longleftrightarrow> x = TT"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    56
  by (induct x) simp_all
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    57
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    58
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
    59
subsection \<open>Case analysis\<close>
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    60
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 35783
diff changeset
    61
default_sort pcpo
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    62
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    63
definition tr_case :: "'a \<rightarrow> 'a \<rightarrow> tr \<rightarrow> 'a"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    64
  where "tr_case = (\<Lambda> t e (Def b). if b then t else e)"
40322
707eb30e8a53 make syntax of continuous if-then-else consistent with HOL if-then-else
huffman
parents: 36452
diff changeset
    65
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    66
abbreviation cifte_syn :: "[tr, 'c, 'c] \<Rightarrow> 'c"  ("(If (_)/ then (_)/ else (_))" [0, 0, 60] 60)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    67
  where "If b then e1 else e2 \<equiv> tr_case\<cdot>e1\<cdot>e2\<cdot>b"
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    68
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    69
translations
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    70
  "\<Lambda> (XCONST TT). t" \<rightleftharpoons> "CONST tr_case\<cdot>t\<cdot>\<bottom>"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    71
  "\<Lambda> (XCONST FF). t" \<rightleftharpoons> "CONST tr_case\<cdot>\<bottom>\<cdot>t"
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    72
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    73
lemma ifte_thms [simp]:
40322
707eb30e8a53 make syntax of continuous if-then-else consistent with HOL if-then-else
huffman
parents: 36452
diff changeset
    74
  "If \<bottom> then e1 else e2 = \<bottom>"
707eb30e8a53 make syntax of continuous if-then-else consistent with HOL if-then-else
huffman
parents: 36452
diff changeset
    75
  "If FF then e1 else e2 = e2"
707eb30e8a53 make syntax of continuous if-then-else consistent with HOL if-then-else
huffman
parents: 36452
diff changeset
    76
  "If TT then e1 else e2 = e1"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    77
  by (simp_all add: tr_case_def TT_def FF_def)
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    78
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    79
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
    80
subsection \<open>Boolean connectives\<close>
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
    81
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    82
definition trand :: "tr \<rightarrow> tr \<rightarrow> tr"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    83
  where andalso_def: "trand = (\<Lambda> x y. If x then y else FF)"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    84
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    85
abbreviation andalso_syn :: "tr \<Rightarrow> tr \<Rightarrow> tr"  ("_ andalso _" [36,35] 35)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    86
  where "x andalso y \<equiv> trand\<cdot>x\<cdot>y"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    87
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    88
definition tror :: "tr \<rightarrow> tr \<rightarrow> tr"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    89
  where orelse_def: "tror = (\<Lambda> x y. If x then TT else y)"
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18081
diff changeset
    90
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    91
abbreviation orelse_syn :: "tr \<Rightarrow> tr \<Rightarrow> tr"  ("_ orelse _"  [31,30] 30)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    92
  where "x orelse y \<equiv> tror\<cdot>x\<cdot>y"
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    93
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    94
definition neg :: "tr \<rightarrow> tr"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    95
  where "neg = flift2 Not"
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
    96
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    97
definition If2 :: "tr \<Rightarrow> 'c \<Rightarrow> 'c \<Rightarrow> 'c"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
    98
  where "If2 Q x y = (If Q then x else y)"
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
    99
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
   100
text \<open>tactic for tr-thms with case split\<close>
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   101
40324
b5e1ab22198a rename constant trifte to tr_case
huffman
parents: 40322
diff changeset
   102
lemmas tr_defs = andalso_def orelse_def neg_def tr_case_def TT_def FF_def
27148
5b78e50adc49 removed dead code;
wenzelm
parents: 25135
diff changeset
   103
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
   104
text \<open>lemmas about andalso, orelse, neg and if\<close>
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   105
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   106
lemma andalso_thms [simp]:
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   107
  "(TT andalso y) = y"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   108
  "(FF andalso y) = FF"
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   109
  "(\<bottom> andalso y) = \<bottom>"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   110
  "(y andalso TT) = y"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   111
  "(y andalso y) = y"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   112
      apply (unfold andalso_def, simp_all)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   113
   apply (cases y, simp_all)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   114
  apply (cases y, simp_all)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   115
  done
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   116
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   117
lemma orelse_thms [simp]:
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   118
  "(TT orelse y) = TT"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   119
  "(FF orelse y) = y"
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   120
  "(\<bottom> orelse y) = \<bottom>"
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   121
  "(y orelse FF) = y"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   122
  "(y orelse y) = y"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   123
      apply (unfold orelse_def, simp_all)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   124
   apply (cases y, simp_all)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   125
  apply (cases y, simp_all)
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   126
  done
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   127
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   128
lemma neg_thms [simp]:
18070
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   129
  "neg\<cdot>TT = FF"
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   130
  "neg\<cdot>FF = TT"
b653e18f0a41 cleaned up; removed adm_tricks in favor of compactness theorems
huffman
parents: 16756
diff changeset
   131
  "neg\<cdot>\<bottom> = \<bottom>"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   132
  by (simp_all add: neg_def TT_def FF_def)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   133
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
   134
text \<open>split-tac for If via If2 because the constant has to be a constant\<close>
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 25131
diff changeset
   135
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   136
lemma split_If2: "P (If2 Q x y) \<longleftrightarrow> ((Q = \<bottom> \<longrightarrow> P \<bottom>) \<and> (Q = TT \<longrightarrow> P x) \<and> (Q = FF \<longrightarrow> P y))"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   137
  by (cases Q) (simp_all add: If2_def)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   138
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 48659
diff changeset
   139
(* FIXME unused!? *)
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
   140
ML \<open>
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 48659
diff changeset
   141
fun split_If_tac ctxt =
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 48659
diff changeset
   142
  simp_tac (put_simpset HOL_basic_ss ctxt addsimps [@{thm If2_def} RS sym])
58956
a816aa3ff391 proper context for compose_tac, Splitter.split_tac (relevant for unify trace options);
wenzelm
parents: 58880
diff changeset
   143
    THEN' (split_tac ctxt [@{thm split_If2}])
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
   144
\<close>
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   145
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   146
subsection "Rewriting of HOLCF operations to HOL functions"
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   147
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   148
lemma andalso_or: "t \<noteq> \<bottom> \<Longrightarrow> (t andalso s) = FF \<longleftrightarrow> t = FF \<or> s = FF"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   149
  by (cases t) simp_all
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   150
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   151
lemma andalso_and: "t \<noteq> \<bottom> \<Longrightarrow> ((t andalso s) \<noteq> FF) \<longleftrightarrow> t \<noteq> FF \<and> s \<noteq> FF"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   152
  by (cases t) simp_all
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   153
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   154
lemma Def_bool1 [simp]: "Def x \<noteq> FF \<longleftrightarrow> x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   155
  by (simp add: FF_def)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   156
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   157
lemma Def_bool2 [simp]: "Def x = FF \<longleftrightarrow> \<not> x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   158
  by (simp add: FF_def)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   159
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   160
lemma Def_bool3 [simp]: "Def x = TT \<longleftrightarrow> x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   161
  by (simp add: TT_def)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   162
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   163
lemma Def_bool4 [simp]: "Def x \<noteq> TT \<longleftrightarrow> \<not> x"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   164
  by (simp add: TT_def)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   165
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   166
lemma If_and_if: "(If Def P then A else B) = (if P then A else B)"
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   167
  by (cases "Def P") (auto simp add: TT_def[symmetric] FF_def[symmetric])
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   168
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   169
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 58956
diff changeset
   170
subsection \<open>Compactness\<close>
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   171
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
   172
lemma compact_TT: "compact TT"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   173
  by (rule compact_chfin)
15649
f8345ee4f607 convert to new-style theory
huffman
parents: 14981
diff changeset
   174
27294
c11e716fafeb added some lemmas; reorganized into sections; tuned proofs
huffman
parents: 27148
diff changeset
   175
lemma compact_FF: "compact FF"
67312
0d25e02759b7 misc tuning and modernization;
wenzelm
parents: 62175
diff changeset
   176
  by (rule compact_chfin)
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
   177
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents:
diff changeset
   178
end