author | Christian Urban <urbanc@in.tum.de> |
Tue, 24 Jan 2012 16:51:01 +0000 | |
changeset 3112 | e4050732ba15 |
parent 1460 | 0fd03936dedb |
permissions | -rw-r--r-- |
1148 | 1 |
(* Title: Quotient.thy |
759 | 2 |
Author: Cezary Kaliszyk and Christian Urban |
3 |
*) |
|
4 |
||
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
5 |
theory Quotient |
1460
0fd03936dedb
merge and proof of support for non-recursive case
Christian Urban <urbanc@in.tum.de>
parents:
1260
diff
changeset
|
6 |
imports Plain ATP_Linkup |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
7 |
uses |
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
8 |
("quotient_info.ML") |
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
9 |
("quotient_typ.ML") |
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
10 |
("quotient_def.ML") |
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
11 |
("quotient_term.ML") |
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
12 |
("quotient_tacs.ML") |
597 | 13 |
begin |
14 |
||
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
15 |
|
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
16 |
text {* |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
17 |
Basic definition for equivalence relations |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
18 |
that are represented by predicates. |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
19 |
*} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
20 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
21 |
definition |
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
22 |
"equivp E \<equiv> \<forall>x y. E x y = (E x = E y)" |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
23 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
24 |
definition |
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
25 |
"reflp E \<equiv> \<forall>x. E x x" |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
26 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
27 |
definition |
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
28 |
"symp E \<equiv> \<forall>x y. E x y \<longrightarrow> E y x" |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
29 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
30 |
definition |
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
31 |
"transp E \<equiv> \<forall>x y z. E x y \<and> E y z \<longrightarrow> E x z" |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
32 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
33 |
lemma equivp_reflp_symp_transp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
34 |
shows "equivp E = (reflp E \<and> symp E \<and> transp E)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
35 |
unfolding equivp_def reflp_def symp_def transp_def expand_fun_eq |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
36 |
by blast |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
37 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
38 |
lemma equivp_reflp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
39 |
shows "equivp E \<Longrightarrow> E x x" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
40 |
by (simp only: equivp_reflp_symp_transp reflp_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
41 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
42 |
lemma equivp_symp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
43 |
shows "equivp E \<Longrightarrow> E x y \<Longrightarrow> E y x" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
44 |
by (metis equivp_reflp_symp_transp symp_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
45 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
46 |
lemma equivp_transp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
47 |
shows "equivp E \<Longrightarrow> E x y \<Longrightarrow> E y z \<Longrightarrow> E x z" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
48 |
by (metis equivp_reflp_symp_transp transp_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
49 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
50 |
lemma equivpI: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
51 |
assumes "reflp R" "symp R" "transp R" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
52 |
shows "equivp R" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
53 |
using assms by (simp add: equivp_reflp_symp_transp) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
54 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
55 |
lemma identity_equivp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
56 |
shows "equivp (op =)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
57 |
unfolding equivp_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
58 |
by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
59 |
|
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
60 |
text {* Partial equivalences: not yet used anywhere *} |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
61 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
62 |
definition |
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
63 |
"part_equivp E \<equiv> (\<exists>x. E x x) \<and> (\<forall>x y. E x y = (E x x \<and> E y y \<and> (E x = E y)))" |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
64 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
65 |
lemma equivp_implies_part_equivp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
66 |
assumes a: "equivp E" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
67 |
shows "part_equivp E" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
68 |
using a |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
69 |
unfolding equivp_def part_equivp_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
70 |
by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
71 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
72 |
text {* Composition of Relations *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
73 |
|
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
74 |
abbreviation |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
75 |
rel_conj (infixr "OOO" 75) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
76 |
where |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
77 |
"r1 OOO r2 \<equiv> r1 OO r2 OO r1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
78 |
|
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
79 |
lemma eq_comp_r: |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
80 |
shows "((op =) OOO R) = R" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
81 |
by (auto simp add: expand_fun_eq) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
82 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
83 |
section {* Respects predicate *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
84 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
85 |
definition |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
86 |
Respects |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
87 |
where |
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
88 |
"Respects R x \<equiv> R x x" |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
89 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
90 |
lemma in_respects: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
91 |
shows "(x \<in> Respects R) = R x x" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
92 |
unfolding mem_def Respects_def |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
93 |
by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
94 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
95 |
section {* Function map and function relation *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
96 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
97 |
definition |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
98 |
fun_map (infixr "--->" 55) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
99 |
where |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
100 |
[simp]: "fun_map f g h x = g (h (f x))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
101 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
102 |
definition |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
103 |
fun_rel (infixr "===>" 55) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
104 |
where |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
105 |
[simp]: "fun_rel E1 E2 f g = (\<forall>x y. E1 x y \<longrightarrow> E2 (f x) (g y))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
106 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
107 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
108 |
lemma fun_map_id: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
109 |
shows "(id ---> id) = id" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
110 |
by (simp add: expand_fun_eq id_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
111 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
112 |
lemma fun_rel_eq: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
113 |
shows "((op =) ===> (op =)) = (op =)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
114 |
by (simp add: expand_fun_eq) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
115 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
116 |
lemma fun_rel_id: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
117 |
assumes a: "\<And>x y. R1 x y \<Longrightarrow> R2 (f x) (g y)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
118 |
shows "(R1 ===> R2) f g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
119 |
using a by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
120 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
121 |
lemma fun_rel_id_asm: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
122 |
assumes a: "\<And>x y. R1 x y \<Longrightarrow> (A \<longrightarrow> R2 (f x) (g y))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
123 |
shows "A \<longrightarrow> (R1 ===> R2) f g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
124 |
using a by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
125 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
126 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
127 |
section {* Quotient Predicate *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
128 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
129 |
definition |
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
130 |
"Quotient E Abs Rep \<equiv> |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
131 |
(\<forall>a. Abs (Rep a) = a) \<and> (\<forall>a. E (Rep a) (Rep a)) \<and> |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
132 |
(\<forall>r s. E r s = (E r r \<and> E s s \<and> (Abs r = Abs s)))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
133 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
134 |
lemma Quotient_abs_rep: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
135 |
assumes a: "Quotient E Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
136 |
shows "Abs (Rep a) = a" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
137 |
using a |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
138 |
unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
139 |
by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
140 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
141 |
lemma Quotient_rep_reflp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
142 |
assumes a: "Quotient E Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
143 |
shows "E (Rep a) (Rep a)" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
144 |
using a |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
145 |
unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
146 |
by blast |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
147 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
148 |
lemma Quotient_rel: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
149 |
assumes a: "Quotient E Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
150 |
shows " E r s = (E r r \<and> E s s \<and> (Abs r = Abs s))" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
151 |
using a |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
152 |
unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
153 |
by blast |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
154 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
155 |
lemma Quotient_rel_rep: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
156 |
assumes a: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
157 |
shows "R (Rep a) (Rep b) = (a = b)" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
158 |
using a |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
159 |
unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
160 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
161 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
162 |
lemma Quotient_rep_abs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
163 |
assumes a: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
164 |
shows "R r r \<Longrightarrow> R (Rep (Abs r)) r" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
165 |
using a unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
166 |
by blast |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
167 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
168 |
lemma Quotient_rel_abs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
169 |
assumes a: "Quotient E Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
170 |
shows "E r s \<Longrightarrow> Abs r = Abs s" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
171 |
using a unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
172 |
by blast |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
173 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
174 |
lemma Quotient_symp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
175 |
assumes a: "Quotient E Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
176 |
shows "symp E" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
177 |
using a unfolding Quotient_def symp_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
178 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
179 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
180 |
lemma Quotient_transp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
181 |
assumes a: "Quotient E Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
182 |
shows "transp E" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
183 |
using a unfolding Quotient_def transp_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
184 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
185 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
186 |
lemma identity_quotient: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
187 |
shows "Quotient (op =) id id" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
188 |
unfolding Quotient_def id_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
189 |
by blast |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
190 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
191 |
lemma fun_quotient: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
192 |
assumes q1: "Quotient R1 abs1 rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
193 |
and q2: "Quotient R2 abs2 rep2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
194 |
shows "Quotient (R1 ===> R2) (rep1 ---> abs2) (abs1 ---> rep2)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
195 |
proof - |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
196 |
have "\<forall>a. (rep1 ---> abs2) ((abs1 ---> rep2) a) = a" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
197 |
using q1 q2 |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
198 |
unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
199 |
unfolding expand_fun_eq |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
200 |
by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
201 |
moreover |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
202 |
have "\<forall>a. (R1 ===> R2) ((abs1 ---> rep2) a) ((abs1 ---> rep2) a)" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
203 |
using q1 q2 |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
204 |
unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
205 |
by (simp (no_asm)) (metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
206 |
moreover |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
207 |
have "\<forall>r s. (R1 ===> R2) r s = ((R1 ===> R2) r r \<and> (R1 ===> R2) s s \<and> |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
208 |
(rep1 ---> abs2) r = (rep1 ---> abs2) s)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
209 |
unfolding expand_fun_eq |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
210 |
apply(auto) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
211 |
using q1 q2 unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
212 |
apply(metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
213 |
using q1 q2 unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
214 |
apply(metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
215 |
using q1 q2 unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
216 |
apply(metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
217 |
using q1 q2 unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
218 |
apply(metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
219 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
220 |
ultimately |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
221 |
show "Quotient (R1 ===> R2) (rep1 ---> abs2) (abs1 ---> rep2)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
222 |
unfolding Quotient_def by blast |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
223 |
qed |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
224 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
225 |
lemma abs_o_rep: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
226 |
assumes a: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
227 |
shows "Abs o Rep = id" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
228 |
unfolding expand_fun_eq |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
229 |
by (simp add: Quotient_abs_rep[OF a]) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
230 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
231 |
lemma equals_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
232 |
assumes q: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
233 |
and a: "R xa xb" "R ya yb" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
234 |
shows "R xa ya = R xb yb" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
235 |
using a Quotient_symp[OF q] Quotient_transp[OF q] |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
236 |
unfolding symp_def transp_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
237 |
by blast |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
238 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
239 |
lemma lambda_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
240 |
assumes q1: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
241 |
and q2: "Quotient R2 Abs2 Rep2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
242 |
shows "(Rep1 ---> Abs2) (\<lambda>x. Rep2 (f (Abs1 x))) = (\<lambda>x. f x)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
243 |
unfolding expand_fun_eq |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
244 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
245 |
by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
246 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
247 |
lemma lambda_prs1: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
248 |
assumes q1: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
249 |
and q2: "Quotient R2 Abs2 Rep2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
250 |
shows "(Rep1 ---> Abs2) (\<lambda>x. (Abs1 ---> Rep2) f x) = (\<lambda>x. f x)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
251 |
unfolding expand_fun_eq |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
252 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
253 |
by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
254 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
255 |
lemma rep_abs_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
256 |
assumes q: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
257 |
and a: "R x1 x2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
258 |
shows "R x1 (Rep (Abs x2))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
259 |
using a Quotient_rel[OF q] Quotient_abs_rep[OF q] Quotient_rep_reflp[OF q] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
260 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
261 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
262 |
lemma rep_abs_rsp_left: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
263 |
assumes q: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
264 |
and a: "R x1 x2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
265 |
shows "R (Rep (Abs x1)) x2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
266 |
using a Quotient_rel[OF q] Quotient_abs_rep[OF q] Quotient_rep_reflp[OF q] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
267 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
268 |
|
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
269 |
text{* |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
270 |
In the following theorem R1 can be instantiated with anything, |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
271 |
but we know some of the types of the Rep and Abs functions; |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
272 |
so by solving Quotient assumptions we can get a unique R1 that |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
273 |
will be provable; which is why we need to use apply_rsp and |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
274 |
not the primed version *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
275 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
276 |
lemma apply_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
277 |
fixes f g::"'a \<Rightarrow> 'c" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
278 |
assumes q: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
279 |
and a: "(R1 ===> R2) f g" "R1 x y" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
280 |
shows "R2 (f x) (g y)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
281 |
using a by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
282 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
283 |
lemma apply_rsp': |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
284 |
assumes a: "(R1 ===> R2) f g" "R1 x y" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
285 |
shows "R2 (f x) (g y)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
286 |
using a by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
287 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
288 |
section {* lemmas for regularisation of ball and bex *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
289 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
290 |
lemma ball_reg_eqv: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
291 |
fixes P :: "'a \<Rightarrow> bool" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
292 |
assumes a: "equivp R" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
293 |
shows "Ball (Respects R) P = (All P)" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
294 |
using a |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
295 |
unfolding equivp_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
296 |
by (auto simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
297 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
298 |
lemma bex_reg_eqv: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
299 |
fixes P :: "'a \<Rightarrow> bool" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
300 |
assumes a: "equivp R" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
301 |
shows "Bex (Respects R) P = (Ex P)" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
302 |
using a |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
303 |
unfolding equivp_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
304 |
by (auto simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
305 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
306 |
lemma ball_reg_right: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
307 |
assumes a: "\<And>x. R x \<Longrightarrow> P x \<longrightarrow> Q x" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
308 |
shows "All P \<longrightarrow> Ball R Q" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
309 |
using a by (metis COMBC_def Collect_def Collect_mem_eq) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
310 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
311 |
lemma bex_reg_left: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
312 |
assumes a: "\<And>x. R x \<Longrightarrow> Q x \<longrightarrow> P x" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
313 |
shows "Bex R Q \<longrightarrow> Ex P" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
314 |
using a by (metis COMBC_def Collect_def Collect_mem_eq) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
315 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
316 |
lemma ball_reg_left: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
317 |
assumes a: "equivp R" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
318 |
shows "(\<And>x. (Q x \<longrightarrow> P x)) \<Longrightarrow> Ball (Respects R) Q \<longrightarrow> All P" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
319 |
using a by (metis equivp_reflp in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
320 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
321 |
lemma bex_reg_right: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
322 |
assumes a: "equivp R" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
323 |
shows "(\<And>x. (Q x \<longrightarrow> P x)) \<Longrightarrow> Ex Q \<longrightarrow> Bex (Respects R) P" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
324 |
using a by (metis equivp_reflp in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
325 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
326 |
lemma ball_reg_eqv_range: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
327 |
fixes P::"'a \<Rightarrow> bool" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
328 |
and x::"'a" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
329 |
assumes a: "equivp R2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
330 |
shows "(Ball (Respects (R1 ===> R2)) (\<lambda>f. P (f x)) = All (\<lambda>f. P (f x)))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
331 |
apply(rule iffI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
332 |
apply(rule allI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
333 |
apply(drule_tac x="\<lambda>y. f x" in bspec) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
334 |
apply(simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
335 |
apply(rule impI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
336 |
using a equivp_reflp_symp_transp[of "R2"] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
337 |
apply(simp add: reflp_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
338 |
apply(simp) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
339 |
apply(simp) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
340 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
341 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
342 |
lemma bex_reg_eqv_range: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
343 |
assumes a: "equivp R2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
344 |
shows "(Bex (Respects (R1 ===> R2)) (\<lambda>f. P (f x)) = Ex (\<lambda>f. P (f x)))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
345 |
apply(auto) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
346 |
apply(rule_tac x="\<lambda>y. f x" in bexI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
347 |
apply(simp) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
348 |
apply(simp add: Respects_def in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
349 |
apply(rule impI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
350 |
using a equivp_reflp_symp_transp[of "R2"] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
351 |
apply(simp add: reflp_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
352 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
353 |
|
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
354 |
(* Next four lemmas are unused *) |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
355 |
lemma all_reg: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
356 |
assumes a: "!x :: 'a. (P x --> Q x)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
357 |
and b: "All P" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
358 |
shows "All Q" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
359 |
using a b by (metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
360 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
361 |
lemma ex_reg: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
362 |
assumes a: "!x :: 'a. (P x --> Q x)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
363 |
and b: "Ex P" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
364 |
shows "Ex Q" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
365 |
using a b by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
366 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
367 |
lemma ball_reg: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
368 |
assumes a: "!x :: 'a. (R x --> P x --> Q x)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
369 |
and b: "Ball R P" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
370 |
shows "Ball R Q" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
371 |
using a b by (metis COMBC_def Collect_def Collect_mem_eq) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
372 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
373 |
lemma bex_reg: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
374 |
assumes a: "!x :: 'a. (R x --> P x --> Q x)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
375 |
and b: "Bex R P" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
376 |
shows "Bex R Q" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
377 |
using a b by (metis COMBC_def Collect_def Collect_mem_eq) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
378 |
|
1137
36d596cb63a2
moved "strange" lemma to quotient_tacs; marked a number of lemmas as unused; tuned
Christian Urban <urbanc@in.tum.de>
parents:
1129
diff
changeset
|
379 |
|
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
380 |
lemma ball_all_comm: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
381 |
assumes "\<And>y. (\<forall>x\<in>P. A x y) \<longrightarrow> (\<forall>x. B x y)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
382 |
shows "(\<forall>x\<in>P. \<forall>y. A x y) \<longrightarrow> (\<forall>x. \<forall>y. B x y)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
383 |
using assms by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
384 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
385 |
lemma bex_ex_comm: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
386 |
assumes "(\<exists>y. \<exists>x. A x y) \<longrightarrow> (\<exists>y. \<exists>x\<in>P. B x y)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
387 |
shows "(\<exists>x. \<exists>y. A x y) \<longrightarrow> (\<exists>x\<in>P. \<exists>y. B x y)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
388 |
using assms by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
389 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
390 |
section {* Bounded abstraction *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
391 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
392 |
definition |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
393 |
Babs :: "('a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
394 |
where |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
395 |
"x \<in> p \<Longrightarrow> Babs p m x = m x" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
396 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
397 |
lemma babs_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
398 |
assumes q: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
399 |
and a: "(R1 ===> R2) f g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
400 |
shows "(R1 ===> R2) (Babs (Respects R1) f) (Babs (Respects R1) g)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
401 |
apply (auto simp add: Babs_def in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
402 |
apply (subgoal_tac "x \<in> Respects R1 \<and> y \<in> Respects R1") |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
403 |
using a apply (simp add: Babs_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
404 |
apply (simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
405 |
using Quotient_rel[OF q] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
406 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
407 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
408 |
lemma babs_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
409 |
assumes q1: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
410 |
and q2: "Quotient R2 Abs2 Rep2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
411 |
shows "((Rep1 ---> Abs2) (Babs (Respects R1) ((Abs1 ---> Rep2) f))) = f" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
412 |
apply (rule ext) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
413 |
apply (simp) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
414 |
apply (subgoal_tac "Rep1 x \<in> Respects R1") |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
415 |
apply (simp add: Babs_def Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2]) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
416 |
apply (simp add: in_respects Quotient_rel_rep[OF q1]) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
417 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
418 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
419 |
lemma babs_simp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
420 |
assumes q: "Quotient R1 Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
421 |
shows "((R1 ===> R2) (Babs (Respects R1) f) (Babs (Respects R1) g)) = ((R1 ===> R2) f g)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
422 |
apply(rule iffI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
423 |
apply(simp_all only: babs_rsp[OF q]) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
424 |
apply(auto simp add: Babs_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
425 |
apply (subgoal_tac "x \<in> Respects R1 \<and> y \<in> Respects R1") |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
426 |
apply(metis Babs_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
427 |
apply (simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
428 |
using Quotient_rel[OF q] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
429 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
430 |
|
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
431 |
(* If a user proves that a particular functional relation |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
432 |
is an equivalence this may be useful in regularising *) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
433 |
lemma babs_reg_eqv: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
434 |
shows "equivp R \<Longrightarrow> Babs (Respects R) P = P" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
435 |
by (simp add: expand_fun_eq Babs_def in_respects equivp_reflp) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
436 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
437 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
438 |
(* 3 lemmas needed for proving repabs_inj *) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
439 |
lemma ball_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
440 |
assumes a: "(R ===> (op =)) f g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
441 |
shows "Ball (Respects R) f = Ball (Respects R) g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
442 |
using a by (simp add: Ball_def in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
443 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
444 |
lemma bex_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
445 |
assumes a: "(R ===> (op =)) f g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
446 |
shows "(Bex (Respects R) f = Bex (Respects R) g)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
447 |
using a by (simp add: Bex_def in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
448 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
449 |
lemma bex1_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
450 |
assumes a: "(R ===> (op =)) f g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
451 |
shows "Ex1 (\<lambda>x. x \<in> Respects R \<and> f x) = Ex1 (\<lambda>x. x \<in> Respects R \<and> g x)" |
1128
17ca92ab4660
Main renaming + fixes for new Isabelle in IntEx2.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1127
diff
changeset
|
452 |
using a |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
453 |
by (simp add: Ex1_def in_respects) auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
454 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
455 |
(* 2 lemmas needed for cleaning of quantifiers *) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
456 |
lemma all_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
457 |
assumes a: "Quotient R absf repf" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
458 |
shows "Ball (Respects R) ((absf ---> id) f) = All f" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
459 |
using a unfolding Quotient_def Ball_def in_respects fun_map_def id_apply |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
460 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
461 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
462 |
lemma ex_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
463 |
assumes a: "Quotient R absf repf" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
464 |
shows "Bex (Respects R) ((absf ---> id) f) = Ex f" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
465 |
using a unfolding Quotient_def Bex_def in_respects fun_map_def id_apply |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
466 |
by metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
467 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
468 |
section {* Bex1_rel quantifier *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
469 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
470 |
definition |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
471 |
Bex1_rel :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
472 |
where |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
473 |
"Bex1_rel R P \<longleftrightarrow> (\<exists>x \<in> Respects R. P x) \<and> (\<forall>x \<in> Respects R. \<forall>y \<in> Respects R. ((P x \<and> P y) \<longrightarrow> (R x y)))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
474 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
475 |
lemma bex1_rel_aux: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
476 |
"\<lbrakk>\<forall>xa ya. R xa ya \<longrightarrow> x xa = y ya; Bex1_rel R x\<rbrakk> \<Longrightarrow> Bex1_rel R y" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
477 |
unfolding Bex1_rel_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
478 |
apply (erule conjE)+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
479 |
apply (erule bexE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
480 |
apply rule |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
481 |
apply (rule_tac x="xa" in bexI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
482 |
apply metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
483 |
apply metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
484 |
apply rule+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
485 |
apply (erule_tac x="xaa" in ballE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
486 |
prefer 2 |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
487 |
apply (metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
488 |
apply (erule_tac x="ya" in ballE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
489 |
prefer 2 |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
490 |
apply (metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
491 |
apply (metis in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
492 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
493 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
494 |
lemma bex1_rel_aux2: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
495 |
"\<lbrakk>\<forall>xa ya. R xa ya \<longrightarrow> x xa = y ya; Bex1_rel R y\<rbrakk> \<Longrightarrow> Bex1_rel R x" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
496 |
unfolding Bex1_rel_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
497 |
apply (erule conjE)+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
498 |
apply (erule bexE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
499 |
apply rule |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
500 |
apply (rule_tac x="xa" in bexI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
501 |
apply metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
502 |
apply metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
503 |
apply rule+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
504 |
apply (erule_tac x="xaa" in ballE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
505 |
prefer 2 |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
506 |
apply (metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
507 |
apply (erule_tac x="ya" in ballE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
508 |
prefer 2 |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
509 |
apply (metis) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
510 |
apply (metis in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
511 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
512 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
513 |
lemma bex1_rel_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
514 |
assumes a: "Quotient R absf repf" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
515 |
shows "((R ===> op =) ===> op =) (Bex1_rel R) (Bex1_rel R)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
516 |
apply simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
517 |
apply clarify |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
518 |
apply rule |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
519 |
apply (simp_all add: bex1_rel_aux bex1_rel_aux2) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
520 |
apply (erule bex1_rel_aux2) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
521 |
apply assumption |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
522 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
523 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
524 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
525 |
lemma ex1_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
526 |
assumes a: "Quotient R absf repf" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
527 |
shows "((absf ---> id) ---> id) (Bex1_rel R) f = Ex1 f" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
528 |
apply simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
529 |
apply (subst Bex1_rel_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
530 |
apply (subst Bex_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
531 |
apply (subst Ex1_def) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
532 |
apply simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
533 |
apply rule |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
534 |
apply (erule conjE)+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
535 |
apply (erule_tac exE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
536 |
apply (erule conjE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
537 |
apply (subgoal_tac "\<forall>y. R y y \<longrightarrow> f (absf y) \<longrightarrow> R x y") |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
538 |
apply (rule_tac x="absf x" in exI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
539 |
apply (simp) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
540 |
apply rule+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
541 |
using a unfolding Quotient_def |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
542 |
apply metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
543 |
apply rule+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
544 |
apply (erule_tac x="x" in ballE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
545 |
apply (erule_tac x="y" in ballE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
546 |
apply simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
547 |
apply (simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
548 |
apply (simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
549 |
apply (erule_tac exE) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
550 |
apply rule |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
551 |
apply (rule_tac x="repf x" in exI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
552 |
apply (simp only: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
553 |
apply rule |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
554 |
apply (metis Quotient_rel_rep[OF a]) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
555 |
using a unfolding Quotient_def apply (simp) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
556 |
apply rule+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
557 |
using a unfolding Quotient_def in_respects |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
558 |
apply metis |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
559 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
560 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
561 |
lemma bex1_bexeq_reg: "(\<exists>!x\<in>Respects R. P x) \<longrightarrow> (Bex1_rel R (\<lambda>x. P x))" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
562 |
apply (simp add: Ex1_def Bex1_rel_def in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
563 |
apply clarify |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
564 |
apply auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
565 |
apply (rule bexI) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
566 |
apply assumption |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
567 |
apply (simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
568 |
apply (simp add: in_respects) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
569 |
apply auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
570 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
571 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
572 |
section {* Various respects and preserve lemmas *} |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
573 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
574 |
lemma quot_rel_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
575 |
assumes a: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
576 |
shows "(R ===> R ===> op =) R R" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
577 |
apply(rule fun_rel_id)+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
578 |
apply(rule equals_rsp[OF a]) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
579 |
apply(assumption)+ |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
580 |
done |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
581 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
582 |
lemma o_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
583 |
assumes q1: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
584 |
and q2: "Quotient R2 Abs2 Rep2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
585 |
and q3: "Quotient R3 Abs3 Rep3" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
586 |
shows "(Rep1 ---> Abs3) (((Abs2 ---> Rep3) f) o ((Abs1 ---> Rep2) g)) = f o g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
587 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] Quotient_abs_rep[OF q3] |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
588 |
unfolding o_def expand_fun_eq by simp |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
589 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
590 |
lemma o_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
591 |
assumes q1: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
592 |
and q2: "Quotient R2 Abs2 Rep2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
593 |
and q3: "Quotient R3 Abs3 Rep3" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
594 |
and a1: "(R2 ===> R3) f1 f2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
595 |
and a2: "(R1 ===> R2) g1 g2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
596 |
shows "(R1 ===> R3) (f1 o g1) (f2 o g2)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
597 |
using a1 a2 unfolding o_def expand_fun_eq |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
598 |
by (auto) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
599 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
600 |
lemma cond_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
601 |
assumes a: "Quotient R absf repf" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
602 |
shows "absf (if a then repf b else repf c) = (if a then b else c)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
603 |
using a unfolding Quotient_def by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
604 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
605 |
lemma if_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
606 |
assumes q: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
607 |
shows "Abs (If a (Rep b) (Rep c)) = If a b c" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
608 |
using Quotient_abs_rep[OF q] by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
609 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
610 |
(* q not used *) |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
611 |
lemma if_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
612 |
assumes q: "Quotient R Abs Rep" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
613 |
and a: "a1 = a2" "R b1 b2" "R c1 c2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
614 |
shows "R (If a1 b1 c1) (If a2 b2 c2)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
615 |
using a by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
616 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
617 |
lemma let_prs: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
618 |
assumes q1: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
619 |
and q2: "Quotient R2 Abs2 Rep2" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
620 |
shows "Abs2 (Let (Rep1 x) ((Abs1 ---> Rep2) f)) = Let x f" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
621 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
622 |
|
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
623 |
lemma let_rsp: |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
624 |
assumes q1: "Quotient R1 Abs1 Rep1" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
625 |
and a1: "(R1 ===> R2) f g" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
626 |
and a2: "R1 x y" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
627 |
shows "R2 ((Let x f)::'c) ((Let y g)::'c)" |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
628 |
using apply_rsp[OF q1 a1] a2 by auto |
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
629 |
|
1124 | 630 |
locale quot_type = |
597 | 631 |
fixes R :: "'a \<Rightarrow> 'a \<Rightarrow> bool" |
632 |
and Abs :: "('a \<Rightarrow> bool) \<Rightarrow> 'b" |
|
633 |
and Rep :: "'b \<Rightarrow> ('a \<Rightarrow> bool)" |
|
634 |
assumes equivp: "equivp R" |
|
635 |
and rep_prop: "\<And>y. \<exists>x. Rep y = R x" |
|
636 |
and rep_inverse: "\<And>x. Abs (Rep x) = x" |
|
637 |
and abs_inverse: "\<And>x. (Rep (Abs (R x))) = (R x)" |
|
638 |
and rep_inject: "\<And>x y. (Rep x = Rep y) = (x = y)" |
|
639 |
begin |
|
640 |
||
641 |
definition |
|
719 | 642 |
abs::"'a \<Rightarrow> 'b" |
597 | 643 |
where |
719 | 644 |
"abs x \<equiv> Abs (R x)" |
597 | 645 |
|
646 |
definition |
|
719 | 647 |
rep::"'b \<Rightarrow> 'a" |
597 | 648 |
where |
719 | 649 |
"rep a = Eps (Rep a)" |
597 | 650 |
|
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
651 |
lemma homeier_lem9: |
597 | 652 |
shows "R (Eps (R x)) = R x" |
653 |
proof - |
|
654 |
have a: "R x x" using equivp by (simp add: equivp_reflp_symp_transp reflp_def) |
|
655 |
then have "R x (Eps (R x))" by (rule someI) |
|
656 |
then show "R (Eps (R x)) = R x" |
|
657 |
using equivp unfolding equivp_def by simp |
|
658 |
qed |
|
659 |
||
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
660 |
theorem homeier_thm10: |
930
68c1f378a70a
All eq_reflections apart from the one of 'id_apply' can be removed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
925
diff
changeset
|
661 |
shows "abs (rep a) = a" |
719 | 662 |
unfolding abs_def rep_def |
597 | 663 |
proof - |
664 |
from rep_prop |
|
665 |
obtain x where eq: "Rep a = R x" by auto |
|
666 |
have "Abs (R (Eps (Rep a))) = Abs (R (Eps (R x)))" using eq by simp |
|
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
667 |
also have "\<dots> = Abs (R x)" using homeier_lem9 by simp |
597 | 668 |
also have "\<dots> = Abs (Rep a)" using eq by simp |
669 |
also have "\<dots> = a" using rep_inverse by simp |
|
670 |
finally |
|
671 |
show "Abs (R (Eps (Rep a))) = a" by simp |
|
672 |
qed |
|
673 |
||
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
674 |
lemma homeier_lem7: |
919 | 675 |
shows "(R x = R y) = (Abs (R x) = Abs (R y))" (is "?LHS = ?RHS") |
676 |
proof - |
|
677 |
have "?RHS = (Rep (Abs (R x)) = Rep (Abs (R y)))" by (simp add: rep_inject) |
|
678 |
also have "\<dots> = ?LHS" by (simp add: abs_inverse) |
|
679 |
finally show "?LHS = ?RHS" by simp |
|
680 |
qed |
|
597 | 681 |
|
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
682 |
theorem homeier_thm11: |
719 | 683 |
shows "R r r' = (abs r = abs r')" |
1116
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
684 |
unfolding abs_def |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
685 |
by (simp only: equivp[simplified equivp_def] homeier_lem7) |
597 | 686 |
|
920
dae99175f584
renamed QuotScript to QuotBase
Christian Urban <urbanc@in.tum.de>
parents:
919
diff
changeset
|
687 |
lemma rep_refl: |
dae99175f584
renamed QuotScript to QuotBase
Christian Urban <urbanc@in.tum.de>
parents:
919
diff
changeset
|
688 |
shows "R (rep a) (rep a)" |
1116
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
689 |
unfolding rep_def |
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
690 |
by (simp add: equivp[simplified equivp_def]) |
920
dae99175f584
renamed QuotScript to QuotBase
Christian Urban <urbanc@in.tum.de>
parents:
919
diff
changeset
|
691 |
|
dae99175f584
renamed QuotScript to QuotBase
Christian Urban <urbanc@in.tum.de>
parents:
919
diff
changeset
|
692 |
|
719 | 693 |
lemma rep_abs_rsp: |
694 |
shows "R f (rep (abs g)) = R f g" |
|
695 |
and "R (rep (abs g)) f = R g f" |
|
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
696 |
by (simp_all add: homeier_thm10 homeier_thm11) |
597 | 697 |
|
698 |
lemma Quotient: |
|
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
699 |
shows "Quotient R abs rep" |
1116
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
700 |
unfolding Quotient_def |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
701 |
apply(simp add: homeier_thm10) |
1116
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
702 |
apply(simp add: rep_refl) |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
703 |
apply(subst homeier_thm11[symmetric]) |
1116
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
704 |
apply(simp add: equivp[simplified equivp_def]) |
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
705 |
done |
597 | 706 |
|
707 |
end |
|
708 |
||
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
709 |
section {* ML setup *} |
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
710 |
|
919 | 711 |
text {* Auxiliary data for the quotient package *} |
869
ce5f78f0eac5
Finished organising an efficient datastructure for qconst_info.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
854
diff
changeset
|
712 |
|
597 | 713 |
use "quotient_info.ML" |
714 |
||
715 |
declare [[map "fun" = (fun_map, fun_rel)]] |
|
615
386a6b1a5203
the lift_tac produces a warning message if one of the three automatic proofs fails
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
716 |
|
909
3e7a6ec549d1
Using Bexeq_rsp, and manually lifted lemma with Ex1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
907
diff
changeset
|
717 |
lemmas [quot_thm] = fun_quotient |
911
95ee248b3832
Automatic injection of Bexeq
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
909
diff
changeset
|
718 |
lemmas [quot_respect] = quot_rel_rsp |
648
830b58c2fa94
decoupled QuotProd from QuotMain and also started new cleaning strategy
Christian Urban <urbanc@in.tum.de>
parents:
643
diff
changeset
|
719 |
lemmas [quot_equiv] = identity_equivp |
597 | 720 |
|
919 | 721 |
|
722 |
text {* Lemmas about simplifying id's. *} |
|
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
723 |
lemmas [id_simps] = |
925
8d51795ef54d
ids *cannot* be object equalities
Christian Urban <urbanc@in.tum.de>
parents:
920
diff
changeset
|
724 |
id_def[symmetric] |
930
68c1f378a70a
All eq_reflections apart from the one of 'id_apply' can be removed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
925
diff
changeset
|
725 |
fun_map_id |
939
ce774af6b964
Changed the lambda_prs_simple_conv to use id_apply, now last eq_reflection can be removed from id_simps.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
930
diff
changeset
|
726 |
id_apply |
930
68c1f378a70a
All eq_reflections apart from the one of 'id_apply' can be removed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
925
diff
changeset
|
727 |
id_o |
68c1f378a70a
All eq_reflections apart from the one of 'id_apply' can be removed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
925
diff
changeset
|
728 |
o_id |
825
970e86082cd7
Modifictaions for new_relation.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
789
diff
changeset
|
729 |
eq_comp_r |
774
b4ffb8826105
moved get_fun into quotient_term; this simplifies the overall including structure of the package
Christian Urban <urbanc@in.tum.de>
parents:
773
diff
changeset
|
730 |
|
919 | 731 |
text {* Translation functions for the lifting process. *} |
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
732 |
use "quotient_term.ML" |
774
b4ffb8826105
moved get_fun into quotient_term; this simplifies the overall including structure of the package
Christian Urban <urbanc@in.tum.de>
parents:
773
diff
changeset
|
733 |
|
b4ffb8826105
moved get_fun into quotient_term; this simplifies the overall including structure of the package
Christian Urban <urbanc@in.tum.de>
parents:
773
diff
changeset
|
734 |
|
919 | 735 |
text {* Definitions of the quotient types. *} |
725
0d98a4c7f8dc
renamed quotient.ML to quotient_typ.ML
Christian Urban <urbanc@in.tum.de>
parents:
720
diff
changeset
|
736 |
use "quotient_typ.ML" |
597 | 737 |
|
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
738 |
|
919 | 739 |
text {* Definitions for quotient constants. *} |
597 | 740 |
use "quotient_def.ML" |
741 |
||
759 | 742 |
|
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
743 |
text {* |
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
744 |
An auxiliary constant for recording some information |
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
745 |
about the lifted theorem in a tactic. |
919 | 746 |
*} |
758
3104d62e7a16
moved the QuotMain code into two ML-files
Christian Urban <urbanc@in.tum.de>
parents:
752
diff
changeset
|
747 |
definition |
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
748 |
"Quot_True x \<equiv> True" |
605
120e479ed367
first attempt to deal with Babs in regularise and cleaning (not yet working)
Christian Urban <urbanc@in.tum.de>
parents:
602
diff
changeset
|
749 |
|
1127
243a5ceaa088
Merging QuotBase into QuotMain.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1124
diff
changeset
|
750 |
lemma |
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
751 |
shows QT_all: "Quot_True (All P) \<Longrightarrow> Quot_True P" |
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
752 |
and QT_ex: "Quot_True (Ex P) \<Longrightarrow> Quot_True P" |
907 | 753 |
and QT_ex1: "Quot_True (Ex1 P) \<Longrightarrow> Quot_True P" |
1113
9f6c606d5b59
more minor space and bracket modifications.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1077
diff
changeset
|
754 |
and QT_lam: "Quot_True (\<lambda>x. P x) \<Longrightarrow> (\<And>x. Quot_True (P x))" |
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
755 |
and QT_ext: "(\<And>x. Quot_True (a x) \<Longrightarrow> f x = g x) \<Longrightarrow> (Quot_True a \<Longrightarrow> f = g)" |
1116
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
756 |
by (simp_all add: Quot_True_def ext) |
751 | 757 |
|
773
d6acae26d027
tuned comments; renamed QUOT_TRUE to Quot_True; atomize_eqv seems to not be neccessary (has it been added to Isabelle)...it is now comented out and everything still works
Christian Urban <urbanc@in.tum.de>
parents:
768
diff
changeset
|
758 |
lemma QT_imp: "Quot_True a \<equiv> Quot_True b" |
1116
3acc7d25627a
Some cleaning of proofs.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1113
diff
changeset
|
759 |
by (simp add: Quot_True_def) |
751 | 760 |
|
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
761 |
|
919 | 762 |
text {* Tactics for proving the lifted theorems *} |
758
3104d62e7a16
moved the QuotMain code into two ML-files
Christian Urban <urbanc@in.tum.de>
parents:
752
diff
changeset
|
763 |
use "quotient_tacs.ML" |
751 | 764 |
|
689 | 765 |
section {* Methods / Interface *} |
766 |
||
632
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
767 |
method_setup lifting = |
1143 | 768 |
{* Attrib.thms >> (fn thms => fn ctxt => SIMPLE_METHOD (HEADGOAL (Quotient_Tacs.lift_tac ctxt thms))) *} |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
769 |
{* lifts theorems to quotient types *} |
632
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
770 |
|
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
771 |
method_setup lifting_setup = |
1143 | 772 |
{* Attrib.thm >> (fn thms => fn ctxt => SIMPLE_METHOD (HEADGOAL (Quotient_Tacs.procedure_tac ctxt thms))) *} |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
773 |
{* sets up the three goals for the quotient lifting procedure *} |
632
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
774 |
|
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
775 |
method_setup regularize = |
1143 | 776 |
{* Scan.succeed (fn ctxt => SIMPLE_METHOD (HEADGOAL (Quotient_Tacs.regularize_tac ctxt))) *} |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
777 |
{* proves the regularization goals from the quotient lifting procedure *} |
632
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
778 |
|
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
779 |
method_setup injection = |
1143 | 780 |
{* Scan.succeed (fn ctxt => SIMPLE_METHOD (HEADGOAL (Quotient_Tacs.all_injection_tac ctxt))) *} |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
781 |
{* proves the rep/abs injection goals from the quotient lifting procedure *} |
632
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
782 |
|
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
783 |
method_setup cleaning = |
1143 | 784 |
{* Scan.succeed (fn ctxt => SIMPLE_METHOD (HEADGOAL (Quotient_Tacs.clean_tac ctxt))) *} |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
785 |
{* proves the cleaning goals from the quotient lifting procedure *} |
632
d23416464f62
added methods for the lifting_tac and the other tacs
Christian Urban <urbanc@in.tum.de>
parents:
624
diff
changeset
|
786 |
|
1068
62e54830590f
A proper version of the attribute
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
939
diff
changeset
|
787 |
attribute_setup quot_lifted = |
1077 | 788 |
{* Scan.succeed Quotient_Tacs.lifted_attrib *} |
1122
d1eaed018e5d
Changes from Makarius's code review + some noticed fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1116
diff
changeset
|
789 |
{* lifts theorems to quotient types *} |
1068
62e54830590f
A proper version of the attribute
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
939
diff
changeset
|
790 |
|
1129
9a86f0ef6503
Notation available locally
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
791 |
no_notation |
9a86f0ef6503
Notation available locally
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
792 |
rel_conj (infixr "OOO" 75) and |
9a86f0ef6503
Notation available locally
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
793 |
fun_map (infixr "--->" 55) and |
9a86f0ef6503
Notation available locally
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
794 |
fun_rel (infixr "===>" 55) |
9a86f0ef6503
Notation available locally
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
795 |
|
597 | 796 |
end |
797 |