src/HOLCF/Domain.thy
author huffman
Tue, 02 Mar 2010 09:54:50 -0800
changeset 35512 d1ef88d7de5a
parent 35494 45c9a8278faf
child 35529 089e438b925b
permissions -rw-r--r--
remove dead code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
     1
(*  Title:      HOLCF/Domain.thy
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
     2
    Author:     Brian Huffman
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
     3
*)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
     4
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
     5
header {* Domain package *}
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
     6
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
     7
theory Domain
33800
d625c373b160 Domain.thy imports Representable.thy
huffman
parents: 33504
diff changeset
     8
imports Ssum Sprod Up One Tr Fixrec Representable
30910
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
     9
uses
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
    10
  ("Tools/cont_consts.ML")
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
    11
  ("Tools/cont_proc.ML")
35444
73f645fdd4ff reorganizing domain package code (in progress)
huffman
parents: 35117
diff changeset
    12
  ("Tools/Domain/domain_constructors.ML")
32126
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
    13
  ("Tools/Domain/domain_library.ML")
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
    14
  ("Tools/Domain/domain_syntax.ML")
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
    15
  ("Tools/Domain/domain_axioms.ML")
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
    16
  ("Tools/Domain/domain_theorems.ML")
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
    17
  ("Tools/Domain/domain_extender.ML")
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    18
begin
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    19
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    20
defaultsort pcpo
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    21
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    22
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    23
subsection {* Continuous isomorphisms *}
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    24
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    25
text {* A locale for continuous isomorphisms *}
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    26
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    27
locale iso =
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    28
  fixes abs :: "'a \<rightarrow> 'b"
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    29
  fixes rep :: "'b \<rightarrow> 'a"
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    30
  assumes abs_iso [simp]: "rep\<cdot>(abs\<cdot>x) = x"
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    31
  assumes rep_iso [simp]: "abs\<cdot>(rep\<cdot>y) = y"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    32
begin
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    33
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    34
lemma swap: "iso rep abs"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    35
  by (rule iso.intro [OF rep_iso abs_iso])
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    36
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30911
diff changeset
    37
lemma abs_below: "(abs\<cdot>x \<sqsubseteq> abs\<cdot>y) = (x \<sqsubseteq> y)"
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    38
proof
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    39
  assume "abs\<cdot>x \<sqsubseteq> abs\<cdot>y"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    40
  then have "rep\<cdot>(abs\<cdot>x) \<sqsubseteq> rep\<cdot>(abs\<cdot>y)" by (rule monofun_cfun_arg)
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    41
  then show "x \<sqsubseteq> y" by simp
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    42
next
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    43
  assume "x \<sqsubseteq> y"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    44
  then show "abs\<cdot>x \<sqsubseteq> abs\<cdot>y" by (rule monofun_cfun_arg)
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    45
qed
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    46
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30911
diff changeset
    47
