163
|
1 |
theory FSet
|
|
2 |
imports QuotMain
|
|
3 |
begin
|
|
4 |
|
|
5 |
inductive
|
|
6 |
list_eq (infix "\<approx>" 50)
|
|
7 |
where
|
|
8 |
"a#b#xs \<approx> b#a#xs"
|
|
9 |
| "[] \<approx> []"
|
|
10 |
| "xs \<approx> ys \<Longrightarrow> ys \<approx> xs"
|
|
11 |
| "a#a#xs \<approx> a#xs"
|
|
12 |
| "xs \<approx> ys \<Longrightarrow> a#xs \<approx> a#ys"
|
|
13 |
| "\<lbrakk>xs1 \<approx> xs2; xs2 \<approx> xs3\<rbrakk> \<Longrightarrow> xs1 \<approx> xs3"
|
|
14 |
|
|
15 |
lemma list_eq_refl:
|
|
16 |
shows "xs \<approx> xs"
|
|
17 |
apply (induct xs)
|
|
18 |
apply (auto intro: list_eq.intros)
|
|
19 |
done
|
|
20 |
|
|
21 |
lemma equiv_list_eq:
|
|
22 |
shows "EQUIV list_eq"
|
|
23 |
unfolding EQUIV_REFL_SYM_TRANS REFL_def SYM_def TRANS_def
|
|
24 |
apply(auto intro: list_eq.intros list_eq_refl)
|
|
25 |
done
|
|
26 |
|
|
27 |
quotient fset = "'a list" / "list_eq"
|
|
28 |
apply(rule equiv_list_eq)
|
|
29 |
done
|
|
30 |
|
|
31 |
print_theorems
|
|
32 |
|
|
33 |
typ "'a fset"
|
|
34 |
thm "Rep_fset"
|
|
35 |
thm "ABS_fset_def"
|
|
36 |
|
|
37 |
ML {* @{term "Abs_fset"} *}
|
|
38 |
local_setup {*
|
218
|
39 |
old_make_const_def @{binding EMPTY} @{term "[]"} NoSyn @{typ "'a list"} @{typ "'a fset"} #> snd
|
163
|
40 |
*}
|
|
41 |
|
|
42 |
term Nil
|
|
43 |
term EMPTY
|
|
44 |
thm EMPTY_def
|
|
45 |
|
|
46 |
|
|
47 |
local_setup {*
|
218
|
48 |
old_make_const_def @{binding INSERT} @{term "op #"} NoSyn @{typ "'a list"} @{typ "'a fset"} #> snd
|
163
|
49 |
*}
|
|
50 |
|
|
51 |
term Cons
|
|
52 |
term INSERT
|
|
53 |
thm INSERT_def
|
|
54 |
|
|
55 |
local_setup {*
|
218
|
56 |
old_make_const_def @{binding UNION} @{term "op @"} NoSyn @{typ "'a list"} @{typ "'a fset"} #> snd
|
163
|
57 |
*}
|
|
58 |
|
|
59 |
term append
|
|
60 |
term UNION
|
|
61 |
thm UNION_def
|
|
62 |
|
|
63 |
thm QUOTIENT_fset
|
|
64 |
|
|
65 |
thm QUOT_TYPE_I_fset.thm11
|
|
66 |
|
|
67 |
|
|
68 |
fun
|
|
69 |
membship :: "'a \<Rightarrow> 'a list \<Rightarrow> bool" (infix "memb" 100)
|
|
70 |
where
|
|
71 |
m1: "(x memb []) = False"
|
|
72 |
| m2: "(x memb (y#xs)) = ((x=y) \<or> (x memb xs))"
|
|
73 |
|
|
74 |
fun
|
|
75 |
card1 :: "'a list \<Rightarrow> nat"
|
|
76 |
where
|
|
77 |
card1_nil: "(card1 []) = 0"
|
|
78 |
| card1_cons: "(card1 (x # xs)) = (if (x memb xs) then (card1 xs) else (Suc (card1 xs)))"
|
|
79 |
|
|
80 |
local_setup {*
|
218
|
81 |
old_make_const_def @{binding card} @{term "card1"} NoSyn @{typ "'a list"} @{typ "'a fset"} #> snd
|
163
|
82 |
*}
|
|
83 |
|
|
84 |
term card1
|
|
85 |
term card
|
|
86 |
thm card_def
|
|
87 |
|
|
88 |
(* text {*
|
|
89 |
Maybe make_const_def should require a theorem that says that the particular lifted function
|
|
90 |
respects the relation. With it such a definition would be impossible:
|
|
91 |
make_const_def @{binding CARD} @{term "length"} NoSyn @{typ "'a list"} @{typ "'a fset"} #> snd
|
|
92 |
*}*)
|
|
93 |
|
|
94 |
lemma card1_0:
|
|
95 |
fixes a :: "'a list"
|
|
96 |
shows "(card1 a = 0) = (a = [])"
|
214
|
97 |
by (induct a) auto
|
163
|
98 |
|
|
99 |
lemma not_mem_card1:
|
|
100 |
fixes x :: "'a"
|
|
101 |
fixes xs :: "'a list"
|
|
102 |
shows "~(x memb xs) \<Longrightarrow> card1 (x # xs) = Suc (card1 xs)"
|
|
103 |
by simp
|
|
104 |
|
|
105 |
lemma mem_cons:
|
|
106 |
fixes x :: "'a"
|
|
107 |
fixes xs :: "'a list"
|
|
108 |
assumes a : "x memb xs"
|
|
109 |
shows "x # xs \<approx> xs"
|
214
|
110 |
using a by (induct xs) (auto intro: list_eq.intros )
|
163
|
111 |
|
|
112 |
lemma card1_suc:
|
|
113 |
fixes xs :: "'a list"
|
|
114 |
fixes n :: "nat"
|
|
115 |
assumes c: "card1 xs = Suc n"
|
|
116 |
shows "\<exists>a ys. ~(a memb ys) \<and> xs \<approx> (a # ys)"
|
|
117 |
using c
|
|
118 |
apply(induct xs)
|
|
119 |
apply (metis Suc_neq_Zero card1_0)
|
|
120 |
apply (metis QUOT_TYPE_I_fset.R_trans card1_cons list_eq_refl mem_cons)
|
|
121 |
done
|
|
122 |
|
|
123 |
primrec
|
|
124 |
fold1
|
|
125 |
where
|
|
126 |
"fold1 f (g :: 'a \<Rightarrow> 'b) (z :: 'b) [] = z"
|
|
127 |
| "fold1 f g z (a # A) =
|
|
128 |
(if ((!u v. (f u v = f v u))
|
|
129 |
\<and> (!u v w. ((f u (f v w) = f (f u v) w))))
|
|
130 |
then (
|
|
131 |
if (a memb A) then (fold1 f g z A) else (f (g a) (fold1 f g z A))
|
|
132 |
) else z)"
|
|
133 |
|
|
134 |
(* fold1_def is not usable, but: *)
|
|
135 |
thm fold1.simps
|
|
136 |
|
|
137 |
lemma fs1_strong_cases:
|
|
138 |
fixes X :: "'a list"
|
|
139 |
shows "(X = []) \<or> (\<exists>a. \<exists> Y. (~(a memb Y) \<and> (X \<approx> a # Y)))"
|
|
140 |
apply (induct X)
|
|
141 |
apply (simp)
|
|
142 |
apply (metis QUOT_TYPE_I_fset.thm11 list_eq_refl mem_cons m1)
|
|
143 |
done
|
|
144 |
|
|
145 |
local_setup {*
|
218
|
146 |
old_make_const_def @{binding IN} @{term "membship"} NoSyn @{typ "'a list"} @{typ "'a fset"} #> snd
|
163
|
147 |
*}
|
|
148 |
|
|
149 |
term membship
|
|
150 |
term IN
|
|
151 |
thm IN_def
|
|
152 |
|
194
|
153 |
local_setup {*
|
218
|
154 |
old_make_const_def @{binding fold} @{term "fold1::('b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a list \<Rightarrow> 'b"} NoSyn @{typ "'a list"} @{typ "'a fset"} #> snd
|
194
|
155 |
*}
|
|
156 |
|
|
157 |
term fold1
|
|
158 |
term fold
|
|
159 |
thm fold_def
|
|
160 |
|
225
|
161 |
quotient_def (for "'a fset")
|
|
162 |
fmap::"('a \<Rightarrow> 'a) \<Rightarrow> 'a fset \<Rightarrow> 'a fset"
|
|
163 |
where
|
|
164 |
"fmap \<equiv> (map::('a \<Rightarrow> 'a) \<Rightarrow> 'a list \<Rightarrow> 'a list)"
|
194
|
165 |
|
|
166 |
term map
|
|
167 |
term fmap
|
|
168 |
thm fmap_def
|
|
169 |
|
164
|
170 |
lemma memb_rsp:
|
163
|
171 |
fixes z
|
|
172 |
assumes a: "list_eq x y"
|
|
173 |
shows "(z memb x) = (z memb y)"
|
|
174 |
using a by induct auto
|
|
175 |
|
164
|
176 |
lemma ho_memb_rsp:
|
|
177 |
"(op = ===> (op \<approx> ===> op =)) (op memb) (op memb)"
|
214
|
178 |
by (simp add: memb_rsp)
|
164
|
179 |
|
163
|
180 |
lemma card1_rsp:
|
|
181 |
fixes a b :: "'a list"
|
|
182 |
assumes e: "a \<approx> b"
|
|
183 |
shows "card1 a = card1 b"
|
214
|
184 |
using e by induct (simp_all add:memb_rsp)
|
163
|
185 |
|
228
|
186 |
lemma ho_card1_rsp: "(op \<approx> ===> op =) card1 card1"
|
214
|
187 |
by (simp add: card1_rsp)
|
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
188 |
|
164
|
189 |
lemma cons_rsp:
|
163
|
190 |
fixes z
|
|
191 |
assumes a: "xs \<approx> ys"
|
|
192 |
shows "(z # xs) \<approx> (z # ys)"
|
|
193 |
using a by (rule list_eq.intros(5))
|
|
194 |
|
164
|
195 |
lemma ho_cons_rsp:
|
228
|
196 |
"(op = ===> op \<approx> ===> op \<approx>) op # op #"
|
214
|
197 |
by (simp add: cons_rsp)
|
164
|
198 |
|
175
|
199 |
lemma append_rsp_fst:
|
163
|
200 |
assumes a : "list_eq l1 l2"
|
214
|
201 |
shows "(l1 @ s) \<approx> (l2 @ s)"
|
163
|
202 |
using a
|
214
|
203 |
by (induct) (auto intro: list_eq.intros list_eq_refl)
|
|
204 |
|
|
205 |
lemma append_end:
|
|
206 |
shows "(e # l) \<approx> (l @ [e])"
|
|
207 |
apply (induct l)
|
|
208 |
apply (auto intro: list_eq.intros list_eq_refl)
|
|
209 |
done
|
|
210 |
|
|
211 |
lemma rev_rsp:
|
|
212 |
shows "a \<approx> rev a"
|
|
213 |
apply (induct a)
|
|
214 |
apply simp
|
|
215 |
apply (rule list_eq_refl)
|
|
216 |
apply simp_all
|
|
217 |
apply (rule list_eq.intros(6))
|
|
218 |
prefer 2
|
|
219 |
apply (rule append_rsp_fst)
|
|
220 |
apply assumption
|
|
221 |
apply (rule append_end)
|
|
222 |
done
|
163
|
223 |
|
214
|
224 |
lemma append_sym_rsp:
|
|
225 |
shows "(a @ b) \<approx> (b @ a)"
|
|
226 |
apply (rule list_eq.intros(6))
|
|
227 |
apply (rule append_rsp_fst)
|
|
228 |
apply (rule rev_rsp)
|
|
229 |
apply (rule list_eq.intros(6))
|
|
230 |
apply (rule rev_rsp)
|
|
231 |
apply (simp)
|
|
232 |
apply (rule append_rsp_fst)
|
|
233 |
apply (rule list_eq.intros(3))
|
|
234 |
apply (rule rev_rsp)
|
|
235 |
done
|
|
236 |
|
|
237 |
lemma append_rsp:
|
|
238 |
assumes a : "list_eq l1 r1"
|
|
239 |
assumes b : "list_eq l2 r2 "
|
|
240 |
shows "(l1 @ l2) \<approx> (r1 @ r2)"
|
|
241 |
apply (rule list_eq.intros(6))
|
|
242 |
apply (rule append_rsp_fst)
|
|
243 |
using a apply (assumption)
|
|
244 |
apply (rule list_eq.intros(6))
|
|
245 |
apply (rule append_sym_rsp)
|
|
246 |
apply (rule list_eq.intros(6))
|
|
247 |
apply (rule append_rsp_fst)
|
|
248 |
using b apply (assumption)
|
|
249 |
apply (rule append_sym_rsp)
|
|
250 |
done
|
175
|
251 |
|
194
|
252 |
lemma ho_append_rsp:
|
228
|
253 |
"(op \<approx> ===> op \<approx> ===> op \<approx>) op @ op @"
|
214
|
254 |
by (simp add: append_rsp)
|
175
|
255 |
|
194
|
256 |
lemma map_rsp:
|
|
257 |
assumes a: "a \<approx> b"
|
|
258 |
shows "map f a \<approx> map f b"
|
|
259 |
using a
|
|
260 |
apply (induct)
|
|
261 |
apply(auto intro: list_eq.intros)
|
|
262 |
done
|
|
263 |
|
215
|
264 |
lemma fun_rel_id:
|
228
|
265 |
"(op = ===> op =) \<equiv> op ="
|
215
|
266 |
apply (rule eq_reflection)
|
|
267 |
apply (rule ext)
|
|
268 |
apply (rule ext)
|
|
269 |
apply (simp)
|
|
270 |
apply (auto)
|
|
271 |
apply (rule ext)
|
|
272 |
apply (simp)
|
|
273 |
done
|
|
274 |
|
194
|
275 |
lemma ho_map_rsp:
|
228
|
276 |
"((op = ===> op =) ===> op \<approx> ===> op \<approx>) map map"
|
215
|
277 |
by (simp add: fun_rel_id map_rsp)
|
194
|
278 |
|
|
279 |
lemma map_append :
|
|
280 |
"(map f ((a::'a list) @ b)) \<approx>
|
|
281 |
((map f a) ::'a list) @ (map f b)"
|
215
|
282 |
by simp (rule list_eq_refl)
|
194
|
283 |
|
226
|
284 |
ML {* val rty = @{typ "'a list"} *}
|
|
285 |
ML {* val qty = @{typ "'a fset"} *}
|
|
286 |
ML {* val rel = @{term "list_eq"} *}
|
|
287 |
ML {* val rel_eqv = (#equiv_thm o hd) (quotdata_lookup @{context}) *}
|
|
288 |
ML {* val rel_refl = @{thm list_eq_refl} *}
|
|
289 |
ML {* val quot = @{thm QUOTIENT_fset} *}
|
|
290 |
ML {* val rsp_thms =
|
|
291 |
@{thms ho_memb_rsp ho_cons_rsp ho_card1_rsp ho_map_rsp ho_append_rsp}
|
|
292 |
@ @{thms ho_all_prs ho_ex_prs} *}
|
|
293 |
ML {* val trans2 = @{thm QUOT_TYPE_I_fset.R_trans2} *}
|
|
294 |
ML {* val reps_same = @{thm QUOT_TYPE_I_fset.REPS_same} *}
|
|
295 |
ML {* val defs = @{thms EMPTY_def IN_def UNION_def card_def INSERT_def fmap_def fold_def} *}
|
|
296 |
(* ML {* val consts = map (fst o dest_Const o fst o Logic.dest_equals o concl_of) fset_defs *} *)
|
163
|
297 |
ML {*
|
226
|
298 |
val consts = [@{const_name "Nil"}, @{const_name "Cons"},
|
|
299 |
@{const_name "membship"}, @{const_name "card1"},
|
|
300 |
@{const_name "append"}, @{const_name "fold1"},
|
|
301 |
@{const_name "map"}];
|
206
|
302 |
*}
|
|
303 |
|
226
|
304 |
ML {* fun lift_thm_fset lthy t =
|
|
305 |
lift_thm lthy consts rty qty rel rel_eqv rel_refl quot rsp_thms trans2 reps_same defs t
|
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
306 |
*}
|
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
307 |
|
226
|
308 |
lemma eq_r: "a = b \<Longrightarrow> a \<approx> b"
|
|
309 |
by (simp add: list_eq_refl)
|
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
310 |
|
226
|
311 |
ML {* lift_thm_fset @{context} @{thm m1} *}
|
|
312 |
ML {* lift_thm_fset @{context} @{thm m2} *}
|
|
313 |
ML {* lift_thm_fset @{context} @{thm list_eq.intros(4)} *}
|
|
314 |
ML {* lift_thm_fset @{context} @{thm list_eq.intros(5)} *}
|
|
315 |
ML {* lift_thm_fset @{context} @{thm card1_suc} *}
|
|
316 |
ML {* lift_thm_fset @{context} @{thm map_append} *}
|
|
317 |
ML {* lift_thm_fset @{context} @{thm eq_r[OF append_assoc]} *}
|
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
318 |
|
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
319 |
thm fold1.simps(2)
|
173
7cf227756e2a
Finally completely lift the previously lifted theorems + clean some old stuff
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
320 |
thm list.recs(2)
|
163
|
321 |
|
209
|
322 |
ML {* val ind_r_a = atomize_thm @{thm list.induct} *}
|
175
|
323 |
(* prove {* build_regularize_goal ind_r_a @{typ "'a List.list"} @{term "op \<approx>"} @{context} *}
|
|
324 |
ML_prf {* fun tac ctxt =
|
|
325 |
(asm_full_simp_tac ((Simplifier.context ctxt HOL_ss) addsimps
|
|
326 |
[(@{thm equiv_res_forall} OF [@{thm equiv_list_eq}]),
|
|
327 |
(@{thm equiv_res_exists} OF [@{thm equiv_list_eq}])])) THEN_ALL_NEW
|
|
328 |
(((rtac @{thm RIGHT_RES_FORALL_REGULAR}) THEN' (RANGE [fn _ => all_tac, atac]) THEN'
|
|
329 |
(MetisTools.metis_tac ctxt [])) ORELSE' (MetisTools.metis_tac ctxt [])); *}
|
|
330 |
apply (tactic {* tac @{context} 1 *}) *)
|
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
331 |
ML {* val ind_r_r = regularize ind_r_a @{typ "'a List.list"} @{term "op \<approx>"} @{thm equiv_list_eq} @{context} *}
|
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
332 |
ML {*
|
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
333 |
val rt = build_repabs_term @{context} ind_r_r consts @{typ "'a list"} @{typ "'a fset"}
|
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
334 |
val rg = Logic.mk_equals ((Thm.prop_of ind_r_r), rt);
|
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
335 |
*}
|
226
|
336 |
(*prove rg
|
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
337 |
apply(atomize(full))
|
194
|
338 |
apply (tactic {* REPEAT_ALL_NEW (r_mk_comb_tac_fset @{context}) 1 *})
|
226
|
339 |
done*)
|
210
|
340 |
ML {* val ind_r_t =
|
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
341 |
Toplevel.program (fn () =>
|
210
|
342 |
repabs @{context} ind_r_r consts @{typ "'a list"} @{typ "'a fset"}
|
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
343 |
@{thm QUOTIENT_fset} @{thm list_eq_refl} @{thm QUOT_TYPE_I_fset.R_trans2}
|
202
|
344 |
(@{thms ho_memb_rsp ho_cons_rsp ho_card1_rsp ho_map_rsp ho_append_rsp} @ @{thms ho_all_prs ho_ex_prs})
|
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
345 |
)
|
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
346 |
*}
|
226
|
347 |
ML {* val abs = findabs rty (prop_of (atomize_thm @{thm list.induct})) *}
|
|
348 |
ML {* val simp_lam_prs_thms = map (make_simp_lam_prs_thm @{context} quot) abs *}
|
|
349 |
ML {* val ind_r_l = repeat_eqsubst_thm @{context} simp_lam_prs_thms ind_r_t *}
|
175
|
350 |
lemma app_prs_for_induct: "(ABS_fset ---> id) f (REP_fset T1) = f T1"
|
|
351 |
apply (simp add: fun_map.simps QUOT_TYPE_I_fset.thm10)
|
|
352 |
done
|
163
|
353 |
|
209
|
354 |
ML {* val ind_r_l1 = eqsubst_thm @{context} @{thms app_prs_for_induct} ind_r_l *}
|
178
945786a68ec6
Finally lifted induction, with some manually added simplification lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
355 |
ML {* val ind_r_l2 = eqsubst_thm @{context} @{thms app_prs_for_induct} ind_r_l1 *}
|
945786a68ec6
Finally lifted induction, with some manually added simplification lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
356 |
ML {* val ind_r_l3 = eqsubst_thm @{context} @{thms app_prs_for_induct} ind_r_l2 *}
|
209
|
357 |
ML {* val ind_r_l4 = eqsubst_thm @{context} @{thms app_prs_for_induct} ind_r_l3 *}
|
|
358 |
ML {* val ind_r_a = simp_allex_prs @{context} quot ind_r_l4 *}
|
|
359 |
ML {* val thm = @{thm FORALL_PRS[OF FUN_QUOTIENT[OF QUOTIENT_fset IDENTITY_QUOTIENT], symmetric]} *}
|
|
360 |
ML {* val ind_r_a1 = eqsubst_thm @{context} [thm] ind_r_a *}
|
226
|
361 |
ML {* val defs_sym = add_lower_defs @{context} defs *}
|
|
362 |
ML {* val ind_r_d = repeat_eqsubst_thm @{context} defs_sym ind_r_a1 *}
|
178
945786a68ec6
Finally lifted induction, with some manually added simplification lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
363 |
ML {* val ind_r_s = MetaSimplifier.rewrite_rule @{thms QUOT_TYPE_I_fset.REPS_same} ind_r_d *}
|
209
|
364 |
ML {* ObjectLogic.rulify ind_r_s *}
|
178
945786a68ec6
Finally lifted induction, with some manually added simplification lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
|
365 |
|
163
|
366 |
ML {*
|
226
|
367 |
fun lift_thm_fset_note name thm lthy =
|
163
|
368 |
let
|
226
|
369 |
val lifted_thm = lift_thm_fset lthy thm;
|
163
|
370 |
val (_, lthy2) = note (name, lifted_thm) lthy;
|
|
371 |
in
|
|
372 |
lthy2
|
|
373 |
end;
|
|
374 |
*}
|
|
375 |
|
226
|
376 |
local_setup {*
|
|
377 |
lift_thm_fset_note @{binding "m1l"} @{thm m1} #>
|
|
378 |
lift_thm_fset_note @{binding "m2l"} @{thm m2} #>
|
|
379 |
lift_thm_fset_note @{binding "leqi4l"} @{thm list_eq.intros(4)} #>
|
|
380 |
lift_thm_fset_note @{binding "leqi5l"} @{thm list_eq.intros(5)}
|
163
|
381 |
*}
|
226
|
382 |
thm m1l
|
|
383 |
thm m2l
|
|
384 |
thm leqi4l
|
|
385 |
thm leqi5l
|
163
|
386 |
|
|
387 |
end
|