src/ZF/OrderArith.thy
changeset 13269 3ba9be497c33
parent 13140 6d97dbb189a9
child 13356 c9cfe1638bf2
     1.1 --- a/src/ZF/OrderArith.thy	Mon Jul 01 18:16:18 2002 +0200
     1.2 +++ b/src/ZF/OrderArith.thy	Tue Jul 02 13:28:08 2002 +0200
     1.3 @@ -38,26 +38,22 @@
     1.4  
     1.5  lemma radd_Inl_Inr_iff [iff]: 
     1.6      "<Inl(a), Inr(b)> : radd(A,r,B,s)  <->  a:A & b:B"
     1.7 -apply (unfold radd_def)
     1.8 -apply blast
     1.9 +apply (unfold radd_def, blast)
    1.10  done
    1.11  
    1.12  lemma radd_Inl_iff [iff]: 
    1.13      "<Inl(a'), Inl(a)> : radd(A,r,B,s)  <->  a':A & a:A & <a',a>:r"
    1.14 -apply (unfold radd_def)
    1.15 -apply blast
    1.16 +apply (unfold radd_def, blast)
    1.17  done
    1.18  
    1.19  lemma radd_Inr_iff [iff]: 
    1.20      "<Inr(b'), Inr(b)> : radd(A,r,B,s) <->  b':B & b:B & <b',b>:s"
    1.21 -apply (unfold radd_def)
    1.22 -apply blast
    1.23 +apply (unfold radd_def, blast)
    1.24  done
    1.25  
    1.26  lemma radd_Inr_Inl_iff [iff]: 
    1.27      "<Inr(b), Inl(a)> : radd(A,r,B,s) <->  False"
    1.28 -apply (unfold radd_def)
    1.29 -apply blast
    1.30 +apply (unfold radd_def, blast)
    1.31  done
    1.32  
    1.33  (** Elimination Rule **)
    1.34 @@ -68,8 +64,7 @@
    1.35          !!x' x. [| p'=Inl(x'); p=Inl(x); <x',x>: r; x':A; x:A |] ==> Q;  
    1.36          !!y' y. [| p'=Inr(y'); p=Inr(y); <y',y>: s; y':B; y:B |] ==> Q   
    1.37       |] ==> Q"
    1.38 -apply (unfold radd_def)
    1.39 -apply (blast intro: elim:); 
    1.40 +apply (unfold radd_def, blast) 
    1.41  done
    1.42  
    1.43  (** Type checking **)
    1.44 @@ -85,8 +80,7 @@
    1.45  
    1.46  lemma linear_radd: 
    1.47      "[| linear(A,r);  linear(B,s) |] ==> linear(A+B,radd(A,r,B,s))"
    1.48 -apply (unfold linear_def)
    1.49 -apply (blast intro: elim:); 
    1.50 +apply (unfold linear_def, blast) 
    1.51  done
    1.52  
    1.53  
    1.54 @@ -100,12 +94,11 @@
    1.55   apply (erule_tac V = "y : A + B" in thin_rl)
    1.56   apply (rule_tac ballI)
    1.57   apply (erule_tac r = "r" and a = "x" in wf_on_induct, assumption)
    1.58 - apply (blast intro: elim:); 
    1.59 + apply blast 
    1.60  (*Returning to main part of proof*)
    1.61  apply safe
    1.62  apply blast
    1.63 -apply (erule_tac r = "s" and a = "ya" in wf_on_induct , assumption)
    1.64 -apply (blast intro: elim:); 
    1.65 +apply (erule_tac r = "s" and a = "ya" in wf_on_induct, assumption, blast) 
    1.66  done
    1.67  
    1.68  lemma wf_radd: "[| wf(r);  wf(s) |] ==> wf(radd(field(r),r,field(s),s))"
    1.69 @@ -126,7 +119,7 @@
    1.70  lemma sum_bij:
    1.71       "[| f: bij(A,C);  g: bij(B,D) |]
    1.72        ==> (lam z:A+B. case(%x. Inl(f`x), %y. Inr(g`y), z)) : bij(A+B, C+D)"
    1.73 -apply (rule_tac d = "case (%x. Inl (converse (f) `x) , %y. Inr (converse (g) `y))" in lam_bijective)
    1.74 +apply (rule_tac d = "case (%x. Inl (converse (f) `x), %y. Inr (converse (g) `y))" in lam_bijective)
    1.75  apply (typecheck add: bij_is_inj inj_is_fun) 
    1.76  apply (auto simp add: left_inverse_bij right_inverse_bij) 
    1.77  done
    1.78 @@ -163,8 +156,7 @@
    1.79       "(lam z:(A+B)+C. case(case(Inl, %y. Inr(Inl(y))), %y. Inr(Inr(y)), z))  
    1.80        : ord_iso((A+B)+C, radd(A+B, radd(A,r,B,s), C, t),     
    1.81                  A+(B+C), radd(A, r, B+C, radd(B,s,C,t)))"
    1.82 -apply (rule sum_assoc_bij [THEN ord_isoI])
    1.83 -apply auto
    1.84 +apply (rule sum_assoc_bij [THEN ord_isoI], auto)
    1.85  done
    1.86  
    1.87  
    1.88 @@ -177,8 +169,7 @@
    1.89              (<a',a>: r  & a':A & a:A & b': B & b: B) |   
    1.90              (<b',b>: s  & a'=a & a:A & b': B & b: B)"
    1.91  
    1.92 -apply (unfold rmult_def)
    1.93 -apply blast
    1.94 +apply (unfold rmult_def, blast)
    1.95  done
    1.96  
    1.97  lemma rmultE: 
    1.98 @@ -186,7 +177,7 @@
    1.99          [| <a',a>: r;  a':A;  a:A;  b':B;  b:B |] ==> Q;         
   1.100          [| <b',b>: s;  a:A;  a'=a;  b':B;  b:B |] ==> Q  
   1.101       |] ==> Q"
   1.102 -apply (blast intro: elim:); 
   1.103 +apply blast 
   1.104  done
   1.105  
   1.106  (** Type checking **)
   1.107 @@ -202,8 +193,7 @@
   1.108  
   1.109  lemma linear_rmult:
   1.110      "[| linear(A,r);  linear(B,s) |] ==> linear(A*B,rmult(A,r,B,s))"
   1.111 -apply (simp add: linear_def); 
   1.112 -apply (blast intro: elim:); 
   1.113 +apply (simp add: linear_def, blast) 
   1.114  done
   1.115  
   1.116  (** Well-foundedness **)
   1.117 @@ -212,11 +202,10 @@
   1.118  apply (rule wf_onI2)
   1.119  apply (erule SigmaE)
   1.120  apply (erule ssubst)
   1.121 -apply (subgoal_tac "ALL b:B. <x,b>: Ba")
   1.122 -apply blast
   1.123 -apply (erule_tac a = "x" in wf_on_induct , assumption)
   1.124 +apply (subgoal_tac "ALL b:B. <x,b>: Ba", blast)
   1.125 +apply (erule_tac a = "x" in wf_on_induct, assumption)
   1.126  apply (rule ballI)
   1.127 -apply (erule_tac a = "b" in wf_on_induct , assumption)
   1.128 +apply (erule_tac a = "b" in wf_on_induct, assumption)
   1.129  apply (best elim!: rmultE bspec [THEN mp])
   1.130  done
   1.131  
   1.132 @@ -257,9 +246,7 @@
   1.133  done
   1.134  
   1.135  lemma singleton_prod_bij: "(lam z:A. <x,z>) : bij(A, {x}*A)"
   1.136 -apply (rule_tac d = "snd" in lam_bijective)
   1.137 -apply auto
   1.138 -done
   1.139 +by (rule_tac d = "snd" in lam_bijective, auto)
   1.140  
   1.141  (*Used??*)
   1.142  lemma singleton_prod_ord_iso:
   1.143 @@ -279,8 +266,7 @@
   1.144  apply (rule subst_elem)
   1.145  apply (rule id_bij [THEN sum_bij, THEN comp_bij])
   1.146  apply (rule singleton_prod_bij)
   1.147 -apply (rule sum_disjoint_bij)
   1.148 -apply blast
   1.149 +apply (rule sum_disjoint_bij, blast)
   1.150  apply (simp (no_asm_simp) cong add: case_cong)
   1.151  apply (rule comp_lam [THEN trans, symmetric])
   1.152  apply (fast elim!: case_type)
   1.153 @@ -303,7 +289,7 @@
   1.154  lemma sum_prod_distrib_bij:
   1.155       "(lam <x,z>:(A+B)*C. case(%y. Inl(<y,z>), %y. Inr(<y,z>), x))  
   1.156        : bij((A+B)*C, (A*C)+(B*C))"
   1.157 -apply (rule_tac d = "case (%<x,y>.<Inl (x) ,y>, %<x,y>.<Inr (x) ,y>) " 
   1.158 +apply (rule_tac d = "case (%<x,y>.<Inl (x),y>, %<x,y>.<Inr (x),y>) " 
   1.159         in lam_bijective)
   1.160  apply auto
   1.161  done
   1.162 @@ -312,24 +298,21 @@
   1.163   "(lam <x,z>:(A+B)*C. case(%y. Inl(<y,z>), %y. Inr(<y,z>), x))  
   1.164    : ord_iso((A+B)*C, rmult(A+B, radd(A,r,B,s), C, t),  
   1.165              (A*C)+(B*C), radd(A*C, rmult(A,r,C,t), B*C, rmult(B,s,C,t)))"
   1.166 -apply (rule sum_prod_distrib_bij [THEN ord_isoI])
   1.167 -apply auto
   1.168 +apply (rule sum_prod_distrib_bij [THEN ord_isoI], auto)
   1.169  done
   1.170  
   1.171  (** Associativity **)
   1.172  
   1.173  lemma prod_assoc_bij:
   1.174       "(lam <<x,y>, z>:(A*B)*C. <x,<y,z>>) : bij((A*B)*C, A*(B*C))"
   1.175 -apply (rule_tac d = "%<x, <y,z>>. <<x,y>, z>" in lam_bijective)
   1.176 -apply auto
   1.177 +apply (rule_tac d = "%<x, <y,z>>. <<x,y>, z>" in lam_bijective, auto)
   1.178  done
   1.179  
   1.180  lemma prod_assoc_ord_iso:
   1.181   "(lam <<x,y>, z>:(A*B)*C. <x,<y,z>>)                    
   1.182    : ord_iso((A*B)*C, rmult(A*B, rmult(A,r,B,s), C, t),   
   1.183              A*(B*C), rmult(A, r, B*C, rmult(B,s,C,t)))"
   1.184 -apply (rule prod_assoc_bij [THEN ord_isoI])
   1.185 -apply auto
   1.186 +apply (rule prod_assoc_bij [THEN ord_isoI], auto)
   1.187  done
   1.188  
   1.189  (**** Inverse image of a relation ****)
   1.190 @@ -337,9 +320,7 @@
   1.191  (** Rewrite rule **)
   1.192  
   1.193  lemma rvimage_iff: "<a,b> : rvimage(A,f,r)  <->  <f`a,f`b>: r & a:A & b:A"
   1.194 -apply (unfold rvimage_def)
   1.195 -apply blast
   1.196 -done
   1.197 +by (unfold rvimage_def, blast)
   1.198  
   1.199  (** Type checking **)
   1.200  
   1.201 @@ -351,9 +332,7 @@
   1.202  lemmas field_rvimage = rvimage_type [THEN field_rel_subset]
   1.203  
   1.204  lemma rvimage_converse: "rvimage(A,f, converse(r)) = converse(rvimage(A,f,r))"
   1.205 -apply (unfold rvimage_def)
   1.206 -apply blast
   1.207 -done
   1.208 +by (unfold rvimage_def, blast)
   1.209  
   1.210  
   1.211  (** Partial Ordering Properties **)
   1.212 @@ -381,7 +360,7 @@
   1.213  lemma linear_rvimage:
   1.214      "[| f: inj(A,B);  linear(B,r) |] ==> linear(A,rvimage(A,f,r))"
   1.215  apply (simp add: inj_def linear_def rvimage_iff) 
   1.216 -apply (blast intro: apply_funtype); 
   1.217 +apply (blast intro: apply_funtype) 
   1.218  done
   1.219  
   1.220  lemma tot_ord_rvimage: 
   1.221 @@ -400,9 +379,9 @@
   1.222  apply (subgoal_tac "EX w. w : {w: {f`x. x:Q}. EX x. x: Q & (f`x = w) }")
   1.223   apply (erule allE)
   1.224   apply (erule impE)
   1.225 - apply assumption; 
   1.226 + apply assumption
   1.227   apply blast
   1.228 -apply (blast intro: elim:); 
   1.229 +apply blast 
   1.230  done
   1.231  
   1.232  lemma wf_on_rvimage: "[| f: A->B;  wf[B](r) |] ==> wf[A](rvimage(A,f,r))"
   1.233 @@ -431,8 +410,7 @@
   1.234  
   1.235  lemma ord_iso_rvimage_eq: 
   1.236      "f: ord_iso(A,r, B,s) ==> rvimage(A,f,s) = r Int A*A"
   1.237 -apply (unfold ord_iso_def rvimage_def)
   1.238 -apply blast
   1.239 +apply (unfold ord_iso_def rvimage_def, blast)
   1.240  done
   1.241  
   1.242  
   1.243 @@ -441,8 +419,7 @@
   1.244  lemma measure_eq_rvimage_Memrel:
   1.245       "measure(A,f) = rvimage(A,Lambda(A,f),Memrel(Collect(RepFun(A,f),Ord)))"
   1.246  apply (simp (no_asm) add: measure_def rvimage_def Memrel_iff)
   1.247 -apply (rule equalityI)
   1.248 -apply auto
   1.249 +apply (rule equalityI, auto)
   1.250  apply (auto intro: Ord_in_Ord simp add: lt_def)
   1.251  done
   1.252