author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Wed, 04 Nov 2009 09:52:31 +0100 | |
changeset 273 | b82e765ca464 |
parent 270 | c55883442514 |
child 274 | df225aa45770 |
permissions | -rw-r--r-- |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1 |
theory FSet |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
2 |
imports QuotMain |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
4 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
5 |
inductive |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
6 |
list_eq (infix "\<approx>" 50) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
7 |
where |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
8 |
"a#b#xs \<approx> b#a#xs" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
9 |
| "[] \<approx> []" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
10 |
| "xs \<approx> ys \<Longrightarrow> ys \<approx> xs" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
11 |
| "a#a#xs \<approx> a#xs" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
12 |
| "xs \<approx> ys \<Longrightarrow> a#xs \<approx> a#ys" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
13 |
| "\<lbrakk>xs1 \<approx> xs2; xs2 \<approx> xs3\<rbrakk> \<Longrightarrow> xs1 \<approx> xs3" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
14 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
15 |
lemma list_eq_refl: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
16 |
shows "xs \<approx> xs" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
17 |
apply (induct xs) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
18 |
apply (auto intro: list_eq.intros) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
19 |
done |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
20 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
21 |
lemma equiv_list_eq: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
22 |
shows "EQUIV list_eq" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
23 |
unfolding EQUIV_REFL_SYM_TRANS REFL_def SYM_def TRANS_def |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
24 |
apply(auto intro: list_eq.intros list_eq_refl) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
25 |
done |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
26 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
27 |
quotient fset = "'a list" / "list_eq" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
28 |
apply(rule equiv_list_eq) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
29 |
done |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
30 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
31 |
print_theorems |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
32 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
33 |
typ "'a fset" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
34 |
thm "Rep_fset" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
35 |
thm "ABS_fset_def" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
36 |
|
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
267
diff
changeset
|
37 |
quotient_def |
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
38 |
EMPTY :: "'a fset" |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
39 |
where |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
40 |
"EMPTY \<equiv> ([]::'a list)" |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
41 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
42 |
term Nil |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
43 |
term EMPTY |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
44 |
thm EMPTY_def |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
45 |
|
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
267
diff
changeset
|
46 |
quotient_def |
254
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
47 |
INSERT :: "'a \<Rightarrow> 'a fset \<Rightarrow> 'a fset" |
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
48 |
where |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
49 |
"INSERT \<equiv> op #" |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
50 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
51 |
term Cons |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
52 |
term INSERT |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
53 |
thm INSERT_def |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
54 |
|
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
267
diff
changeset
|
55 |
quotient_def |
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
56 |
FUNION :: "'a fset \<Rightarrow> 'a fset \<Rightarrow> 'a fset" |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
57 |
where |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
58 |
"FUNION \<equiv> (op @)" |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
59 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
60 |
term append |
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
61 |
term FUNION |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
62 |
thm FUNION_def |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
63 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
64 |
thm QUOTIENT_fset |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
65 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
66 |
thm QUOT_TYPE_I_fset.thm11 |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
67 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
68 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
69 |
fun |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
70 |
membship :: "'a \<Rightarrow> 'a list \<Rightarrow> bool" (infix "memb" 100) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
71 |
where |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
72 |
m1: "(x memb []) = False" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
73 |
| m2: "(x memb (y#xs)) = ((x=y) \<or> (x memb xs))" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
74 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
75 |
fun |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
76 |
card1 :: "'a list \<Rightarrow> nat" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
77 |
where |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
78 |
card1_nil: "(card1 []) = 0" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
79 |
| card1_cons: "(card1 (x # xs)) = (if (x memb xs) then (card1 xs) else (Suc (card1 xs)))" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
80 |
|
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
267
diff
changeset
|
81 |
quotient_def |
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
82 |
CARD :: "'a fset \<Rightarrow> nat" |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
83 |
where |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
84 |
"CARD \<equiv> card1" |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
85 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
86 |
term card1 |
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
87 |
term CARD |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
88 |
thm CARD_def |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
89 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
90 |
(* text {* |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
91 |
Maybe make_const_def should require a theorem that says that the particular lifted function |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
92 |
respects the relation. With it such a definition would be impossible: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
93 |
make_const_def @{binding CARD} @{term "length"} NoSyn @{typ "'a list"} @{typ "'a fset"} #> snd |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
94 |
*}*) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
95 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
96 |
lemma card1_0: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
97 |
fixes a :: "'a list" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
98 |
shows "(card1 a = 0) = (a = [])" |
214 | 99 |
by (induct a) auto |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
100 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
101 |
lemma not_mem_card1: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
102 |
fixes x :: "'a" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
103 |
fixes xs :: "'a list" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
104 |
shows "~(x memb xs) \<Longrightarrow> card1 (x # xs) = Suc (card1 xs)" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
105 |
by simp |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
106 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
107 |
lemma mem_cons: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
108 |
fixes x :: "'a" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
109 |
fixes xs :: "'a list" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
110 |
assumes a : "x memb xs" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
111 |
shows "x # xs \<approx> xs" |
214 | 112 |
using a by (induct xs) (auto intro: list_eq.intros ) |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
113 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
114 |
lemma card1_suc: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
115 |
fixes xs :: "'a list" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
116 |
fixes n :: "nat" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
117 |
assumes c: "card1 xs = Suc n" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
118 |
shows "\<exists>a ys. ~(a memb ys) \<and> xs \<approx> (a # ys)" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
119 |
using c |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
120 |
apply(induct xs) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
121 |
apply (metis Suc_neq_Zero card1_0) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
122 |
apply (metis QUOT_TYPE_I_fset.R_trans card1_cons list_eq_refl mem_cons) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
123 |
done |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
124 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
125 |
primrec |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
126 |
fold1 |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
127 |
where |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
128 |
"fold1 f (g :: 'a \<Rightarrow> 'b) (z :: 'b) [] = z" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
129 |
| "fold1 f g z (a # A) = |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
130 |
(if ((!u v. (f u v = f v u)) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
131 |
\<and> (!u v w. ((f u (f v w) = f (f u v) w)))) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
132 |
then ( |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
133 |
if (a memb A) then (fold1 f g z A) else (f (g a) (fold1 f g z A)) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
134 |
) else z)" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
135 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
136 |
(* fold1_def is not usable, but: *) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
137 |
thm fold1.simps |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
138 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
139 |
lemma fs1_strong_cases: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
140 |
fixes X :: "'a list" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
141 |
shows "(X = []) \<or> (\<exists>a. \<exists> Y. (~(a memb Y) \<and> (X \<approx> a # Y)))" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
142 |
apply (induct X) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
143 |
apply (simp) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
144 |
apply (metis QUOT_TYPE_I_fset.thm11 list_eq_refl mem_cons m1) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
145 |
done |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
146 |
|
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
267
diff
changeset
|
147 |
quotient_def |
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
148 |
IN :: "'a \<Rightarrow> 'a fset \<Rightarrow> bool" |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
149 |
where |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
150 |
"IN \<equiv> membship" |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
151 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
152 |
term membship |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
153 |
term IN |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
154 |
thm IN_def |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
155 |
|
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
156 |
(* FIXME: does not work yet |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
157 |
quotient_def (for "'a fset") |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
158 |
FOLD :: "('b \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a fset \<Rightarrow> 'b" |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
159 |
where |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
160 |
"FOLD \<equiv> fold1" |
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
161 |
*) |
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
162 |
local_setup {* |
218
df05cd030d2f
added infrastructure for defining lifted constants
Christian Urban <urbanc@in.tum.de>
parents:
215
diff
changeset
|
163 |
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
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
164 |
*} |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
165 |
|
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
166 |
term fold1 |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
167 |
term fold |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
168 |
thm fold_def |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
169 |
|
231
c643938b846a
updated some definitions; had to give sometimes different names; somewhere I introduced a bug, since not everything is working anymore (needs fixing!)
Christian Urban <urbanc@in.tum.de>
parents:
225
diff
changeset
|
170 |
(* FIXME: does not work yet for all types*) |
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
267
diff
changeset
|
171 |
quotient_def |
254
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
172 |
fmap::"('a \<Rightarrow> 'b) \<Rightarrow> 'a fset \<Rightarrow> 'b fset" |
225 | 173 |
where |
254
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
174 |
"fmap \<equiv> map" |
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
175 |
|
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
176 |
term map |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
177 |
term fmap |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
178 |
thm fmap_def |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
179 |
|
239
02b14a21761a
Cleaning of the interface to lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
233
diff
changeset
|
180 |
ML {* val defs = @{thms EMPTY_def IN_def FUNION_def CARD_def INSERT_def fmap_def fold_def} *} |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
181 |
|
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
182 |
lemma memb_rsp: |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
183 |
fixes z |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
184 |
assumes a: "list_eq x y" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
185 |
shows "(z memb x) = (z memb y)" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
186 |
using a by induct auto |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
187 |
|
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
188 |
lemma ho_memb_rsp: |
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
189 |
"(op = ===> (op \<approx> ===> op =)) (op memb) (op memb)" |
214 | 190 |
by (simp add: memb_rsp) |
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
191 |
|
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
192 |
lemma card1_rsp: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
193 |
fixes a b :: "'a list" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
194 |
assumes e: "a \<approx> b" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
195 |
shows "card1 a = card1 b" |
214 | 196 |
using e by induct (simp_all add:memb_rsp) |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
197 |
|
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
226
diff
changeset
|
198 |
lemma ho_card1_rsp: "(op \<approx> ===> op =) card1 card1" |
214 | 199 |
by (simp add: card1_rsp) |
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
168
diff
changeset
|
200 |
|
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
201 |
lemma cons_rsp: |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
202 |
fixes z |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
203 |
assumes a: "xs \<approx> ys" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
204 |
shows "(z # xs) \<approx> (z # ys)" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
205 |
using a by (rule list_eq.intros(5)) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
206 |
|
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
207 |
lemma ho_cons_rsp: |
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
226
diff
changeset
|
208 |
"(op = ===> op \<approx> ===> op \<approx>) op # op #" |
214 | 209 |
by (simp add: cons_rsp) |
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
210 |
|
175
f7602653dddd
Preparing infrastructire for LAMBDA_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
173
diff
changeset
|
211 |
lemma append_rsp_fst: |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
212 |
assumes a : "list_eq l1 l2" |
214 | 213 |
shows "(l1 @ s) \<approx> (l2 @ s)" |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
214 |
using a |
214 | 215 |
by (induct) (auto intro: list_eq.intros list_eq_refl) |
216 |
||
217 |
lemma append_end: |
|
218 |
shows "(e # l) \<approx> (l @ [e])" |
|
219 |
apply (induct l) |
|
220 |
apply (auto intro: list_eq.intros list_eq_refl) |
|
221 |
done |
|
222 |
||
223 |
lemma rev_rsp: |
|
224 |
shows "a \<approx> rev a" |
|
225 |
apply (induct a) |
|
226 |
apply simp |
|
227 |
apply (rule list_eq_refl) |
|
228 |
apply simp_all |
|
229 |
apply (rule list_eq.intros(6)) |
|
230 |
prefer 2 |
|
231 |
apply (rule append_rsp_fst) |
|
232 |
apply assumption |
|
233 |
apply (rule append_end) |
|
234 |
done |
|
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
235 |
|
214 | 236 |
lemma append_sym_rsp: |
237 |
shows "(a @ b) \<approx> (b @ a)" |
|
238 |
apply (rule list_eq.intros(6)) |
|
239 |
apply (rule append_rsp_fst) |
|
240 |
apply (rule rev_rsp) |
|
241 |
apply (rule list_eq.intros(6)) |
|
242 |
apply (rule rev_rsp) |
|
243 |
apply (simp) |
|
244 |
apply (rule append_rsp_fst) |
|
245 |
apply (rule list_eq.intros(3)) |
|
246 |
apply (rule rev_rsp) |
|
247 |
done |
|
248 |
||
249 |
lemma append_rsp: |
|
250 |
assumes a : "list_eq l1 r1" |
|
251 |
assumes b : "list_eq l2 r2 " |
|
252 |
shows "(l1 @ l2) \<approx> (r1 @ r2)" |
|
253 |
apply (rule list_eq.intros(6)) |
|
254 |
apply (rule append_rsp_fst) |
|
255 |
using a apply (assumption) |
|
256 |
apply (rule list_eq.intros(6)) |
|
257 |
apply (rule append_sym_rsp) |
|
258 |
apply (rule list_eq.intros(6)) |
|
259 |
apply (rule append_rsp_fst) |
|
260 |
using b apply (assumption) |
|
261 |
apply (rule append_sym_rsp) |
|
262 |
done |
|
175
f7602653dddd
Preparing infrastructire for LAMBDA_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
173
diff
changeset
|
263 |
|
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
264 |
lemma ho_append_rsp: |
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
226
diff
changeset
|
265 |
"(op \<approx> ===> op \<approx> ===> op \<approx>) op @ op @" |
214 | 266 |
by (simp add: append_rsp) |
175
f7602653dddd
Preparing infrastructire for LAMBDA_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
173
diff
changeset
|
267 |
|
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
268 |
lemma map_rsp: |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
269 |
assumes a: "a \<approx> b" |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
270 |
shows "map f a \<approx> map f b" |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
271 |
using a |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
272 |
apply (induct) |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
273 |
apply(auto intro: list_eq.intros) |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
274 |
done |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
275 |
|
215
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
276 |
lemma fun_rel_id: |
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
226
diff
changeset
|
277 |
"(op = ===> op =) \<equiv> op =" |
215
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
278 |
apply (rule eq_reflection) |
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
279 |
apply (rule ext) |
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
280 |
apply (rule ext) |
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
281 |
apply (simp) |
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
282 |
apply (auto) |
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
283 |
apply (rule ext) |
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
284 |
apply (simp) |
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
285 |
done |
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
286 |
|
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
287 |
lemma ho_map_rsp: |
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
226
diff
changeset
|
288 |
"((op = ===> op =) ===> op \<approx> ===> op \<approx>) map map" |
215
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
289 |
by (simp add: fun_rel_id map_rsp) |
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
290 |
|
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
291 |
lemma map_append : |
258
93ea455b29f1
Map does not fully work yet.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
257
diff
changeset
|
292 |
"(map f (a @ b)) \<approx> |
93ea455b29f1
Map does not fully work yet.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
257
diff
changeset
|
293 |
(map f a) @ (map f b)" |
215
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
294 |
by simp (rule list_eq_refl) |
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
295 |
|
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
296 |
lemma op_eq_twice: "(op = ===> op =) = (op =)" |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
297 |
apply (rule ext) |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
298 |
apply (rule ext) |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
299 |
apply (simp add: FUN_REL.simps) |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
300 |
apply auto |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
301 |
apply (rule ext) |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
302 |
apply simp |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
303 |
done |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
304 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
305 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
306 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
307 |
lemma ho_fold_rsp: |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
308 |
"((op = ===> op = ===> op =) ===> (op = ===> op =) ===> op = ===> op \<approx> ===> op =) fold1 fold1" |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
309 |
apply (auto simp add: op_eq_twice) |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
310 |
sorry |
241
60acf3d3a4a0
Finding applications and duplicates filtered out in abstractions
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
239
diff
changeset
|
311 |
|
254
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
312 |
print_quotients |
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
313 |
|
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
314 |
|
226 | 315 |
ML {* val qty = @{typ "'a fset"} *} |
316 |
ML {* val rsp_thms = |
|
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
317 |
@{thms ho_memb_rsp ho_cons_rsp ho_card1_rsp ho_map_rsp ho_append_rsp ho_fold_rsp} |
226 | 318 |
@ @{thms ho_all_prs ho_ex_prs} *} |
206
1e227c9ee915
Fixed APPLY_RSP vs Cong in the InjRepAbs tactic.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
202
diff
changeset
|
319 |
|
239
02b14a21761a
Cleaning of the interface to lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
233
diff
changeset
|
320 |
ML {* fun lift_thm_fset lthy t = lift_thm lthy qty "fset" rsp_thms defs t *} |
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
171
diff
changeset
|
321 |
|
248
6ed87b3d358c
Finally merged the code of the versions of regularize and tested examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
244
diff
changeset
|
322 |
(* ML {* lift_thm_fset @{context} @{thm neq_Nil_conv} *} *) |
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
323 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
324 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
325 |
|
226 | 326 |
ML {* lift_thm_fset @{context} @{thm m1} *} |
327 |
ML {* lift_thm_fset @{context} @{thm m2} *} |
|
328 |
ML {* lift_thm_fset @{context} @{thm list_eq.intros(4)} *} |
|
329 |
ML {* lift_thm_fset @{context} @{thm list_eq.intros(5)} *} |
|
330 |
ML {* lift_thm_fset @{context} @{thm card1_suc} *} |
|
258
93ea455b29f1
Map does not fully work yet.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
257
diff
changeset
|
331 |
(*ML {* lift_thm_fset @{context} @{thm map_append} *}*) |
251 | 332 |
ML {* lift_thm_fset @{context} @{thm append_assoc} *} |
267
3764566c1151
Automatic FORALL_PRS. 'list.induct' lifts automatically. Faster ALLEX_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
260
diff
changeset
|
333 |
ML {* lift_thm_fset @{context} @{thm list.induct} *} |
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
334 |
ML {* lift_thm_fset @{context} @{thm fold1.simps(2)} *} |
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
168
diff
changeset
|
335 |
|
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
336 |
term list_rec |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
337 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
338 |
quotient_def |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
339 |
fset_rec::"'a \<Rightarrow> ('b \<Rightarrow> 'b fset \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'a fset \<Rightarrow> 'b" |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
340 |
where |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
341 |
"fset_rec \<equiv> list_rec" |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
342 |
|
173
7cf227756e2a
Finally completely lift the previously lifted theorems + clean some old stuff
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
172
diff
changeset
|
343 |
thm list.recs(2) |
248
6ed87b3d358c
Finally merged the code of the versions of regularize and tested examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
244
diff
changeset
|
344 |
thm list.cases |
6ed87b3d358c
Finally merged the code of the versions of regularize and tested examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
244
diff
changeset
|
345 |
|
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
346 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
347 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
348 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
349 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
350 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
351 |
ML {* val consts = lookup_quot_consts defs *} |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
352 |
ML {* val defs_sym = add_lower_defs @{context} defs *} |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
353 |
ML {* val (rty, rel, rel_refl, rel_eqv) = lookup_quot_data @{context} qty *} |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
354 |
ML {* val (trans2, reps_same, absrep, quot) = lookup_quot_thms @{context} "fset" *} |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
355 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
356 |
|
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
357 |
ML {* val ind_r_a = atomize_thm @{thm card1_suc} *} |
252
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
358 |
(* prove {* build_regularize_goal ind_r_a rty rel @{context} *} |
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
359 |
ML_prf {* fun tac ctxt = |
251 | 360 |
(FIRST' [ |
361 |
rtac rel_refl, |
|
362 |
atac, |
|
252
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
363 |
rtac @{thm get_rid}, |
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
364 |
rtac @{thm get_rid2}, |
251 | 365 |
(fn i => CHANGED (asm_full_simp_tac ((Simplifier.context ctxt HOL_ss) addsimps |
239
02b14a21761a
Cleaning of the interface to lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
233
diff
changeset
|
366 |
[(@{thm equiv_res_forall} OF [rel_eqv]), |
251 | 367 |
(@{thm equiv_res_exists} OF [rel_eqv])]) i)), |
252
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
368 |
(rtac @{thm impI} THEN' (asm_full_simp_tac (Simplifier.context ctxt HOL_ss)) THEN' rtac rel_refl), |
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
369 |
(rtac @{thm RIGHT_RES_FORALL_REGULAR}) |
251 | 370 |
]); |
371 |
*} |
|
252
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
372 |
apply (atomize(full)) |
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
373 |
apply (tactic {* tac @{context} 1 *}) *) |
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
251
diff
changeset
|
374 |
ML {* val ind_r_r = regularize ind_r_a rty rel rel_eqv rel_refl @{context} *} |
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
375 |
ML {* |
239
02b14a21761a
Cleaning of the interface to lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
233
diff
changeset
|
376 |
val rt = build_repabs_term @{context} ind_r_r consts rty qty |
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
171
diff
changeset
|
377 |
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>
parents:
171
diff
changeset
|
378 |
*} |
257
68bd5c2a1b96
Fixed quotdata_lookup.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
255
diff
changeset
|
379 |
prove rg |
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
171
diff
changeset
|
380 |
apply(atomize(full)) |
257
68bd5c2a1b96
Fixed quotdata_lookup.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
255
diff
changeset
|
381 |
ML_prf {* fun r_mk_comb_tac_fset lthy = r_mk_comb_tac lthy rty quot rel_refl trans2 rsp_thms *} |
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
382 |
apply (tactic {* REPEAT_ALL_NEW (r_mk_comb_tac_fset @{context}) 1 *}) |
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
383 |
done |
210
f88ea69331bf
Simplfied interface to repabs_injection.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
209
diff
changeset
|
384 |
ML {* val ind_r_t = |
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
171
diff
changeset
|
385 |
Toplevel.program (fn () => |
239
02b14a21761a
Cleaning of the interface to lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
233
diff
changeset
|
386 |
repabs @{context} ind_r_r consts rty qty quot rel_refl trans2 rsp_thms |
172
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
171
diff
changeset
|
387 |
) |
da38ce2711a6
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
171
diff
changeset
|
388 |
*} |
241
60acf3d3a4a0
Finding applications and duplicates filtered out in abstractions
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
239
diff
changeset
|
389 |
|
226 | 390 |
ML {* val abs = findabs rty (prop_of (atomize_thm @{thm list.induct})) *} |
241
60acf3d3a4a0
Finding applications and duplicates filtered out in abstractions
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
239
diff
changeset
|
391 |
ML {* val aps = findaps rty (prop_of (atomize_thm @{thm list.induct})) *} |
253
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
392 |
ML {* val simp_lam_prs_thms = map (make_simp_prs_thm @{context} quot @{thm LAMBDA_PRS}) abs *} |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
393 |
ML {* val ind_r_l = repeat_eqsubst_thm @{context} (simp_app_prs_thms @ simp_lam_prs_thms) ind_r_t *} |
260
59578f428bbe
Fixes after optimization and preparing for a general FORALL_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
258
diff
changeset
|
394 |
ML {* val thm = @{thm FORALL_PRS[OF FUN_QUOTIENT[OF QUOTIENT_fset IDENTITY_QUOTIENT]]} *} |
59578f428bbe
Fixes after optimization and preparing for a general FORALL_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
258
diff
changeset
|
395 |
ML {* val ind_r_a = simp_allex_prs quot [thm] ind_r_l *} |
226 | 396 |
ML {* val defs_sym = add_lower_defs @{context} defs *} |
260
59578f428bbe
Fixes after optimization and preparing for a general FORALL_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
258
diff
changeset
|
397 |
ML {* val ind_r_d = repeat_eqsubst_thm @{context} defs_sym ind_r_a *} |
178
945786a68ec6
Finally lifted induction, with some manually added simplification lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
176
diff
changeset
|
398 |
ML {* val ind_r_s = MetaSimplifier.rewrite_rule @{thms QUOT_TYPE_I_fset.REPS_same} ind_r_d *} |
209
1e8e1b736586
map_append lifted automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
208
diff
changeset
|
399 |
ML {* ObjectLogic.rulify ind_r_s *} |
178
945786a68ec6
Finally lifted induction, with some manually added simplification lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
176
diff
changeset
|
400 |
|
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
401 |
ML {* |
226 | 402 |
fun lift_thm_fset_note name thm lthy = |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
403 |
let |
226 | 404 |
val lifted_thm = lift_thm_fset lthy thm; |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
405 |
val (_, lthy2) = note (name, lifted_thm) lthy; |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
406 |
in |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
407 |
lthy2 |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
408 |
end; |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
409 |
*} |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
410 |
|
226 | 411 |
local_setup {* |
412 |
lift_thm_fset_note @{binding "m1l"} @{thm m1} #> |
|
413 |
lift_thm_fset_note @{binding "m2l"} @{thm m2} #> |
|
414 |
lift_thm_fset_note @{binding "leqi4l"} @{thm list_eq.intros(4)} #> |
|
415 |
lift_thm_fset_note @{binding "leqi5l"} @{thm list_eq.intros(5)} |
|
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
416 |
*} |
226 | 417 |
thm m1l |
418 |
thm m2l |
|
419 |
thm leqi4l |
|
420 |
thm leqi5l |
|
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
421 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
422 |
end |