lemma rep_below: "(rep\<cdot>x \<sqsubseteq> rep\<cdot>y) = (x \<sqsubseteq> y)"
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30911
diff changeset
    48
  by (rule iso.abs_below [OF swap])
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    49
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    50
lemma abs_eq: "(abs\<cdot>x = abs\<cdot>y) = (x = y)"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30911
diff changeset
    51
  by (simp add: po_eq_conv abs_below)
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    52
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    53
lemma rep_eq: "(rep\<cdot>x = rep\<cdot>y) = (x = y)"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    54
  by (rule iso.abs_eq [OF swap])
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    55
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    56
lemma abs_strict: "abs\<cdot>\<bottom> = \<bottom>"
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    57
proof -
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    58
  have "\<bottom> \<sqsubseteq> rep\<cdot>\<bottom>" ..
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    59
  then have "abs\<cdot>\<bottom> \<sqsubseteq> abs\<cdot>(rep\<cdot>\<bottom>)" by (rule monofun_cfun_arg)
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    60
  then have "abs\<cdot>\<bottom> \<sqsubseteq> \<bottom>" by simp
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    61
  then show ?thesis by (rule UU_I)
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    62
qed
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    63
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    64
lemma rep_strict: "rep\<cdot>\<bottom> = \<bottom>"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    65
  by (rule iso.abs_strict [OF swap])
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    66
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    67
lemma abs_defin': "abs\<cdot>x = \<bottom> \<Longrightarrow> x = \<bottom>"
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    68
proof -
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    69
  have "x = rep\<cdot>(abs\<cdot>x)" by simp
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    70
  also assume "abs\<cdot>x = \<bottom>"
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    71
  also note rep_strict
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    72
  finally show "x = \<bottom>" .
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    73
qed
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    74
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    75
lemma rep_defin': "rep\<cdot>z = \<bottom> \<Longrightarrow> z = \<bottom>"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    76
  by (rule iso.abs_defin' [OF swap])
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    77
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    78
lemma abs_defined: "z \<noteq> \<bottom> \<Longrightarrow> abs\<cdot>z \<noteq> \<bottom>"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    79
  by (erule contrapos_nn, erule abs_defin')
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    80
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    81
lemma rep_defined: "z \<noteq> \<bottom> \<Longrightarrow> rep\<cdot>z \<noteq> \<bottom>"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    82
  by (rule iso.abs_defined [OF iso.swap]) (rule iso_axioms)
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    83
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    84
lemma abs_defined_iff: "(abs\<cdot>x = \<bottom>) = (x = \<bottom>)"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    85
  by (auto elim: abs_defin' intro: abs_strict)
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
    86
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    87
lemma rep_defined_iff: "(rep\<cdot>x = \<bottom>) = (x = \<bottom>)"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
    88
  by (rule iso.abs_defined_iff [OF iso.swap]) (rule iso_axioms)
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
    89
35457
d63655b88369 move proofs of casedist into domain_constructors.ML
huffman
parents: 35446
diff changeset
    90
lemma casedist_rule: "rep\<cdot>x = \<bottom> \<or> P \<Longrightarrow> x = \<bottom> \<or> P"
d63655b88369 move proofs of casedist into domain_constructors.ML
huffman
parents: 35446
diff changeset
    91
  by (simp add: rep_defined_iff)
d63655b88369 move proofs of casedist into domain_constructors.ML
huffman
parents: 35446
diff changeset
    92
d63655b88369 move proofs of casedist into domain_constructors.ML
huffman
parents: 35446
diff changeset
    93
lemma compact_abs_rev: "compact (abs\<cdot>x) \<Longrightarrow> compact x"
17836
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
    94
proof (unfold compact_def)
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
    95
  assume "adm (\<lambda>y. \<not> abs\<cdot>x \<sqsubseteq> y)"
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
    96
  with cont_Rep_CFun2
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
    97
  have "adm (\<lambda>y. \<not> abs\<cdot>x \<sqsubseteq> abs\<cdot>y)" by (rule adm_subst)
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30911
diff changeset
    98
  then show "adm (\<lambda>y. \<not> x \<sqsubseteq> y)" using abs_below by simp
17836
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
    99
qed
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
   100
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   101
lemma compact_rep_rev: "compact (rep\<cdot>x) \<Longrightarrow> compact x"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   102
  by (rule iso.compact_abs_rev [OF iso.swap]) (rule iso_axioms)
17836
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
   103
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   104
lemma compact_abs: "compact x \<Longrightarrow> compact (abs\<cdot>x)"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   105
  by (rule compact_rep_rev) simp
17836
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
   106
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   107
lemma compact_rep: "compact x \<Longrightarrow> compact (rep\<cdot>x)"
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   108
  by (rule iso.compact_abs [OF iso.swap]) (rule iso_axioms)
17836
5d9c9e284d16 added compactness theorems in locale iso
huffman
parents: 17835
diff changeset
   109
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   110
lemma iso_swap: "(x = abs\<cdot>y) = (rep\<cdot>x = y)"
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   111
proof
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   112
  assume "x = abs\<cdot>y"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   113
  then have "rep\<cdot>x = rep\<cdot>(abs\<cdot>y)" by simp
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   114
  then show "rep\<cdot>x = y" by simp
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   115
next
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   116
  assume "rep\<cdot>x = y"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   117
  then have "abs\<cdot>(rep\<cdot>x) = abs\<cdot>y" by simp
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   118
  then show "x = abs\<cdot>y" by simp
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   119
qed
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   120
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   121
end
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   122
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   123
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   124
subsection {* Casedist *}
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   125
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   126
lemma ex_one_defined_iff:
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   127
  "(\<exists>x. P x \<and> x \<noteq> \<bottom>) = P ONE"
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   128
 apply safe
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   129
  apply (rule_tac p=x in oneE)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   130
   apply simp
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   131
  apply simp
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   132
 apply force
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   133
 done
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   134
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   135
lemma ex_up_defined_iff:
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   136
  "(\<exists>x. P x \<and> x \<noteq> \<bottom>) = (\<exists>x. P (up\<cdot>x))"
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   137
 apply safe
16754
1b979f8b7e8e renamed upE1 to upE
huffman
parents: 16320
diff changeset
   138
  apply (rule_tac p=x in upE)
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   139
   apply simp
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   140
  apply fast
16320
89917621becf fixed renamed lemma
huffman
parents: 16230
diff changeset
   141
 apply (force intro!: up_defined)
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   142
 done
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   143
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   144
lemma ex_sprod_defined_iff:
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   145
 "(\<exists>y. P y \<and> y \<noteq> \<bottom>) =
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   146
  (\<exists>x y. (P (:x, y:) \<and> x \<noteq> \<bottom>) \<and> y \<noteq> \<bottom>)"
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   147
 apply safe
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   148
  apply (rule_tac p=y in sprodE)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   149
   apply simp
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   150
  apply fast
16217
96f0c8546265 renamed defined lemmas
huffman
parents: 16121
diff changeset
   151
 apply (force intro!: spair_defined)
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   152
 done
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   153
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   154
lemma ex_sprod_up_defined_iff:
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   155
 "(\<exists>y. P y \<and> y \<noteq> \<bottom>) =
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   156
  (\<exists>x y. P (:up\<cdot>x, y:) \<and> y \<noteq> \<bottom>)"
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   157
 apply safe
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   158
  apply (rule_tac p=y in sprodE)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   159
   apply simp
16754
1b979f8b7e8e renamed upE1 to upE
huffman
parents: 16320
diff changeset
   160
  apply (rule_tac p=x in upE)
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   161
   apply simp
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   162
  apply fast
16217
96f0c8546265 renamed defined lemmas
huffman
parents: 16121
diff changeset
   163
 apply (force intro!: spair_defined)
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   164
 done
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   165
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   166
lemma ex_ssum_defined_iff:
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   167
 "(\<exists>x. P x \<and> x \<noteq> \<bottom>) =
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   168
 ((\<exists>x. P (sinl\<cdot>x) \<and> x \<noteq> \<bottom>) \<or>
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   169
  (\<exists>x. P (sinr\<cdot>x) \<and> x \<noteq> \<bottom>))"
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   170
 apply (rule iffI)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   171
  apply (erule exE)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   172
  apply (erule conjE)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   173
  apply (rule_tac p=x in ssumE)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   174
    apply simp
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   175
   apply (rule disjI1, fast)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   176
  apply (rule disjI2, fast)
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   177
 apply (erule disjE)
17835
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
   178
  apply force
74e6140e5f1f added several theorems in locale iso
huffman
parents: 16754
diff changeset
   179
 apply force
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   180
 done
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   181
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   182
lemma exh_start: "p = \<bottom> \<or> (\<exists>x. p = x \<and> x \<noteq> \<bottom>)"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   183
  by auto
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   184
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   185
lemmas ex_defined_iffs =
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   186
   ex_ssum_defined_iff
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   187
   ex_sprod_up_defined_iff
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   188
   ex_sprod_defined_iff
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   189
   ex_up_defined_iff
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   190
   ex_one_defined_iff
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   191
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   192
text {* Rules for turning exh into casedist *}
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   193
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   194
lemma exh_casedist0: "\<lbrakk>R; R \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P" (* like make_elim *)
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   195
  by auto
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   196
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   197
lemma exh_casedist1: "((P \<or> Q \<Longrightarrow> R) \<Longrightarrow> S) \<equiv> (\<lbrakk>P \<Longrightarrow> R; Q \<Longrightarrow> R\<rbrakk> \<Longrightarrow> S)"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   198
  by rule auto
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   199
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   200
lemma exh_casedist2: "(\<exists>x. P x \<Longrightarrow> Q) \<equiv> (\<And>x. P x \<Longrightarrow> Q)"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   201
  by rule auto
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   202
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   203
lemma exh_casedist3: "(P \<and> Q \<Longrightarrow> R) \<equiv> (P \<Longrightarrow> Q \<Longrightarrow> R)"
23376
53317a1ec8b2 tuned proofs: avoid implicit prems;
wenzelm
parents: 23152
diff changeset
   204
  by rule auto
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   205
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   206
lemmas exh_casedists = exh_casedist1 exh_casedist2 exh_casedist3
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   207
30910
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
   208
31230
50deb3badfba add combinators for building copy functions
huffman
parents: 31076
diff changeset
   209
subsection {* Combinators for building copy functions *}
50deb3badfba add combinators for building copy functions
huffman
parents: 31076
diff changeset
   210
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 33400
diff changeset
   211
lemmas domain_map_stricts =
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 33400
diff changeset
   212
  ssum_map_strict sprod_map_strict u_map_strict
31230
50deb3badfba add combinators for building copy functions
huffman
parents: 31076
diff changeset
   213
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 33400
diff changeset
   214
lemmas domain_map_simps =
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 33400
diff changeset
   215
  ssum_map_sinl ssum_map_sinr sprod_map_spair u_map_up
31230
50deb3badfba add combinators for building copy functions
huffman
parents: 31076
diff changeset
   216
50deb3badfba add combinators for building copy functions
huffman
parents: 31076
diff changeset
   217
30910
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
   218
subsection {* Installing the domain package *}
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
   219
30911
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   220
lemmas con_strict_rules =
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   221
  sinl_strict sinr_strict spair_strict1 spair_strict2
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   222
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   223
lemmas con_defin_rules =
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   224
  sinl_defined sinr_defined spair_defined up_defined ONE_defined
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   225
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   226
lemmas con_defined_iff_rules =
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   227
  sinl_defined_iff sinr_defined_iff spair_strict_iff up_defined ONE_defined
7809cbaa1b61 domain package: simplify internal proofs of con_rews
huffman
parents: 30910
diff changeset
   228
35117
eeec2a320a77 change generated lemmas dist_eqs and dist_les to iff-style
huffman
parents: 33800
diff changeset
   229
lemmas con_below_iff_rules =
eeec2a320a77 change generated lemmas dist_eqs and dist_les to iff-style
huffman
parents: 33800
diff changeset
   230
  sinl_below sinr_below sinl_below_sinr sinr_below_sinl con_defined_iff_rules
eeec2a320a77 change generated lemmas dist_eqs and dist_les to iff-style
huffman
parents: 33800
diff changeset
   231
eeec2a320a77 change generated lemmas dist_eqs and dist_les to iff-style
huffman
parents: 33800
diff changeset
   232
lemmas con_eq_iff_rules =
eeec2a320a77 change generated lemmas dist_eqs and dist_les to iff-style
huffman
parents: 33800
diff changeset
   233
  sinl_eq sinr_eq sinl_eq_sinr sinr_eq_sinl con_defined_iff_rules
eeec2a320a77 change generated lemmas dist_eqs and dist_les to iff-style
huffman
parents: 33800
diff changeset
   234
35446
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   235
lemmas sel_strict_rules =
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   236
  cfcomp2 sscase1 sfst_strict ssnd_strict fup1
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   237
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   238
lemma sel_app_extra_rules:
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   239
  "sscase\<cdot>ID\<cdot>\<bottom>\<cdot>(sinr\<cdot>x) = \<bottom>"
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   240
  "sscase\<cdot>ID\<cdot>\<bottom>\<cdot>(sinl\<cdot>x) = x"
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   241
  "sscase\<cdot>\<bottom>\<cdot>ID\<cdot>(sinl\<cdot>x) = \<bottom>"
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   242
  "sscase\<cdot>\<bottom>\<cdot>ID\<cdot>(sinr\<cdot>x) = x"
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   243
  "fup\<cdot>ID\<cdot>(up\<cdot>x) = x"
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   244
by (cases "x = \<bottom>", simp, simp)+
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   245
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   246
lemmas sel_app_rules =
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   247
  sel_strict_rules sel_app_extra_rules
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   248
  ssnd_spair sfst_spair up_defined spair_defined
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   249
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   250
lemmas sel_defined_iff_rules =
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   251
  cfcomp2 sfst_defined_iff ssnd_defined_iff
b719dad322fa rewrite domain package code for selector functions
huffman
parents: 35444
diff changeset
   252
35494
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   253
lemmas take_con_rules =
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   254
  ID1 ssum_map_sinl' ssum_map_sinr' ssum_map_strict
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   255
  sprod_map_spair' sprod_map_strict u_map_up u_map_strict
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   256
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   257
lemma lub_ID_take_lemma:
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   258
  assumes "chain t" and "(\<Squnion>n. t n) = ID"
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   259
  assumes "\<And>n. t n\<cdot>x = t n\<cdot>y" shows "x = y"
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   260
proof -
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   261
  have "(\<Squnion>n. t n\<cdot>x) = (\<Squnion>n. t n\<cdot>y)"
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   262
    using assms(3) by simp
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   263
  then have "(\<Squnion>n. t n)\<cdot>x = (\<Squnion>n. t n)\<cdot>y"
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   264
    using assms(1) by (simp add: lub_distribs)
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   265
  then show "x = y"
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   266
    using assms(2) by simp
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   267
qed
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   268
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   269
lemma lub_ID_reach:
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   270
  assumes "chain t" and "(\<Squnion>n. t n) = ID"
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   271
  shows "(\<Squnion>n. t n\<cdot>x) = x"
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   272
using assms by (simp add: lub_distribs)
45c9a8278faf domain package no longer generates copy functions; all proofs use take functions instead
huffman
parents: 35457
diff changeset
   273
30910
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
   274
use "Tools/cont_consts.ML"
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
   275
use "Tools/cont_proc.ML"
32126
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
   276
use "Tools/Domain/domain_library.ML"
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
   277
use "Tools/Domain/domain_syntax.ML"
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
   278
use "Tools/Domain/domain_axioms.ML"
35457
d63655b88369 move proofs of casedist into domain_constructors.ML
huffman
parents: 35446
diff changeset
   279
use "Tools/Domain/domain_constructors.ML"
32126
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
   280
use "Tools/Domain/domain_theorems.ML"
a5042f260440 obey captialized directory names convention
haftmann
parents: 31230
diff changeset
   281
use "Tools/Domain/domain_extender.ML"
30910
a7cc0ef93269 set up domain package in Domain.thy
huffman
parents: 29138
diff changeset
   282
15741
29a78517543f New file for theorems used by the domain package
huffman
parents:
diff changeset
   283
end