src/ZF/ex/Equiv.ML
changeset 7 268f93ab3bc4
parent 0 a5a9c433f639
child 434 89d45187f04d
equal deleted inserted replaced
6:8ce8c4d13d4d 7:268f93ab3bc4
   188 \    congruent(r, %x1. UN x2:r``{a}. b(x1,x2))";
   188 \    congruent(r, %x1. UN x2:r``{a}. b(x1,x2))";
   189 by (cut_facts_tac (equivA::prems) 1);
   189 by (cut_facts_tac (equivA::prems) 1);
   190 by (safe_tac ZF_cs);
   190 by (safe_tac ZF_cs);
   191 by (rtac (equivA RS equiv_type RS subsetD RS SigmaE2) 1);
   191 by (rtac (equivA RS equiv_type RS subsetD RS SigmaE2) 1);
   192 by (assume_tac 1);
   192 by (assume_tac 1);
   193 by (ASM_SIMP_TAC (ZF_ss addrews [equivA RS UN_equiv_class,
   193 by (asm_simp_tac (ZF_ss addsimps [equivA RS UN_equiv_class,
   194 				 congruent2_implies_congruent]) 1);
   194 				 congruent2_implies_congruent]) 1);
   195 by (rewrite_goals_tac [congruent2_def,equiv_def,refl_def]);
   195 by (rewrite_goals_tac [congruent2_def,equiv_def,refl_def]);
   196 by (fast_tac ZF_cs 1);
   196 by (fast_tac ZF_cs 1);
   197 val congruent2_implies_congruent_UN = result();
   197 val congruent2_implies_congruent_UN = result();
   198 
   198 
   199 val prems as equivA::_ = goal Equiv.thy
   199 val prems as equivA::_ = goal Equiv.thy
   200     "[| equiv(A,r);  congruent2(r,b);  a1: A;  a2: A |]  \
   200     "[| equiv(A,r);  congruent2(r,b);  a1: A;  a2: A |]  \
   201 \    ==> (UN x1:r``{a1}. UN x2:r``{a2}. b(x1,x2)) = b(a1,a2)";
   201 \    ==> (UN x1:r``{a1}. UN x2:r``{a2}. b(x1,x2)) = b(a1,a2)";
   202 by (cut_facts_tac prems 1);
   202 by (cut_facts_tac prems 1);
   203 by (ASM_SIMP_TAC (ZF_ss addrews [equivA RS UN_equiv_class,
   203 by (asm_simp_tac (ZF_ss addsimps [equivA RS UN_equiv_class,
   204 				 congruent2_implies_congruent,
   204 				 congruent2_implies_congruent,
   205 				 congruent2_implies_congruent_UN]) 1);
   205 				 congruent2_implies_congruent_UN]) 1);
   206 val UN_equiv_class2 = result();
   206 val UN_equiv_class2 = result();
   207 
   207 
   208 (*type checking*)
   208 (*type checking*)
   233      ORELSE etac (subsetD RS SigmaE2) 1 THEN assume_tac 2 THEN assume_tac 1));
   233      ORELSE etac (subsetD RS SigmaE2) 1 THEN assume_tac 2 THEN assume_tac 1));
   234 val congruent2I = result();
   234 val congruent2I = result();
   235 
   235 
   236 val [equivA,commute,congt] = goal Equiv.thy
   236 val [equivA,commute,congt] = goal Equiv.thy
   237     "[| equiv(A,r);	\
   237     "[| equiv(A,r);	\
   238 \       !! y z w. [| y: A;  z: A |] ==> b(y,z) = b(z,y);        \
   238 \       !! y z. [| y: A;  z: A |] ==> b(y,z) = b(z,y);        \
   239 \       !! y z w. [| w: A;  <y,z>: r |] ==> b(w,y) = b(w,z)	\
   239 \       !! y z w. [| w: A;  <y,z>: r |] ==> b(w,y) = b(w,z)	\
   240 \    |] ==> congruent2(r,b)";
   240 \    |] ==> congruent2(r,b)";
   241 by (resolve_tac [equivA RS congruent2I] 1);
   241 by (resolve_tac [equivA RS congruent2I] 1);
   242 by (rtac (commute RS trans) 1);
   242 by (rtac (commute RS trans) 1);
   243 by (rtac (commute RS trans RS sym) 3);
   243 by (rtac (commute RS trans RS sym) 3);
   257 by (cut_facts_tac [ZinA,congt] 1);
   257 by (cut_facts_tac [ZinA,congt] 1);
   258 by (rewtac congruent_def);
   258 by (rewtac congruent_def);
   259 by (safe_tac ZF_cs);
   259 by (safe_tac ZF_cs);
   260 by (rtac (equivA RS equiv_type RS subsetD RS SigmaE2) 1);
   260 by (rtac (equivA RS equiv_type RS subsetD RS SigmaE2) 1);
   261 by (assume_tac 1);
   261 by (assume_tac 1);
   262 by (ASM_SIMP_TAC (ZF_ss addrews [congt RS (equivA RS UN_equiv_class)]) 1);
   262 by (asm_simp_tac (ZF_ss addsimps [congt RS (equivA RS UN_equiv_class)]) 1);
   263 by (rtac (commute RS trans) 1);
   263 by (rtac (commute RS trans) 1);
   264 by (rtac (commute RS trans RS sym) 3);
   264 by (rtac (commute RS trans RS sym) 3);
   265 by (rtac sym 5);
   265 by (rtac sym 5);
   266 by (REPEAT (ares_tac [congt' RS spec RS spec RS mp] 1));
   266 by (REPEAT (ares_tac [congt' RS spec RS spec RS mp] 1));
   267 val congruent_commuteI = result();
   267 val congruent_commuteI = result();