author | paulson |
Fri, 03 Jan 1997 15:01:55 +0100 | |
changeset 2469 | b50b8c0eec01 |
parent 1461 | 6bcb44e4d6e5 |
child 2493 | bdeb5024353a |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/EquivClass.ML |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
2 |
ID: $Id$ |
1461 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
4 |
Copyright 1994 University of Cambridge |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
5 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
6 |
For EquivClass.thy. Equivalence relations in Zermelo-Fraenkel Set Theory |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
7 |
*) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
8 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
9 |
val RSLIST = curry (op MRS); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
10 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
11 |
open EquivClass; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
12 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
13 |
(*** Suppes, Theorem 70: r is an equiv relation iff converse(r) O r = r ***) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
14 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
15 |
(** first half: equiv(A,r) ==> converse(r) O r = r **) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
16 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
17 |
goalw EquivClass.thy [trans_def,sym_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
18 |
"!!r. [| sym(r); trans(r) |] ==> converse(r) O r <= r"; |
2469 | 19 |
by (fast_tac (!claset) 1); |
760 | 20 |
qed "sym_trans_comp_subset"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
21 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
22 |
goalw EquivClass.thy [refl_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
23 |
"!!A r. [| refl(A,r); r <= A*A |] ==> r <= converse(r) O r"; |
2469 | 24 |
by (fast_tac (!claset) 1); |
760 | 25 |
qed "refl_comp_subset"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
26 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
27 |
goalw EquivClass.thy [equiv_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
28 |
"!!A r. equiv(A,r) ==> converse(r) O r = r"; |
749 | 29 |
by (fast_tac (subset_cs addSIs [equalityI, sym_trans_comp_subset, |
1461 | 30 |
refl_comp_subset]) 1); |
760 | 31 |
qed "equiv_comp_eq"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
32 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
33 |
(*second half*) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
34 |
goalw EquivClass.thy [equiv_def,refl_def,sym_def,trans_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
35 |
"!!A r. [| converse(r) O r = r; domain(r) = A |] ==> equiv(A,r)"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
36 |
by (etac equalityE 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
37 |
by (subgoal_tac "ALL x y. <x,y> : r --> <y,x> : r" 1); |
2469 | 38 |
by (ALLGOALS (fast_tac (!claset))); |
760 | 39 |
qed "comp_equivI"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
40 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
41 |
(** Equivalence classes **) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
42 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
43 |
(*Lemma for the next result*) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
44 |
goalw EquivClass.thy [trans_def,sym_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
45 |
"!!A r. [| sym(r); trans(r); <a,b>: r |] ==> r``{a} <= r``{b}"; |
2469 | 46 |
by (Fast_tac 1); |
760 | 47 |
qed "equiv_class_subset"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
48 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
49 |
goalw EquivClass.thy [equiv_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
50 |
"!!A r. [| equiv(A,r); <a,b>: r |] ==> r``{a} = r``{b}"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
51 |
by (safe_tac (subset_cs addSIs [equalityI, equiv_class_subset])); |
1461 | 52 |
by (rewtac sym_def); |
2469 | 53 |
by (Fast_tac 1); |
760 | 54 |
qed "equiv_class_eq"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
55 |
|
749 | 56 |
goalw EquivClass.thy [equiv_def,refl_def] |
57 |
"!!A r. [| equiv(A,r); a: A |] ==> a: r``{a}"; |
|
2469 | 58 |
by (Fast_tac 1); |
760 | 59 |
qed "equiv_class_self"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
60 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
61 |
(*Lemma for the next result*) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
62 |
goalw EquivClass.thy [equiv_def,refl_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
63 |
"!!A r. [| equiv(A,r); r``{b} <= r``{a}; b: A |] ==> <a,b>: r"; |
2469 | 64 |
by (Fast_tac 1); |
760 | 65 |
qed "subset_equiv_class"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
66 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
67 |
val prems = goal EquivClass.thy |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
68 |
"[| r``{a} = r``{b}; equiv(A,r); b: A |] ==> <a,b>: r"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
69 |
by (REPEAT (resolve_tac (prems @ [equalityD2, subset_equiv_class]) 1)); |
760 | 70 |
qed "eq_equiv_class"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
71 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
72 |
(*thus r``{a} = r``{b} as well*) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
73 |
goalw EquivClass.thy [equiv_def,trans_def,sym_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
74 |
"!!A r. [| equiv(A,r); x: (r``{a} Int r``{b}) |] ==> <a,b>: r"; |
2469 | 75 |
by (Fast_tac 1); |
760 | 76 |
qed "equiv_class_nondisjoint"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
77 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
78 |
goalw EquivClass.thy [equiv_def] "!!A r. equiv(A,r) ==> r <= A*A"; |
1076
68f088887f48
Modified proofs for new claset primitives. The problem is that they enforce
lcp
parents:
1013
diff
changeset
|
79 |
by (safe_tac subset_cs); |
760 | 80 |
qed "equiv_type"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
81 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
82 |
goal EquivClass.thy |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
83 |
"!!A r. equiv(A,r) ==> <x,y>: r <-> r``{x} = r``{y} & x:A & y:A"; |
2469 | 84 |
by (fast_tac (!claset addIs [eq_equiv_class, equiv_class_eq] |
85 |
addDs [equiv_type]) 1); |
|
760 | 86 |
qed "equiv_class_eq_iff"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
87 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
88 |
goal EquivClass.thy |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
89 |
"!!A r. [| equiv(A,r); x: A; y: A |] ==> r``{x} = r``{y} <-> <x,y>: r"; |
2469 | 90 |
by (fast_tac (!claset addIs [eq_equiv_class, equiv_class_eq] |
91 |
addDs [equiv_type]) 1); |
|
760 | 92 |
qed "eq_equiv_class_iff"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
93 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
94 |
(*** Quotients ***) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
95 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
96 |
(** Introduction/elimination rules -- needed? **) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
97 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
98 |
val prems = goalw EquivClass.thy [quotient_def] "x:A ==> r``{x}: A/r"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
99 |
by (rtac RepFunI 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
100 |
by (resolve_tac prems 1); |
760 | 101 |
qed "quotientI"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
102 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
103 |
val major::prems = goalw EquivClass.thy [quotient_def] |
1461 | 104 |
"[| X: A/r; !!x. [| X = r``{x}; x:A |] ==> P |] \ |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
105 |
\ ==> P"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
106 |
by (rtac (major RS RepFunE) 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
107 |
by (eresolve_tac prems 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
108 |
by (assume_tac 1); |
760 | 109 |
qed "quotientE"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
110 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
111 |
goalw EquivClass.thy [equiv_def,refl_def,quotient_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
112 |
"!!A r. equiv(A,r) ==> Union(A/r) = A"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
113 |
by (fast_tac eq_cs 1); |
760 | 114 |
qed "Union_quotient"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
115 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
116 |
goalw EquivClass.thy [quotient_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
117 |
"!!A r. [| equiv(A,r); X: A/r; Y: A/r |] ==> X=Y | (X Int Y <= 0)"; |
2469 | 118 |
by (safe_tac (!claset addSIs [equiv_class_eq])); |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
119 |
by (assume_tac 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
120 |
by (rewrite_goals_tac [equiv_def,trans_def,sym_def]); |
2469 | 121 |
by (Fast_tac 1); |
760 | 122 |
qed "quotient_disj"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
123 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
124 |
(**** Defining unary operations upon equivalence classes ****) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
125 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
126 |
(** These proofs really require as local premises |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
127 |
equiv(A,r); congruent(r,b) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
128 |
**) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
129 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
130 |
(*Conversion rule*) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
131 |
val prems as [equivA,bcong,_] = goal EquivClass.thy |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
132 |
"[| equiv(A,r); congruent(r,b); a: A |] ==> (UN x:r``{a}. b(x)) = b(a)"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
133 |
by (cut_facts_tac prems 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
134 |
by (rtac ([refl RS UN_cong, UN_constant] MRS trans) 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
135 |
by (etac equiv_class_self 2); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
136 |
by (assume_tac 2); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
137 |
by (rewrite_goals_tac [equiv_def,sym_def,congruent_def]); |
2469 | 138 |
by (Fast_tac 1); |
760 | 139 |
qed "UN_equiv_class"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
140 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
141 |
(*type checking of UN x:r``{a}. b(x) *) |
946 | 142 |
val prems = goalw EquivClass.thy [quotient_def] |
1461 | 143 |
"[| equiv(A,r); congruent(r,b); X: A/r; \ |
144 |
\ !!x. x : A ==> b(x) : B |] \ |
|
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
145 |
\ ==> (UN x:X. b(x)) : B"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
146 |
by (cut_facts_tac prems 1); |
2469 | 147 |
by (safe_tac (!claset)); |
148 |
by (asm_simp_tac (!simpset addsimps (UN_equiv_class::prems)) 1); |
|
760 | 149 |
qed "UN_equiv_class_type"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
150 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
151 |
(*Sufficient conditions for injectiveness. Could weaken premises! |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
152 |
major premise could be an inclusion; bcong could be !!y. y:A ==> b(y):B |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
153 |
*) |
946 | 154 |
val prems = goalw EquivClass.thy [quotient_def] |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
155 |
"[| equiv(A,r); congruent(r,b); \ |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
156 |
\ (UN x:X. b(x))=(UN y:Y. b(y)); X: A/r; Y: A/r; \ |
1461 | 157 |
\ !!x y. [| x:A; y:A; b(x)=b(y) |] ==> <x,y>:r |] \ |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
158 |
\ ==> X=Y"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
159 |
by (cut_facts_tac prems 1); |
2469 | 160 |
by (safe_tac (!claset)); |
946 | 161 |
by (rtac equiv_class_eq 1); |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
162 |
by (REPEAT (ares_tac prems 1)); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
163 |
by (etac box_equals 1); |
946 | 164 |
by (REPEAT (ares_tac [UN_equiv_class] 1)); |
760 | 165 |
qed "UN_equiv_class_inject"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
166 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
167 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
168 |
(**** Defining binary operations upon equivalence classes ****) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
169 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
170 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
171 |
goalw EquivClass.thy [congruent_def,congruent2_def,equiv_def,refl_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
172 |
"!!A r. [| equiv(A,r); congruent2(r,b); a: A |] ==> congruent(r,b(a))"; |
2469 | 173 |
by (Fast_tac 1); |
760 | 174 |
qed "congruent2_implies_congruent"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
175 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
176 |
val equivA::prems = goalw EquivClass.thy [congruent_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
177 |
"[| equiv(A,r); congruent2(r,b); a: A |] ==> \ |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
178 |
\ congruent(r, %x1. UN x2:r``{a}. b(x1,x2))"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
179 |
by (cut_facts_tac (equivA::prems) 1); |
2469 | 180 |
by (safe_tac (!claset)); |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
181 |
by (rtac (equivA RS equiv_type RS subsetD RS SigmaE2) 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
182 |
by (assume_tac 1); |
2469 | 183 |
by (asm_simp_tac (!simpset addsimps [equivA RS UN_equiv_class, |
184 |
congruent2_implies_congruent]) 1); |
|
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
185 |
by (rewrite_goals_tac [congruent2_def,equiv_def,refl_def]); |
2469 | 186 |
by (Fast_tac 1); |
760 | 187 |
qed "congruent2_implies_congruent_UN"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
188 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
189 |
val prems as equivA::_ = goal EquivClass.thy |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
190 |
"[| equiv(A,r); congruent2(r,b); a1: A; a2: A |] \ |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
191 |
\ ==> (UN x1:r``{a1}. UN x2:r``{a2}. b(x1,x2)) = b(a1,a2)"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
192 |
by (cut_facts_tac prems 1); |
2469 | 193 |
by (asm_simp_tac (!simpset addsimps [equivA RS UN_equiv_class, |
194 |
congruent2_implies_congruent, |
|
195 |
congruent2_implies_congruent_UN]) 1); |
|
760 | 196 |
qed "UN_equiv_class2"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
197 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
198 |
(*type checking*) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
199 |
val prems = goalw EquivClass.thy [quotient_def] |
1461 | 200 |
"[| equiv(A,r); congruent2(r,b); \ |
201 |
\ X1: A/r; X2: A/r; \ |
|
202 |
\ !!x1 x2. [| x1: A; x2: A |] ==> b(x1,x2) : B \ |
|
749 | 203 |
\ |] ==> (UN x1:X1. UN x2:X2. b(x1,x2)) : B"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
204 |
by (cut_facts_tac prems 1); |
2469 | 205 |
by (safe_tac (!claset)); |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
206 |
by (REPEAT (ares_tac (prems@[UN_equiv_class_type, |
1461 | 207 |
congruent2_implies_congruent_UN, |
208 |
congruent2_implies_congruent, quotientI]) 1)); |
|
760 | 209 |
qed "UN_equiv_class_type2"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
210 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
211 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
212 |
(*Suggested by John Harrison -- the two subproofs may be MUCH simpler |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
213 |
than the direct proof*) |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
214 |
val prems = goalw EquivClass.thy [congruent2_def,equiv_def,refl_def] |
1461 | 215 |
"[| equiv(A,r); \ |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
216 |
\ !! y z w. [| w: A; <y,z> : r |] ==> b(y,w) = b(z,w); \ |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
217 |
\ !! y z w. [| w: A; <y,z> : r |] ==> b(w,y) = b(w,z) \ |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
218 |
\ |] ==> congruent2(r,b)"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
219 |
by (cut_facts_tac prems 1); |
2469 | 220 |
by (safe_tac (!claset)); |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
221 |
by (rtac trans 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
222 |
by (REPEAT (ares_tac prems 1 |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
223 |
ORELSE etac (subsetD RS SigmaE2) 1 THEN assume_tac 2 THEN assume_tac 1)); |
760 | 224 |
qed "congruent2I"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
225 |
|
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
226 |
val [equivA,commute,congt] = goal EquivClass.thy |
1461 | 227 |
"[| equiv(A,r); \ |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
228 |
\ !! y z. [| y: A; z: A |] ==> b(y,z) = b(z,y); \ |
1461 | 229 |
\ !! y z w. [| w: A; <y,z>: r |] ==> b(w,y) = b(w,z) \ |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
230 |
\ |] ==> congruent2(r,b)"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
231 |
by (resolve_tac [equivA RS congruent2I] 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
232 |
by (rtac (commute RS trans) 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
233 |
by (rtac (commute RS trans RS sym) 3); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
234 |
by (rtac sym 5); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
235 |
by (REPEAT (ares_tac [congt] 1 |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
236 |
ORELSE etac (equivA RS equiv_type RS subsetD RS SigmaE2) 1)); |
760 | 237 |
qed "congruent2_commuteI"; |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
238 |
|
723
82caba9e130f
ZF/EquivClass/congruent_commuteI: uncommented and simplified proof
lcp
parents:
535
diff
changeset
|
239 |
(*Obsolete?*) |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
240 |
val [equivA,ZinA,congt,commute] = goalw EquivClass.thy [quotient_def] |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
241 |
"[| equiv(A,r); Z: A/r; \ |
1461 | 242 |
\ !!w. [| w: A |] ==> congruent(r, %z.b(w,z)); \ |
243 |
\ !!x y. [| x: A; y: A |] ==> b(y,x) = b(x,y) \ |
|
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
244 |
\ |] ==> congruent(r, %w. UN z: Z. b(w,z))"; |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
245 |
val congt' = rewrite_rule [congruent_def] congt; |
723
82caba9e130f
ZF/EquivClass/congruent_commuteI: uncommented and simplified proof
lcp
parents:
535
diff
changeset
|
246 |
by (cut_facts_tac [ZinA] 1); |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
247 |
by (rewtac congruent_def); |
2469 | 248 |
by (safe_tac (!claset)); |
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
249 |
by (rtac (equivA RS equiv_type RS subsetD RS SigmaE2) 1); |
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
250 |
by (assume_tac 1); |
2469 | 251 |
by (asm_simp_tac (!simpset addsimps [commute, |
252 |
[equivA, congt] MRS UN_equiv_class]) 1); |
|
535
9d62c7e08699
ZF/ex/Equiv.thy,.ML: moved to main directory as EquivClass.thy,.ML
lcp
parents:
diff
changeset
|
253 |
by (REPEAT (ares_tac [congt' RS spec RS spec RS mp] 1)); |
760 | 254 |
qed "congruent_commuteI"; |