| author | wenzelm | 
| Thu, 29 Jun 2017 21:43:55 +0200 | |
| changeset 66223 | a6fdb22b0ce2 | 
| parent 62175 | 8ffc4d0e652d | 
| child 67312 | 0d25e02759b7 | 
| permissions | -rw-r--r-- | 
| 42151 | 1 | (* Title: HOL/HOLCF/Sprod.thy | 
| 40502 
8e92772bc0e8
move map functions to new theory file Map_Functions; add theory file Plain_HOLCF
 huffman parents: 
40436diff
changeset | 2 | Author: Franz Regensburger | 
| 
8e92772bc0e8
move map functions to new theory file Map_Functions; add theory file Plain_HOLCF
 huffman parents: 
40436diff
changeset | 3 | Author: Brian Huffman | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 4 | *) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 5 | |
| 62175 | 6 | section \<open>The type of strict products\<close> | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 7 | |
| 15577 | 8 | theory Sprod | 
| 40502 
8e92772bc0e8
move map functions to new theory file Map_Functions; add theory file Plain_HOLCF
 huffman parents: 
40436diff
changeset | 9 | imports Cfun | 
| 15577 | 10 | begin | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 11 | |
| 36452 | 12 | default_sort pcpo | 
| 16082 | 13 | |
| 62175 | 14 | subsection \<open>Definition of strict product type\<close> | 
| 15591 
50c3384ca6c4
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 15 | |
| 45695 | 16 | definition "sprod = {p::'a \<times> 'b. p = \<bottom> \<or> (fst p \<noteq> \<bottom> \<and> snd p \<noteq> \<bottom>)}"
 | 
| 17 | ||
| 61998 | 18 | pcpodef ('a, 'b) sprod  ("(_ \<otimes>/ _)" [21,20] 20) = "sprod :: ('a \<times> 'b) set"
 | 
| 45695 | 19 | unfolding sprod_def by simp_all | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 20 | |
| 35525 | 21 | instance sprod :: ("{chfin,pcpo}", "{chfin,pcpo}") chfin
 | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 22 | by (rule typedef_chfin [OF type_definition_sprod below_sprod_def]) | 
| 25827 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25757diff
changeset | 23 | |
| 61998 | 24 | type_notation (ASCII) | 
| 25 | sprod (infixr "**" 20) | |
| 61378 | 26 | |
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 27 | |
| 62175 | 28 | subsection \<open>Definitions of constants\<close> | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 29 | |
| 25135 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 30 | definition | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 31 |   sfst :: "('a ** 'b) \<rightarrow> 'a" where
 | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 32 | "sfst = (\<Lambda> p. fst (Rep_sprod p))" | 
| 25135 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 33 | |
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 34 | definition | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 35 |   ssnd :: "('a ** 'b) \<rightarrow> 'b" where
 | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 36 | "ssnd = (\<Lambda> p. snd (Rep_sprod p))" | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 37 | |
| 25135 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 38 | definition | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 39 |   spair :: "'a \<rightarrow> 'b \<rightarrow> ('a ** 'b)" where
 | 
| 40767 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 40 | "spair = (\<Lambda> a b. Abs_sprod (seq\<cdot>b\<cdot>a, seq\<cdot>a\<cdot>b))" | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 41 | |
| 25135 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 42 | definition | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 43 |   ssplit :: "('a \<rightarrow> 'b \<rightarrow> 'c) \<rightarrow> ('a ** 'b) \<rightarrow> 'c" where
 | 
| 40767 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 44 | "ssplit = (\<Lambda> f p. seq\<cdot>p\<cdot>(f\<cdot>(sfst\<cdot>p)\<cdot>(ssnd\<cdot>p)))" | 
| 25135 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 45 | |
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 46 | syntax | 
| 41479 | 47 |   "_stuple" :: "[logic, args] \<Rightarrow> logic"  ("(1'(:_,/ _:'))")
 | 
