140 by (assume_tac 2); |
140 by (assume_tac 2); |
141 by (rewrite_goals_tac [equiv_def,sym_def,congruent_def]); |
141 by (rewrite_goals_tac [equiv_def,sym_def,congruent_def]); |
142 by (fast_tac ZF_cs 1); |
142 by (fast_tac ZF_cs 1); |
143 qed "UN_equiv_class"; |
143 qed "UN_equiv_class"; |
144 |
144 |
145 (*Resolve th against the "local" premises*) |
|
146 val localize = RSLIST [equivA,bcong]; |
|
147 |
|
148 (*type checking of UN x:r``{a}. b(x) *) |
145 (*type checking of UN x:r``{a}. b(x) *) |
149 val _::_::prems = goalw EquivClass.thy [quotient_def] |
146 val prems = goalw EquivClass.thy [quotient_def] |
150 "[| equiv(A,r); congruent(r,b); X: A/r; \ |
147 "[| equiv(A,r); congruent(r,b); X: A/r; \ |
151 \ !!x. x : A ==> b(x) : B |] \ |
148 \ !!x. x : A ==> b(x) : B |] \ |
152 \ ==> (UN x:X. b(x)) : B"; |
149 \ ==> (UN x:X. b(x)) : B"; |
153 by (cut_facts_tac prems 1); |
150 by (cut_facts_tac prems 1); |
154 by (safe_tac ZF_cs); |
151 by (safe_tac ZF_cs); |
155 by (rtac (localize UN_equiv_class RS ssubst) 1); |
152 by (asm_simp_tac (ZF_ss addsimps (UN_equiv_class::prems)) 1); |
156 by (REPEAT (ares_tac prems 1)); |
|
157 qed "UN_equiv_class_type"; |
153 qed "UN_equiv_class_type"; |
158 |
154 |
159 (*Sufficient conditions for injectiveness. Could weaken premises! |
155 (*Sufficient conditions for injectiveness. Could weaken premises! |
160 major premise could be an inclusion; bcong could be !!y. y:A ==> b(y):B |
156 major premise could be an inclusion; bcong could be !!y. y:A ==> b(y):B |
161 *) |
157 *) |
162 val _::_::prems = goalw EquivClass.thy [quotient_def] |
158 val prems = goalw EquivClass.thy [quotient_def] |
163 "[| equiv(A,r); congruent(r,b); \ |
159 "[| equiv(A,r); congruent(r,b); \ |
164 \ (UN x:X. b(x))=(UN y:Y. b(y)); X: A/r; Y: A/r; \ |
160 \ (UN x:X. b(x))=(UN y:Y. b(y)); X: A/r; Y: A/r; \ |
165 \ !!x y. [| x:A; y:A; b(x)=b(y) |] ==> <x,y>:r |] \ |
161 \ !!x y. [| x:A; y:A; b(x)=b(y) |] ==> <x,y>:r |] \ |
166 \ ==> X=Y"; |
162 \ ==> X=Y"; |
167 by (cut_facts_tac prems 1); |
163 by (cut_facts_tac prems 1); |
168 by (safe_tac ZF_cs); |
164 by (safe_tac ZF_cs); |
169 by (rtac (equivA RS equiv_class_eq) 1); |
165 by (rtac equiv_class_eq 1); |
170 by (REPEAT (ares_tac prems 1)); |
166 by (REPEAT (ares_tac prems 1)); |
171 by (etac box_equals 1); |
167 by (etac box_equals 1); |
172 by (REPEAT (ares_tac [localize UN_equiv_class] 1)); |
168 by (REPEAT (ares_tac [UN_equiv_class] 1)); |
173 qed "UN_equiv_class_inject"; |
169 qed "UN_equiv_class_inject"; |
174 |
170 |
175 |
171 |
176 (**** Defining binary operations upon equivalence classes ****) |
172 (**** Defining binary operations upon equivalence classes ****) |
177 |
173 |