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