dropped group_simps, ring_simps, field_eq_simps; classes division_ring_inverse_zero, field_inverse_zero, linordered_field_inverse_zero
authorhaftmann
Mon Apr 26 11:34:15 2010 +0200 (2010-04-26)
changeset 3634889c54f51f55a
parent 36347 0ca616bc6c6f
child 36349 39be26d1bc28
dropped group_simps, ring_simps, field_eq_simps; classes division_ring_inverse_zero, field_inverse_zero, linordered_field_inverse_zero
NEWS
src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy
src/HOL/Fields.thy
src/HOL/Groups.thy
src/HOL/Library/Fraction_Field.thy
src/HOL/Rings.thy
     1.1 --- a/NEWS	Mon Apr 26 11:34:15 2010 +0200
     1.2 +++ b/NEWS	Mon Apr 26 11:34:15 2010 +0200
     1.3 @@ -119,8 +119,12 @@
     1.4  *** HOL ***
     1.5  
     1.6  * Abstract algebra:
     1.7 -  * class division_by_zero includes division_ring;
     1.8 +  * classes division_ring_inverse_zero, field_inverse_zero, linordered_field_inverse_zero
     1.9 +    include rule inverse 0 = 0 -- subsumes former division_by_zero class.
    1.10    * numerous lemmas have been ported from field to division_ring;
    1.11 +  * dropped theorem group group_simps, use algebra_simps instead;
    1.12 +  * dropped theorem group ring_simps, use field_simps instead;
    1.13 +  * proper theorem collection field_simps subsumes former theorem groups field_eq_simps and field_simps;
    1.14    * dropped lemma eq_minus_self_iff which is a duplicate for equal_neg_zero.
    1.15  
    1.16    INCOMPATIBILITY.
     2.1 --- a/src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy	Mon Apr 26 11:34:15 2010 +0200
     2.2 +++ b/src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy	Mon Apr 26 11:34:15 2010 +0200
     2.3 @@ -27,7 +27,7 @@
     2.4    "tmsize (CNP n c a) = 3 + polysize c + tmsize a "
     2.5  
     2.6    (* Semantics of terms tm *)
     2.7 -consts Itm :: "'a::{ring_char_0,division_by_zero,field} list \<Rightarrow> 'a list \<Rightarrow> tm \<Rightarrow> 'a"
     2.8 +consts Itm :: "'a::{ring_char_0,division_ring_inverse_zero,field} list \<Rightarrow> 'a list \<Rightarrow> tm \<Rightarrow> 'a"
     2.9  primrec
    2.10    "Itm vs bs (CP c) = (Ipoly vs c)"
    2.11    "Itm vs bs (Bound n) = bs!n"
    2.12 @@ -239,7 +239,7 @@
    2.13  lemma tmadd[simp]: "Itm vs bs (tmadd (t,s)) = Itm vs bs (Add t s)"
    2.14  apply (induct t s rule: tmadd.induct, simp_all add: Let_def)
    2.15  apply (case_tac "c1 +\<^sub>p c2 = 0\<^sub>p",case_tac "n1 \<le> n2", simp_all)
    2.16 -apply (case_tac "n1 = n2", simp_all add: ring_simps)
    2.17 +apply (case_tac "n1 = n2", simp_all add: field_simps)
    2.18  apply (simp only: right_distrib[symmetric]) 
    2.19  by (auto simp del: polyadd simp add: polyadd[symmetric])
    2.20  
    2.21 @@ -259,7 +259,7 @@
    2.22    "tmmul t = (\<lambda> i. Mul i t)"
    2.23  
    2.24  lemma tmmul[simp]: "Itm vs bs (tmmul t i) = Itm vs bs (Mul i t)"
    2.25 -by (induct t arbitrary: i rule: tmmul.induct, simp_all add: ring_simps)
    2.26 +by (induct t arbitrary: i rule: tmmul.induct, simp_all add: field_simps)
    2.27  
    2.28  lemma tmmul_nb0[simp]: "tmbound0 t \<Longrightarrow> tmbound0 (tmmul t i)"
    2.29  by (induct t arbitrary: i rule: tmmul.induct, auto )
    2.30 @@ -270,7 +270,7 @@
    2.31  by (induct t arbitrary: i rule: tmmul.induct, auto simp add: Let_def)
    2.32  
    2.33  lemma tmmul_allpolys_npoly[simp]: 
    2.34 -  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
    2.35 +  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero, field})"
    2.36    shows "allpolys isnpoly t \<Longrightarrow> isnpoly c \<Longrightarrow> allpolys isnpoly (tmmul t c)" by (induct t rule: tmmul.induct, simp_all add: Let_def polymul_norm)
    2.37  
    2.38  definition tmneg :: "tm \<Rightarrow> tm" where
    2.39 @@ -296,7 +296,7 @@
    2.40  using tmneg_def by simp
    2.41  lemma [simp]: "isnpoly (C (-1,1))" unfolding isnpoly_def by simp
    2.42  lemma tmneg_allpolys_npoly[simp]: 
    2.43 -  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
    2.44 +  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero, field})"
    2.45    shows "allpolys isnpoly t \<Longrightarrow> allpolys isnpoly (tmneg t)" 
    2.46    unfolding tmneg_def by auto
    2.47  
    2.48 @@ -310,7 +310,7 @@
    2.49  lemma tmsub_blt[simp]: "\<lbrakk>tmboundslt n t ; tmboundslt n s\<rbrakk> \<Longrightarrow> tmboundslt n (tmsub t s )"
    2.50  using tmsub_def by simp
    2.51  lemma tmsub_allpolys_npoly[simp]: 
    2.52 -  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
    2.53 +  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero, field})"
    2.54    shows "allpolys isnpoly t \<Longrightarrow> allpolys isnpoly s \<Longrightarrow> allpolys isnpoly (tmsub t s)" 
    2.55    unfolding tmsub_def by (simp add: isnpoly_def)
    2.56  
    2.57 @@ -324,8 +324,8 @@
    2.58    "simptm (CNP n c t) = (let c' = polynate c in if c' = 0\<^sub>p then simptm t else tmadd (CNP n c' (CP 0\<^sub>p ), simptm t))"
    2.59  
    2.60  lemma polynate_stupid: 
    2.61 -  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
    2.62 -  shows "polynate t = 0\<^sub>p \<Longrightarrow> Ipoly bs t = (0::'a::{ring_char_0,division_by_zero, field})" 
    2.63 +  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero, field})"
    2.64 +  shows "polynate t = 0\<^sub>p \<Longrightarrow> Ipoly bs t = (0::'a::{ring_char_0,division_ring_inverse_zero, field})" 
    2.65  apply (subst polynate[symmetric])
    2.66  apply simp
    2.67  done
    2.68 @@ -345,7 +345,7 @@
    2.69  lemma [simp]: "isnpoly 0\<^sub>p" and [simp]: "isnpoly (C(1,1))" 
    2.70    by (simp_all add: isnpoly_def)
    2.71  lemma simptm_allpolys_npoly[simp]: 
    2.72 -  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
    2.73 +  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero, field})"
    2.74    shows "allpolys isnpoly (simptm p)"
    2.75    by (induct p rule: simptm.induct, auto simp add: Let_def)
    2.76  
    2.77 @@ -369,14 +369,14 @@
    2.78    "tmbound 0 (snd (split0 t)) \<and> (Itm vs bs (CNP 0 (fst (split0 t)) (snd (split0 t))) = Itm vs bs t)"
    2.79    apply (induct t rule: split0.induct)
    2.80    apply simp
    2.81 -  apply (simp add: Let_def split_def ring_simps)
    2.82 -  apply (simp add: Let_def split_def ring_simps)
    2.83 -  apply (simp add: Let_def split_def ring_simps)
    2.84 -  apply (simp add: Let_def split_def ring_simps)
    2.85 -  apply (simp add: Let_def split_def ring_simps)
    2.86 +  apply (simp add: Let_def split_def field_simps)
    2.87 +  apply (simp add: Let_def split_def field_simps)
    2.88 +  apply (simp add: Let_def split_def field_simps)
    2.89 +  apply (simp add: Let_def split_def field_simps)
    2.90 +  apply (simp add: Let_def split_def field_simps)
    2.91    apply (simp add: Let_def split_def mult_assoc right_distrib[symmetric])
    2.92 -  apply (simp add: Let_def split_def ring_simps)
    2.93 -  apply (simp add: Let_def split_def ring_simps)
    2.94 +  apply (simp add: Let_def split_def field_simps)
    2.95 +  apply (simp add: Let_def split_def field_simps)
    2.96    done
    2.97  
    2.98  lemma split0_ci: "split0 t = (c',t') \<Longrightarrow> Itm vs bs t = Itm vs bs (CNP 0 c' t')"
    2.99 @@ -387,7 +387,7 @@
   2.100  qed
   2.101  
   2.102  lemma split0_nb0: 
   2.103 -  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
   2.104 +  assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero, field})"
   2.105    shows "split0 t = (c',t') \<Longrightarrow>  tmbound 0 t'"
   2.106  proof-
   2.107    fix c' t'
   2.108 @@ -395,7 +395,7 @@
   2.109    with conjunct1[OF split0[where t="t"]] show "tmbound 0 t'" by simp
   2.110  qed
   2.111  
   2.112 -lemma split0_nb0'[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
   2.113 +lemma split0_nb0'[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero, field})"
   2.114    shows "tmbound0 (snd (split0 t))"
   2.115    using split0_nb0[of t "fst (split0 t)" "snd (split0 t)"] by (simp add: tmbound0_tmbound_iff)
   2.116  
   2.117 @@ -418,7 +418,7 @@
   2.118  lemma allpolys_split0: "allpolys isnpoly p \<Longrightarrow> allpolys isnpoly (snd (split0 p))"
   2.119  by (induct p rule: split0.induct, auto simp  add: isnpoly_def Let_def split_def split0_stupid)
   2.120  
   2.121 -lemma isnpoly_fst_split0:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero, field})"
   2.122 +lemma isnpoly_fst_split0:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero, field})"
   2.123    shows 
   2.124    "allpolys isnpoly p \<Longrightarrow> isnpoly (fst (split0 p))"
   2.125    by (induct p rule: split0.induct, 
   2.126 @@ -447,7 +447,7 @@
   2.127  by (induct p rule: fmsize.induct) simp_all
   2.128  
   2.129    (* Semantics of formulae (fm) *)
   2.130 -consts Ifm ::"'a::{division_by_zero,linordered_field} list \<Rightarrow> 'a list \<Rightarrow> fm \<Rightarrow> bool"
   2.131 +consts Ifm ::"'a::{division_ring_inverse_zero,linordered_field} list \<Rightarrow> 'a list \<Rightarrow> fm \<Rightarrow> bool"
   2.132  primrec
   2.133    "Ifm vs bs T = True"
   2.134    "Ifm vs bs F = False"
   2.135 @@ -969,24 +969,24 @@
   2.136  definition "simpeq t = (let (c,s) = split0 (simptm t) in if c= 0\<^sub>p then eq s else Eq (CNP 0 c s))"
   2.137  definition "simpneq t = (let (c,s) = split0 (simptm t) in if c= 0\<^sub>p then neq s else NEq (CNP 0 c s))"
   2.138  
   2.139 -lemma simplt_islin[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.140 +lemma simplt_islin[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.141    shows "islin (simplt t)"
   2.142    unfolding simplt_def 
   2.143    using split0_nb0'
   2.144  by (auto simp add: lt_lin Let_def split_def isnpoly_fst_split0[OF simptm_allpolys_npoly] islin_stupid allpolys_split0[OF simptm_allpolys_npoly])
   2.145    
   2.146 -lemma simple_islin[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.147 +lemma simple_islin[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.148    shows "islin (simple t)"
   2.149    unfolding simple_def 
   2.150    using split0_nb0'
   2.151  by (auto simp add: Let_def split_def isnpoly_fst_split0[OF simptm_allpolys_npoly] islin_stupid allpolys_split0[OF simptm_allpolys_npoly] le_lin)
   2.152 -lemma simpeq_islin[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.153 +lemma simpeq_islin[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.154    shows "islin (simpeq t)"
   2.155    unfolding simpeq_def 
   2.156    using split0_nb0'
   2.157  by (auto simp add: Let_def split_def isnpoly_fst_split0[OF simptm_allpolys_npoly] islin_stupid allpolys_split0[OF simptm_allpolys_npoly] eq_lin)
   2.158  
   2.159 -lemma simpneq_islin[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.160 +lemma simpneq_islin[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.161    shows "islin (simpneq t)"
   2.162    unfolding simpneq_def 
   2.163    using split0_nb0'
   2.164 @@ -994,7 +994,7 @@
   2.165  
   2.166  lemma really_stupid: "\<not> (\<forall>c1 s'. (c1, s') \<noteq> split0 s)"
   2.167    by (cases "split0 s", auto)
   2.168 -lemma split0_npoly:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.169 +lemma split0_npoly:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.170    and n: "allpolys isnpoly t"
   2.171    shows "isnpoly (fst (split0 t))" and "allpolys isnpoly (snd (split0 t))"
   2.172    using n
   2.173 @@ -1083,7 +1083,7 @@
   2.174    apply (case_tac poly, auto)
   2.175    done
   2.176  
   2.177 -lemma simplt_nb[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.178 +lemma simplt_nb[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.179    shows "tmbound0 t \<Longrightarrow> bound0 (simplt t)"
   2.180    using split0 [of "simptm t" vs bs]
   2.181  proof(simp add: simplt_def Let_def split_def)
   2.182 @@ -1100,7 +1100,7 @@
   2.183         fst (split0 (simptm t)) = 0\<^sub>p" by (simp add: simplt_def Let_def split_def lt_nb)
   2.184  qed
   2.185  
   2.186 -lemma simple_nb[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.187 +lemma simple_nb[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.188    shows "tmbound0 t \<Longrightarrow> bound0 (simple t)"
   2.189    using split0 [of "simptm t" vs bs]
   2.190  proof(simp add: simple_def Let_def split_def)
   2.191 @@ -1117,7 +1117,7 @@
   2.192         fst (split0 (simptm t)) = 0\<^sub>p" by (simp add: simplt_def Let_def split_def le_nb)
   2.193  qed
   2.194  
   2.195 -lemma simpeq_nb[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.196 +lemma simpeq_nb[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.197    shows "tmbound0 t \<Longrightarrow> bound0 (simpeq t)"
   2.198    using split0 [of "simptm t" vs bs]
   2.199  proof(simp add: simpeq_def Let_def split_def)
   2.200 @@ -1134,7 +1134,7 @@
   2.201         fst (split0 (simptm t)) = 0\<^sub>p" by (simp add: simpeq_def Let_def split_def eq_nb)
   2.202  qed
   2.203  
   2.204 -lemma simpneq_nb[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.205 +lemma simpneq_nb[simp]:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.206    shows "tmbound0 t \<Longrightarrow> bound0 (simpneq t)"
   2.207    using split0 [of "simptm t" vs bs]
   2.208  proof(simp add: simpneq_def Let_def split_def)
   2.209 @@ -1267,7 +1267,7 @@
   2.210  lemma simpfm[simp]: "Ifm vs bs (simpfm p) = Ifm vs bs p"
   2.211  by(induct p arbitrary: bs rule: simpfm.induct, auto)
   2.212  
   2.213 -lemma simpfm_bound0:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.214 +lemma simpfm_bound0:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.215    shows "bound0 p \<Longrightarrow> bound0 (simpfm p)"
   2.216  by (induct p rule: simpfm.induct, auto)
   2.217  
   2.218 @@ -1296,7 +1296,7 @@
   2.219  lemma disj_lin: "islin p \<Longrightarrow> islin q \<Longrightarrow> islin (disj p q)" by (simp add: disj_def)
   2.220  lemma conj_lin: "islin p \<Longrightarrow> islin q \<Longrightarrow> islin (conj p q)" by (simp add: conj_def)
   2.221  
   2.222 -lemma   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.223 +lemma   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.224    shows "qfree p \<Longrightarrow> islin (simpfm p)" 
   2.225    apply (induct p rule: simpfm.induct)
   2.226    apply (simp_all add: conj_lin disj_lin)
   2.227 @@ -1698,11 +1698,11 @@
   2.228    {assume c: "?N c > 0"
   2.229        from px pos_less_divide_eq[OF c, where a="x" and b="-?Nt x s"]  
   2.230        have px': "x < - ?Nt x s / ?N c" 
   2.231 -        by (auto simp add: not_less ring_simps) 
   2.232 +        by (auto simp add: not_less field_simps) 
   2.233      {assume y: "y < - ?Nt x s / ?N c" 
   2.234        hence "y * ?N c < - ?Nt x s"
   2.235          by (simp add: pos_less_divide_eq[OF c, where a="y" and b="-?Nt x s", symmetric])
   2.236 -      hence "?N c * y + ?Nt x s < 0" by (simp add: ring_simps)
   2.237 +      hence "?N c * y + ?Nt x s < 0" by (simp add: field_simps)
   2.238        hence ?case using tmbound0_I[OF lin(3), where bs="bs" and b="x" and b'="y"] by simp}
   2.239      moreover
   2.240      {assume y: "y > -?Nt x s / ?N c" 
   2.241 @@ -1715,11 +1715,11 @@
   2.242    {assume c: "?N c < 0"
   2.243        from px neg_divide_less_eq[OF c, where a="x" and b="-?Nt x s"]  
   2.244        have px': "x > - ?Nt x s / ?N c" 
   2.245 -        by (auto simp add: not_less ring_simps) 
   2.246 +        by (auto simp add: not_less field_simps) 
   2.247      {assume y: "y > - ?Nt x s / ?N c" 
   2.248        hence "y * ?N c < - ?Nt x s"
   2.249          by (simp add: neg_divide_less_eq[OF c, where a="y" and b="-?Nt x s", symmetric])
   2.250 -      hence "?N c * y + ?Nt x s < 0" by (simp add: ring_simps)
   2.251 +      hence "?N c * y + ?Nt x s < 0" by (simp add: field_simps)
   2.252        hence ?case using tmbound0_I[OF lin(3), where bs="bs" and b="x" and b'="y"] by simp}
   2.253      moreover
   2.254      {assume y: "y < -?Nt x s / ?N c" 
   2.255 @@ -1743,11 +1743,11 @@
   2.256    moreover
   2.257    {assume c: "?N c > 0"
   2.258        from px pos_le_divide_eq[OF c, where a="x" and b="-?Nt x s"]  
   2.259 -      have px': "x <= - ?Nt x s / ?N c" by (simp add: not_less ring_simps) 
   2.260 +      have px': "x <= - ?Nt x s / ?N c" by (simp add: not_less field_simps) 
   2.261      {assume y: "y < - ?Nt x s / ?N c" 
   2.262        hence "y * ?N c < - ?Nt x s"
   2.263          by (simp add: pos_less_divide_eq[OF c, where a="y" and b="-?Nt x s", symmetric])
   2.264 -      hence "?N c * y + ?Nt x s < 0" by (simp add: ring_simps)
   2.265 +      hence "?N c * y + ?Nt x s < 0" by (simp add: field_simps)
   2.266        hence ?case using tmbound0_I[OF lin(3), where bs="bs" and b="x" and b'="y"] by simp}
   2.267      moreover
   2.268      {assume y: "y > -?Nt x s / ?N c" 
   2.269 @@ -1759,11 +1759,11 @@
   2.270    moreover
   2.271    {assume c: "?N c < 0"
   2.272        from px neg_divide_le_eq[OF c, where a="x" and b="-?Nt x s"]  
   2.273 -      have px': "x >= - ?Nt x s / ?N c" by (simp add: ring_simps) 
   2.274 +      have px': "x >= - ?Nt x s / ?N c" by (simp add: field_simps) 
   2.275      {assume y: "y > - ?Nt x s / ?N c" 
   2.276        hence "y * ?N c < - ?Nt x s"
   2.277          by (simp add: neg_divide_less_eq[OF c, where a="y" and b="-?Nt x s", symmetric])
   2.278 -      hence "?N c * y + ?Nt x s < 0" by (simp add: ring_simps)
   2.279 +      hence "?N c * y + ?Nt x s < 0" by (simp add: field_simps)
   2.280        hence ?case using tmbound0_I[OF lin(3), where bs="bs" and b="x" and b'="y"] by simp}
   2.281      moreover
   2.282      {assume y: "y < -?Nt x s / ?N c" 
   2.283 @@ -1787,7 +1787,7 @@
   2.284    moreover
   2.285    {assume c: "?N c > 0" hence cnz: "?N c \<noteq> 0" by simp
   2.286      from px eq_divide_eq[of "x" "-?Nt x s" "?N c"]  cnz
   2.287 -    have px': "x = - ?Nt x s / ?N c" by (simp add: ring_simps)
   2.288 +    have px': "x = - ?Nt x s / ?N c" by (simp add: field_simps)
   2.289      {assume y: "y < -?Nt x s / ?N c" 
   2.290        with ly have eu: "l < - ?Nt x s / ?N c" by auto
   2.291        with noS ly yu have th: "- ?Nt x s / ?N c \<ge> u" by (cases "- ?Nt x s / ?N c < u", auto)
   2.292 @@ -1802,7 +1802,7 @@
   2.293    moreover
   2.294    {assume c: "?N c < 0" hence cnz: "?N c \<noteq> 0" by simp
   2.295      from px eq_divide_eq[of "x" "-?Nt x s" "?N c"]  cnz
   2.296 -    have px': "x = - ?Nt x s / ?N c" by (simp add: ring_simps)
   2.297 +    have px': "x = - ?Nt x s / ?N c" by (simp add: field_simps)
   2.298      {assume y: "y < -?Nt x s / ?N c" 
   2.299        with ly have eu: "l < - ?Nt x s / ?N c" by auto
   2.300        with noS ly yu have th: "- ?Nt x s / ?N c \<ge> u" by (cases "- ?Nt x s / ?N c < u", auto)
   2.301 @@ -1829,7 +1829,7 @@
   2.302    moreover
   2.303    {assume c: "?N c \<noteq> 0"
   2.304      from yne c eq_divide_eq[of "y" "- ?Nt x s" "?N c"] have ?case
   2.305 -      by (simp add: ring_simps tmbound0_I[OF lin(3), of vs x bs y] sum_eq[symmetric]) }
   2.306 +      by (simp add: field_simps tmbound0_I[OF lin(3), of vs x bs y] sum_eq[symmetric]) }
   2.307    ultimately show ?case by blast
   2.308  qed (auto simp add: nth_pos2 tmbound0_I[where vs=vs and bs="bs" and b="y" and b'="x"] bound0_I[where vs=vs and bs="bs" and b="y" and b'="x"])
   2.309  
   2.310 @@ -1844,7 +1844,7 @@
   2.311  
   2.312  lemma half_sum_eq: "(u + u) / (1+1) = (u::'a::{linordered_field})" 
   2.313  proof-
   2.314 -  have "(u + u) = (1 + 1) * u" by (simp add: ring_simps)
   2.315 +  have "(u + u) = (1 + 1) * u" by (simp add: field_simps)
   2.316    hence "(u + u) / (1+1) = (1 + 1)*u / (1 + 1)" by simp
   2.317    with nonzero_mult_divide_cancel_left[OF one_plus_one_nonzero, of u] show ?thesis by simp
   2.318  qed
   2.319 @@ -1987,7 +1987,7 @@
   2.320      also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a * (-?s / ((1 + 1)*?d)) + ?r) = 0" 
   2.321        using d mult_cancel_left[of "(1 + 1)*?d" "(?a * (-?s / ((1 + 1)*?d)) + ?r)" 0] by simp
   2.322      also have "\<dots> \<longleftrightarrow> (- ?a * ?s) * ((1 + 1)*?d / ((1 + 1)*?d)) + (1 + 1)*?d*?r= 0"
   2.323 -      by (simp add: ring_simps right_distrib[of "(1 + 1)*?d"] del: right_distrib)
   2.324 +      by (simp add: field_simps right_distrib[of "(1 + 1)*?d"] del: right_distrib)
   2.325      
   2.326      also have "\<dots> \<longleftrightarrow> - (?a * ?s) + (1 + 1)*?d*?r = 0" using d by simp 
   2.327      finally have ?thesis using c d 
   2.328 @@ -2003,7 +2003,7 @@
   2.329      also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a * (-?t / ((1 + 1)*?c)) + ?r) = 0" 
   2.330        using c mult_cancel_left[of "(1 + 1)*?c" "(?a * (-?t / ((1 + 1)*?c)) + ?r)" 0] by simp
   2.331      also have "\<dots> \<longleftrightarrow> (?a * -?t)* ((1 + 1)*?c) / ((1 + 1)*?c) + (1 + 1)*?c*?r= 0"
   2.332 -      by (simp add: ring_simps right_distrib[of "(1 + 1)*?c"] del: right_distrib)
   2.333 +      by (simp add: field_simps right_distrib[of "(1 + 1)*?c"] del: right_distrib)
   2.334      also have "\<dots> \<longleftrightarrow> - (?a * ?t) + (1 + 1)*?c*?r = 0" using c by simp 
   2.335      finally have ?thesis using c d 
   2.336        apply (simp add: r[of "- (?t/ ((1 + 1)*?c))"] msubsteq_def Let_def evaldjf_ex del: one_add_one_is_two)
   2.337 @@ -2014,19 +2014,19 @@
   2.338    {assume c: "?c \<noteq> 0" and d: "?d\<noteq>0" hence dc: "?c * ?d *(1 + 1) \<noteq> 0" by simp
   2.339      from add_frac_eq[OF c d, of "- ?t" "- ?s"]
   2.340      have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" 
   2.341 -      by (simp add: ring_simps)
   2.342 +      by (simp add: field_simps)
   2.343      have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Eq (CNP 0 a r))" by (simp only: th)
   2.344      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r = 0" 
   2.345        by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"])
   2.346      also have "\<dots> \<longleftrightarrow> ((1 + 1) * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r) =0 "
   2.347        using c d mult_cancel_left[of "(1 + 1) * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r" 0] by simp
   2.348      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + (1 + 1)*?c*?d*?r =0" 
   2.349 -      using nonzero_mult_divide_cancel_left[OF dc] c d
   2.350 -      by (simp add: ring_simps diff_divide_distrib del: left_distrib)
   2.351 +      using nonzero_mult_divide_cancel_left [OF dc] c d
   2.352 +      by (simp add: algebra_simps diff_divide_distrib del: left_distrib)
   2.353      finally  have ?thesis using c d 
   2.354 -      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubsteq_def Let_def evaldjf_ex ring_simps)
   2.355 +      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubsteq_def Let_def evaldjf_ex field_simps)
   2.356        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.357 -      apply (simp add: ring_simps)
   2.358 +      apply (simp add: field_simps)
   2.359        done }
   2.360    ultimately show ?thesis by blast
   2.361  qed
   2.362 @@ -2075,7 +2075,7 @@
   2.363      also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a * (-?s / ((1 + 1)*?d)) + ?r) \<noteq> 0" 
   2.364        using d mult_cancel_left[of "(1 + 1)*?d" "(?a * (-?s / ((1 + 1)*?d)) + ?r)" 0] by simp
   2.365      also have "\<dots> \<longleftrightarrow> (- ?a * ?s) * ((1 + 1)*?d / ((1 + 1)*?d)) + (1 + 1)*?d*?r\<noteq> 0"
   2.366 -      by (simp add: ring_simps right_distrib[of "(1 + 1)*?d"] del: right_distrib)
   2.367 +      by (simp add: field_simps right_distrib[of "(1 + 1)*?d"] del: right_distrib)
   2.368      
   2.369      also have "\<dots> \<longleftrightarrow> - (?a * ?s) + (1 + 1)*?d*?r \<noteq> 0" using d by simp 
   2.370      finally have ?thesis using c d 
   2.371 @@ -2091,7 +2091,7 @@
   2.372      also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a * (-?t / ((1 + 1)*?c)) + ?r) \<noteq> 0" 
   2.373        using c mult_cancel_left[of "(1 + 1)*?c" "(?a * (-?t / ((1 + 1)*?c)) + ?r)" 0] by simp
   2.374      also have "\<dots> \<longleftrightarrow> (?a * -?t)* ((1 + 1)*?c) / ((1 + 1)*?c) + (1 + 1)*?c*?r \<noteq> 0"
   2.375 -      by (simp add: ring_simps right_distrib[of "(1 + 1)*?c"] del: right_distrib)
   2.376 +      by (simp add: field_simps right_distrib[of "(1 + 1)*?c"] del: right_distrib)
   2.377      also have "\<dots> \<longleftrightarrow> - (?a * ?t) + (1 + 1)*?c*?r \<noteq> 0" using c by simp 
   2.378      finally have ?thesis using c d 
   2.379        apply (simp add: r[of "- (?t/ ((1 + 1)*?c))"] msubstneq_def Let_def evaldjf_ex del: one_add_one_is_two)
   2.380 @@ -2102,7 +2102,7 @@
   2.381    {assume c: "?c \<noteq> 0" and d: "?d\<noteq>0" hence dc: "?c * ?d *(1 + 1) \<noteq> 0" by simp
   2.382      from add_frac_eq[OF c d, of "- ?t" "- ?s"]
   2.383      have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" 
   2.384 -      by (simp add: ring_simps)
   2.385 +      by (simp add: field_simps)
   2.386      have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (NEq (CNP 0 a r))" by (simp only: th)
   2.387      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r \<noteq> 0" 
   2.388        by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"])
   2.389 @@ -2110,11 +2110,11 @@
   2.390        using c d mult_cancel_left[of "(1 + 1) * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r" 0] by simp
   2.391      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + (1 + 1)*?c*?d*?r \<noteq> 0" 
   2.392        using nonzero_mult_divide_cancel_left[OF dc] c d
   2.393 -      by (simp add: ring_simps diff_divide_distrib del: left_distrib)
   2.394 +      by (simp add: algebra_simps diff_divide_distrib del: left_distrib)
   2.395      finally  have ?thesis using c d 
   2.396 -      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstneq_def Let_def evaldjf_ex ring_simps)
   2.397 +      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstneq_def Let_def evaldjf_ex field_simps)
   2.398        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.399 -      apply (simp add: ring_simps)
   2.400 +      apply (simp add: field_simps)
   2.401        done }
   2.402    ultimately show ?thesis by blast
   2.403  qed
   2.404 @@ -2169,7 +2169,7 @@
   2.405      from dc' have dc'': "\<not> (1 + 1)*?c *?d < 0" by simp
   2.406      from add_frac_eq[OF c d, of "- ?t" "- ?s"]
   2.407      have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" 
   2.408 -      by (simp add: ring_simps)
   2.409 +      by (simp add: field_simps)
   2.410      have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th)
   2.411      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r < 0" 
   2.412        by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"])
   2.413 @@ -2178,11 +2178,11 @@
   2.414        using dc' dc'' mult_less_cancel_left_disj[of "(1 + 1) * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r" 0] by simp
   2.415      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + (1 + 1)*?c*?d*?r < 0" 
   2.416        using nonzero_mult_divide_cancel_left[of "(1 + 1)*?c*?d"] c d
   2.417 -      by (simp add: ring_simps diff_divide_distrib del: left_distrib)
   2.418 +      by (simp add: algebra_simps diff_divide_distrib del: left_distrib)
   2.419      finally  have ?thesis using dc c d  nc nd dc'
   2.420 -      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstlt_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm) 
   2.421 +      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) 
   2.422      apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.423 -    by (simp add: ring_simps order_less_not_sym[OF dc])}
   2.424 +    by (simp add: field_simps order_less_not_sym[OF dc])}
   2.425    moreover
   2.426    {assume dc: "?c*?d < 0" 
   2.427  
   2.428 @@ -2191,7 +2191,7 @@
   2.429      hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto
   2.430      from add_frac_eq[OF c d, of "- ?t" "- ?s"]
   2.431      have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" 
   2.432 -      by (simp add: ring_simps)
   2.433 +      by (simp add: field_simps)
   2.434      have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th)
   2.435      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r < 0" 
   2.436        by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"])
   2.437 @@ -2201,78 +2201,78 @@
   2.438        using dc' order_less_not_sym[OF dc'] mult_less_cancel_left_disj[of "(1 + 1) * ?c * ?d" 0 "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r"] by simp
   2.439      also have "\<dots> \<longleftrightarrow> ?a * ((?d * ?t + ?c* ?s )) - (1 + 1)*?c*?d*?r < 0" 
   2.440        using nonzero_mult_divide_cancel_left[of "(1 + 1)*?c*?d"] c d
   2.441 -      by (simp add: ring_simps diff_divide_distrib del: left_distrib)
   2.442 +      by (simp add: algebra_simps diff_divide_distrib del: left_distrib)
   2.443      finally  have ?thesis using dc c d  nc nd
   2.444 -      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstlt_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm) 
   2.445 +      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) 
   2.446        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.447 -      by (simp add: ring_simps order_less_not_sym[OF dc]) }
   2.448 +      by (simp add: field_simps order_less_not_sym[OF dc]) }
   2.449    moreover
   2.450    {assume c: "?c > 0" and d: "?d=0"  
   2.451      from c have c'': "(1 + 1)*?c > 0" by (simp add: zero_less_mult_iff)
   2.452      from c have c': "(1 + 1)*?c \<noteq> 0" by simp
   2.453 -    from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)"  by (simp add: ring_simps)
   2.454 +    from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)"  by (simp add: field_simps)
   2.455      have "?rhs \<longleftrightarrow> Ifm vs (- ?t / ((1 + 1)*?c) # bs) (Lt (CNP 0 a r))" by (simp only: th)
   2.456      also have "\<dots> \<longleftrightarrow> ?a* (- ?t / ((1 + 1)*?c))+ ?r < 0" by (simp add: r[of "- (?t / ((1 + 1)*?c))"])
   2.457      also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a* (- ?t / ((1 + 1)*?c))+ ?r) < 0"
   2.458        using c mult_less_cancel_left_disj[of "(1 + 1) * ?c" "?a* (- ?t / ((1 + 1)*?c))+ ?r" 0] c' c'' order_less_not_sym[OF c''] by simp
   2.459      also have "\<dots> \<longleftrightarrow> - ?a*?t+  (1 + 1)*?c *?r < 0" 
   2.460        using nonzero_mult_divide_cancel_left[OF c'] c
   2.461 -      by (simp add: ring_simps diff_divide_distrib less_le del: left_distrib)
   2.462 +      by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib)
   2.463      finally have ?thesis using c d nc nd 
   2.464 -      apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstlt_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm)
   2.465 +      apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm)
   2.466        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.467        using c order_less_not_sym[OF c] less_imp_neq[OF c]
   2.468 -      by (simp add: ring_simps )  }
   2.469 +      by (simp add: field_simps )  }
   2.470    moreover
   2.471    {assume c: "?c < 0" and d: "?d=0"  hence c': "(1 + 1)*?c \<noteq> 0" by simp
   2.472      from c have c'': "(1 + 1)*?c < 0" by (simp add: mult_less_0_iff)
   2.473 -    from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)"  by (simp add: ring_simps)
   2.474 +    from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)"  by (simp add: field_simps)
   2.475      have "?rhs \<longleftrightarrow> Ifm vs (- ?t / ((1 + 1)*?c) # bs) (Lt (CNP 0 a r))" by (simp only: th)
   2.476      also have "\<dots> \<longleftrightarrow> ?a* (- ?t / ((1 + 1)*?c))+ ?r < 0" by (simp add: r[of "- (?t / ((1 + 1)*?c))"])
   2.477      also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a* (- ?t / ((1 + 1)*?c))+ ?r) > 0"
   2.478        using c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' mult_less_cancel_left_disj[of "(1 + 1) * ?c" 0 "?a* (- ?t / ((1 + 1)*?c))+ ?r"] by simp
   2.479      also have "\<dots> \<longleftrightarrow> ?a*?t -  (1 + 1)*?c *?r < 0" 
   2.480        using nonzero_mult_divide_cancel_left[OF c'] c order_less_not_sym[OF c''] less_imp_neq[OF c''] c''
   2.481 -        by (simp add: ring_simps diff_divide_distrib del:  left_distrib)
   2.482 +        by (simp add: algebra_simps diff_divide_distrib del:  left_distrib)
   2.483      finally have ?thesis using c d nc nd 
   2.484 -      apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstlt_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm)
   2.485 +      apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm)
   2.486        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.487        using c order_less_not_sym[OF c] less_imp_neq[OF c]
   2.488 -      by (simp add: ring_simps )    }
   2.489 +      by (simp add: field_simps )    }
   2.490    moreover
   2.491    moreover
   2.492    {assume c: "?c = 0" and d: "?d>0"  
   2.493      from d have d'': "(1 + 1)*?d > 0" by (simp add: zero_less_mult_iff)
   2.494      from d have d': "(1 + 1)*?d \<noteq> 0" by simp
   2.495 -    from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)"  by (simp add: ring_simps)
   2.496 +    from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)"  by (simp add: field_simps)
   2.497      have "?rhs \<longleftrightarrow> Ifm vs (- ?s / ((1 + 1)*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th)
   2.498      also have "\<dots> \<longleftrightarrow> ?a* (- ?s / ((1 + 1)*?d))+ ?r < 0" by (simp add: r[of "- (?s / ((1 + 1)*?d))"])
   2.499      also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a* (- ?s / ((1 + 1)*?d))+ ?r) < 0"
   2.500        using d mult_less_cancel_left_disj[of "(1 + 1) * ?d" "?a* (- ?s / ((1 + 1)*?d))+ ?r" 0] d' d'' order_less_not_sym[OF d''] by simp
   2.501      also have "\<dots> \<longleftrightarrow> - ?a*?s+  (1 + 1)*?d *?r < 0" 
   2.502        using nonzero_mult_divide_cancel_left[OF d'] d
   2.503 -      by (simp add: ring_simps diff_divide_distrib less_le del: left_distrib)
   2.504 +      by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib)
   2.505      finally have ?thesis using c d nc nd 
   2.506 -      apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstlt_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm)
   2.507 +      apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm)
   2.508        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.509        using d order_less_not_sym[OF d] less_imp_neq[OF d]
   2.510 -      by (simp add: ring_simps )  }
   2.511 +      by (simp add: field_simps)  }
   2.512    moreover
   2.513    {assume c: "?c = 0" and d: "?d<0"  hence d': "(1 + 1)*?d \<noteq> 0" by simp
   2.514      from d have d'': "(1 + 1)*?d < 0" by (simp add: mult_less_0_iff)
   2.515 -    from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)"  by (simp add: ring_simps)
   2.516 +    from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)"  by (simp add: field_simps)
   2.517      have "?rhs \<longleftrightarrow> Ifm vs (- ?s / ((1 + 1)*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th)
   2.518      also have "\<dots> \<longleftrightarrow> ?a* (- ?s / ((1 + 1)*?d))+ ?r < 0" by (simp add: r[of "- (?s / ((1 + 1)*?d))"])
   2.519      also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a* (- ?s / ((1 + 1)*?d))+ ?r) > 0"
   2.520        using d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' mult_less_cancel_left_disj[of "(1 + 1) * ?d" 0 "?a* (- ?s / ((1 + 1)*?d))+ ?r"] by simp
   2.521      also have "\<dots> \<longleftrightarrow> ?a*?s -  (1 + 1)*?d *?r < 0" 
   2.522        using nonzero_mult_divide_cancel_left[OF d'] d order_less_not_sym[OF d''] less_imp_neq[OF d''] d''
   2.523 -        by (simp add: ring_simps diff_divide_distrib del:  left_distrib)
   2.524 +        by (simp add: algebra_simps diff_divide_distrib del:  left_distrib)
   2.525      finally have ?thesis using c d nc nd 
   2.526 -      apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstlt_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm)
   2.527 +      apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm)
   2.528        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.529        using d order_less_not_sym[OF d] less_imp_neq[OF d]
   2.530 -      by (simp add: ring_simps )    }
   2.531 +      by (simp add: field_simps )    }
   2.532  ultimately show ?thesis by blast
   2.533  qed
   2.534  
   2.535 @@ -2325,7 +2325,7 @@
   2.536      from dc' have dc'': "\<not> (1 + 1)*?c *?d < 0" by simp
   2.537      from add_frac_eq[OF c d, of "- ?t" "- ?s"]
   2.538      have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" 
   2.539 -      by (simp add: ring_simps)
   2.540 +      by (simp add: field_simps)
   2.541      have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Le (CNP 0 a r))" by (simp only: th)
   2.542      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r <= 0" 
   2.543        by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"])
   2.544 @@ -2334,11 +2334,11 @@
   2.545        using dc' dc'' mult_le_cancel_left[of "(1 + 1) * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r" 0] by simp
   2.546      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + (1 + 1)*?c*?d*?r <= 0" 
   2.547        using nonzero_mult_divide_cancel_left[of "(1 + 1)*?c*?d"] c d
   2.548 -      by (simp add: ring_simps diff_divide_distrib del: left_distrib)
   2.549 +      by (simp add: algebra_simps diff_divide_distrib del: left_distrib)
   2.550      finally  have ?thesis using dc c d  nc nd dc'
   2.551 -      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstle_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm) 
   2.552 +      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) 
   2.553      apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.554 -    by (simp add: ring_simps order_less_not_sym[OF dc])}
   2.555 +    by (simp add: field_simps order_less_not_sym[OF dc])}
   2.556    moreover
   2.557    {assume dc: "?c*?d < 0" 
   2.558  
   2.559 @@ -2347,7 +2347,7 @@
   2.560      hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto
   2.561      from add_frac_eq[OF c d, of "- ?t" "- ?s"]
   2.562      have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" 
   2.563 -      by (simp add: ring_simps)
   2.564 +      by (simp add: field_simps)
   2.565      have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Le (CNP 0 a r))" by (simp only: th)
   2.566      also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r <= 0" 
   2.567        by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"])
   2.568 @@ -2357,78 +2357,78 @@
   2.569        using dc' order_less_not_sym[OF dc'] mult_le_cancel_left[of "(1 + 1) * ?c * ?d" 0 "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r"] by simp
   2.570      also have "\<dots> \<longleftrightarrow> ?a * ((?d * ?t + ?c* ?s )) - (1 + 1)*?c*?d*?r <= 0" 
   2.571        using nonzero_mult_divide_cancel_left[of "(1 + 1)*?c*?d"] c d
   2.572 -      by (simp add: ring_simps diff_divide_distrib del: left_distrib)
   2.573 +      by (simp add: algebra_simps diff_divide_distrib del: left_distrib)
   2.574      finally  have ?thesis using dc c d  nc nd
   2.575 -      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstle_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm) 
   2.576 +      apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) 
   2.577        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.578 -      by (simp add: ring_simps order_less_not_sym[OF dc]) }
   2.579 +      by (simp add: field_simps order_less_not_sym[OF dc]) }
   2.580    moreover
   2.581    {assume c: "?c > 0" and d: "?d=0"  
   2.582      from c have c'': "(1 + 1)*?c > 0" by (simp add: zero_less_mult_iff)
   2.583      from c have c': "(1 + 1)*?c \<noteq> 0" by simp
   2.584 -    from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)"  by (simp add: ring_simps)
   2.585 +    from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)"  by (simp add: field_simps)
   2.586      have "?rhs \<longleftrightarrow> Ifm vs (- ?t / ((1 + 1)*?c) # bs) (Le (CNP 0 a r))" by (simp only: th)
   2.587      also have "\<dots> \<longleftrightarrow> ?a* (- ?t / ((1 + 1)*?c))+ ?r <= 0" by (simp add: r[of "- (?t / ((1 + 1)*?c))"])
   2.588      also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a* (- ?t / ((1 + 1)*?c))+ ?r) <= 0"
   2.589        using c mult_le_cancel_left[of "(1 + 1) * ?c" "?a* (- ?t / ((1 + 1)*?c))+ ?r" 0] c' c'' order_less_not_sym[OF c''] by simp
   2.590      also have "\<dots> \<longleftrightarrow> - ?a*?t+  (1 + 1)*?c *?r <= 0" 
   2.591        using nonzero_mult_divide_cancel_left[OF c'] c
   2.592 -      by (simp add: ring_simps diff_divide_distrib less_le del: left_distrib)
   2.593 +      by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib)
   2.594      finally have ?thesis using c d nc nd 
   2.595 -      apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstle_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm)
   2.596 +      apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm)
   2.597        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.598        using c order_less_not_sym[OF c] less_imp_neq[OF c]
   2.599 -      by (simp add: ring_simps )  }
   2.600 +      by (simp add: field_simps )  }
   2.601    moreover
   2.602    {assume c: "?c < 0" and d: "?d=0"  hence c': "(1 + 1)*?c \<noteq> 0" by simp
   2.603      from c have c'': "(1 + 1)*?c < 0" by (simp add: mult_less_0_iff)
   2.604 -    from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)"  by (simp add: ring_simps)
   2.605 +    from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)"  by (simp add: field_simps)
   2.606      have "?rhs \<longleftrightarrow> Ifm vs (- ?t / ((1 + 1)*?c) # bs) (Le (CNP 0 a r))" by (simp only: th)
   2.607      also have "\<dots> \<longleftrightarrow> ?a* (- ?t / ((1 + 1)*?c))+ ?r <= 0" by (simp add: r[of "- (?t / ((1 + 1)*?c))"])
   2.608      also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a* (- ?t / ((1 + 1)*?c))+ ?r) >= 0"
   2.609        using c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' mult_le_cancel_left[of "(1 + 1) * ?c" 0 "?a* (- ?t / ((1 + 1)*?c))+ ?r"] by simp
   2.610      also have "\<dots> \<longleftrightarrow> ?a*?t -  (1 + 1)*?c *?r <= 0" 
   2.611        using nonzero_mult_divide_cancel_left[OF c'] c order_less_not_sym[OF c''] less_imp_neq[OF c''] c''
   2.612 -        by (simp add: ring_simps diff_divide_distrib del:  left_distrib)
   2.613 +        by (simp add: algebra_simps diff_divide_distrib del:  left_distrib)
   2.614      finally have ?thesis using c d nc nd 
   2.615 -      apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstle_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm)
   2.616 +      apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm)
   2.617        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.618        using c order_less_not_sym[OF c] less_imp_neq[OF c]
   2.619 -      by (simp add: ring_simps )    }
   2.620 +      by (simp add: field_simps )    }
   2.621    moreover
   2.622    moreover
   2.623    {assume c: "?c = 0" and d: "?d>0"  
   2.624      from d have d'': "(1 + 1)*?d > 0" by (simp add: zero_less_mult_iff)
   2.625      from d have d': "(1 + 1)*?d \<noteq> 0" by simp
   2.626 -    from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)"  by (simp add: ring_simps)
   2.627 +    from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)"  by (simp add: field_simps)
   2.628      have "?rhs \<longleftrightarrow> Ifm vs (- ?s / ((1 + 1)*?d) # bs) (Le (CNP 0 a r))" by (simp only: th)
   2.629      also have "\<dots> \<longleftrightarrow> ?a* (- ?s / ((1 + 1)*?d))+ ?r <= 0" by (simp add: r[of "- (?s / ((1 + 1)*?d))"])
   2.630      also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a* (- ?s / ((1 + 1)*?d))+ ?r) <= 0"
   2.631        using d mult_le_cancel_left[of "(1 + 1) * ?d" "?a* (- ?s / ((1 + 1)*?d))+ ?r" 0] d' d'' order_less_not_sym[OF d''] by simp
   2.632      also have "\<dots> \<longleftrightarrow> - ?a*?s+  (1 + 1)*?d *?r <= 0" 
   2.633        using nonzero_mult_divide_cancel_left[OF d'] d
   2.634 -      by (simp add: ring_simps diff_divide_distrib less_le del: left_distrib)
   2.635 +      by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib)
   2.636      finally have ?thesis using c d nc nd 
   2.637 -      apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstle_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm)
   2.638 +      apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm)
   2.639        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.640        using d order_less_not_sym[OF d] less_imp_neq[OF d]
   2.641 -      by (simp add: ring_simps )  }
   2.642 +      by (simp add: field_simps )  }
   2.643    moreover
   2.644    {assume c: "?c = 0" and d: "?d<0"  hence d': "(1 + 1)*?d \<noteq> 0" by simp
   2.645      from d have d'': "(1 + 1)*?d < 0" by (simp add: mult_less_0_iff)
   2.646 -    from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)"  by (simp add: ring_simps)
   2.647 +    from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)"  by (simp add: field_simps)
   2.648      have "?rhs \<longleftrightarrow> Ifm vs (- ?s / ((1 + 1)*?d) # bs) (Le (CNP 0 a r))" by (simp only: th)
   2.649      also have "\<dots> \<longleftrightarrow> ?a* (- ?s / ((1 + 1)*?d))+ ?r <= 0" by (simp add: r[of "- (?s / ((1 + 1)*?d))"])
   2.650      also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a* (- ?s / ((1 + 1)*?d))+ ?r) >= 0"
   2.651        using d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' mult_le_cancel_left[of "(1 + 1) * ?d" 0 "?a* (- ?s / ((1 + 1)*?d))+ ?r"] by simp
   2.652      also have "\<dots> \<longleftrightarrow> ?a*?s -  (1 + 1)*?d *?r <= 0" 
   2.653        using nonzero_mult_divide_cancel_left[OF d'] d order_less_not_sym[OF d''] less_imp_neq[OF d''] d''
   2.654 -        by (simp add: ring_simps diff_divide_distrib del:  left_distrib)
   2.655 +        by (simp add: algebra_simps diff_divide_distrib del:  left_distrib)
   2.656      finally have ?thesis using c d nc nd 
   2.657 -      apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstle_def Let_def evaldjf_ex ring_simps lt polyneg_norm polymul_norm)
   2.658 +      apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm)
   2.659        apply (simp only: one_add_one_is_two[symmetric] of_int_add)
   2.660        using d order_less_not_sym[OF d] less_imp_neq[OF d]
   2.661 -      by (simp add: ring_simps )    }
   2.662 +      by (simp add: field_simps )    }
   2.663  ultimately show ?thesis by blast
   2.664  qed
   2.665  
   2.666 @@ -2519,7 +2519,7 @@
   2.667  lemma remdps_set[simp]: "set (remdps xs) = set xs"
   2.668    by (induct xs rule: remdps.induct, auto)
   2.669  
   2.670 -lemma simpfm_lin:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})"
   2.671 +lemma simpfm_lin:   assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})"
   2.672    shows "qfree p \<Longrightarrow> islin (simpfm p)"
   2.673    by (induct p rule: simpfm.induct, auto simp add: conj_lin disj_lin)
   2.674  
   2.675 @@ -2551,7 +2551,7 @@
   2.676    {fix c t d s assume ctU: "(c,t) \<in> set ?U" and dsU: "(d,s) \<in> set ?U"
   2.677      from U_l ctU dsU have norm: "isnpoly c" "isnpoly d" by auto
   2.678      from msubst_I[OF lq norm, of vs x bs t s] msubst_I[OF lq norm(2,1), of vs x bs s t]
   2.679 -    have "?I (msubst ?q ((c,t),(d,s))) = ?I (msubst ?q ((d,s),(c,t)))" by (simp add: ring_simps)}
   2.680 +    have "?I (msubst ?q ((c,t),(d,s))) = ?I (msubst ?q ((d,s),(c,t)))" by (simp add: field_simps)}
   2.681    hence th0: "\<forall>x \<in> set ?U. \<forall>y \<in> set ?U. ?I (msubst ?q (x, y)) \<longleftrightarrow> ?I (msubst ?q (y, x))" by clarsimp
   2.682    {fix x assume xUp: "x \<in> set ?Up" 
   2.683      then  obtain c t d s where ctU: "(c,t) \<in> set ?U" and dsU: "(d,s) \<in> set ?U" 
   2.684 @@ -2616,7 +2616,7 @@
   2.685      let ?s = "Itm vs (x # bs) s"
   2.686      let ?t = "Itm vs (x # bs) t"
   2.687      have eq2: "\<And>(x::'a). x + x = (1 + 1) * x"
   2.688 -      by  (simp add: ring_simps)
   2.689 +      by  (simp add: field_simps)
   2.690      {assume "?c = 0 \<and> ?d = 0"
   2.691        with ct have ?D by simp}
   2.692      moreover
   2.693 @@ -2747,12 +2747,12 @@
   2.694  using lp tnb
   2.695  by (induct p c t rule: msubstpos.induct, auto simp add: msubsteq2_nb msubstltpos_nb msubstlepos_nb)
   2.696  
   2.697 -lemma msubstneg_nb: assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})" and lp: "islin p" and tnb: "tmbound0 t"
   2.698 +lemma msubstneg_nb: assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})" and lp: "islin p" and tnb: "tmbound0 t"
   2.699    shows "bound0 (msubstneg p c t)"
   2.700  using lp tnb
   2.701  by (induct p c t rule: msubstneg.induct, auto simp add: msubsteq2_nb msubstltneg_nb msubstleneg_nb)
   2.702  
   2.703 -lemma msubst2_nb: assumes "SORT_CONSTRAINT('a::{ring_char_0,division_by_zero,field})" and lp: "islin p" and tnb: "tmbound0 t"
   2.704 +lemma msubst2_nb: assumes "SORT_CONSTRAINT('a::{ring_char_0,division_ring_inverse_zero,field})" and lp: "islin p" and tnb: "tmbound0 t"
   2.705    shows "bound0 (msubst2 p c t)"
   2.706  using lp tnb
   2.707  by (simp add: msubst2_def msubstneg_nb msubstpos_nb conj_nb disj_nb lt_nb simpfm_bound0)
   2.708 @@ -2899,14 +2899,14 @@
   2.709          by (auto simp add: msubst2_def lt[OF stupid(3)] lt[OF stupid(1)] mult_less_0_iff zero_less_mult_iff)
   2.710        from msubst2[OF lq norm2(1) z(1), of x bs] 
   2.711          msubst2[OF lq norm2(2) z(2), of x bs] H 
   2.712 -      show ?rhs by (simp add: ring_simps)
   2.713 +      show ?rhs by (simp add: field_simps)
   2.714      next
   2.715        assume H: ?rhs
   2.716        hence z: "\<lparr>C (-2, 1) *\<^sub>p b *\<^sub>p d\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>C (-2, 1) *\<^sub>p d *\<^sub>p b\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" 
   2.717          by (auto simp add: msubst2_def lt[OF stupid(4)] lt[OF stupid(2)] mult_less_0_iff zero_less_mult_iff)
   2.718        from msubst2[OF lq norm2(1) z(1), of x bs] 
   2.719          msubst2[OF lq norm2(2) z(2), of x bs] H 
   2.720 -      show ?lhs by (simp add: ring_simps)
   2.721 +      show ?lhs by (simp add: field_simps)
   2.722      qed}
   2.723    hence th0: "\<forall>x \<in> set ?U. \<forall>y \<in> set ?U. ?I (?s (x, y)) \<longleftrightarrow> ?I (?s (y, x))"
   2.724      by clarsimp
   2.725 @@ -3156,54 +3156,54 @@
   2.726  *} "Parametric QE for linear Arithmetic over fields, Version 2"
   2.727  
   2.728  
   2.729 -lemma "\<exists>(x::'a::{division_by_zero,linordered_field,number_ring}). y \<noteq> -1 \<longrightarrow> (y + 1)*x < 0"
   2.730 -  apply (frpar type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "y::'a::{division_by_zero,linordered_field,number_ring}")
   2.731 -  apply (simp add: ring_simps)
   2.732 +lemma "\<exists>(x::'a::{linordered_field, division_ring_inverse_zero, number_ring}). y \<noteq> -1 \<longrightarrow> (y + 1)*x < 0"
   2.733 +  apply (frpar type: "'a::{linordered_field, division_ring_inverse_zero, number_ring}" pars: "y::'a::{linordered_field, division_ring_inverse_zero, number_ring}")
   2.734 +  apply (simp add: field_simps)
   2.735    apply (rule spec[where x=y])
   2.736 -  apply (frpar type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "z::'a::{division_by_zero,linordered_field,number_ring}")
   2.737 +  apply (frpar type: "'a::{linordered_field, division_ring_inverse_zero, number_ring}" pars: "z::'a::{linordered_field, division_ring_inverse_zero, number_ring}")
   2.738    by simp
   2.739  
   2.740  text{* Collins/Jones Problem *}
   2.741  (*
   2.742 -lemma "\<exists>(r::'a::{division_by_zero,linordered_field,number_ring}). 0 < r \<and> r < 1 \<and> 0 < (2 - 3*r) *(a^2 + b^2) + (2*a)*r \<and> (2 - 3*r) *(a^2 + b^2) + 4*a*r - 2*a - r < 0"
   2.743 +lemma "\<exists>(r::'a::{linordered_field, division_ring_inverse_zero, number_ring}). 0 < r \<and> r < 1 \<and> 0 < (2 - 3*r) *(a^2 + b^2) + (2*a)*r \<and> (2 - 3*r) *(a^2 + b^2) + 4*a*r - 2*a - r < 0"
   2.744  proof-
   2.745 -  have "(\<exists>(r::'a::{division_by_zero,linordered_field,number_ring}). 0 < r \<and> r < 1 \<and> 0 < (2 - 3*r) *(a^2 + b^2) + (2*a)*r \<and> (2 - 3*r) *(a^2 + b^2) + 4*a*r - 2*a - r < 0) \<longleftrightarrow> (\<exists>(r::'a::{division_by_zero,linordered_field,number_ring}). 0 < r \<and> r < 1 \<and> 0 < 2 *(a^2 + b^2) - (3*(a^2 + b^2)) * r + (2*a)*r \<and> 2*(a^2 + b^2) - (3*(a^2 + b^2) - 4*a + 1)*r - 2*a < 0)" (is "?lhs \<longleftrightarrow> ?rhs")
   2.746 -by (simp add: ring_simps)
   2.747 +  have "(\<exists>(r::'a::{linordered_field, division_ring_inverse_zero, number_ring}). 0 < r \<and> r < 1 \<and> 0 < (2 - 3*r) *(a^2 + b^2) + (2*a)*r \<and> (2 - 3*r) *(a^2 + b^2) + 4*a*r - 2*a - r < 0) \<longleftrightarrow> (\<exists>(r::'a::{linordered_field, division_ring_inverse_zero, number_ring}). 0 < r \<and> r < 1 \<and> 0 < 2 *(a^2 + b^2) - (3*(a^2 + b^2)) * r + (2*a)*r \<and> 2*(a^2 + b^2) - (3*(a^2 + b^2) - 4*a + 1)*r - 2*a < 0)" (is "?lhs \<longleftrightarrow> ?rhs")
   2.748 +by (simp add: field_simps)
   2.749  have "?rhs"
   2.750  
   2.751 -  apply (frpar type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "a::'a::{division_by_zero,linordered_field,number_ring}" "b::'a::{division_by_zero,linordered_field,number_ring}")
   2.752 -  apply (simp add: ring_simps)
   2.753 +  apply (frpar type: "'a::{linordered_field, division_ring_inverse_zero, number_ring}" pars: "a::'a::{linordered_field, division_ring_inverse_zero, number_ring}" "b::'a::{linordered_field, division_ring_inverse_zero, number_ring}")
   2.754 +  apply (simp add: field_simps)
   2.755  oops
   2.756  *)
   2.757  (*
   2.758 -lemma "ALL (x::'a::{division_by_zero,linordered_field,number_ring}) y. (1 - t)*x \<le> (1+t)*y \<and> (1 - t)*y \<le> (1+t)*x --> 0 \<le> y"
   2.759 -apply (frpar type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "t::'a::{division_by_zero,linordered_field,number_ring}")
   2.760 +lemma "ALL (x::'a::{linordered_field, division_ring_inverse_zero, number_ring}) y. (1 - t)*x \<le> (1+t)*y \<and> (1 - t)*y \<le> (1+t)*x --> 0 \<le> y"
   2.761 +apply (frpar type: "'a::{linordered_field, division_ring_inverse_zero, number_ring}" pars: "t::'a::{linordered_field, division_ring_inverse_zero, number_ring}")
   2.762  oops
   2.763  *)
   2.764  
   2.765 -lemma "\<exists>(x::'a::{division_by_zero,linordered_field,number_ring}). y \<noteq> -1 \<longrightarrow> (y + 1)*x < 0"
   2.766 -  apply (frpar2 type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "y::'a::{division_by_zero,linordered_field,number_ring}")
   2.767 -  apply (simp add: ring_simps)
   2.768 +lemma "\<exists>(x::'a::{linordered_field, division_ring_inverse_zero, number_ring}). y \<noteq> -1 \<longrightarrow> (y + 1)*x < 0"
   2.769 +  apply (frpar2 type: "'a::{linordered_field, division_ring_inverse_zero, number_ring}" pars: "y::'a::{linordered_field, division_ring_inverse_zero, number_ring}")
   2.770 +  apply (simp add: field_simps)
   2.771    apply (rule spec[where x=y])
   2.772 -  apply (frpar2 type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "z::'a::{division_by_zero,linordered_field,number_ring}")
   2.773 +  apply (frpar2 type: "'a::{linordered_field, division_ring_inverse_zero, number_ring}" pars: "z::'a::{linordered_field, division_ring_inverse_zero, number_ring}")
   2.774    by simp
   2.775  
   2.776  text{* Collins/Jones Problem *}
   2.777  
   2.778  (*
   2.779 -lemma "\<exists>(r::'a::{division_by_zero,linordered_field,number_ring}). 0 < r \<and> r < 1 \<and> 0 < (2 - 3*r) *(a^2 + b^2) + (2*a)*r \<and> (2 - 3*r) *(a^2 + b^2) + 4*a*r - 2*a - r < 0"
   2.780 +lemma "\<exists>(r::'a::{linordered_field, division_ring_inverse_zero, number_ring}). 0 < r \<and> r < 1 \<and> 0 < (2 - 3*r) *(a^2 + b^2) + (2*a)*r \<and> (2 - 3*r) *(a^2 + b^2) + 4*a*r - 2*a - r < 0"
   2.781  proof-
   2.782 -  have "(\<exists>(r::'a::{division_by_zero,linordered_field,number_ring}). 0 < r \<and> r < 1 \<and> 0 < (2 - 3*r) *(a^2 + b^2) + (2*a)*r \<and> (2 - 3*r) *(a^2 + b^2) + 4*a*r - 2*a - r < 0) \<longleftrightarrow> (\<exists>(r::'a::{division_by_zero,linordered_field,number_ring}). 0 < r \<and> r < 1 \<and> 0 < 2 *(a^2 + b^2) - (3*(a^2 + b^2)) * r + (2*a)*r \<and> 2*(a^2 + b^2) - (3*(a^2 + b^2) - 4*a + 1)*r - 2*a < 0)" (is "?lhs \<longleftrightarrow> ?rhs")
   2.783 -by (simp add: ring_simps)
   2.784 +  have "(\<exists>(r::'a::{linordered_field, division_ring_inverse_zero, number_ring}). 0 < r \<and> r < 1 \<and> 0 < (2 - 3*r) *(a^2 + b^2) + (2*a)*r \<and> (2 - 3*r) *(a^2 + b^2) + 4*a*r - 2*a - r < 0) \<longleftrightarrow> (\<exists>(r::'a::{linordered_field, division_ring_inverse_zero, number_ring}). 0 < r \<and> r < 1 \<and> 0 < 2 *(a^2 + b^2) - (3*(a^2 + b^2)) * r + (2*a)*r \<and> 2*(a^2 + b^2) - (3*(a^2 + b^2) - 4*a + 1)*r - 2*a < 0)" (is "?lhs \<longleftrightarrow> ?rhs")
   2.785 +by (simp add: field_simps)
   2.786  have "?rhs"
   2.787 -  apply (frpar2 type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "a::'a::{division_by_zero,linordered_field,number_ring}" "b::'a::{division_by_zero,linordered_field,number_ring}")
   2.788 +  apply (frpar2 type: "'a::{linordered_field, division_ring_inverse_zero, number_ring}" pars: "a::'a::{linordered_field, division_ring_inverse_zero, number_ring}" "b::'a::{linordered_field, division_ring_inverse_zero, number_ring}")
   2.789    apply simp
   2.790  oops
   2.791  *)
   2.792  
   2.793  (*
   2.794 -lemma "ALL (x::'a::{division_by_zero,linordered_field,number_ring}) y. (1 - t)*x \<le> (1+t)*y \<and> (1 - t)*y \<le> (1+t)*x --> 0 \<le> y"
   2.795 -apply (frpar2 type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "t::'a::{division_by_zero,linordered_field,number_ring}")
   2.796 +lemma "ALL (x::'a::{linordered_field, division_ring_inverse_zero, number_ring}) y. (1 - t)*x \<le> (1+t)*y \<and> (1 - t)*y \<le> (1+t)*x --> 0 \<le> y"
   2.797 +apply (frpar2 type: "'a::{linordered_field, division_ring_inverse_zero, number_ring}" pars: "t::'a::{linordered_field, division_ring_inverse_zero, number_ring}")
   2.798  apply (simp add: field_simps linorder_neq_iff[symmetric])
   2.799  apply ferrack
   2.800  oops
     3.1 --- a/src/HOL/Fields.thy	Mon Apr 26 11:34:15 2010 +0200
     3.2 +++ b/src/HOL/Fields.thy	Mon Apr 26 11:34:15 2010 +0200
     3.3 @@ -13,20 +13,6 @@
     3.4  imports Rings
     3.5  begin
     3.6  
     3.7 -text{* Lemmas @{text field_simps} multiply with denominators in (in)equations
     3.8 -if they can be proved to be non-zero (for equations) or positive/negative
     3.9 -(for inequations). Can be too aggressive and is therefore separate from the
    3.10 -more benign @{text algebra_simps}. *}
    3.11 -
    3.12 -ML {*
    3.13 -structure Field_Simps = Named_Thms(
    3.14 -  val name = "field_simps"
    3.15 -  val description = "algebra simplification rules for fields"
    3.16 -)
    3.17 -*}
    3.18 -
    3.19 -setup Field_Simps.setup
    3.20 -
    3.21  class field = comm_ring_1 + inverse +
    3.22    assumes field_inverse: "a \<noteq> 0 \<Longrightarrow> inverse a * a = 1"
    3.23    assumes field_divide_inverse: "a / b = a * inverse b"
    3.24 @@ -110,51 +96,45 @@
    3.25    "\<lbrakk>b \<noteq> 0; c \<noteq> 0\<rbrakk> \<Longrightarrow> (a * c) / (c * b) = a / b"
    3.26  using nonzero_mult_divide_mult_cancel_right [of b c a] by (simp add: mult_ac)
    3.27  
    3.28 -lemma add_divide_eq_iff:
    3.29 +lemma add_divide_eq_iff [field_simps]:
    3.30    "z \<noteq> 0 \<Longrightarrow> x + y / z = (z * x + y) / z"
    3.31    by (simp add: add_divide_distrib)
    3.32  
    3.33 -lemma divide_add_eq_iff:
    3.34 +lemma divide_add_eq_iff [field_simps]:
    3.35    "z \<noteq> 0 \<Longrightarrow> x / z + y = (x + z * y) / z"
    3.36    by (simp add: add_divide_distrib)
    3.37  
    3.38 -lemma diff_divide_eq_iff:
    3.39 +lemma diff_divide_eq_iff [field_simps]:
    3.40    "z \<noteq> 0 \<Longrightarrow> x - y / z = (z * x - y) / z"
    3.41    by (simp add: diff_divide_distrib)
    3.42  
    3.43 -lemma divide_diff_eq_iff:
    3.44 +lemma divide_diff_eq_iff [field_simps]:
    3.45    "z \<noteq> 0 \<Longrightarrow> x / z - y = (x - z * y) / z"
    3.46    by (simp add: diff_divide_distrib)
    3.47  
    3.48 -lemmas field_eq_simps [field_simps, no_atp] = algebra_simps
    3.49 -  (* pull / out*)
    3.50 -  add_divide_eq_iff divide_add_eq_iff
    3.51 -  diff_divide_eq_iff divide_diff_eq_iff
    3.52 -  (* multiply eqn *)
    3.53 -  nonzero_eq_divide_eq nonzero_divide_eq_eq
    3.54 -  times_divide_eq_left times_divide_eq_right
    3.55 -
    3.56 -text{*An example:*}
    3.57 -lemma "\<lbrakk>a\<noteq>b; c\<noteq>d; e\<noteq>f\<rbrakk> \<Longrightarrow> ((a-b)*(c-d)*(e-f))/((c-d)*(e-f)*(a-b)) = 1"
    3.58 -apply(subgoal_tac "(c-d)*(e-f)*(a-b) \<noteq> 0")
    3.59 - apply(simp add:field_eq_simps)
    3.60 -apply(simp)
    3.61 -done
    3.62 -
    3.63  lemma diff_frac_eq:
    3.64    "y \<noteq> 0 \<Longrightarrow> z \<noteq> 0 \<Longrightarrow> x / y - w / z = (x * z - w * y) / (y * z)"
    3.65 -  by (simp add: field_eq_simps times_divide_eq)
    3.66 +  by (simp add: field_simps)
    3.67  
    3.68  lemma frac_eq_eq:
    3.69    "y \<noteq> 0 \<Longrightarrow> z \<noteq> 0 \<Longrightarrow> (x / y = w / z) = (x * z = w * y)"
    3.70 -  by (simp add: field_eq_simps times_divide_eq)
    3.71 +  by (simp add: field_simps)
    3.72 +
    3.73 +end
    3.74 +
    3.75 +class field_inverse_zero = field +
    3.76 +  assumes field_inverse_zero: "inverse 0 = 0"
    3.77 +begin
    3.78 +
    3.79 +subclass division_ring_inverse_zero proof
    3.80 +qed (fact field_inverse_zero)
    3.81  
    3.82  end
    3.83  
    3.84  text{*This version builds in division by zero while also re-orienting
    3.85        the right-hand side.*}
    3.86  lemma inverse_mult_distrib [simp]:
    3.87 -     "inverse(a*b) = inverse(a) * inverse(b::'a::{field,division_by_zero})"
    3.88 +     "inverse(a*b) = inverse(a) * inverse(b::'a::{field,division_ring_inverse_zero})"
    3.89    proof cases
    3.90      assume "a \<noteq> 0 & b \<noteq> 0" 
    3.91      thus ?thesis by (simp add: nonzero_inverse_mult_distrib mult_ac)
    3.92 @@ -164,7 +144,7 @@
    3.93    qed
    3.94  
    3.95  lemma inverse_divide [simp]:
    3.96 -  "inverse (a/b) = b / (a::'a::{field,division_by_zero})"
    3.97 +  "inverse (a/b) = b / (a::'a::{field,division_ring_inverse_zero})"
    3.98    by (simp add: divide_inverse mult_commute)
    3.99  
   3.100  
   3.101 @@ -175,85 +155,85 @@
   3.102  because the latter are covered by a simproc. *}
   3.103  
   3.104  lemma mult_divide_mult_cancel_left:
   3.105 -  "c\<noteq>0 ==> (c*a) / (c*b) = a / (b::'a::{field,division_by_zero})"
   3.106 +  "c\<noteq>0 ==> (c*a) / (c*b) = a / (b::'a::{field,division_ring_inverse_zero})"
   3.107  apply (cases "b = 0")
   3.108  apply simp_all
   3.109  done
   3.110  
   3.111  lemma mult_divide_mult_cancel_right:
   3.112 -  "c\<noteq>0 ==> (a*c) / (b*c) = a / (b::'a::{field,division_by_zero})"
   3.113 +  "c\<noteq>0 ==> (a*c) / (b*c) = a / (b::'a::{field,division_ring_inverse_zero})"
   3.114  apply (cases "b = 0")
   3.115  apply simp_all
   3.116  done
   3.117  
   3.118  lemma divide_divide_eq_right [simp,no_atp]:
   3.119 -  "a / (b/c) = (a*c) / (b::'a::{field,division_by_zero})"
   3.120 +  "a / (b/c) = (a*c) / (b::'a::{field,division_ring_inverse_zero})"
   3.121  by (simp add: divide_inverse mult_ac)
   3.122  
   3.123  lemma divide_divide_eq_left [simp,no_atp]:
   3.124 -  "(a / b) / (c::'a::{field,division_by_zero}) = a / (b*c)"
   3.125 +  "(a / b) / (c::'a::{field,division_ring_inverse_zero}) = a / (b*c)"
   3.126  by (simp add: divide_inverse mult_assoc)
   3.127  
   3.128  
   3.129  text {*Special Cancellation Simprules for Division*}
   3.130  
   3.131  lemma mult_divide_mult_cancel_left_if[simp,no_atp]:
   3.132 -fixes c :: "'a :: {field,division_by_zero}"
   3.133 +fixes c :: "'a :: {field,division_ring_inverse_zero}"
   3.134  shows "(c*a) / (c*b) = (if c=0 then 0 else a/b)"
   3.135  by (simp add: mult_divide_mult_cancel_left)
   3.136  
   3.137  
   3.138  text {* Division and Unary Minus *}
   3.139  
   3.140 -lemma minus_divide_right: "- (a/b) = a / -(b::'a::{field,division_by_zero})"
   3.141 +lemma minus_divide_right: "- (a/b) = a / -(b::'a::{field,division_ring_inverse_zero})"
   3.142  by (simp add: divide_inverse)
   3.143  
   3.144  lemma divide_minus_right [simp, no_atp]:
   3.145 -  "a / -(b::'a::{field,division_by_zero}) = -(a / b)"
   3.146 +  "a / -(b::'a::{field,division_ring_inverse_zero}) = -(a / b)"
   3.147  by (simp add: divide_inverse)
   3.148  
   3.149  lemma minus_divide_divide:
   3.150 -  "(-a)/(-b) = a / (b::'a::{field,division_by_zero})"
   3.151 +  "(-a)/(-b) = a / (b::'a::{field,division_ring_inverse_zero})"
   3.152  apply (cases "b=0", simp) 
   3.153  apply (simp add: nonzero_minus_divide_divide) 
   3.154  done
   3.155  
   3.156  lemma eq_divide_eq:
   3.157 -  "((a::'a::{field,division_by_zero}) = b/c) = (if c\<noteq>0 then a*c = b else a=0)"
   3.158 +  "((a::'a::{field,division_ring_inverse_zero}) = b/c) = (if c\<noteq>0 then a*c = b else a=0)"
   3.159  by (simp add: nonzero_eq_divide_eq)
   3.160  
   3.161  lemma divide_eq_eq:
   3.162 -  "(b/c = (a::'a::{field,division_by_zero})) = (if c\<noteq>0 then b = a*c else a=0)"
   3.163 +  "(b/c = (a::'a::{field,division_ring_inverse_zero})) = (if c\<noteq>0 then b = a*c else a=0)"
   3.164  by (force simp add: nonzero_divide_eq_eq)
   3.165  
   3.166  lemma inverse_eq_1_iff [simp]:
   3.167 -  "(inverse x = 1) = (x = (1::'a::{field,division_by_zero}))"
   3.168 +  "(inverse x = 1) = (x = (1::'a::{field,division_ring_inverse_zero}))"
   3.169  by (insert inverse_eq_iff_eq [of x 1], simp) 
   3.170  
   3.171  lemma divide_eq_0_iff [simp,no_atp]:
   3.172 -     "(a/b = 0) = (a=0 | b=(0::'a::{field,division_by_zero}))"
   3.173 +     "(a/b = 0) = (a=0 | b=(0::'a::{field,division_ring_inverse_zero}))"
   3.174  by (simp add: divide_inverse)
   3.175  
   3.176  lemma divide_cancel_right [simp,no_atp]:
   3.177 -     "(a/c = b/c) = (c = 0 | a = (b::'a::{field,division_by_zero}))"
   3.178 +     "(a/c = b/c) = (c = 0 | a = (b::'a::{field,division_ring_inverse_zero}))"
   3.179  apply (cases "c=0", simp)
   3.180  apply (simp add: divide_inverse)
   3.181  done
   3.182  
   3.183  lemma divide_cancel_left [simp,no_atp]:
   3.184 -     "(c/a = c/b) = (c = 0 | a = (b::'a::{field,division_by_zero}))" 
   3.185 +     "(c/a = c/b) = (c = 0 | a = (b::'a::{field,division_ring_inverse_zero}))" 
   3.186  apply (cases "c=0", simp)
   3.187  apply (simp add: divide_inverse)
   3.188  done
   3.189  
   3.190  lemma divide_eq_1_iff [simp,no_atp]:
   3.191 -     "(a/b = 1) = (b \<noteq> 0 & a = (b::'a::{field,division_by_zero}))"
   3.192 +     "(a/b = 1) = (b \<noteq> 0 & a = (b::'a::{field,division_ring_inverse_zero}))"
   3.193  apply (cases "b=0", simp)
   3.194  apply (simp add: right_inverse_eq)
   3.195  done
   3.196  
   3.197  lemma one_eq_divide_iff [simp,no_atp]:
   3.198 -     "(1 = a/b) = (b \<noteq> 0 & a = (b::'a::{field,division_by_zero}))"
   3.199 +     "(1 = a/b) = (b \<noteq> 0 & a = (b::'a::{field,division_ring_inverse_zero}))"
   3.200  by (simp add: eq_commute [of 1])
   3.201  
   3.202  
   3.203 @@ -405,7 +385,7 @@
   3.204    "a < 0 \<Longrightarrow> b < 0 \<Longrightarrow> inverse a \<le> inverse b \<longleftrightarrow> b \<le> a"
   3.205    by (blast intro: le_imp_inverse_le_neg dest: inverse_le_imp_le_neg) 
   3.206  
   3.207 -lemma pos_le_divide_eq: "0 < c ==> (a \<le> b/c) = (a*c \<le> b)"
   3.208 +lemma pos_le_divide_eq [field_simps]: "0 < c ==> (a \<le> b/c) = (a*c \<le> b)"
   3.209  proof -
   3.210    assume less: "0<c"
   3.211    hence "(a \<le> b/c) = (a*c \<le> (b/c)*c)"
   3.212 @@ -415,7 +395,7 @@
   3.213    finally show ?thesis .
   3.214  qed
   3.215  
   3.216 -lemma neg_le_divide_eq: "c < 0 ==> (a \<le> b/c) = (b \<le> a*c)"
   3.217 +lemma neg_le_divide_eq [field_simps]: "c < 0 ==> (a \<le> b/c) = (b \<le> a*c)"
   3.218  proof -
   3.219    assume less: "c<0"
   3.220    hence "(a \<le> b/c) = ((b/c)*c \<le> a*c)"
   3.221 @@ -425,7 +405,7 @@
   3.222    finally show ?thesis .
   3.223  qed
   3.224  
   3.225 -lemma pos_less_divide_eq:
   3.226 +lemma pos_less_divide_eq [field_simps]:
   3.227       "0 < c ==> (a < b/c) = (a*c < b)"
   3.228  proof -
   3.229    assume less: "0<c"
   3.230 @@ -436,7 +416,7 @@
   3.231    finally show ?thesis .
   3.232  qed
   3.233  
   3.234 -lemma neg_less_divide_eq:
   3.235 +lemma neg_less_divide_eq [field_simps]:
   3.236   "c < 0 ==> (a < b/c) = (b < a*c)"
   3.237  proof -
   3.238    assume less: "c<0"
   3.239 @@ -447,7 +427,7 @@
   3.240    finally show ?thesis .
   3.241  qed
   3.242  
   3.243 -lemma pos_divide_less_eq:
   3.244 +lemma pos_divide_less_eq [field_simps]:
   3.245       "0 < c ==> (b/c < a) = (b < a*c)"
   3.246  proof -
   3.247    assume less: "0<c"
   3.248 @@ -458,7 +438,7 @@
   3.249    finally show ?thesis .
   3.250  qed
   3.251  
   3.252 -lemma neg_divide_less_eq:
   3.253 +lemma neg_divide_less_eq [field_simps]:
   3.254   "c < 0 ==> (b/c < a) = (a*c < b)"
   3.255  proof -
   3.256    assume less: "c<0"
   3.257 @@ -469,7 +449,7 @@
   3.258    finally show ?thesis .
   3.259  qed
   3.260  
   3.261 -lemma pos_divide_le_eq: "0 < c ==> (b/c \<le> a) = (b \<le> a*c)"
   3.262 +lemma pos_divide_le_eq [field_simps]: "0 < c ==> (b/c \<le> a) = (b \<le> a*c)"
   3.263  proof -
   3.264    assume less: "0<c"
   3.265    hence "(b/c \<le> a) = ((b/c)*c \<le> a*c)"
   3.266 @@ -479,7 +459,7 @@
   3.267    finally show ?thesis .
   3.268  qed
   3.269  
   3.270 -lemma neg_divide_le_eq: "c < 0 ==> (b/c \<le> a) = (a*c \<le> b)"
   3.271 +lemma neg_divide_le_eq [field_simps]: "c < 0 ==> (b/c \<le> a) = (a*c \<le> b)"
   3.272  proof -
   3.273    assume less: "c<0"
   3.274    hence "(b/c \<le> a) = (a*c \<le> (b/c)*c)"
   3.275 @@ -489,19 +469,15 @@
   3.276    finally show ?thesis .
   3.277  qed
   3.278  
   3.279 -lemmas [field_simps, no_atp] =
   3.280 -  (* multiply ineqn *)
   3.281 -  pos_divide_less_eq neg_divide_less_eq
   3.282 -  pos_less_divide_eq neg_less_divide_eq
   3.283 -  pos_divide_le_eq neg_divide_le_eq
   3.284 -  pos_le_divide_eq neg_le_divide_eq
   3.285 -
   3.286  text{* Lemmas @{text sign_simps} is a first attempt to automate proofs
   3.287  of positivity/negativity needed for @{text field_simps}. Have not added @{text
   3.288  sign_simps} to @{text field_simps} because the former can lead to case
   3.289  explosions. *}
   3.290  
   3.291 -lemmas sign_simps[no_atp] = group_simps
   3.292 +lemmas sign_simps [no_atp] = algebra_simps
   3.293 +  zero_less_mult_iff mult_less_0_iff
   3.294 +
   3.295 +lemmas (in -) sign_simps [no_atp] = algebra_simps
   3.296    zero_less_mult_iff mult_less_0_iff
   3.297  
   3.298  (* Only works once linear arithmetic is installed:
   3.299 @@ -667,37 +643,46 @@
   3.300  
   3.301  end
   3.302  
   3.303 +class linordered_field_inverse_zero = linordered_field +
   3.304 +  assumes linordered_field_inverse_zero: "inverse 0 = 0"
   3.305 +begin
   3.306 +
   3.307 +subclass field_inverse_zero proof
   3.308 +qed (fact linordered_field_inverse_zero)
   3.309 +
   3.310 +end
   3.311 +
   3.312  lemma le_divide_eq:
   3.313    "(a \<le> b/c) = 
   3.314     (if 0 < c then a*c \<le> b
   3.315               else if c < 0 then b \<le> a*c
   3.316 -             else  a \<le> (0::'a::{linordered_field,division_by_zero}))"
   3.317 +             else  a \<le> (0::'a::{linordered_field,division_ring_inverse_zero}))"
   3.318  apply (cases "c=0", simp) 
   3.319  apply (force simp add: pos_le_divide_eq neg_le_divide_eq linorder_neq_iff) 
   3.320  done
   3.321  
   3.322  lemma inverse_positive_iff_positive [simp]:
   3.323 -  "(0 < inverse a) = (0 < (a::'a::{linordered_field,division_by_zero}))"
   3.324 +  "(0 < inverse a) = (0 < (a::'a::{linordered_field,division_ring_inverse_zero}))"
   3.325  apply (cases "a = 0", simp)
   3.326  apply (blast intro: inverse_positive_imp_positive positive_imp_inverse_positive)
   3.327  done
   3.328  
   3.329  lemma inverse_negative_iff_negative [simp]:
   3.330 -  "(inverse a < 0) = (a < (0::'a::{linordered_field,division_by_zero}))"
   3.331 +  "(inverse a < 0) = (a < (0::'a::{linordered_field,division_ring_inverse_zero}))"
   3.332  apply (cases "a = 0", simp)
   3.333  apply (blast intro: inverse_negative_imp_negative negative_imp_inverse_negative)
   3.334  done
   3.335  
   3.336  lemma inverse_nonnegative_iff_nonnegative [simp]:
   3.337 -  "(0 \<le> inverse a) = (0 \<le> (a::'a::{linordered_field,division_by_zero}))"
   3.338 +  "(0 \<le> inverse a) = (0 \<le> (a::'a::{linordered_field,division_ring_inverse_zero}))"
   3.339  by (simp add: linorder_not_less [symmetric])
   3.340  
   3.341  lemma inverse_nonpositive_iff_nonpositive [simp]:
   3.342 -  "(inverse a \<le> 0) = (a \<le> (0::'a::{linordered_field,division_by_zero}))"
   3.343 +  "(inverse a \<le> 0) = (a \<le> (0::'a::{linordered_field,division_ring_inverse_zero}))"
   3.344  by (simp add: linorder_not_less [symmetric])
   3.345  
   3.346  lemma one_less_inverse_iff:
   3.347 -  "(1 < inverse x) = (0 < x & x < (1::'a::{linordered_field,division_by_zero}))"
   3.348 +  "(1 < inverse x) = (0 < x & x < (1::'a::{linordered_field,division_ring_inverse_zero}))"
   3.349  proof cases
   3.350    assume "0 < x"
   3.351      with inverse_less_iff_less [OF zero_less_one, of x]
   3.352 @@ -715,22 +700,22 @@
   3.353  qed
   3.354  
   3.355  lemma one_le_inverse_iff:
   3.356 -  "(1 \<le> inverse x) = (0 < x & x \<le> (1::'a::{linordered_field,division_by_zero}))"
   3.357 +  "(1 \<le> inverse x) = (0 < x & x \<le> (1::'a::{linordered_field,division_ring_inverse_zero}))"
   3.358  by (force simp add: order_le_less one_less_inverse_iff)
   3.359  
   3.360  lemma inverse_less_1_iff:
   3.361 -  "(inverse x < 1) = (x \<le> 0 | 1 < (x::'a::{linordered_field,division_by_zero}))"
   3.362 +  "(inverse x < 1) = (x \<le> 0 | 1 < (x::'a::{linordered_field,division_ring_inverse_zero}))"
   3.363  by (simp add: linorder_not_le [symmetric] one_le_inverse_iff) 
   3.364  
   3.365  lemma inverse_le_1_iff:
   3.366 -  "(inverse x \<le> 1) = (x \<le> 0 | 1 \<le> (x::'a::{linordered_field,division_by_zero}))"
   3.367 +  "(inverse x \<le> 1) = (x \<le> 0 | 1 \<le> (x::'a::{linordered_field,division_ring_inverse_zero}))"
   3.368  by (simp add: linorder_not_less [symmetric] one_less_inverse_iff) 
   3.369  
   3.370  lemma divide_le_eq:
   3.371    "(b/c \<le> a) = 
   3.372     (if 0 < c then b \<le> a*c
   3.373               else if c < 0 then a*c \<le> b
   3.374 -             else 0 \<le> (a::'a::{linordered_field,division_by_zero}))"
   3.375 +             else 0 \<le> (a::'a::{linordered_field,division_ring_inverse_zero}))"
   3.376  apply (cases "c=0", simp) 
   3.377  apply (force simp add: pos_divide_le_eq neg_divide_le_eq linorder_neq_iff) 
   3.378  done
   3.379 @@ -739,7 +724,7 @@
   3.380    "(a < b/c) = 
   3.381     (if 0 < c then a*c < b
   3.382               else if c < 0 then b < a*c
   3.383 -             else  a < (0::'a::{linordered_field,division_by_zero}))"
   3.384 +             else  a < (0::'a::{linordered_field,division_ring_inverse_zero}))"
   3.385  apply (cases "c=0", simp) 
   3.386  apply (force simp add: pos_less_divide_eq neg_less_divide_eq linorder_neq_iff) 
   3.387  done
   3.388 @@ -748,7 +733,7 @@
   3.389    "(b/c < a) = 
   3.390     (if 0 < c then b < a*c
   3.391               else if c < 0 then a*c < b
   3.392 -             else 0 < (a::'a::{linordered_field,division_by_zero}))"
   3.393 +             else 0 < (a::'a::{linordered_field,division_ring_inverse_zero}))"
   3.394  apply (cases "c=0", simp) 
   3.395  apply (force simp add: pos_divide_less_eq neg_divide_less_eq linorder_neq_iff) 
   3.396  done
   3.397 @@ -756,21 +741,21 @@
   3.398  text {*Division and Signs*}
   3.399  
   3.400  lemma zero_less_divide_iff:
   3.401 -     "((0::'a::{linordered_field,division_by_zero}) < a/b) = (0 < a & 0 < b | a < 0 & b < 0)"
   3.402 +     "((0::'a::{linordered_field,division_ring_inverse_zero}) < a/b) = (0 < a & 0 < b | a < 0 & b < 0)"
   3.403  by (simp add: divide_inverse zero_less_mult_iff)
   3.404  
   3.405  lemma divide_less_0_iff:
   3.406 -     "(a/b < (0::'a::{linordered_field,division_by_zero})) = 
   3.407 +     "(a/b < (0::'a::{linordered_field,division_ring_inverse_zero})) = 
   3.408        (0 < a & b < 0 | a < 0 & 0 < b)"
   3.409  by (simp add: divide_inverse mult_less_0_iff)
   3.410  
   3.411  lemma zero_le_divide_iff:
   3.412 -     "((0::'a::{linordered_field,division_by_zero}) \<le> a/b) =
   3.413 +     "((0::'a::{linordered_field,division_ring_inverse_zero}) \<le> a/b) =
   3.414        (0 \<le> a & 0 \<le> b | a \<le> 0 & b \<le> 0)"
   3.415  by (simp add: divide_inverse zero_le_mult_iff)
   3.416  
   3.417  lemma divide_le_0_iff:
   3.418 -     "(a/b \<le> (0::'a::{linordered_field,division_by_zero})) =
   3.419 +     "(a/b \<le> (0::'a::{linordered_field,division_ring_inverse_zero})) =
   3.420        (0 \<le> a & b \<le> 0 | a \<le> 0 & 0 \<le> b)"
   3.421  by (simp add: divide_inverse mult_le_0_iff)
   3.422  
   3.423 @@ -779,13 +764,13 @@
   3.424  text{*Simplify expressions equated with 1*}
   3.425  
   3.426  lemma zero_eq_1_divide_iff [simp,no_atp]:
   3.427 -     "((0::'a::{linordered_field,division_by_zero}) = 1/a) = (a = 0)"
   3.428 +     "((0::'a::{linordered_field,division_ring_inverse_zero}) = 1/a) = (a = 0)"
   3.429  apply (cases "a=0", simp)
   3.430  apply (auto simp add: nonzero_eq_divide_eq)
   3.431  done
   3.432  
   3.433  lemma one_divide_eq_0_iff [simp,no_atp]:
   3.434 -     "(1/a = (0::'a::{linordered_field,division_by_zero})) = (a = 0)"
   3.435 +     "(1/a = (0::'a::{linordered_field,division_ring_inverse_zero})) = (a = 0)"
   3.436  apply (cases "a=0", simp)
   3.437  apply (insert zero_neq_one [THEN not_sym])
   3.438  apply (auto simp add: nonzero_divide_eq_eq)
   3.439 @@ -803,16 +788,16 @@
   3.440  declare divide_le_0_1_iff [simp,no_atp]
   3.441  
   3.442  lemma divide_right_mono:
   3.443 -     "[|a \<le> b; 0 \<le> c|] ==> a/c \<le> b/(c::'a::{linordered_field,division_by_zero})"
   3.444 +     "[|a \<le> b; 0 \<le> c|] ==> a/c \<le> b/(c::'a::{linordered_field,division_ring_inverse_zero})"
   3.445  by (force simp add: divide_strict_right_mono order_le_less)
   3.446  
   3.447 -lemma divide_right_mono_neg: "(a::'a::{linordered_field,division_by_zero}) <= b 
   3.448 +lemma divide_right_mono_neg: "(a::'a::{linordered_field,division_ring_inverse_zero}) <= b 
   3.449      ==> c <= 0 ==> b / c <= a / c"
   3.450  apply (drule divide_right_mono [of _ _ "- c"])
   3.451  apply auto
   3.452  done
   3.453  
   3.454 -lemma divide_left_mono_neg: "(a::'a::{linordered_field,division_by_zero}) <= b 
   3.455 +lemma divide_left_mono_neg: "(a::'a::{linordered_field,division_ring_inverse_zero}) <= b 
   3.456      ==> c <= 0 ==> 0 < a * b ==> c / a <= c / b"
   3.457    apply (drule divide_left_mono [of _ _ "- c"])
   3.458    apply (auto simp add: mult_commute)
   3.459 @@ -823,22 +808,22 @@
   3.460  text{*Simplify quotients that are compared with the value 1.*}
   3.461  
   3.462  lemma le_divide_eq_1 [no_atp]:
   3.463 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.464 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.465    shows "(1 \<le> b / a) = ((0 < a & a \<le> b) | (a < 0 & b \<le> a))"
   3.466  by (auto simp add: le_divide_eq)
   3.467  
   3.468  lemma divide_le_eq_1 [no_atp]:
   3.469 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.470 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.471    shows "(b / a \<le> 1) = ((0 < a & b \<le> a) | (a < 0 & a \<le> b) | a=0)"
   3.472  by (auto simp add: divide_le_eq)
   3.473  
   3.474  lemma less_divide_eq_1 [no_atp]:
   3.475 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.476 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.477    shows "(1 < b / a) = ((0 < a & a < b) | (a < 0 & b < a))"
   3.478  by (auto simp add: less_divide_eq)
   3.479  
   3.480  lemma divide_less_eq_1 [no_atp]:
   3.481 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.482 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.483    shows "(b / a < 1) = ((0 < a & b < a) | (a < 0 & a < b) | a=0)"
   3.484  by (auto simp add: divide_less_eq)
   3.485  
   3.486 @@ -846,76 +831,76 @@
   3.487  text {*Conditional Simplification Rules: No Case Splits*}
   3.488  
   3.489  lemma le_divide_eq_1_pos [simp,no_atp]:
   3.490 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.491 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.492    shows "0 < a \<Longrightarrow> (1 \<le> b/a) = (a \<le> b)"
   3.493  by (auto simp add: le_divide_eq)
   3.494  
   3.495  lemma le_divide_eq_1_neg [simp,no_atp]:
   3.496 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.497 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.498    shows "a < 0 \<Longrightarrow> (1 \<le> b/a) = (b \<le> a)"
   3.499  by (auto simp add: le_divide_eq)
   3.500  
   3.501  lemma divide_le_eq_1_pos [simp,no_atp]:
   3.502 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.503 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.504    shows "0 < a \<Longrightarrow> (b/a \<le> 1) = (b \<le> a)"
   3.505  by (auto simp add: divide_le_eq)
   3.506  
   3.507  lemma divide_le_eq_1_neg [simp,no_atp]:
   3.508 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.509 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.510    shows "a < 0 \<Longrightarrow> (b/a \<le> 1) = (a \<le> b)"
   3.511  by (auto simp add: divide_le_eq)
   3.512  
   3.513  lemma less_divide_eq_1_pos [simp,no_atp]:
   3.514 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.515 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.516    shows "0 < a \<Longrightarrow> (1 < b/a) = (a < b)"
   3.517  by (auto simp add: less_divide_eq)
   3.518  
   3.519  lemma less_divide_eq_1_neg [simp,no_atp]:
   3.520 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.521 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.522    shows "a < 0 \<Longrightarrow> (1 < b/a) = (b < a)"
   3.523  by (auto simp add: less_divide_eq)
   3.524  
   3.525  lemma divide_less_eq_1_pos [simp,no_atp]:
   3.526 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.527 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.528    shows "0 < a \<Longrightarrow> (b/a < 1) = (b < a)"
   3.529  by (auto simp add: divide_less_eq)
   3.530  
   3.531  lemma divide_less_eq_1_neg [simp,no_atp]:
   3.532 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.533 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.534    shows "a < 0 \<Longrightarrow> b/a < 1 <-> a < b"
   3.535  by (auto simp add: divide_less_eq)
   3.536  
   3.537  lemma eq_divide_eq_1 [simp,no_atp]:
   3.538 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.539 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.540    shows "(1 = b/a) = ((a \<noteq> 0 & a = b))"
   3.541  by (auto simp add: eq_divide_eq)
   3.542  
   3.543  lemma divide_eq_eq_1 [simp,no_atp]:
   3.544 -  fixes a :: "'a :: {linordered_field,division_by_zero}"
   3.545 +  fixes a :: "'a :: {linordered_field,division_ring_inverse_zero}"
   3.546    shows "(b/a = 1) = ((a \<noteq> 0 & a = b))"
   3.547  by (auto simp add: divide_eq_eq)
   3.548  
   3.549  lemma abs_inverse [simp]:
   3.550 -     "\<bar>inverse (a::'a::{linordered_field,division_by_zero})\<bar> = 
   3.551 +     "\<bar>inverse (a::'a::{linordered_field,division_ring_inverse_zero})\<bar> = 
   3.552        inverse \<bar>a\<bar>"
   3.553  apply (cases "a=0", simp) 
   3.554  apply (simp add: nonzero_abs_inverse) 
   3.555  done
   3.556  
   3.557  lemma abs_divide [simp]:
   3.558 -     "\<bar>a / (b::'a::{linordered_field,division_by_zero})\<bar> = \<bar>a\<bar> / \<bar>b\<bar>"
   3.559 +     "\<bar>a / (b::'a::{linordered_field,division_ring_inverse_zero})\<bar> = \<bar>a\<bar> / \<bar>b\<bar>"
   3.560  apply (cases "b=0", simp) 
   3.561  apply (simp add: nonzero_abs_divide) 
   3.562  done
   3.563  
   3.564 -lemma abs_div_pos: "(0::'a::{linordered_field,division_by_zero}) < y ==> 
   3.565 +lemma abs_div_pos: "(0::'a::{linordered_field,division_ring_inverse_zero}) < y ==> 
   3.566      \<bar>x\<bar> / y = \<bar>x / y\<bar>"
   3.567    apply (subst abs_divide)
   3.568    apply (simp add: order_less_imp_le)
   3.569  done
   3.570  
   3.571  lemma field_le_mult_one_interval:
   3.572 -  fixes x :: "'a\<Colon>{linordered_field,division_by_zero}"
   3.573 +  fixes x :: "'a\<Colon>{linordered_field,division_ring_inverse_zero}"
   3.574    assumes *: "\<And>z. \<lbrakk> 0 < z ; z < 1 \<rbrakk> \<Longrightarrow> z * x \<le> y"
   3.575    shows "x \<le> y"
   3.576  proof (cases "0 < x")
     4.1 --- a/src/HOL/Groups.thy	Mon Apr 26 11:34:15 2010 +0200
     4.2 +++ b/src/HOL/Groups.thy	Mon Apr 26 11:34:15 2010 +0200
     4.3 @@ -20,6 +20,15 @@
     4.4  
     4.5  setup Ac_Simps.setup
     4.6  
     4.7 +text{* The rewrites accumulated in @{text algebra_simps} deal with the
     4.8 +classical algebraic structures of groups, rings and family. They simplify
     4.9 +terms by multiplying everything out (in case of a ring) and bringing sums and
    4.10 +products into a canonical form (by ordered rewriting). As a result it decides
    4.11 +group and ring equalities but also helps with inequalities.
    4.12 +
    4.13 +Of course it also works for fields, but it knows nothing about multiplicative
    4.14 +inverses or division. This is catered for by @{text field_simps}. *}
    4.15 +
    4.16  ML {*
    4.17  structure Algebra_Simps = Named_Thms(
    4.18    val name = "algebra_simps"
    4.19 @@ -29,14 +38,19 @@
    4.20  
    4.21  setup Algebra_Simps.setup
    4.22  
    4.23 -text{* The rewrites accumulated in @{text algebra_simps} deal with the
    4.24 -classical algebraic structures of groups, rings and family. They simplify
    4.25 -terms by multiplying everything out (in case of a ring) and bringing sums and
    4.26 -products into a canonical form (by ordered rewriting). As a result it decides
    4.27 -group and ring equalities but also helps with inequalities.
    4.28 +text{* Lemmas @{text field_simps} multiply with denominators in (in)equations
    4.29 +if they can be proved to be non-zero (for equations) or positive/negative
    4.30 +(for inequations). Can be too aggressive and is therefore separate from the
    4.31 +more benign @{text algebra_simps}. *}
    4.32  
    4.33 -Of course it also works for fields, but it knows nothing about multiplicative
    4.34 -inverses or division. This is catered for by @{text field_simps}. *}
    4.35 +ML {*
    4.36 +structure Field_Simps = Named_Thms(
    4.37 +  val name = "field_simps"
    4.38 +  val description = "algebra simplification rules for fields"
    4.39 +)
    4.40 +*}
    4.41 +
    4.42 +setup Field_Simps.setup
    4.43  
    4.44  
    4.45  subsection {* Abstract structures *}
    4.46 @@ -138,13 +152,13 @@
    4.47  subsection {* Semigroups and Monoids *}
    4.48  
    4.49  class semigroup_add = plus +
    4.50 -  assumes add_assoc [algebra_simps]: "(a + b) + c = a + (b + c)"
    4.51 +  assumes add_assoc [algebra_simps, field_simps]: "(a + b) + c = a + (b + c)"
    4.52  
    4.53  sublocale semigroup_add < add!: semigroup plus proof
    4.54  qed (fact add_assoc)
    4.55  
    4.56  class ab_semigroup_add = semigroup_add +
    4.57 -  assumes add_commute [algebra_simps]: "a + b = b + a"
    4.58 +  assumes add_commute [algebra_simps, field_simps]: "a + b = b + a"
    4.59  
    4.60  sublocale ab_semigroup_add < add!: abel_semigroup plus proof
    4.61  qed (fact add_commute)
    4.62 @@ -152,7 +166,7 @@
    4.63  context ab_semigroup_add
    4.64  begin
    4.65  
    4.66 -lemmas add_left_commute [algebra_simps] = add.left_commute
    4.67 +lemmas add_left_commute [algebra_simps, field_simps] = add.left_commute
    4.68  
    4.69  theorems add_ac = add_assoc add_commute add_left_commute
    4.70  
    4.71 @@ -161,13 +175,13 @@
    4.72  theorems add_ac = add_assoc add_commute add_left_commute
    4.73  
    4.74  class semigroup_mult = times +
    4.75 -  assumes mult_assoc [algebra_simps]: "(a * b) * c = a * (b * c)"
    4.76 +  assumes mult_assoc [algebra_simps, field_simps]: "(a * b) * c = a * (b * c)"
    4.77  
    4.78  sublocale semigroup_mult < mult!: semigroup times proof
    4.79  qed (fact mult_assoc)
    4.80  
    4.81  class ab_semigroup_mult = semigroup_mult +
    4.82 -  assumes mult_commute [algebra_simps]: "a * b = b * a"
    4.83 +  assumes mult_commute [algebra_simps, field_simps]: "a * b = b * a"
    4.84  
    4.85  sublocale ab_semigroup_mult < mult!: abel_semigroup times proof
    4.86  qed (fact mult_commute)
    4.87 @@ -175,7 +189,7 @@
    4.88  context ab_semigroup_mult
    4.89  begin
    4.90  
    4.91 -lemmas mult_left_commute [algebra_simps] = mult.left_commute
    4.92 +lemmas mult_left_commute [algebra_simps, field_simps] = mult.left_commute
    4.93  
    4.94  theorems mult_ac = mult_assoc mult_commute mult_left_commute
    4.95  
    4.96 @@ -370,7 +384,7 @@
    4.97  lemma add_diff_cancel: "a + b - b = a"
    4.98  by (simp add: diff_minus add_assoc)
    4.99  
   4.100 -declare diff_minus[symmetric, algebra_simps]
   4.101 +declare diff_minus[symmetric, algebra_simps, field_simps]
   4.102  
   4.103  lemma eq_neg_iff_add_eq_0: "a = - b \<longleftrightarrow> a + b = 0"
   4.104  proof
   4.105 @@ -401,7 +415,7 @@
   4.106    then show "b = c" by simp
   4.107  qed
   4.108  
   4.109 -lemma uminus_add_conv_diff[algebra_simps]:
   4.110 +lemma uminus_add_conv_diff[algebra_simps, field_simps]:
   4.111    "- a + b = b - a"
   4.112  by (simp add:diff_minus add_commute)
   4.113  
   4.114 @@ -413,22 +427,22 @@
   4.115    "- (a - b) = b - a"
   4.116  by (simp add: diff_minus add_commute)
   4.117  
   4.118 -lemma add_diff_eq[algebra_simps]: "a + (b - c) = (a + b) - c"
   4.119 +lemma add_diff_eq[algebra_simps, field_simps]: "a + (b - c) = (a + b) - c"
   4.120  by (simp add: diff_minus add_ac)
   4.121  
   4.122 -lemma diff_add_eq[algebra_simps]: "(a - b) + c = (a + c) - b"
   4.123 +lemma diff_add_eq[algebra_simps, field_simps]: "(a - b) + c = (a + c) - b"
   4.124  by (simp add: diff_minus add_ac)
   4.125  
   4.126 -lemma diff_eq_eq[algebra_simps]: "a - b = c \<longleftrightarrow> a = c + b"
   4.127 +lemma diff_eq_eq[algebra_simps, field_simps]: "a - b = c \<longleftrightarrow> a = c + b"
   4.128  by (auto simp add: diff_minus add_assoc)
   4.129  
   4.130 -lemma eq_diff_eq[algebra_simps]: "a = c - b \<longleftrightarrow> a + b = c"
   4.131 +lemma eq_diff_eq[algebra_simps, field_simps]: "a = c - b \<longleftrightarrow> a + b = c"
   4.132  by (auto simp add: diff_minus add_assoc)
   4.133  
   4.134 -lemma diff_diff_eq[algebra_simps]: "(a - b) - c = a - (b + c)"
   4.135 +lemma diff_diff_eq[algebra_simps, field_simps]: "(a - b) - c = a - (b + c)"
   4.136  by (simp add: diff_minus add_ac)
   4.137  
   4.138 -lemma diff_diff_eq2[algebra_simps]: "a - (b - c) = (a + c) - b"
   4.139 +lemma diff_diff_eq2[algebra_simps, field_simps]: "a - (b - c) = (a + c) - b"
   4.140  by (simp add: diff_minus add_ac)
   4.141  
   4.142  lemma eq_iff_diff_eq_0: "a = b \<longleftrightarrow> a - b = 0"
   4.143 @@ -749,35 +763,29 @@
   4.144    finally show ?thesis .
   4.145  qed
   4.146  
   4.147 -lemma diff_less_eq[algebra_simps]: "a - b < c \<longleftrightarrow> a < c + b"
   4.148 +lemma diff_less_eq[algebra_simps, field_simps]: "a - b < c \<longleftrightarrow> a < c + b"
   4.149  apply (subst less_iff_diff_less_0 [of a])
   4.150  apply (rule less_iff_diff_less_0 [of _ c, THEN ssubst])
   4.151  apply (simp add: diff_minus add_ac)
   4.152  done
   4.153  
   4.154 -lemma less_diff_eq[algebra_simps]: "a < c - b \<longleftrightarrow> a + b < c"
   4.155 +lemma less_diff_eq[algebra_simps, field_simps]: "a < c - b \<longleftrightarrow> a + b < c"
   4.156  apply (subst less_iff_diff_less_0 [of "a + b"])
   4.157  apply (subst less_iff_diff_less_0 [of a])
   4.158  apply (simp add: diff_minus add_ac)
   4.159  done
   4.160  
   4.161 -lemma diff_le_eq[algebra_simps]: "a - b \<le> c \<longleftrightarrow> a \<le> c + b"
   4.162 +lemma diff_le_eq[algebra_simps, field_simps]: "a - b \<le> c \<longleftrightarrow> a \<le> c + b"
   4.163  by (auto simp add: le_less diff_less_eq diff_add_cancel add_diff_cancel)
   4.164  
   4.165 -lemma le_diff_eq[algebra_simps]: "a \<le> c - b \<longleftrightarrow> a + b \<le> c"
   4.166 +lemma le_diff_eq[algebra_simps, field_simps]: "a \<le> c - b \<longleftrightarrow> a + b \<le> c"
   4.167  by (auto simp add: le_less less_diff_eq diff_add_cancel add_diff_cancel)
   4.168  
   4.169  lemma le_iff_diff_le_0: "a \<le> b \<longleftrightarrow> a - b \<le> 0"
   4.170  by (simp add: algebra_simps)
   4.171  
   4.172 -text{*Legacy - use @{text algebra_simps} *}
   4.173 -lemmas group_simps[no_atp] = algebra_simps
   4.174 -
   4.175  end
   4.176  
   4.177 -text{*Legacy - use @{text algebra_simps} *}
   4.178 -lemmas group_simps[no_atp] = algebra_simps
   4.179 -
   4.180  class linordered_ab_semigroup_add =
   4.181    linorder + ordered_ab_semigroup_add
   4.182  
     5.1 --- a/src/HOL/Library/Fraction_Field.thy	Mon Apr 26 11:34:15 2010 +0200
     5.2 +++ b/src/HOL/Library/Fraction_Field.thy	Mon Apr 26 11:34:15 2010 +0200
     5.3 @@ -267,7 +267,7 @@
     5.4  
     5.5  end
     5.6  
     5.7 -instance fract :: (idom) division_by_zero
     5.8 +instance fract :: (idom) division_ring_inverse_zero
     5.9  proof
    5.10    show "inverse 0 = (0:: 'a fract)" by (simp add: fract_expand)
    5.11      (simp add: fract_collapse)
    5.12 @@ -450,7 +450,7 @@
    5.13          by simp
    5.14        with F have "(a * d) * (b * d) * ?F * ?F \<le> (c * b) * (b * d) * ?F * ?F"
    5.15          by (simp add: mult_le_cancel_right)
    5.16 -      with neq show ?thesis by (simp add: ring_simps)
    5.17 +      with neq show ?thesis by (simp add: field_simps)
    5.18      qed
    5.19    qed
    5.20    show "q < r ==> 0 < s ==> s * q < s * r"
     6.1 --- a/src/HOL/Rings.thy	Mon Apr 26 11:34:15 2010 +0200
     6.2 +++ b/src/HOL/Rings.thy	Mon Apr 26 11:34:15 2010 +0200
     6.3 @@ -14,8 +14,8 @@
     6.4  begin
     6.5  
     6.6  class semiring = ab_semigroup_add + semigroup_mult +
     6.7 -  assumes left_distrib[algebra_simps]: "(a + b) * c = a * c + b * c"
     6.8 -  assumes right_distrib[algebra_simps]: "a * (b + c) = a * b + a * c"
     6.9 +  assumes left_distrib[algebra_simps, field_simps]: "(a + b) * c = a * c + b * c"
    6.10 +  assumes right_distrib[algebra_simps, field_simps]: "a * (b + c) = a * b + a * c"
    6.11  begin
    6.12  
    6.13  text{*For the @{text combine_numerals} simproc*}
    6.14 @@ -230,18 +230,15 @@
    6.15  lemma minus_mult_commute: "- a * b = a * - b"
    6.16  by simp
    6.17  
    6.18 -lemma right_diff_distrib[algebra_simps]: "a * (b - c) = a * b - a * c"
    6.19 +lemma right_diff_distrib[algebra_simps, field_simps]: "a * (b - c) = a * b - a * c"
    6.20  by (simp add: right_distrib diff_minus)
    6.21  
    6.22 -lemma left_diff_distrib[algebra_simps]: "(a - b) * c = a * c - b * c"
    6.23 +lemma left_diff_distrib[algebra_simps, field_simps]: "(a - b) * c = a * c - b * c"
    6.24  by (simp add: left_distrib diff_minus)
    6.25  
    6.26  lemmas ring_distribs[no_atp] =
    6.27    right_distrib left_distrib left_diff_distrib right_diff_distrib
    6.28  
    6.29 -text{*Legacy - use @{text algebra_simps} *}
    6.30 -lemmas ring_simps[no_atp] = algebra_simps
    6.31 -
    6.32  lemma eq_add_iff1:
    6.33    "a * e + c = b * e + d \<longleftrightarrow> (a - b) * e + c = d"
    6.34  by (simp add: algebra_simps)
    6.35 @@ -536,7 +533,7 @@
    6.36  lemma diff_divide_distrib: "(a - b) / c = a / c - b / c"
    6.37    by (simp add: diff_minus add_divide_distrib)
    6.38  
    6.39 -lemma nonzero_eq_divide_eq: "c \<noteq> 0 \<Longrightarrow> a = b / c \<longleftrightarrow> a * c = b"
    6.40 +lemma nonzero_eq_divide_eq [field_simps]: "c \<noteq> 0 \<Longrightarrow> a = b / c \<longleftrightarrow> a * c = b"
    6.41  proof -
    6.42    assume [simp]: "c \<noteq> 0"
    6.43    have "a = b / c \<longleftrightarrow> a * c = (b / c) * c" by simp
    6.44 @@ -544,7 +541,7 @@
    6.45    finally show ?thesis .
    6.46  qed
    6.47  
    6.48 -lemma nonzero_divide_eq_eq: "c \<noteq> 0 \<Longrightarrow> b / c = a \<longleftrightarrow> b = a * c"
    6.49 +lemma nonzero_divide_eq_eq [field_simps]: "c \<noteq> 0 \<Longrightarrow> b / c = a \<longleftrightarrow> b = a * c"
    6.50  proof -
    6.51    assume [simp]: "c \<noteq> 0"
    6.52    have "b / c = a \<longleftrightarrow> (b / c) * c = a * c" by simp
    6.53 @@ -560,7 +557,7 @@
    6.54  
    6.55  end
    6.56  
    6.57 -class division_by_zero = division_ring +
    6.58 +class division_ring_inverse_zero = division_ring +
    6.59    assumes inverse_zero [simp]: "inverse 0 = 0"
    6.60  begin
    6.61  
    6.62 @@ -861,9 +858,6 @@
    6.63  
    6.64  subclass ordered_ab_group_add ..
    6.65  
    6.66 -text{*Legacy - use @{text algebra_simps} *}
    6.67 -lemmas ring_simps[no_atp] = algebra_simps
    6.68 -
    6.69  lemma less_add_iff1:
    6.70    "a * e + c < b * e + d \<longleftrightarrow> (a - b) * e + c < d"
    6.71  by (simp add: algebra_simps)
    6.72 @@ -1068,9 +1062,6 @@
    6.73  
    6.74  end
    6.75  
    6.76 -text{*Legacy - use @{text algebra_simps} *}
    6.77 -lemmas ring_simps[no_atp] = algebra_simps
    6.78 -
    6.79  lemmas mult_sign_intros =
    6.80    mult_nonneg_nonneg mult_nonneg_nonpos
    6.81    mult_nonpos_nonneg mult_nonpos_nonpos