author | Christian Urban <urbanc@in.tum.de> |
Thu, 03 Dec 2009 14:00:43 +0100 | |
changeset 504 | bb23a7393de3 |
parent 494 | abafefa0d58b |
child 505 | 6cdba30c6d66 |
permissions | -rw-r--r-- |
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
theory IntEx |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
2 |
imports QuotMain |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
504 | 4 |
|
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
5 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
6 |
fun |
281
46e6d06efe3f
Experiments with lifting partially applied constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
276
diff
changeset
|
7 |
intrel :: "(nat \<times> nat) \<Rightarrow> (nat \<times> nat) \<Rightarrow> bool" (infix "\<approx>" 50) |
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
8 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
9 |
"intrel (x, y) (u, v) = (x + v = u + y)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
10 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
11 |
quotient my_int = "nat \<times> nat" / intrel |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
12 |
apply(unfold EQUIV_def) |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
apply(auto simp add: mem_def expand_fun_eq) |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
14 |
done |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
15 |
|
321
f46dc0ca08c3
simplified get_fun so that it uses directly rty and qty, instead of qenv
Christian Urban <urbanc@in.tum.de>
parents:
320
diff
changeset
|
16 |
thm my_int_equiv |
f46dc0ca08c3
simplified get_fun so that it uses directly rty and qty, instead of qenv
Christian Urban <urbanc@in.tum.de>
parents:
320
diff
changeset
|
17 |
|
239
02b14a21761a
Cleaning of the interface to lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
228
diff
changeset
|
18 |
print_theorems |
274
df225aa45770
simplified the quotient_def code
Christian Urban <urbanc@in.tum.de>
parents:
268
diff
changeset
|
19 |
print_quotients |
239
02b14a21761a
Cleaning of the interface to lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
228
diff
changeset
|
20 |
|
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:
263
diff
changeset
|
21 |
quotient_def |
218
df05cd030d2f
added infrastructure for defining lifted constants
Christian Urban <urbanc@in.tum.de>
parents:
210
diff
changeset
|
22 |
ZERO::"my_int" |
df05cd030d2f
added infrastructure for defining lifted constants
Christian Urban <urbanc@in.tum.de>
parents:
210
diff
changeset
|
23 |
where |
df05cd030d2f
added infrastructure for defining lifted constants
Christian Urban <urbanc@in.tum.de>
parents:
210
diff
changeset
|
24 |
"ZERO \<equiv> (0::nat, 0::nat)" |
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
25 |
|
318
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
312
diff
changeset
|
26 |
ML {* print_qconstinfo @{context} *} |
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
312
diff
changeset
|
27 |
|
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:
263
diff
changeset
|
28 |
term ZERO |
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:
263
diff
changeset
|
29 |
thm ZERO_def |
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
30 |
|
290
a0be84b0c707
removed typing information from get_fun in quotient_def; *potentially* dangerous
Christian Urban <urbanc@in.tum.de>
parents:
286
diff
changeset
|
31 |
ML {* prop_of @{thm ZERO_def} *} |
a0be84b0c707
removed typing information from get_fun in quotient_def; *potentially* dangerous
Christian Urban <urbanc@in.tum.de>
parents:
286
diff
changeset
|
32 |
|
318
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
312
diff
changeset
|
33 |
ML {* separate *} |
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
312
diff
changeset
|
34 |
|
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:
263
diff
changeset
|
35 |
quotient_def |
218
df05cd030d2f
added infrastructure for defining lifted constants
Christian Urban <urbanc@in.tum.de>
parents:
210
diff
changeset
|
36 |
ONE::"my_int" |
193 | 37 |
where |
218
df05cd030d2f
added infrastructure for defining lifted constants
Christian Urban <urbanc@in.tum.de>
parents:
210
diff
changeset
|
38 |
"ONE \<equiv> (1::nat, 0::nat)" |
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
39 |
|
318
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
312
diff
changeset
|
40 |
ML {* print_qconstinfo @{context} *} |
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
312
diff
changeset
|
41 |
|
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
42 |
term ONE |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
43 |
thm ONE_def |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
44 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
45 |
fun |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
46 |
my_plus :: "(nat \<times> nat) \<Rightarrow> (nat \<times> nat) \<Rightarrow> (nat \<times> nat)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
47 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
48 |
"my_plus (x, y) (u, v) = (x + u, y + v)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
49 |
|
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:
263
diff
changeset
|
50 |
quotient_def |
218
df05cd030d2f
added infrastructure for defining lifted constants
Christian Urban <urbanc@in.tum.de>
parents:
210
diff
changeset
|
51 |
PLUS::"my_int \<Rightarrow> my_int \<Rightarrow> my_int" |
df05cd030d2f
added infrastructure for defining lifted constants
Christian Urban <urbanc@in.tum.de>
parents:
210
diff
changeset
|
52 |
where |
275
34ad627ac5d5
fixed definition of PLUS
Christian Urban <urbanc@in.tum.de>
parents:
274
diff
changeset
|
53 |
"PLUS \<equiv> my_plus" |
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
54 |
|
318
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
312
diff
changeset
|
55 |
term my_plus |
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
56 |
term PLUS |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
57 |
thm PLUS_def |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
58 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
59 |
fun |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
60 |
my_neg :: "(nat \<times> nat) \<Rightarrow> (nat \<times> nat)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
61 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
62 |
"my_neg (x, y) = (y, x)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
63 |
|
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:
263
diff
changeset
|
64 |
quotient_def |
220 | 65 |
NEG::"my_int \<Rightarrow> my_int" |
66 |
where |
|
67 |
"NEG \<equiv> my_neg" |
|
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
68 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
69 |
term NEG |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
70 |
thm NEG_def |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
71 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
72 |
definition |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
73 |
MINUS :: "my_int \<Rightarrow> my_int \<Rightarrow> my_int" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
74 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
75 |
"MINUS z w = PLUS z (NEG w)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
76 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
77 |
fun |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
78 |
my_mult :: "(nat \<times> nat) \<Rightarrow> (nat \<times> nat) \<Rightarrow> (nat \<times> nat)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
79 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
80 |
"my_mult (x, y) (u, v) = (x*u + y*v, x*v + y*u)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
81 |
|
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:
263
diff
changeset
|
82 |
quotient_def |
220 | 83 |
MULT::"my_int \<Rightarrow> my_int \<Rightarrow> my_int" |
84 |
where |
|
85 |
"MULT \<equiv> my_mult" |
|
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
86 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
87 |
term MULT |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
88 |
thm MULT_def |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
89 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
90 |
(* NOT SURE WETHER THIS DEFINITION IS CORRECT *) |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
91 |
fun |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
92 |
my_le :: "(nat \<times> nat) \<Rightarrow> (nat \<times> nat) \<Rightarrow> bool" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
93 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
94 |
"my_le (x, y) (u, v) = (x+v \<le> u+y)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
95 |
|
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:
263
diff
changeset
|
96 |
quotient_def |
220 | 97 |
LE :: "my_int \<Rightarrow> my_int \<Rightarrow> bool" |
98 |
where |
|
99 |
"LE \<equiv> my_le" |
|
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
100 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
101 |
term LE |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
102 |
thm LE_def |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
103 |
|
321
f46dc0ca08c3
simplified get_fun so that it uses directly rty and qty, instead of qenv
Christian Urban <urbanc@in.tum.de>
parents:
320
diff
changeset
|
104 |
|
181
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
105 |
definition |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
106 |
LESS :: "my_int \<Rightarrow> my_int \<Rightarrow> bool" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
107 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
108 |
"LESS z w = (LE z w \<and> z \<noteq> w)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
109 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
110 |
term LESS |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
111 |
thm LESS_def |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
112 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
113 |
definition |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
114 |
ABS :: "my_int \<Rightarrow> my_int" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
115 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
116 |
"ABS i = (if (LESS i ZERO) then (NEG i) else i)" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
117 |
|
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
118 |
definition |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
119 |
SIGN :: "my_int \<Rightarrow> my_int" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
120 |
where |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
121 |
"SIGN i = (if i = ZERO then ZERO else if (LESS ZERO i) then ONE else (NEG ONE))" |
3e53081ad53a
added another example file about integers (see HOL/Int.thy)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
122 |
|
310
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
123 |
ML {* print_qconstinfo @{context} *} |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
124 |
|
199 | 125 |
lemma plus_sym_pre: |
281
46e6d06efe3f
Experiments with lifting partially applied constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
276
diff
changeset
|
126 |
shows "my_plus a b \<approx> my_plus b a" |
199 | 127 |
apply(cases a) |
128 |
apply(cases b) |
|
129 |
apply(auto) |
|
130 |
done |
|
131 |
||
450
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
446
diff
changeset
|
132 |
lemma ho_plus_rsp[quot_rsp]: |
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
446
diff
changeset
|
133 |
shows "(intrel ===> intrel ===> intrel) my_plus my_plus" |
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
446
diff
changeset
|
134 |
by (simp) |
192
a296bf1a3b09
Simplifying code in int
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
191
diff
changeset
|
135 |
|
a296bf1a3b09
Simplifying code in int
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
191
diff
changeset
|
136 |
ML {* val qty = @{typ "my_int"} *} |
239
02b14a21761a
Cleaning of the interface to lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
228
diff
changeset
|
137 |
ML {* val ty_name = "my_int" *} |
458 | 138 |
ML {* val rsp_thms = @{thms ho_plus_rsp} *} |
260
59578f428bbe
Fixes after optimization and preparing for a general FORALL_PRS
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
239
diff
changeset
|
139 |
ML {* val defs = @{thms PLUS_def} *} |
377 | 140 |
ML {* val (rty, rel, rel_refl, rel_eqv) = lookup_quot_data @{context} qty *} |
141 |
ML {* val (trans2, reps_same, absrep, quot) = lookup_quot_thms @{context} "my_int"; *} |
|
142 |
ML {* val consts = lookup_quot_consts defs *} |
|
197
c0f2db9a243b
Further reordering in Int code.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
196
diff
changeset
|
143 |
|
489
2b7b349e470f
deleted now obsolete argument rty everywhere
Christian Urban <urbanc@in.tum.de>
parents:
485
diff
changeset
|
144 |
ML {* fun lift_tac_intex lthy t = lift_tac lthy t [rel_eqv] [quot] defs *} |
423
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
145 |
|
489
2b7b349e470f
deleted now obsolete argument rty everywhere
Christian Urban <urbanc@in.tum.de>
parents:
485
diff
changeset
|
146 |
ML {* fun inj_repabs_tac_intex lthy = inj_repabs_tac lthy [quot] [rel_refl] [trans2] *} |
2b7b349e470f
deleted now obsolete argument rty everywhere
Christian Urban <urbanc@in.tum.de>
parents:
485
diff
changeset
|
147 |
ML {* fun all_inj_repabs_tac_intex lthy = all_inj_repabs_tac lthy [quot] [rel_refl] [trans2] *} |
423
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
148 |
|
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
149 |
|
377 | 150 |
lemma "PLUS a b = PLUS b a" |
423
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
151 |
apply(tactic {* procedure_tac @{context} @{thm plus_sym_pre} 1 *}) |
432
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
423
diff
changeset
|
152 |
apply(tactic {* regularize_tac @{context} [rel_eqv] 1 *}) |
423
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
153 |
prefer 2 |
466 | 154 |
apply(tactic {* clean_tac @{context} [quot] defs 1 *}) |
445
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
155 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
156 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
157 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
158 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
159 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
160 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
161 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
162 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
163 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
164 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
165 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
166 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
167 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
168 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
169 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
170 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
171 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
172 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
173 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
174 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
175 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
176 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
177 |
apply(tactic {* inj_repabs_tac_intex @{context} 1*}) |
423
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
178 |
done |
342 | 179 |
|
198
ff4425e000db
Completely cleaned Int.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
197
diff
changeset
|
180 |
lemma plus_assoc_pre: |
281
46e6d06efe3f
Experiments with lifting partially applied constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
276
diff
changeset
|
181 |
shows "my_plus (my_plus i j) k \<approx> my_plus i (my_plus j k)" |
198
ff4425e000db
Completely cleaned Int.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
197
diff
changeset
|
182 |
apply (cases i) |
ff4425e000db
Completely cleaned Int.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
197
diff
changeset
|
183 |
apply (cases j) |
ff4425e000db
Completely cleaned Int.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
197
diff
changeset
|
184 |
apply (cases k) |
224
f9a25fe22037
Cleaning the unnecessary theorems in 'IntEx'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
222
diff
changeset
|
185 |
apply (simp) |
198
ff4425e000db
Completely cleaned Int.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
197
diff
changeset
|
186 |
done |
ff4425e000db
Completely cleaned Int.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
197
diff
changeset
|
187 |
|
377 | 188 |
lemma plus_assoc: "PLUS (PLUS x xa) xb = PLUS x (PLUS xa xb)" |
423
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
189 |
apply(tactic {* procedure_tac @{context} @{thm plus_assoc_pre} 1 *}) |
432
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
423
diff
changeset
|
190 |
apply(tactic {* regularize_tac @{context} [rel_eqv] 1 *}) |
445
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
191 |
apply(tactic {* all_inj_repabs_tac_intex @{context} 1*}) |
466 | 192 |
apply(tactic {* clean_tac @{context} [quot] defs 1 *}) |
423
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
193 |
done |
354
2eb6d527dfe4
addded a tactic, which sets up the three goals of the `algorithm'
Christian Urban <urbanc@in.tum.de>
parents:
347
diff
changeset
|
194 |
|
379
57bde65f6eb2
Removed unused things from QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
377
diff
changeset
|
195 |
lemma ho_tst: "foldl my_plus x [] = x" |
57bde65f6eb2
Removed unused things from QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
377
diff
changeset
|
196 |
apply simp |
57bde65f6eb2
Removed unused things from QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
377
diff
changeset
|
197 |
done |
57bde65f6eb2
Removed unused things from QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
377
diff
changeset
|
198 |
|
485
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
199 |
|
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
200 |
lemma foldr_prs: |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
201 |
assumes a: "QUOTIENT R1 abs1 rep1" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
202 |
and b: "QUOTIENT R2 abs2 rep2" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
203 |
shows "abs2 (foldr ((abs1 ---> abs2 ---> rep2) f) (map rep1 l) (rep2 e)) = foldr f l e" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
204 |
apply (induct l) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
205 |
apply (simp add: QUOTIENT_ABS_REP[OF b]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
206 |
apply (simp add: QUOTIENT_ABS_REP[OF a] QUOTIENT_ABS_REP[OF b]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
207 |
done |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
208 |
|
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
209 |
lemma foldl_prs: |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
210 |
assumes a: "QUOTIENT R1 abs1 rep1" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
211 |
and b: "QUOTIENT R2 abs2 rep2" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
212 |
shows "abs1 (foldl ((abs1 ---> abs2 ---> rep1) f) (rep1 e) (map rep2 l)) = foldl f e l" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
213 |
apply (induct l arbitrary:e) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
214 |
apply (simp add: QUOTIENT_ABS_REP[OF a]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
215 |
apply (simp add: QUOTIENT_ABS_REP[OF a] QUOTIENT_ABS_REP[OF b]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
216 |
done |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
217 |
|
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
218 |
lemma map_prs: |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
219 |
assumes a: "QUOTIENT R1 abs1 rep1" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
220 |
and b: "QUOTIENT R2 abs2 rep2" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
221 |
shows "(map abs2) (map ((abs1 ---> rep2) f) (map rep1 l)) = map f l" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
222 |
apply (induct l) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
223 |
apply (simp) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
224 |
apply (simp add: QUOTIENT_ABS_REP[OF a] QUOTIENT_ABS_REP[OF b]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
225 |
done |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
226 |
|
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
227 |
|
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
228 |
(* Removed unneeded assumption: "QUOTIENT R abs1 rep1" *) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
229 |
lemma nil_prs: |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
230 |
shows "map abs1 [] = []" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
231 |
by simp |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
232 |
|
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
233 |
lemma cons_prs: |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
234 |
assumes a: "QUOTIENT R1 abs1 rep1" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
235 |
shows "(map abs1) ((rep1 h) # (map rep1 t)) = h # t" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
236 |
apply (induct t) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
237 |
by (simp_all add: QUOTIENT_ABS_REP[OF a]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
238 |
|
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
239 |
lemma cons_rsp[quot_rsp]: |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
240 |
"(op \<approx> ===> LIST_REL op \<approx> ===> LIST_REL op \<approx>) op # op #" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
241 |
by simp |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
242 |
|
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
243 |
(* I believe it's true. *) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
244 |
lemma foldl_rsp[quot_rsp]: |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
245 |
"((op \<approx> ===> op \<approx> ===> op \<approx>) ===> op \<approx> ===> LIST_REL op \<approx> ===> op \<approx>) foldl foldl" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
246 |
apply (simp only: FUN_REL.simps) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
247 |
apply (rule allI) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
248 |
apply (rule allI) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
249 |
apply (rule impI) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
250 |
apply (rule allI) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
251 |
apply (rule allI) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
252 |
apply (rule impI) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
253 |
apply (rule allI) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
254 |
apply (rule allI) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
255 |
apply (rule impI) |
489
2b7b349e470f
deleted now obsolete argument rty everywhere
Christian Urban <urbanc@in.tum.de>
parents:
485
diff
changeset
|
256 |
apply (induct_tac xb yb rule: list_induct2) (* To finish I need to give it: arbitrary:xa ya *) |
414 | 257 |
sorry |
258 |
||
485
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
259 |
lemma nil_listrel_rsp[quot_rsp]: |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
260 |
"(LIST_REL R) [] []" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
261 |
by simp |
416
3f3927f793d4
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
414
diff
changeset
|
262 |
|
493 | 263 |
thm LAMBDA_PRS[no_vars] |
264 |
thm all_prs[no_vars] |
|
265 |
||
266 |
lemma test_all_prs: |
|
267 |
"\<lbrakk>QUOTIENT R absf repf; f = g\<rbrakk> \<Longrightarrow> Ball (Respects R) ((absf ---> id) f) = All g" |
|
268 |
apply(drule all_prs) |
|
269 |
apply(simp) |
|
270 |
done |
|
271 |
||
272 |
lemma test: |
|
273 |
"\<lbrakk>QUOTIENT R1 Abs1 Rep1; QUOTIENT R2 Abs2 Rep2; |
|
274 |
(\<lambda>x. Rep2 (f (Abs1 x))) = lhs \<rbrakk> \<Longrightarrow> (Rep1 ---> Abs2) lhs = f" |
|
275 |
apply - |
|
276 |
thm LAMBDA_PRS |
|
277 |
apply(drule LAMBDA_PRS) |
|
278 |
apply(assumption) |
|
279 |
apply(auto) |
|
280 |
done |
|
281 |
||
282 |
||
379
57bde65f6eb2
Removed unused things from QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
377
diff
changeset
|
283 |
lemma "foldl PLUS x [] = x" |
445
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
284 |
apply(tactic {* procedure_tac @{context} @{thm ho_tst} 1 *}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
285 |
apply(tactic {* regularize_tac @{context} [rel_eqv] 1 *}) |
f1c0a66284d3
renamed r_mk_comb_tac to inj_repabs_tac
Christian Urban <urbanc@in.tum.de>
parents:
433
diff
changeset
|
286 |
apply(tactic {* all_inj_repabs_tac_intex @{context} 1*}) |
485
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
287 |
apply(simp only: foldl_prs[OF QUOTIENT_my_int QUOTIENT_my_int]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
288 |
apply(simp only: nil_prs) |
466 | 289 |
apply(tactic {* clean_tac @{context} [quot] defs 1 *}) |
423
2f0ad33f0241
annotated a proof with all steps and simplified LAMBDA_RES_TAC
Christian Urban <urbanc@in.tum.de>
parents:
419
diff
changeset
|
290 |
done |
359 | 291 |
|
485
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
292 |
lemma ho_tst2: "foldl my_plus x (h # t) \<approx> my_plus h (foldl my_plus x t)" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
293 |
sorry |
327
22c8bf90cadb
tried to prove the repabs_inj lemma, but failed for the moment
Christian Urban <urbanc@in.tum.de>
parents:
326
diff
changeset
|
294 |
|
485
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
295 |
lemma "foldl PLUS x (h # t) = PLUS h (foldl PLUS x t)" |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
296 |
apply(tactic {* procedure_tac @{context} @{thm ho_tst2} 1 *}) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
297 |
apply(tactic {* regularize_tac @{context} [rel_eqv] 1 *}) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
298 |
apply(tactic {* all_inj_repabs_tac_intex @{context} 1*}) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
299 |
apply(simp only: foldl_prs[OF QUOTIENT_my_int QUOTIENT_my_int]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
300 |
apply(simp only: cons_prs[OF QUOTIENT_my_int]) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
301 |
apply(tactic {* clean_tac @{context} [quot] defs 1 *}) |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
302 |
done |
4efb104514f7
More experiments with higher order quotients and theorems with non-lifted constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
466
diff
changeset
|
303 |