| 48 | ||
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 49 | translations | 
| 18078 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
17837diff
changeset | 50 | "(:x, y, z:)" == "(:x, (:y, z:):)" | 
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
18078diff
changeset | 51 | "(:x, y:)" == "CONST spair\<cdot>x\<cdot>y" | 
| 18078 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
17837diff
changeset | 52 | |
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
17837diff
changeset | 53 | translations | 
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
18078diff
changeset | 54 | "\<Lambda>(CONST spair\<cdot>x\<cdot>y). t" == "CONST ssplit\<cdot>(\<Lambda> x y. t)" | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 55 | |
| 62175 | 56 | subsection \<open>Case analysis\<close> | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 57 | |
| 40767 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 58 | lemma spair_sprod: "(seq\<cdot>b\<cdot>a, seq\<cdot>a\<cdot>b) \<in> sprod" | 
| 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 59 | by (simp add: sprod_def seq_conv_if) | 
| 40083 | 60 | |
| 40767 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 61 | lemma Rep_sprod_spair: "Rep_sprod (:a, b:) = (seq\<cdot>b\<cdot>a, seq\<cdot>a\<cdot>b)" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 62 | by (simp add: spair_def cont_Abs_sprod Abs_sprod_inverse spair_sprod) | 
| 40080 | 63 | |
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 64 | lemmas Rep_sprod_simps = | 
| 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 65 | Rep_sprod_inject [symmetric] below_sprod_def | 
| 44066 
d74182c93f04
rename Pair_fst_snd_eq to prod_eq_iff (keeping old name too)
 huffman parents: 
42151diff
changeset | 66 | prod_eq_iff below_prod_def | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 67 | Rep_sprod_strict Rep_sprod_spair | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 68 | |
| 35783 | 69 | lemma sprodE [case_names bottom spair, cases type: sprod]: | 
| 40080 | 70 | obtains "p = \<bottom>" | x y where "p = (:x, y:)" and "x \<noteq> \<bottom>" and "y \<noteq> \<bottom>" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 71 | using Rep_sprod [of p] by (auto simp add: sprod_def Rep_sprod_simps) | 
| 16059 
dab0d004732f
Simplified version of strict product theory, using TypedefPcpo
 huffman parents: 
15930diff
changeset | 72 | |
| 35783 | 73 | lemma sprod_induct [case_names bottom spair, induct type: sprod]: | 
| 25757 
5957e3d72fec
declare sprodE as cases rule; new induction rule sprod_induct
 huffman parents: 
25135diff
changeset | 74 | "\<lbrakk>P \<bottom>; \<And>x y. \<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> P (:x, y:)\<rbrakk> \<Longrightarrow> P x" | 
| 
5957e3d72fec
declare sprodE as cases rule; new induction rule sprod_induct
 huffman parents: 
25135diff
changeset | 75 | by (cases x, simp_all) | 
| 
5957e3d72fec
declare sprodE as cases rule; new induction rule sprod_induct
 huffman parents: 
25135diff
changeset | 76 | |
| 62175 | 77 | subsection \<open>Properties of \emph{spair}\<close>
 | 
| 16059 
dab0d004732f
Simplified version of strict product theory, using TypedefPcpo
 huffman parents: 
15930diff
changeset | 78 | |
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 79 | lemma spair_strict1 [simp]: "(:\<bottom>, y:) = \<bottom>" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 80 | by (simp add: Rep_sprod_simps) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 81 | |
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 82 | lemma spair_strict2 [simp]: "(:x, \<bottom>:) = \<bottom>" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 83 | by (simp add: Rep_sprod_simps) | 
| 25914 | 84 | |
| 40321 
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
 huffman parents: 
40098diff
changeset | 85 | lemma spair_bottom_iff [simp]: "((:x, y:) = \<bottom>) = (x = \<bottom> \<or> y = \<bottom>)" | 
| 40767 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 86 | by (simp add: Rep_sprod_simps seq_conv_if) | 
| 25914 | 87 | |
| 31076 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
 huffman parents: 
29138diff
changeset | 88 | lemma spair_below_iff: | 
| 25914 | 89 | "((:a, b:) \<sqsubseteq> (:c, d:)) = (a = \<bottom> \<or> b = \<bottom> \<or> (a \<sqsubseteq> c \<and> b \<sqsubseteq> d))" | 
| 40767 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 90 | by (simp add: Rep_sprod_simps seq_conv_if) | 
| 25914 | 91 | |
| 92 | lemma spair_eq_iff: | |
| 93 | "((:a, b:) = (:c, d:)) = | |
| 94 | (a = c \<and> b = d \<or> (a = \<bottom> \<or> b = \<bottom>) \<and> (c = \<bottom> \<or> d = \<bottom>))" | |
| 40767 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 95 | by (simp add: Rep_sprod_simps seq_conv_if) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 96 | |
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 97 | lemma spair_strict: "x = \<bottom> \<or> y = \<bottom> \<Longrightarrow> (:x, y:) = \<bottom>" | 
| 25914 | 98 | by simp | 
| 16059 
dab0d004732f
Simplified version of strict product theory, using TypedefPcpo
 huffman parents: 
