author | Christian Urban <urbanc@in.tum.de> |
Fri, 27 Nov 2009 13:59:52 +0100 | |
changeset 420 | dcfe009c98aa |
parent 419 | b1cd040ff5f7 |
child 423 | 2f0ad33f0241 |
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" |
309
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
104 |
shows "(~(x memb xs)) = (card1 (x # xs) = Suc (card1 xs))" |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
105 |
by auto |
163
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 |
|
294 | 125 |
definition |
126 |
rsp_fold |
|
127 |
where |
|
128 |
"rsp_fold f = ((!u v. (f u v = f v u)) \<and> (!u v w. ((f u (f v w) = f (f u v) w))))" |
|
129 |
||
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
130 |
primrec |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
131 |
fold1 |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
132 |
where |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
133 |
"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
|
134 |
| "fold1 f g z (a # A) = |
294 | 135 |
(if rsp_fold f |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
136 |
then ( |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
137 |
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
|
138 |
) else z)" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
139 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
140 |
(* fold1_def is not usable, but: *) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
141 |
thm fold1.simps |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
142 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
143 |
lemma fs1_strong_cases: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
144 |
fixes X :: "'a list" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
145 |
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
|
146 |
apply (induct X) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
147 |
apply (simp) |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
148 |
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
|
149 |
done |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
150 |
|
296 | 151 |
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
|
152 |
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
|
153 |
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
|
154 |
"IN \<equiv> membship" |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
155 |
|
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
156 |
term membship |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
157 |
term IN |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
158 |
thm IN_def |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
159 |
|
274
df225aa45770
simplified the quotient_def code
Christian Urban <urbanc@in.tum.de>
parents:
273
diff
changeset
|
160 |
term fold1 |
df225aa45770
simplified the quotient_def code
Christian Urban <urbanc@in.tum.de>
parents:
273
diff
changeset
|
161 |
quotient_def |
df225aa45770
simplified the quotient_def code
Christian Urban <urbanc@in.tum.de>
parents:
273
diff
changeset
|
162 |
FOLD :: "('a \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'b fset \<Rightarrow> 'a" |
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
|
163 |
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
|
164 |
"FOLD \<equiv> fold1" |
194
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 |
|
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
|
170 |
quotient_def |
254
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
171 |
fmap::"('a \<Rightarrow> 'b) \<Rightarrow> 'a fset \<Rightarrow> 'b fset" |
225 | 172 |
where |
254
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
173 |
"fmap \<equiv> map" |
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
174 |
|
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
175 |
term map |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
176 |
term fmap |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
177 |
thm fmap_def |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
178 |
|
274
df225aa45770
simplified the quotient_def code
Christian Urban <urbanc@in.tum.de>
parents:
273
diff
changeset
|
179 |
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
|
180 |
|
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
181 |
lemma memb_rsp: |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
182 |
fixes z |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
183 |
assumes a: "list_eq x y" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
184 |
shows "(z memb x) = (z memb y)" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
185 |
using a by induct auto |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
186 |
|
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
187 |
lemma ho_memb_rsp: |
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
188 |
"(op = ===> (op \<approx> ===> op =)) (op memb) (op memb)" |
214 | 189 |
by (simp add: memb_rsp) |
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
190 |
|
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
191 |
lemma card1_rsp: |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
192 |
fixes a b :: "'a list" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
193 |
assumes e: "a \<approx> b" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
194 |
shows "card1 a = card1 b" |
214 | 195 |
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
|
196 |
|
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
226
diff
changeset
|
197 |
lemma ho_card1_rsp: "(op \<approx> ===> op =) card1 card1" |
214 | 198 |
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
|
199 |
|
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
200 |
lemma cons_rsp: |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
201 |
fixes z |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
202 |
assumes a: "xs \<approx> ys" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
203 |
shows "(z # xs) \<approx> (z # ys)" |
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
204 |
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
|
205 |
|
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
206 |
lemma ho_cons_rsp: |
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
226
diff
changeset
|
207 |
"(op = ===> op \<approx> ===> op \<approx>) op # op #" |
214 | 208 |
by (simp add: cons_rsp) |
164
4f00ca4f5ef4
Stronger tactic, simpler proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
163
diff
changeset
|
209 |
|
175
f7602653dddd
Preparing infrastructire for LAMBDA_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
173
diff
changeset
|
210 |
lemma append_rsp_fst: |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
211 |
assumes a : "list_eq l1 l2" |
214 | 212 |
shows "(l1 @ s) \<approx> (l2 @ s)" |
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
213 |
using a |
214 | 214 |
by (induct) (auto intro: list_eq.intros list_eq_refl) |
215 |
||
216 |
lemma append_end: |
|
217 |
shows "(e # l) \<approx> (l @ [e])" |
|
218 |
apply (induct l) |
|
219 |
apply (auto intro: list_eq.intros list_eq_refl) |
|
220 |
done |
|
221 |
||
222 |
lemma rev_rsp: |
|
223 |
shows "a \<approx> rev a" |
|
224 |
apply (induct a) |
|
225 |
apply simp |
|
226 |
apply (rule list_eq_refl) |
|
227 |
apply simp_all |
|
228 |
apply (rule list_eq.intros(6)) |
|
229 |
prefer 2 |
|
230 |
apply (rule append_rsp_fst) |
|
231 |
apply assumption |
|
232 |
apply (rule append_end) |
|
233 |
done |
|
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
234 |
|
214 | 235 |
lemma append_sym_rsp: |
236 |
shows "(a @ b) \<approx> (b @ a)" |
|
237 |
apply (rule list_eq.intros(6)) |
|
238 |
apply (rule append_rsp_fst) |
|
239 |
apply (rule rev_rsp) |
|
240 |
apply (rule list_eq.intros(6)) |
|
241 |
apply (rule rev_rsp) |
|
242 |
apply (simp) |
|
243 |
apply (rule append_rsp_fst) |
|
244 |
apply (rule list_eq.intros(3)) |
|
245 |
apply (rule rev_rsp) |
|
246 |
done |
|
247 |
||
248 |
lemma append_rsp: |
|
249 |
assumes a : "list_eq l1 r1" |
|
250 |
assumes b : "list_eq l2 r2 " |
|
251 |
shows "(l1 @ l2) \<approx> (r1 @ r2)" |
|
252 |
apply (rule list_eq.intros(6)) |
|
253 |
apply (rule append_rsp_fst) |
|
254 |
using a apply (assumption) |
|
255 |
apply (rule list_eq.intros(6)) |
|
256 |
apply (rule append_sym_rsp) |
|
257 |
apply (rule list_eq.intros(6)) |
|
258 |
apply (rule append_rsp_fst) |
|
259 |
using b apply (assumption) |
|
260 |
apply (rule append_sym_rsp) |
|
261 |
done |
|
175
f7602653dddd
Preparing infrastructire for LAMBDA_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
173
diff
changeset
|
262 |
|
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
263 |
lemma ho_append_rsp: |
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
226
diff
changeset
|
264 |
"(op \<approx> ===> op \<approx> ===> op \<approx>) op @ op @" |
214 | 265 |
by (simp add: append_rsp) |
175
f7602653dddd
Preparing infrastructire for LAMBDA_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
173
diff
changeset
|
266 |
|
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
267 |
lemma map_rsp: |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
268 |
assumes a: "a \<approx> b" |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
269 |
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
|
270 |
using a |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
271 |
apply (induct) |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
272 |
apply(auto intro: list_eq.intros) |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
273 |
done |
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
274 |
|
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
275 |
lemma ho_map_rsp: |
294 | 276 |
"(op = ===> op \<approx> ===> op \<approx>) map map" |
277 |
by (simp add: map_rsp) |
|
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
278 |
|
294 | 279 |
lemma map_append: |
258
93ea455b29f1
Map does not fully work yet.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
257
diff
changeset
|
280 |
"(map f (a @ b)) \<approx> |
93ea455b29f1
Map does not fully work yet.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
257
diff
changeset
|
281 |
(map f a) @ (map f b)" |
215
89a2ff3f82c7
More finshed proofs and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
214
diff
changeset
|
282 |
by simp (rule list_eq_refl) |
194
03c03e88efa9
Simplifying Int and Working on map
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
190
diff
changeset
|
283 |
|
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
284 |
lemma ho_fold_rsp: |
294 | 285 |
"(op = ===> op = ===> op = ===> op \<approx> ===> op =) fold1 fold1" |
292
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
286 |
apply (auto simp add: FUN_REL_EQ) |
294 | 287 |
apply (case_tac "rsp_fold x") |
288 |
prefer 2 |
|
289 |
apply (erule_tac list_eq.induct) |
|
290 |
apply (simp_all) |
|
291 |
apply (erule_tac list_eq.induct) |
|
292 |
apply (simp_all) |
|
293 |
apply (auto simp add: memb_rsp rsp_fold_def) |
|
294 |
done |
|
241
60acf3d3a4a0
Finding applications and duplicates filtered out in abstractions
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
239
diff
changeset
|
295 |
|
254
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
296 |
print_quotients |
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
297 |
|
77ff9624cfd6
fixed the problem with types in map
Christian Urban <urbanc@in.tum.de>
parents:
252
diff
changeset
|
298 |
|
226 | 299 |
ML {* val qty = @{typ "'a fset"} *} |
300 |
ML {* val rsp_thms = |
|
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
301 |
@{thms ho_memb_rsp ho_cons_rsp ho_card1_rsp ho_map_rsp ho_append_rsp ho_fold_rsp} |
226 | 302 |
@ @{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
|
303 |
|
364
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
304 |
ML {* val (rty, rel, rel_refl, rel_eqv) = lookup_quot_data @{context} qty *} |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
305 |
ML {* val (trans2, reps_same, absrep, quot) = lookup_quot_thms @{context} "fset"; *} |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
306 |
ML {* val consts = lookup_quot_consts defs *} |
419
b1cd040ff5f7
Simplifying arguments; got rid of trans2_thm.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
307 |
ML {* fun lift_tac_fset lthy t = lift_tac lthy t [rel_eqv] rty [quot] rsp_thms defs *} |
314 | 308 |
|
364
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
309 |
lemma "IN x EMPTY = False" |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
310 |
by (tactic {* lift_tac_fset @{context} @{thm m1} 1 *}) |
353
9a0e8ab42ee8
fixed the error by a temporary fix (the data of the eqivalence relation should be only its name)
Christian Urban <urbanc@in.tum.de>
parents:
350
diff
changeset
|
311 |
|
364
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
312 |
lemma "IN x (INSERT y xa) = (x = y \<or> IN x xa)" |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
313 |
by (tactic {* lift_tac_fset @{context} @{thm m2} 1 *}) |
356
51aafebf4d06
Another theorem for which the new regularize differs from old one, so the goal is not proved. But it seems, that the new one is better.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
353
diff
changeset
|
314 |
|
364
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
315 |
lemma "INSERT a (INSERT a x) = INSERT a x" |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
316 |
apply (tactic {* lift_tac_fset @{context} @{thm list_eq.intros(4)} 1 *}) |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
317 |
done |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
318 |
|
367
d444389fe3f9
The non-working procedure_tac.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
364
diff
changeset
|
319 |
lemma "x = xa \<Longrightarrow> INSERT a x = INSERT a xa" |
364
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
320 |
apply (tactic {* lift_tac_fset @{context} @{thm list_eq.intros(5)} 1 *}) |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
321 |
done |
353
9a0e8ab42ee8
fixed the error by a temporary fix (the data of the eqivalence relation should be only its name)
Christian Urban <urbanc@in.tum.de>
parents:
350
diff
changeset
|
322 |
|
367
d444389fe3f9
The non-working procedure_tac.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
364
diff
changeset
|
323 |
lemma "CARD x = Suc n \<Longrightarrow> (\<exists>a b. \<not> IN a b & x = INSERT a b)" |
364
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
324 |
apply (tactic {* lift_tac_fset @{context} @{thm card1_suc} 1 *}) |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
325 |
done |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
326 |
|
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
327 |
lemma "(\<not> IN x xa) = (CARD (INSERT x xa) = Suc (CARD xa))" |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
328 |
apply (tactic {* lift_tac_fset @{context} @{thm not_mem_card1} 1 *}) |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
329 |
done |
356
51aafebf4d06
Another theorem for which the new regularize differs from old one, so the goal is not proved. But it seems, that the new one is better.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
353
diff
changeset
|
330 |
|
364
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
331 |
lemma "\<forall>f g z a x. FOLD f g (z::'b) (INSERT a x) = |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
332 |
(if rsp_fold f then if IN a x then FOLD f g z x else f (g a) (FOLD f g z x) else z)" |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
333 |
apply (tactic {* lift_tac_fset @{context} @{thm fold1.simps(2)} 1 *}) |
4c455d58ac99
Fixes to the tactic after quotient_tac changed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
356
diff
changeset
|
334 |
done |
356
51aafebf4d06
Another theorem for which the new regularize differs from old one, so the goal is not proved. But it seems, that the new one is better.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
353
diff
changeset
|
335 |
|
368 | 336 |
lemma "fmap f (FUNION (x::'b fset) (xa::'b fset)) = FUNION (fmap f x) (fmap f xa)" |
337 |
apply (tactic {* lift_tac_fset @{context} @{thm map_append} 1 *}) |
|
338 |
done |
|
339 |
||
367
d444389fe3f9
The non-working procedure_tac.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
364
diff
changeset
|
340 |
lemma "FUNION (FUNION x xa) xb = FUNION x (FUNION xa xb)" |
d444389fe3f9
The non-working procedure_tac.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
364
diff
changeset
|
341 |
apply (tactic {* lift_tac_fset @{context} @{thm append_assoc} 1 *}) |
d444389fe3f9
The non-working procedure_tac.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
364
diff
changeset
|
342 |
done |
d444389fe3f9
The non-working procedure_tac.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
364
diff
changeset
|
343 |
|
390 | 344 |
lemma cheat: "P" sorry |
345 |
||
376
e99c0334d8bf
lambda_prs and cleaning the existing examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
375
diff
changeset
|
346 |
lemma "\<lbrakk>P EMPTY; \<And>a x. P x \<Longrightarrow> P (INSERT a x)\<rbrakk> \<Longrightarrow> P l" |
392
98ccde1c184c
Fixed FSet after merge.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
391
diff
changeset
|
347 |
apply(tactic {* procedure_tac @{context} @{thm list.induct} 1 *}) |
416
3f3927f793d4
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
414
diff
changeset
|
348 |
apply(tactic {* regularize_tac @{context} [rel_eqv] [rel_refl] 1 *}) |
398
fafcc54e531d
some diagnostic code for r_mk_comb
Christian Urban <urbanc@in.tum.de>
parents:
397
diff
changeset
|
349 |
prefer 2 |
420
dcfe009c98aa
replaced FIRST' (map rtac list) with resolve_tac list
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
350 |
apply (tactic {* clean_tac @{context} [quot] defs |
dcfe009c98aa
replaced FIRST' (map rtac list) with resolve_tac list
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
351 |
[(@{typ "('a list \<Rightarrow> bool)"},@{typ "('a fset \<Rightarrow> bool)"})] 1 *}) |
416
3f3927f793d4
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
414
diff
changeset
|
352 |
apply(tactic {* r_mk_comb_tac' @{context} rty [quot] rel_refl trans2 rsp_thms 1*}) |
414 | 353 |
done |
390 | 354 |
|
420
dcfe009c98aa
replaced FIRST' (map rtac list) with resolve_tac list
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
355 |
|
dcfe009c98aa
replaced FIRST' (map rtac list) with resolve_tac list
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
356 |
|
dcfe009c98aa
replaced FIRST' (map rtac list) with resolve_tac list
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
357 |
|
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
358 |
quotient_def |
276 | 359 |
fset_rec::"'a \<Rightarrow> ('b \<Rightarrow> 'b fset \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'b fset \<Rightarrow> 'a" |
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
360 |
where |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
361 |
"fset_rec \<equiv> list_rec" |
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
362 |
|
292
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
363 |
quotient_def |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
364 |
fset_case::"'a \<Rightarrow> ('b \<Rightarrow> 'b fset \<Rightarrow> 'a) \<Rightarrow> 'b fset \<Rightarrow> 'a" |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
365 |
where |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
366 |
"fset_case \<equiv> list_case" |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
367 |
|
296 | 368 |
(* Probably not true without additional assumptions about the function *) |
292
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
369 |
lemma list_rec_rsp: |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
370 |
"(op = ===> (op = ===> op \<approx> ===> op =) ===> op \<approx> ===> op =) list_rec list_rec" |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
371 |
apply (auto simp add: FUN_REL_EQ) |
296 | 372 |
apply (erule_tac list_eq.induct) |
373 |
apply (simp_all) |
|
292
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
374 |
sorry |
289
7e8617f20b59
Remaining fixes for polymorphic types. map_append now lifts properly with 'a list and 'b list.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
285
diff
changeset
|
375 |
|
292
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
376 |
lemma list_case_rsp: |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
377 |
"(op = ===> (op = ===> op \<approx> ===> op =) ===> op \<approx> ===> op =) list_case list_case" |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
378 |
apply (auto simp add: FUN_REL_EQ) |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
379 |
sorry |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
380 |
|
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
381 |
ML {* val rsp_thms = @{thms list_rec_rsp list_case_rsp} @ rsp_thms *} |
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
382 |
ML {* val defs = @{thms fset_rec_def fset_case_def} @ defs *} |
419
b1cd040ff5f7
Simplifying arguments; got rid of trans2_thm.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
383 |
ML {* fun lift_tac_fset lthy t = lift_tac lthy t [rel_eqv] rty [quot] rsp_thms defs *} |
356
51aafebf4d06
Another theorem for which the new regularize differs from old one, so the goal is not proved. But it seems, that the new one is better.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
353
diff
changeset
|
384 |
|
376
e99c0334d8bf
lambda_prs and cleaning the existing examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
375
diff
changeset
|
385 |
lemma "fset_rec (f1::'t) x (INSERT a xa) = x a xa (fset_rec f1 x xa)" |
e99c0334d8bf
lambda_prs and cleaning the existing examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
375
diff
changeset
|
386 |
apply (tactic {* lift_tac_fset @{context} @{thm list.recs(2)} 1 *}) |
e99c0334d8bf
lambda_prs and cleaning the existing examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
375
diff
changeset
|
387 |
done |
e99c0334d8bf
lambda_prs and cleaning the existing examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
375
diff
changeset
|
388 |
|
e99c0334d8bf
lambda_prs and cleaning the existing examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
375
diff
changeset
|
389 |
lemma "fset_case (f1::'t) f2 (INSERT a xa) = f2 a xa" |
e99c0334d8bf
lambda_prs and cleaning the existing examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
375
diff
changeset
|
390 |
apply (tactic {* lift_tac_fset @{context} @{thm list.cases(2)} 1 *}) |
e99c0334d8bf
lambda_prs and cleaning the existing examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
375
diff
changeset
|
391 |
done |
348
b1f83c7a8674
More theorems lifted in the goal-directed way.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
338
diff
changeset
|
392 |
|
304
e741c735b867
Atomizing a "goal" theorems.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
300
diff
changeset
|
393 |
lemma list_induct_part: |
386
4fcbbb5b3b58
Moved exception handling to QuotMain and cleaned FSet.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
384
diff
changeset
|
394 |
assumes a: "P (x :: 'a list) ([] :: 'c list)" |
304
e741c735b867
Atomizing a "goal" theorems.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
300
diff
changeset
|
395 |
assumes b: "\<And>e t. P x t \<Longrightarrow> P x (e # t)" |
e741c735b867
Atomizing a "goal" theorems.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
300
diff
changeset
|
396 |
shows "P x l" |
e741c735b867
Atomizing a "goal" theorems.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
300
diff
changeset
|
397 |
apply (rule_tac P="P x" in list.induct) |
e741c735b867
Atomizing a "goal" theorems.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
300
diff
changeset
|
398 |
apply (rule a) |
e741c735b867
Atomizing a "goal" theorems.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
300
diff
changeset
|
399 |
apply (rule b) |
e741c735b867
Atomizing a "goal" theorems.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
300
diff
changeset
|
400 |
apply (assumption) |
e741c735b867
Atomizing a "goal" theorems.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
300
diff
changeset
|
401 |
done |
273
b82e765ca464
Lifting 'fold1.simps(2)' and some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
270
diff
changeset
|
402 |
|
292
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
403 |
|
419
b1cd040ff5f7
Simplifying arguments; got rid of trans2_thm.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
404 |
ML {* fun r_mk_comb_tac_fset lthy = r_mk_comb_tac lthy rty [quot] [rel_refl] [trans2] rsp_thms *} |
292
bd76f0398aa9
More functionality for lifting list.cases and list.recs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
291
diff
changeset
|
405 |
|
334 | 406 |
|
407 |
||
384
7f8b5ff303f4
Finished manual lifting of list_induct_part :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
379
diff
changeset
|
408 |
|
379
57bde65f6eb2
Removed unused things from QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
376
diff
changeset
|
409 |
(* Construction site starts here *) |
386
4fcbbb5b3b58
Moved exception handling to QuotMain and cleaned FSet.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
384
diff
changeset
|
410 |
lemma "P (x :: 'a list) (EMPTY :: 'c fset) \<Longrightarrow> (\<And>e t. P x t \<Longrightarrow> P x (INSERT e t)) \<Longrightarrow> P x l" |
389 | 411 |
apply (tactic {* procedure_tac @{context} @{thm list_induct_part} 1 *}) |
416
3f3927f793d4
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
414
diff
changeset
|
412 |
apply (tactic {* regularize_tac @{context} [rel_eqv] [rel_refl] 1 *}) |
309
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
413 |
apply (tactic {* (APPLY_RSP_TAC rty @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
414 |
apply (rule FUN_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
415 |
apply (rule FUN_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
416 |
apply (rule IDENTITY_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
417 |
apply (rule FUN_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
418 |
apply (rule QUOTIENT_fset) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
419 |
apply (rule IDENTITY_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
420 |
apply (rule IDENTITY_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
421 |
apply (rule IDENTITY_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
422 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
423 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
424 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
425 |
apply (tactic {* (APPLY_RSP_TAC rty @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
426 |
apply (rule IDENTITY_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
427 |
apply (rule IDENTITY_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
428 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
429 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
430 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
431 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
432 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
433 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
434 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
435 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
436 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
437 |
apply (tactic {* (APPLY_RSP_TAC rty @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
438 |
apply (rule IDENTITY_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
439 |
apply (rule FUN_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
440 |
apply (rule QUOTIENT_fset) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
441 |
apply (rule IDENTITY_QUOTIENT) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
442 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
443 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
444 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
445 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
446 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
447 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
448 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
449 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
450 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
451 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
452 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
453 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
454 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
455 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
456 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
457 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
458 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
459 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
317
d3c7f6d19c7f
Still don't know how to do the proof automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
314
diff
changeset
|
460 |
apply (tactic {* instantiate_tac @{thm APPLY_RSP2} @{context} 1 *}) |
416
3f3927f793d4
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
414
diff
changeset
|
461 |
apply (tactic {* (instantiate_tac @{thm REP_ABS_RSP(1)} @{context} THEN' (RANGE [quotient_tac [quot]])) 1 *}) |
317
d3c7f6d19c7f
Still don't know how to do the proof automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
314
diff
changeset
|
462 |
apply assumption |
d3c7f6d19c7f
Still don't know how to do the proof automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
314
diff
changeset
|
463 |
apply (rule refl) |
309
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
464 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
465 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
317
d3c7f6d19c7f
Still don't know how to do the proof automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
314
diff
changeset
|
466 |
apply (tactic {* instantiate_tac @{thm APPLY_RSP2} @{context} 1 *}) |
d3c7f6d19c7f
Still don't know how to do the proof automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
314
diff
changeset
|
467 |
apply (tactic {* instantiate_tac @{thm APPLY_RSP2} @{context} 1 *}) |
416
3f3927f793d4
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
414
diff
changeset
|
468 |
apply (tactic {* (instantiate_tac @{thm REP_ABS_RSP(1)} @{context} THEN' (RANGE [quotient_tac [quot]])) 1 *}) |
309
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
469 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
470 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
471 |
apply (tactic {* REPEAT_ALL_NEW (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
472 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
317
d3c7f6d19c7f
Still don't know how to do the proof automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
314
diff
changeset
|
473 |
apply (tactic {* instantiate_tac @{thm APPLY_RSP2} @{context} 1 *}) |
416
3f3927f793d4
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
414
diff
changeset
|
474 |
apply (tactic {* (instantiate_tac @{thm REP_ABS_RSP(1)} @{context} THEN' (RANGE [quotient_tac [quot]])) 1 *}) |
309
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
475 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
476 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
477 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
478 |
apply (tactic {* (r_mk_comb_tac_fset @{context}) 1 *}) |
416
3f3927f793d4
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
414
diff
changeset
|
479 |
apply (tactic {* clean_tac @{context} [quot] defs [(@{typ "('a list \<Rightarrow> 'c list \<Rightarrow> bool)"},@{typ "('a list \<Rightarrow> 'c fset \<Rightarrow> bool)"})] 1 *}) |
309
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
480 |
done |
20fa8dd8fb93
Lifting towards goal and manually finished the proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
305
diff
changeset
|
481 |
|
163
3da18bf6886c
Split Finite Set example into separate file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
482 |
end |