author | paulson |
Mon, 07 Aug 2000 10:29:54 +0200 | |
changeset 9548 | 15bee2731e43 |
parent 9495 | af1fd424941e |
child 11316 | b4e71bd751e4 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/ex/Limit |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2 |
ID: $Id$ |
1461 | 3 |
Author: Sten Agerholm |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
4 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
5 |
The inverse limit construction. |
5136 | 6 |
|
7 |
(Proofs tidied up considerably by lcp) |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
8 |
*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
9 |
|
2469 | 10 |
val nat_linear_le = [nat_into_Ord,nat_into_Ord] MRS Ord_linear_le; |
11 |
||
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
12 |
(*----------------------------------------------------------------------*) |
1461 | 13 |
(* Useful goal commands. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
14 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
15 |
|
4152 | 16 |
val brr = fn thl => fn n => by (REPEAT(ares_tac thl n)); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
17 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
18 |
(*----------------------------------------------------------------------*) |
1461 | 19 |
(* Basic results. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
20 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
21 |
|
5136 | 22 |
Goalw [set_def] "x:fst(D) ==> x:set(D)"; |
23 |
by (assume_tac 1); |
|
3425 | 24 |
qed "set_I"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
25 |
|
5136 | 26 |
Goalw [rel_def] "<x,y>:snd(D) ==> rel(D,x,y)"; |
27 |
by (assume_tac 1); |
|
3425 | 28 |
qed "rel_I"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
29 |
|
5136 | 30 |
Goalw [rel_def] "rel(D,x,y) ==> <x,y>:snd(D)"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
31 |
by (assume_tac 1); |
3425 | 32 |
qed "rel_E"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
33 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
34 |
(*----------------------------------------------------------------------*) |
1461 | 35 |
(* I/E/D rules for po and cpo. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
36 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
37 |
|
5136 | 38 |
Goalw [po_def] "[|po(D); x:set(D)|] ==> rel(D,x,x)"; |
39 |
by (Blast_tac 1); |
|
3425 | 40 |
qed "po_refl"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
41 |
|
5136 | 42 |
Goalw [po_def] "[|po(D); rel(D,x,y); rel(D,y,z); x:set(D); \ |
43 |
\ y:set(D); z:set(D)|] ==> rel(D,x,z)"; |
|
44 |
by (Blast_tac 1); |
|
3425 | 45 |
qed "po_trans"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
46 |
|
5136 | 47 |
Goalw [po_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
48 |
"[|po(D); rel(D,x,y); rel(D,y,x); x:set(D); y:set(D)|] ==> x = y"; |
5136 | 49 |
by (Blast_tac 1); |
3425 | 50 |
qed "po_antisym"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
51 |
|
5136 | 52 |
val prems = Goalw [po_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
53 |
"[| !!x. x:set(D) ==> rel(D,x,x); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
54 |
\ !!x y z. [| rel(D,x,y); rel(D,y,z); x:set(D); y:set(D); z:set(D)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
55 |
\ rel(D,x,z); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
56 |
\ !!x y. [| rel(D,x,y); rel(D,y,x); x:set(D); y:set(D)|] ==> x=y |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
57 |
\ po(D)"; |
9210 | 58 |
by (blast_tac (claset() addIs prems) 1); |
3425 | 59 |
qed "poI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
60 |
|
5136 | 61 |
val prems = Goalw [cpo_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
62 |
"[| po(D); !!X. chain(D,X) ==> islub(D,X,x(D,X))|] ==> cpo(D)"; |
9210 | 63 |
by (blast_tac (claset() addIs prems) 1); |
3425 | 64 |
qed "cpoI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
65 |
|
5136 | 66 |
Goalw [cpo_def] "cpo(D) ==> po(D)"; |
67 |
by (Blast_tac 1); |
|
3425 | 68 |
qed "cpo_po"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
69 |
|
5136 | 70 |
Goal "[|cpo(D); x:set(D)|] ==> rel(D,x,x)"; |
71 |
by (blast_tac (claset() addIs [po_refl, cpo_po]) 1); |
|
3425 | 72 |
qed "cpo_refl"; |
6158 | 73 |
|
3425 | 74 |
Addsimps [cpo_refl]; |
5136 | 75 |
AddSIs [cpo_refl]; |
6158 | 76 |
AddTCs [cpo_refl]; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
77 |
|
5136 | 78 |
Goal "[|cpo(D); rel(D,x,y); rel(D,y,z); x:set(D); \ |
79 |
\ y:set(D); z:set(D)|] ==> rel(D,x,z)"; |
|
80 |
by (blast_tac (claset() addIs [cpo_po, po_trans]) 1); |
|
3425 | 81 |
qed "cpo_trans"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
82 |
|
5136 | 83 |
Goal "[|cpo(D); rel(D,x,y); rel(D,y,x); x:set(D); y:set(D)|] ==> x = y"; |
84 |
by (blast_tac (claset() addIs [cpo_po, po_antisym]) 1); |
|
3425 | 85 |
qed "cpo_antisym"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
86 |
|
5136 | 87 |
val [cpo,chain,ex] = Goalw [cpo_def] |
2469 | 88 |
"[|cpo(D); chain(D,X); !!x. islub(D,X,x) ==> R|] ==> R"; |
1623 | 89 |
by (rtac (chain RS (cpo RS conjunct2 RS spec RS mp) RS exE) 1); |
5136 | 90 |
by (etac ex 1); |
3425 | 91 |
qed "cpo_islub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
92 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
93 |
(*----------------------------------------------------------------------*) |
1461 | 94 |
(* Theorems about isub and islub. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
95 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
96 |
|
5136 | 97 |
Goalw [islub_def] "islub(D,X,x) ==> isub(D,X,x)"; |
98 |
by (Asm_simp_tac 1); |
|
3425 | 99 |
qed "islub_isub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
100 |
|
5136 | 101 |
Goalw [islub_def,isub_def] "islub(D,X,x) ==> x:set(D)"; |
102 |
by (Asm_simp_tac 1); |
|
3425 | 103 |
qed "islub_in"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
104 |
|
5136 | 105 |
Goalw [islub_def,isub_def] "[|islub(D,X,x); n:nat|] ==> rel(D,X`n,x)"; |
106 |
by (Asm_simp_tac 1); |
|
3425 | 107 |
qed "islub_ub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
108 |
|
5136 | 109 |
Goalw [islub_def] "[|islub(D,X,x); isub(D,X,y)|] ==> rel(D,x,y)"; |
110 |
by (Blast_tac 1); |
|
3425 | 111 |
qed "islub_least"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
112 |
|
5136 | 113 |
val prems = Goalw [islub_def] (* islubI *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
114 |
"[|isub(D,X,x); !!y. isub(D,X,y) ==> rel(D,x,y)|] ==> islub(D,X,x)"; |
9210 | 115 |
by (blast_tac (claset() addIs prems) 1); |
3425 | 116 |
qed "islubI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
117 |
|
5136 | 118 |
val prems = Goalw [isub_def] (* isubI *) |
2469 | 119 |
"[|x:set(D); !!n. n:nat ==> rel(D,X`n,x)|] ==> isub(D,X,x)"; |
9210 | 120 |
by (blast_tac (claset() addIs prems) 1); |
3425 | 121 |
qed "isubI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
122 |
|
5136 | 123 |
val prems = Goalw [isub_def] (* isubE *) |
124 |
"[|isub(D,X,x); [|x:set(D); !!n. n:nat==>rel(D,X`n,x)|] ==> P \ |
|
9210 | 125 |
\ |] ==> P"; |
5136 | 126 |
by (asm_simp_tac (simpset() addsimps prems) 1); |
3425 | 127 |
qed "isubE"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
128 |
|
5136 | 129 |
Goalw [isub_def] "isub(D,X,x) ==> x:set(D)"; |
130 |
by (Asm_simp_tac 1); |
|
3425 | 131 |
qed "isubD1"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
132 |
|
5136 | 133 |
Goalw [isub_def] "[|isub(D,X,x); n:nat|]==>rel(D,X`n,x)"; |
134 |
by (Asm_simp_tac 1); |
|
3425 | 135 |
qed "isubD2"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
136 |
|
5136 | 137 |
Goal "[|islub(D,X,x); islub(D,X,y); cpo(D)|] ==> x = y"; |
138 |
by (blast_tac (claset() addIs [cpo_antisym,islub_least, |
|
9210 | 139 |
islub_isub,islub_in]) 1); |
3425 | 140 |
qed "islub_unique"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
141 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
142 |
(*----------------------------------------------------------------------*) |
1461 | 143 |
(* lub gives the least upper bound of chains. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
144 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
145 |
|
5136 | 146 |
Goalw [lub_def] "[|chain(D,X); cpo(D)|] ==> islub(D,X,lub(D,X))"; |
147 |
by (best_tac (claset() addEs [cpo_islub] addIs [theI, islub_unique]) 1); |
|
3425 | 148 |
qed "cpo_lub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
149 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
150 |
(*----------------------------------------------------------------------*) |
1461 | 151 |
(* Theorems about chains. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
152 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
153 |
|
9210 | 154 |
val prems = Goalw [chain_def] |
155 |
"[|X:nat->set(D); !!n. n:nat ==> rel(D,X`n,X`succ(n))|] ==> chain(D,X)"; |
|
156 |
by (blast_tac (claset() addIs prems) 1); |
|
157 |
qed "chainI"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
158 |
|
5136 | 159 |
Goalw [chain_def] "chain(D,X) ==> X : nat -> set(D)"; |
160 |
by (Asm_simp_tac 1); |
|
3425 | 161 |
qed "chain_fun"; |
5136 | 162 |
|
163 |
Goalw [chain_def] "[|chain(D,X); n:nat|] ==> X`n : set(D)"; |
|
164 |
by (blast_tac (claset() addDs [apply_type]) 1); |
|
3425 | 165 |
qed "chain_in"; |
5136 | 166 |
|
167 |
Goalw [chain_def] "[|chain(D,X); n:nat|] ==> rel(D, X ` n, X ` succ(n))"; |
|
168 |
by (Blast_tac 1); |
|
3425 | 169 |
qed "chain_rel"; |
5136 | 170 |
|
171 |
Addsimps [chain_in, chain_rel]; |
|
6169 | 172 |
AddTCs [chain_fun, chain_in, chain_rel]; |
5136 | 173 |
|
174 |
Goal "[|chain(D,X); cpo(D); n:nat; m:nat|] ==> rel(D,X`n,(X`(m #+ n)))"; |
|
6070 | 175 |
by (induct_tac "m" 1); |
9210 | 176 |
by (auto_tac (claset() addIs [cpo_trans], simpset())); |
3425 | 177 |
qed "chain_rel_gen_add"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
178 |
|
5136 | 179 |
Goal (* chain_rel_gen *) |
9495 | 180 |
"[|n le m; chain(D,X); cpo(D); m:nat|] ==> rel(D,X`n,X`m)"; |
181 |
by (ftac lt_nat_in_nat 1 THEN etac nat_succI 1); |
|
9210 | 182 |
by (etac rev_mp 1); (*prepare the induction*) |
6070 | 183 |
by (induct_tac "m" 1); |
9210 | 184 |
by (auto_tac (claset() addIs [cpo_trans], |
6158 | 185 |
simpset() addsimps [le_iff])); |
3425 | 186 |
qed "chain_rel_gen"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
187 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
188 |
(*----------------------------------------------------------------------*) |
1461 | 189 |
(* Theorems about pcpos and bottom. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
190 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
191 |
|
5136 | 192 |
val prems = Goalw [pcpo_def] (* pcpoI *) |
3840 | 193 |
"[|!!y. y:set(D)==>rel(D,x,y); x:set(D); cpo(D)|]==>pcpo(D)"; |
5136 | 194 |
by (auto_tac (claset() addIs prems, simpset())); |
3425 | 195 |
qed "pcpoI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
196 |
|
5136 | 197 |
Goalw [pcpo_def] "pcpo(D) ==> cpo(D)"; |
198 |
by (etac conjunct1 1); |
|
199 |
qed "pcpo_cpo"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
200 |
|
5136 | 201 |
Goalw [pcpo_def] (* pcpo_bot_ex1 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
202 |
"pcpo(D) ==> EX! x. x:set(D) & (ALL y:set(D). rel(D,x,y))"; |
5136 | 203 |
by (blast_tac (claset() addIs [cpo_antisym]) 1); |
3425 | 204 |
qed "pcpo_bot_ex1"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
205 |
|
5136 | 206 |
Goalw [bot_def] (* bot_least *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
207 |
"[| pcpo(D); y:set(D)|] ==> rel(D,bot(D),y)"; |
5136 | 208 |
by (best_tac (claset() addIs [pcpo_bot_ex1 RS theI2]) 1); |
3425 | 209 |
qed "bot_least"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
210 |
|
5136 | 211 |
Goalw [bot_def] (* bot_in *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
212 |
"pcpo(D) ==> bot(D):set(D)"; |
5136 | 213 |
by (best_tac (claset() addIs [pcpo_bot_ex1 RS theI2]) 1); |
3425 | 214 |
qed "bot_in"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
215 |
|
6158 | 216 |
AddTCs [pcpo_cpo, bot_least, bot_in]; |
217 |
||
9264 | 218 |
val prems = Goal (* bot_unique *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
219 |
"[| pcpo(D); x:set(D); !!y. y:set(D) ==> rel(D,x,y)|] ==> x = bot(D)"; |
9210 | 220 |
by (blast_tac (claset() addIs ([cpo_antisym,pcpo_cpo,bot_in,bot_least]@ |
221 |
prems)) 1); |
|
3425 | 222 |
qed "bot_unique"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
223 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
224 |
(*----------------------------------------------------------------------*) |
1461 | 225 |
(* Constant chains and lubs and cpos. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
226 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
227 |
|
5136 | 228 |
Goalw [chain_def] "[|x:set(D); cpo(D)|] ==> chain(D,(lam n:nat. x))"; |
229 |
by (asm_simp_tac (simpset() addsimps [lam_type, nat_succI]) 1); |
|
3425 | 230 |
qed "chain_const"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
231 |
|
5136 | 232 |
Goalw [islub_def,isub_def] |
233 |
"[|x:set(D); cpo(D)|] ==> islub(D,(lam n:nat. x),x)"; |
|
3425 | 234 |
by (Asm_simp_tac 1); |
235 |
by (Blast_tac 1); |
|
236 |
qed "islub_const"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
237 |
|
5136 | 238 |
Goal "[|x:set(D); cpo(D)|] ==> lub(D,lam n:nat. x) = x"; |
239 |
by (blast_tac (claset() addIs [islub_unique, cpo_lub, |
|
240 |
chain_const, islub_const]) 1); |
|
3425 | 241 |
qed "lub_const"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
242 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
243 |
(*----------------------------------------------------------------------*) |
1461 | 244 |
(* Taking the suffix of chains has no effect on ub's. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
245 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
246 |
|
5136 | 247 |
Goalw [isub_def,suffix_def] (* isub_suffix *) |
9495 | 248 |
"[| chain(D,X); cpo(D) |] ==> isub(D,suffix(X,n),x) <-> isub(D,X,x)"; |
249 |
by Safe_tac; |
|
250 |
by (dres_inst_tac [("x","na")] bspec 1); |
|
9210 | 251 |
by (auto_tac (claset() addIs [cpo_trans, chain_rel_gen_add], simpset())); |
3425 | 252 |
qed "isub_suffix"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
253 |
|
5136 | 254 |
Goalw [islub_def] (* islub_suffix *) |
9495 | 255 |
"[|chain(D,X); cpo(D)|] ==> islub(D,suffix(X,n),x) <-> islub(D,X,x)"; |
5136 | 256 |
by (asm_simp_tac (simpset() addsimps [isub_suffix]) 1); |
3425 | 257 |
qed "islub_suffix"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
258 |
|
5136 | 259 |
Goalw [lub_def] (* lub_suffix *) |
9495 | 260 |
"[|chain(D,X); cpo(D)|] ==> lub(D,suffix(X,n)) = lub(D,X)"; |
5136 | 261 |
by (asm_simp_tac (simpset() addsimps [islub_suffix]) 1); |
3425 | 262 |
qed "lub_suffix"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
263 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
264 |
(*----------------------------------------------------------------------*) |
1461 | 265 |
(* Dominate and subchain. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
266 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
267 |
|
9210 | 268 |
val prems = Goalw [dominate_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
269 |
"[| !!m. m:nat ==> n(m):nat; !!m. m:nat ==> rel(D,X`m,Y`n(m))|] ==> \ |
9210 | 270 |
\ dominate(D,X,Y)"; |
271 |
by (blast_tac (claset() addIs prems) 1); |
|
272 |
qed "dominateI"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
273 |
|
9210 | 274 |
Goalw [isub_def, dominate_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
275 |
"[|dominate(D,X,Y); isub(D,Y,x); cpo(D); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
276 |
\ X:nat->set(D); Y:nat->set(D)|] ==> isub(D,X,x)"; |
9495 | 277 |
by (Asm_full_simp_tac 1); |
278 |
by (blast_tac (claset() addIs [cpo_trans] addSIs [apply_funtype]) 1); |
|
3425 | 279 |
qed "dominate_isub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
280 |
|
9210 | 281 |
Goalw [islub_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
282 |
"[|dominate(D,X,Y); islub(D,X,x); islub(D,Y,y); cpo(D); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
283 |
\ X:nat->set(D); Y:nat->set(D)|] ==> rel(D,x,y)"; |
9210 | 284 |
by (blast_tac (claset() addIs [dominate_isub]) 1); |
3425 | 285 |
qed "dominate_islub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
286 |
|
9210 | 287 |
Goalw [isub_def, subchain_def] |
288 |
"[|subchain(Y,X); isub(D,X,x)|] ==> isub(D,Y,x)"; |
|
9495 | 289 |
by (Force_tac 1); |
3425 | 290 |
qed "subchain_isub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
291 |
|
5268 | 292 |
Goal "[|dominate(D,X,Y); subchain(Y,X); islub(D,X,x); islub(D,Y,y); cpo(D); \ |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
293 |
\ X:nat->set(D); Y:nat->set(D)|] ==> x = y"; |
5136 | 294 |
by (blast_tac (claset() addIs [cpo_antisym, dominate_islub, islub_least, |
295 |
subchain_isub, islub_isub, islub_in]) 1); |
|
3425 | 296 |
qed "dominate_islub_eq"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
297 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
298 |
(*----------------------------------------------------------------------*) |
1461 | 299 |
(* Matrix. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
300 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
301 |
|
5136 | 302 |
Goalw [matrix_def] (* matrix_fun *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
303 |
"matrix(D,M) ==> M : nat -> (nat -> set(D))"; |
5136 | 304 |
by (Asm_simp_tac 1); |
3425 | 305 |
qed "matrix_fun"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
306 |
|
5136 | 307 |
Goal "[|matrix(D,M); n:nat|] ==> M`n : nat -> set(D)"; |
308 |
by (blast_tac (claset() addIs [apply_funtype, matrix_fun]) 1); |
|
3425 | 309 |
qed "matrix_in_fun"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
310 |
|
5136 | 311 |
Goal "[|matrix(D,M); n:nat; m:nat|] ==> M`n`m : set(D)"; |
9210 | 312 |
by (blast_tac (claset() addIs [apply_funtype, matrix_in_fun]) 1); |
3425 | 313 |
qed "matrix_in"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
314 |
|
5136 | 315 |
Goalw [matrix_def] (* matrix_rel_1_0 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
316 |
"[|matrix(D,M); n:nat; m:nat|] ==> rel(D,M`n`m,M`succ(n)`m)"; |
5136 | 317 |
by (Asm_simp_tac 1); |
3425 | 318 |
qed "matrix_rel_1_0"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
319 |
|
5136 | 320 |
Goalw [matrix_def] (* matrix_rel_0_1 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
321 |
"[|matrix(D,M); n:nat; m:nat|] ==> rel(D,M`n`m,M`n`succ(m))"; |
5136 | 322 |
by (Asm_simp_tac 1); |
3425 | 323 |
qed "matrix_rel_0_1"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
324 |
|
5136 | 325 |
Goalw [matrix_def] (* matrix_rel_1_1 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
326 |
"[|matrix(D,M); n:nat; m:nat|] ==> rel(D,M`n`m,M`succ(n)`succ(m))"; |
5136 | 327 |
by (Asm_simp_tac 1); |
3425 | 328 |
qed "matrix_rel_1_1"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
329 |
|
5136 | 330 |
Goal "f:X->Y->Z ==> (lam y:Y. lam x:X. f`x`y):Y->X->Z"; |
331 |
by (blast_tac (claset() addIs [lam_type, apply_funtype]) 1); |
|
3425 | 332 |
qed "fun_swap"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
333 |
|
5136 | 334 |
Goalw [matrix_def] (* matrix_sym_axis *) |
335 |
"matrix(D,M) ==> matrix(D,lam m:nat. lam n:nat. M`n`m)"; |
|
336 |
by (asm_simp_tac (simpset() addsimps [fun_swap]) 1); |
|
3425 | 337 |
qed "matrix_sym_axis"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
338 |
|
5136 | 339 |
Goalw [chain_def] (* matrix_chain_diag *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
340 |
"matrix(D,M) ==> chain(D,lam n:nat. M`n`n)"; |
9210 | 341 |
by (auto_tac (claset() addIs [lam_type, matrix_in, matrix_rel_1_1], |
342 |
simpset())); |
|
3425 | 343 |
qed "matrix_chain_diag"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
344 |
|
5136 | 345 |
Goalw [chain_def] (* matrix_chain_left *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
346 |
"[|matrix(D,M); n:nat|] ==> chain(D,M`n)"; |
9210 | 347 |
by (auto_tac (claset() addIs [matrix_fun RS apply_type, matrix_in, |
348 |
matrix_rel_0_1], simpset())); |
|
3425 | 349 |
qed "matrix_chain_left"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
350 |
|
5136 | 351 |
Goalw [chain_def] (* matrix_chain_right *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
352 |
"[|matrix(D,M); m:nat|] ==> chain(D,lam n:nat. M`n`m)"; |
5136 | 353 |
by (auto_tac (claset() addIs [lam_type,matrix_in,matrix_rel_1_0], |
354 |
simpset())); |
|
3425 | 355 |
qed "matrix_chain_right"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
356 |
|
6169 | 357 |
val xprem::yprem::prems = Goalw [matrix_def] (* matrix_chainI *) |
3840 | 358 |
"[|!!x. x:nat==>chain(D,M`x); !!y. y:nat==>chain(D,lam x:nat. M`x`y); \ |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
359 |
\ M:nat->nat->set(D); cpo(D)|] ==> matrix(D,M)"; |
6169 | 360 |
by Safe_tac; |
361 |
by (cut_inst_tac[("y1","m"),("n","n")] (yprem RS chain_rel) 2); |
|
2469 | 362 |
by (Asm_full_simp_tac 4); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
363 |
by (rtac cpo_trans 5); |
6169 | 364 |
by (cut_inst_tac[("y1","m"),("n","n")] (yprem RS chain_rel) 6); |
2469 | 365 |
by (Asm_full_simp_tac 8); |
6169 | 366 |
by (typecheck_tac (tcset() addTCs (chain_fun RS apply_type):: |
367 |
xprem::yprem::prems)); |
|
3425 | 368 |
qed "matrix_chainI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
369 |
|
9264 | 370 |
Goal "[|m : nat; rel(D, (lam n:nat. M`n`n)`m, y)|] ==> rel(D,M`m`m, y)"; |
371 |
by (Asm_full_simp_tac 1); |
|
372 |
qed "lemma"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
373 |
|
9264 | 374 |
Goal "[|x:nat; m:nat; rel(D,(lam n:nat. M`n`m1)`x,(lam n:nat. M`n`m1)`m)|] \ |
375 |
\ ==> rel(D,M`x`m1,M`m`m1)"; |
|
376 |
by (Asm_full_simp_tac 1); |
|
377 |
qed "lemma2"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
378 |
|
5136 | 379 |
Goalw [isub_def] (* isub_lemma *) |
380 |
"[|isub(D, lam n:nat. M`n`n, y); matrix(D,M); cpo(D)|] ==> \ |
|
381 |
\ isub(D, lam n:nat. lub(D,lam m:nat. M`n`m), y)"; |
|
4152 | 382 |
by Safe_tac; |
2469 | 383 |
by (Asm_simp_tac 1); |
5136 | 384 |
by (forward_tac [matrix_fun RS apply_type] 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
385 |
by (assume_tac 1); |
2469 | 386 |
by (Asm_simp_tac 1); |
5136 | 387 |
by (rtac (matrix_chain_left RS cpo_lub RS islub_least) 1); |
388 |
by (REPEAT (assume_tac 1)); |
|
1623 | 389 |
by (rewtac isub_def); |
4152 | 390 |
by Safe_tac; |
5136 | 391 |
by (excluded_middle_tac "n le na" 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
392 |
by (rtac cpo_trans 1); |
5136 | 393 |
by (assume_tac 1); |
1623 | 394 |
by (rtac (not_le_iff_lt RS iffD1 RS leI RS chain_rel_gen) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
395 |
by (assume_tac 3); |
5136 | 396 |
by (REPEAT(ares_tac [nat_into_Ord,matrix_chain_left] 1)); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
397 |
by (rtac lemma 1); |
5136 | 398 |
by (assume_tac 1); |
399 |
by (Blast_tac 1); |
|
400 |
by (REPEAT(ares_tac [matrix_in] 1)); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
401 |
by (rtac cpo_trans 1); |
5136 | 402 |
by (assume_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
403 |
by (rtac lemma2 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
404 |
by (rtac lemma 4); |
5136 | 405 |
by (Blast_tac 5); |
406 |
by (REPEAT(ares_tac [chain_rel_gen,matrix_chain_right,matrix_in,isubD1] 1)); |
|
3425 | 407 |
qed "isub_lemma"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
408 |
|
5136 | 409 |
Goalw [chain_def] (* matrix_chain_lub *) |
3840 | 410 |
"[|matrix(D,M); cpo(D)|] ==> chain(D,lam n:nat. lub(D,lam m:nat. M`n`m))"; |
4152 | 411 |
by Safe_tac; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
412 |
by (rtac lam_type 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
413 |
by (rtac islub_in 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
414 |
by (rtac cpo_lub 1); |
5136 | 415 |
by (assume_tac 2); |
2469 | 416 |
by (Asm_simp_tac 2); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
417 |
by (rtac chainI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
418 |
by (rtac lam_type 1); |
5136 | 419 |
by (REPEAT(ares_tac [matrix_in] 1)); |
2469 | 420 |
by (Asm_simp_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
421 |
by (rtac matrix_rel_0_1 1); |
5136 | 422 |
by (REPEAT(assume_tac 1)); |
4091 | 423 |
by (asm_simp_tac (simpset() addsimps |
5136 | 424 |
[matrix_chain_left RS chain_fun RS eta]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
425 |
by (rtac dominate_islub 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
426 |
by (rtac cpo_lub 3); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
427 |
by (rtac cpo_lub 2); |
1623 | 428 |
by (rewtac dominate_def); |
5136 | 429 |
by (REPEAT(ares_tac [matrix_chain_left,nat_succI,chain_fun] 2)); |
430 |
by (blast_tac (claset() addIs [matrix_rel_1_0]) 1); |
|
3425 | 431 |
qed "matrix_chain_lub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
432 |
|
5136 | 433 |
Goal (* isub_eq *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
434 |
"[|matrix(D,M); cpo(D)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
435 |
\ isub(D,(lam n:nat. lub(D,lam m:nat. M`n`m)),y) <-> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
436 |
\ isub(D,(lam n:nat. M`n`n),y)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
437 |
by (rtac iffI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
438 |
by (rtac dominate_isub 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
439 |
by (assume_tac 2); |
1623 | 440 |
by (rewtac dominate_def); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
441 |
by (rtac ballI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
442 |
by (rtac bexI 1); |
9210 | 443 |
by Auto_tac; |
4091 | 444 |
by (asm_simp_tac (simpset() addsimps |
5136 | 445 |
[matrix_chain_left RS chain_fun RS eta]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
446 |
by (rtac islub_ub 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
447 |
by (rtac cpo_lub 1); |
9210 | 448 |
by (REPEAT(ares_tac [matrix_chain_left,matrix_chain_diag,chain_fun, |
449 |
matrix_chain_lub, isub_lemma] 1)); |
|
3425 | 450 |
qed "isub_eq"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
451 |
|
9210 | 452 |
Goalw [lub_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
453 |
"lub(D,(lam n:nat. lub(D,lam m:nat. M`n`m))) = \ |
9210 | 454 |
\ (THE x. islub(D, (lam n:nat. lub(D,lam m:nat. M`n`m)), x))"; |
455 |
by (Blast_tac 1); |
|
456 |
qed "lemma1"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
457 |
|
9210 | 458 |
Goalw [lub_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
459 |
"lub(D,(lam n:nat. M`n`n)) = \ |
9210 | 460 |
\ (THE x. islub(D, (lam n:nat. M`n`n), x))"; |
461 |
by (Blast_tac 1); |
|
462 |
qed "lemma2"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
463 |
|
5136 | 464 |
Goal (* lub_matrix_diag *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
465 |
"[|matrix(D,M); cpo(D)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
466 |
\ lub(D,(lam n:nat. lub(D,lam m:nat. M`n`m))) = \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
467 |
\ lub(D,(lam n:nat. M`n`n))"; |
4091 | 468 |
by (simp_tac (simpset() addsimps [lemma1,lemma2]) 1); |
9210 | 469 |
by (asm_simp_tac (simpset() addsimps [islub_def, isub_eq]) 1); |
3425 | 470 |
qed "lub_matrix_diag"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
471 |
|
5136 | 472 |
Goal (* lub_matrix_diag_sym *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
473 |
"[|matrix(D,M); cpo(D)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
474 |
\ lub(D,(lam m:nat. lub(D,lam n:nat. M`n`m))) = \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
475 |
\ lub(D,(lam n:nat. M`n`n))"; |
5136 | 476 |
by (dtac (matrix_sym_axis RS lub_matrix_diag) 1); |
477 |
by Auto_tac; |
|
3425 | 478 |
qed "lub_matrix_diag_sym"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
479 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
480 |
(*----------------------------------------------------------------------*) |
1461 | 481 |
(* I/E/D rules for mono and cont. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
482 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
483 |
|
5136 | 484 |
val prems = Goalw [mono_def] (* monoI *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
485 |
"[|f:set(D)->set(E); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
486 |
\ !!x y. [|rel(D,x,y); x:set(D); y:set(D)|] ==> rel(E,f`x,f`y)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
487 |
\ f:mono(D,E)"; |
5136 | 488 |
by (blast_tac(claset() addSIs prems) 1); |
3425 | 489 |
qed "monoI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
490 |
|
5136 | 491 |
Goalw [mono_def] "f:mono(D,E) ==> f:set(D)->set(E)"; |
492 |
by (Fast_tac 1); |
|
3425 | 493 |
qed "mono_fun"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
494 |
|
5136 | 495 |
Goal "[|f:mono(D,E); x:set(D)|] ==> f`x:set(E)"; |
496 |
by (blast_tac(claset() addSIs [mono_fun RS apply_type]) 1); |
|
3425 | 497 |
qed "mono_map"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
498 |
|
5136 | 499 |
Goalw [mono_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
500 |
"[|f:mono(D,E); rel(D,x,y); x:set(D); y:set(D)|] ==> rel(E,f`x,f`y)"; |
5136 | 501 |
by (Blast_tac 1); |
3425 | 502 |
qed "mono_mono"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
503 |
|
5136 | 504 |
val prems = Goalw [cont_def,mono_def] (* contI *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
505 |
"[|f:set(D)->set(E); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
506 |
\ !!x y. [|rel(D,x,y); x:set(D); y:set(D)|] ==> rel(E,f`x,f`y); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
507 |
\ !!X. chain(D,X) ==> f`lub(D,X) = lub(E,lam n:nat. f`(X`n))|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
508 |
\ f:cont(D,E)"; |
4091 | 509 |
by (fast_tac(claset() addSIs prems) 1); |
3425 | 510 |
qed "contI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
511 |
|
5136 | 512 |
Goalw [cont_def] "f:cont(D,E) ==> f:mono(D,E)"; |
513 |
by (Blast_tac 1); |
|
3425 | 514 |
qed "cont2mono"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
515 |
|
6169 | 516 |
Goalw [cont_def] "f:cont(D,E) ==> f:set(D)->set(E)"; |
5136 | 517 |
by (rtac mono_fun 1); |
518 |
by (Blast_tac 1); |
|
3425 | 519 |
qed "cont_fun"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
520 |
|
5136 | 521 |
Goal "[|f:cont(D,E); x:set(D)|] ==> f`x:set(E)"; |
522 |
by (blast_tac(claset() addSIs [cont_fun RS apply_type]) 1); |
|
3425 | 523 |
qed "cont_map"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
524 |
|
6169 | 525 |
AddTCs [comp_fun, cont_fun, cont_map]; |
526 |
||
5136 | 527 |
Goalw [cont_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
528 |
"[|f:cont(D,E); rel(D,x,y); x:set(D); y:set(D)|] ==> rel(E,f`x,f`y)"; |
5136 | 529 |
by (blast_tac(claset() addSIs [mono_mono]) 1); |
3425 | 530 |
qed "cont_mono"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
531 |
|
5136 | 532 |
Goalw [cont_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
533 |
"[|f:cont(D,E); chain(D,X)|] ==> f`(lub(D,X)) = lub(E,lam n:nat. f`(X`n))"; |
5136 | 534 |
by (Blast_tac 1); |
3425 | 535 |
qed "cont_lub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
536 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
537 |
(*----------------------------------------------------------------------*) |
1461 | 538 |
(* Continuity and chains. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
539 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
540 |
|
5136 | 541 |
Goal "[|f:mono(D,E); chain(D,X)|] ==> chain(E,lam n:nat. f`(X`n))"; |
542 |
by (simp_tac (simpset() addsimps [chain_def]) 1); |
|
543 |
by (blast_tac(claset() addIs [lam_type, mono_map, chain_in, |
|
544 |
mono_mono, chain_rel]) 1); |
|
3425 | 545 |
qed "mono_chain"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
546 |
|
5136 | 547 |
Goal "[|f:cont(D,E); chain(D,X)|] ==> chain(E,lam n:nat. f`(X`n))"; |
548 |
by (blast_tac(claset() addIs [mono_chain, cont2mono]) 1); |
|
3425 | 549 |
qed "cont_chain"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
550 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
551 |
(*----------------------------------------------------------------------*) |
1461 | 552 |
(* I/E/D rules about (set+rel) cf, the continuous function space. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
553 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
554 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
555 |
(* The following development more difficult with cpo-as-relation approach. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
556 |
|
5136 | 557 |
Goalw [set_def,cf_def] "f:set(cf(D,E)) ==> f:cont(D,E)"; |
2469 | 558 |
by (Asm_full_simp_tac 1); |
3425 | 559 |
qed "cf_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
560 |
|
5136 | 561 |
Goalw [set_def,cf_def] (* Non-trivial with relation *) |
562 |
"f:cont(D,E) ==> f:set(cf(D,E))"; |
|
2469 | 563 |
by (Asm_full_simp_tac 1); |
3425 | 564 |
qed "cont_cf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
565 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
566 |
(* rel_cf originally an equality. Now stated as two rules. Seemed easiest. |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
567 |
Besides, now complicated by typing assumptions. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
568 |
|
9264 | 569 |
val prems = Goal |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
570 |
"[|!!x. x:set(D) ==> rel(E,f`x,g`x); f:cont(D,E); g:cont(D,E)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
571 |
\ rel(cf(D,E),f,g)"; |
9210 | 572 |
by (asm_simp_tac (simpset() addsimps [rel_I, cf_def]@prems) 1); |
3425 | 573 |
qed "rel_cfI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
574 |
|
5136 | 575 |
Goalw [rel_def,cf_def] "[|rel(cf(D,E),f,g); x:set(D)|] ==> rel(E,f`x,g`x)"; |
2469 | 576 |
by (Asm_full_simp_tac 1); |
3425 | 577 |
qed "rel_cf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
578 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
579 |
(*----------------------------------------------------------------------*) |
1461 | 580 |
(* Theorems about the continuous function space. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
581 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
582 |
|
5136 | 583 |
Goal (* chain_cf *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
584 |
"[| chain(cf(D,E),X); x:set(D)|] ==> chain(E,lam n:nat. X`n`x)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
585 |
by (rtac chainI 1); |
9210 | 586 |
by (blast_tac (claset() addIs [lam_type, apply_funtype, cont_fun, |
587 |
cf_cont,chain_in]) 1); |
|
2469 | 588 |
by (Asm_simp_tac 1); |
9210 | 589 |
by (blast_tac (claset() addIs [rel_cf,chain_rel]) 1); |
3425 | 590 |
qed "chain_cf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
591 |
|
5136 | 592 |
Goal (* matrix_lemma *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
593 |
"[|chain(cf(D,E),X); chain(D,Xa); cpo(D); cpo(E) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
594 |
\ matrix(E,lam x:nat. lam xa:nat. X`x`(Xa`xa))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
595 |
by (rtac matrix_chainI 1); |
9210 | 596 |
by Auto_tac; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
597 |
by (rtac chainI 1); |
9210 | 598 |
by (blast_tac (claset() addIs [lam_type, apply_funtype, cont_fun, |
599 |
cf_cont,chain_in]) 1); |
|
2469 | 600 |
by (Asm_simp_tac 1); |
9210 | 601 |
by (blast_tac (claset() addIs [cont_mono, nat_succI, chain_rel, |
602 |
cf_cont,chain_in]) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
603 |
by (rtac chainI 1); |
9210 | 604 |
by (blast_tac (claset() addIs [lam_type, apply_funtype, cont_fun, |
605 |
cf_cont,chain_in]) 1); |
|
2469 | 606 |
by (Asm_simp_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
607 |
by (rtac rel_cf 1); |
5136 | 608 |
brr [chain_in,chain_rel] 1; |
9210 | 609 |
by (blast_tac (claset() addIs [lam_type, apply_funtype, cont_fun, |
610 |
cf_cont,chain_in]) 1); |
|
3425 | 611 |
qed "matrix_lemma"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
612 |
|
5136 | 613 |
Goal (* chain_cf_lub_cont *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
614 |
"[|chain(cf(D,E),X); cpo(D); cpo(E) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
615 |
\ (lam x:set(D). lub(E, lam n:nat. X ` n ` x)) : cont(D, E)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
616 |
by (rtac contI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
617 |
by (rtac lam_type 1); |
5136 | 618 |
by (REPEAT(ares_tac[chain_cf RS cpo_lub RS islub_in] 1)); |
2469 | 619 |
by (Asm_simp_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
620 |
by (rtac dominate_islub 1); |
5136 | 621 |
by (REPEAT(ares_tac[chain_cf RS cpo_lub] 2)); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
622 |
by (rtac dominateI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
623 |
by (assume_tac 1); |
2469 | 624 |
by (Asm_simp_tac 1); |
5136 | 625 |
by (REPEAT(ares_tac [chain_in RS cf_cont RS cont_mono] 1)); |
626 |
by (REPEAT(ares_tac [chain_cf RS chain_fun] 1)); |
|
2034 | 627 |
by (stac beta 1); |
5136 | 628 |
by (REPEAT(ares_tac [cpo_lub RS islub_in] 1)); |
629 |
by (asm_simp_tac(simpset() addsimps[chain_in RS cf_cont RS cont_lub]) 1); |
|
630 |
by (forward_tac[matrix_lemma RS lub_matrix_diag]1); |
|
631 |
by (REPEAT (assume_tac 1)); |
|
9210 | 632 |
by (asm_full_simp_tac(simpset() addsimps[chain_in RS beta]) 1); |
5136 | 633 |
by (dtac (matrix_lemma RS lub_matrix_diag_sym) 1); |
6169 | 634 |
by Auto_tac; |
3425 | 635 |
qed "chain_cf_lub_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
636 |
|
5136 | 637 |
Goal (* islub_cf *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
638 |
"[| chain(cf(D,E),X); cpo(D); cpo(E)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
639 |
\ islub(cf(D,E), X, lam x:set(D). lub(E,lam n:nat. X`n`x))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
640 |
by (rtac islubI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
641 |
by (rtac isubI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
642 |
by (rtac (chain_cf_lub_cont RS cont_cf) 1); |
5136 | 643 |
by (REPEAT (assume_tac 1)); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
644 |
by (rtac rel_cfI 1); |
5136 | 645 |
by (fast_tac (claset() addSDs [chain_cf RS cpo_lub RS islub_ub] |
646 |
addss simpset()) 1); |
|
647 |
by (blast_tac (claset() addIs [cf_cont,chain_in]) 1); |
|
648 |
by (blast_tac (claset() addIs [cont_cf,chain_cf_lub_cont]) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
649 |
by (rtac rel_cfI 1); |
2469 | 650 |
by (Asm_simp_tac 1); |
5136 | 651 |
by (REPEAT (blast_tac (claset() addIs [chain_cf_lub_cont,isubD1,cf_cont]) 2)); |
652 |
by (best_tac (claset() addIs [chain_cf RS cpo_lub RS islub_least, |
|
653 |
cf_cont RS cont_fun RS apply_type, isubI] |
|
654 |
addEs [isubD2 RS rel_cf, isubD1] |
|
655 |
addss simpset()) 1); |
|
3425 | 656 |
qed "islub_cf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
657 |
|
5136 | 658 |
Goal (* cpo_cf *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
659 |
"[| cpo(D); cpo(E)|] ==> cpo(cf(D,E))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
660 |
by (rtac (poI RS cpoI) 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
661 |
by (rtac rel_cfI 1); |
5136 | 662 |
brr[cpo_refl, cf_cont RS cont_fun RS apply_type, cf_cont] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
663 |
by (rtac rel_cfI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
664 |
by (rtac cpo_trans 1); |
5136 | 665 |
by (assume_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
666 |
by (etac rel_cf 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
667 |
by (assume_tac 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
668 |
by (rtac rel_cf 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
669 |
by (assume_tac 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
670 |
brr[cf_cont RS cont_fun RS apply_type,cf_cont]1; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
671 |
by (rtac fun_extension 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
672 |
brr[cf_cont RS cont_fun]1; |
5136 | 673 |
by (fast_tac (claset() addIs [islub_cf]) 2); |
674 |
by (blast_tac (claset() addIs [cpo_antisym,rel_cf, |
|
675 |
cf_cont RS cont_fun RS apply_type]) 1); |
|
676 |
||
3425 | 677 |
qed "cpo_cf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
678 |
|
6158 | 679 |
AddTCs [cpo_cf]; |
680 |
||
5136 | 681 |
Goal "[| chain(cf(D,E),X); cpo(D); cpo(E)|] ==> \ |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
682 |
\ lub(cf(D,E), X) = (lam x:set(D). lub(E,lam n:nat. X`n`x))"; |
5136 | 683 |
by (blast_tac (claset() addIs [islub_unique,cpo_lub,islub_cf,cpo_cf]) 1); |
3425 | 684 |
qed "lub_cf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
685 |
|
5136 | 686 |
Goal "[|y:set(E); cpo(D); cpo(E)|] ==> (lam x:set(D).y) : cont(D,E)"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
687 |
by (rtac contI 1); |
2469 | 688 |
by (Asm_simp_tac 2); |
5136 | 689 |
by (blast_tac (claset() addIs [lam_type]) 1); |
690 |
by (asm_simp_tac(simpset() addsimps [chain_in, cpo_lub RS islub_in, |
|
691 |
lub_const]) 1); |
|
3425 | 692 |
qed "const_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
693 |
|
5136 | 694 |
Goal "[|cpo(D); pcpo(E); y:cont(D,E)|]==>rel(cf(D,E),(lam x:set(D).bot(E)),y)"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
695 |
by (rtac rel_cfI 1); |
2469 | 696 |
by (Asm_simp_tac 1); |
6169 | 697 |
by (ALLGOALS (type_solver_tac (tcset() addTCs [cont_fun, const_cont]) [])); |
3425 | 698 |
qed "cf_least"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
699 |
|
5136 | 700 |
Goal (* pcpo_cf *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
701 |
"[|cpo(D); pcpo(E)|] ==> pcpo(cf(D,E))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
702 |
by (rtac pcpoI 1); |
5136 | 703 |
brr[cf_least, bot_in, const_cont RS cont_cf, cf_cont, cpo_cf, pcpo_cpo] 1; |
3425 | 704 |
qed "pcpo_cf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
705 |
|
5136 | 706 |
Goal (* bot_cf *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
707 |
"[|cpo(D); pcpo(E)|] ==> bot(cf(D,E)) = (lam x:set(D).bot(E))"; |
9210 | 708 |
by (blast_tac (claset() addIs [bot_unique RS sym, pcpo_cf, cf_least, |
709 |
bot_in RS const_cont RS cont_cf, cf_cont, pcpo_cpo])1); |
|
3425 | 710 |
qed "bot_cf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
711 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
712 |
(*----------------------------------------------------------------------*) |
1461 | 713 |
(* Identity and composition. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
714 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
715 |
|
5136 | 716 |
Goal (* id_cont *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
717 |
"cpo(D) ==> id(set(D)):cont(D,D)"; |
6169 | 718 |
by (asm_simp_tac(simpset() addsimps[id_type, contI, cpo_lub RS islub_in, |
719 |
chain_fun RS eta]) 1); |
|
3425 | 720 |
qed "id_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
721 |
|
6153 | 722 |
AddTCs [id_cont]; |
723 |
||
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
724 |
val comp_cont_apply = cont_fun RSN(2,cont_fun RS comp_fun_apply); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
725 |
|
5136 | 726 |
Goal (* comp_pres_cont *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
727 |
"[| f:cont(D',E); g:cont(D,D'); cpo(D)|] ==> f O g : cont(D,E)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
728 |
by (rtac contI 1); |
2034 | 729 |
by (stac comp_cont_apply 2); |
730 |
by (stac comp_cont_apply 5); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
731 |
by (rtac cont_mono 8); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
732 |
by (rtac cont_mono 9); (* 15 subgoals *) |
6169 | 733 |
by Typecheck_tac; (* proves all but the lub case *) |
2034 | 734 |
by (stac comp_cont_apply 1); |
735 |
by (stac cont_lub 4); |
|
736 |
by (stac cont_lub 6); |
|
5136 | 737 |
by (asm_full_simp_tac(simpset() addsimps [comp_cont_apply,chain_in]) 8); |
738 |
by (auto_tac (claset() addIs [cpo_lub RS islub_in, cont_chain], simpset())); |
|
3425 | 739 |
qed "comp_pres_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
740 |
|
6153 | 741 |
AddTCs [comp_pres_cont]; |
742 |
||
5136 | 743 |
Goal (* comp_mono *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
744 |
"[| f:cont(D',E); g:cont(D,D'); f':cont(D',E); g':cont(D,D'); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
745 |
\ rel(cf(D',E),f,f'); rel(cf(D,D'),g,g'); cpo(D); cpo(E) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
746 |
\ rel(cf(D,E),f O g,f' O g')"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
747 |
by (rtac rel_cfI 1); (* extra proof obl: f O g and f' O g' cont. Extra asm cpo(D). *) |
2034 | 748 |
by (stac comp_cont_apply 1); |
749 |
by (stac comp_cont_apply 4); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
750 |
by (rtac cpo_trans 7); |
5136 | 751 |
by (REPEAT (ares_tac [rel_cf,cont_mono,cont_map,comp_pres_cont] 1)); |
3425 | 752 |
qed "comp_mono"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
753 |
|
5136 | 754 |
Goal (* chain_cf_comp *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
755 |
"[| chain(cf(D',E),X); chain(cf(D,D'),Y); cpo(D); cpo(E)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
756 |
\ chain(cf(D,E),lam n:nat. X`n O Y`n)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
757 |
by (rtac chainI 1); |
2469 | 758 |
by (Asm_simp_tac 2); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
759 |
by (rtac rel_cfI 2); |
2034 | 760 |
by (stac comp_cont_apply 2); |
761 |
by (stac comp_cont_apply 5); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
762 |
by (rtac cpo_trans 8); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
763 |
by (rtac rel_cf 9); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
764 |
by (rtac cont_mono 11); |
5136 | 765 |
brr[lam_type, comp_pres_cont, cont_cf, chain_in RS cf_cont, cont_map, chain_rel,rel_cf,nat_succI] 1; |
3425 | 766 |
qed "chain_cf_comp"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
767 |
|
5136 | 768 |
Goal (* comp_lubs *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
769 |
"[| chain(cf(D',E),X); chain(cf(D,D'),Y); cpo(D); cpo(D'); cpo(E)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
770 |
\ lub(cf(D',E),X) O lub(cf(D,D'),Y) = lub(cf(D,E),lam n:nat. X`n O Y`n)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
771 |
by (rtac fun_extension 1); |
2034 | 772 |
by (stac lub_cf 3); |
5136 | 773 |
brr[comp_fun, cf_cont RS cont_fun, cpo_lub RS islub_in, cpo_cf, chain_cf_comp] 1; |
774 |
by (asm_simp_tac(simpset() |
|
775 |
addsimps[chain_in RS |
|
776 |
cf_cont RSN(3,chain_in RS |
|
777 |
cf_cont RS comp_cont_apply)]) 1); |
|
2034 | 778 |
by (stac comp_cont_apply 1); |
5136 | 779 |
brr[cpo_lub RS islub_in RS cf_cont, cpo_cf] 1; |
780 |
by (asm_simp_tac(simpset() addsimps |
|
781 |
[lub_cf,chain_cf, chain_in RS cf_cont RS cont_lub, |
|
782 |
chain_cf RS cpo_lub RS islub_in]) 1); |
|
1623 | 783 |
by (cut_inst_tac[("M","lam xa:nat. lam xb:nat. X`xa`(Y`xb`x)")] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
784 |
lub_matrix_diag 1); |
2469 | 785 |
by (Asm_full_simp_tac 3); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
786 |
by (rtac matrix_chainI 1); |
2469 | 787 |
by (Asm_simp_tac 1); |
5525 | 788 |
by (Asm_simp_tac 2); |
789 |
by (dtac (chain_in RS cf_cont) 1 THEN atac 1); |
|
790 |
by (fast_tac (claset() addDs [chain_cf RSN(2,cont_chain)] |
|
5136 | 791 |
addss simpset()) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
792 |
by (rtac chain_cf 1); |
5136 | 793 |
by (REPEAT (ares_tac [cont_fun RS apply_type, chain_in RS cf_cont, |
794 |
lam_type] 1)); |
|
3425 | 795 |
qed "comp_lubs"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
796 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
797 |
(*----------------------------------------------------------------------*) |
1461 | 798 |
(* Theorems about projpair. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
799 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
800 |
|
5136 | 801 |
Goalw [projpair_def] (* projpairI *) |
802 |
"[| e:cont(D,E); p:cont(E,D); p O e = id(set(D)); \ |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
803 |
\ rel(cf(E,E))(e O p)(id(set(E)))|] ==> projpair(D,E,e,p)"; |
2469 | 804 |
by (Fast_tac 1); |
3425 | 805 |
qed "projpairI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
806 |
|
9210 | 807 |
Goalw [projpair_def] "projpair(D,E,e,p) ==> e:cont(D,E)"; |
808 |
by Auto_tac; |
|
3425 | 809 |
qed "projpair_e_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
810 |
|
9210 | 811 |
Goalw [projpair_def] "projpair(D,E,e,p) ==> p:cont(E,D)"; |
812 |
by Auto_tac; |
|
3425 | 813 |
qed "projpair_p_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
814 |
|
9210 | 815 |
Goalw [projpair_def] "projpair(D,E,e,p) ==> p O e = id(set(D))"; |
816 |
by Auto_tac; |
|
3425 | 817 |
qed "projpair_eq"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
818 |
|
9210 | 819 |
Goalw [projpair_def] "projpair(D,E,e,p) ==> rel(cf(E,E))(e O p)(id(set(E)))"; |
820 |
by Auto_tac; |
|
3425 | 821 |
qed "projpair_rel"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
822 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
823 |
val projpairDs = [projpair_e_cont,projpair_p_cont,projpair_eq,projpair_rel]; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
824 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
825 |
(*----------------------------------------------------------------------*) |
1461 | 826 |
(* NB! projpair_e_cont and projpair_p_cont cannot be used repeatedly *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
827 |
(* at the same time since both match a goal of the form f:cont(X,Y).*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
828 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
829 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
830 |
(*----------------------------------------------------------------------*) |
1461 | 831 |
(* Uniqueness of embedding projection pairs. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
832 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
833 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
834 |
val id_comp = fun_is_rel RS left_comp_id; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
835 |
val comp_id = fun_is_rel RS right_comp_id; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
836 |
|
5136 | 837 |
val prems = goal thy (* lemma1 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
838 |
"[|cpo(D); cpo(E); projpair(D,E,e,p); projpair(D,E,e',p'); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
839 |
\ rel(cf(D,E),e,e')|] ==> rel(cf(E,D),p',p)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
840 |
val [_,_,p1,p2,_] = prems; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
841 |
(* The two theorems proj_e_cont and proj_p_cont are useless unless they |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
842 |
are used manually, one at a time. Therefore the following contl. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
843 |
val contl = [p1 RS projpair_e_cont,p1 RS projpair_p_cont, |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
844 |
p2 RS projpair_e_cont,p2 RS projpair_p_cont]; |
1623 | 845 |
by (rtac (p2 RS projpair_p_cont RS cont_fun RS id_comp RS subst) 1); |
846 |
by (rtac (p1 RS projpair_eq RS subst) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
847 |
by (rtac cpo_trans 1); |
1623 | 848 |
brr(cpo_cf::prems) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
849 |
(* The following corresponds to EXISTS_TAC, non-trivial instantiation. *) |
1623 | 850 |
by (res_inst_tac[("f","p O (e' O p')")]cont_cf 4); |
2034 | 851 |
by (stac comp_assoc 1); |
1623 | 852 |
brr(cpo_refl::cpo_cf::cont_cf::comp_mono::comp_pres_cont::(contl@prems)) 1; |
853 |
by (res_inst_tac[("P","%x. rel(cf(E,D),p O e' O p',x)")] |
|
854 |
(p1 RS projpair_p_cont RS cont_fun RS comp_id RS subst) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
855 |
by (rtac comp_mono 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
856 |
brr(cpo_refl::cpo_cf::cont_cf::comp_mono::comp_pres_cont::id_cont:: |
1623 | 857 |
projpair_rel::(contl@prems)) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
858 |
val lemma1 = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
859 |
|
5136 | 860 |
val prems = goal thy (* lemma2 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
861 |
"[|cpo(D); cpo(E); projpair(D,E,e,p); projpair(D,E,e',p'); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
862 |
\ rel(cf(E,D),p',p)|] ==> rel(cf(D,E),e,e')"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
863 |
val [_,_,p1,p2,_] = prems; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
864 |
val contl = [p1 RS projpair_e_cont,p1 RS projpair_p_cont, |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
865 |
p2 RS projpair_e_cont,p2 RS projpair_p_cont]; |
1623 | 866 |
by (rtac (p1 RS projpair_e_cont RS cont_fun RS comp_id RS subst) 1); |
867 |
by (rtac (p2 RS projpair_eq RS subst) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
868 |
by (rtac cpo_trans 1); |
1623 | 869 |
brr(cpo_cf::prems) 1; |
870 |
by (res_inst_tac[("f","(e O p) O e'")]cont_cf 4); |
|
2034 | 871 |
by (stac comp_assoc 1); |
1623 | 872 |
brr((cpo_cf RS cpo_refl)::cont_cf::comp_mono::comp_pres_cont::(contl@prems)) 1; |
873 |
by (res_inst_tac[("P","%x. rel(cf(D,E),(e O p) O e',x)")] |
|
874 |
(p2 RS projpair_e_cont RS cont_fun RS id_comp RS subst) 1); |
|
5136 | 875 |
brr((cpo_cf RS cpo_refl)::cont_cf::comp_mono::id_cont::comp_pres_cont::projpair_rel::(contl@prems)) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
876 |
val lemma2 = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
877 |
|
5136 | 878 |
val prems = goal thy (* projpair_unique *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
879 |
"[|cpo(D); cpo(E); projpair(D,E,e,p); projpair(D,E,e',p')|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
880 |
\ (e=e')<->(p=p')"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
881 |
val [_,_,p1,p2] = prems; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
882 |
val contl = [p1 RS projpair_e_cont,p1 RS projpair_p_cont, |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
883 |
p2 RS projpair_e_cont,p2 RS projpair_p_cont]; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
884 |
by (rtac iffI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
885 |
by (rtac cpo_antisym 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
886 |
by (rtac lemma1 2); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
887 |
(* First some existentials are instantiated. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
888 |
by (resolve_tac prems 4); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
889 |
by (resolve_tac prems 4); |
2469 | 890 |
by (Asm_simp_tac 4); |
5136 | 891 |
brr([cpo_cf,cpo_refl,cont_cf,projpair_e_cont]@prems) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
892 |
by (rtac lemma1 1); |
5136 | 893 |
by (REPEAT (ares_tac prems 1)); |
2469 | 894 |
by (Asm_simp_tac 1); |
1623 | 895 |
brr(cpo_cf::cpo_refl::cont_cf::(contl @ prems)) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
896 |
by (rtac cpo_antisym 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
897 |
by (rtac lemma2 2); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
898 |
(* First some existentials are instantiated. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
899 |
by (resolve_tac prems 4); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
900 |
by (resolve_tac prems 4); |
2469 | 901 |
by (Asm_simp_tac 4); |
5136 | 902 |
brr([cpo_cf,cpo_refl,cont_cf,projpair_p_cont]@prems) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
903 |
by (rtac lemma2 1); |
5136 | 904 |
by (REPEAT (ares_tac prems 1)); |
2469 | 905 |
by (Asm_simp_tac 1); |
1623 | 906 |
brr(cpo_cf::cpo_refl::cont_cf::(contl @ prems)) 1; |
3425 | 907 |
qed "projpair_unique"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
908 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
909 |
(* Slightly different, more asms, since THE chooses the unique element. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
910 |
|
5136 | 911 |
Goalw [emb_def,Rp_def] (* embRp *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
912 |
"[|emb(D,E,e); cpo(D); cpo(E)|] ==> projpair(D,E,e,Rp(D,E,e))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
913 |
by (rtac theI2 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
914 |
by (assume_tac 2); |
5136 | 915 |
by (blast_tac (claset() addIs [projpair_unique RS iffD1]) 1); |
3425 | 916 |
qed "embRp"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
917 |
|
9210 | 918 |
Goalw [emb_def] "projpair(D,E,e,p) ==> emb(D,E,e)"; |
919 |
by Auto_tac; |
|
920 |
qed "embI"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
921 |
|
5136 | 922 |
Goal "[|projpair(D,E,e,p); cpo(D); cpo(E)|] ==> Rp(D,E,e) = p"; |
923 |
by (blast_tac (claset() addIs [embRp, embI, projpair_unique RS iffD1]) 1); |
|
3425 | 924 |
qed "Rp_unique"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
925 |
|
9210 | 926 |
Goalw [emb_def] "emb(D,E,e) ==> e:cont(D,E)"; |
927 |
by (blast_tac (claset() addIs [projpair_e_cont]) 1); |
|
928 |
qed "emb_cont"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
929 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
930 |
(* The following three theorems have cpo asms due to THE (uniqueness). *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
931 |
|
6153 | 932 |
bind_thm ("Rp_cont", embRp RS projpair_p_cont); |
933 |
bind_thm ("embRp_eq", embRp RS projpair_eq); |
|
934 |
bind_thm ("embRp_rel", embRp RS projpair_rel); |
|
935 |
||
6176
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6169
diff
changeset
|
936 |
AddTCs [emb_cont, Rp_cont]; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
937 |
|
5136 | 938 |
Goal (* embRp_eq_thm *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
939 |
"[|emb(D,E,e); x:set(D); cpo(D); cpo(E)|] ==> Rp(D,E,e)`(e`x) = x"; |
1623 | 940 |
by (rtac (comp_fun_apply RS subst) 1); |
5136 | 941 |
brr[Rp_cont,emb_cont,cont_fun] 1; |
2034 | 942 |
by (stac embRp_eq 1); |
9210 | 943 |
by (auto_tac (claset() addIs [id_conv], simpset())); |
3425 | 944 |
qed "embRp_eq_thm"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
945 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
946 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
947 |
(*----------------------------------------------------------------------*) |
1461 | 948 |
(* The identity embedding. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
949 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
950 |
|
5136 | 951 |
Goalw [projpair_def] (* projpair_id *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
952 |
"cpo(D) ==> projpair(D,D,id(set(D)),id(set(D)))"; |
4152 | 953 |
by Safe_tac; |
5136 | 954 |
brr[id_cont,id_comp,id_type] 1; |
2034 | 955 |
by (stac id_comp 1); (* Matches almost anything *) |
5136 | 956 |
brr[id_cont,id_type,cpo_refl,cpo_cf,cont_cf] 1; |
3425 | 957 |
qed "projpair_id"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
958 |
|
5136 | 959 |
Goal (* emb_id *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
960 |
"cpo(D) ==> emb(D,D,id(set(D)))"; |
5136 | 961 |
by (auto_tac (claset() addIs [embI,projpair_id], simpset())); |
3425 | 962 |
qed "emb_id"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
963 |
|
5136 | 964 |
Goal (* Rp_id *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
965 |
"cpo(D) ==> Rp(D,D,id(set(D))) = id(set(D))"; |
5136 | 966 |
by (auto_tac (claset() addIs [Rp_unique,projpair_id], simpset())); |
3425 | 967 |
qed "Rp_id"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
968 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
969 |
(*----------------------------------------------------------------------*) |
1461 | 970 |
(* Composition preserves embeddings. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
971 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
972 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
973 |
(* Considerably shorter, only partly due to a simpler comp_assoc. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
974 |
(* Proof in HOL-ST: 70 lines (minus 14 due to comp_assoc complication). *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
975 |
(* Proof in Isa/ZF: 23 lines (compared to 56: 60% reduction). *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
976 |
|
5136 | 977 |
Goalw [projpair_def] (* lemma *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
978 |
"[|emb(D,D',e); emb(D',E,e'); cpo(D); cpo(D'); cpo(E)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
979 |
\ projpair(D,E,e' O e,(Rp(D,D',e)) O (Rp(D',E,e')))"; |
4152 | 980 |
by Safe_tac; |
5136 | 981 |
brr[comp_pres_cont,Rp_cont,emb_cont] 1; |
1623 | 982 |
by (rtac (comp_assoc RS subst) 1); |
983 |
by (res_inst_tac[("t1","e'")](comp_assoc RS ssubst) 1); |
|
2034 | 984 |
by (stac embRp_eq 1); (* Matches everything due to subst/ssubst. *) |
5136 | 985 |
by (REPEAT (assume_tac 1)); |
2034 | 986 |
by (stac comp_id 1); |
5136 | 987 |
brr[cont_fun,Rp_cont,embRp_eq] 1; |
1623 | 988 |
by (rtac (comp_assoc RS subst) 1); |
989 |
by (res_inst_tac[("t1","Rp(D,D',e)")](comp_assoc RS ssubst) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
990 |
by (rtac cpo_trans 1); |
5136 | 991 |
brr[cpo_cf] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
992 |
by (rtac comp_mono 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
993 |
by (rtac cpo_refl 6); |
5136 | 994 |
brr[cont_cf,Rp_cont] 7; |
995 |
brr[cpo_cf] 6; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
996 |
by (rtac comp_mono 5); |
5136 | 997 |
brr[embRp_rel] 10; |
998 |
brr[cpo_cf RS cpo_refl, cont_cf,Rp_cont] 9; |
|
2034 | 999 |
by (stac comp_id 10); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1000 |
by (rtac embRp_rel 11); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1001 |
(* There are 16 subgoals at this point. All are proved immediately by: *) |
5136 | 1002 |
by (REPEAT (ares_tac [comp_pres_cont,Rp_cont,id_cont, |
1003 |
emb_cont,cont_fun,cont_cf] 1)); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1004 |
val lemma = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1005 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1006 |
(* The use of RS is great in places like the following, both ugly in HOL. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1007 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1008 |
val emb_comp = lemma RS embI; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1009 |
val Rp_comp = lemma RS Rp_unique; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1010 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1011 |
(*----------------------------------------------------------------------*) |
1461 | 1012 |
(* Infinite cartesian product. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1013 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1014 |
|
5136 | 1015 |
Goalw [set_def,iprod_def] (* iprodI *) |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5136
diff
changeset
|
1016 |
"x:(PROD n:nat. set(DD`n)) ==> x:set(iprod(DD))"; |
2469 | 1017 |
by (Asm_full_simp_tac 1); |
3425 | 1018 |
qed "iprodI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1019 |
|
5136 | 1020 |
Goalw [set_def,iprod_def] (* iprodE *) |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5136
diff
changeset
|
1021 |
"x:set(iprod(DD)) ==> x:(PROD n:nat. set(DD`n))"; |
2469 | 1022 |
by (Asm_full_simp_tac 1); |
3425 | 1023 |
qed "iprodE"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1024 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1025 |
(* Contains typing conditions in contrast to HOL-ST *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1026 |
|
5136 | 1027 |
val prems = Goalw [iprod_def] (* rel_iprodI *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1028 |
"[|!!n. n:nat ==> rel(DD`n,f`n,g`n); f:(PROD n:nat. set(DD`n)); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1029 |
\ g:(PROD n:nat. set(DD`n))|] ==> rel(iprod(DD),f,g)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1030 |
by (rtac rel_I 1); |
2469 | 1031 |
by (Simp_tac 1); |
4152 | 1032 |
by Safe_tac; |
5136 | 1033 |
by (REPEAT (ares_tac prems 1)); |
3425 | 1034 |
qed "rel_iprodI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1035 |
|
5136 | 1036 |
Goalw [iprod_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1037 |
"[|rel(iprod(DD),f,g); n:nat|] ==> rel(DD`n,f`n,g`n)"; |
5136 | 1038 |
by (fast_tac (claset() addDs [rel_E] addss simpset()) 1); |
3425 | 1039 |
qed "rel_iprodE"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1040 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1041 |
(* Some special theorems like dProdApIn_cpo and other `_cpo' |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1042 |
probably not needed in Isabelle, wait and see. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1043 |
|
5136 | 1044 |
val prems = Goalw [chain_def] (* chain_iprod *) |
2469 | 1045 |
"[|chain(iprod(DD),X); !!n. n:nat ==> cpo(DD`n); n:nat|] ==> \ |
3840 | 1046 |
\ chain(DD`n,lam m:nat. X`m`n)"; |
4152 | 1047 |
by Safe_tac; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1048 |
by (rtac lam_type 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1049 |
by (rtac apply_type 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1050 |
by (rtac iprodE 1); |
1623 | 1051 |
by (etac (hd prems RS conjunct1 RS apply_type) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1052 |
by (resolve_tac prems 1); |
4091 | 1053 |
by (asm_simp_tac(simpset() addsimps prems) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1054 |
by (rtac rel_iprodE 1); |
4091 | 1055 |
by (asm_simp_tac (simpset() addsimps prems) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1056 |
by (resolve_tac prems 1); |
3425 | 1057 |
qed "chain_iprod"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1058 |
|
5136 | 1059 |
val prems = Goalw [islub_def,isub_def] (* islub_iprod *) |
2469 | 1060 |
"[|chain(iprod(DD),X); !!n. n:nat ==> cpo(DD`n)|] ==> \ |
3840 | 1061 |
\ islub(iprod(DD),X,lam n:nat. lub(DD`n,lam m:nat. X`m`n))"; |
4152 | 1062 |
by Safe_tac; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1063 |
by (rtac iprodI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1064 |
by (rtac lam_type 1); |
1623 | 1065 |
brr((chain_iprod RS cpo_lub RS islub_in)::prems) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1066 |
by (rtac rel_iprodI 1); |
2469 | 1067 |
by (Asm_simp_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1068 |
(* Here, HOL resolution is handy, Isabelle resolution bad. *) |
1623 | 1069 |
by (res_inst_tac[("P","%t. rel(DD`na,t,lub(DD`na,lam x:nat. X`x`na))"), |
1070 |
("b1","%n. X`n`na")](beta RS subst) 1); |
|
1071 |
brr((chain_iprod RS cpo_lub RS islub_ub)::iprodE::chain_in::prems) 1; |
|
1072 |
brr(iprodI::lam_type::(chain_iprod RS cpo_lub RS islub_in)::prems) 1; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1073 |
by (rtac rel_iprodI 1); |
2469 | 1074 |
by (Asm_simp_tac 1); |
1623 | 1075 |
brr(islub_least::(chain_iprod RS cpo_lub)::prems) 1; |
1076 |
by (rewtac isub_def); |
|
4152 | 1077 |
by Safe_tac; |
1623 | 1078 |
by (etac (iprodE RS apply_type) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1079 |
by (assume_tac 1); |
2469 | 1080 |
by (Asm_simp_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1081 |
by (dtac bspec 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1082 |
by (etac rel_iprodE 2); |
1623 | 1083 |
brr(lam_type::(chain_iprod RS cpo_lub RS islub_in)::iprodE::prems) 1; |
3425 | 1084 |
qed "islub_iprod"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1085 |
|
9264 | 1086 |
val prems = Goal (* cpo_iprod *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1087 |
"(!!n. n:nat ==> cpo(DD`n)) ==> cpo(iprod(DD))"; |
5136 | 1088 |
brr[cpoI,poI] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1089 |
by (rtac rel_iprodI 1); (* not repeated: want to solve 1 and leave 2 unchanged *) |
1623 | 1090 |
brr(cpo_refl::(iprodE RS apply_type)::iprodE::prems) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1091 |
by (rtac rel_iprodI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1092 |
by (dtac rel_iprodE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1093 |
by (dtac rel_iprodE 2); |
1623 | 1094 |
brr(cpo_trans::(iprodE RS apply_type)::iprodE::prems) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1095 |
by (rtac fun_extension 1); |
1623 | 1096 |
brr(cpo_antisym::rel_iprodE::(iprodE RS apply_type)::iprodE::prems) 1; |
1097 |
brr(islub_iprod::prems) 1; |
|
3425 | 1098 |
qed "cpo_iprod"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1099 |
|
6158 | 1100 |
AddTCs [cpo_iprod]; |
1101 |
||
5136 | 1102 |
val prems = Goalw [islub_def,isub_def] (* lub_iprod *) |
2469 | 1103 |
"[|chain(iprod(DD),X); !!n. n:nat ==> cpo(DD`n)|] ==> \ |
3840 | 1104 |
\ lub(iprod(DD),X) = (lam n:nat. lub(DD`n,lam m:nat. X`m`n))"; |
1623 | 1105 |
brr((cpo_lub RS islub_unique)::islub_iprod::cpo_iprod::prems) 1; |
3425 | 1106 |
qed "lub_iprod"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1107 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1108 |
(*----------------------------------------------------------------------*) |
1461 | 1109 |
(* The notion of subcpo. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1110 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1111 |
|
5136 | 1112 |
val prems = Goalw [subcpo_def] (* subcpoI *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1113 |
"[|set(D)<=set(E); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1114 |
\ !!x y. [|x:set(D); y:set(D)|] ==> rel(D,x,y)<->rel(E,x,y); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1115 |
\ !!X. chain(D,X) ==> lub(E,X) : set(D)|] ==> subcpo(D,E)"; |
4152 | 1116 |
by Safe_tac; |
4091 | 1117 |
by (asm_full_simp_tac(simpset() addsimps prems) 2); |
1118 |
by (asm_simp_tac(simpset() addsimps prems) 2); |
|
1623 | 1119 |
brr(prems@[subsetD]) 1; |
3425 | 1120 |
qed "subcpoI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1121 |
|
9210 | 1122 |
Goalw [subcpo_def] "subcpo(D,E) ==> set(D)<=set(E)"; |
1123 |
by Auto_tac; |
|
1124 |
qed "subcpo_subset"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1125 |
|
5136 | 1126 |
Goalw [subcpo_def] |
1127 |
"[|subcpo(D,E); x:set(D); y:set(D)|] ==> rel(D,x,y)<->rel(E,x,y)"; |
|
1128 |
by (Blast_tac 1); |
|
1129 |
qed "subcpo_rel_eq"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1130 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1131 |
val subcpo_relD1 = subcpo_rel_eq RS iffD1; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1132 |
val subcpo_relD2 = subcpo_rel_eq RS iffD2; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1133 |
|
5136 | 1134 |
Goalw [subcpo_def] "[|subcpo(D,E); chain(D,X)|] ==> lub(E,X) : set(D)"; |
1135 |
by (Blast_tac 1); |
|
1136 |
qed "subcpo_lub"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1137 |
|
5136 | 1138 |
Goal "[|subcpo(D,E); chain(D,X)|] ==> chain(E,X)"; |
1139 |
by (rtac (Pi_type RS chainI) 1); |
|
1140 |
by (REPEAT |
|
1141 |
(blast_tac (claset() addIs [chain_fun, subcpo_relD1, |
|
1142 |
subcpo_subset RS subsetD, |
|
1143 |
chain_in, chain_rel]) 1)); |
|
3425 | 1144 |
qed "chain_subcpo"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1145 |
|
5136 | 1146 |
Goal "[|subcpo(D,E); chain(D,X); isub(D,X,x)|] ==> isub(E,X,x)"; |
1147 |
by (blast_tac (claset() addIs [isubI, subcpo_relD1,subcpo_relD1, |
|
1148 |
chain_in, isubD1, isubD2, |
|
1149 |
subcpo_subset RS subsetD, |
|
1150 |
chain_in, chain_rel]) 1); |
|
3425 | 1151 |
qed "ub_subcpo"; |
1461 | 1152 |
|
5136 | 1153 |
Goal "[|subcpo(D,E); cpo(E); chain(D,X)|] ==> islub(D,X,lub(E,X))"; |
1154 |
by (blast_tac (claset() addIs [islubI, isubI, subcpo_lub, |
|
1155 |
subcpo_relD2, chain_in, |
|
1156 |
islub_ub, islub_least, cpo_lub, |
|
1157 |
chain_subcpo, isubD1, ub_subcpo]) 1); |
|
3425 | 1158 |
qed "islub_subcpo"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1159 |
|
5136 | 1160 |
Goal "[|subcpo(D,E); cpo(E)|] ==> cpo(D)"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1161 |
brr[cpoI,poI]1; |
5136 | 1162 |
by (asm_full_simp_tac(simpset() addsimps[subcpo_rel_eq]) 1); |
1163 |
brr[cpo_refl, subcpo_subset RS subsetD] 1; |
|
1164 |
by (rotate_tac ~3 1); |
|
1165 |
by (asm_full_simp_tac(simpset() addsimps[subcpo_rel_eq]) 1); |
|
1166 |
by (blast_tac (claset() addIs [subcpo_subset RS subsetD, cpo_trans]) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1167 |
(* Changing the order of the assumptions, otherwise full_simp doesn't work. *) |
5136 | 1168 |
by (rotate_tac ~2 1); |
1169 |
by (asm_full_simp_tac(simpset() addsimps[subcpo_rel_eq]) 1); |
|
1170 |
by (blast_tac (claset() addIs [cpo_antisym, subcpo_subset RS subsetD]) 1); |
|
1171 |
by (fast_tac (claset() addIs [islub_subcpo]) 1); |
|
3425 | 1172 |
qed "subcpo_cpo"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1173 |
|
5136 | 1174 |
Goal "[|subcpo(D,E); cpo(E); chain(D,X)|] ==> lub(D,X) = lub(E,X)"; |
1175 |
by (blast_tac (claset() addIs [cpo_lub RS islub_unique, |
|
1176 |
islub_subcpo, subcpo_cpo]) 1); |
|
3425 | 1177 |
qed "lub_subcpo"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1178 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1179 |
(*----------------------------------------------------------------------*) |
1461 | 1180 |
(* Making subcpos using mkcpo. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1181 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1182 |
|
5136 | 1183 |
Goalw [set_def,mkcpo_def] "[|x:set(D); P(x)|] ==> x:set(mkcpo(D,P))"; |
1184 |
by Auto_tac; |
|
3425 | 1185 |
qed "mkcpoI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1186 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1187 |
(* Old proof where cpos are non-reflexive relations. |
1623 | 1188 |
by (rewtac set_def); (* Annoying, cannot just rewrite once. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1189 |
by (rtac CollectI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1190 |
by (rtac domainI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1191 |
by (rtac CollectI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1192 |
(* Now, work on subgoal 2 (and 3) to instantiate unknown. *) |
2469 | 1193 |
by (Simp_tac 2); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1194 |
by (rtac conjI 2); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1195 |
by (rtac conjI 3); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1196 |
by (resolve_tac prems 3); |
4091 | 1197 |
by (simp_tac(simpset() addsimps [rewrite_rule[set_def](hd prems)]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1198 |
by (resolve_tac prems 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1199 |
by (rtac cpo_refl 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1200 |
by (resolve_tac prems 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1201 |
by (rtac rel_I 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1202 |
by (rtac CollectI 1); |
4091 | 1203 |
by (fast_tac(claset() addSIs [rewrite_rule[set_def](hd prems)]) 1); |
2469 | 1204 |
by (Simp_tac 1); |
5136 | 1205 |
brr[conjI,cpo_refl] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1206 |
*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1207 |
|
5136 | 1208 |
Goalw [set_def,mkcpo_def] (* mkcpoD1 *) |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5136
diff
changeset
|
1209 |
"x:set(mkcpo(D,P))==> x:set(D)"; |
2469 | 1210 |
by (Asm_full_simp_tac 1); |
3425 | 1211 |
qed "mkcpoD1"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1212 |
|
5136 | 1213 |
Goalw [set_def,mkcpo_def] (* mkcpoD2 *) |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5136
diff
changeset
|
1214 |
"x:set(mkcpo(D,P))==> P(x)"; |
2469 | 1215 |
by (Asm_full_simp_tac 1); |
3425 | 1216 |
qed "mkcpoD2"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1217 |
|
5136 | 1218 |
Goalw [rel_def,mkcpo_def] (* rel_mkcpoE *) |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5136
diff
changeset
|
1219 |
"rel(mkcpo(D,P),x,y) ==> rel(D,x,y)"; |
2469 | 1220 |
by (Asm_full_simp_tac 1); |
3425 | 1221 |
qed "rel_mkcpoE"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1222 |
|
9210 | 1223 |
Goalw [mkcpo_def,rel_def,set_def] |
1224 |
"[|x:set(D); y:set(D)|] ==> rel(mkcpo(D,P),x,y) <-> rel(D,x,y)"; |
|
1225 |
by Auto_tac; |
|
1226 |
qed "rel_mkcpo"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1227 |
|
5136 | 1228 |
Goal (* chain_mkcpo *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1229 |
"chain(mkcpo(D,P),X) ==> chain(D,X)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1230 |
by (rtac chainI 1); |
9210 | 1231 |
by (blast_tac (claset() addIs [Pi_type, chain_fun, chain_in RS mkcpoD1]) 1); |
1232 |
by (blast_tac (claset() addIs [rel_mkcpo RS iffD1, chain_rel, mkcpoD1, |
|
1233 |
chain_in,nat_succI]) 1); |
|
3425 | 1234 |
qed "chain_mkcpo"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1235 |
|
9264 | 1236 |
val prems = Goal (* subcpo_mkcpo *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1237 |
"[|!!X. chain(mkcpo(D,P),X) ==> P(lub(D,X)); cpo(D)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1238 |
\ subcpo(mkcpo(D,P),D)"; |
1623 | 1239 |
brr(subcpoI::subsetI::prems) 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1240 |
by (rtac rel_mkcpo 2); |
1623 | 1241 |
by (REPEAT(etac mkcpoD1 1)); |
1242 |
brr(mkcpoI::(cpo_lub RS islub_in)::chain_mkcpo::prems) 1; |
|
3425 | 1243 |
qed "subcpo_mkcpo"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1244 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1245 |
(*----------------------------------------------------------------------*) |
1461 | 1246 |
(* Embedding projection chains of cpos. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1247 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1248 |
|
5136 | 1249 |
val prems = Goalw [emb_chain_def] (* emb_chainI *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1250 |
"[|!!n. n:nat ==> cpo(DD`n); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1251 |
\ !!n. n:nat ==> emb(DD`n,DD`succ(n),ee`n)|] ==> emb_chain(DD,ee)"; |
4152 | 1252 |
by Safe_tac; |
5136 | 1253 |
by (REPEAT (ares_tac prems 1)); |
3425 | 1254 |
qed "emb_chainI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1255 |
|
9264 | 1256 |
Goalw [emb_chain_def] "[|emb_chain(DD,ee); n:nat|] ==> cpo(DD`n)"; |
1257 |
by (Fast_tac 1); |
|
1258 |
qed "emb_chain_cpo"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1259 |
|
6153 | 1260 |
AddTCs [emb_chain_cpo]; |
1261 |
||
9264 | 1262 |
Goalw [emb_chain_def] |
1263 |
"[|emb_chain(DD,ee); n:nat|] ==> emb(DD`n,DD`succ(n),ee`n)"; |
|
1264 |
by (Fast_tac 1); |
|
1265 |
qed "emb_chain_emb"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1266 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1267 |
(*----------------------------------------------------------------------*) |
1461 | 1268 |
(* Dinf, the inverse Limit. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1269 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1270 |
|
5136 | 1271 |
val prems = Goalw [Dinf_def] (* DinfI *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1272 |
"[|x:(PROD n:nat. set(DD`n)); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1273 |
\ !!n. n:nat ==> Rp(DD`n,DD`succ(n),ee`n)`(x`succ(n)) = x`n|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1274 |
\ x:set(Dinf(DD,ee))"; |
1623 | 1275 |
brr(mkcpoI::iprodI::ballI::prems) 1; |
3425 | 1276 |
qed "DinfI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1277 |
|
5136 | 1278 |
Goalw [Dinf_def] "x:set(Dinf(DD,ee)) ==> x:(PROD n:nat. set(DD`n))"; |
1279 |
by (etac (mkcpoD1 RS iprodE) 1); |
|
1280 |
qed "Dinf_prod"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1281 |
|
5136 | 1282 |
Goalw [Dinf_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1283 |
"[|x:set(Dinf(DD,ee)); n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1284 |
\ Rp(DD`n,DD`succ(n),ee`n)`(x`succ(n)) = x`n"; |
5136 | 1285 |
by (blast_tac (claset() addDs [mkcpoD2]) 1); |
1286 |
qed "Dinf_eq"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1287 |
|
5136 | 1288 |
val prems = Goalw [Dinf_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1289 |
"[|!!n. n:nat ==> rel(DD`n,x`n,y`n); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1290 |
\ x:(PROD n:nat. set(DD`n)); y:(PROD n:nat. set(DD`n))|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1291 |
\ rel(Dinf(DD,ee),x,y)"; |
1623 | 1292 |
by (rtac (rel_mkcpo RS iffD2) 1); |
1293 |
brr(rel_iprodI::iprodI::prems) 1; |
|
3425 | 1294 |
qed "rel_DinfI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1295 |
|
5136 | 1296 |
Goalw [Dinf_def] "[|rel(Dinf(DD,ee),x,y); n:nat|] ==> rel(DD`n,x`n,y`n)"; |
1297 |
by (etac (rel_mkcpoE RS rel_iprodE) 1); |
|
1298 |
by (assume_tac 1); |
|
3425 | 1299 |
qed "rel_Dinf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1300 |
|
5136 | 1301 |
Goalw [Dinf_def] "chain(Dinf(DD,ee),X) ==> chain(iprod(DD),X)"; |
1302 |
by (etac chain_mkcpo 1); |
|
1303 |
qed "chain_Dinf"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1304 |
|
5136 | 1305 |
Goalw [Dinf_def] (* subcpo_Dinf *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1306 |
"emb_chain(DD,ee) ==> subcpo(Dinf(DD,ee),iprod(DD))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1307 |
by (rtac subcpo_mkcpo 1); |
1623 | 1308 |
by (fold_tac [Dinf_def]); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1309 |
by (rtac ballI 1); |
2034 | 1310 |
by (stac lub_iprod 1); |
5136 | 1311 |
brr[chain_Dinf, emb_chain_cpo] 1; |
2469 | 1312 |
by (Asm_simp_tac 1); |
2034 | 1313 |
by (stac (Rp_cont RS cont_lub) 1); |
5136 | 1314 |
brr[emb_chain_cpo,emb_chain_emb,nat_succI,chain_iprod,chain_Dinf] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1315 |
(* Useful simplification, ugly in HOL. *) |
5136 | 1316 |
by (asm_simp_tac(simpset() addsimps[Dinf_eq,chain_in]) 1); |
1317 |
by (auto_tac (claset() addIs [cpo_iprod,emb_chain_cpo], simpset())); |
|
3425 | 1318 |
qed "subcpo_Dinf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1319 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1320 |
(* Simple example of existential reasoning in Isabelle versus HOL. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1321 |
|
5136 | 1322 |
Goal "emb_chain(DD,ee) ==> cpo(Dinf(DD,ee))"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1323 |
by (rtac subcpo_cpo 1); |
6163 | 1324 |
by (etac subcpo_Dinf 1); |
6158 | 1325 |
by (auto_tac (claset() addIs [cpo_iprod, emb_chain_cpo], simpset())); |
3425 | 1326 |
qed "cpo_Dinf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1327 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1328 |
(* Again and again the proofs are much easier to WRITE in Isabelle, but |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1329 |
the proof steps are essentially the same (I think). *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1330 |
|
5136 | 1331 |
Goal (* lub_Dinf *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1332 |
"[|chain(Dinf(DD,ee),X); emb_chain(DD,ee)|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1333 |
\ lub(Dinf(DD,ee),X) = (lam n:nat. lub(DD`n,lam m:nat. X`m`n))"; |
2034 | 1334 |
by (stac (subcpo_Dinf RS lub_subcpo) 1); |
5136 | 1335 |
by (auto_tac (claset() addIs [cpo_iprod,emb_chain_cpo,lub_iprod,chain_Dinf], simpset())); |
3425 | 1336 |
qed "lub_Dinf"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1337 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1338 |
(*----------------------------------------------------------------------*) |
1461 | 1339 |
(* Generalising embedddings D_m -> D_{m+1} to embeddings D_m -> D_n, *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1340 |
(* defined as eps(DD,ee,m,n), via e_less and e_gr. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1341 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1342 |
|
5136 | 1343 |
Goalw [e_less_def] (* e_less_eq *) |
1344 |
"m:nat ==> e_less(DD,ee,m,m) = id(set(DD`m))"; |
|
4091 | 1345 |
by (asm_simp_tac (simpset() addsimps[diff_self_eq_0]) 1); |
3425 | 1346 |
qed "e_less_eq"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1347 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1348 |
Goal "succ(m#+n)#-m = succ(natify(n))"; |
9548 | 1349 |
by (Asm_simp_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1350 |
val lemma_succ_sub = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1351 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1352 |
Goalw [e_less_def] |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1353 |
"e_less(DD,ee,m,succ(m#+k)) = (ee`(m#+k))O(e_less(DD,ee,m,m#+k))"; |
4091 | 1354 |
by (asm_simp_tac (simpset() addsimps [lemma_succ_sub,diff_add_inverse]) 1); |
3425 | 1355 |
qed "e_less_add"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1356 |
|
9264 | 1357 |
Goal "n:nat ==> succ(n) = n #+ 1"; |
1358 |
by (Asm_simp_tac 1); |
|
1359 |
qed "add1"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1360 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1361 |
Goal "[| m le n; n: nat |] ==> EX k: nat. n = m #+ k"; |
9548 | 1362 |
by (dtac less_imp_succ_add 1); |
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1363 |
by Auto_tac; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1364 |
val lemma_le_exists = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1365 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1366 |
val prems = Goal |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1367 |
"[| m le n; !!x. [|n=m#+x; x:nat|] ==> Q; n:nat |] ==> Q"; |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1368 |
by (rtac (lemma_le_exists RS bexE) 1); |
5136 | 1369 |
by (DEPTH_SOLVE (ares_tac prems 1)); |
3425 | 1370 |
qed "le_exists"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1371 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1372 |
Goal "[| m le n; n:nat |] ==> \ |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1373 |
\ e_less(DD,ee,m,succ(n)) = ee`n O e_less(DD,ee,m,n)"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1374 |
by (rtac le_exists 1); |
5136 | 1375 |
by (assume_tac 1); |
1376 |
by (asm_simp_tac(simpset() addsimps[e_less_add]) 1); |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1377 |
by (assume_tac 1); |
3425 | 1378 |
qed "e_less_le"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1379 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1380 |
(* All theorems assume variables m and n are natural numbers. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1381 |
|
5136 | 1382 |
Goal "m:nat ==> e_less(DD,ee,m,succ(m)) = ee`m O id(set(DD`m))"; |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
1383 |
by (asm_simp_tac(simpset() addsimps[e_less_le, e_less_eq]) 1); |
3425 | 1384 |
qed "e_less_succ"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1385 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1386 |
val prems = Goal |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1387 |
"[|!!n. n:nat ==> emb(DD`n,DD`succ(n),ee`n); m:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1388 |
\ e_less(DD,ee,m,succ(m)) = ee`m"; |
5529 | 1389 |
by (asm_simp_tac(simpset() addsimps e_less_succ::prems) 1); |
2034 | 1390 |
by (stac comp_id 1); |
1623 | 1391 |
brr(emb_cont::cont_fun::refl::prems) 1; |
3425 | 1392 |
qed "e_less_succ_emb"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1393 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1394 |
(* Compare this proof with the HOL one, here we do type checking. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1395 |
(* In any case the one below was very easy to write. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1396 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1397 |
Goal "[| emb_chain(DD,ee); m:nat |] ==> \ |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1398 |
\ emb(DD`m, DD`(m#+k), e_less(DD,ee,m,m#+k))"; |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1399 |
by (subgoal_tac "emb(DD`m, DD`(m#+natify(k)), e_less(DD,ee,m,m#+natify(k)))" 1); |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1400 |
by (res_inst_tac [("n","natify(k)")] nat_induct 2); |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1401 |
by (ALLGOALS (asm_full_simp_tac (simpset() addsimps[e_less_eq]))); |
5136 | 1402 |
brr[emb_id,emb_chain_cpo] 1; |
6070 | 1403 |
by (asm_simp_tac(simpset() addsimps[e_less_add]) 1); |
5136 | 1404 |
by (auto_tac (claset() addIs [emb_comp,emb_chain_emb,emb_chain_cpo,add_type], |
1405 |
simpset())); |
|
3425 | 1406 |
qed "emb_e_less_add"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1407 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1408 |
Goal "[| m le n; emb_chain(DD,ee); n:nat |] ==> \ |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1409 |
\ emb(DD`m, DD`n, e_less(DD,ee,m,n))"; |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1410 |
by (ftac lt_nat_in_nat 1); |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1411 |
by (etac nat_succI 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1412 |
(* same proof as e_less_le *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1413 |
by (rtac le_exists 1); |
5136 | 1414 |
by (assume_tac 1); |
1415 |
by (asm_simp_tac(simpset() addsimps[emb_e_less_add]) 1); |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1416 |
by (assume_tac 1); |
3425 | 1417 |
qed "emb_e_less"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1418 |
|
9264 | 1419 |
Goal "[|f=f'; g=g'|] ==> f O g = f' O g'"; |
1420 |
by (Asm_simp_tac 1); |
|
1421 |
qed "comp_mono_eq"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1422 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1423 |
(* Typing, typing, typing, three irritating assumptions. Extra theorems |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1424 |
needed in proof, but no real difficulty. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1425 |
(* Note also the object-level implication for induction on k. This |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1426 |
must be removed later to allow the theorems to be used for simp. |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1427 |
Therefore this theorem is only a lemma. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1428 |
|
5136 | 1429 |
Goal (* e_less_split_add_lemma *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1430 |
"[| emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1431 |
\ n le k --> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1432 |
\ e_less(DD,ee,m,m#+k) = e_less(DD,ee,m#+n,m#+k) O e_less(DD,ee,m,m#+n)"; |
6070 | 1433 |
by (induct_tac "k" 1); |
5136 | 1434 |
by (asm_full_simp_tac(simpset() addsimps [e_less_eq, id_type RS id_comp]) 1); |
1623 | 1435 |
by (asm_simp_tac(ZF_ss addsimps[le_succ_iff]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1436 |
by (rtac impI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1437 |
by (etac disjE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1438 |
by (etac impE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1439 |
by (assume_tac 1); |
5136 | 1440 |
by (asm_simp_tac(ZF_ss addsimps[add_succ_right, e_less_add, add_type,nat_succI]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1441 |
(* Again and again, simplification is a pain. When does it work, when not? *) |
2034 | 1442 |
by (stac e_less_le 1); |
5136 | 1443 |
brr[add_le_mono,nat_le_refl,add_type,nat_succI] 1; |
2034 | 1444 |
by (stac comp_assoc 1); |
5136 | 1445 |
brr[comp_mono_eq,refl] 1; |
1446 |
by (asm_simp_tac(ZF_ss addsimps[e_less_eq,add_type,nat_succI]) 1); |
|
2034 | 1447 |
by (stac id_comp 1); (* simp cannot unify/inst right, use brr below(?). *) |
5136 | 1448 |
by (REPEAT (ares_tac [emb_e_less_add RS emb_cont RS cont_fun, refl, |
1449 |
nat_succI] 1)); |
|
3425 | 1450 |
qed "e_less_split_add_lemma"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1451 |
|
5136 | 1452 |
Goal "[| n le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
1453 |
\ e_less(DD,ee,m,m#+k) = e_less(DD,ee,m#+n,m#+k) O e_less(DD,ee,m,m#+n)"; |
|
1454 |
by (blast_tac (claset() addIs [e_less_split_add_lemma RS mp]) 1); |
|
1455 |
qed "e_less_split_add"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1456 |
|
5136 | 1457 |
Goalw [e_gr_def] (* e_gr_eq *) |
1458 |
"m:nat ==> e_gr(DD,ee,m,m) = id(set(DD`m))"; |
|
4091 | 1459 |
by (asm_simp_tac (simpset() addsimps[diff_self_eq_0]) 1); |
3425 | 1460 |
qed "e_gr_eq"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1461 |
|
5136 | 1462 |
Goalw [e_gr_def] (* e_gr_add *) |
1463 |
"[|n:nat; k:nat|] ==> \ |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1464 |
\ e_gr(DD,ee,succ(n#+k),n) = \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1465 |
\ e_gr(DD,ee,n#+k,n) O Rp(DD`(n#+k),DD`succ(n#+k),ee`(n#+k))"; |
4091 | 1466 |
by (asm_simp_tac (simpset() addsimps [lemma_succ_sub,diff_add_inverse]) 1); |
3425 | 1467 |
qed "e_gr_add"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1468 |
|
5136 | 1469 |
Goal "[|n le m; m:nat; n:nat|] ==> \ |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1470 |
\ e_gr(DD,ee,succ(m),n) = e_gr(DD,ee,m,n) O Rp(DD`m,DD`succ(m),ee`m)"; |
5136 | 1471 |
by (etac le_exists 1); |
1472 |
by (asm_simp_tac(simpset() addsimps[e_gr_add]) 1); |
|
1473 |
by (REPEAT (assume_tac 1)); |
|
3425 | 1474 |
qed "e_gr_le"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1475 |
|
5136 | 1476 |
Goal "m:nat ==> \ |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1477 |
\ e_gr(DD,ee,succ(m),m) = id(set(DD`m)) O Rp(DD`m,DD`succ(m),ee`m)"; |
5136 | 1478 |
by (asm_simp_tac(simpset() addsimps[e_gr_le,e_gr_eq]) 1); |
3425 | 1479 |
qed "e_gr_succ"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1480 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1481 |
(* Cpo asm's due to THE uniqueness. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1482 |
|
5136 | 1483 |
Goal "[|emb_chain(DD,ee); m:nat|] ==> \ |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1484 |
\ e_gr(DD,ee,succ(m),m) = Rp(DD`m,DD`succ(m),ee`m)"; |
5136 | 1485 |
by (asm_simp_tac(simpset() addsimps[e_gr_succ]) 1); |
1486 |
by (blast_tac (claset() addIs [id_comp, Rp_cont,cont_fun, |
|
1487 |
emb_chain_cpo,emb_chain_emb]) 1); |
|
3425 | 1488 |
qed "e_gr_succ_emb"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1489 |
|
5136 | 1490 |
Goal (* e_gr_fun_add *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1491 |
"[|emb_chain(DD,ee); n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1492 |
\ e_gr(DD,ee,n#+k,n): set(DD`(n#+k))->set(DD`n)"; |
6070 | 1493 |
by (induct_tac "k" 1); |
1494 |
by (asm_simp_tac(simpset() addsimps[e_gr_eq,id_type]) 1); |
|
1495 |
by (asm_simp_tac(simpset() addsimps[e_gr_add]) 1); |
|
5136 | 1496 |
brr[comp_fun, Rp_cont, cont_fun, emb_chain_emb, emb_chain_cpo, add_type, nat_succI] 1; |
3425 | 1497 |
qed "e_gr_fun_add"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1498 |
|
5136 | 1499 |
Goal (* e_gr_fun *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1500 |
"[|n le m; emb_chain(DD,ee); m:nat; n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1501 |
\ e_gr(DD,ee,m,n): set(DD`m)->set(DD`n)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1502 |
by (rtac le_exists 1); |
5136 | 1503 |
by (assume_tac 1); |
1504 |
by (asm_simp_tac(simpset() addsimps[e_gr_fun_add]) 1); |
|
1505 |
by (REPEAT (assume_tac 1)); |
|
3425 | 1506 |
qed "e_gr_fun"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1507 |
|
5136 | 1508 |
Goal (* e_gr_split_add_lemma *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1509 |
"[| emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1510 |
\ m le k --> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1511 |
\ e_gr(DD,ee,n#+k,n) = e_gr(DD,ee,n#+m,n) O e_gr(DD,ee,n#+k,n#+m)"; |
6070 | 1512 |
by (induct_tac "k" 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1513 |
by (rtac impI 1); |
6070 | 1514 |
by (asm_full_simp_tac(simpset() addsimps |
1515 |
[le0_iff, e_gr_eq, id_type RS comp_id]) 1); |
|
1623 | 1516 |
by (asm_simp_tac(ZF_ss addsimps[le_succ_iff]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1517 |
by (rtac impI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1518 |
by (etac disjE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1519 |
by (etac impE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1520 |
by (assume_tac 1); |
5136 | 1521 |
by (asm_simp_tac(ZF_ss addsimps[add_succ_right, e_gr_add, add_type,nat_succI]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1522 |
(* Again and again, simplification is a pain. When does it work, when not? *) |
2034 | 1523 |
by (stac e_gr_le 1); |
5136 | 1524 |
brr[add_le_mono,nat_le_refl,add_type,nat_succI] 1; |
2034 | 1525 |
by (stac comp_assoc 1); |
5136 | 1526 |
brr[comp_mono_eq,refl] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1527 |
(* New direct subgoal *) |
5136 | 1528 |
by (asm_simp_tac(ZF_ss addsimps[e_gr_eq,add_type,nat_succI]) 1); |
2034 | 1529 |
by (stac comp_id 1); (* simp cannot unify/inst right, use brr below(?). *) |
5136 | 1530 |
by (REPEAT (ares_tac [e_gr_fun,add_type,refl,add_le_self,nat_succI] 1)); |
3425 | 1531 |
qed "e_gr_split_add_lemma"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1532 |
|
5136 | 1533 |
Goal "[| m le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
1534 |
\ e_gr(DD,ee,n#+k,n) = e_gr(DD,ee,n#+m,n) O e_gr(DD,ee,n#+k,n#+m)"; |
|
1535 |
by (blast_tac (claset() addIs [e_gr_split_add_lemma RS mp]) 1); |
|
1536 |
qed "e_gr_split_add"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1537 |
|
5136 | 1538 |
Goal "[|m le n; emb_chain(DD,ee); m:nat; n:nat|] ==> \ |
1539 |
\ e_less(DD,ee,m,n):cont(DD`m,DD`n)"; |
|
1540 |
by (blast_tac (claset() addIs [emb_cont, emb_e_less]) 1); |
|
1541 |
qed "e_less_cont"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1542 |
|
6070 | 1543 |
Goal (* e_gr_cont *) |
1544 |
"[|n le m; emb_chain(DD,ee); m:nat; n:nat|] ==> \ |
|
1545 |
\ e_gr(DD,ee,m,n):cont(DD`m,DD`n)"; |
|
1546 |
by (etac rev_mp 1); |
|
1547 |
by (induct_tac "m" 1); |
|
1548 |
by (asm_full_simp_tac(simpset() addsimps [le0_iff,e_gr_eq,nat_0I]) 1); |
|
5136 | 1549 |
brr[impI,id_cont,emb_chain_cpo,nat_0I] 1; |
4091 | 1550 |
by (asm_full_simp_tac(simpset() addsimps[le_succ_iff]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1551 |
by (etac disjE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1552 |
by (etac impE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1553 |
by (assume_tac 1); |
5136 | 1554 |
by (asm_simp_tac(simpset() addsimps[e_gr_le]) 1); |
1555 |
brr[comp_pres_cont,Rp_cont,emb_chain_cpo,emb_chain_emb,nat_succI] 1; |
|
1556 |
by (asm_simp_tac(simpset() addsimps[e_gr_eq,nat_succI]) 1); |
|
1557 |
by (auto_tac (claset() addIs [id_cont,emb_chain_cpo], simpset())); |
|
3425 | 1558 |
qed "e_gr_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1559 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1560 |
(* Considerably shorter.... 57 against 26 *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1561 |
|
5136 | 1562 |
Goal (* e_less_e_gr_split_add *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1563 |
"[|n le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1564 |
\ e_less(DD,ee,m,m#+n) = e_gr(DD,ee,m#+k,m#+n) O e_less(DD,ee,m,m#+k)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1565 |
(* Use mp to prepare for induction. *) |
6070 | 1566 |
by (etac rev_mp 1); |
1567 |
by (induct_tac "k" 1); |
|
1568 |
by (asm_full_simp_tac(simpset() addsimps |
|
1569 |
[e_gr_eq, e_less_eq, id_type RS id_comp]) 1); |
|
1570 |
by (simp_tac(ZF_ss addsimps[le_succ_iff]) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1571 |
by (rtac impI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1572 |
by (etac disjE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1573 |
by (etac impE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1574 |
by (assume_tac 1); |
5136 | 1575 |
by (asm_simp_tac(ZF_ss addsimps[add_succ_right, e_gr_le, e_less_le, add_le_self,nat_le_refl,add_le_mono,add_type]) 1); |
2034 | 1576 |
by (stac comp_assoc 1); |
1623 | 1577 |
by (res_inst_tac[("s1","ee`(m#+x)")](comp_assoc RS subst) 1); |
2034 | 1578 |
by (stac embRp_eq 1); |
5136 | 1579 |
brr[emb_chain_emb,add_type,emb_chain_cpo,nat_succI] 1; |
2034 | 1580 |
by (stac id_comp 1); |
5136 | 1581 |
brr[e_less_cont RS cont_fun, add_type,add_le_self,refl] 1; |
1582 |
by (asm_full_simp_tac(ZF_ss addsimps[e_gr_eq,nat_succI,add_type]) 1); |
|
2034 | 1583 |
by (stac id_comp 1); |
5136 | 1584 |
by (REPEAT (ares_tac [e_less_cont RS cont_fun, add_type, |
1585 |
nat_succI,add_le_self,refl] 1)); |
|
3425 | 1586 |
qed "e_less_e_gr_split_add"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1587 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1588 |
(* Again considerably shorter, and easy to obtain from the previous thm. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1589 |
|
5136 | 1590 |
Goal (* e_gr_e_less_split_add *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1591 |
"[|m le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1592 |
\ e_gr(DD,ee,n#+m,n) = e_gr(DD,ee,n#+k,n) O e_less(DD,ee,n#+m,n#+k)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1593 |
(* Use mp to prepare for induction. *) |
6070 | 1594 |
by (etac rev_mp 1); |
1595 |
by (induct_tac "k" 1); |
|
4091 | 1596 |
by (asm_full_simp_tac(simpset() addsimps |
6070 | 1597 |
[e_gr_eq, e_less_eq, id_type RS id_comp]) 1); |
1623 | 1598 |
by (simp_tac(ZF_ss addsimps[le_succ_iff]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1599 |
by (rtac impI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1600 |
by (etac disjE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1601 |
by (etac impE 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1602 |
by (assume_tac 1); |
5136 | 1603 |
by (asm_simp_tac(ZF_ss addsimps[add_succ_right, e_gr_le, e_less_le, add_le_self,nat_le_refl,add_le_mono,add_type]) 1); |
2034 | 1604 |
by (stac comp_assoc 1); |
1623 | 1605 |
by (res_inst_tac[("s1","ee`(n#+x)")](comp_assoc RS subst) 1); |
2034 | 1606 |
by (stac embRp_eq 1); |
5136 | 1607 |
brr[emb_chain_emb,add_type,emb_chain_cpo,nat_succI] 1; |
2034 | 1608 |
by (stac id_comp 1); |
5136 | 1609 |
brr[e_less_cont RS cont_fun, add_type, add_le_mono, nat_le_refl, refl] 1; |
1610 |
by (asm_full_simp_tac(ZF_ss addsimps[e_less_eq,nat_succI,add_type]) 1); |
|
2034 | 1611 |
by (stac comp_id 1); |
5136 | 1612 |
by (REPEAT (ares_tac [e_gr_cont RS cont_fun, add_type,nat_succI,add_le_self, |
1613 |
refl] 1)); |
|
3425 | 1614 |
qed "e_gr_e_less_split_add"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1615 |
|
2469 | 1616 |
|
5136 | 1617 |
Goalw [eps_def] (* emb_eps *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1618 |
"[|m le n; emb_chain(DD,ee); m:nat; n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1619 |
\ emb(DD`m,DD`n,eps(DD,ee,m,n))"; |
5136 | 1620 |
by (asm_simp_tac(simpset()) 1); |
1621 |
brr[emb_e_less] 1; |
|
3425 | 1622 |
qed "emb_eps"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1623 |
|
5136 | 1624 |
Goalw [eps_def] (* eps_fun *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1625 |
"[|emb_chain(DD,ee); m:nat; n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1626 |
\ eps(DD,ee,m,n): set(DD`m)->set(DD`n)"; |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
1627 |
by (rtac (split_if RS iffD2) 1); |
4152 | 1628 |
by Safe_tac; |
5136 | 1629 |
brr[e_less_cont RS cont_fun] 1; |
1630 |
by (auto_tac (claset() addIs [not_le_iff_lt RS iffD1 RS leI, e_gr_fun,nat_into_Ord], simpset())); |
|
3425 | 1631 |
qed "eps_fun"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1632 |
|
5136 | 1633 |
Goalw [eps_def] "n:nat ==> eps(DD,ee,n,n) = id(set(DD`n))"; |
1634 |
by (asm_simp_tac(simpset() addsimps [e_less_eq]) 1); |
|
1635 |
qed "eps_id"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1636 |
|
5136 | 1637 |
Goalw [eps_def] |
1638 |
"[|m:nat; n:nat|] ==> eps(DD,ee,m,m#+n) = e_less(DD,ee,m,m#+n)"; |
|
1639 |
by (asm_simp_tac(simpset() addsimps [add_le_self]) 1); |
|
1640 |
qed "eps_e_less_add"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1641 |
|
5136 | 1642 |
Goalw [eps_def] |
1643 |
"[|m le n; m:nat; n:nat|] ==> eps(DD,ee,m,n) = e_less(DD,ee,m,n)"; |
|
1644 |
by (Asm_simp_tac 1); |
|
1645 |
qed "eps_e_less"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1646 |
|
5136 | 1647 |
Goalw [eps_def] (* eps_e_gr_add *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1648 |
"[|n:nat; k:nat|] ==> eps(DD,ee,n#+k,n) = e_gr(DD,ee,n#+k,n)"; |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
1649 |
by (rtac (split_if RS iffD2) 1); |
4152 | 1650 |
by Safe_tac; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1651 |
by (etac leE 1); |
5136 | 1652 |
by (asm_simp_tac(simpset() addsimps[e_less_eq,e_gr_eq]) 2); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1653 |
(* Must control rewriting by instantiating a variable. *) |
8551 | 1654 |
by (asm_full_simp_tac |
1655 |
(simpset() addsimps |
|
1656 |
[inst "i1" "n" (nat_into_Ord RS not_le_iff_lt RS iff_sym), |
|
5136 | 1657 |
add_le_self]) 1); |
3425 | 1658 |
qed "eps_e_gr_add"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1659 |
|
5136 | 1660 |
Goal (* eps_e_gr *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1661 |
"[|n le m; m:nat; n:nat|] ==> eps(DD,ee,m,n) = e_gr(DD,ee,m,n)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1662 |
by (rtac le_exists 1); |
5136 | 1663 |
by (assume_tac 1); |
1664 |
by (asm_simp_tac(simpset() addsimps[eps_e_gr_add]) 1); |
|
1665 |
by (REPEAT (assume_tac 1)); |
|
3425 | 1666 |
qed "eps_e_gr"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1667 |
|
9264 | 1668 |
val prems = Goal (* eps_succ_ee *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1669 |
"[|!!n. n:nat ==> emb(DD`n,DD`succ(n),ee`n); m:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1670 |
\ eps(DD,ee,m,succ(m)) = ee`m"; |
5529 | 1671 |
by (asm_simp_tac(simpset() addsimps eps_e_less::le_succ_iff::e_less_succ_emb:: |
1672 |
prems) 1); |
|
3425 | 1673 |
qed "eps_succ_ee"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1674 |
|
5136 | 1675 |
Goal (* eps_succ_Rp *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1676 |
"[|emb_chain(DD,ee); m:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1677 |
\ eps(DD,ee,succ(m),m) = Rp(DD`m,DD`succ(m),ee`m)"; |
5529 | 1678 |
by (asm_simp_tac(simpset() addsimps eps_e_gr::le_succ_iff::e_gr_succ_emb:: |
1679 |
prems) 1); |
|
3425 | 1680 |
qed "eps_succ_Rp"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1681 |
|
5136 | 1682 |
Goal (* eps_cont *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1683 |
"[|emb_chain(DD,ee); m:nat; n:nat|] ==> eps(DD,ee,m,n): cont(DD`m,DD`n)"; |
5136 | 1684 |
by (res_inst_tac [("i","m"),("j","n")] nat_linear_le 1); |
1685 |
by (ALLGOALS (asm_simp_tac(simpset() addsimps [eps_e_less,e_less_cont, |
|
1686 |
eps_e_gr,e_gr_cont]))); |
|
3425 | 1687 |
qed "eps_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1688 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1689 |
(* Theorems about splitting. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1690 |
|
5136 | 1691 |
Goal (* eps_split_add_left *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1692 |
"[|n le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1693 |
\ eps(DD,ee,m,m#+k) = eps(DD,ee,m#+n,m#+k) O eps(DD,ee,m,m#+n)"; |
4091 | 1694 |
by (asm_simp_tac(simpset() addsimps |
5136 | 1695 |
[eps_e_less,add_le_self,add_le_mono]) 1); |
1696 |
by (auto_tac (claset() addIs [e_less_split_add], simpset())); |
|
3425 | 1697 |
qed "eps_split_add_left"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1698 |
|
5136 | 1699 |
Goal (* eps_split_add_left_rev *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1700 |
"[|n le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1701 |
\ eps(DD,ee,m,m#+n) = eps(DD,ee,m#+k,m#+n) O eps(DD,ee,m,m#+k)"; |
4091 | 1702 |
by (asm_simp_tac(simpset() addsimps |
5136 | 1703 |
[eps_e_less_add,eps_e_gr,add_le_self,add_le_mono]) 1); |
1704 |
by (auto_tac (claset() addIs [e_less_e_gr_split_add], simpset())); |
|
3425 | 1705 |
qed "eps_split_add_left_rev"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1706 |
|
5136 | 1707 |
Goal (* eps_split_add_right *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1708 |
"[|m le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1709 |
\ eps(DD,ee,n#+k,n) = eps(DD,ee,n#+m,n) O eps(DD,ee,n#+k,n#+m)"; |
4091 | 1710 |
by (asm_simp_tac(simpset() addsimps |
5136 | 1711 |
[eps_e_gr,add_le_self,add_le_mono]) 1); |
1712 |
by (auto_tac (claset() addIs [e_gr_split_add], simpset())); |
|
3425 | 1713 |
qed "eps_split_add_right"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1714 |
|
5136 | 1715 |
Goal (* eps_split_add_right_rev *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1716 |
"[|m le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1717 |
\ eps(DD,ee,n#+m,n) = eps(DD,ee,n#+k,n) O eps(DD,ee,n#+m,n#+k)"; |
4091 | 1718 |
by (asm_simp_tac(simpset() addsimps |
5136 | 1719 |
[eps_e_gr_add,eps_e_less,add_le_self,add_le_mono]) 1); |
1720 |
by (auto_tac (claset() addIs [e_gr_e_less_split_add], simpset())); |
|
3425 | 1721 |
qed "eps_split_add_right_rev"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1722 |
|
9548 | 1723 |
(* Arithmetic *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1724 |
|
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1725 |
val [prem1,prem2,prem3,prem4] = Goal |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1726 |
"[| n le k; k le m; \ |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1727 |
\ !!p q. [|p le q; k=n#+p; m=n#+q; p:nat; q:nat|] ==> R; \ |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1728 |
\ m:nat |]==>R"; |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1729 |
by (rtac (prem1 RS le_exists) 1); |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1730 |
by (simp_tac (simpset() addsimps [prem2 RS lt_nat_in_nat, prem4]) 2); |
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1731 |
by (rtac ([prem1,prem2] MRS le_trans RS le_exists) 1); |
9548 | 1732 |
by (rtac prem4 2); |
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1733 |
by (rtac prem3 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1734 |
by (assume_tac 2); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1735 |
by (assume_tac 2); |
9491
1a36151ee2fc
natify, a coercion to reduce the number of type constraints in arithmetic
paulson
parents:
9264
diff
changeset
|
1736 |
by (cut_facts_tac [prem1,prem2] 1); |
9548 | 1737 |
by Auto_tac; |
3425 | 1738 |
qed "le_exists_lemma"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1739 |
|
5136 | 1740 |
Goal (* eps_split_left_le *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1741 |
"[|m le k; k le n; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1742 |
\ eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1743 |
by (rtac le_exists_lemma 1); |
5136 | 1744 |
by (REPEAT (assume_tac 1)); |
2469 | 1745 |
by (Asm_simp_tac 1); |
5136 | 1746 |
by (auto_tac (claset() addIs [eps_split_add_left], simpset())); |
3425 | 1747 |
qed "eps_split_left_le"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1748 |
|
5136 | 1749 |
Goal (* eps_split_left_le_rev *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1750 |
"[|m le n; n le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1751 |
\ eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1752 |
by (rtac le_exists_lemma 1); |
5136 | 1753 |
by (REPEAT (assume_tac 1)); |
2469 | 1754 |
by (Asm_simp_tac 1); |
5136 | 1755 |
by (auto_tac (claset() addIs [eps_split_add_left_rev], simpset())); |
3425 | 1756 |
qed "eps_split_left_le_rev"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1757 |
|
5136 | 1758 |
Goal (* eps_split_right_le *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1759 |
"[|n le k; k le m; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1760 |
\ eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1761 |
by (rtac le_exists_lemma 1); |
5136 | 1762 |
by (REPEAT (assume_tac 1)); |
2469 | 1763 |
by (Asm_simp_tac 1); |
5136 | 1764 |
by (auto_tac (claset() addIs [eps_split_add_right], simpset())); |
3425 | 1765 |
qed "eps_split_right_le"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1766 |
|
5136 | 1767 |
Goal (* eps_split_right_le_rev *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1768 |
"[|n le m; m le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1769 |
\ eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1770 |
by (rtac le_exists_lemma 1); |
5136 | 1771 |
by (REPEAT (assume_tac 1)); |
2469 | 1772 |
by (Asm_simp_tac 1); |
5136 | 1773 |
by (auto_tac (claset() addIs [eps_split_add_right_rev], simpset())); |
3425 | 1774 |
qed "eps_split_right_le_rev"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1775 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1776 |
(* The desired two theorems about `splitting'. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1777 |
|
5136 | 1778 |
Goal (* eps_split_left *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1779 |
"[|m le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1780 |
\ eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"; |
2469 | 1781 |
by (rtac nat_linear_le 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1782 |
by (rtac eps_split_right_le_rev 4); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1783 |
by (assume_tac 4); |
2469 | 1784 |
by (rtac nat_linear_le 3); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1785 |
by (rtac eps_split_left_le 5); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1786 |
by (assume_tac 6); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1787 |
by (rtac eps_split_left_le_rev 10); |
5136 | 1788 |
by (REPEAT (assume_tac 1)); (* 20 trivial subgoals *) |
3425 | 1789 |
qed "eps_split_left"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1790 |
|
5136 | 1791 |
Goal (* eps_split_right *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1792 |
"[|n le k; emb_chain(DD,ee); m:nat; n:nat; k:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1793 |
\ eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"; |
2469 | 1794 |
by (rtac nat_linear_le 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1795 |
by (rtac eps_split_left_le_rev 3); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1796 |
by (assume_tac 3); |
2469 | 1797 |
by (rtac nat_linear_le 8); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1798 |
by (rtac eps_split_right_le 10); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1799 |
by (assume_tac 11); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1800 |
by (rtac eps_split_right_le_rev 15); |
5136 | 1801 |
by (REPEAT (assume_tac 1)); (* 20 trivial subgoals *) |
3425 | 1802 |
qed "eps_split_right"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1803 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1804 |
(*----------------------------------------------------------------------*) |
1461 | 1805 |
(* That was eps: D_m -> D_n, NEXT rho_emb: D_n -> Dinf. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1806 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1807 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1808 |
(* Considerably shorter. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1809 |
|
5136 | 1810 |
Goalw [rho_emb_def] (* rho_emb_fun *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1811 |
"[|emb_chain(DD,ee); n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1812 |
\ rho_emb(DD,ee,n): set(DD`n) -> set(Dinf(DD,ee))"; |
5136 | 1813 |
brr[lam_type, DinfI, eps_cont RS cont_fun RS apply_type] 1; |
2469 | 1814 |
by (Asm_simp_tac 1); |
5136 | 1815 |
by (res_inst_tac [("i","succ(na)"),("j","n")] nat_linear_le 1); |
1816 |
by (Blast_tac 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1817 |
by (assume_tac 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1818 |
(* The easiest would be to apply add1 everywhere also in the assumptions, |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1819 |
but since x le y is x<succ(y) simplification does too much with this thm. *) |
2034 | 1820 |
by (stac eps_split_right_le 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1821 |
by (assume_tac 2); |
6153 | 1822 |
by (asm_simp_tac(FOL_ss addsimps [add1]) 1); |
5136 | 1823 |
brr[add_le_self,nat_0I,nat_succI] 1; |
1824 |
by (asm_simp_tac(simpset() addsimps[eps_succ_Rp]) 1); |
|
2034 | 1825 |
by (stac comp_fun_apply 1); |
5136 | 1826 |
brr[eps_fun, nat_succI, Rp_cont RS cont_fun, emb_chain_emb, emb_chain_cpo,refl] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1827 |
(* Now the second part of the proof. Slightly different than HOL. *) |
5136 | 1828 |
by (asm_simp_tac(simpset() addsimps[eps_e_less,nat_succI]) 1); |
1623 | 1829 |
by (etac (le_iff RS iffD1 RS disjE) 1); |
5136 | 1830 |
by (asm_simp_tac(simpset() addsimps[e_less_le]) 1); |
2034 | 1831 |
by (stac comp_fun_apply 1); |
5136 | 1832 |
brr[e_less_cont,cont_fun,emb_chain_emb,emb_cont] 1; |
2034 | 1833 |
by (stac embRp_eq_thm 1); |
5136 | 1834 |
brr[emb_chain_emb, e_less_cont RS cont_fun RS apply_type, emb_chain_cpo, nat_succI] 1; |
1835 |
by (asm_simp_tac(simpset() addsimps[eps_e_less]) 1); |
|
1836 |
by (dtac asm_rl 1); |
|
9210 | 1837 |
by (asm_full_simp_tac(simpset() addsimps[eps_succ_Rp, e_less_eq, id_conv, nat_succI]) 1); |
3425 | 1838 |
qed "rho_emb_fun"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1839 |
|
9264 | 1840 |
Goalw [rho_emb_def] |
1841 |
"x:set(DD`n) ==> rho_emb(DD,ee,n)`x = (lam m:nat. eps(DD,ee,n,m)`x)"; |
|
1842 |
by (Asm_simp_tac 1); |
|
1843 |
qed "rho_emb_apply1"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1844 |
|
9264 | 1845 |
Goalw [rho_emb_def] |
1846 |
"[|x:set(DD`n); m:nat|] ==> rho_emb(DD,ee,n)`x`m = eps(DD,ee,n,m)`x"; |
|
1847 |
by (Asm_simp_tac 1); |
|
1848 |
qed "rho_emb_apply2"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1849 |
|
9264 | 1850 |
Goal "[| x:set(DD`n); n:nat|] ==> rho_emb(DD,ee,n)`x`n = x"; |
1851 |
by (asm_simp_tac(simpset() addsimps[rho_emb_apply2,eps_id]) 1); |
|
1852 |
qed "rho_emb_id"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1853 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1854 |
(* Shorter proof, 23 against 62. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1855 |
|
5136 | 1856 |
Goal (* rho_emb_cont *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1857 |
"[|emb_chain(DD,ee); n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1858 |
\ rho_emb(DD,ee,n): cont(DD`n,Dinf(DD,ee))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1859 |
by (rtac contI 1); |
5136 | 1860 |
brr[rho_emb_fun] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1861 |
by (rtac rel_DinfI 1); |
1623 | 1862 |
by (SELECT_GOAL(rewtac rho_emb_def) 1); |
2469 | 1863 |
by (Asm_simp_tac 1); |
5136 | 1864 |
brr[eps_cont RS cont_mono, Dinf_prod,apply_type,rho_emb_fun] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1865 |
(* Continuity, different order, slightly different proofs. *) |
2034 | 1866 |
by (stac lub_Dinf 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1867 |
by (rtac chainI 1); |
5136 | 1868 |
brr[lam_type, rho_emb_fun RS apply_type, chain_in] 1; |
2469 | 1869 |
by (Asm_simp_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1870 |
by (rtac rel_DinfI 1); |
5136 | 1871 |
by (asm_simp_tac(simpset() addsimps [rho_emb_apply2,chain_in]) 1); |
1872 |
brr[eps_cont RS cont_mono, chain_rel, Dinf_prod, rho_emb_fun RS apply_type, chain_in,nat_succI] 1; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1873 |
(* Now, back to the result of applying lub_Dinf *) |
5136 | 1874 |
by (asm_simp_tac(simpset() addsimps [rho_emb_apply2,chain_in]) 1); |
2034 | 1875 |
by (stac rho_emb_apply1 1); |
5136 | 1876 |
brr[cpo_lub RS islub_in, emb_chain_cpo] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1877 |
by (rtac fun_extension 1); |
5136 | 1878 |
brr[lam_type, eps_cont RS cont_fun RS apply_type, cpo_lub RS islub_in, emb_chain_cpo] 1; |
1879 |
brr[cont_chain,eps_cont,emb_chain_cpo] 1; |
|
2469 | 1880 |
by (Asm_simp_tac 1); |
5136 | 1881 |
by (asm_simp_tac(simpset() addsimps[eps_cont RS cont_lub]) 1); |
3425 | 1882 |
qed "rho_emb_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1883 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1884 |
(* 32 vs 61, using safe_tac with imp in asm would be unfortunate (5steps) *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1885 |
|
5136 | 1886 |
Goal (* lemma1 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1887 |
"[|m le n; emb_chain(DD,ee); x:set(Dinf(DD,ee)); m:nat; n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1888 |
\ rel(DD`n,e_less(DD,ee,m,n)`(x`m),x`n)"; |
5136 | 1889 |
by (etac rev_mp 1); (* For induction proof *) |
6070 | 1890 |
by (induct_tac "n" 1); |
1891 |
by (rtac impI 1); |
|
1892 |
by (asm_full_simp_tac (simpset() addsimps [e_less_eq]) 1); |
|
6169 | 1893 |
by (stac id_conv 1); |
5136 | 1894 |
brr[apply_type,Dinf_prod,cpo_refl,emb_chain_cpo,nat_0I] 1; |
4091 | 1895 |
by (asm_full_simp_tac (simpset() addsimps [le_succ_iff]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1896 |
by (rtac impI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1897 |
by (etac disjE 1); |
1623 | 1898 |
by (dtac mp 1 THEN atac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1899 |
by (rtac cpo_trans 1); |
2034 | 1900 |
by (stac e_less_le 2); |
5136 | 1901 |
brr[emb_chain_cpo,nat_succI] 1; |
2034 | 1902 |
by (stac comp_fun_apply 1); |
5136 | 1903 |
brr[emb_chain_emb RS emb_cont, e_less_cont, cont_fun, apply_type, Dinf_prod] 1; |
1623 | 1904 |
by (res_inst_tac[("y","x`xa")](emb_chain_emb RS emb_cont RS cont_mono) 1); |
5136 | 1905 |
brr[e_less_cont RS cont_fun, apply_type,Dinf_prod] 1; |
1623 | 1906 |
by (res_inst_tac[("x1","x"),("n1","xa")](Dinf_eq RS subst) 1); |
1907 |
by (rtac (comp_fun_apply RS subst) 3); |
|
1908 |
by (res_inst_tac |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1909 |
[("P", |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1910 |
"%z. rel(DD ` succ(xa), \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1911 |
\ (ee ` xa O Rp(?DD46(xa) ` xa,?DD46(xa) ` succ(xa),?ee46(xa) ` xa)) ` \ |
6169 | 1912 |
\ (x ` succ(xa)),z)")](id_conv RS subst) 6); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1913 |
by (rtac rel_cf 7); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1914 |
(* Dinf and cont_fun doesn't go well together, both Pi(_,%x._). *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1915 |
(* brr solves 11 of 12 subgoals *) |
5136 | 1916 |
brr[Dinf_prod RS apply_type, cont_fun, Rp_cont, e_less_cont, emb_cont, emb_chain_emb, emb_chain_cpo, apply_type, embRp_rel, disjI1 RS (le_succ_iff RS iffD2), nat_succI] 1; |
1917 |
by (asm_full_simp_tac (simpset() addsimps [e_less_eq]) 1); |
|
6169 | 1918 |
by (stac id_conv 1); |
5136 | 1919 |
by (auto_tac (claset() addIs [apply_type,Dinf_prod,emb_chain_cpo], simpset())); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1920 |
val lemma1 = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1921 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1922 |
(* 18 vs 40 *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1923 |
|
5136 | 1924 |
Goal (* lemma2 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1925 |
"[|n le m; emb_chain(DD,ee); x:set(Dinf(DD,ee)); m:nat; n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1926 |
\ rel(DD`n,e_gr(DD,ee,m,n)`(x`m),x`n)"; |
5136 | 1927 |
by (etac rev_mp 1); (* For induction proof *) |
6070 | 1928 |
by (induct_tac "m" 1); |
1929 |
by (rtac impI 1); |
|
1930 |
by (asm_full_simp_tac (simpset() addsimps [e_gr_eq]) 1); |
|
6169 | 1931 |
by (stac id_conv 1); |
5136 | 1932 |
brr[apply_type,Dinf_prod,cpo_refl,emb_chain_cpo,nat_0I] 1; |
4091 | 1933 |
by (asm_full_simp_tac (simpset() addsimps [le_succ_iff]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1934 |
by (rtac impI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1935 |
by (etac disjE 1); |
1623 | 1936 |
by (dtac mp 1 THEN atac 1); |
2034 | 1937 |
by (stac e_gr_le 1); |
1938 |
by (stac comp_fun_apply 4); |
|
1939 |
by (stac Dinf_eq 7); |
|
5136 | 1940 |
brr[emb_chain_emb, emb_chain_cpo, Rp_cont, e_gr_cont, cont_fun, emb_cont, apply_type,Dinf_prod,nat_succI] 1; |
1941 |
by (asm_full_simp_tac (simpset() addsimps [e_gr_eq]) 1); |
|
6169 | 1942 |
by (stac id_conv 1); |
5136 | 1943 |
by (auto_tac (claset() addIs [apply_type,Dinf_prod,emb_chain_cpo], simpset())); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1944 |
val lemma2 = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1945 |
|
5136 | 1946 |
Goalw [eps_def] (* eps1 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1947 |
"[|emb_chain(DD,ee); x:set(Dinf(DD,ee)); m:nat; n:nat|] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1948 |
\ rel(DD`n,eps(DD,ee,m,n)`(x`m),x`n)"; |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
1949 |
by (split_tac [split_if] 1); |
5136 | 1950 |
brr[conjI, impI, lemma1, not_le_iff_lt RS iffD1 RS leI RS lemma2, nat_into_Ord] 1; |
3425 | 1951 |
qed "eps1"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1952 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1953 |
(* The following theorem is needed/useful due to type check for rel_cfI, |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1954 |
but also elsewhere. |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1955 |
Look for occurences of rel_cfI, rel_DinfI, etc to evaluate the problem. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1956 |
|
5136 | 1957 |
Goal (* lam_Dinf_cont *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1958 |
"[| emb_chain(DD,ee); n:nat |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1959 |
\ (lam x:set(Dinf(DD,ee)). x`n) : cont(Dinf(DD,ee),DD`n)"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1960 |
by (rtac contI 1); |
5136 | 1961 |
brr[lam_type,apply_type,Dinf_prod] 1; |
2469 | 1962 |
by (Asm_simp_tac 1); |
5136 | 1963 |
brr[rel_Dinf] 1; |
2034 | 1964 |
by (stac beta 1); |
5136 | 1965 |
by (auto_tac (claset() addIs [cpo_Dinf,islub_in,cpo_lub], simpset())); |
1966 |
by (asm_simp_tac(simpset() addsimps[chain_in,lub_Dinf]) 1); |
|
3425 | 1967 |
qed "lam_Dinf_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1968 |
|
5136 | 1969 |
Goalw [rho_proj_def] (* rho_projpair *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1970 |
"[| emb_chain(DD,ee); n:nat |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1971 |
\ projpair(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n),rho_proj(DD,ee,n))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1972 |
by (rtac projpairI 1); |
5136 | 1973 |
brr[rho_emb_cont] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1974 |
(* lemma used, introduced because same fact needed below due to rel_cfI. *) |
5136 | 1975 |
brr[lam_Dinf_cont] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1976 |
(*-----------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1977 |
(* This part is 7 lines, but 30 in HOL (75% reduction!) *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1978 |
by (rtac fun_extension 1); |
6169 | 1979 |
by (stac id_conv 3); |
2034 | 1980 |
by (stac comp_fun_apply 4); |
1981 |
by (stac beta 7); |
|
1982 |
by (stac rho_emb_id 8); |
|
5136 | 1983 |
brr[comp_fun, id_type, lam_type, rho_emb_fun, Dinf_prod RS apply_type, apply_type,refl] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1984 |
(*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1985 |
by (rtac rel_cfI 1); (* ------------------>>>Yields type cond, not in HOL *) |
6169 | 1986 |
by (stac id_conv 1); |
2034 | 1987 |
by (stac comp_fun_apply 2); |
1988 |
by (stac beta 5); |
|
1989 |
by (stac rho_emb_apply1 6); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1990 |
by (rtac rel_DinfI 7); (* ------------------>>>Yields type cond, not in HOL *) |
2034 | 1991 |
by (stac beta 7); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1992 |
brr(eps1::lam_type::rho_emb_fun::eps_fun:: (* Dinf_prod bad with lam_type *) |
5136 | 1993 |
[Dinf_prod RS apply_type, refl]) 1; |
1994 |
brr[apply_type, eps_fun, Dinf_prod, comp_pres_cont, rho_emb_cont, lam_Dinf_cont,id_cont,cpo_Dinf,emb_chain_cpo] 1; |
|
3425 | 1995 |
qed "rho_projpair"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1996 |
|
5136 | 1997 |
Goalw [emb_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
1998 |
"[| emb_chain(DD,ee); n:nat |] ==> emb(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n))"; |
5136 | 1999 |
by (auto_tac (claset() addIs [exI,rho_projpair], simpset())); |
3425 | 2000 |
qed "emb_rho_emb"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2001 |
|
5268 | 2002 |
Goal "[| emb_chain(DD,ee); n:nat |] ==> \ |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2003 |
\ rho_proj(DD,ee,n) : cont(Dinf(DD,ee),DD`n)"; |
5136 | 2004 |
by (auto_tac (claset() addIs [rho_projpair,projpair_p_cont], simpset())); |
3425 | 2005 |
qed "rho_proj_cont"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2006 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2007 |
(*----------------------------------------------------------------------*) |
1461 | 2008 |
(* Commutivity and universality. *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2009 |
(*----------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2010 |
|
5136 | 2011 |
val prems = Goalw [commute_def] (* commuteI *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2012 |
"[| !!n. n:nat ==> emb(DD`n,E,r(n)); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2013 |
\ !!m n. [|m le n; m:nat; n:nat|] ==> r(n) O eps(DD,ee,m,n) = r(m) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2014 |
\ commute(DD,ee,E,r)"; |
4152 | 2015 |
by Safe_tac; |
5136 | 2016 |
by (REPEAT (ares_tac prems 1)); |
3425 | 2017 |
qed "commuteI"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2018 |
|
5136 | 2019 |
Goalw [commute_def] (* commute_emb *) |
2020 |
"[| commute(DD,ee,E,r); n:nat |] ==> emb(DD`n,E,r(n))"; |
|
2469 | 2021 |
by (Fast_tac 1); |
3425 | 2022 |
qed "commute_emb"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2023 |
|
6176
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6169
diff
changeset
|
2024 |
AddTCs [commute_emb]; |
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6169
diff
changeset
|
2025 |
|
5136 | 2026 |
Goalw [commute_def] (* commute_eq *) |
2027 |
"[| commute(DD,ee,E,r); m le n; m:nat; n:nat |] ==> \ |
|
2028 |
\ r(n) O eps(DD,ee,m,n) = r(m) "; |
|
2029 |
by (Blast_tac 1); |
|
3425 | 2030 |
qed "commute_eq"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2031 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2032 |
(* Shorter proof: 11 vs 46 lines. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2033 |
|
5136 | 2034 |
Goal (* rho_emb_commute *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2035 |
"emb_chain(DD,ee) ==> commute(DD,ee,Dinf(DD,ee),rho_emb(DD,ee))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2036 |
by (rtac commuteI 1); |
5136 | 2037 |
brr[emb_rho_emb] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2038 |
by (rtac fun_extension 1); (* Manual instantiation in HOL. *) |
2034 | 2039 |
by (stac comp_fun_apply 3); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2040 |
by (rtac fun_extension 6); (* Next, clean up and instantiate unknowns *) |
5136 | 2041 |
brr[comp_fun,rho_emb_fun,eps_fun,Dinf_prod,apply_type] 1; |
1623 | 2042 |
by (asm_simp_tac |
5136 | 2043 |
(simpset() addsimps[rho_emb_apply2, eps_fun RS apply_type]) 1); |
1623 | 2044 |
by (rtac (comp_fun_apply RS subst) 1); |
2045 |
by (rtac (eps_split_left RS subst) 4); |
|
5136 | 2046 |
by (auto_tac (claset() addIs [eps_fun], simpset())); |
3425 | 2047 |
qed "rho_emb_commute"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2048 |
|
9264 | 2049 |
val prems = goal Arith.thy "n:nat ==> n le succ(n)"; |
2050 |
by (REPEAT (ares_tac ((disjI1 RS(le_succ_iff RS iffD2))::le_refl::nat_into_Ord::prems) 1)); |
|
2051 |
qed "le_succ"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2052 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2053 |
(* Shorter proof: 21 vs 83 (106 - 23, due to OAssoc complication) *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2054 |
|
5136 | 2055 |
Goal (* commute_chain *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2056 |
"[| commute(DD,ee,E,r); emb_chain(DD,ee); cpo(E) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2057 |
\ chain(cf(E,E),lam n:nat. r(n) O Rp(DD`n,E,r(n)))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2058 |
by (rtac chainI 1); |
5136 | 2059 |
by (blast_tac (claset() addIs [lam_type, cont_cf, comp_pres_cont, commute_emb, Rp_cont, emb_cont, emb_chain_cpo]) 1); |
2469 | 2060 |
by (Asm_simp_tac 1); |
1623 | 2061 |
by (res_inst_tac[("r1","r"),("m1","n")](commute_eq RS subst) 1); |
5136 | 2062 |
brr[le_succ,nat_succI] 1; |
2034 | 2063 |
by (stac Rp_comp 1); |
5136 | 2064 |
brr[emb_eps,commute_emb,emb_chain_cpo,le_succ,nat_succI] 1; |
1623 | 2065 |
by (rtac (comp_assoc RS subst) 1); (* Remember that comp_assoc is simpler in Isa *) |
2066 |
by (res_inst_tac[("r1","r(succ(n))")](comp_assoc RS ssubst) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2067 |
by (rtac comp_mono 1); |
5136 | 2068 |
by (REPEAT |
2069 |
(blast_tac (claset() addIs [comp_pres_cont, eps_cont, emb_eps, |
|
2070 |
commute_emb, Rp_cont, emb_cont, |
|
2071 |
emb_chain_cpo,le_succ]) 1)); |
|
1623 | 2072 |
by (res_inst_tac[("b","r(succ(n))")](comp_id RS subst) 1); (* 1 subst too much *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2073 |
by (rtac comp_mono 2); |
5136 | 2074 |
by (REPEAT |
2075 |
(blast_tac (claset() addIs [comp_pres_cont, eps_cont, emb_eps, emb_id, |
|
2076 |
commute_emb, Rp_cont, emb_cont, cont_fun, |
|
2077 |
emb_chain_cpo,le_succ]) 1)); |
|
2078 |
by (stac comp_id 1); (* Undoes "1 subst too much", typing next anyway *) |
|
2079 |
by (REPEAT |
|
2080 |
(blast_tac (claset() addIs [cont_fun, Rp_cont, emb_cont, commute_emb, |
|
2081 |
cont_cf, cpo_cf, emb_chain_cpo, |
|
2082 |
embRp_rel,emb_eps,le_succ]) 1)); |
|
3425 | 2083 |
qed "commute_chain"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2084 |
|
5136 | 2085 |
Goal (* rho_emb_chain *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2086 |
"emb_chain(DD,ee) ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2087 |
\ chain(cf(Dinf(DD,ee),Dinf(DD,ee)), \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2088 |
\ lam n:nat. rho_emb(DD,ee,n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n)))"; |
5136 | 2089 |
by (auto_tac (claset() addIs [commute_chain,rho_emb_commute,cpo_Dinf], simpset())); |
3425 | 2090 |
qed "rho_emb_chain"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2091 |
|
5136 | 2092 |
Goal "[| emb_chain(DD,ee); x:set(Dinf(DD,ee)) |] ==> \ |
2093 |
\ chain(Dinf(DD,ee), \ |
|
2094 |
\ lam n:nat. \ |
|
2095 |
\ (rho_emb(DD,ee,n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n)))`x)"; |
|
2096 |
by (dtac (rho_emb_chain RS chain_cf) 1); |
|
2097 |
by (assume_tac 1); |
|
2469 | 2098 |
by (Asm_full_simp_tac 1); |
3425 | 2099 |
qed "rho_emb_chain_apply1"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2100 |
|
5136 | 2101 |
Goal "[| chain(iprod(DD),X); emb_chain(DD,ee); n:nat |] ==> \ |
2102 |
\ chain(DD`n,lam m:nat. X `m `n)"; |
|
2103 |
by (auto_tac (claset() addIs [chain_iprod,emb_chain_cpo], simpset())); |
|
3425 | 2104 |
qed "chain_iprod_emb_chain"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2105 |
|
5136 | 2106 |
Goal (* rho_emb_chain_apply2 *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2107 |
"[| emb_chain(DD,ee); x:set(Dinf(DD,ee)); n:nat |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2108 |
\ chain \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2109 |
\ (DD`n, \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2110 |
\ lam xa:nat. \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2111 |
\ (rho_emb(DD, ee, xa) O Rp(DD ` xa, Dinf(DD, ee),rho_emb(DD, ee, xa))) ` \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2112 |
\ x ` n)"; |
5136 | 2113 |
by (forward_tac [rho_emb_chain_apply1 RS chain_Dinf RS chain_iprod_emb_chain] 1); |
2114 |
by Auto_tac; |
|
3425 | 2115 |
qed "rho_emb_chain_apply2"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2116 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2117 |
(* Shorter proof: 32 vs 72 (roughly), Isabelle proof has lemmas. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2118 |
|
5136 | 2119 |
Goal (* rho_emb_lub *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2120 |
"emb_chain(DD,ee) ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2121 |
\ lub(cf(Dinf(DD,ee),Dinf(DD,ee)), \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2122 |
\ lam n:nat. rho_emb(DD,ee,n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n))) = \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2123 |
\ id(set(Dinf(DD,ee)))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2124 |
by (rtac cpo_antisym 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2125 |
by (rtac cpo_cf 1); (* Instantiate variable, continued below (would loop otherwise) *) |
5136 | 2126 |
brr[cpo_Dinf] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2127 |
by (rtac islub_least 1); |
5136 | 2128 |
brr[cpo_lub,rho_emb_chain,cpo_cf,cpo_Dinf,isubI,cont_cf,id_cont] 1; |
2469 | 2129 |
by (Asm_simp_tac 1); |
5136 | 2130 |
brr[embRp_rel,emb_rho_emb,emb_chain_cpo,cpo_Dinf] 1; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2131 |
by (rtac rel_cfI 1); |
6169 | 2132 |
by (asm_simp_tac (simpset() addsimps[lub_cf,rho_emb_chain,cpo_Dinf]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2133 |
by (rtac rel_DinfI 1); (* Addtional assumptions *) |
2034 | 2134 |
by (stac lub_Dinf 1); |
5136 | 2135 |
brr[rho_emb_chain_apply1] 1; |
2136 |
brr[Dinf_prod, cpo_lub RS islub_in, id_cont, cpo_Dinf, cpo_cf, cf_cont, rho_emb_chain, rho_emb_chain_apply1, id_cont RS cont_cf] 2; |
|
2469 | 2137 |
by (Asm_simp_tac 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2138 |
by (rtac dominate_islub 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2139 |
by (rtac cpo_lub 3); |
5136 | 2140 |
brr[rho_emb_chain_apply2,emb_chain_cpo] 3; |
1623 | 2141 |
by (res_inst_tac[("x1","x`n")](chain_const RS chain_fun) 3); |
5136 | 2142 |
brr[islub_const, apply_type, Dinf_prod, emb_chain_cpo, chain_fun, rho_emb_chain_apply2] 2; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2143 |
by (rtac dominateI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2144 |
by (assume_tac 1); |
2469 | 2145 |
by (Asm_simp_tac 1); |
2034 | 2146 |
by (stac comp_fun_apply 1); |
5136 | 2147 |
brr[cont_fun,Rp_cont,emb_cont,emb_rho_emb,cpo_Dinf,emb_chain_cpo] 1; |
2034 | 2148 |
by (stac ((rho_projpair RS Rp_unique)) 1); |
1623 | 2149 |
by (SELECT_GOAL(rewtac rho_proj_def) 5); |
2469 | 2150 |
by (Asm_simp_tac 5); |
2034 | 2151 |
by (stac rho_emb_id 5); |
5136 | 2152 |
by (auto_tac (claset() addIs [cpo_Dinf,apply_type,Dinf_prod,emb_chain_cpo], |
2153 |
simpset())); |
|
3425 | 2154 |
qed "rho_emb_lub"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2155 |
|
5136 | 2156 |
Goal (* theta_chain, almost same prf as commute_chain *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2157 |
"[| commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2158 |
\ emb_chain(DD,ee); cpo(E); cpo(G) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2159 |
\ chain(cf(E,G),lam n:nat. f(n) O Rp(DD`n,E,r(n)))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2160 |
by (rtac chainI 1); |
5136 | 2161 |
by (blast_tac (claset() addIs [lam_type, cont_cf, comp_pres_cont, commute_emb, Rp_cont,emb_cont,emb_chain_cpo]) 1); |
2469 | 2162 |
by (Asm_simp_tac 1); |
1623 | 2163 |
by (res_inst_tac[("r1","r"),("m1","n")](commute_eq RS subst) 1); |
2164 |
by (res_inst_tac[("r1","f"),("m1","n")](commute_eq RS subst) 5); |
|
5136 | 2165 |
brr[le_succ,nat_succI] 1; |
2034 | 2166 |
by (stac Rp_comp 1); |
5136 | 2167 |
brr[emb_eps,commute_emb,emb_chain_cpo,le_succ,nat_succI] 1; |
1623 | 2168 |
by (rtac (comp_assoc RS subst) 1); (* Remember that comp_assoc is simpler in Isa *) |
2169 |
by (res_inst_tac[("r1","f(succ(n))")](comp_assoc RS ssubst) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2170 |
by (rtac comp_mono 1); |
5136 | 2171 |
by (REPEAT (blast_tac (claset() addIs [comp_pres_cont, eps_cont, emb_eps, commute_emb, Rp_cont, emb_cont,emb_chain_cpo,le_succ]) 1)); |
1623 | 2172 |
by (res_inst_tac[("b","f(succ(n))")](comp_id RS subst) 1); (* 1 subst too much *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2173 |
by (rtac comp_mono 2); |
5136 | 2174 |
by (REPEAT (blast_tac (claset() addIs[comp_pres_cont, eps_cont, emb_eps, emb_id, commute_emb, Rp_cont, emb_cont,cont_fun,emb_chain_cpo,le_succ]) 1)); |
2175 |
by (stac comp_id 1); (* Undoes "1 subst too much", typing next anyway *) |
|
2176 |
by (REPEAT |
|
2177 |
(blast_tac (claset() addIs[cont_fun, Rp_cont, emb_cont, commute_emb, |
|
2178 |
cont_cf, cpo_cf,emb_chain_cpo, |
|
2179 |
embRp_rel,emb_eps,le_succ]) 1)); |
|
3425 | 2180 |
qed "theta_chain"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2181 |
|
5136 | 2182 |
Goal (* theta_proj_chain, same prf as theta_chain *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2183 |
"[| commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2184 |
\ emb_chain(DD,ee); cpo(E); cpo(G) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2185 |
\ chain(cf(G,E),lam n:nat. r(n) O Rp(DD`n,G,f(n)))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2186 |
by (rtac chainI 1); |
5136 | 2187 |
by (blast_tac (claset() addIs [lam_type, cont_cf, comp_pres_cont, commute_emb, Rp_cont,emb_cont,emb_chain_cpo]) 1); |
2469 | 2188 |
by (Asm_simp_tac 1); |
1623 | 2189 |
by (res_inst_tac[("r1","r"),("m1","n")](commute_eq RS subst) 1); |
2190 |
by (res_inst_tac[("r1","f"),("m1","n")](commute_eq RS subst) 5); |
|
5136 | 2191 |
brr[le_succ,nat_succI] 1; |
2034 | 2192 |
by (stac Rp_comp 1); |
5136 | 2193 |
brr[emb_eps,commute_emb,emb_chain_cpo,le_succ,nat_succI] 1; |
1623 | 2194 |
by (rtac (comp_assoc RS subst) 1); (* Remember that comp_assoc is simpler in Isa *) |
2195 |
by (res_inst_tac[("r1","r(succ(n))")](comp_assoc RS ssubst) 1); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2196 |
by (rtac comp_mono 1); |
5136 | 2197 |
by (REPEAT (blast_tac (claset() addIs [comp_pres_cont, eps_cont, emb_eps, commute_emb, Rp_cont, emb_cont,emb_chain_cpo,le_succ]) 1)); |
1623 | 2198 |
by (res_inst_tac[("b","r(succ(n))")](comp_id RS subst) 1); (* 1 subst too much *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2199 |
by (rtac comp_mono 2); |
5136 | 2200 |
by (REPEAT (blast_tac (claset() addIs[comp_pres_cont, eps_cont, emb_eps, emb_id, commute_emb, Rp_cont, emb_cont,cont_fun,emb_chain_cpo,le_succ]) 1)); |
2201 |
by (stac comp_id 1); (* Undoes "1 subst too much", typing next anyway *) |
|
2202 |
by (REPEAT |
|
2203 |
(blast_tac (claset() addIs[cont_fun, Rp_cont, emb_cont, commute_emb, |
|
2204 |
cont_cf, cpo_cf,emb_chain_cpo,embRp_rel, |
|
2205 |
emb_eps,le_succ]) 1)); |
|
3425 | 2206 |
qed "theta_proj_chain"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2207 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2208 |
(* Simplification with comp_assoc is possible inside a lam-abstraction, |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2209 |
because it does not have assumptions. If it had, as the HOL-ST theorem |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2210 |
too strongly has, we would be in deep trouble due to the lack of proper |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2211 |
conditional rewriting (a HOL contrib provides something that works). *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2212 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2213 |
(* Controlled simplification inside lambda: introduce lemmas *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2214 |
|
5136 | 2215 |
Goal "[| commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2216 |
\ emb_chain(DD,ee); cpo(E); cpo(G); x:nat |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2217 |
\ r(x) O Rp(DD ` x, G, f(x)) O f(x) O Rp(DD ` x, E, r(x)) = \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2218 |
\ r(x) O Rp(DD ` x, E, r(x))"; |
1623 | 2219 |
by (res_inst_tac[("s1","f(x)")](comp_assoc RS subst) 1); |
2034 | 2220 |
by (stac embRp_eq 1); |
2221 |
by (stac id_comp 4); |
|
5136 | 2222 |
by (auto_tac (claset() addIs [cont_fun,Rp_cont,commute_emb,emb_chain_cpo], |
2223 |
simpset())); |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2224 |
val lemma = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2225 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2226 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2227 |
(* Shorter proof (but lemmas): 19 vs 79 (103 - 24, due to OAssoc) *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2228 |
|
5136 | 2229 |
Goalw [projpair_def,rho_proj_def] (* theta_projpair *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2230 |
"[| lub(cf(E,E), lam n:nat. r(n) O Rp(DD`n,E,r(n))) = id(set(E)); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2231 |
\ commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2232 |
\ emb_chain(DD,ee); cpo(E); cpo(G) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2233 |
\ projpair \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2234 |
\ (E,G, \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2235 |
\ lub(cf(E,G), lam n:nat. f(n) O Rp(DD`n,E,r(n))), \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2236 |
\ lub(cf(G,E), lam n:nat. r(n) O Rp(DD`n,G,f(n))))"; |
4152 | 2237 |
by Safe_tac; |
2034 | 2238 |
by (stac comp_lubs 3); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2239 |
(* The following one line is 15 lines in HOL, and includes existentials. *) |
5136 | 2240 |
brr[cf_cont,islub_in,cpo_lub,cpo_cf,theta_chain,theta_proj_chain] 1; |
4091 | 2241 |
by (simp_tac (simpset() addsimps[comp_assoc]) 1); |
5136 | 2242 |
by (asm_simp_tac (simpset() addsimps[lemma]) 1); |
2243 |
by (stac comp_lubs 1); |
|
2244 |
brr[cf_cont,islub_in,cpo_lub,cpo_cf,theta_chain,theta_proj_chain] 1; |
|
4091 | 2245 |
by (simp_tac (simpset() addsimps[comp_assoc]) 1); |
5136 | 2246 |
by (asm_simp_tac (simpset() addsimps[lemma]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2247 |
by (rtac dominate_islub 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2248 |
by (rtac cpo_lub 2); |
6153 | 2249 |
brr[commute_chain, commute_emb, islub_const, cont_cf, id_cont, |
2250 |
cpo_cf, chain_fun,chain_const] 2; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2251 |
by (rtac dominateI 1); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2252 |
by (assume_tac 1); |
2469 | 2253 |
by (Asm_simp_tac 1); |
5136 | 2254 |
by (blast_tac (claset() addIs [embRp_rel,commute_emb,emb_chain_cpo]) 1); |
3425 | 2255 |
qed "theta_projpair"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2256 |
|
5136 | 2257 |
Goalw [emb_def] |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2258 |
"[| lub(cf(E,E), lam n:nat. r(n) O Rp(DD`n,E,r(n))) = id(set(E)); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2259 |
\ commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2260 |
\ emb_chain(DD,ee); cpo(E); cpo(G) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2261 |
\ emb(E,G,lub(cf(E,G), lam n:nat. f(n) O Rp(DD`n,E,r(n))))"; |
5136 | 2262 |
by (blast_tac (claset() addIs [theta_projpair]) 1); |
3425 | 2263 |
qed "emb_theta"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2264 |
|
5136 | 2265 |
Goal (* mono_lemma *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2266 |
"[| g:cont(D,D'); cpo(D); cpo(D'); cpo(E) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2267 |
\ (lam f : cont(D',E). f O g) : mono(cf(D',E),cf(D,E))"; |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2268 |
by (rtac monoI 1); |
1623 | 2269 |
by (REPEAT(dtac cf_cont 2)); |
2469 | 2270 |
by (Asm_simp_tac 2); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2271 |
by (rtac comp_mono 2); |
1623 | 2272 |
by (SELECT_GOAL(rewrite_goals_tac[set_def,cf_def]) 1); |
2469 | 2273 |
by (Asm_simp_tac 1); |
5136 | 2274 |
by (auto_tac (claset() addIs [lam_type,comp_pres_cont,cpo_cf,cont_cf], |
2275 |
simpset())); |
|
3425 | 2276 |
qed "mono_lemma"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2277 |
|
5136 | 2278 |
Goal "[| commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
2279 |
\ emb_chain(DD,ee); cpo(E); cpo(G); n:nat |] ==> \ |
|
2280 |
\ (lam na:nat. (lam f:cont(E, G). f O r(n)) ` \ |
|
2281 |
\ ((lam n:nat. f(n) O Rp(DD ` n, E, r(n))) ` na)) = \ |
|
2282 |
\ (lam na:nat. (f(na) O Rp(DD ` na, E, r(na))) O r(n))"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2283 |
by (rtac fun_extension 1); |
6070 | 2284 |
by (fast_tac (claset() addIs [lam_type]) 1); |
6176
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6169
diff
changeset
|
2285 |
by (Asm_simp_tac 2); |
6169 | 2286 |
by (fast_tac (claset() addIs [lam_type]) 1); |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2287 |
val lemma = result(); |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2288 |
|
5136 | 2289 |
Goal "[| commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
2290 |
\ emb_chain(DD,ee); cpo(E); cpo(G); n:nat |] ==> \ |
|
2291 |
\ chain(cf(DD`n,G),lam x:nat. (f(x) O Rp(DD ` x, E, r(x))) O r(n))"; |
|
2292 |
by (rtac (lemma RS subst) 1); |
|
2293 |
by (REPEAT |
|
2294 |
(blast_tac (claset() addIs[theta_chain,emb_chain_cpo, |
|
2295 |
commute_emb RS emb_cont RS mono_lemma RS mono_chain]) 1)); |
|
3425 | 2296 |
qed "chain_lemma"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2297 |
|
5136 | 2298 |
Goalw [suffix_def] (* suffix_lemma *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2299 |
"[| commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2300 |
\ emb_chain(DD,ee); cpo(E); cpo(G); cpo(DD`x); x:nat |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2301 |
\ suffix(lam n:nat. (f(n) O Rp(DD`n,E,r(n))) O r(x),x) = (lam n:nat. f(x))"; |
5136 | 2302 |
by (Asm_simp_tac 1); |
2303 |
by (rtac (lam_type RS fun_extension) 1); |
|
2304 |
by (REPEAT (blast_tac (claset() addIs [lam_type, comp_fun, cont_fun, Rp_cont, emb_cont, commute_emb, add_type,emb_chain_cpo]) 1)); |
|
2469 | 2305 |
by (Asm_simp_tac 1); |
5136 | 2306 |
by (subgoal_tac "f(x #+ xa) O \ |
2307 |
\ (Rp(DD ` (x #+ xa), E, r(x #+ xa)) O r(x #+ xa)) O \ |
|
2308 |
\ eps(DD, ee, x, x #+ xa) = f(x)" 1); |
|
2309 |
by (asm_simp_tac (simpset() addsimps [embRp_eq,eps_fun RS id_comp,commute_emb, |
|
2310 |
emb_chain_cpo]) 2); |
|
2311 |
by (blast_tac (claset() addIs [commute_eq,add_type,add_le_self]) 2); |
|
2312 |
by (asm_full_simp_tac |
|
2313 |
(simpset() addsimps [comp_assoc,commute_eq,add_le_self]) 1); |
|
3425 | 2314 |
qed "suffix_lemma"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2315 |
|
5136 | 2316 |
|
2317 |
||
9264 | 2318 |
val prems = Goalw [mediating_def] |
2319 |
"[|emb(E,G,t); !!n. n:nat ==> f(n) = t O r(n) |]==>mediating(E,G,r,f,t)"; |
|
2320 |
by (Safe_tac); |
|
2321 |
by (REPEAT (ares_tac prems 1)); |
|
2322 |
qed "mediatingI"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2323 |
|
9264 | 2324 |
Goalw [mediating_def] "mediating(E,G,r,f,t) ==> emb(E,G,t)"; |
2325 |
by (Fast_tac 1); |
|
2326 |
qed "mediating_emb"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2327 |
|
9264 | 2328 |
Goalw [mediating_def] "[| mediating(E,G,r,f,t); n:nat |] ==> f(n) = t O r(n)"; |
2329 |
by (Blast_tac 1); |
|
2330 |
qed "mediating_eq"; |
|
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2331 |
|
5136 | 2332 |
Goal (* lub_universal_mediating *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2333 |
"[| lub(cf(E,E), lam n:nat. r(n) O Rp(DD`n,E,r(n))) = id(set(E)); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2334 |
\ commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2335 |
\ emb_chain(DD,ee); cpo(E); cpo(G) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2336 |
\ mediating(E,G,r,f,lub(cf(E,G), lam n:nat. f(n) O Rp(DD`n,E,r(n))))"; |
5136 | 2337 |
brr[mediatingI,emb_theta] 1; |
1623 | 2338 |
by (res_inst_tac[("b","r(n)")](lub_const RS subst) 1); |
2034 | 2339 |
by (stac comp_lubs 3); |
5136 | 2340 |
by (REPEAT (blast_tac (claset() addIs [cont_cf, emb_cont, commute_emb, cpo_cf, theta_chain, chain_const, emb_chain_cpo]) 1)); |
2469 | 2341 |
by (Simp_tac 1); |
9495 | 2342 |
by (res_inst_tac [("n1","n")] (lub_suffix RS subst) 1); |
5136 | 2343 |
brr[chain_lemma,cpo_cf,emb_chain_cpo] 1; |
2344 |
by (asm_simp_tac |
|
2345 |
(simpset() addsimps [suffix_lemma, lub_const, cont_cf, emb_cont, |
|
2346 |
commute_emb, cpo_cf, emb_chain_cpo]) 1); |
|
3425 | 2347 |
qed "lub_universal_mediating"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2348 |
|
5136 | 2349 |
Goal (* lub_universal_unique *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2350 |
"[| mediating(E,G,r,f,t); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2351 |
\ lub(cf(E,E), lam n:nat. r(n) O Rp(DD`n,E,r(n))) = id(set(E)); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2352 |
\ commute(DD,ee,E,r); commute(DD,ee,G,f); \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2353 |
\ emb_chain(DD,ee); cpo(E); cpo(G) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2354 |
\ t = lub(cf(E,G), lam n:nat. f(n) O Rp(DD`n,E,r(n)))"; |
1623 | 2355 |
by (res_inst_tac[("b","t")](comp_id RS subst) 1); |
5136 | 2356 |
by (etac subst 2); |
1623 | 2357 |
by (res_inst_tac[("b","t")](lub_const RS subst) 2); |
2034 | 2358 |
by (stac comp_lubs 4); |
5136 | 2359 |
by (asm_simp_tac (simpset() addsimps [comp_assoc, |
8551 | 2360 |
inst "f" "f" mediating_eq]) 9); |
2361 |
brr[cont_fun, emb_cont, mediating_emb, cont_cf, cpo_cf, chain_const, |
|
2362 |
commute_chain,emb_chain_cpo] 1; |
|
3425 | 2363 |
qed "lub_universal_unique"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2364 |
|
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2365 |
(*---------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2366 |
(* Dinf yields the inverse_limit, stated as rho_emb_commute and *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2367 |
(* Dinf_universal. *) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2368 |
(*---------------------------------------------------------------------*) |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2369 |
|
5136 | 2370 |
Goal (* Dinf_universal *) |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2371 |
"[| commute(DD,ee,G,f); emb_chain(DD,ee); cpo(G) |] ==> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2372 |
\ mediating \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2373 |
\ (Dinf(DD,ee),G,rho_emb(DD,ee),f, \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2374 |
\ lub(cf(Dinf(DD,ee),G), \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2375 |
\ lam n:nat. f(n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n)))) & \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2376 |
\ (ALL t. mediating(Dinf(DD,ee),G,rho_emb(DD,ee),f,t) --> \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2377 |
\ t = lub(cf(Dinf(DD,ee),G), \ |
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2378 |
\ lam n:nat. f(n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n))))"; |
4152 | 2379 |
by Safe_tac; |
5136 | 2380 |
brr[lub_universal_mediating,rho_emb_commute,rho_emb_lub,cpo_Dinf] 1; |
2381 |
by (auto_tac (claset() addIs [lub_universal_unique,rho_emb_commute,rho_emb_lub,cpo_Dinf], simpset())); |
|
3425 | 2382 |
qed "Dinf_universal"; |
1281
68f6be60ab1c
The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff
changeset
|
2383 |