15930diff
changeset | 99 | |
| 16212 
422f836f6b39
renamed strict, defined, and inject lemmas; renamed sfst2, ssnd2 to sfst_spair, ssnd_spair
 huffman parents: 
16082diff
changeset | 100 | lemma spair_strict_rev: "(:x, y:) \<noteq> \<bottom> \<Longrightarrow> x \<noteq> \<bottom> \<and> y \<noteq> \<bottom>" | 
| 25914 | 101 | by simp | 
| 16059 
dab0d004732f
Simplified version of strict product theory, using TypedefPcpo
 huffman parents: 
15930diff
changeset | 102 | |
| 25914 | 103 | lemma spair_defined: "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> (:x, y:) \<noteq> \<bottom>" | 
| 104 | by simp | |
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 105 | |
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 106 | lemma spair_defined_rev: "(:x, y:) = \<bottom> \<Longrightarrow> x = \<bottom> \<or> y = \<bottom>" | 
| 25914 | 107 | by simp | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 108 | |
| 40095 | 109 | lemma spair_below: | 
| 110 | "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> (:x, y:) \<sqsubseteq> (:a, b:) = (x \<sqsubseteq> a \<and> y \<sqsubseteq> b)" | |
| 111 | by (simp add: spair_below_iff) | |
| 112 | ||
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 113 | lemma spair_eq: | 
| 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 114 | "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> ((:x, y:) = (:a, b:)) = (x = a \<and> y = b)" | 
| 25914 | 115 | by (simp add: spair_eq_iff) | 
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 116 | |
| 16212 
422f836f6b39
renamed strict, defined, and inject lemmas; renamed sfst2, ssnd2 to sfst_spair, ssnd_spair
 huffman parents: 
