src/HOL/Integ/Equiv.ML
changeset 1894 c2c8279d40f0
parent 1844 791e79473966
child 1978 e7df069acb74
     1.1 --- a/src/HOL/Integ/Equiv.ML	Mon Jul 29 18:31:39 1996 +0200
     1.2 +++ b/src/HOL/Integ/Equiv.ML	Tue Jul 30 17:33:26 1996 +0200
     1.3 @@ -10,18 +10,20 @@
     1.4  
     1.5  open Equiv;
     1.6  
     1.7 +Delrules [equalityI];
     1.8 +
     1.9  (*** Suppes, Theorem 70: r is an equiv relation iff converse(r) O r = r ***)
    1.10  
    1.11  (** first half: equiv A r ==> converse(r) O r = r **)
    1.12  
    1.13  goalw Equiv.thy [trans_def,sym_def,converse_def]
    1.14      "!!r. [| sym(r); trans(r) |] ==> converse(r) O r <= r";
    1.15 -by (fast_tac (comp_cs addSEs [converseD]) 1);
    1.16 +by (fast_tac (!claset addSEs [converseD]) 1);
    1.17  qed "sym_trans_comp_subset";
    1.18  
    1.19  goalw Equiv.thy [refl_def]
    1.20      "!!A r. refl A r ==> r <= converse(r) O r";
    1.21 -by (fast_tac (rel_cs addIs [compI]) 1);
    1.22 +by (fast_tac (!claset addIs [compI]) 1);
    1.23  qed "refl_comp_subset";
    1.24  
    1.25  goalw Equiv.thy [equiv_def]
    1.26 @@ -36,9 +38,9 @@
    1.27      "!!A r. [| converse(r) O r = r;  Domain(r) = A |] ==> equiv A r";
    1.28  by (etac equalityE 1);
    1.29  by (subgoal_tac "ALL x y. (x,y) : r --> (y,x) : r" 1);
    1.30 -by (safe_tac set_cs);
    1.31 -by (fast_tac (set_cs addSIs [converseI] addIs [compI]) 3);
    1.32 -by (ALLGOALS (fast_tac (rel_cs addIs [compI] addSEs [compE])));
    1.33 +by (safe_tac (!claset));
    1.34 +by (fast_tac (!claset addSIs [converseI] addIs [compI]) 3);
    1.35 +by (ALLGOALS (fast_tac (!claset addIs [compI] addSEs [compE])));
    1.36  qed "comp_equivI";
    1.37  
    1.38  (** Equivalence classes **)
    1.39 @@ -46,28 +48,28 @@
    1.40  (*Lemma for the next result*)
    1.41  goalw Equiv.thy [equiv_def,trans_def,sym_def]
    1.42      "!!A r. [| equiv A r;  (a,b): r |] ==> r^^{a} <= r^^{b}";
    1.43 -by (safe_tac rel_cs);
    1.44 +by (safe_tac (!claset));
    1.45  by (rtac ImageI 1);
    1.46 -by (fast_tac rel_cs 2);
    1.47 -by (fast_tac rel_cs 1);
    1.48 +by (Fast_tac 2);
    1.49 +by (Fast_tac 1);
    1.50  qed "equiv_class_subset";
    1.51  
    1.52  goal Equiv.thy "!!A r. [| equiv A r;  (a,b): r |] ==> r^^{a} = r^^{b}";
    1.53  by (REPEAT (ares_tac [equalityI, equiv_class_subset] 1));
    1.54  by (rewrite_goals_tac [equiv_def,sym_def]);
    1.55 -by (fast_tac rel_cs 1);
    1.56 +by (Fast_tac 1);
    1.57  qed "equiv_class_eq";
    1.58  
    1.59  val prems = goalw Equiv.thy [equiv_def,refl_def]
    1.60      "[| equiv A r;  a: A |] ==> a: r^^{a}";
    1.61  by (cut_facts_tac prems 1);
    1.62 -by (fast_tac rel_cs 1);
    1.63 +by (Fast_tac 1);
    1.64  qed "equiv_class_self";
    1.65  
    1.66  (*Lemma for the next result*)
    1.67  goalw Equiv.thy [equiv_def,refl_def]
    1.68      "!!A r. [| equiv A r;  r^^{b} <= r^^{a};  b: A |] ==> (a,b): r";
    1.69 -by (fast_tac rel_cs 1);
    1.70 +by (Fast_tac 1);
    1.71  qed "subset_equiv_class";
    1.72  
    1.73  val prems = goal Equiv.thy
    1.74 @@ -78,7 +80,7 @@
    1.75  (*thus r^^{a} = r^^{b} as well*)
    1.76  goalw Equiv.thy [equiv_def,trans_def,sym_def]
    1.77      "!!A r. [| equiv A r;  x: (r^^{a} Int r^^{b}) |] ==> (a,b): r";
    1.78 -by (fast_tac rel_cs 1);
    1.79 +by (Fast_tac 1);
    1.80  qed "equiv_class_nondisjoint";
    1.81  
    1.82  val [major] = goalw Equiv.thy [equiv_def,refl_def]
    1.83 @@ -88,7 +90,7 @@
    1.84  
    1.85  goal Equiv.thy
    1.86      "!!A r. equiv A r ==> ((x,y): r) = (r^^{x} = r^^{y} & x:A & y:A)";
    1.87 -by (safe_tac rel_cs);
    1.88 +by (safe_tac (!claset));
    1.89  by ((rtac equiv_class_eq 1) THEN (assume_tac 1) THEN (assume_tac 1));
    1.90  by ((rtac eq_equiv_class 3) THEN 
    1.91      (assume_tac 4) THEN (assume_tac 4) THEN (assume_tac 3));
    1.92 @@ -100,7 +102,7 @@
    1.93  
    1.94  goal Equiv.thy
    1.95      "!!A r. [| equiv A r;  x: A;  y: A |] ==> (r^^{x} = r^^{y}) = ((x,y): r)";
    1.96 -by (safe_tac rel_cs);
    1.97 +by (safe_tac (!claset));
    1.98  by ((rtac eq_equiv_class 1) THEN 
    1.99      (assume_tac 1) THEN (assume_tac 1) THEN (assume_tac 1));
   1.100  by ((rtac equiv_class_eq 1) THEN 
   1.101 @@ -123,7 +125,7 @@
   1.102  by (resolve_tac [major RS UN_E] 1);
   1.103  by (rtac minor 1);
   1.104  by (assume_tac 2);
   1.105 -by (fast_tac rel_cs 1);
   1.106 +by (Fast_tac 1);
   1.107  qed "quotientE";
   1.108  
   1.109  (** Not needed by Theory Integ --> bypassed **)
   1.110 @@ -136,10 +138,10 @@
   1.111  (** Not needed by Theory Integ --> bypassed **)
   1.112  (*goalw Equiv.thy [quotient_def]
   1.113      "!!A r. [| equiv A r;  X: A/r;  Y: A/r |] ==> X=Y | (X Int Y <= 0)";
   1.114 -by (safe_tac (ZF_cs addSIs [equiv_class_eq]));
   1.115 +by (safe_tac (!claset addSIs [equiv_class_eq]));
   1.116  by (assume_tac 1);
   1.117  by (rewrite_goals_tac [equiv_def,trans_def,sym_def]);
   1.118 -by (fast_tac ZF_cs 1);
   1.119 +by (Fast_tac 1);
   1.120  qed "quotient_disj";
   1.121  **)
   1.122  
   1.123 @@ -147,7 +149,7 @@
   1.124  
   1.125  (* theorem needed to prove UN_equiv_class *)
   1.126  goal Set.thy "!!A. [| a:A; ! y:A. b(y)=b(a) |] ==> (UN y:A. b(y))=b(a)";
   1.127 -by (fast_tac (!claset addSEs [equalityE]) 1);
   1.128 +by (fast_tac (!claset addSEs [equalityE] addSIs [equalityI]) 1);
   1.129  qed "UN_singleton_lemma";
   1.130  val UN_singleton = ballI RSN (2,UN_singleton_lemma);
   1.131  
   1.132 @@ -165,7 +167,7 @@
   1.133  by (assume_tac 1);
   1.134  by (assume_tac 1);
   1.135  by (rewrite_goals_tac [equiv_def,congruent_def,sym_def]);
   1.136 -by (fast_tac rel_cs 1);
   1.137 +by (Fast_tac 1);
   1.138  qed "UN_equiv_class";
   1.139  
   1.140  (*Resolve th against the "local" premises*)
   1.141 @@ -177,7 +179,7 @@
   1.142  \       !!x.  x : A ==> b(x) : B |]     \
   1.143  \    ==> (UN x:X. b(x)) : B";
   1.144  by (cut_facts_tac prems 1);
   1.145 -by (safe_tac rel_cs);
   1.146 +by (safe_tac (!claset));
   1.147  by (rtac (localize UN_equiv_class RS ssubst) 1);
   1.148  by (REPEAT (ares_tac prems 1));
   1.149  qed "UN_equiv_class_type";
   1.150 @@ -191,7 +193,7 @@
   1.151  \       !!x y. [| x:A; y:A; b(x)=b(y) |] ==> (x,y):r |]         \
   1.152  \    ==> X=Y";
   1.153  by (cut_facts_tac prems 1);
   1.154 -by (safe_tac rel_cs);
   1.155 +by (safe_tac ((!claset) delrules [equalityI]));
   1.156  by (rtac (equivA RS equiv_class_eq) 1);
   1.157  by (REPEAT (ares_tac prems 1));
   1.158  by (etac box_equals 1);
   1.159 @@ -204,20 +206,20 @@
   1.160  
   1.161  goalw Equiv.thy [congruent_def,congruent2_def,equiv_def,refl_def]
   1.162      "!!A r. [| equiv A r;  congruent2 r b;  a: A |] ==> congruent r (b a)";
   1.163 -by (fast_tac rel_cs 1);
   1.164 +by (Fast_tac 1);
   1.165  qed "congruent2_implies_congruent";
   1.166  
   1.167  val equivA::prems = goalw Equiv.thy [congruent_def]
   1.168      "[| equiv A r;  congruent2 r b;  a: A |] ==> \
   1.169  \    congruent r (%x1. UN x2:r^^{a}. b x1 x2)";
   1.170  by (cut_facts_tac (equivA::prems) 1);
   1.171 -by (safe_tac rel_cs);
   1.172 +by (safe_tac (!claset));
   1.173  by (rtac (equivA RS equiv_type RS subsetD RS SigmaE2) 1);
   1.174  by (assume_tac 1);
   1.175  by (asm_simp_tac (!simpset addsimps [equivA RS UN_equiv_class,
   1.176                                       congruent2_implies_congruent]) 1);
   1.177  by (rewrite_goals_tac [congruent2_def,equiv_def,refl_def]);
   1.178 -by (fast_tac rel_cs 1);
   1.179 +by (Fast_tac 1);
   1.180  qed "congruent2_implies_congruent_UN";
   1.181  
   1.182  val prems as equivA::_ = goal Equiv.thy
   1.183 @@ -236,7 +238,7 @@
   1.184  \       !!x1 x2.  [| x1: A; x2: A |] ==> b x1 x2 : B |]    \
   1.185  \    ==> (UN x1:X1. UN x2:X2. b x1 x2) : B";
   1.186  by (cut_facts_tac prems 1);
   1.187 -by (safe_tac rel_cs);
   1.188 +by (safe_tac (!claset));
   1.189  by (REPEAT (ares_tac (prems@[UN_equiv_class_type,
   1.190                               congruent2_implies_congruent_UN,
   1.191                               congruent2_implies_congruent, quotientI]) 1));
   1.192 @@ -251,7 +253,7 @@
   1.193  \       !! y z w. [| w: A;  (y,z) : r |] ==> b w y = b w z       \
   1.194  \    |] ==> congruent2 r b";
   1.195  by (cut_facts_tac prems 1);
   1.196 -by (safe_tac rel_cs);
   1.197 +by (safe_tac (!claset));
   1.198  by (rtac trans 1);
   1.199  by (REPEAT (ares_tac prems 1
   1.200       ORELSE etac (subsetD RS SigmaE2) 1 THEN assume_tac 2 THEN assume_tac 1));