16082diff
changeset | 117 | lemma spair_inject: | 
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 118 | "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>; (:x, y:) = (:a, b:)\<rbrakk> \<Longrightarrow> x = a \<and> y = b" | 
| 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 119 | by (rule spair_eq [THEN iffD1]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 120 | |
| 41430 
1aa23e9f2c87
change some lemma names containing 'UU' to 'bottom'
 huffman parents: 
40774diff
changeset | 121 | lemma inst_sprod_pcpo2: "\<bottom> = (:\<bottom>, \<bottom>:)" | 
| 16059 
dab0d004732f
Simplified version of strict product theory, using TypedefPcpo
 huffman parents: 
15930diff
changeset | 122 | by simp | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 123 | |
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
32960diff
changeset | 124 | lemma sprodE2: "(\<And>x y. p = (:x, y:) \<Longrightarrow> Q) \<Longrightarrow> Q" | 
| 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
32960diff
changeset | 125 | by (cases p, simp only: inst_sprod_pcpo2, simp) | 
| 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
32960diff
changeset | 126 | |
| 62175 | 127 | subsection \<open>Properties of \emph{sfst} and \emph{ssnd}\<close>
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 128 | |
| 16212 
422f836f6b39
renamed strict, defined, and inject lemmas; renamed sfst2, ssnd2 to sfst_spair, ssnd_spair
 huffman parents: 
16082diff
changeset | 129 | lemma sfst_strict [simp]: "sfst\<cdot>\<bottom> = \<bottom>" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 130 | by (simp add: sfst_def cont_Rep_sprod Rep_sprod_strict) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 131 | |
| 16212 
422f836f6b39
renamed strict, defined, and inject lemmas; renamed sfst2, ssnd2 to sfst_spair, ssnd_spair
 huffman parents: 
16082diff
changeset | 132 | lemma ssnd_strict [simp]: "ssnd\<cdot>\<bottom> = \<bottom>" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 133 | by (simp add: ssnd_def cont_Rep_sprod Rep_sprod_strict) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 134 | |
| 16212 
422f836f6b39
renamed strict, defined, and inject lemmas; renamed sfst2, ssnd2 to sfst_spair, ssnd_spair
 huffman parents: 
16082diff
changeset | 135 | lemma sfst_spair [simp]: "y \<noteq> \<bottom> \<Longrightarrow> sfst\<cdot>(:x, y:) = x" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 136 | by (simp add: sfst_def cont_Rep_sprod Rep_sprod_spair) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 137 | |
| 16212 
422f836f6b39
renamed strict, defined, and inject lemmas; renamed sfst2, ssnd2 to sfst_spair, ssnd_spair
 huffman parents: 
16082diff
changeset | 138 | lemma ssnd_spair [simp]: "x \<noteq> \<bottom> \<Longrightarrow> ssnd\<cdot>(:x, y:) = y" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 139 | by (simp add: ssnd_def cont_Rep_sprod Rep_sprod_spair) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 140 | |
| 40321 
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
 huffman parents: 
40098diff
changeset | 141 | lemma sfst_bottom_iff [simp]: "(sfst\<cdot>p = \<bottom>) = (p = \<bottom>)" | 
| 25757 
5957e3d72fec
declare sprodE as cases rule; new induction rule sprod_induct
 huffman parents: 
25135diff
changeset | 142 | by (cases p, simp_all) | 
| 16777 
555c8951f05c
added lemmas sfst_defined_iff, ssnd_defined_iff, sfst_defined, ssnd_defined
 huffman parents: 
16751diff
changeset | 143 | |
| 40321 
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
 huffman parents: 
40098diff
changeset | 144 | lemma ssnd_bottom_iff [simp]: "(ssnd\<cdot>p = \<bottom>) = (p = \<bottom>)" | 
| 25757 
5957e3d72fec
declare sprodE as cases rule; new induction rule sprod_induct
 huffman parents: 
25135diff
changeset | 145 | by (cases p, simp_all) | 
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 146 | |
| 16777 
555c8951f05c
added lemmas sfst_defined_iff, ssnd_defined_iff, sfst_defined, ssnd_defined
 huffman parents: 
16751diff
changeset | 147 | lemma sfst_defined: "p \<noteq> \<bottom> \<Longrightarrow> sfst\<cdot>p \<noteq> \<bottom>" | 
| 
555c8951f05c
added lemmas sfst_defined_iff, ssnd_defined_iff, sfst_defined, ssnd_defined
 huffman parents: 
16751diff
changeset | 148 | by simp | 
| 
555c8951f05c
added lemmas sfst_defined_iff, ssnd_defined_iff, sfst_defined, ssnd_defined
 huffman parents: 
16751diff
changeset | 149 | |
| 
555c8951f05c
added lemmas sfst_defined_iff, ssnd_defined_iff, sfst_defined, ssnd_defined
 huffman parents: 
16751diff
changeset | 150 | lemma ssnd_defined: "p \<noteq> \<bottom> \<Longrightarrow> ssnd\<cdot>p \<noteq> \<bottom>" | 
| 
555c8951f05c
added lemmas sfst_defined_iff, ssnd_defined_iff, sfst_defined, ssnd_defined
 huffman parents: 
16751diff
changeset | 151 | by simp | 
| 
555c8951f05c
added lemmas sfst_defined_iff, ssnd_defined_iff, sfst_defined, ssnd_defined
 huffman parents: 
16751diff
changeset | 152 | |
| 40094 
0295606b6a36
rename lemma surjective_pairing_Sprod2 to spair_sfst_ssnd
 huffman parents: 
40093diff
changeset | 153 | lemma spair_sfst_ssnd: "(:sfst\<cdot>p, ssnd\<cdot>p:) = p" | 
| 25757 
5957e3d72fec
declare sprodE as cases rule; new induction rule sprod_induct
 huffman parents: 
25135diff
changeset | 154 | by (cases p, simp_all) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 155 | |
| 40436 | 156 | lemma below_sprod: "(x \<sqsubseteq> y) = (sfst\<cdot>x \<sqsubseteq> sfst\<cdot>y \<and> ssnd\<cdot>x \<sqsubseteq> ssnd\<cdot>y)" | 
| 40098 
9dbb01456031
use default names sprod/Rep_sprod/Abs_sprod from pcpodef instead of Sprod/Rep_Sprod/Abs_Sprod; similarly for ssum
 huffman parents: 
40095diff
changeset | 157 | by (simp add: Rep_sprod_simps sfst_def ssnd_def cont_Rep_sprod) | 
| 16317 
868eddbcaf6e
added theorems less_sprod, spair_less, spair_eq, spair_inject
 huffman parents: 
16212diff
changeset | 158 | |
| 16751 | 159 | lemma eq_sprod: "(x = y) = (sfst\<cdot>x = sfst\<cdot>y \<and> ssnd\<cdot>x = ssnd\<cdot>y)" | 
| 31076 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
 huffman parents: 
29138diff
changeset | 160 | by (auto simp add: po_eq_conv below_sprod) | 
| 16751 | 161 | |
| 40436 | 162 | lemma sfst_below_iff: "sfst\<cdot>x \<sqsubseteq> y \<longleftrightarrow> x \<sqsubseteq> (:y, ssnd\<cdot>x:)" | 
| 25881 | 163 | apply (cases "x = \<bottom>", simp, cases "y = \<bottom>", simp) | 
| 31076 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
 huffman parents: 
29138diff
changeset | 164 | apply (simp add: below_sprod) | 
| 25881 | 165 | done | 
| 166 | ||
| 40436 | 167 | lemma ssnd_below_iff: "ssnd\<cdot>x \<sqsubseteq> y \<longleftrightarrow> x \<sqsubseteq> (:sfst\<cdot>x, y:)" | 
| 25881 | 168 | apply (cases "x = \<bottom>", simp, cases "y = \<bottom>", simp) | 
| 31076 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
 huffman parents: 
29138diff
changeset | 169 | apply (simp add: below_sprod) | 
| 25881 | 170 | done | 
| 171 | ||
| 62175 | 172 | subsection \<open>Compactness\<close> | 
| 25881 | 173 | |
| 174 | lemma compact_sfst: "compact x \<Longrightarrow> compact (sfst\<cdot>x)" | |
| 31076 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
 huffman parents: 
29138diff
changeset | 175 | by (rule compactI, simp add: sfst_below_iff) | 
| 25881 | 176 | |
| 177 | lemma compact_ssnd: "compact x \<Longrightarrow> compact (ssnd\<cdot>x)" | |
| 31076 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
 huffman parents: 
29138diff
changeset | 178 | by (rule compactI, simp add: ssnd_below_iff) | 
| 25881 | 179 | |
| 180 | lemma compact_spair: "\<lbrakk>compact x; compact y\<rbrakk> \<Longrightarrow> compact (:x, y:)" | |
| 40767 
a3e505b236e7
rename function 'strict' to 'seq', which is its name in Haskell
 huffman parents: 
40502diff
changeset | 181 | by (rule compact_sprod, simp add: Rep_sprod_spair seq_conv_if) | 
| 25881 | 182 | |
| 183 | lemma compact_spair_iff: | |
| 184 | "compact (:x, y:) = (x = \<bottom> \<or> y = \<bottom> \<or> (compact x \<and> compact y))" | |
| 185 | apply (safe elim!: compact_spair) | |
| 186 | apply (drule compact_sfst, simp) | |
| 187 | apply (drule compact_ssnd, simp) | |
| 188 | apply simp | |
| 189 | apply simp | |
| 190 | done | |
| 191 | ||
| 62175 | 192 | subsection \<open>Properties of \emph{ssplit}\<close>
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 193 | |
| 16059 
dab0d004732f
Simplified version of strict product theory, using TypedefPcpo
 huffman parents: 
15930diff
changeset | 194 | lemma ssplit1 [simp]: "ssplit\<cdot>f\<cdot>\<bottom> = \<bottom>" | 
| 15591 
50c3384ca6c4
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 195 | by (simp add: ssplit_def) | 
| 
50c3384ca6c4
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 196 | |
| 16920 | 197 | lemma ssplit2 [simp]: "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> ssplit\<cdot>f\<cdot>(:x, y:) = f\<cdot>x\<cdot>y" | 
| 15591 
50c3384ca6c4
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 198 | by (simp add: ssplit_def) | 
| 
50c3384ca6c4
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 199 | |
| 16553 | 200 | lemma ssplit3 [simp]: "ssplit\<cdot>spair\<cdot>z = z" | 
| 25757 
5957e3d72fec
declare sprodE as cases rule; new induction rule sprod_induct
 huffman parents: 
25135diff
changeset | 201 | by (cases z, simp_all) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 202 | |
| 62175 | 203 | subsection \<open>Strict product preserves flatness\<close> | 
| 25827 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25757diff
changeset | 204 | |
| 35525 | 205 | instance sprod :: (flat, flat) flat | 
| 27310 | 206 | proof | 
| 207 | fix x y :: "'a \<otimes> 'b" | |
| 208 | assume "x \<sqsubseteq> y" thus "x = \<bottom> \<or> x = y" | |
| 209 | apply (induct x, simp) | |
| 210 | apply (induct y, simp) | |
| 31076 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
 huffman parents: 
29138diff
changeset | 211 | apply (simp add: spair_below_iff flat_below_iff) | 
| 27310 | 212 | done | 
| 213 | qed | |
| 25827 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25757diff
changeset | 214 | |
| 26962 
c8b20f615d6c
use new class package for classes profinite, bifinite; remove approx class
 huffman parents: 
25914diff
changeset | 215 | end |