more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
authorhaftmann
Fri Feb 05 14:33:50 2010 +0100 (2010-02-05)
changeset 35028108662d50512
parent 35027 ed7d12bcf8f8
child 35029 22aab1c5e5a8
child 35032 7efe662e41b4
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
src/HOL/Archimedean_Field.thy
src/HOL/Code_Numeral.thy
src/HOL/Decision_Procs/Approximation.thy
src/HOL/Decision_Procs/Dense_Linear_Order.thy
src/HOL/Decision_Procs/MIR.thy
src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy
src/HOL/Decision_Procs/Polynomial_List.thy
src/HOL/Decision_Procs/ex/Dense_Linear_Order_Ex.thy
src/HOL/Fact.thy
src/HOL/Finite_Set.thy
src/HOL/GCD.thy
src/HOL/Import/HOL/real.imp
src/HOL/Int.thy
src/HOL/Lattices.thy
src/HOL/Library/Abstract_Rat.thy
src/HOL/Library/BigO.thy
src/HOL/Library/Kleene_Algebra.thy
src/HOL/Library/Multiset.thy
src/HOL/Library/Nat_Infinity.thy
src/HOL/Library/Polynomial.thy
src/HOL/Library/Univ_Poly.thy
src/HOL/Library/positivstellensatz.ML
src/HOL/List.thy
src/HOL/Matrix/ComputeNumeral.thy
src/HOL/Matrix/LP.thy
src/HOL/Matrix/Matrix.thy
src/HOL/Matrix/SparseMatrix.thy
src/HOL/Matrix/cplex/Cplex.thy
src/HOL/Metis_Examples/BigO.thy
src/HOL/Multivariate_Analysis/Derivative.thy
src/HOL/Multivariate_Analysis/Determinants.thy
src/HOL/Multivariate_Analysis/Euclidean_Space.thy
src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy
src/HOL/NSA/HyperDef.thy
src/HOL/NSA/HyperNat.thy
src/HOL/NSA/StarDef.thy
src/HOL/Nat.thy
src/HOL/Nat_Numeral.thy
src/HOL/Nitpick.thy
src/HOL/OrderedGroup.thy
src/HOL/Orderings.thy
src/HOL/PReal.thy
src/HOL/Parity.thy
src/HOL/Power.thy
src/HOL/Probability/Borel.thy
src/HOL/Quickcheck.thy
src/HOL/RComplete.thy
src/HOL/Rational.thy
src/HOL/Real.thy
src/HOL/RealDef.thy
src/HOL/Ring_and_Field.thy
src/HOL/Series.thy
src/HOL/SupInf.thy
src/HOL/Tools/Nitpick/minipick.ML
src/HOL/Tools/Nitpick/nitpick_hol.ML
src/HOL/Tools/Nitpick/nitpick_mono.ML
src/HOL/Tools/Nitpick/nitpick_nut.ML
src/HOL/Tools/int_arith.ML
src/HOL/Tools/lin_arith.ML
src/HOL/Tools/numeral_simprocs.ML
src/HOL/Transcendental.thy
src/HOL/ZF/Games.thy
src/HOL/ex/Numeral.thy
src/HOL/ex/RPred.thy
src/HOL/ex/ReflectionEx.thy
     1.1 --- a/src/HOL/Archimedean_Field.thy	Fri Feb 05 14:33:31 2010 +0100
     1.2 +++ b/src/HOL/Archimedean_Field.thy	Fri Feb 05 14:33:50 2010 +0100
     1.3 @@ -12,7 +12,7 @@
     1.4  
     1.5  text {* Archimedean fields have no infinite elements. *}
     1.6  
     1.7 -class archimedean_field = ordered_field + number_ring +
     1.8 +class archimedean_field = linordered_field + number_ring +
     1.9    assumes ex_le_of_int: "\<exists>z. x \<le> of_int z"
    1.10  
    1.11  lemma ex_less_of_int:
     2.1 --- a/src/HOL/Code_Numeral.thy	Fri Feb 05 14:33:31 2010 +0100
     2.2 +++ b/src/HOL/Code_Numeral.thy	Fri Feb 05 14:33:50 2010 +0100
     2.3 @@ -144,7 +144,7 @@
     2.4  
     2.5  subsection {* Basic arithmetic *}
     2.6  
     2.7 -instantiation code_numeral :: "{minus, ordered_semidom, semiring_div, linorder}"
     2.8 +instantiation code_numeral :: "{minus, linordered_semidom, semiring_div, linorder}"
     2.9  begin
    2.10  
    2.11  definition [simp, code del]:
     3.1 --- a/src/HOL/Decision_Procs/Approximation.thy	Fri Feb 05 14:33:31 2010 +0100
     3.2 +++ b/src/HOL/Decision_Procs/Approximation.thy	Fri Feb 05 14:33:50 2010 +0100
     3.3 @@ -1431,7 +1431,7 @@
     3.4        moreover have "0 \<le> exp t / real (fact (get_even n)) * (real x) ^ (get_even n)"
     3.5          by (auto intro!: mult_nonneg_nonneg divide_nonneg_pos simp add: get_even zero_le_even_power exp_gt_zero)
     3.6        ultimately show ?thesis
     3.7 -        using get_odd exp_gt_zero by (auto intro!: pordered_cancel_semiring_class.mult_nonneg_nonneg)
     3.8 +        using get_odd exp_gt_zero by (auto intro!: mult_nonneg_nonneg)
     3.9      qed
    3.10      finally have "real (lb_exp_horner prec (get_even n) 1 1 x) \<le> exp (real x)" .
    3.11    } moreover
    3.12 @@ -1451,7 +1451,7 @@
    3.13      moreover have "exp t / real (fact (get_odd n)) * (real x) ^ (get_odd n) \<le> 0"
    3.14        by (auto intro!: mult_nonneg_nonpos divide_nonpos_pos simp add: x_less_zero exp_gt_zero)
    3.15      ultimately have "exp (real x) \<le> (\<Sum>j = 0..<get_odd n. 1 / real (fact j) * real x ^ j)"
    3.16 -      using get_odd exp_gt_zero by (auto intro!: pordered_cancel_semiring_class.mult_nonneg_nonneg)
    3.17 +      using get_odd exp_gt_zero by (auto intro!: mult_nonneg_nonneg)
    3.18      also have "\<dots> \<le> real (ub_exp_horner prec (get_odd n) 1 1 x)"
    3.19        using bounds(2) by auto
    3.20      finally have "exp (real x) \<le> real (ub_exp_horner prec (get_odd n) 1 1 x)" .
     4.1 --- a/src/HOL/Decision_Procs/Dense_Linear_Order.thy	Fri Feb 05 14:33:31 2010 +0100
     4.2 +++ b/src/HOL/Decision_Procs/Dense_Linear_Order.thy	Fri Feb 05 14:33:50 2010 +0100
     4.3 @@ -208,7 +208,7 @@
     4.4  
     4.5  section {* The classical QE after Langford for dense linear orders *}
     4.6  
     4.7 -context dense_linear_order
     4.8 +context dense_linorder
     4.9  begin
    4.10  
    4.11  lemma interval_empty_iff:
    4.12 @@ -265,7 +265,7 @@
    4.13  lemmas dlo_simps[noatp] = order_refl less_irrefl not_less not_le exists_neq 
    4.14    le_less neq_iff linear less_not_permute
    4.15  
    4.16 -lemma axiom[noatp]: "dense_linear_order (op \<le>) (op <)" by (rule dense_linear_order_axioms)
    4.17 +lemma axiom[noatp]: "dense_linorder (op \<le>) (op <)" by (rule dense_linorder_axioms)
    4.18  lemma atoms[noatp]:
    4.19    shows "TERM (less :: 'a \<Rightarrow> _)"
    4.20      and "TERM (less_eq :: 'a \<Rightarrow> _)"
    4.21 @@ -409,17 +409,17 @@
    4.22  end
    4.23  
    4.24  
    4.25 -locale constr_dense_linear_order = linorder_no_lb + linorder_no_ub +
    4.26 +locale constr_dense_linorder = linorder_no_lb + linorder_no_ub +
    4.27    fixes between
    4.28    assumes between_less: "less x y \<Longrightarrow> less x (between x y) \<and> less (between x y) y"
    4.29       and  between_same: "between x x = x"
    4.30  
    4.31 -sublocale  constr_dense_linear_order < dense_linear_order 
    4.32 +sublocale  constr_dense_linorder < dense_linorder 
    4.33    apply unfold_locales
    4.34    using gt_ex lt_ex between_less
    4.35      by (auto, rule_tac x="between x y" in exI, simp)
    4.36  
    4.37 -context  constr_dense_linear_order
    4.38 +context  constr_dense_linorder
    4.39  begin
    4.40  
    4.41  lemma rinf_U[noatp]:
    4.42 @@ -500,8 +500,8 @@
    4.43  lemmas npi_thms[noatp] = npi_conj npi_disj npi_eq npi_neq npi_lt npi_le npi_gt npi_ge npi_P
    4.44  lemmas lin_dense_thms[noatp] = lin_dense_conj lin_dense_disj lin_dense_eq lin_dense_neq lin_dense_lt lin_dense_le lin_dense_gt lin_dense_ge lin_dense_P
    4.45  
    4.46 -lemma ferrack_axiom[noatp]: "constr_dense_linear_order less_eq less between"
    4.47 -  by (rule constr_dense_linear_order_axioms)
    4.48 +lemma ferrack_axiom[noatp]: "constr_dense_linorder less_eq less between"
    4.49 +  by (rule constr_dense_linorder_axioms)
    4.50  lemma atoms[noatp]:
    4.51    shows "TERM (less :: 'a \<Rightarrow> _)"
    4.52      and "TERM (less_eq :: 'a \<Rightarrow> _)"
    4.53 @@ -551,7 +551,7 @@
    4.54  
    4.55  subsection {* Ferrante and Rackoff algorithm over ordered fields *}
    4.56  
    4.57 -lemma neg_prod_lt:"(c\<Colon>'a\<Colon>ordered_field) < 0 \<Longrightarrow> ((c*x < 0) == (x > 0))"
    4.58 +lemma neg_prod_lt:"(c\<Colon>'a\<Colon>linordered_field) < 0 \<Longrightarrow> ((c*x < 0) == (x > 0))"
    4.59  proof-
    4.60    assume H: "c < 0"
    4.61    have "c*x < 0 = (0/c < x)" by (simp only: neg_divide_less_eq[OF H] algebra_simps)
    4.62 @@ -559,7 +559,7 @@
    4.63    finally show  "(c*x < 0) == (x > 0)" by simp
    4.64  qed
    4.65  
    4.66 -lemma pos_prod_lt:"(c\<Colon>'a\<Colon>ordered_field) > 0 \<Longrightarrow> ((c*x < 0) == (x < 0))"
    4.67 +lemma pos_prod_lt:"(c\<Colon>'a\<Colon>linordered_field) > 0 \<Longrightarrow> ((c*x < 0) == (x < 0))"
    4.68  proof-
    4.69    assume H: "c > 0"
    4.70    hence "c*x < 0 = (0/c > x)" by (simp only: pos_less_divide_eq[OF H] algebra_simps)
    4.71 @@ -567,7 +567,7 @@
    4.72    finally show  "(c*x < 0) == (x < 0)" by simp
    4.73  qed
    4.74  
    4.75 -lemma neg_prod_sum_lt: "(c\<Colon>'a\<Colon>ordered_field) < 0 \<Longrightarrow> ((c*x + t< 0) == (x > (- 1/c)*t))"
    4.76 +lemma neg_prod_sum_lt: "(c\<Colon>'a\<Colon>linordered_field) < 0 \<Longrightarrow> ((c*x + t< 0) == (x > (- 1/c)*t))"
    4.77  proof-
    4.78    assume H: "c < 0"
    4.79    have "c*x + t< 0 = (c*x < -t)" by (subst less_iff_diff_less_0 [of "c*x" "-t"], simp)
    4.80 @@ -576,7 +576,7 @@
    4.81    finally show  "(c*x + t < 0) == (x > (- 1/c)*t)" by simp
    4.82  qed
    4.83  
    4.84 -lemma pos_prod_sum_lt:"(c\<Colon>'a\<Colon>ordered_field) > 0 \<Longrightarrow> ((c*x + t < 0) == (x < (- 1/c)*t))"
    4.85 +lemma pos_prod_sum_lt:"(c\<Colon>'a\<Colon>linordered_field) > 0 \<Longrightarrow> ((c*x + t < 0) == (x < (- 1/c)*t))"
    4.86  proof-
    4.87    assume H: "c > 0"
    4.88    have "c*x + t< 0 = (c*x < -t)"  by (subst less_iff_diff_less_0 [of "c*x" "-t"], simp)
    4.89 @@ -585,10 +585,10 @@
    4.90    finally show  "(c*x + t < 0) == (x < (- 1/c)*t)" by simp
    4.91  qed
    4.92  
    4.93 -lemma sum_lt:"((x::'a::pordered_ab_group_add) + t < 0) == (x < - t)"
    4.94 +lemma sum_lt:"((x::'a::ordered_ab_group_add) + t < 0) == (x < - t)"
    4.95    using less_diff_eq[where a= x and b=t and c=0] by simp
    4.96  
    4.97 -lemma neg_prod_le:"(c\<Colon>'a\<Colon>ordered_field) < 0 \<Longrightarrow> ((c*x <= 0) == (x >= 0))"
    4.98 +lemma neg_prod_le:"(c\<Colon>'a\<Colon>linordered_field) < 0 \<Longrightarrow> ((c*x <= 0) == (x >= 0))"
    4.99  proof-
   4.100    assume H: "c < 0"
   4.101    have "c*x <= 0 = (0/c <= x)" by (simp only: neg_divide_le_eq[OF H] algebra_simps)
   4.102 @@ -596,7 +596,7 @@
   4.103    finally show  "(c*x <= 0) == (x >= 0)" by simp
   4.104  qed
   4.105  
   4.106 -lemma pos_prod_le:"(c\<Colon>'a\<Colon>ordered_field) > 0 \<Longrightarrow> ((c*x <= 0) == (x <= 0))"
   4.107 +lemma pos_prod_le:"(c\<Colon>'a\<Colon>linordered_field) > 0 \<Longrightarrow> ((c*x <= 0) == (x <= 0))"
   4.108  proof-
   4.109    assume H: "c > 0"
   4.110    hence "c*x <= 0 = (0/c >= x)" by (simp only: pos_le_divide_eq[OF H] algebra_simps)
   4.111 @@ -604,7 +604,7 @@
   4.112    finally show  "(c*x <= 0) == (x <= 0)" by simp
   4.113  qed
   4.114  
   4.115 -lemma neg_prod_sum_le: "(c\<Colon>'a\<Colon>ordered_field) < 0 \<Longrightarrow> ((c*x + t <= 0) == (x >= (- 1/c)*t))"
   4.116 +lemma neg_prod_sum_le: "(c\<Colon>'a\<Colon>linordered_field) < 0 \<Longrightarrow> ((c*x + t <= 0) == (x >= (- 1/c)*t))"
   4.117  proof-
   4.118    assume H: "c < 0"
   4.119    have "c*x + t <= 0 = (c*x <= -t)"  by (subst le_iff_diff_le_0 [of "c*x" "-t"], simp)
   4.120 @@ -613,7 +613,7 @@
   4.121    finally show  "(c*x + t <= 0) == (x >= (- 1/c)*t)" by simp
   4.122  qed
   4.123  
   4.124 -lemma pos_prod_sum_le:"(c\<Colon>'a\<Colon>ordered_field) > 0 \<Longrightarrow> ((c*x + t <= 0) == (x <= (- 1/c)*t))"
   4.125 +lemma pos_prod_sum_le:"(c\<Colon>'a\<Colon>linordered_field) > 0 \<Longrightarrow> ((c*x + t <= 0) == (x <= (- 1/c)*t))"
   4.126  proof-
   4.127    assume H: "c > 0"
   4.128    have "c*x + t <= 0 = (c*x <= -t)" by (subst le_iff_diff_le_0 [of "c*x" "-t"], simp)
   4.129 @@ -622,24 +622,24 @@
   4.130    finally show  "(c*x + t <= 0) == (x <= (- 1/c)*t)" by simp
   4.131  qed
   4.132  
   4.133 -lemma sum_le:"((x::'a::pordered_ab_group_add) + t <= 0) == (x <= - t)"
   4.134 +lemma sum_le:"((x::'a::ordered_ab_group_add) + t <= 0) == (x <= - t)"
   4.135    using le_diff_eq[where a= x and b=t and c=0] by simp
   4.136  
   4.137 -lemma nz_prod_eq:"(c\<Colon>'a\<Colon>ordered_field) \<noteq> 0 \<Longrightarrow> ((c*x = 0) == (x = 0))" by simp
   4.138 -lemma nz_prod_sum_eq: "(c\<Colon>'a\<Colon>ordered_field) \<noteq> 0 \<Longrightarrow> ((c*x + t = 0) == (x = (- 1/c)*t))"
   4.139 +lemma nz_prod_eq:"(c\<Colon>'a\<Colon>linordered_field) \<noteq> 0 \<Longrightarrow> ((c*x = 0) == (x = 0))" by simp
   4.140 +lemma nz_prod_sum_eq: "(c\<Colon>'a\<Colon>linordered_field) \<noteq> 0 \<Longrightarrow> ((c*x + t = 0) == (x = (- 1/c)*t))"
   4.141  proof-
   4.142    assume H: "c \<noteq> 0"
   4.143    have "c*x + t = 0 = (c*x = -t)" by (subst eq_iff_diff_eq_0 [of "c*x" "-t"], simp)
   4.144    also have "\<dots> = (x = -t/c)" by (simp only: nonzero_eq_divide_eq[OF H] algebra_simps)
   4.145    finally show  "(c*x + t = 0) == (x = (- 1/c)*t)" by simp
   4.146  qed
   4.147 -lemma sum_eq:"((x::'a::pordered_ab_group_add) + t = 0) == (x = - t)"
   4.148 +lemma sum_eq:"((x::'a::ordered_ab_group_add) + t = 0) == (x = - t)"
   4.149    using eq_diff_eq[where a= x and b=t and c=0] by simp
   4.150  
   4.151  
   4.152 -interpretation class_ordered_field_dense_linear_order: constr_dense_linear_order
   4.153 +interpretation class_dense_linlinordered_field: constr_dense_linorder
   4.154   "op <=" "op <"
   4.155 -   "\<lambda> x y. 1/2 * ((x::'a::{ordered_field,number_ring}) + y)"
   4.156 +   "\<lambda> x y. 1/2 * ((x::'a::{linordered_field,number_ring}) + y)"
   4.157  proof (unfold_locales, dlo, dlo, auto)
   4.158    fix x y::'a assume lt: "x < y"
   4.159    from  less_half_sum[OF lt] show "x < (x + y) /2" by simp
   4.160 @@ -871,7 +871,7 @@
   4.161     addsplits [@{thm "abs_split"},@{thm "split_max"}, @{thm "split_min"}]
   4.162  
   4.163  in
   4.164 -Ferrante_Rackoff_Data.funs @{thm "class_ordered_field_dense_linear_order.ferrack_axiom"}
   4.165 +Ferrante_Rackoff_Data.funs @{thm "class_dense_linlinordered_field.ferrack_axiom"}
   4.166    {isolate_conv = field_isolate_conv, whatis = classfield_whatis, simpset = class_field_ss}
   4.167  end
   4.168  *}
     5.1 --- a/src/HOL/Decision_Procs/MIR.thy	Fri Feb 05 14:33:31 2010 +0100
     5.2 +++ b/src/HOL/Decision_Procs/MIR.thy	Fri Feb 05 14:33:50 2010 +0100
     5.3 @@ -54,7 +54,7 @@
     5.4  by clarsimp
     5.5  
     5.6  
     5.7 -lemma myl: "\<forall> (a::'a::{pordered_ab_group_add}) (b::'a). (a \<le> b) = (0 \<le> b - a)" 
     5.8 +lemma myl: "\<forall> (a::'a::{ordered_ab_group_add}) (b::'a). (a \<le> b) = (0 \<le> b - a)" 
     5.9  proof(clarify)
    5.10    fix x y ::"'a"
    5.11    have "(x \<le> y) = (x - y \<le> 0)" by (simp only: le_iff_diff_le_0[where a="x" and b="y"])
    5.12 @@ -63,7 +63,7 @@
    5.13    finally show "(x \<le> y) = (0 \<le> y - x)" .
    5.14  qed
    5.15  
    5.16 -lemma myless: "\<forall> (a::'a::{pordered_ab_group_add}) (b::'a). (a < b) = (0 < b - a)" 
    5.17 +lemma myless: "\<forall> (a::'a::{ordered_ab_group_add}) (b::'a). (a < b) = (0 < b - a)" 
    5.18  proof(clarify)
    5.19    fix x y ::"'a"
    5.20    have "(x < y) = (x - y < 0)" by (simp only: less_iff_diff_less_0[where a="x" and b="y"])
    5.21 @@ -72,7 +72,7 @@
    5.22    finally show "(x < y) = (0 < y - x)" .
    5.23  qed
    5.24  
    5.25 -lemma myeq: "\<forall> (a::'a::{pordered_ab_group_add}) (b::'a). (a = b) = (0 = b - a)"
    5.26 +lemma myeq: "\<forall> (a::'a::{ordered_ab_group_add}) (b::'a). (a = b) = (0 = b - a)"
    5.27    by auto
    5.28  
    5.29    (* Maybe should be added to the library \<dots> *)
     6.1 --- a/src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy	Fri Feb 05 14:33:31 2010 +0100
     6.2 +++ b/src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy	Fri Feb 05 14:33:50 2010 +0100
     6.3 @@ -447,7 +447,7 @@
     6.4  by (induct p rule: fmsize.induct) simp_all
     6.5  
     6.6    (* Semantics of formulae (fm) *)
     6.7 -consts Ifm ::"'a::{division_by_zero,ordered_field} list \<Rightarrow> 'a list \<Rightarrow> fm \<Rightarrow> bool"
     6.8 +consts Ifm ::"'a::{division_by_zero,linordered_field} list \<Rightarrow> 'a list \<Rightarrow> fm \<Rightarrow> bool"
     6.9  primrec
    6.10    "Ifm vs bs T = True"
    6.11    "Ifm vs bs F = False"
    6.12 @@ -1833,16 +1833,16 @@
    6.13    ultimately show ?case by blast
    6.14  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"])
    6.15  
    6.16 -lemma one_plus_one_pos[simp]: "(1::'a::{ordered_field}) + 1 > 0"
    6.17 +lemma one_plus_one_pos[simp]: "(1::'a::{linordered_field}) + 1 > 0"
    6.18  proof-
    6.19    have op: "(1::'a) > 0" by simp
    6.20    from add_pos_pos[OF op op] show ?thesis . 
    6.21  qed
    6.22  
    6.23 -lemma one_plus_one_nonzero[simp]: "(1::'a::{ordered_field}) + 1 \<noteq> 0" 
    6.24 +lemma one_plus_one_nonzero[simp]: "(1::'a::{linordered_field}) + 1 \<noteq> 0" 
    6.25    using one_plus_one_pos[where ?'a = 'a] by (simp add: less_le) 
    6.26  
    6.27 -lemma half_sum_eq: "(u + u) / (1+1) = (u::'a::{ordered_field})" 
    6.28 +lemma half_sum_eq: "(u + u) / (1+1) = (u::'a::{linordered_field})" 
    6.29  proof-
    6.30    have "(u + u) = (1 + 1) * u" by (simp add: ring_simps)
    6.31    hence "(u + u) / (1+1) = (1 + 1)*u / (1 + 1)" by simp
    6.32 @@ -3172,54 +3172,54 @@
    6.33  *} "Parametric QE for linear Arithmetic over fields, Version 2"
    6.34  
    6.35  
    6.36 -lemma "\<exists>(x::'a::{division_by_zero,ordered_field,number_ring}). y \<noteq> -1 \<longrightarrow> (y + 1)*x < 0"
    6.37 -  apply (frpar type: "'a::{division_by_zero,ordered_field,number_ring}" pars: "y::'a::{division_by_zero,ordered_field,number_ring}")
    6.38 +lemma "\<exists>(x::'a::{division_by_zero,linordered_field,number_ring}). y \<noteq> -1 \<longrightarrow> (y + 1)*x < 0"
    6.39 +  apply (frpar type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "y::'a::{division_by_zero,linordered_field,number_ring}")
    6.40    apply (simp add: ring_simps)
    6.41    apply (rule spec[where x=y])
    6.42 -  apply (frpar type: "'a::{division_by_zero,ordered_field,number_ring}" pars: "z::'a::{division_by_zero,ordered_field,number_ring}")
    6.43 +  apply (frpar type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "z::'a::{division_by_zero,linordered_field,number_ring}")
    6.44    by simp
    6.45  
    6.46  text{* Collins/Jones Problem *}
    6.47  (*
    6.48 -lemma "\<exists>(r::'a::{division_by_zero,ordered_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"
    6.49 +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"
    6.50  proof-
    6.51 -  have "(\<exists>(r::'a::{division_by_zero,ordered_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,ordered_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")
    6.52 +  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")
    6.53  by (simp add: ring_simps)
    6.54  have "?rhs"
    6.55  
    6.56 -  apply (frpar type: "'a::{division_by_zero,ordered_field,number_ring}" pars: "a::'a::{division_by_zero,ordered_field,number_ring}" "b::'a::{division_by_zero,ordered_field,number_ring}")
    6.57 +  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}")
    6.58    apply (simp add: ring_simps)
    6.59  oops
    6.60  *)
    6.61  (*
    6.62 -lemma "ALL (x::'a::{division_by_zero,ordered_field,number_ring}) y. (1 - t)*x \<le> (1+t)*y \<and> (1 - t)*y \<le> (1+t)*x --> 0 \<le> y"
    6.63 -apply (frpar type: "'a::{division_by_zero,ordered_field,number_ring}" pars: "t::'a::{division_by_zero,ordered_field,number_ring}")
    6.64 +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"
    6.65 +apply (frpar type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "t::'a::{division_by_zero,linordered_field,number_ring}")
    6.66  oops
    6.67  *)
    6.68  
    6.69 -lemma "\<exists>(x::'a::{division_by_zero,ordered_field,number_ring}). y \<noteq> -1 \<longrightarrow> (y + 1)*x < 0"
    6.70 -  apply (frpar2 type: "'a::{division_by_zero,ordered_field,number_ring}" pars: "y::'a::{division_by_zero,ordered_field,number_ring}")
    6.71 +lemma "\<exists>(x::'a::{division_by_zero,linordered_field,number_ring}). y \<noteq> -1 \<longrightarrow> (y + 1)*x < 0"
    6.72 +  apply (frpar2 type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "y::'a::{division_by_zero,linordered_field,number_ring}")
    6.73    apply (simp add: ring_simps)
    6.74    apply (rule spec[where x=y])
    6.75 -  apply (frpar2 type: "'a::{division_by_zero,ordered_field,number_ring}" pars: "z::'a::{division_by_zero,ordered_field,number_ring}")
    6.76 +  apply (frpar2 type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "z::'a::{division_by_zero,linordered_field,number_ring}")
    6.77    by simp
    6.78  
    6.79  text{* Collins/Jones Problem *}
    6.80  
    6.81  (*
    6.82 -lemma "\<exists>(r::'a::{division_by_zero,ordered_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"
    6.83 +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"
    6.84  proof-
    6.85 -  have "(\<exists>(r::'a::{division_by_zero,ordered_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,ordered_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")
    6.86 +  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")
    6.87  by (simp add: ring_simps)
    6.88  have "?rhs"
    6.89 -  apply (frpar2 type: "'a::{division_by_zero,ordered_field,number_ring}" pars: "a::'a::{division_by_zero,ordered_field,number_ring}" "b::'a::{division_by_zero,ordered_field,number_ring}")
    6.90 +  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}")
    6.91    apply simp
    6.92  oops
    6.93  *)
    6.94  
    6.95  (*
    6.96 -lemma "ALL (x::'a::{division_by_zero,ordered_field,number_ring}) y. (1 - t)*x \<le> (1+t)*y \<and> (1 - t)*y \<le> (1+t)*x --> 0 \<le> y"
    6.97 -apply (frpar2 type: "'a::{division_by_zero,ordered_field,number_ring}" pars: "t::'a::{division_by_zero,ordered_field,number_ring}")
    6.98 +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"
    6.99 +apply (frpar2 type: "'a::{division_by_zero,linordered_field,number_ring}" pars: "t::'a::{division_by_zero,linordered_field,number_ring}")
   6.100  apply (simp add: field_simps linorder_neq_iff[symmetric])
   6.101  apply ferrack
   6.102  oops
     7.1 --- a/src/HOL/Decision_Procs/Polynomial_List.thy	Fri Feb 05 14:33:31 2010 +0100
     7.2 +++ b/src/HOL/Decision_Procs/Polynomial_List.thy	Fri Feb 05 14:33:50 2010 +0100
     7.3 @@ -772,7 +772,7 @@
     7.4  
     7.5  text{*bound for polynomial.*}
     7.6  
     7.7 -lemma poly_mono: "abs(x) \<le> k ==> abs(poly p (x::'a::{ordered_idom})) \<le> poly (map abs p) k"
     7.8 +lemma poly_mono: "abs(x) \<le> k ==> abs(poly p (x::'a::{linordered_idom})) \<le> poly (map abs p) k"
     7.9  apply (induct "p", auto)
    7.10  apply (rule_tac y = "abs a + abs (x * poly p x)" in order_trans)
    7.11  apply (rule abs_triangle_ineq)
     8.1 --- a/src/HOL/Decision_Procs/ex/Dense_Linear_Order_Ex.thy	Fri Feb 05 14:33:31 2010 +0100
     8.2 +++ b/src/HOL/Decision_Procs/ex/Dense_Linear_Order_Ex.thy	Fri Feb 05 14:33:50 2010 +0100
     8.3 @@ -7,147 +7,147 @@
     8.4  begin
     8.5  
     8.6  lemma
     8.7 -  "\<exists>(y::'a::{ordered_field,number_ring, division_by_zero}) <2. x + 3* y < 0 \<and> x - y >0"
     8.8 +  "\<exists>(y::'a::{linordered_field,number_ring, division_by_zero}) <2. x + 3* y < 0 \<and> x - y >0"
     8.9    by ferrack
    8.10  
    8.11 -lemma "~ (ALL x (y::'a::{ordered_field,number_ring, division_by_zero}). x < y --> 10*x < 11*y)"
    8.12 +lemma "~ (ALL x (y::'a::{linordered_field,number_ring, division_by_zero}). x < y --> 10*x < 11*y)"
    8.13    by ferrack
    8.14  
    8.15 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y. x < y --> (10*(x + 5*y + -1) < 60*y)"
    8.16 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y. x < y --> (10*(x + 5*y + -1) < 60*y)"
    8.17    by ferrack
    8.18  
    8.19 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y. x ~= y --> x < y"
    8.20 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y. x ~= y --> x < y"
    8.21    by ferrack
    8.22  
    8.23 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y. (x ~= y & 10*x ~= 9*y & 10*x < y) --> x < y"
    8.24 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y. (x ~= y & 10*x ~= 9*y & 10*x < y) --> x < y"
    8.25    by ferrack
    8.26  
    8.27 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y. (x ~= y & 5*x <= y) --> 500*x <= 100*y"
    8.28 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y. (x ~= y & 5*x <= y) --> 500*x <= 100*y"
    8.29    by ferrack
    8.30  
    8.31 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX (y::'a::{ordered_field,number_ring, division_by_zero}). 4*x + 3*y <= 0 & 4*x + 3*y >= -1)"
    8.32 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX (y::'a::{linordered_field,number_ring, division_by_zero}). 4*x + 3*y <= 0 & 4*x + 3*y >= -1)"
    8.33    by ferrack
    8.34  
    8.35 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) < 0. (EX (y::'a::{ordered_field,number_ring, division_by_zero}) > 0. 7*x + y > 0 & x - y <= 9)"
    8.36 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) < 0. (EX (y::'a::{linordered_field,number_ring, division_by_zero}) > 0. 7*x + y > 0 & x - y <= 9)"
    8.37    by ferrack
    8.38  
    8.39 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}). (0 < x & x < 1) --> (ALL y > 1. x + y ~= 1)"
    8.40 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}). (0 < x & x < 1) --> (ALL y > 1. x + y ~= 1)"
    8.41    by ferrack
    8.42  
    8.43 -lemma "EX x. (ALL (y::'a::{ordered_field,number_ring, division_by_zero}). y < 2 -->  2*(y - x) \<le> 0 )"
    8.44 +lemma "EX x. (ALL (y::'a::{linordered_field,number_ring, division_by_zero}). y < 2 -->  2*(y - x) \<le> 0 )"
    8.45    by ferrack
    8.46  
    8.47 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}). x < 10 | x > 20 | (EX y. y>= 0 & y <= 10 & x+y = 20)"
    8.48 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}). x < 10 | x > 20 | (EX y. y>= 0 & y <= 10 & x+y = 20)"
    8.49    by ferrack
    8.50  
    8.51 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y z. x + y < z --> y >= z --> x < 0"
    8.52 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y z. x + y < z --> y >= z --> x < 0"
    8.53    by ferrack
    8.54  
    8.55 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y z. x + 7*y < 5* z & 5*y >= 7*z & x < 0"
    8.56 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y z. x + 7*y < 5* z & 5*y >= 7*z & x < 0"
    8.57    by ferrack
    8.58  
    8.59 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y z. abs (x + y) <= z --> (abs z = z)"
    8.60 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y z. abs (x + y) <= z --> (abs z = z)"
    8.61    by ferrack
    8.62  
    8.63 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y z. x + 7*y - 5* z < 0 & 5*y + 7*z + 3*x < 0"
    8.64 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y z. x + 7*y - 5* z < 0 & 5*y + 7*z + 3*x < 0"
    8.65    by ferrack
    8.66  
    8.67 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y z. (abs (5*x+3*y+z) <= 5*x+3*y+z & abs (5*x+3*y+z) >= - (5*x+3*y+z)) | (abs (5*x+3*y+z) >= 5*x+3*y+z & abs (5*x+3*y+z) <= - (5*x+3*y+z))"
    8.68 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y z. (abs (5*x+3*y+z) <= 5*x+3*y+z & abs (5*x+3*y+z) >= - (5*x+3*y+z)) | (abs (5*x+3*y+z) >= 5*x+3*y+z & abs (5*x+3*y+z) <= - (5*x+3*y+z))"
    8.69    by ferrack
    8.70  
    8.71 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y. x < y --> (EX z>0. x+z = y)"
    8.72 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y. x < y --> (EX z>0. x+z = y)"
    8.73    by ferrack
    8.74  
    8.75 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y. x < y --> (EX z>0. x+z = y)"
    8.76 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y. x < y --> (EX z>0. x+z = y)"
    8.77    by ferrack
    8.78  
    8.79 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y. (EX z>0. abs (x - y) <= z )"
    8.80 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y. (EX z>0. abs (x - y) <= z )"
    8.81    by ferrack
    8.82  
    8.83 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y. (ALL z<0. (z < x --> z <= y) & (z > y --> z >= x))"
    8.84 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y. (ALL z<0. (z < x --> z <= y) & (z > y --> z >= x))"
    8.85    by ferrack
    8.86  
    8.87 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y. (ALL z>=0. abs (3*x+7*y) <= 2*z + 1)"
    8.88 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y. (ALL z>=0. abs (3*x+7*y) <= 2*z + 1)"
    8.89    by ferrack
    8.90  
    8.91 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y. (ALL z<0. (z < x --> z <= y) & (z > y --> z >= x))"
    8.92 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y. (ALL z<0. (z < x --> z <= y) & (z > y --> z >= x))"
    8.93    by ferrack
    8.94  
    8.95 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero})>0. (ALL y. (EX z. 13* abs z \<noteq> abs (12*y - x) & 5*x - 3*(abs y) <= 7*z))"
    8.96 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero})>0. (ALL y. (EX z. 13* abs z \<noteq> abs (12*y - x) & 5*x - 3*(abs y) <= 7*z))"
    8.97    by ferrack
    8.98  
    8.99 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}). abs (4*x + 17) < 4 & (ALL y . abs (x*34 - 34*y - 9) \<noteq> 0 \<longrightarrow> (EX z. 5*x - 3*abs y <= 7*z))"
   8.100 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}). abs (4*x + 17) < 4 & (ALL y . abs (x*34 - 34*y - 9) \<noteq> 0 \<longrightarrow> (EX z. 5*x - 3*abs y <= 7*z))"
   8.101    by ferrack
   8.102  
   8.103 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX y > abs (23*x - 9). (ALL z > abs (3*y - 19* abs x). x+z > 2*y))"
   8.104 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX y > abs (23*x - 9). (ALL z > abs (3*y - 19* abs x). x+z > 2*y))"
   8.105    by ferrack
   8.106  
   8.107 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX y< abs (3*x - 1). (ALL z >= (3*abs x - 1). abs (12*x - 13*y + 19*z) > abs (23*x) ))"
   8.108 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX y< abs (3*x - 1). (ALL z >= (3*abs x - 1). abs (12*x - 13*y + 19*z) > abs (23*x) ))"
   8.109    by ferrack
   8.110  
   8.111 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}). abs x < 100 & (ALL y > x. (EX z<2*y - x. 5*x - 3*y <= 7*z))"
   8.112 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}). abs x < 100 & (ALL y > x. (EX z<2*y - x. 5*x - 3*y <= 7*z))"
   8.113    by ferrack
   8.114  
   8.115 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y z w. 7*x<3*y --> 5*y < 7*z --> z < 2*w --> 7*(2*w-x) > 2*y"
   8.116 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y z w. 7*x<3*y --> 5*y < 7*z --> z < 2*w --> 7*(2*w-x) > 2*y"
   8.117    by ferrack
   8.118  
   8.119 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y z w. 5*x + 3*z - 17*w + abs (y - 8*x + z) <= 89"
   8.120 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y z w. 5*x + 3*z - 17*w + abs (y - 8*x + z) <= 89"
   8.121    by ferrack
   8.122  
   8.123 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y z w. 5*x + 3*z - 17*w + 7* (y - 8*x + z) <= max y (7*z - x + w)"
   8.124 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y z w. 5*x + 3*z - 17*w + 7* (y - 8*x + z) <= max y (7*z - x + w)"
   8.125    by ferrack
   8.126  
   8.127 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y z w. min (5*x + 3*z) (17*w) + 5* abs (y - 8*x + z) <= max y (7*z - x + w)"
   8.128 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y z w. min (5*x + 3*z) (17*w) + 5* abs (y - 8*x + z) <= max y (7*z - x + w)"
   8.129    by ferrack
   8.130  
   8.131 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y z. (EX w >= (x+y+z). w <= abs x + abs y + abs z)"
   8.132 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y z. (EX w >= (x+y+z). w <= abs x + abs y + abs z)"
   8.133    by ferrack
   8.134  
   8.135 -lemma "~(ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX y z w. 3* x + z*4 = 3*y & x + y < z & x> w & 3*x < w + y))"
   8.136 +lemma "~(ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX y z w. 3* x + z*4 = 3*y & x + y < z & x> w & 3*x < w + y))"
   8.137    by ferrack
   8.138  
   8.139 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y. (EX z w. abs (x-y) = (z-w) & z*1234 < 233*x & w ~= y)"
   8.140 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y. (EX z w. abs (x-y) = (z-w) & z*1234 < 233*x & w ~= y)"
   8.141    by ferrack
   8.142  
   8.143 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX y z w. min (5*x + 3*z) (17*w) + 5* abs (y - 8*x + z) <= max y (7*z - x + w))"
   8.144 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX y z w. min (5*x + 3*z) (17*w) + 5* abs (y - 8*x + z) <= max y (7*z - x + w))"
   8.145    by ferrack
   8.146  
   8.147 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y z. (ALL w >= abs (x+y+z). w >= abs x + abs y + abs z)"
   8.148 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y z. (ALL w >= abs (x+y+z). w >= abs x + abs y + abs z)"
   8.149    by ferrack
   8.150  
   8.151 -lemma "EX z. (ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y. (EX w >= (x+y+z). w <= abs x + abs y + abs z))"
   8.152 +lemma "EX z. (ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y. (EX w >= (x+y+z). w <= abs x + abs y + abs z))"
   8.153    by ferrack
   8.154  
   8.155 -lemma "EX z. (ALL (x::'a::{ordered_field,number_ring, division_by_zero}) < abs z. (EX y w. x< y & x < z & x> w & 3*x < w + y))"
   8.156 +lemma "EX z. (ALL (x::'a::{linordered_field,number_ring, division_by_zero}) < abs z. (EX y w. x< y & x < z & x> w & 3*x < w + y))"
   8.157    by ferrack
   8.158  
   8.159 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}) y. (EX z. (ALL w. abs (x-y) = abs (z-w) --> z < x & w ~= y))"
   8.160 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}) y. (EX z. (ALL w. abs (x-y) = abs (z-w) --> z < x & w ~= y))"
   8.161    by ferrack
   8.162  
   8.163 -lemma "EX y. (ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX z w. min (5*x + 3*z) (17*w) + 5* abs (y - 8*x + z) <= max y (7*z - x + w)))"
   8.164 +lemma "EX y. (ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX z w. min (5*x + 3*z) (17*w) + 5* abs (y - 8*x + z) <= max y (7*z - x + w)))"
   8.165    by ferrack
   8.166  
   8.167 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) z. (ALL w >= 13*x - 4*z. (EX y. w >= abs x + abs y + z))"
   8.168 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) z. (ALL w >= 13*x - 4*z. (EX y. w >= abs x + abs y + z))"
   8.169    by ferrack
   8.170  
   8.171 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}). (ALL y < x. (EX z > (x+y).
   8.172 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}). (ALL y < x. (EX z > (x+y).
   8.173    (ALL w. 5*w + 10*x - z >= y --> w + 7*x + 3*z >= 2*y)))"
   8.174    by ferrack
   8.175  
   8.176 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}). (ALL y. (EX z > y.
   8.177 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}). (ALL y. (EX z > y.
   8.178    (ALL w . w < 13 --> w + 10*x - z >= y --> 5*w + 7*x + 13*z >= 2*y)))"
   8.179    by ferrack
   8.180  
   8.181 -lemma "EX (x::'a::{ordered_field,number_ring, division_by_zero}) y z w. min (5*x + 3*z) (17*w) + 5* abs (y - 8*x + z) <= max y (7*z - x + w)"
   8.182 +lemma "EX (x::'a::{linordered_field,number_ring, division_by_zero}) y z w. min (5*x + 3*z) (17*w) + 5* abs (y - 8*x + z) <= max y (7*z - x + w)"
   8.183    by ferrack
   8.184  
   8.185 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX y. (ALL z>19. y <= x + z & (EX w. abs (y - x) < w)))"
   8.186 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX y. (ALL z>19. y <= x + z & (EX w. abs (y - x) < w)))"
   8.187    by ferrack
   8.188  
   8.189 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX y. (ALL z>19. y <= x + z & (EX w. abs (x + z) < w - y)))"
   8.190 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX y. (ALL z>19. y <= x + z & (EX w. abs (x + z) < w - y)))"
   8.191    by ferrack
   8.192  
   8.193 -lemma "ALL (x::'a::{ordered_field,number_ring, division_by_zero}). (EX y. abs y ~= abs x & (ALL z> max x y. (EX w. w ~= y & w ~= z & 3*w - z >= x + y)))"
   8.194 +lemma "ALL (x::'a::{linordered_field,number_ring, division_by_zero}). (EX y. abs y ~= abs x & (ALL z> max x y. (EX w. w ~= y & w ~= z & 3*w - z >= x + y)))"
   8.195    by ferrack
   8.196  
   8.197  end
     9.1 --- a/src/HOL/Fact.thy	Fri Feb 05 14:33:31 2010 +0100
     9.2 +++ b/src/HOL/Fact.thy	Fri Feb 05 14:33:50 2010 +0100
     9.3 @@ -266,15 +266,15 @@
     9.4  lemma of_nat_fact_not_zero [simp]: "of_nat (fact n) \<noteq> (0::'a::semiring_char_0)"
     9.5  by auto
     9.6  
     9.7 -lemma of_nat_fact_gt_zero [simp]: "(0::'a::{ordered_semidom}) < of_nat(fact n)" by auto
     9.8 +lemma of_nat_fact_gt_zero [simp]: "(0::'a::{linordered_semidom}) < of_nat(fact n)" by auto
     9.9  
    9.10 -lemma of_nat_fact_ge_zero [simp]: "(0::'a::ordered_semidom) \<le> of_nat(fact n)"
    9.11 +lemma of_nat_fact_ge_zero [simp]: "(0::'a::linordered_semidom) \<le> of_nat(fact n)"
    9.12  by simp
    9.13  
    9.14 -lemma inv_of_nat_fact_gt_zero [simp]: "(0::'a::ordered_field) < inverse (of_nat (fact n))"
    9.15 +lemma inv_of_nat_fact_gt_zero [simp]: "(0::'a::linordered_field) < inverse (of_nat (fact n))"
    9.16  by (auto simp add: positive_imp_inverse_positive)
    9.17  
    9.18 -lemma inv_of_nat_fact_ge_zero [simp]: "(0::'a::ordered_field) \<le> inverse (of_nat (fact n))"
    9.19 +lemma inv_of_nat_fact_ge_zero [simp]: "(0::'a::linordered_field) \<le> inverse (of_nat (fact n))"
    9.20  by (auto intro: order_less_imp_le)
    9.21  
    9.22  end
    10.1 --- a/src/HOL/Finite_Set.thy	Fri Feb 05 14:33:31 2010 +0100
    10.2 +++ b/src/HOL/Finite_Set.thy	Fri Feb 05 14:33:50 2010 +0100
    10.3 @@ -830,7 +830,7 @@
    10.4  
    10.5  end
    10.6  
    10.7 -context lower_semilattice
    10.8 +context semilattice_inf
    10.9  begin
   10.10  
   10.11  lemma ab_semigroup_idem_mult_inf: "ab_semigroup_idem_mult inf"
   10.12 @@ -857,20 +857,20 @@
   10.13  
   10.14  end
   10.15  
   10.16 -context upper_semilattice
   10.17 +context semilattice_sup
   10.18  begin
   10.19  
   10.20  lemma ab_semigroup_idem_mult_sup: "ab_semigroup_idem_mult sup"
   10.21 -by (rule lower_semilattice.ab_semigroup_idem_mult_inf)(rule dual_semilattice)
   10.22 +by (rule semilattice_inf.ab_semigroup_idem_mult_inf)(rule dual_semilattice)
   10.23  
   10.24  lemma fold_sup_insert[simp]: "finite A \<Longrightarrow> fold sup b (insert a A) = sup a (fold sup b A)"
   10.25 -by(rule lower_semilattice.fold_inf_insert)(rule dual_semilattice)
   10.26 +by(rule semilattice_inf.fold_inf_insert)(rule dual_semilattice)
   10.27  
   10.28  lemma fold_sup_le_sup: "finite A \<Longrightarrow> ALL a:A. a \<le> b \<Longrightarrow> fold sup c A \<le> sup b c"
   10.29 -by(rule lower_semilattice.inf_le_fold_inf)(rule dual_semilattice)
   10.30 +by(rule semilattice_inf.inf_le_fold_inf)(rule dual_semilattice)
   10.31  
   10.32  lemma sup_le_fold_sup: "finite A \<Longrightarrow> a \<in> A \<Longrightarrow> sup a b \<le> fold sup b A"
   10.33 -by(rule lower_semilattice.fold_inf_le_inf)(rule dual_semilattice)
   10.34 +by(rule semilattice_inf.fold_inf_le_inf)(rule dual_semilattice)
   10.35  
   10.36  end
   10.37  
   10.38 @@ -1486,7 +1486,7 @@
   10.39  qed
   10.40  
   10.41  lemma setsum_mono:
   10.42 -  assumes le: "\<And>i. i\<in>K \<Longrightarrow> f (i::'a) \<le> ((g i)::('b::{comm_monoid_add, pordered_ab_semigroup_add}))"
   10.43 +  assumes le: "\<And>i. i\<in>K \<Longrightarrow> f (i::'a) \<le> ((g i)::('b::{comm_monoid_add, ordered_ab_semigroup_add}))"
   10.44    shows "(\<Sum>i\<in>K. f i) \<le> (\<Sum>i\<in>K. g i)"
   10.45  proof (cases "finite K")
   10.46    case True
   10.47 @@ -1505,7 +1505,7 @@
   10.48  qed
   10.49  
   10.50  lemma setsum_strict_mono:
   10.51 -  fixes f :: "'a \<Rightarrow> 'b::{pordered_cancel_ab_semigroup_add,comm_monoid_add}"
   10.52 +  fixes f :: "'a \<Rightarrow> 'b::{ordered_cancel_ab_semigroup_add,comm_monoid_add}"
   10.53    assumes "finite A"  "A \<noteq> {}"
   10.54      and "!!x. x:A \<Longrightarrow> f x < g x"
   10.55    shows "setsum f A < setsum g A"
   10.56 @@ -1534,7 +1534,7 @@
   10.57  qed
   10.58  
   10.59  lemma setsum_nonneg:
   10.60 -  assumes nn: "\<forall>x\<in>A. (0::'a::{pordered_ab_semigroup_add,comm_monoid_add}) \<le> f x"
   10.61 +  assumes nn: "\<forall>x\<in>A. (0::'a::{ordered_ab_semigroup_add,comm_monoid_add}) \<le> f x"
   10.62    shows "0 \<le> setsum f A"
   10.63  proof (cases "finite A")
   10.64    case True thus ?thesis using nn
   10.65 @@ -1550,7 +1550,7 @@
   10.66  qed
   10.67  
   10.68  lemma setsum_nonpos:
   10.69 -  assumes np: "\<forall>x\<in>A. f x \<le> (0::'a::{pordered_ab_semigroup_add,comm_monoid_add})"
   10.70 +  assumes np: "\<forall>x\<in>A. f x \<le> (0::'a::{ordered_ab_semigroup_add,comm_monoid_add})"
   10.71    shows "setsum f A \<le> 0"
   10.72  proof (cases "finite A")
   10.73    case True thus ?thesis using np
   10.74 @@ -1566,7 +1566,7 @@
   10.75  qed
   10.76  
   10.77  lemma setsum_mono2:
   10.78 -fixes f :: "'a \<Rightarrow> 'b :: {pordered_ab_semigroup_add_imp_le,comm_monoid_add}"
   10.79 +fixes f :: "'a \<Rightarrow> 'b :: {ordered_ab_semigroup_add_imp_le,comm_monoid_add}"
   10.80  assumes fin: "finite B" and sub: "A \<subseteq> B" and nn: "\<And>b. b \<in> B-A \<Longrightarrow> 0 \<le> f b"
   10.81  shows "setsum f A \<le> setsum f B"
   10.82  proof -
   10.83 @@ -1580,7 +1580,7 @@
   10.84  
   10.85  lemma setsum_mono3: "finite B ==> A <= B ==> 
   10.86      ALL x: B - A. 
   10.87 -      0 <= ((f x)::'a::{comm_monoid_add,pordered_ab_semigroup_add}) ==>
   10.88 +      0 <= ((f x)::'a::{comm_monoid_add,ordered_ab_semigroup_add}) ==>
   10.89          setsum f A <= setsum f B"
   10.90    apply (subgoal_tac "setsum f B = setsum f A + setsum f (B - A)")
   10.91    apply (erule ssubst)
   10.92 @@ -1640,7 +1640,7 @@
   10.93  qed
   10.94  
   10.95  lemma setsum_abs[iff]: 
   10.96 -  fixes f :: "'a => ('b::pordered_ab_group_add_abs)"
   10.97 +  fixes f :: "'a => ('b::ordered_ab_group_add_abs)"
   10.98    shows "abs (setsum f A) \<le> setsum (%i. abs(f i)) A"
   10.99  proof (cases "finite A")
  10.100    case True
  10.101 @@ -1656,7 +1656,7 @@
  10.102  qed
  10.103  
  10.104  lemma setsum_abs_ge_zero[iff]: 
  10.105 -  fixes f :: "'a => ('b::pordered_ab_group_add_abs)"
  10.106 +  fixes f :: "'a => ('b::ordered_ab_group_add_abs)"
  10.107    shows "0 \<le> setsum (%i. abs(f i)) A"
  10.108  proof (cases "finite A")
  10.109    case True
  10.110 @@ -1671,7 +1671,7 @@
  10.111  qed
  10.112  
  10.113  lemma abs_setsum_abs[simp]: 
  10.114 -  fixes f :: "'a => ('b::pordered_ab_group_add_abs)"
  10.115 +  fixes f :: "'a => ('b::ordered_ab_group_add_abs)"
  10.116    shows "abs (\<Sum>a\<in>A. abs(f a)) = (\<Sum>a\<in>A. abs(f a))"
  10.117  proof (cases "finite A")
  10.118    case True
  10.119 @@ -1946,10 +1946,10 @@
  10.120  done
  10.121  
  10.122  lemma setprod_nonneg [rule_format]:
  10.123 -   "(ALL x: A. (0::'a::ordered_semidom) \<le> f x) --> 0 \<le> setprod f A"
  10.124 +   "(ALL x: A. (0::'a::linordered_semidom) \<le> f x) --> 0 \<le> setprod f A"
  10.125  by (cases "finite A", induct set: finite, simp_all add: mult_nonneg_nonneg)
  10.126  
  10.127 -lemma setprod_pos [rule_format]: "(ALL x: A. (0::'a::ordered_semidom) < f x)
  10.128 +lemma setprod_pos [rule_format]: "(ALL x: A. (0::'a::linordered_semidom) < f x)
  10.129    --> 0 < setprod f A"
  10.130  by (cases "finite A", induct set: finite, simp_all add: mult_pos_pos)
  10.131  
  10.132 @@ -2289,7 +2289,7 @@
  10.133  
  10.134  
  10.135  lemma setsum_bounded:
  10.136 -  assumes le: "\<And>i. i\<in>A \<Longrightarrow> f i \<le> (K::'a::{semiring_1, pordered_ab_semigroup_add})"
  10.137 +  assumes le: "\<And>i. i\<in>A \<Longrightarrow> f i \<le> (K::'a::{semiring_1, ordered_ab_semigroup_add})"
  10.138    shows "setsum f A \<le> of_nat(card A) * K"
  10.139  proof (cases "finite A")
  10.140    case True
  10.141 @@ -2791,7 +2791,7 @@
  10.142    over (non-empty) sets by means of @{text fold1}.
  10.143  *}
  10.144  
  10.145 -context lower_semilattice
  10.146 +context semilattice_inf
  10.147  begin
  10.148  
  10.149  lemma below_fold1_iff:
  10.150 @@ -2859,7 +2859,7 @@
  10.151  apply(erule exE)
  10.152  apply(rule order_trans)
  10.153  apply(erule (1) fold1_belowI)
  10.154 -apply(erule (1) lower_semilattice.fold1_belowI [OF dual_semilattice])
  10.155 +apply(erule (1) semilattice_inf.fold1_belowI [OF dual_semilattice])
  10.156  done
  10.157  
  10.158  lemma sup_Inf_absorb [simp]:
  10.159 @@ -2871,7 +2871,7 @@
  10.160  lemma inf_Sup_absorb [simp]:
  10.161    "finite A \<Longrightarrow> a \<in> A \<Longrightarrow> inf a (\<Squnion>\<^bsub>fin\<^esub>A) = a"
  10.162  by (simp add: Sup_fin_def inf_absorb1
  10.163 -  lower_semilattice.fold1_belowI [OF dual_semilattice])
  10.164 +  semilattice_inf.fold1_belowI [OF dual_semilattice])
  10.165  
  10.166  end
  10.167  
  10.168 @@ -2991,7 +2991,7 @@
  10.169    proof qed (auto simp add: max_def)
  10.170  
  10.171  lemma max_lattice:
  10.172 -  "lower_semilattice (op \<ge>) (op >) max"
  10.173 +  "semilattice_inf (op \<ge>) (op >) max"
  10.174    by (fact min_max.dual_semilattice)
  10.175  
  10.176  lemma dual_max:
  10.177 @@ -3158,7 +3158,7 @@
  10.178    assumes "finite A" and "x \<in> A"
  10.179    shows "x \<le> Max A"
  10.180  proof -
  10.181 -  interpret lower_semilattice "op \<ge>" "op >" max
  10.182 +  interpret semilattice_inf "op \<ge>" "op >" max
  10.183      by (rule max_lattice)
  10.184    from assms show ?thesis by (simp add: Max_def fold1_belowI)
  10.185  qed
  10.186 @@ -3172,7 +3172,7 @@
  10.187    assumes "finite A" and "A \<noteq> {}"
  10.188    shows "Max A \<le> x \<longleftrightarrow> (\<forall>a\<in>A. a \<le> x)"
  10.189  proof -
  10.190 -  interpret lower_semilattice "op \<ge>" "op >" max
  10.191 +  interpret semilattice_inf "op \<ge>" "op >" max
  10.192      by (rule max_lattice)
  10.193    from assms show ?thesis by (simp add: Max_def below_fold1_iff)
  10.194  qed
  10.195 @@ -3293,7 +3293,7 @@
  10.196  
  10.197  end
  10.198  
  10.199 -context ordered_ab_semigroup_add
  10.200 +context linordered_ab_semigroup_add
  10.201  begin
  10.202  
  10.203  lemma add_Min_commute:
  10.204 @@ -3347,12 +3347,12 @@
  10.205  proof
  10.206  qed auto
  10.207  
  10.208 -lemma (in lower_semilattice) fun_left_comm_idem_inf:
  10.209 +lemma (in semilattice_inf) fun_left_comm_idem_inf:
  10.210    "fun_left_comm_idem inf"
  10.211  proof
  10.212  qed (auto simp add: inf_left_commute)
  10.213  
  10.214 -lemma (in upper_semilattice) fun_left_comm_idem_sup:
  10.215 +lemma (in semilattice_sup) fun_left_comm_idem_sup:
  10.216    "fun_left_comm_idem sup"
  10.217  proof
  10.218  qed (auto simp add: sup_left_commute)
    11.1 --- a/src/HOL/GCD.thy	Fri Feb 05 14:33:31 2010 +0100
    11.2 +++ b/src/HOL/GCD.thy	Fri Feb 05 14:33:50 2010 +0100
    11.3 @@ -1445,12 +1445,12 @@
    11.4  subsubsection {* The complete divisibility lattice *}
    11.5  
    11.6  
    11.7 -interpretation gcd_semilattice_nat: lower_semilattice "op dvd" "(%m n::nat. m dvd n & ~ n dvd m)" gcd
    11.8 +interpretation gcd_semilattice_nat: semilattice_inf "op dvd" "(%m n::nat. m dvd n & ~ n dvd m)" gcd
    11.9  proof
   11.10    case goal3 thus ?case by(metis gcd_unique_nat)
   11.11  qed auto
   11.12  
   11.13 -interpretation lcm_semilattice_nat: upper_semilattice "op dvd" "(%m n::nat. m dvd n & ~ n dvd m)" lcm
   11.14 +interpretation lcm_semilattice_nat: semilattice_sup "op dvd" "(%m n::nat. m dvd n & ~ n dvd m)" lcm
   11.15  proof
   11.16    case goal3 thus ?case by(metis lcm_unique_nat)
   11.17  qed auto
    12.1 --- a/src/HOL/Import/HOL/real.imp	Fri Feb 05 14:33:31 2010 +0100
    12.2 +++ b/src/HOL/Import/HOL/real.imp	Fri Feb 05 14:33:50 2010 +0100
    12.3 @@ -147,7 +147,7 @@
    12.4    "REAL_LT_TOTAL" > "HOL4Compat.REAL_LT_TOTAL"
    12.5    "REAL_LT_SUB_RADD" > "OrderedGroup.compare_rls_6"
    12.6    "REAL_LT_SUB_LADD" > "OrderedGroup.compare_rls_7"
    12.7 -  "REAL_LT_RMUL_IMP" > "Ring_and_Field.ordered_semiring_strict_class.mult_strict_right_mono"
    12.8 +  "REAL_LT_RMUL_IMP" > "Ring_and_Field.mult_strict_right_mono"
    12.9    "REAL_LT_RMUL_0" > "HOL4Real.real.REAL_LT_RMUL_0"
   12.10    "REAL_LT_RMUL" > "RealDef.real_mult_less_iff1"
   12.11    "REAL_LT_REFL" > "Orderings.order_less_irrefl"
   12.12 @@ -161,7 +161,7 @@
   12.13    "REAL_LT_MULTIPLE" > "HOL4Real.real.REAL_LT_MULTIPLE"
   12.14    "REAL_LT_MUL2" > "Ring_and_Field.mult_strict_mono'"
   12.15    "REAL_LT_MUL" > "Ring_and_Field.mult_pos_pos"
   12.16 -  "REAL_LT_LMUL_IMP" > "Ring_and_Field.ordered_comm_semiring_strict_class.mult_strict_mono"
   12.17 +  "REAL_LT_LMUL_IMP" > "Ring_and_Field.linordered_comm_semiring_strict_class.mult_strict_mono"
   12.18    "REAL_LT_LMUL_0" > "HOL4Real.real.REAL_LT_LMUL_0"
   12.19    "REAL_LT_LMUL" > "HOL4Real.real.REAL_LT_LMUL"
   12.20    "REAL_LT_LE" > "Orderings.order_class.order_less_le"
   12.21 @@ -188,7 +188,7 @@
   12.22    "REAL_LT_ADD1" > "HOL4Real.real.REAL_LT_ADD1"
   12.23    "REAL_LT_ADD" > "OrderedGroup.add_pos_pos"
   12.24    "REAL_LT_1" > "HOL4Real.real.REAL_LT_1"
   12.25 -  "REAL_LT_01" > "Ring_and_Field.ordered_semidom_class.zero_less_one"
   12.26 +  "REAL_LT_01" > "Ring_and_Field.zero_less_one"
   12.27    "REAL_LTE_TRANS" > "Set.basic_trans_rules_24"
   12.28    "REAL_LTE_TOTAL" > "HOL4Real.real.REAL_LTE_TOTAL"
   12.29    "REAL_LTE_ANTSYM" > "HOL4Real.real.REAL_LTE_ANTSYM"
   12.30 @@ -204,7 +204,7 @@
   12.31    "REAL_LE_SUB_LADD" > "OrderedGroup.compare_rls_9"
   12.32    "REAL_LE_SQUARE" > "Ring_and_Field.zero_le_square"
   12.33    "REAL_LE_RNEG" > "OrderedGroup.le_eq_neg"
   12.34 -  "REAL_LE_RMUL_IMP" > "Ring_and_Field.pordered_semiring_class.mult_right_mono"
   12.35 +  "REAL_LE_RMUL_IMP" > "Ring_and_Field.mult_right_mono"
   12.36    "REAL_LE_RMUL" > "RealDef.real_mult_le_cancel_iff1"
   12.37    "REAL_LE_REFL" > "Finite_Set.max.f_below.below_refl"
   12.38    "REAL_LE_RDIV_EQ" > "Ring_and_Field.pos_le_divide_eq"
   12.39 @@ -220,11 +220,11 @@
   12.40    "REAL_LE_MUL" > "Ring_and_Field.mult_nonneg_nonneg"
   12.41    "REAL_LE_LT" > "Orderings.order_le_less"
   12.42    "REAL_LE_LNEG" > "RealDef.real_0_le_add_iff"
   12.43 -  "REAL_LE_LMUL_IMP" > "Ring_and_Field.pordered_comm_semiring_class.mult_mono"
   12.44 +  "REAL_LE_LMUL_IMP" > "Ring_and_Field.mult_mono"
   12.45    "REAL_LE_LMUL" > "RealDef.real_mult_le_cancel_iff2"
   12.46    "REAL_LE_LDIV_EQ" > "Ring_and_Field.pos_divide_le_eq"
   12.47    "REAL_LE_LDIV" > "Ring_and_Field.mult_imp_div_pos_le"
   12.48 -  "REAL_LE_LADD_IMP" > "OrderedGroup.pordered_ab_semigroup_add_class.add_left_mono"
   12.49 +  "REAL_LE_LADD_IMP" > "OrderedGroup.add_left_mono"
   12.50    "REAL_LE_LADD" > "OrderedGroup.add_le_cancel_left"
   12.51    "REAL_LE_INV_EQ" > "Ring_and_Field.inverse_nonnegative_iff_nonnegative"
   12.52    "REAL_LE_INV" > "HOL4Real.real.REAL_LE_INV"
    13.1 --- a/src/HOL/Int.thy	Fri Feb 05 14:33:31 2010 +0100
    13.2 +++ b/src/HOL/Int.thy	Fri Feb 05 14:33:50 2010 +0100
    13.3 @@ -208,7 +208,7 @@
    13.4  
    13.5  end
    13.6  
    13.7 -instance int :: pordered_cancel_ab_semigroup_add
    13.8 +instance int :: ordered_cancel_ab_semigroup_add
    13.9  proof
   13.10    fix i j k :: int
   13.11    show "i \<le> j \<Longrightarrow> k + i \<le> k + j"
   13.12 @@ -245,7 +245,7 @@
   13.13  done
   13.14  
   13.15  text{*The integers form an ordered integral domain*}
   13.16 -instance int :: ordered_idom
   13.17 +instance int :: linordered_idom
   13.18  proof
   13.19    fix i j k :: int
   13.20    show "i < j \<Longrightarrow> 0 < k \<Longrightarrow> k * i < k * j"
   13.21 @@ -256,7 +256,7 @@
   13.22      by (simp only: zsgn_def)
   13.23  qed
   13.24  
   13.25 -instance int :: lordered_ring
   13.26 +instance int :: lattice_ring
   13.27  proof  
   13.28    fix k :: int
   13.29    show "abs k = sup k (- k)"
   13.30 @@ -331,7 +331,7 @@
   13.31  
   13.32  end
   13.33  
   13.34 -context ordered_idom
   13.35 +context linordered_idom
   13.36  begin
   13.37  
   13.38  lemma of_int_le_iff [simp]:
   13.39 @@ -370,8 +370,8 @@
   13.40  
   13.41  end
   13.42  
   13.43 -text{*Every @{text ordered_idom} has characteristic zero.*}
   13.44 -subclass (in ordered_idom) ring_char_0 by intro_locales
   13.45 +text{*Every @{text linordered_idom} has characteristic zero.*}
   13.46 +subclass (in linordered_idom) ring_char_0 by intro_locales
   13.47  
   13.48  lemma of_int_eq_id [simp]: "of_int = id"
   13.49  proof
   13.50 @@ -529,7 +529,7 @@
   13.51        in theory @{text Ring_and_Field}.
   13.52        But is it really better than just rewriting with @{text abs_if}?*}
   13.53  lemma abs_split [arith_split,noatp]:
   13.54 -     "P(abs(a::'a::ordered_idom)) = ((0 \<le> a --> P a) & (a < 0 --> P(-a)))"
   13.55 +     "P(abs(a::'a::linordered_idom)) = ((0 \<le> a --> P a) & (a < 0 --> P(-a)))"
   13.56  by (force dest: order_less_le_trans simp add: abs_if linorder_not_less)
   13.57  
   13.58  lemma negD: "(x \<Colon> int) < 0 \<Longrightarrow> \<exists>n. x = - (of_nat (Suc n))"
   13.59 @@ -804,7 +804,7 @@
   13.60  text {* Preliminaries *}
   13.61  
   13.62  lemma even_less_0_iff:
   13.63 -  "a + a < 0 \<longleftrightarrow> a < (0::'a::ordered_idom)"
   13.64 +  "a + a < 0 \<longleftrightarrow> a < (0::'a::linordered_idom)"
   13.65  proof -
   13.66    have "a + a < 0 \<longleftrightarrow> (1+1)*a < 0" by (simp add: left_distrib)
   13.67    also have "(1+1)*a < 0 \<longleftrightarrow> a < 0"
   13.68 @@ -1147,7 +1147,7 @@
   13.69  subsubsection {* The Less-Than Relation *}
   13.70  
   13.71  lemma double_less_0_iff:
   13.72 -  "(a + a < 0) = (a < (0::'a::ordered_idom))"
   13.73 +  "(a + a < 0) = (a < (0::'a::linordered_idom))"
   13.74  proof -
   13.75    have "(a + a < 0) = ((1+1)*a < 0)" by (simp add: left_distrib)
   13.76    also have "... = (a < 0)"
   13.77 @@ -1180,7 +1180,7 @@
   13.78  text {* Absolute value (@{term abs}) *}
   13.79  
   13.80  lemma abs_number_of:
   13.81 -  "abs(number_of x::'a::{ordered_idom,number_ring}) =
   13.82 +  "abs(number_of x::'a::{linordered_idom,number_ring}) =
   13.83     (if number_of x < (0::'a) then -number_of x else number_of x)"
   13.84    by (simp add: abs_if)
   13.85  
   13.86 @@ -1214,11 +1214,11 @@
   13.87  text {* Simplification of relational operations *}
   13.88  
   13.89  lemma less_number_of [simp]:
   13.90 -  "(number_of x::'a::{ordered_idom,number_ring}) < number_of y \<longleftrightarrow> x < y"
   13.91 +  "(number_of x::'a::{linordered_idom,number_ring}) < number_of y \<longleftrightarrow> x < y"
   13.92    unfolding number_of_eq by (rule of_int_less_iff)
   13.93  
   13.94  lemma le_number_of [simp]:
   13.95 -  "(number_of x::'a::{ordered_idom,number_ring}) \<le> number_of y \<longleftrightarrow> x \<le> y"
   13.96 +  "(number_of x::'a::{linordered_idom,number_ring}) \<le> number_of y \<longleftrightarrow> x \<le> y"
   13.97    unfolding number_of_eq by (rule of_int_le_iff)
   13.98  
   13.99  lemma eq_number_of [simp]:
  13.100 @@ -1362,7 +1362,7 @@
  13.101  
  13.102  lemma Ints_odd_less_0: 
  13.103    assumes in_Ints: "a \<in> Ints"
  13.104 -  shows "(1 + a + a < 0) = (a < (0::'a::ordered_idom))"
  13.105 +  shows "(1 + a + a < 0) = (a < (0::'a::linordered_idom))"
  13.106  proof -
  13.107    from in_Ints have "a \<in> range of_int" unfolding Ints_def [symmetric] .
  13.108    then obtain z where a: "a = of_int z" ..
  13.109 @@ -1519,11 +1519,11 @@
  13.110    finally show ?thesis .
  13.111  qed
  13.112  
  13.113 -lemma abs_minus_one [simp]: "abs (-1) = (1::'a::{ordered_idom,number_ring})"
  13.114 +lemma abs_minus_one [simp]: "abs (-1) = (1::'a::{linordered_idom,number_ring})"
  13.115  by (simp add: abs_if)
  13.116  
  13.117  lemma abs_power_minus_one [simp]:
  13.118 -  "abs(-1 ^ n) = (1::'a::{ordered_idom,number_ring})"
  13.119 +  "abs(-1 ^ n) = (1::'a::{linordered_idom,number_ring})"
  13.120  by (simp add: power_abs)
  13.121  
  13.122  lemma of_int_number_of_eq [simp]:
  13.123 @@ -1906,12 +1906,12 @@
  13.124  text{*To Simplify Inequalities Where One Side is the Constant 1*}
  13.125  
  13.126  lemma less_minus_iff_1 [simp,noatp]:
  13.127 -  fixes b::"'b::{ordered_idom,number_ring}"
  13.128 +  fixes b::"'b::{linordered_idom,number_ring}"
  13.129    shows "(1 < - b) = (b < -1)"
  13.130  by auto
  13.131  
  13.132  lemma le_minus_iff_1 [simp,noatp]:
  13.133 -  fixes b::"'b::{ordered_idom,number_ring}"
  13.134 +  fixes b::"'b::{linordered_idom,number_ring}"
  13.135    shows "(1 \<le> - b) = (b \<le> -1)"
  13.136  by auto
  13.137  
  13.138 @@ -1921,12 +1921,12 @@
  13.139  by (subst equation_minus_iff, auto)
  13.140  
  13.141  lemma minus_less_iff_1 [simp,noatp]:
  13.142 -  fixes a::"'b::{ordered_idom,number_ring}"
  13.143 +  fixes a::"'b::{linordered_idom,number_ring}"
  13.144    shows "(- a < 1) = (-1 < a)"
  13.145  by auto
  13.146  
  13.147  lemma minus_le_iff_1 [simp,noatp]:
  13.148 -  fixes a::"'b::{ordered_idom,number_ring}"
  13.149 +  fixes a::"'b::{linordered_idom,number_ring}"
  13.150    shows "(- a \<le> 1) = (-1 \<le> a)"
  13.151  by auto
  13.152  
  13.153 @@ -1990,7 +1990,7 @@
  13.154  by (simp add: divide_inverse inverse_minus_eq)
  13.155  
  13.156  lemma half_gt_zero_iff:
  13.157 -     "(0 < r/2) = (0 < (r::'a::{ordered_field,division_by_zero,number_ring}))"
  13.158 +     "(0 < r/2) = (0 < (r::'a::{linordered_field,division_by_zero,number_ring}))"
  13.159  by auto
  13.160  
  13.161  lemmas half_gt_zero [simp] = half_gt_zero_iff [THEN iffD2, standard]
    14.1 --- a/src/HOL/Lattices.thy	Fri Feb 05 14:33:31 2010 +0100
    14.2 +++ b/src/HOL/Lattices.thy	Fri Feb 05 14:33:50 2010 +0100
    14.3 @@ -16,13 +16,13 @@
    14.4    top ("\<top>") and
    14.5    bot ("\<bottom>")
    14.6  
    14.7 -class lower_semilattice = order +
    14.8 +class semilattice_inf = order +
    14.9    fixes inf :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<sqinter>" 70)
   14.10    assumes inf_le1 [simp]: "x \<sqinter> y \<sqsubseteq> x"
   14.11    and inf_le2 [simp]: "x \<sqinter> y \<sqsubseteq> y"
   14.12    and inf_greatest: "x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<sqinter> z"
   14.13  
   14.14 -class upper_semilattice = order +
   14.15 +class semilattice_sup = order +
   14.16    fixes sup :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<squnion>" 65)
   14.17    assumes sup_ge1 [simp]: "x \<sqsubseteq> x \<squnion> y"
   14.18    and sup_ge2 [simp]: "y \<sqsubseteq> x \<squnion> y"
   14.19 @@ -32,18 +32,18 @@
   14.20  text {* Dual lattice *}
   14.21  
   14.22  lemma dual_semilattice:
   14.23 -  "lower_semilattice (op \<ge>) (op >) sup"
   14.24 -by (rule lower_semilattice.intro, rule dual_order)
   14.25 +  "semilattice_inf (op \<ge>) (op >) sup"
   14.26 +by (rule semilattice_inf.intro, rule dual_order)
   14.27    (unfold_locales, simp_all add: sup_least)
   14.28  
   14.29  end
   14.30  
   14.31 -class lattice = lower_semilattice + upper_semilattice
   14.32 +class lattice = semilattice_inf + semilattice_sup
   14.33  
   14.34  
   14.35  subsubsection {* Intro and elim rules*}
   14.36  
   14.37 -context lower_semilattice
   14.38 +context semilattice_inf
   14.39  begin
   14.40  
   14.41  lemma le_infI1:
   14.42 @@ -69,13 +69,13 @@
   14.43    by (auto intro: le_infI1 antisym dest: eq_iff [THEN iffD1])
   14.44  
   14.45  lemma mono_inf:
   14.46 -  fixes f :: "'a \<Rightarrow> 'b\<Colon>lower_semilattice"
   14.47 +  fixes f :: "'a \<Rightarrow> 'b\<Colon>semilattice_inf"
   14.48    shows "mono f \<Longrightarrow> f (A \<sqinter> B) \<sqsubseteq> f A \<sqinter> f B"
   14.49    by (auto simp add: mono_def intro: Lattices.inf_greatest)
   14.50  
   14.51  end
   14.52  
   14.53 -context upper_semilattice
   14.54 +context semilattice_sup
   14.55  begin
   14.56  
   14.57  lemma le_supI1:
   14.58 @@ -103,7 +103,7 @@
   14.59    by (auto intro: le_supI2 antisym dest: eq_iff [THEN iffD1])
   14.60  
   14.61  lemma mono_sup:
   14.62 -  fixes f :: "'a \<Rightarrow> 'b\<Colon>upper_semilattice"
   14.63 +  fixes f :: "'a \<Rightarrow> 'b\<Colon>semilattice_sup"
   14.64    shows "mono f \<Longrightarrow> f A \<squnion> f B \<sqsubseteq> f (A \<squnion> B)"
   14.65    by (auto simp add: mono_def intro: Lattices.sup_least)
   14.66  
   14.67 @@ -112,7 +112,7 @@
   14.68  
   14.69  subsubsection {* Equational laws *}
   14.70  
   14.71 -sublocale lower_semilattice < inf!: semilattice inf
   14.72 +sublocale semilattice_inf < inf!: semilattice inf
   14.73  proof
   14.74    fix a b c
   14.75    show "(a \<sqinter> b) \<sqinter> c = a \<sqinter> (b \<sqinter> c)"
   14.76 @@ -123,7 +123,7 @@
   14.77      by (rule antisym) auto
   14.78  qed
   14.79  
   14.80 -context lower_semilattice
   14.81 +context semilattice_inf
   14.82  begin
   14.83  
   14.84  lemma inf_assoc: "(x \<sqinter> y) \<sqinter> z = x \<sqinter> (y \<sqinter> z)"
   14.85 @@ -151,7 +151,7 @@
   14.86  
   14.87  end
   14.88  
   14.89 -sublocale upper_semilattice < sup!: semilattice sup
   14.90 +sublocale semilattice_sup < sup!: semilattice sup
   14.91  proof
   14.92    fix a b c
   14.93    show "(a \<squnion> b) \<squnion> c = a \<squnion> (b \<squnion> c)"
   14.94 @@ -162,7 +162,7 @@
   14.95      by (rule antisym) auto
   14.96  qed
   14.97  
   14.98 -context upper_semilattice
   14.99 +context semilattice_sup
  14.100  begin
  14.101  
  14.102  lemma sup_assoc: "(x \<squnion> y) \<squnion> z = x \<squnion> (y \<squnion> z)"
  14.103 @@ -195,7 +195,7 @@
  14.104  
  14.105  lemma dual_lattice:
  14.106    "lattice (op \<ge>) (op >) sup inf"
  14.107 -  by (rule lattice.intro, rule dual_semilattice, rule upper_semilattice.intro, rule dual_order)
  14.108 +  by (rule lattice.intro, rule dual_semilattice, rule semilattice_sup.intro, rule dual_order)
  14.109      (unfold_locales, auto)
  14.110  
  14.111  lemma inf_sup_absorb: "x \<sqinter> (x \<squnion> y) = x"
  14.112 @@ -246,7 +246,7 @@
  14.113  
  14.114  subsubsection {* Strict order *}
  14.115  
  14.116 -context lower_semilattice
  14.117 +context semilattice_inf
  14.118  begin
  14.119  
  14.120  lemma less_infI1:
  14.121 @@ -259,13 +259,13 @@
  14.122  
  14.123  end
  14.124  
  14.125 -context upper_semilattice
  14.126 +context semilattice_sup
  14.127  begin
  14.128  
  14.129  lemma less_supI1:
  14.130    "x \<sqsubset> a \<Longrightarrow> x \<sqsubset> a \<squnion> b"
  14.131  proof -
  14.132 -  interpret dual: lower_semilattice "op \<ge>" "op >" sup
  14.133 +  interpret dual: semilattice_inf "op \<ge>" "op >" sup
  14.134      by (fact dual_semilattice)
  14.135    assume "x \<sqsubset> a"
  14.136    then show "x \<sqsubset> a \<squnion> b"
  14.137 @@ -275,7 +275,7 @@
  14.138  lemma less_supI2:
  14.139    "x \<sqsubset> b \<Longrightarrow> x \<sqsubset> a \<squnion> b"
  14.140  proof -
  14.141 -  interpret dual: lower_semilattice "op \<ge>" "op >" sup
  14.142 +  interpret dual: semilattice_inf "op \<ge>" "op >" sup
  14.143      by (fact dual_semilattice)
  14.144    assume "x \<sqsubset> b"
  14.145    then show "x \<sqsubset> a \<squnion> b"
  14.146 @@ -492,7 +492,7 @@
  14.147  
  14.148  subsection {* Uniqueness of inf and sup *}
  14.149  
  14.150 -lemma (in lower_semilattice) inf_unique:
  14.151 +lemma (in semilattice_inf) inf_unique:
  14.152    fixes f (infixl "\<triangle>" 70)
  14.153    assumes le1: "\<And>x y. x \<triangle> y \<sqsubseteq> x" and le2: "\<And>x y. x \<triangle> y \<sqsubseteq> y"
  14.154    and greatest: "\<And>x y z. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<triangle> z"
  14.155 @@ -504,7 +504,7 @@
  14.156    show "x \<sqinter> y \<sqsubseteq> x \<triangle> y" by (rule leI) simp_all
  14.157  qed
  14.158  
  14.159 -lemma (in upper_semilattice) sup_unique:
  14.160 +lemma (in semilattice_sup) sup_unique:
  14.161    fixes f (infixl "\<nabla>" 70)
  14.162    assumes ge1 [simp]: "\<And>x y. x \<sqsubseteq> x \<nabla> y" and ge2: "\<And>x y. y \<sqsubseteq> x \<nabla> y"
  14.163    and least: "\<And>x y z. y \<sqsubseteq> x \<Longrightarrow> z \<sqsubseteq> x \<Longrightarrow> y \<nabla> z \<sqsubseteq> x"
  14.164 @@ -527,10 +527,10 @@
  14.165      by (auto simp add: min_def max_def)
  14.166  qed (auto simp add: min_def max_def not_le less_imp_le)
  14.167  
  14.168 -lemma inf_min: "inf = (min \<Colon> 'a\<Colon>{lower_semilattice, linorder} \<Rightarrow> 'a \<Rightarrow> 'a)"
  14.169 +lemma inf_min: "inf = (min \<Colon> 'a\<Colon>{semilattice_inf, linorder} \<Rightarrow> 'a \<Rightarrow> 'a)"
  14.170    by (rule ext)+ (auto intro: antisym)
  14.171  
  14.172 -lemma sup_max: "sup = (max \<Colon> 'a\<Colon>{upper_semilattice, linorder} \<Rightarrow> 'a \<Rightarrow> 'a)"
  14.173 +lemma sup_max: "sup = (max \<Colon> 'a\<Colon>{semilattice_sup, linorder} \<Rightarrow> 'a \<Rightarrow> 'a)"
  14.174    by (rule ext)+ (auto intro: antisym)
  14.175  
  14.176  lemmas le_maxI1 = min_max.sup_ge1
    15.1 --- a/src/HOL/Library/Abstract_Rat.thy	Fri Feb 05 14:33:31 2010 +0100
    15.2 +++ b/src/HOL/Library/Abstract_Rat.thy	Fri Feb 05 14:33:50 2010 +0100
    15.3 @@ -332,7 +332,7 @@
    15.4  lemma Ndiv[simp]: "INum (x \<div>\<^sub>N y) = INum x / (INum y ::'a :: {ring_char_0, division_by_zero,field})" by (simp add: Ndiv_def)
    15.5  
    15.6  lemma Nlt0_iff[simp]: assumes nx: "isnormNum x" 
    15.7 -  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,ordered_field})< 0) = 0>\<^sub>N x "
    15.8 +  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,linordered_field})< 0) = 0>\<^sub>N x "
    15.9  proof-
   15.10    have " \<exists> a b. x = (a,b)" by simp
   15.11    then obtain a b where x[simp]:"x = (a,b)" by blast
   15.12 @@ -345,7 +345,7 @@
   15.13  qed
   15.14  
   15.15  lemma Nle0_iff[simp]:assumes nx: "isnormNum x" 
   15.16 -  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,ordered_field}) \<le> 0) = 0\<ge>\<^sub>N x"
   15.17 +  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,linordered_field}) \<le> 0) = 0\<ge>\<^sub>N x"
   15.18  proof-
   15.19    have " \<exists> a b. x = (a,b)" by simp
   15.20    then obtain a b where x[simp]:"x = (a,b)" by blast
   15.21 @@ -357,7 +357,7 @@
   15.22    ultimately show ?thesis by blast
   15.23  qed
   15.24  
   15.25 -lemma Ngt0_iff[simp]:assumes nx: "isnormNum x" shows "((INum x :: 'a :: {ring_char_0,division_by_zero,ordered_field})> 0) = 0<\<^sub>N x"
   15.26 +lemma Ngt0_iff[simp]:assumes nx: "isnormNum x" shows "((INum x :: 'a :: {ring_char_0,division_by_zero,linordered_field})> 0) = 0<\<^sub>N x"
   15.27  proof-
   15.28    have " \<exists> a b. x = (a,b)" by simp
   15.29    then obtain a b where x[simp]:"x = (a,b)" by blast
   15.30 @@ -369,7 +369,7 @@
   15.31    ultimately show ?thesis by blast
   15.32  qed
   15.33  lemma Nge0_iff[simp]:assumes nx: "isnormNum x" 
   15.34 -  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,ordered_field}) \<ge> 0) = 0\<le>\<^sub>N x"
   15.35 +  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,linordered_field}) \<ge> 0) = 0\<le>\<^sub>N x"
   15.36  proof-
   15.37    have " \<exists> a b. x = (a,b)" by simp
   15.38    then obtain a b where x[simp]:"x = (a,b)" by blast
   15.39 @@ -382,7 +382,7 @@
   15.40  qed
   15.41  
   15.42  lemma Nlt_iff[simp]: assumes nx: "isnormNum x" and ny: "isnormNum y"
   15.43 -  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,ordered_field}) < INum y) = (x <\<^sub>N y)"
   15.44 +  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,linordered_field}) < INum y) = (x <\<^sub>N y)"
   15.45  proof-
   15.46    let ?z = "0::'a"
   15.47    have "((INum x ::'a) < INum y) = (INum (x -\<^sub>N y) < ?z)" using nx ny by simp
   15.48 @@ -391,7 +391,7 @@
   15.49  qed
   15.50  
   15.51  lemma Nle_iff[simp]: assumes nx: "isnormNum x" and ny: "isnormNum y"
   15.52 -  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,ordered_field})\<le> INum y) = (x \<le>\<^sub>N y)"
   15.53 +  shows "((INum x :: 'a :: {ring_char_0,division_by_zero,linordered_field})\<le> INum y) = (x \<le>\<^sub>N y)"
   15.54  proof-
   15.55    have "((INum x ::'a) \<le> INum y) = (INum (x -\<^sub>N y) \<le> (0::'a))" using nx ny by simp
   15.56    also have "\<dots> = (0\<ge>\<^sub>N (x -\<^sub>N y))" using Nle0_iff[OF Nsub_normN[OF ny]] by simp
    16.1 --- a/src/HOL/Library/BigO.thy	Fri Feb 05 14:33:31 2010 +0100
    16.2 +++ b/src/HOL/Library/BigO.thy	Fri Feb 05 14:33:50 2010 +0100
    16.3 @@ -38,11 +38,11 @@
    16.4  subsection {* Definitions *}
    16.5  
    16.6  definition
    16.7 -  bigo :: "('a => 'b::ordered_idom) => ('a => 'b) set"  ("(1O'(_'))") where
    16.8 +  bigo :: "('a => 'b::linordered_idom) => ('a => 'b) set"  ("(1O'(_'))") where
    16.9    "O(f::('a => 'b)) =
   16.10        {h. EX c. ALL x. abs (h x) <= c * abs (f x)}"
   16.11  
   16.12 -lemma bigo_pos_const: "(EX (c::'a::ordered_idom). 
   16.13 +lemma bigo_pos_const: "(EX (c::'a::linordered_idom). 
   16.14      ALL x. (abs (h x)) <= (c * (abs (f x))))
   16.15        = (EX c. 0 < c & (ALL x. (abs(h x)) <= (c * (abs (f x)))))"
   16.16    apply auto
   16.17 @@ -352,7 +352,7 @@
   16.18    done
   16.19  
   16.20  lemma bigo_mult5: "ALL x. f x ~= 0 ==>
   16.21 -    O(f * g) <= (f::'a => ('b::ordered_field)) *o O(g)"
   16.22 +    O(f * g) <= (f::'a => ('b::linordered_field)) *o O(g)"
   16.23  proof -
   16.24    assume "ALL x. f x ~= 0"
   16.25    show "O(f * g) <= f *o O(g)"
   16.26 @@ -381,14 +381,14 @@
   16.27  qed
   16.28  
   16.29  lemma bigo_mult6: "ALL x. f x ~= 0 ==>
   16.30 -    O(f * g) = (f::'a => ('b::ordered_field)) *o O(g)"
   16.31 +    O(f * g) = (f::'a => ('b::linordered_field)) *o O(g)"
   16.32    apply (rule equalityI)
   16.33    apply (erule bigo_mult5)
   16.34    apply (rule bigo_mult2)
   16.35    done
   16.36  
   16.37  lemma bigo_mult7: "ALL x. f x ~= 0 ==>
   16.38 -    O(f * g) <= O(f::'a => ('b::ordered_field)) \<otimes> O(g)"
   16.39 +    O(f * g) <= O(f::'a => ('b::linordered_field)) \<otimes> O(g)"
   16.40    apply (subst bigo_mult6)
   16.41    apply assumption
   16.42    apply (rule set_times_mono3)
   16.43 @@ -396,7 +396,7 @@
   16.44    done
   16.45  
   16.46  lemma bigo_mult8: "ALL x. f x ~= 0 ==>
   16.47 -    O(f * g) = O(f::'a => ('b::ordered_field)) \<otimes> O(g)"
   16.48 +    O(f * g) = O(f::'a => ('b::linordered_field)) \<otimes> O(g)"
   16.49    apply (rule equalityI)
   16.50    apply (erule bigo_mult7)
   16.51    apply (rule bigo_mult)
   16.52 @@ -481,16 +481,16 @@
   16.53    apply (rule bigo_const1)
   16.54    done
   16.55  
   16.56 -lemma bigo_const3: "(c::'a::ordered_field) ~= 0 ==> (%x. 1) : O(%x. c)"
   16.57 +lemma bigo_const3: "(c::'a::linordered_field) ~= 0 ==> (%x. 1) : O(%x. c)"
   16.58    apply (simp add: bigo_def)
   16.59    apply (rule_tac x = "abs(inverse c)" in exI)
   16.60    apply (simp add: abs_mult [symmetric])
   16.61    done
   16.62  
   16.63 -lemma bigo_const4: "(c::'a::ordered_field) ~= 0 ==> O(%x. 1) <= O(%x. c)"
   16.64 +lemma bigo_const4: "(c::'a::linordered_field) ~= 0 ==> O(%x. 1) <= O(%x. c)"
   16.65    by (rule bigo_elt_subset, rule bigo_const3, assumption)
   16.66  
   16.67 -lemma bigo_const [simp]: "(c::'a::ordered_field) ~= 0 ==> 
   16.68 +lemma bigo_const [simp]: "(c::'a::linordered_field) ~= 0 ==> 
   16.69      O(%x. c) = O(%x. 1)"
   16.70    by (rule equalityI, rule bigo_const2, rule bigo_const4, assumption)
   16.71  
   16.72 @@ -503,21 +503,21 @@
   16.73  lemma bigo_const_mult2: "O(%x. c * f x) <= O(f)"
   16.74    by (rule bigo_elt_subset, rule bigo_const_mult1)
   16.75  
   16.76 -lemma bigo_const_mult3: "(c::'a::ordered_field) ~= 0 ==> f : O(%x. c * f x)"
   16.77 +lemma bigo_const_mult3: "(c::'a::linordered_field) ~= 0 ==> f : O(%x. c * f x)"
   16.78    apply (simp add: bigo_def)
   16.79    apply (rule_tac x = "abs(inverse c)" in exI)
   16.80    apply (simp add: abs_mult [symmetric] mult_assoc [symmetric])
   16.81    done
   16.82  
   16.83 -lemma bigo_const_mult4: "(c::'a::ordered_field) ~= 0 ==> 
   16.84 +lemma bigo_const_mult4: "(c::'a::linordered_field) ~= 0 ==> 
   16.85      O(f) <= O(%x. c * f x)"
   16.86    by (rule bigo_elt_subset, rule bigo_const_mult3, assumption)
   16.87  
   16.88 -lemma bigo_const_mult [simp]: "(c::'a::ordered_field) ~= 0 ==> 
   16.89 +lemma bigo_const_mult [simp]: "(c::'a::linordered_field) ~= 0 ==> 
   16.90      O(%x. c * f x) = O(f)"
   16.91    by (rule equalityI, rule bigo_const_mult2, erule bigo_const_mult4)
   16.92  
   16.93 -lemma bigo_const_mult5 [simp]: "(c::'a::ordered_field) ~= 0 ==> 
   16.94 +lemma bigo_const_mult5 [simp]: "(c::'a::linordered_field) ~= 0 ==> 
   16.95      (%x. c) *o O(f) = O(f)"
   16.96    apply (auto del: subsetI)
   16.97    apply (rule order_trans)
   16.98 @@ -688,7 +688,7 @@
   16.99    apply assumption+
  16.100    done
  16.101    
  16.102 -lemma bigo_useful_const_mult: "(c::'a::ordered_field) ~= 0 ==> 
  16.103 +lemma bigo_useful_const_mult: "(c::'a::linordered_field) ~= 0 ==> 
  16.104      (%x. c) * f =o O(h) ==> f =o O(h)"
  16.105    apply (rule subsetD)
  16.106    apply (subgoal_tac "(%x. 1 / c) *o O(h) <= O(h)")
  16.107 @@ -733,7 +733,7 @@
  16.108  subsection {* Less than or equal to *}
  16.109  
  16.110  definition
  16.111 -  lesso :: "('a => 'b::ordered_idom) => ('a => 'b) => ('a => 'b)"
  16.112 +  lesso :: "('a => 'b::linordered_idom) => ('a => 'b) => ('a => 'b)"
  16.113      (infixl "<o" 70) where
  16.114    "f <o g = (%x. max (f x - g x) 0)"
  16.115  
  16.116 @@ -833,7 +833,7 @@
  16.117    apply (simp add: algebra_simps)
  16.118    done
  16.119  
  16.120 -lemma bigo_lesso4: "f <o g =o O(k::'a=>'b::ordered_field) ==>
  16.121 +lemma bigo_lesso4: "f <o g =o O(k::'a=>'b::linordered_field) ==>
  16.122      g =o h +o O(k) ==> f <o h =o O(k)"
  16.123    apply (unfold lesso_def)
  16.124    apply (drule set_plus_imp_minus)
    17.1 --- a/src/HOL/Library/Kleene_Algebra.thy	Fri Feb 05 14:33:31 2010 +0100
    17.2 +++ b/src/HOL/Library/Kleene_Algebra.thy	Fri Feb 05 14:33:50 2010 +0100
    17.3 @@ -72,7 +72,7 @@
    17.4  class pre_kleene = semiring_1 + order_by_add
    17.5  begin
    17.6  
    17.7 -subclass pordered_semiring proof
    17.8 +subclass ordered_semiring proof
    17.9    fix x y z :: 'a
   17.10  
   17.11    assume "x \<le> y"
    18.1 --- a/src/HOL/Library/Multiset.thy	Fri Feb 05 14:33:31 2010 +0100
    18.2 +++ b/src/HOL/Library/Multiset.thy	Fri Feb 05 14:33:50 2010 +0100
    18.3 @@ -415,11 +415,11 @@
    18.4    mset_le_trans simp: mset_less_def)
    18.5  
    18.6  interpretation mset_order_cancel_semigroup:
    18.7 -  pordered_cancel_ab_semigroup_add "op +" "op \<le>#" "op <#"
    18.8 +  ordered_cancel_ab_semigroup_add "op +" "op \<le>#" "op <#"
    18.9  proof qed (erule mset_le_mono_add [OF mset_le_refl])
   18.10  
   18.11  interpretation mset_order_semigroup_cancel:
   18.12 -  pordered_ab_semigroup_add_imp_le "op +" "op \<le>#" "op <#"
   18.13 +  ordered_ab_semigroup_add_imp_le "op +" "op \<le>#" "op <#"
   18.14  proof qed simp
   18.15  
   18.16  lemma mset_lessD: "A \<subset># B \<Longrightarrow> x \<in># A \<Longrightarrow> x \<in># B"
   18.17 @@ -1348,7 +1348,7 @@
   18.18  lemma union_upper2: "B <= A + (B::'a::order multiset)"
   18.19  by (subst add_commute) (rule union_upper1)
   18.20  
   18.21 -instance multiset :: (order) pordered_ab_semigroup_add
   18.22 +instance multiset :: (order) ordered_ab_semigroup_add
   18.23  apply intro_classes
   18.24  apply (erule union_le_mono[OF mult_le_refl])
   18.25  done
    19.1 --- a/src/HOL/Library/Nat_Infinity.thy	Fri Feb 05 14:33:31 2010 +0100
    19.2 +++ b/src/HOL/Library/Nat_Infinity.thy	Fri Feb 05 14:33:50 2010 +0100
    19.3 @@ -234,7 +234,7 @@
    19.4  
    19.5  subsection {* Ordering *}
    19.6  
    19.7 -instantiation inat :: ordered_ab_semigroup_add
    19.8 +instantiation inat :: linordered_ab_semigroup_add
    19.9  begin
   19.10  
   19.11  definition
   19.12 @@ -268,7 +268,7 @@
   19.13  
   19.14  end
   19.15  
   19.16 -instance inat :: pordered_comm_semiring
   19.17 +instance inat :: ordered_comm_semiring
   19.18  proof
   19.19    fix a b c :: inat
   19.20    assume "a \<le> b" and "0 \<le> c"
    20.1 --- a/src/HOL/Library/Polynomial.thy	Fri Feb 05 14:33:31 2010 +0100
    20.2 +++ b/src/HOL/Library/Polynomial.thy	Fri Feb 05 14:33:50 2010 +0100
    20.3 @@ -706,7 +706,7 @@
    20.4  subsection {* Polynomials form an ordered integral domain *}
    20.5  
    20.6  definition
    20.7 -  pos_poly :: "'a::ordered_idom poly \<Rightarrow> bool"
    20.8 +  pos_poly :: "'a::linordered_idom poly \<Rightarrow> bool"
    20.9  where
   20.10    "pos_poly p \<longleftrightarrow> 0 < coeff p (degree p)"
   20.11  
   20.12 @@ -732,7 +732,7 @@
   20.13  lemma pos_poly_total: "p = 0 \<or> pos_poly p \<or> pos_poly (- p)"
   20.14  by (induct p) (auto simp add: pos_poly_pCons)
   20.15  
   20.16 -instantiation poly :: (ordered_idom) ordered_idom
   20.17 +instantiation poly :: (linordered_idom) linordered_idom
   20.18  begin
   20.19  
   20.20  definition
    21.1 --- a/src/HOL/Library/Univ_Poly.thy	Fri Feb 05 14:33:31 2010 +0100
    21.2 +++ b/src/HOL/Library/Univ_Poly.thy	Fri Feb 05 14:33:50 2010 +0100
    21.3 @@ -990,7 +990,7 @@
    21.4  
    21.5  text{*bound for polynomial.*}
    21.6  
    21.7 -lemma poly_mono: "abs(x) \<le> k ==> abs(poly p (x::'a::{ordered_idom})) \<le> poly (map abs p) k"
    21.8 +lemma poly_mono: "abs(x) \<le> k ==> abs(poly p (x::'a::{linordered_idom})) \<le> poly (map abs p) k"
    21.9  apply (induct "p", auto)
   21.10  apply (rule_tac y = "abs a + abs (x * poly p x)" in order_trans)
   21.11  apply (rule abs_triangle_ineq)
    22.1 --- a/src/HOL/Library/positivstellensatz.ML	Fri Feb 05 14:33:31 2010 +0100
    22.2 +++ b/src/HOL/Library/positivstellensatz.ML	Fri Feb 05 14:33:50 2010 +0100
    22.3 @@ -275,7 +275,7 @@
    22.4    "((a + b + min x y + c > r) = (a + b + x + c > r & a + b + y + c > r))"
    22.5    by auto};
    22.6  
    22.7 -val abs_split' = @{lemma "P (abs (x::'a::ordered_idom)) == (x >= 0 & P x | x < 0 & P (-x))"
    22.8 +val abs_split' = @{lemma "P (abs (x::'a::linordered_idom)) == (x >= 0 & P x | x < 0 & P (-x))"
    22.9    by (atomize (full)) (auto split add: abs_split)};
   22.10  
   22.11  val max_split = @{lemma "P (max x y) == ((x::'a::linorder) <= y & P y | x > y & P x)"
    23.1 --- a/src/HOL/List.thy	Fri Feb 05 14:33:31 2010 +0100
    23.2 +++ b/src/HOL/List.thy	Fri Feb 05 14:33:50 2010 +0100
    23.3 @@ -2500,12 +2500,12 @@
    23.4  by (induct xs, simp_all add: algebra_simps)
    23.5  
    23.6  lemma listsum_abs:
    23.7 -  fixes xs :: "'a::pordered_ab_group_add_abs list"
    23.8 +  fixes xs :: "'a::ordered_ab_group_add_abs list"
    23.9    shows "\<bar>listsum xs\<bar> \<le> listsum (map abs xs)"
   23.10  by (induct xs, simp, simp add: order_trans [OF abs_triangle_ineq])
   23.11  
   23.12  lemma listsum_mono:
   23.13 -  fixes f g :: "'a \<Rightarrow> 'b::{comm_monoid_add, pordered_ab_semigroup_add}"
   23.14 +  fixes f g :: "'a \<Rightarrow> 'b::{comm_monoid_add, ordered_ab_semigroup_add}"
   23.15    shows "(\<And>x. x \<in> set xs \<Longrightarrow> f x \<le> g x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. f x) \<le> (\<Sum>x\<leftarrow>xs. g x)"
   23.16  by (induct xs, simp, simp add: add_mono)
   23.17  
    24.1 --- a/src/HOL/Matrix/ComputeNumeral.thy	Fri Feb 05 14:33:31 2010 +0100
    24.2 +++ b/src/HOL/Matrix/ComputeNumeral.thy	Fri Feb 05 14:33:50 2010 +0100
    24.3 @@ -109,22 +109,22 @@
    24.4  
    24.5  lemmas compute_natarith = bitarith natnorm natsuc natadd natsub natmul nateq natless natle natfac.simps
    24.6  
    24.7 -lemma number_eq: "(((number_of x)::'a::{number_ring, ordered_idom}) = (number_of y)) = (x = y)"
    24.8 +lemma number_eq: "(((number_of x)::'a::{number_ring, linordered_idom}) = (number_of y)) = (x = y)"
    24.9    unfolding number_of_eq
   24.10    apply simp
   24.11    done
   24.12  
   24.13 -lemma number_le: "(((number_of x)::'a::{number_ring, ordered_idom}) \<le>  (number_of y)) = (x \<le> y)"
   24.14 +lemma number_le: "(((number_of x)::'a::{number_ring, linordered_idom}) \<le>  (number_of y)) = (x \<le> y)"
   24.15    unfolding number_of_eq
   24.16    apply simp
   24.17    done
   24.18  
   24.19 -lemma number_less: "(((number_of x)::'a::{number_ring, ordered_idom}) <  (number_of y)) = (x < y)"
   24.20 +lemma number_less: "(((number_of x)::'a::{number_ring, linordered_idom}) <  (number_of y)) = (x < y)"
   24.21    unfolding number_of_eq 
   24.22    apply simp
   24.23    done
   24.24  
   24.25 -lemma number_diff: "((number_of x)::'a::{number_ring, ordered_idom}) - number_of y = number_of (x + (- y))"
   24.26 +lemma number_diff: "((number_of x)::'a::{number_ring, linordered_idom}) - number_of y = number_of (x + (- y))"
   24.27    apply (subst diff_number_of_eq)
   24.28    apply simp
   24.29    done
    25.1 --- a/src/HOL/Matrix/LP.thy	Fri Feb 05 14:33:31 2010 +0100
    25.2 +++ b/src/HOL/Matrix/LP.thy	Fri Feb 05 14:33:50 2010 +0100
    25.3 @@ -8,7 +8,7 @@
    25.4  
    25.5  lemma linprog_dual_estimate:
    25.6    assumes
    25.7 -  "A * x \<le> (b::'a::lordered_ring)"
    25.8 +  "A * x \<le> (b::'a::lattice_ring)"
    25.9    "0 \<le> y"
   25.10    "abs (A - A') \<le> \<delta>A"
   25.11    "b \<le> b'"
   25.12 @@ -57,7 +57,7 @@
   25.13  
   25.14  lemma le_ge_imp_abs_diff_1:
   25.15    assumes
   25.16 -  "A1 <= (A::'a::lordered_ring)"
   25.17 +  "A1 <= (A::'a::lattice_ring)"
   25.18    "A <= A2" 
   25.19    shows "abs (A-A1) <= A2-A1"
   25.20  proof -
   25.21 @@ -72,7 +72,7 @@
   25.22  
   25.23  lemma mult_le_prts:
   25.24    assumes
   25.25 -  "a1 <= (a::'a::lordered_ring)"
   25.26 +  "a1 <= (a::'a::lattice_ring)"
   25.27    "a <= a2"
   25.28    "b1 <= b"
   25.29    "b <= b2"
   25.30 @@ -120,7 +120,7 @@
   25.31      
   25.32  lemma mult_le_dual_prts: 
   25.33    assumes
   25.34 -  "A * x \<le> (b::'a::lordered_ring)"
   25.35 +  "A * x \<le> (b::'a::lattice_ring)"
   25.36    "0 \<le> y"
   25.37    "A1 \<le> A"
   25.38    "A \<le> A2"
    26.1 --- a/src/HOL/Matrix/Matrix.thy	Fri Feb 05 14:33:31 2010 +0100
    26.2 +++ b/src/HOL/Matrix/Matrix.thy	Fri Feb 05 14:33:50 2010 +0100
    26.3 @@ -1545,7 +1545,7 @@
    26.4      by (simp add: plus_matrix_def diff_matrix_def minus_matrix_def Rep_matrix_inject[symmetric] ext)
    26.5  qed
    26.6  
    26.7 -instance matrix :: (pordered_ab_group_add) pordered_ab_group_add
    26.8 +instance matrix :: (ordered_ab_group_add) ordered_ab_group_add
    26.9  proof
   26.10    fix A B C :: "'a matrix"
   26.11    assume "A <= B"
   26.12 @@ -1556,8 +1556,8 @@
   26.13      done
   26.14  qed
   26.15    
   26.16 -instance matrix :: (lordered_ab_group_add) lordered_ab_group_add_meet ..
   26.17 -instance matrix :: (lordered_ab_group_add) lordered_ab_group_add_join ..
   26.18 +instance matrix :: (lattice_ab_group_add) semilattice_inf_ab_group_add ..
   26.19 +instance matrix :: (lattice_ab_group_add) semilattice_sup_ab_group_add ..
   26.20  
   26.21  instance matrix :: (semiring_0) semiring_0
   26.22  proof
   26.23 @@ -1583,7 +1583,7 @@
   26.24  
   26.25  instance matrix :: (ring) ring ..
   26.26  
   26.27 -instance matrix :: (pordered_ring) pordered_ring
   26.28 +instance matrix :: (ordered_ring) ordered_ring
   26.29  proof
   26.30    fix A B C :: "'a matrix"
   26.31    assume a: "A \<le> B"
   26.32 @@ -1600,9 +1600,9 @@
   26.33      done
   26.34  qed
   26.35  
   26.36 -instance matrix :: (lordered_ring) lordered_ring
   26.37 +instance matrix :: (lattice_ring) lattice_ring
   26.38  proof
   26.39 -  fix A B C :: "('a :: lordered_ring) matrix"
   26.40 +  fix A B C :: "('a :: lattice_ring) matrix"
   26.41    show "abs A = sup A (-A)" 
   26.42      by (simp add: abs_matrix_def)
   26.43  qed
   26.44 @@ -1738,7 +1738,7 @@
   26.45  by auto
   26.46  
   26.47  lemma Rep_matrix_zero_imp_mult_zero:
   26.48 -  "! j i k. (Rep_matrix A j k = 0) | (Rep_matrix B k i) = 0  \<Longrightarrow> A * B = (0::('a::lordered_ring) matrix)"
   26.49 +  "! j i k. (Rep_matrix A j k = 0) | (Rep_matrix B k i) = 0  \<Longrightarrow> A * B = (0::('a::lattice_ring) matrix)"
   26.50  apply (subst Rep_matrix_inject[symmetric])
   26.51  apply (rule ext)+
   26.52  apply (auto simp add: Rep_matrix_mult foldseq_zero zero_imp_mult_zero)
   26.53 @@ -1803,7 +1803,7 @@
   26.54  lemma Rep_minus[simp]: "Rep_matrix (-(A::_::group_add)) x y = - (Rep_matrix A x y)"
   26.55  by (simp add: minus_matrix_def)
   26.56  
   26.57 -lemma Rep_abs[simp]: "Rep_matrix (abs (A::_::lordered_ab_group_add)) x y = abs (Rep_matrix A x y)"
   26.58 +lemma Rep_abs[simp]: "Rep_matrix (abs (A::_::lattice_ab_group_add)) x y = abs (Rep_matrix A x y)"
   26.59  by (simp add: abs_lattice sup_matrix_def)
   26.60  
   26.61  end
    27.1 --- a/src/HOL/Matrix/SparseMatrix.thy	Fri Feb 05 14:33:31 2010 +0100
    27.2 +++ b/src/HOL/Matrix/SparseMatrix.thy	Fri Feb 05 14:33:50 2010 +0100
    27.3 @@ -103,7 +103,7 @@
    27.4    "minus_spvec [] = []"
    27.5    | "minus_spvec (a#as) = (fst a, -(snd a))#(minus_spvec as)"
    27.6  
    27.7 -primrec abs_spvec ::  "('a::lordered_ab_group_add_abs) spvec \<Rightarrow> 'a spvec" where
    27.8 +primrec abs_spvec ::  "('a::lattice_ab_group_add_abs) spvec \<Rightarrow> 'a spvec" where
    27.9    "abs_spvec [] = []"
   27.10    | "abs_spvec (a#as) = (fst a, abs (snd a))#(abs_spvec as)"
   27.11  
   27.12 @@ -116,12 +116,12 @@
   27.13    apply simp
   27.14    done
   27.15  
   27.16 -instance matrix :: (lordered_ab_group_add_abs) lordered_ab_group_add_abs
   27.17 +instance matrix :: (lattice_ab_group_add_abs) lattice_ab_group_add_abs
   27.18  apply default
   27.19  unfolding abs_matrix_def .. (*FIXME move*)
   27.20  
   27.21  lemma sparse_row_vector_abs:
   27.22 -  "sorted_spvec (v :: 'a::lordered_ring spvec) \<Longrightarrow> sparse_row_vector (abs_spvec v) = abs (sparse_row_vector v)"
   27.23 +  "sorted_spvec (v :: 'a::lattice_ring spvec) \<Longrightarrow> sparse_row_vector (abs_spvec v) = abs (sparse_row_vector v)"
   27.24    apply (induct v)
   27.25    apply simp_all
   27.26    apply (frule_tac sorted_spvec_cons1, simp)
   27.27 @@ -174,7 +174,7 @@
   27.28  lemma addmult_spvec_empty2[simp]: "addmult_spvec y a [] = a"
   27.29    by (induct a) auto
   27.30  
   27.31 -lemma sparse_row_vector_map: "(! x y. f (x+y) = (f x) + (f y)) \<Longrightarrow> (f::'a\<Rightarrow>('a::lordered_ring)) 0 = 0 \<Longrightarrow> 
   27.32 +lemma sparse_row_vector_map: "(! x y. f (x+y) = (f x) + (f y)) \<Longrightarrow> (f::'a\<Rightarrow>('a::lattice_ring)) 0 = 0 \<Longrightarrow> 
   27.33    sparse_row_vector (map (% x. (fst x, f (snd x))) a) = apply_matrix f (sparse_row_vector a)"
   27.34    apply (induct a)
   27.35    apply (simp_all add: apply_matrix_add)
   27.36 @@ -185,7 +185,7 @@
   27.37    apply (simp_all add: smult_spvec_cons scalar_mult_add)
   27.38    done
   27.39  
   27.40 -lemma sparse_row_vector_addmult_spvec: "sparse_row_vector (addmult_spvec (y::'a::lordered_ring) a b) = 
   27.41 +lemma sparse_row_vector_addmult_spvec: "sparse_row_vector (addmult_spvec (y::'a::lattice_ring) a b) = 
   27.42    (sparse_row_vector a) + (scalar_mult y (sparse_row_vector b))"
   27.43    apply (induct y a b rule: addmult_spvec.induct)
   27.44    apply (simp add: scalar_mult_add smult_spvec_cons sparse_row_vector_smult singleton_matrix_add)+
   27.45 @@ -235,7 +235,7 @@
   27.46    apply (simp_all add: sorted_spvec_addmult_spvec_helper3)
   27.47    done
   27.48  
   27.49 -fun mult_spvec_spmat :: "('a::lordered_ring) spvec \<Rightarrow> 'a spvec \<Rightarrow> 'a spmat  \<Rightarrow> 'a spvec" where
   27.50 +fun mult_spvec_spmat :: "('a::lattice_ring) spvec \<Rightarrow> 'a spvec \<Rightarrow> 'a spmat  \<Rightarrow> 'a spvec" where
   27.51  (* recdef mult_spvec_spmat "measure (% (c, arr, brr). (length arr) + (length brr))" *)
   27.52    "mult_spvec_spmat c [] brr = c" |
   27.53    "mult_spvec_spmat c arr [] = c" |
   27.54 @@ -244,7 +244,7 @@
   27.55       else if (j < i) then mult_spvec_spmat c ((i,a)#arr) brr 
   27.56       else mult_spvec_spmat (addmult_spvec a c b) arr brr)"
   27.57  
   27.58 -lemma sparse_row_mult_spvec_spmat[rule_format]: "sorted_spvec (a::('a::lordered_ring) spvec) \<longrightarrow> sorted_spvec B \<longrightarrow> 
   27.59 +lemma sparse_row_mult_spvec_spmat[rule_format]: "sorted_spvec (a::('a::lattice_ring) spvec) \<longrightarrow> sorted_spvec B \<longrightarrow> 
   27.60    sparse_row_vector (mult_spvec_spmat c a B) = (sparse_row_vector c) + (sparse_row_vector a) * (sparse_row_matrix B)"
   27.61  proof -
   27.62    have comp_1: "!! a b. a < b \<Longrightarrow> Suc 0 <= nat ((int b)-(int a))" by arith
   27.63 @@ -337,13 +337,13 @@
   27.64  qed
   27.65  
   27.66  lemma sorted_mult_spvec_spmat[rule_format]: 
   27.67 -  "sorted_spvec (c::('a::lordered_ring) spvec) \<longrightarrow> sorted_spmat B \<longrightarrow> sorted_spvec (mult_spvec_spmat c a B)"
   27.68 +  "sorted_spvec (c::('a::lattice_ring) spvec) \<longrightarrow> sorted_spmat B \<longrightarrow> sorted_spvec (mult_spvec_spmat c a B)"
   27.69    apply (induct c a B rule: mult_spvec_spmat.induct)
   27.70    apply (simp_all add: sorted_addmult_spvec)
   27.71    done
   27.72  
   27.73  consts 
   27.74 -  mult_spmat :: "('a::lordered_ring) spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat"
   27.75 +  mult_spmat :: "('a::lattice_ring) spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat"
   27.76  
   27.77  primrec 
   27.78    "mult_spmat [] A = []"
   27.79 @@ -357,7 +357,7 @@
   27.80    done
   27.81  
   27.82  lemma sorted_spvec_mult_spmat[rule_format]:
   27.83 -  "sorted_spvec (A::('a::lordered_ring) spmat) \<longrightarrow> sorted_spvec (mult_spmat A B)"
   27.84 +  "sorted_spvec (A::('a::lattice_ring) spmat) \<longrightarrow> sorted_spvec (mult_spmat A B)"
   27.85    apply (induct A)
   27.86    apply (auto)
   27.87    apply (drule sorted_spvec_cons1, simp)
   27.88 @@ -366,13 +366,13 @@
   27.89    done
   27.90  
   27.91  lemma sorted_spmat_mult_spmat:
   27.92 -  "sorted_spmat (B::('a::lordered_ring) spmat) \<Longrightarrow> sorted_spmat (mult_spmat A B)"
   27.93 +  "sorted_spmat (B::('a::lattice_ring) spmat) \<Longrightarrow> sorted_spmat (mult_spmat A B)"
   27.94    apply (induct A)
   27.95    apply (auto simp add: sorted_mult_spvec_spmat) 
   27.96    done
   27.97  
   27.98  
   27.99 -fun add_spvec :: "('a::lordered_ab_group_add) spvec \<Rightarrow> 'a spvec \<Rightarrow> 'a spvec" where
  27.100 +fun add_spvec :: "('a::lattice_ab_group_add) spvec \<Rightarrow> 'a spvec \<Rightarrow> 'a spvec" where
  27.101  (* "measure (% (a, b). length a + (length b))" *)
  27.102    "add_spvec arr [] = arr" |
  27.103    "add_spvec [] brr = brr" |
  27.104 @@ -389,7 +389,7 @@
  27.105    apply (simp_all add: singleton_matrix_add)
  27.106    done
  27.107  
  27.108 -fun add_spmat :: "('a::lordered_ab_group_add) spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat" where
  27.109 +fun add_spmat :: "('a::lattice_ab_group_add) spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat" where
  27.110  (* "measure (% (A,B). (length A)+(length B))" *)
  27.111    "add_spmat [] bs = bs" |
  27.112    "add_spmat as [] = as" |
  27.113 @@ -532,7 +532,7 @@
  27.114    apply (simp_all add: sorted_spvec_add_spvec)
  27.115    done
  27.116  
  27.117 -fun le_spvec :: "('a::lordered_ab_group_add) spvec \<Rightarrow> 'a spvec \<Rightarrow> bool" where
  27.118 +fun le_spvec :: "('a::lattice_ab_group_add) spvec \<Rightarrow> 'a spvec \<Rightarrow> bool" where
  27.119  (* "measure (% (a,b). (length a) + (length b))" *)
  27.120    "le_spvec [] [] = True" |
  27.121    "le_spvec ((_,a)#as) [] = (a <= 0 & le_spvec as [])" |
  27.122 @@ -542,7 +542,7 @@
  27.123    else if (j < i) then 0 <= b & le_spvec ((i,a)#as) bs
  27.124    else a <= b & le_spvec as bs)"
  27.125  
  27.126 -fun le_spmat :: "('a::lordered_ab_group_add) spmat \<Rightarrow> 'a spmat \<Rightarrow> bool" where
  27.127 +fun le_spmat :: "('a::lattice_ab_group_add) spmat \<Rightarrow> 'a spmat \<Rightarrow> bool" where
  27.128  (* "measure (% (a,b). (length a) + (length b))" *)
  27.129    "le_spmat [] [] = True" |
  27.130    "le_spmat ((i,a)#as) [] = (le_spvec a [] & le_spmat as [])" |
  27.131 @@ -566,7 +566,7 @@
  27.132  
  27.133  
  27.134  lemma disj_matrices_add: "disj_matrices A B \<Longrightarrow> disj_matrices C D \<Longrightarrow> disj_matrices A D \<Longrightarrow> disj_matrices B C \<Longrightarrow> 
  27.135 -  (A + B <= C + D) = (A <= C & B <= (D::('a::lordered_ab_group_add) matrix))"
  27.136 +  (A + B <= C + D) = (A <= C & B <= (D::('a::lattice_ab_group_add) matrix))"
  27.137    apply (auto)
  27.138    apply (simp (no_asm_use) only: le_matrix_def disj_matrices_def)
  27.139    apply (intro strip)
  27.140 @@ -596,19 +596,19 @@
  27.141  by (auto simp add: disj_matrices_def)
  27.142  
  27.143  lemma disj_matrices_add_le_zero: "disj_matrices A B \<Longrightarrow>
  27.144 -  (A + B <= 0) = (A <= 0 & (B::('a::lordered_ab_group_add) matrix) <= 0)"
  27.145 +  (A + B <= 0) = (A <= 0 & (B::('a::lattice_ab_group_add) matrix) <= 0)"
  27.146  by (rule disj_matrices_add[of A B 0 0, simplified])
  27.147   
  27.148  lemma disj_matrices_add_zero_le: "disj_matrices A B \<Longrightarrow>
  27.149 -  (0 <= A + B) = (0 <= A & 0 <= (B::('a::lordered_ab_group_add) matrix))"
  27.150 +  (0 <= A + B) = (0 <= A & 0 <= (B::('a::lattice_ab_group_add) matrix))"
  27.151  by (rule disj_matrices_add[of 0 0 A B, simplified])
  27.152  
  27.153  lemma disj_matrices_add_x_le: "disj_matrices A B \<Longrightarrow> disj_matrices B C \<Longrightarrow> 
  27.154 -  (A <= B + C) = (A <= C & 0 <= (B::('a::lordered_ab_group_add) matrix))"
  27.155 +  (A <= B + C) = (A <= C & 0 <= (B::('a::lattice_ab_group_add) matrix))"
  27.156  by (auto simp add: disj_matrices_add[of 0 A B C, simplified])
  27.157  
  27.158  lemma disj_matrices_add_le_x: "disj_matrices A B \<Longrightarrow> disj_matrices B C \<Longrightarrow> 
  27.159 -  (B + A <= C) = (A <= C &  (B::('a::lordered_ab_group_add) matrix) <= 0)"
  27.160 +  (B + A <= C) = (A <= C &  (B::('a::lattice_ab_group_add) matrix) <= 0)"
  27.161  by (auto simp add: disj_matrices_add[of B A 0 C,simplified] disj_matrices_commute)
  27.162  
  27.163  lemma disj_sparse_row_singleton: "i <= j \<Longrightarrow> sorted_spvec((j,y)#v) \<Longrightarrow> disj_matrices (sparse_row_vector v) (singleton_matrix 0 i x)"
  27.164 @@ -624,7 +624,7 @@
  27.165    apply (simp_all)
  27.166    done 
  27.167  
  27.168 -lemma disj_matrices_x_add: "disj_matrices A B \<Longrightarrow> disj_matrices A C \<Longrightarrow> disj_matrices (A::('a::lordered_ab_group_add) matrix) (B+C)"
  27.169 +lemma disj_matrices_x_add: "disj_matrices A B \<Longrightarrow> disj_matrices A C \<Longrightarrow> disj_matrices (A::('a::lattice_ab_group_add) matrix) (B+C)"
  27.170    apply (simp add: disj_matrices_def)
  27.171    apply (auto)
  27.172    apply (drule_tac j=j and i=i in spec2)+
  27.173 @@ -633,7 +633,7 @@
  27.174    apply (simp_all)
  27.175    done
  27.176  
  27.177 -lemma disj_matrices_add_x: "disj_matrices A B \<Longrightarrow> disj_matrices A C \<Longrightarrow> disj_matrices (B+C) (A::('a::lordered_ab_group_add) matrix)" 
  27.178 +lemma disj_matrices_add_x: "disj_matrices A B \<Longrightarrow> disj_matrices A C \<Longrightarrow> disj_matrices (B+C) (A::('a::lattice_ab_group_add) matrix)" 
  27.179    by (simp add: disj_matrices_x_add disj_matrices_commute)
  27.180  
  27.181  lemma disj_singleton_matrices[simp]: "disj_matrices (singleton_matrix j i x) (singleton_matrix u v y) = (j \<noteq> u | i \<noteq> v | x = 0 | y = 0)" 
  27.182 @@ -731,11 +731,11 @@
  27.183  
  27.184  declare [[simp_depth_limit = 999]]
  27.185  
  27.186 -primrec abs_spmat :: "('a::lordered_ring) spmat \<Rightarrow> 'a spmat" where
  27.187 +primrec abs_spmat :: "('a::lattice_ring) spmat \<Rightarrow> 'a spmat" where
  27.188    "abs_spmat [] = []" |
  27.189    "abs_spmat (a#as) = (fst a, abs_spvec (snd a))#(abs_spmat as)"
  27.190  
  27.191 -primrec minus_spmat :: "('a::lordered_ring) spmat \<Rightarrow> 'a spmat" where
  27.192 +primrec minus_spmat :: "('a::lattice_ring) spmat \<Rightarrow> 'a spmat" where
  27.193    "minus_spmat [] = []" |
  27.194    "minus_spmat (a#as) = (fst a, minus_spvec (snd a))#(minus_spmat as)"
  27.195  
  27.196 @@ -803,7 +803,7 @@
  27.197    done
  27.198  
  27.199  constdefs
  27.200 -  diff_spmat :: "('a::lordered_ring) spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat"
  27.201 +  diff_spmat :: "('a::lattice_ring) spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat"
  27.202    "diff_spmat A B == add_spmat A (minus_spmat B)"
  27.203  
  27.204  lemma sorted_spmat_diff_spmat: "sorted_spmat A \<Longrightarrow> sorted_spmat B \<Longrightarrow> sorted_spmat (diff_spmat A B)"
  27.205 @@ -845,10 +845,10 @@
  27.206  lemma if_case_eq: "(if b then x else y) = (case b of True => x | False => y)" by simp
  27.207  
  27.208  consts
  27.209 -  pprt_spvec :: "('a::{lordered_ab_group_add}) spvec \<Rightarrow> 'a spvec"
  27.210 -  nprt_spvec :: "('a::{lordered_ab_group_add}) spvec \<Rightarrow> 'a spvec"
  27.211 -  pprt_spmat :: "('a::{lordered_ab_group_add}) spmat \<Rightarrow> 'a spmat"
  27.212 -  nprt_spmat :: "('a::{lordered_ab_group_add}) spmat \<Rightarrow> 'a spmat"
  27.213 +  pprt_spvec :: "('a::{lattice_ab_group_add}) spvec \<Rightarrow> 'a spvec"
  27.214 +  nprt_spvec :: "('a::{lattice_ab_group_add}) spvec \<Rightarrow> 'a spvec"
  27.215 +  pprt_spmat :: "('a::{lattice_ab_group_add}) spmat \<Rightarrow> 'a spmat"
  27.216 +  nprt_spmat :: "('a::{lattice_ab_group_add}) spmat \<Rightarrow> 'a spmat"
  27.217  
  27.218  primrec
  27.219    "pprt_spvec [] = []"
  27.220 @@ -869,7 +869,7 @@
  27.221    (*case (nprt_spvec (snd a)) of [] \<Rightarrow> (nprt_spmat as) | y#ys \<Rightarrow> (fst a, y#ys)#(nprt_spmat as))"*)
  27.222  
  27.223  
  27.224 -lemma pprt_add: "disj_matrices A (B::(_::lordered_ring) matrix) \<Longrightarrow> pprt (A+B) = pprt A + pprt B"
  27.225 +lemma pprt_add: "disj_matrices A (B::(_::lattice_ring) matrix) \<Longrightarrow> pprt (A+B) = pprt A + pprt B"
  27.226    apply (simp add: pprt_def sup_matrix_def)
  27.227    apply (simp add: Rep_matrix_inject[symmetric])
  27.228    apply (rule ext)+
  27.229 @@ -878,7 +878,7 @@
  27.230    apply (simp_all add: disj_matrices_contr1)
  27.231    done
  27.232  
  27.233 -lemma nprt_add: "disj_matrices A (B::(_::lordered_ring) matrix) \<Longrightarrow> nprt (A+B) = nprt A + nprt B"
  27.234 +lemma nprt_add: "disj_matrices A (B::(_::lattice_ring) matrix) \<Longrightarrow> nprt (A+B) = nprt A + nprt B"
  27.235    apply (simp add: nprt_def inf_matrix_def)
  27.236    apply (simp add: Rep_matrix_inject[symmetric])
  27.237    apply (rule ext)+
  27.238 @@ -887,14 +887,14 @@
  27.239    apply (simp_all add: disj_matrices_contr1)
  27.240    done
  27.241  
  27.242 -lemma pprt_singleton[simp]: "pprt (singleton_matrix j i (x::_::lordered_ring)) = singleton_matrix j i (pprt x)"
  27.243 +lemma pprt_singleton[simp]: "pprt (singleton_matrix j i (x::_::lattice_ring)) = singleton_matrix j i (pprt x)"
  27.244    apply (simp add: pprt_def sup_matrix_def)
  27.245    apply (simp add: Rep_matrix_inject[symmetric])
  27.246    apply (rule ext)+
  27.247    apply simp
  27.248    done
  27.249  
  27.250 -lemma nprt_singleton[simp]: "nprt (singleton_matrix j i (x::_::lordered_ring)) = singleton_matrix j i (nprt x)"
  27.251 +lemma nprt_singleton[simp]: "nprt (singleton_matrix j i (x::_::lattice_ring)) = singleton_matrix j i (nprt x)"
  27.252    apply (simp add: nprt_def inf_matrix_def)
  27.253    apply (simp add: Rep_matrix_inject[symmetric])
  27.254    apply (rule ext)+
  27.255 @@ -903,7 +903,7 @@
  27.256  
  27.257  lemma less_imp_le: "a < b \<Longrightarrow> a <= (b::_::order)" by (simp add: less_def)
  27.258  
  27.259 -lemma sparse_row_vector_pprt: "sorted_spvec (v :: 'a::lordered_ring spvec) \<Longrightarrow> sparse_row_vector (pprt_spvec v) = pprt (sparse_row_vector v)"
  27.260 +lemma sparse_row_vector_pprt: "sorted_spvec (v :: 'a::lattice_ring spvec) \<Longrightarrow> sparse_row_vector (pprt_spvec v) = pprt (sparse_row_vector v)"
  27.261    apply (induct v)
  27.262    apply (simp_all)
  27.263    apply (frule sorted_spvec_cons1, auto)
  27.264 @@ -913,7 +913,7 @@
  27.265    apply auto
  27.266    done
  27.267  
  27.268 -lemma sparse_row_vector_nprt: "sorted_spvec (v :: 'a::lordered_ring spvec) \<Longrightarrow> sparse_row_vector (nprt_spvec v) = nprt (sparse_row_vector v)"
  27.269 +lemma sparse_row_vector_nprt: "sorted_spvec (v :: 'a::lattice_ring spvec) \<Longrightarrow> sparse_row_vector (nprt_spvec v) = nprt (sparse_row_vector v)"
  27.270    apply (induct v)
  27.271    apply (simp_all)
  27.272    apply (frule sorted_spvec_cons1, auto)
  27.273 @@ -924,7 +924,7 @@
  27.274    done
  27.275    
  27.276    
  27.277 -lemma pprt_move_matrix: "pprt (move_matrix (A::('a::lordered_ring) matrix) j i) = move_matrix (pprt A) j i"
  27.278 +lemma pprt_move_matrix: "pprt (move_matrix (A::('a::lattice_ring) matrix) j i) = move_matrix (pprt A) j i"
  27.279    apply (simp add: pprt_def)
  27.280    apply (simp add: sup_matrix_def)
  27.281    apply (simp add: Rep_matrix_inject[symmetric])
  27.282 @@ -932,7 +932,7 @@
  27.283    apply (simp)
  27.284    done
  27.285  
  27.286 -lemma nprt_move_matrix: "nprt (move_matrix (A::('a::lordered_ring) matrix) j i) = move_matrix (nprt A) j i"
  27.287 +lemma nprt_move_matrix: "nprt (move_matrix (A::('a::lattice_ring) matrix) j i) = move_matrix (nprt A) j i"
  27.288    apply (simp add: nprt_def)
  27.289    apply (simp add: inf_matrix_def)
  27.290    apply (simp add: Rep_matrix_inject[symmetric])
  27.291 @@ -940,7 +940,7 @@
  27.292    apply (simp)
  27.293    done
  27.294  
  27.295 -lemma sparse_row_matrix_pprt: "sorted_spvec (m :: 'a::lordered_ring spmat) \<Longrightarrow> sorted_spmat m \<Longrightarrow> sparse_row_matrix (pprt_spmat m) = pprt (sparse_row_matrix m)"
  27.296 +lemma sparse_row_matrix_pprt: "sorted_spvec (m :: 'a::lattice_ring spmat) \<Longrightarrow> sorted_spmat m \<Longrightarrow> sparse_row_matrix (pprt_spmat m) = pprt (sparse_row_matrix m)"
  27.297    apply (induct m)
  27.298    apply simp
  27.299    apply simp
  27.300 @@ -956,7 +956,7 @@
  27.301    apply (simp add: pprt_move_matrix)
  27.302    done
  27.303  
  27.304 -lemma sparse_row_matrix_nprt: "sorted_spvec (m :: 'a::lordered_ring spmat) \<Longrightarrow> sorted_spmat m \<Longrightarrow> sparse_row_matrix (nprt_spmat m) = nprt (sparse_row_matrix m)"
  27.305 +lemma sparse_row_matrix_nprt: "sorted_spvec (m :: 'a::lattice_ring spmat) \<Longrightarrow> sorted_spmat m \<Longrightarrow> sparse_row_matrix (nprt_spmat m) = nprt (sparse_row_matrix m)"
  27.306    apply (induct m)
  27.307    apply simp
  27.308    apply simp
  27.309 @@ -1015,7 +1015,7 @@
  27.310    done
  27.311  
  27.312  constdefs
  27.313 -  mult_est_spmat :: "('a::lordered_ring) spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat"
  27.314 +  mult_est_spmat :: "('a::lattice_ring) spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat \<Rightarrow> 'a spmat"
  27.315    "mult_est_spmat r1 r2 s1 s2 == 
  27.316    add_spmat (mult_spmat (pprt_spmat s2) (pprt_spmat r2)) (add_spmat (mult_spmat (pprt_spmat s1) (nprt_spmat r2)) 
  27.317    (add_spmat (mult_spmat (nprt_spmat s2) (pprt_spmat r1)) (mult_spmat (nprt_spmat s1) (nprt_spmat r1))))"  
  27.318 @@ -1057,7 +1057,7 @@
  27.319    "sorted_spvec b"
  27.320    "sorted_spvec r"
  27.321    "le_spmat ([], y)"
  27.322 -  "A * x \<le> sparse_row_matrix (b::('a::lordered_ring) spmat)"
  27.323 +  "A * x \<le> sparse_row_matrix (b::('a::lattice_ring) spmat)"
  27.324    "sparse_row_matrix A1 <= A"
  27.325    "A <= sparse_row_matrix A2"
  27.326    "sparse_row_matrix c1 <= c"
    28.1 --- a/src/HOL/Matrix/cplex/Cplex.thy	Fri Feb 05 14:33:31 2010 +0100
    28.2 +++ b/src/HOL/Matrix/cplex/Cplex.thy	Fri Feb 05 14:33:50 2010 +0100
    28.3 @@ -25,7 +25,7 @@
    28.4    "c \<le> sparse_row_matrix c2"
    28.5    "sparse_row_matrix r1 \<le> x"
    28.6    "x \<le> sparse_row_matrix r2"
    28.7 -  "A * x \<le> sparse_row_matrix (b::('a::lordered_ring) spmat)"
    28.8 +  "A * x \<le> sparse_row_matrix (b::('a::lattice_ring) spmat)"
    28.9    shows
   28.10    "c * x \<le> sparse_row_matrix (add_spmat (mult_spmat y b)
   28.11    (let s1 = diff_spmat c1 (mult_spmat y A2); s2 = diff_spmat c2 (mult_spmat y A1) in 
   28.12 @@ -55,7 +55,7 @@
   28.13    "c \<le> sparse_row_matrix c2"
   28.14    "sparse_row_matrix r1 \<le> x"
   28.15    "x \<le> sparse_row_matrix r2"
   28.16 -  "A * x \<le> sparse_row_matrix (b::('a::lordered_ring) spmat)"
   28.17 +  "A * x \<le> sparse_row_matrix (b::('a::lattice_ring) spmat)"
   28.18    shows
   28.19    "c * x \<le> sparse_row_matrix (add_spmat (mult_spmat y b)
   28.20    (mult_est_spmat r1 r2 (diff_spmat c1 (mult_spmat y A2)) (diff_spmat c2 (mult_spmat y A1))))"
    29.1 --- a/src/HOL/Metis_Examples/BigO.thy	Fri Feb 05 14:33:31 2010 +0100
    29.2 +++ b/src/HOL/Metis_Examples/BigO.thy	Fri Feb 05 14:33:50 2010 +0100
    29.3 @@ -12,11 +12,11 @@
    29.4  
    29.5  subsection {* Definitions *}
    29.6  
    29.7 -definition bigo :: "('a => 'b::ordered_idom) => ('a => 'b) set"    ("(1O'(_'))") where
    29.8 +definition bigo :: "('a => 'b::linordered_idom) => ('a => 'b) set"    ("(1O'(_'))") where
    29.9    "O(f::('a => 'b)) ==   {h. EX c. ALL x. abs (h x) <= c * abs (f x)}"
   29.10  
   29.11  declare [[ atp_problem_prefix = "BigO__bigo_pos_const" ]]
   29.12 -lemma bigo_pos_const: "(EX (c::'a::ordered_idom). 
   29.13 +lemma bigo_pos_const: "(EX (c::'a::linordered_idom). 
   29.14      ALL x. (abs (h x)) <= (c * (abs (f x))))
   29.15        = (EX c. 0 < c & (ALL x. (abs(h x)) <= (c * (abs (f x)))))"
   29.16    apply auto
   29.17 @@ -30,7 +30,7 @@
   29.18  
   29.19  declare [[sledgehammer_modulus = 1]]
   29.20  
   29.21 -lemma (*bigo_pos_const:*) "(EX (c::'a::ordered_idom). 
   29.22 +lemma (*bigo_pos_const:*) "(EX (c::'a::linordered_idom). 
   29.23      ALL x. (abs (h x)) <= (c * (abs (f x))))
   29.24        = (EX c. 0 < c & (ALL x. (abs(h x)) <= (c * (abs (f x)))))"
   29.25    apply auto
   29.26 @@ -39,59 +39,59 @@
   29.27    apply (rule_tac x = "abs c" in exI, auto)
   29.28  proof (neg_clausify)
   29.29  fix c x
   29.30 -have 0: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom. \<bar>X1 * X2\<bar> = \<bar>X2 * X1\<bar>"
   29.31 +have 0: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom. \<bar>X1 * X2\<bar> = \<bar>X2 * X1\<bar>"
   29.32    by (metis abs_mult mult_commute)
   29.33 -have 1: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom.
   29.34 -   X1 \<le> (0\<Colon>'a\<Colon>ordered_idom) \<or> \<bar>X2\<bar> * X1 = \<bar>X2 * X1\<bar>"
   29.35 +have 1: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom.
   29.36 +   X1 \<le> (0\<Colon>'a\<Colon>linordered_idom) \<or> \<bar>X2\<bar> * X1 = \<bar>X2 * X1\<bar>"
   29.37    by (metis abs_mult_pos linorder_linear)
   29.38 -have 2: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom.
   29.39 -   \<not> (0\<Colon>'a\<Colon>ordered_idom) < X1 * X2 \<or>
   29.40 -   \<not> (0\<Colon>'a\<Colon>ordered_idom) \<le> X2 \<or> \<not> X1 \<le> (0\<Colon>'a\<Colon>ordered_idom)"
   29.41 +have 2: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom.
   29.42 +   \<not> (0\<Colon>'a\<Colon>linordered_idom) < X1 * X2 \<or>
   29.43 +   \<not> (0\<Colon>'a\<Colon>linordered_idom) \<le> X2 \<or> \<not> X1 \<le> (0\<Colon>'a\<Colon>linordered_idom)"
   29.44    by (metis linorder_not_less mult_nonneg_nonpos2)
   29.45  assume 3: "\<And>x\<Colon>'b\<Colon>type.
   29.46 -   \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>
   29.47 -   \<le> (c\<Colon>'a\<Colon>ordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>"
   29.48 -assume 4: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
   29.49 -  \<le> \<bar>c\<Colon>'a\<Colon>ordered_idom\<bar> * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>"
   29.50 -have 5: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
   29.51 -  \<le> \<bar>(c\<Colon>'a\<Colon>ordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>"
   29.52 +   \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>
   29.53 +   \<le> (c\<Colon>'a\<Colon>linordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>"
   29.54 +assume 4: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
   29.55 +  \<le> \<bar>c\<Colon>'a\<Colon>linordered_idom\<bar> * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>"
   29.56 +have 5: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
   29.57 +  \<le> \<bar>(c\<Colon>'a\<Colon>linordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>"
   29.58    by (metis 4 abs_mult)
   29.59 -have 6: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom.
   29.60 -   \<not> X1 \<le> (0\<Colon>'a\<Colon>ordered_idom) \<or> X1 \<le> \<bar>X2\<bar>"
   29.61 +have 6: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom.
   29.62 +   \<not> X1 \<le> (0\<Colon>'a\<Colon>linordered_idom) \<or> X1 \<le> \<bar>X2\<bar>"
   29.63    by (metis abs_ge_zero xt1(6))
   29.64 -have 7: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom.
   29.65 -   X1 \<le> \<bar>X2\<bar> \<or> (0\<Colon>'a\<Colon>ordered_idom) < X1"
   29.66 +have 7: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom.
   29.67 +   X1 \<le> \<bar>X2\<bar> \<or> (0\<Colon>'a\<Colon>linordered_idom) < X1"
   29.68    by (metis not_leE 6)
   29.69 -have 8: "(0\<Colon>'a\<Colon>ordered_idom) < \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>"
   29.70 +have 8: "(0\<Colon>'a\<Colon>linordered_idom) < \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>"
   29.71    by (metis 5 7)
   29.72 -have 9: "\<And>X1\<Colon>'a\<Colon>ordered_idom.
   29.73 -   \<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar> \<le> X1 \<or>
   29.74 -   (0\<Colon>'a\<Colon>ordered_idom) < X1"
   29.75 +have 9: "\<And>X1\<Colon>'a\<Colon>linordered_idom.
   29.76 +   \<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar> \<le> X1 \<or>
   29.77 +   (0\<Colon>'a\<Colon>linordered_idom) < X1"
   29.78    by (metis 8 order_less_le_trans)
   29.79 -have 10: "(0\<Colon>'a\<Colon>ordered_idom)
   29.80 -< (c\<Colon>'a\<Colon>ordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>"
   29.81 +have 10: "(0\<Colon>'a\<Colon>linordered_idom)
   29.82 +< (c\<Colon>'a\<Colon>linordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>"
   29.83    by (metis 3 9)
   29.84 -have 11: "\<not> (c\<Colon>'a\<Colon>ordered_idom) \<le> (0\<Colon>'a\<Colon>ordered_idom)"
   29.85 +have 11: "\<not> (c\<Colon>'a\<Colon>linordered_idom) \<le> (0\<Colon>'a\<Colon>linordered_idom)"
   29.86    by (metis abs_ge_zero 2 10)
   29.87 -have 12: "\<And>X1\<Colon>'a\<Colon>ordered_idom. (c\<Colon>'a\<Colon>ordered_idom) * \<bar>X1\<bar> = \<bar>X1 * c\<bar>"
   29.88 +have 12: "\<And>X1\<Colon>'a\<Colon>linordered_idom. (c\<Colon>'a\<Colon>linordered_idom) * \<bar>X1\<bar> = \<bar>X1 * c\<bar>"
   29.89    by (metis mult_commute 1 11)
   29.90  have 13: "\<And>X1\<Colon>'b\<Colon>type.
   29.91 -   - (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1
   29.92 -   \<le> (c\<Colon>'a\<Colon>ordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1\<bar>"
   29.93 +   - (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1
   29.94 +   \<le> (c\<Colon>'a\<Colon>linordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1\<bar>"
   29.95    by (metis 3 abs_le_D2)
   29.96  have 14: "\<And>X1\<Colon>'b\<Colon>type.
   29.97 -   - (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1
   29.98 -   \<le> \<bar>(c\<Colon>'a\<Colon>ordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1\<bar>"
   29.99 +   - (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1
  29.100 +   \<le> \<bar>(c\<Colon>'a\<Colon>linordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1\<bar>"
  29.101    by (metis 0 12 13)
  29.102 -have 15: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom. \<bar>X1 * \<bar>X2\<bar>\<bar> = \<bar>X1 * X2\<bar>"
  29.103 +have 15: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom. \<bar>X1 * \<bar>X2\<bar>\<bar> = \<bar>X1 * X2\<bar>"
  29.104    by (metis abs_mult abs_mult_pos abs_ge_zero)
  29.105 -have 16: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom. X1 \<le> \<bar>X2\<bar> \<or> \<not> X1 \<le> X2"
  29.106 +have 16: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom. X1 \<le> \<bar>X2\<bar> \<or> \<not> X1 \<le> X2"
  29.107    by (metis xt1(6) abs_ge_self)
  29.108 -have 17: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom. \<not> \<bar>X1\<bar> \<le> X2 \<or> X1 \<le> \<bar>X2\<bar>"
  29.109 +have 17: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom. \<not> \<bar>X1\<bar> \<le> X2 \<or> X1 \<le> \<bar>X2\<bar>"
  29.110    by (metis 16 abs_le_D1)
  29.111  have 18: "\<And>X1\<Colon>'b\<Colon>type.
  29.112 -   (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1
  29.113 -   \<le> \<bar>(c\<Colon>'a\<Colon>ordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1\<bar>"
  29.114 +   (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1
  29.115 +   \<le> \<bar>(c\<Colon>'a\<Colon>linordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1\<bar>"
  29.116    by (metis 17 3 15)
  29.117  show "False"
  29.118    by (metis abs_le_iff 5 18 14)
  29.119 @@ -99,7 +99,7 @@
  29.120  
  29.121  declare [[sledgehammer_modulus = 2]]
  29.122  
  29.123 -lemma (*bigo_pos_const:*) "(EX (c::'a::ordered_idom). 
  29.124 +lemma (*bigo_pos_const:*) "(EX (c::'a::linordered_idom). 
  29.125      ALL x. (abs (h x)) <= (c * (abs (f x))))
  29.126        = (EX c. 0 < c & (ALL x. (abs(h x)) <= (c * (abs (f x)))))"
  29.127    apply auto
  29.128 @@ -108,31 +108,31 @@
  29.129    apply (rule_tac x = "abs c" in exI, auto);
  29.130  proof (neg_clausify)
  29.131  fix c x
  29.132 -have 0: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom. \<bar>X1 * X2\<bar> = \<bar>X2 * X1\<bar>"
  29.133 +have 0: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom. \<bar>X1 * X2\<bar> = \<bar>X2 * X1\<bar>"
  29.134    by (metis abs_mult mult_commute)
  29.135  assume 1: "\<And>x\<Colon>'b\<Colon>type.
  29.136 -   \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>
  29.137 -   \<le> (c\<Colon>'a\<Colon>ordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>"
  29.138 -assume 2: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
  29.139 -  \<le> \<bar>c\<Colon>'a\<Colon>ordered_idom\<bar> * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>"
  29.140 -have 3: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
  29.141 -  \<le> \<bar>(c\<Colon>'a\<Colon>ordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>"
  29.142 +   \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>
  29.143 +   \<le> (c\<Colon>'a\<Colon>linordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>"
  29.144 +assume 2: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
  29.145 +  \<le> \<bar>c\<Colon>'a\<Colon>linordered_idom\<bar> * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>"
  29.146 +have 3: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
  29.147 +  \<le> \<bar>(c\<Colon>'a\<Colon>linordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>"
  29.148    by (metis 2 abs_mult)
  29.149 -have 4: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom.
  29.150 -   \<not> X1 \<le> (0\<Colon>'a\<Colon>ordered_idom) \<or> X1 \<le> \<bar>X2\<bar>"
  29.151 +have 4: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom.
  29.152 +   \<not> X1 \<le> (0\<Colon>'a\<Colon>linordered_idom) \<or> X1 \<le> \<bar>X2\<bar>"
  29.153    by (metis abs_ge_zero xt1(6))
  29.154 -have 5: "(0\<Colon>'a\<Colon>ordered_idom) < \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>"
  29.155 +have 5: "(0\<Colon>'a\<Colon>linordered_idom) < \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>"
  29.156    by (metis not_leE 4 3)
  29.157 -have 6: "(0\<Colon>'a\<Colon>ordered_idom)
  29.158 -< (c\<Colon>'a\<Colon>ordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>"
  29.159 +have 6: "(0\<Colon>'a\<Colon>linordered_idom)
  29.160 +< (c\<Colon>'a\<Colon>linordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>"
  29.161    by (metis 1 order_less_le_trans 5)
  29.162 -have 7: "\<And>X1\<Colon>'a\<Colon>ordered_idom. (c\<Colon>'a\<Colon>ordered_idom) * \<bar>X1\<bar> = \<bar>X1 * c\<bar>"
  29.163 +have 7: "\<And>X1\<Colon>'a\<Colon>linordered_idom. (c\<Colon>'a\<Colon>linordered_idom) * \<bar>X1\<bar> = \<bar>X1 * c\<bar>"
  29.164    by (metis abs_ge_zero linorder_not_less mult_nonneg_nonpos2 6 linorder_linear abs_mult_pos mult_commute)
  29.165  have 8: "\<And>X1\<Colon>'b\<Colon>type.
  29.166 -   - (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1
  29.167 -   \<le> \<bar>(c\<Colon>'a\<Colon>ordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1\<bar>"
  29.168 +   - (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1
  29.169 +   \<le> \<bar>(c\<Colon>'a\<Colon>linordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1\<bar>"
  29.170    by (metis 0 7 abs_le_D2 1)
  29.171 -have 9: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom. \<not> \<bar>X1\<bar> \<le> X2 \<or> X1 \<le> \<bar>X2\<bar>"
  29.172 +have 9: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom. \<not> \<bar>X1\<bar> \<le> X2 \<or> X1 \<le> \<bar>X2\<bar>"
  29.173    by (metis abs_ge_self xt1(6) abs_le_D1)
  29.174  show "False"
  29.175    by (metis 8 abs_ge_zero abs_mult_pos abs_mult 1 9 3 abs_le_iff)
  29.176 @@ -140,7 +140,7 @@
  29.177  
  29.178  declare [[sledgehammer_modulus = 3]]
  29.179  
  29.180 -lemma (*bigo_pos_const:*) "(EX (c::'a::ordered_idom). 
  29.181 +lemma (*bigo_pos_const:*) "(EX (c::'a::linordered_idom). 
  29.182      ALL x. (abs (h x)) <= (c * (abs (f x))))
  29.183        = (EX c. 0 < c & (ALL x. (abs(h x)) <= (c * (abs (f x)))))"
  29.184    apply auto
  29.185 @@ -150,20 +150,20 @@
  29.186  proof (neg_clausify)
  29.187  fix c x
  29.188  assume 0: "\<And>x\<Colon>'b\<Colon>type.
  29.189 -   \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>
  29.190 -   \<le> (c\<Colon>'a\<Colon>ordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>"
  29.191 -assume 1: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
  29.192 -  \<le> \<bar>c\<Colon>'a\<Colon>ordered_idom\<bar> * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) x\<bar>"
  29.193 -have 2: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom.
  29.194 -   X1 \<le> \<bar>X2\<bar> \<or> (0\<Colon>'a\<Colon>ordered_idom) < X1"
  29.195 +   \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>
  29.196 +   \<le> (c\<Colon>'a\<Colon>linordered_idom) * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>"
  29.197 +assume 1: "\<not> \<bar>(h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) (x\<Colon>'b\<Colon>type)\<bar>
  29.198 +  \<le> \<bar>c\<Colon>'a\<Colon>linordered_idom\<bar> * \<bar>(f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) x\<bar>"
  29.199 +have 2: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom.
  29.200 +   X1 \<le> \<bar>X2\<bar> \<or> (0\<Colon>'a\<Colon>linordered_idom) < X1"
  29.201    by (metis abs_ge_zero xt1(6) not_leE)
  29.202 -have 3: "\<not> (c\<Colon>'a\<Colon>ordered_idom) \<le> (0\<Colon>'a\<Colon>ordered_idom)"
  29.203 +have 3: "\<not> (c\<Colon>'a\<Colon>linordered_idom) \<le> (0\<Colon>'a\<Colon>linordered_idom)"
  29.204    by (metis abs_ge_zero mult_nonneg_nonpos2 linorder_not_less order_less_le_trans 1 abs_mult 2 0)
  29.205 -have 4: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2\<Colon>'a\<Colon>ordered_idom. \<bar>X1 * \<bar>X2\<bar>\<bar> = \<bar>X1 * X2\<bar>"
  29.206 +have 4: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2\<Colon>'a\<Colon>linordered_idom. \<bar>X1 * \<bar>X2\<bar>\<bar> = \<bar>X1 * X2\<bar>"
  29.207    by (metis abs_ge_zero abs_mult_pos abs_mult)
  29.208  have 5: "\<And>X1\<Colon>'b\<Colon>type.
  29.209 -   (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1
  29.210 -   \<le> \<bar>(c\<Colon>'a\<Colon>ordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>ordered_idom) X1\<bar>"
  29.211 +   (h\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1
  29.212 +   \<le> \<bar>(c\<Colon>'a\<Colon>linordered_idom) * (f\<Colon>'b\<Colon>type \<Rightarrow> 'a\<Colon>linordered_idom) X1\<bar>"
  29.213    by (metis 4 0 xt1(6) abs_ge_self abs_le_D1)
  29.214  show "False"
  29.215    by (metis abs_mult mult_commute 3 abs_mult_pos linorder_linear 0 abs_le_D2 5 1 abs_le_iff)
  29.216 @@ -172,7 +172,7 @@
  29.217  
  29.218  declare [[sledgehammer_modulus = 1]]
  29.219  
  29.220 -lemma (*bigo_pos_const:*) "(EX (c::'a::ordered_idom). 
  29.221 +lemma (*bigo_pos_const:*) "(EX (c::'a::linordered_idom). 
  29.222      ALL x. (abs (h x)) <= (c * (abs (f x))))
  29.223        = (EX c. 0 < c & (ALL x. (abs(h x)) <= (c * (abs (f x)))))"
  29.224    apply auto
  29.225 @@ -181,7 +181,7 @@
  29.226    apply (rule_tac x = "abs c" in exI, auto);
  29.227  proof (neg_clausify)
  29.228  fix c x  (*sort/type constraint inserted by hand!*)
  29.229 -have 0: "\<And>(X1\<Colon>'a\<Colon>ordered_idom) X2. \<bar>X1 * \<bar>X2\<bar>\<bar> = \<bar>X1 * X2\<bar>"
  29.230 +have 0: "\<And>(X1\<Colon>'a\<Colon>linordered_idom) X2. \<bar>X1 * \<bar>X2\<bar>\<bar> = \<bar>X1 * X2\<bar>"
  29.231    by (metis abs_ge_zero abs_mult_pos abs_mult)
  29.232  assume 1: "\<And>A. \<bar>h A\<bar> \<le> c * \<bar>f A\<bar>"
  29.233  have 2: "\<And>X1 X2. \<not> \<bar>X1\<bar> \<le> X2 \<or> (0\<Colon>'a) \<le> X2"
  29.234 @@ -383,11 +383,11 @@
  29.235    by (metis 0 order_antisym_conv)
  29.236  have 3: "\<And>X3. \<not> f (x \<bar>X3\<bar>) \<le> \<bar>X3 * g (x \<bar>X3\<bar>)\<bar>"
  29.237    by (metis 1 abs_mult)
  29.238 -have 4: "\<And>X1 X3\<Colon>'b\<Colon>ordered_idom. X3 \<le> X1 \<or> X1 \<le> \<bar>X3\<bar>"
  29.239 +have 4: "\<And>X1 X3\<Colon>'b\<Colon>linordered_idom. X3 \<le> X1 \<or> X1 \<le> \<bar>X3\<bar>"
  29.240    by (metis linorder_linear abs_le_D1)
  29.241  have 5: "\<And>X3::'b. \<bar>X3\<bar> * \<bar>X3\<bar> = X3 * X3"
  29.242    by (metis abs_mult_self)
  29.243 -have 6: "\<And>X3. \<not> X3 * X3 < (0\<Colon>'b\<Colon>ordered_idom)"
  29.244 +have 6: "\<And>X3. \<not> X3 * X3 < (0\<Colon>'b\<Colon>linordered_idom)"
  29.245    by (metis not_square_less_zero)
  29.246  have 7: "\<And>X1 X3::'b. \<bar>X1\<bar> * \<bar>X3\<bar> = \<bar>X3 * X1\<bar>"
  29.247    by (metis abs_mult mult_commute)
  29.248 @@ -438,26 +438,26 @@
  29.249  proof (neg_clausify)
  29.250  fix x
  29.251  assume 0: "\<And>A\<Colon>'a\<Colon>type.
  29.252 -   (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) A
  29.253 -   \<le> (c\<Colon>'b\<Colon>ordered_idom) * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) A"
  29.254 -assume 1: "\<And>A\<Colon>'b\<Colon>ordered_idom.
  29.255 -   \<not> (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) ((x\<Colon>'b\<Colon>ordered_idom \<Rightarrow> 'a\<Colon>type) A)
  29.256 -     \<le> A * \<bar>(g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) (x A)\<bar>"
  29.257 +   (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) A
  29.258 +   \<le> (c\<Colon>'b\<Colon>linordered_idom) * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) A"
  29.259 +assume 1: "\<And>A\<Colon>'b\<Colon>linordered_idom.
  29.260 +   \<not> (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) ((x\<Colon>'b\<Colon>linordered_idom \<Rightarrow> 'a\<Colon>type) A)
  29.261 +     \<le> A * \<bar>(g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) (x A)\<bar>"
  29.262  have 2: "\<And>X2\<Colon>'a\<Colon>type.
  29.263 -   \<not> (c\<Colon>'b\<Colon>ordered_idom) * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) X2
  29.264 -     < (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) X2"
  29.265 +   \<not> (c\<Colon>'b\<Colon>linordered_idom) * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) X2
  29.266 +     < (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) X2"
  29.267    by (metis 0 linorder_not_le)
  29.268 -have 3: "\<And>X2\<Colon>'b\<Colon>ordered_idom.
  29.269 -   \<not> (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) ((x\<Colon>'b\<Colon>ordered_idom \<Rightarrow> 'a\<Colon>type) \<bar>X2\<bar>)
  29.270 -     \<le> \<bar>X2 * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) (x \<bar>X2\<bar>)\<bar>"
  29.271 +have 3: "\<And>X2\<Colon>'b\<Colon>linordered_idom.
  29.272 +   \<not> (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) ((x\<Colon>'b\<Colon>linordered_idom \<Rightarrow> 'a\<Colon>type) \<bar>X2\<bar>)
  29.273 +     \<le> \<bar>X2 * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) (x \<bar>X2\<bar>)\<bar>"
  29.274    by (metis abs_mult 1)
  29.275 -have 4: "\<And>X2\<Colon>'b\<Colon>ordered_idom.
  29.276 -   \<bar>X2 * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) ((x\<Colon>'b\<Colon>ordered_idom \<Rightarrow> 'a\<Colon>type) \<bar>X2\<bar>)\<bar>
  29.277 -   < (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) (x \<bar>X2\<bar>)"
  29.278 +have 4: "\<And>X2\<Colon>'b\<Colon>linordered_idom.
  29.279 +   \<bar>X2 * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) ((x\<Colon>'b\<Colon>linordered_idom \<Rightarrow> 'a\<Colon>type) \<bar>X2\<bar>)\<bar>
  29.280 +   < (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) (x \<bar>X2\<bar>)"
  29.281    by (metis 3 linorder_not_less)
  29.282 -have 5: "\<And>X2\<Colon>'b\<Colon>ordered_idom.
  29.283 -   X2 * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) ((x\<Colon>'b\<Colon>ordered_idom \<Rightarrow> 'a\<Colon>type) \<bar>X2\<bar>)
  29.284 -   < (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) (x \<bar>X2\<bar>)"
  29.285 +have 5: "\<And>X2\<Colon>'b\<Colon>linordered_idom.
  29.286 +   X2 * (g\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) ((x\<Colon>'b\<Colon>linordered_idom \<Rightarrow> 'a\<Colon>type) \<bar>X2\<bar>)
  29.287 +   < (f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) (x \<bar>X2\<bar>)"
  29.288    by (metis abs_less_iff 4)
  29.289  show "False"
  29.290    by (metis 2 5)
  29.291 @@ -603,54 +603,54 @@
  29.292    just been done*)
  29.293  proof (neg_clausify)
  29.294  fix a c b ca x
  29.295 -assume 0: "(0\<Colon>'b\<Colon>ordered_idom) < (c\<Colon>'b\<Colon>ordered_idom)"
  29.296 -assume 1: "\<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) (x\<Colon>'a)\<bar>
  29.297 -\<le> (c\<Colon>'b\<Colon>ordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>"
  29.298 -assume 2: "\<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) (x\<Colon>'a)\<bar>
  29.299 -\<le> (ca\<Colon>'b\<Colon>ordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>"
  29.300 -assume 3: "\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) (x\<Colon>'a)\<bar> *
  29.301 -  \<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>
  29.302 -  \<le> (c\<Colon>'b\<Colon>ordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar> *
  29.303 -    ((ca\<Colon>'b\<Colon>ordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>)"
  29.304 -have 4: "\<bar>c\<Colon>'b\<Colon>ordered_idom\<bar> = c"
  29.305 +assume 0: "(0\<Colon>'b\<Colon>linordered_idom) < (c\<Colon>'b\<Colon>linordered_idom)"
  29.306 +assume 1: "\<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) (x\<Colon>'a)\<bar>
  29.307 +\<le> (c\<Colon>'b\<Colon>linordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>"
  29.308 +assume 2: "\<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) (x\<Colon>'a)\<bar>
  29.309 +\<le> (ca\<Colon>'b\<Colon>linordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>"
  29.310 +assume 3: "\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) (x\<Colon>'a)\<bar> *
  29.311 +  \<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>
  29.312 +  \<le> (c\<Colon>'b\<Colon>linordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar> *
  29.313 +    ((ca\<Colon>'b\<Colon>linordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>)"
  29.314 +have 4: "\<bar>c\<Colon>'b\<Colon>linordered_idom\<bar> = c"
  29.315    by (metis OrderedGroup.abs_of_pos 0)
  29.316 -have 5: "\<And>X1\<Colon>'b\<Colon>ordered_idom. (c\<Colon>'b\<Colon>ordered_idom) * \<bar>X1\<bar> = \<bar>c * X1\<bar>"
  29.317 +have 5: "\<And>X1\<Colon>'b\<Colon>linordered_idom. (c\<Colon>'b\<Colon>linordered_idom) * \<bar>X1\<bar> = \<bar>c * X1\<bar>"
  29.318    by (metis Ring_and_Field.abs_mult 4)
  29.319 -have 6: "(0\<Colon>'b\<Colon>ordered_idom) = (1\<Colon>'b\<Colon>ordered_idom) \<or>
  29.320 -(0\<Colon>'b\<Colon>ordered_idom) < (1\<Colon>'b\<Colon>ordered_idom)"
  29.321 -  by (metis OrderedGroup.abs_not_less_zero Ring_and_Field.abs_one Ring_and_Field.linorder_neqE_ordered_idom)
  29.322 -have 7: "(0\<Colon>'b\<Colon>ordered_idom) < (1\<Colon>'b\<Colon>ordered_idom)"
  29.323 +have 6: "(0\<Colon>'b\<Colon>linordered_idom) = (1\<Colon>'b\<Colon>linordered_idom) \<or>
  29.324 +(0\<Colon>'b\<Colon>linordered_idom) < (1\<Colon>'b\<Colon>linordered_idom)"
  29.325 +  by (metis OrderedGroup.abs_not_less_zero Ring_and_Field.abs_one Ring_and_Field.linorder_neqE_linordered_idom)
  29.326 +have 7: "(0\<Colon>'b\<Colon>linordered_idom) < (1\<Colon>'b\<Colon>linordered_idom)"
  29.327    by (metis 6 Ring_and_Field.one_neq_zero)
  29.328 -have 8: "\<bar>1\<Colon>'b\<Colon>ordered_idom\<bar> = (1\<Colon>'b\<Colon>ordered_idom)"
  29.329 +have 8: "\<bar>1\<Colon>'b\<Colon>linordered_idom\<bar> = (1\<Colon>'b\<Colon>linordered_idom)"
  29.330    by (metis OrderedGroup.abs_of_pos 7)
  29.331 -have 9: "\<And>X1\<Colon>'b\<Colon>ordered_idom. (0\<Colon>'b\<Colon>ordered_idom) \<le> (c\<Colon>'b\<Colon>ordered_idom) * \<bar>X1\<bar>"
  29.332 +have 9: "\<And>X1\<Colon>'b\<Colon>linordered_idom. (0\<Colon>'b\<Colon>linordered_idom) \<le> (c\<Colon>'b\<Colon>linordered_idom) * \<bar>X1\<bar>"
  29.333    by (metis OrderedGroup.abs_ge_zero 5)
  29.334 -have 10: "\<And>X1\<Colon>'b\<Colon>ordered_idom. X1 * (1\<Colon>'b\<Colon>ordered_idom) = X1"
  29.335 +have 10: "\<And>X1\<Colon>'b\<Colon>linordered_idom. X1 * (1\<Colon>'b\<Colon>linordered_idom) = X1"
  29.336    by (metis Ring_and_Field.mult_cancel_right2 mult_commute)
  29.337 -have 11: "\<And>X1\<Colon>'b\<Colon>ordered_idom. \<bar>\<bar>X1\<bar>\<bar> = \<bar>X1\<bar> * \<bar>1\<Colon>'b\<Colon>ordered_idom\<bar>"
  29.338 +have 11: "\<And>X1\<Colon>'b\<Colon>linordered_idom. \<bar>\<bar>X1\<bar>\<bar> = \<bar>X1\<bar> * \<bar>1\<Colon>'b\<Colon>linordered_idom\<bar>"
  29.339    by (metis Ring_and_Field.abs_mult OrderedGroup.abs_idempotent 10)
  29.340 -have 12: "\<And>X1\<Colon>'b\<Colon>ordered_idom. \<bar>\<bar>X1\<bar>\<bar> = \<bar>X1\<bar>"
  29.341 +have 12: "\<And>X1\<Colon>'b\<Colon>linordered_idom. \<bar>\<bar>X1\<bar>\<bar> = \<bar>X1\<bar>"
  29.342    by (metis 11 8 10)
  29.343 -have 13: "\<And>X1\<Colon>'b\<Colon>ordered_idom. (0\<Colon>'b\<Colon>ordered_idom) \<le> \<bar>X1\<bar>"
  29.344 +have 13: "\<And>X1\<Colon>'b\<Colon>linordered_idom. (0\<Colon>'b\<Colon>linordered_idom) \<le> \<bar>X1\<bar>"
  29.345    by (metis OrderedGroup.abs_ge_zero 12)
  29.346 -have 14: "\<not> (0\<Colon>'b\<Colon>ordered_idom)
  29.347 -  \<le> (c\<Colon>'b\<Colon>ordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) (x\<Colon>'a)\<bar> \<or>
  29.348 -\<not> (0\<Colon>'b\<Colon>ordered_idom) \<le> \<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar> \<or>
  29.349 -\<not> \<bar>b x\<bar> \<le> (ca\<Colon>'b\<Colon>ordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar> \<or>
  29.350 -\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar> \<le> c * \<bar>f x\<bar>"
  29.351 +have 14: "\<not> (0\<Colon>'b\<Colon>linordered_idom)
  29.352 +  \<le> (c\<Colon>'b\<Colon>linordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) (x\<Colon>'a)\<bar> \<or>
  29.353 +\<not> (0\<Colon>'b\<Colon>linordered_idom) \<le> \<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar> \<or>
  29.354 +\<not> \<bar>b x\<bar> \<le> (ca\<Colon>'b\<Colon>linordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar> \<or>
  29.355 +\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar> \<le> c * \<bar>f x\<bar>"
  29.356    by (metis 3 Ring_and_Field.mult_mono)
  29.357 -have 15: "\<not> (0\<Colon>'b\<Colon>ordered_idom) \<le> \<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) (x\<Colon>'a)\<bar> \<or>
  29.358 -\<not> \<bar>b x\<bar> \<le> (ca\<Colon>'b\<Colon>ordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar> \<or>
  29.359 -\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>
  29.360 -  \<le> (c\<Colon>'b\<Colon>ordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>"
  29.361 +have 15: "\<not> (0\<Colon>'b\<Colon>linordered_idom) \<le> \<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) (x\<Colon>'a)\<bar> \<or>
  29.362 +\<not> \<bar>b x\<bar> \<le> (ca\<Colon>'b\<Colon>linordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar> \<or>
  29.363 +\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>
  29.364 +  \<le> (c\<Colon>'b\<Colon>linordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>"
  29.365    by (metis 14 9)
  29.366 -have 16: "\<not> \<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) (x\<Colon>'a)\<bar>
  29.367 -  \<le> (ca\<Colon>'b\<Colon>ordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar> \<or>
  29.368 -\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>
  29.369 -  \<le> (c\<Colon>'b\<Colon>ordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>"
  29.370 +have 16: "\<not> \<bar>(b\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) (x\<Colon>'a)\<bar>
  29.371 +  \<le> (ca\<Colon>'b\<Colon>linordered_idom) * \<bar>(g\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar> \<or>
  29.372 +\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>
  29.373 +  \<le> (c\<Colon>'b\<Colon>linordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>"
  29.374    by (metis 15 13)
  29.375 -have 17: "\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) (x\<Colon>'a)\<bar>
  29.376 -  \<le> (c\<Colon>'b\<Colon>ordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>ordered_idom) x\<bar>"
  29.377 +have 17: "\<not> \<bar>(a\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) (x\<Colon>'a)\<bar>
  29.378 +  \<le> (c\<Colon>'b\<Colon>linordered_idom) * \<bar>(f\<Colon>'a \<Rightarrow> 'b\<Colon>linordered_idom) x\<bar>"
  29.379    by (metis 16 2)
  29.380  show 18: "False"
  29.381    by (metis 17 1)
  29.382 @@ -682,7 +682,7 @@
  29.383  
  29.384  
  29.385  lemma bigo_mult5: "ALL x. f x ~= 0 ==>
  29.386 -    O(f * g) <= (f::'a => ('b::ordered_field)) *o O(g)"
  29.387 +    O(f * g) <= (f::'a => ('b::linordered_field)) *o O(g)"
  29.388  proof -
  29.389    assume "ALL x. f x ~= 0"
  29.390    show "O(f * g) <= f *o O(g)"
  29.391 @@ -712,14 +712,14 @@
  29.392  
  29.393  declare [[ atp_problem_prefix = "BigO__bigo_mult6" ]]
  29.394  lemma bigo_mult6: "ALL x. f x ~= 0 ==>
  29.395 -    O(f * g) = (f::'a => ('b::ordered_field)) *o O(g)"
  29.396 +    O(f * g) = (f::'a => ('b::linordered_field)) *o O(g)"
  29.397  by (metis bigo_mult2 bigo_mult5 order_antisym)
  29.398  
  29.399  (*proof requires relaxing relevance: 2007-01-25*)
  29.400  declare [[ atp_problem_prefix = "BigO__bigo_mult7" ]]
  29.401    declare bigo_mult6 [simp]
  29.402  lemma bigo_mult7: "ALL x. f x ~= 0 ==>
  29.403 -    O(f * g) <= O(f::'a => ('b::ordered_field)) \<otimes> O(g)"
  29.404 +    O(f * g) <= O(f::'a => ('b::linordered_field)) \<otimes> O(g)"
  29.405  (*sledgehammer*)
  29.406    apply (subst bigo_mult6)
  29.407    apply assumption
  29.408 @@ -731,7 +731,7 @@
  29.409  declare [[ atp_problem_prefix = "BigO__bigo_mult8" ]]
  29.410    declare bigo_mult7[intro!]
  29.411  lemma bigo_mult8: "ALL x. f x ~= 0 ==>
  29.412 -    O(f * g) = O(f::'a => ('b::ordered_field)) \<otimes> O(g)"
  29.413 +    O(f * g) = O(f::'a => ('b::linordered_field)) \<otimes> O(g)"
  29.414  by (metis bigo_mult bigo_mult7 order_antisym_conv)
  29.415  
  29.416  lemma bigo_minus [intro]: "f : O(g) ==> - f : O(g)"
  29.417 @@ -810,11 +810,11 @@
  29.418  lemma (*bigo_const2 [intro]:*) "O(%x. c) <= O(%x. 1)"
  29.419  by (metis bigo_const1 bigo_elt_subset);
  29.420  
  29.421 -lemma bigo_const2 [intro]: "O(%x. c::'b::ordered_idom) <= O(%x. 1)";
  29.422 +lemma bigo_const2 [intro]: "O(%x. c::'b::linordered_idom) <= O(%x. 1)";
  29.423  (*??FAILS because the two occurrences of COMBK have different polymorphic types
  29.424  proof (neg_clausify)
  29.425 -assume 0: "\<not> O(COMBK (c\<Colon>'b\<Colon>ordered_idom)) \<subseteq> O(COMBK (1\<Colon>'b\<Colon>ordered_idom))"
  29.426 -have 1: "COMBK (c\<Colon>'b\<Colon>ordered_idom) \<notin> O(COMBK (1\<Colon>'b\<Colon>ordered_idom))"
  29.427 +assume 0: "\<not> O(COMBK (c\<Colon>'b\<Colon>linordered_idom)) \<subseteq> O(COMBK (1\<Colon>'b\<Colon>linordered_idom))"
  29.428 +have 1: "COMBK (c\<Colon>'b\<Colon>linordered_idom) \<notin> O(COMBK (1\<Colon>'b\<Colon>linordered_idom))"
  29.429  apply (rule notI) 
  29.430  apply (rule 0 [THEN notE]) 
  29.431  apply (rule bigo_elt_subset) 
  29.432 @@ -830,26 +830,26 @@
  29.433  done
  29.434  
  29.435  declare [[ atp_problem_prefix = "BigO__bigo_const3" ]]
  29.436 -lemma bigo_const3: "(c::'a::ordered_field) ~= 0 ==> (%x. 1) : O(%x. c)"
  29.437 +lemma bigo_const3: "(c::'a::linordered_field) ~= 0 ==> (%x. 1) : O(%x. c)"
  29.438  apply (simp add: bigo_def)
  29.439  proof (neg_clausify)
  29.440 -assume 0: "(c\<Colon>'a\<Colon>ordered_field) \<noteq> (0\<Colon>'a\<Colon>ordered_field)"
  29.441 -assume 1: "\<And>A\<Colon>'a\<Colon>ordered_field. \<not> (1\<Colon>'a\<Colon>ordered_field) \<le> A * \<bar>c\<Colon>'a\<Colon>ordered_field\<bar>"
  29.442 -have 2: "(0\<Colon>'a\<Colon>ordered_field) = \<bar>c\<Colon>'a\<Colon>ordered_field\<bar> \<or>
  29.443 -\<not> (1\<Colon>'a\<Colon>ordered_field) \<le> (1\<Colon>'a\<Colon>ordered_field)"
  29.444 +assume 0: "(c\<Colon>'a\<Colon>linordered_field) \<noteq> (0\<Colon>'a\<Colon>linordered_field)"
  29.445 +assume 1: "\<And>A\<Colon>'a\<Colon>linordered_field. \<not> (1\<Colon>'a\<Colon>linordered_field) \<le> A * \<bar>c\<Colon>'a\<Colon>linordered_field\<bar>"
  29.446 +have 2: "(0\<Colon>'a\<Colon>linordered_field) = \<bar>c\<Colon>'a\<Colon>linordered_field\<bar> \<or>
  29.447 +\<not> (1\<Colon>'a\<Colon>linordered_field) \<le> (1\<Colon>'a\<Colon>linordered_field)"
  29.448    by (metis 1 field_inverse)
  29.449 -have 3: "\<bar>c\<Colon>'a\<Colon>ordered_field\<bar> = (0\<Colon>'a\<Colon>ordered_field)"
  29.450 +have 3: "\<bar>c\<Colon>'a\<Colon>linordered_field\<bar> = (0\<Colon>'a\<Colon>linordered_field)"
  29.451    by (metis linorder_neq_iff linorder_antisym_conv1 2)
  29.452 -have 4: "(0\<Colon>'a\<Colon>ordered_field) = (c\<Colon>'a\<Colon>ordered_field)"
  29.453 +have 4: "(0\<Colon>'a\<Colon>linordered_field) = (c\<Colon>'a\<Colon>linordered_field)"
  29.454    by (metis 3 abs_eq_0)
  29.455  show "False"
  29.456    by (metis 0 4)
  29.457  qed
  29.458  
  29.459 -lemma bigo_const4: "(c::'a::ordered_field) ~= 0 ==> O(%x. 1) <= O(%x. c)"
  29.460 +lemma bigo_const4: "(c::'a::linordered_field) ~= 0 ==> O(%x. 1) <= O(%x. c)"
  29.461  by (rule bigo_elt_subset, rule bigo_const3, assumption)
  29.462  
  29.463 -lemma bigo_const [simp]: "(c::'a::ordered_field) ~= 0 ==> 
  29.464 +lemma bigo_const [simp]: "(c::'a::linordered_field) ~= 0 ==> 
  29.465      O(%x. c) = O(%x. 1)"
  29.466  by (rule equalityI, rule bigo_const2, rule bigo_const4, assumption)
  29.467  
  29.468 @@ -858,9 +858,9 @@
  29.469    apply (simp add: bigo_def abs_mult)
  29.470  proof (neg_clausify)
  29.471  fix x
  29.472 -assume 0: "\<And>xa\<Colon>'b\<Colon>ordered_idom.
  29.473 -   \<not> \<bar>c\<Colon>'b\<Colon>ordered_idom\<bar> *
  29.474 -     \<bar>(f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>ordered_idom) ((x\<Colon>'b\<Colon>ordered_idom \<Rightarrow> 'a\<Colon>type) xa)\<bar>
  29.475 +assume 0: "\<And>xa\<Colon>'b\<Colon>linordered_idom.
  29.476 +   \<not> \<bar>c\<Colon>'b\<Colon>linordered_idom\<bar> *
  29.477 +     \<bar>(f\<Colon>'a\<Colon>type \<Rightarrow> 'b\<Colon>linordered_idom) ((x\<Colon>'b\<Colon>linordered_idom \<Rightarrow> 'a\<Colon>type) xa)\<bar>
  29.478       \<le> xa * \<bar>f (x xa)\<bar>"
  29.479  show "False"
  29.480    by (metis linorder_neq_iff linorder_antisym_conv1 0)
  29.481 @@ -870,7 +870,7 @@
  29.482  by (rule bigo_elt_subset, rule bigo_const_mult1)
  29.483  
  29.484  declare [[ atp_problem_prefix = "BigO__bigo_const_mult3" ]]
  29.485 -lemma bigo_const_mult3: "(c::'a::ordered_field) ~= 0 ==> f : O(%x. c * f x)"
  29.486 +lemma bigo_const_mult3: "(c::'a::linordered_field) ~= 0 ==> f : O(%x. c * f x)"
  29.487    apply (simp add: bigo_def)
  29.488  (*sledgehammer [no luck]*); 
  29.489    apply (rule_tac x = "abs(inverse c)" in exI)
  29.490 @@ -879,16 +879,16 @@
  29.491  apply (auto ); 
  29.492  done
  29.493  
  29.494 -lemma bigo_const_mult4: "(c::'a::ordered_field) ~= 0 ==> 
  29.495 +lemma bigo_const_mult4: "(c::'a::linordered_field) ~= 0 ==> 
  29.496      O(f) <= O(%x. c * f x)"
  29.497  by (rule bigo_elt_subset, rule bigo_const_mult3, assumption)
  29.498  
  29.499 -lemma bigo_const_mult [simp]: "(c::'a::ordered_field) ~= 0 ==> 
  29.500 +lemma bigo_const_mult [simp]: "(c::'a::linordered_field) ~= 0 ==> 
  29.501      O(%x. c * f x) = O(f)"
  29.502  by (rule equalityI, rule bigo_const_mult2, erule bigo_const_mult4)
  29.503  
  29.504  declare [[ atp_problem_prefix = "BigO__bigo_const_mult5" ]]
  29.505 -lemma bigo_const_mult5 [simp]: "(c::'a::ordered_field) ~= 0 ==> 
  29.506 +lemma bigo_const_mult5 [simp]: "(c::'a::linordered_field) ~= 0 ==> 
  29.507      (%x. c) *o O(f) = O(f)"
  29.508    apply (auto del: subsetI)
  29.509    apply (rule order_trans)
  29.510 @@ -1057,7 +1057,7 @@
  29.511    apply assumption+
  29.512  done
  29.513    
  29.514 -lemma bigo_useful_const_mult: "(c::'a::ordered_field) ~= 0 ==> 
  29.515 +lemma bigo_useful_const_mult: "(c::'a::linordered_field) ~= 0 ==> 
  29.516      (%x. c) * f =o O(h) ==> f =o O(h)"
  29.517    apply (rule subsetD)
  29.518    apply (subgoal_tac "(%x. 1 / c) *o O(h) <= O(h)")
  29.519 @@ -1100,7 +1100,7 @@
  29.520  subsection {* Less than or equal to *}
  29.521  
  29.522  constdefs 
  29.523 -  lesso :: "('a => 'b::ordered_idom) => ('a => 'b) => ('a => 'b)"
  29.524 +  lesso :: "('a => 'b::linordered_idom) => ('a => 'b) => ('a => 'b)"
  29.525        (infixl "<o" 70)
  29.526    "f <o g == (%x. max (f x - g x) 0)"
  29.527  
  29.528 @@ -1165,7 +1165,7 @@
  29.529  proof (neg_clausify)
  29.530  fix x
  29.531  assume 0: "\<And>A. k A \<le> f A"
  29.532 -have 1: "\<And>(X1\<Colon>'b\<Colon>ordered_idom) X2. \<not> max X1 X2 < X1"
  29.533 +have 1: "\<And>(X1\<Colon>'b\<Colon>linordered_idom) X2. \<not> max X1 X2 < X1"
  29.534    by (metis linorder_not_less le_maxI1)  (*sort inserted by hand*)
  29.535  assume 2: "(0\<Colon>'b) \<le> k x - g x"
  29.536  have 3: "\<not> k x - g x < (0\<Colon>'b)"
  29.537 @@ -1206,7 +1206,7 @@
  29.538  apply (metis abs_ge_zero linorder_linear min_max.sup_absorb1 min_max.sup_commute)
  29.539  done
  29.540  
  29.541 -lemma bigo_lesso4: "f <o g =o O(k::'a=>'b::ordered_field) ==>
  29.542 +lemma bigo_lesso4: "f <o g =o O(k::'a=>'b::linordered_field) ==>
  29.543      g =o h +o O(k) ==> f <o h =o O(k)"
  29.544    apply (unfold lesso_def)
  29.545    apply (drule set_plus_imp_minus)
    30.1 --- a/src/HOL/Multivariate_Analysis/Derivative.thy	Fri Feb 05 14:33:31 2010 +0100
    30.2 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy	Fri Feb 05 14:33:50 2010 +0100
    30.3 @@ -1183,7 +1183,7 @@
    30.4        fix y assume as:"y \<in> s" "0 < dist y x" "dist y x < e / (B * C * D)"
    30.5        have "norm (h (f' (y - x)) (g' (y - x))) \<le> norm (f' (y - x)) * norm (g' (y - x)) * B" using B by auto
    30.6        also have "\<dots> \<le> (norm (y - x) * C) * (D * norm (y - x)) * B" apply(rule mult_right_mono)
    30.7 -	apply(rule pordered_semiring_class.mult_mono) using B C D by (auto simp add: field_simps intro!:mult_nonneg_nonneg)
    30.8 +	apply(rule mult_mono) using B C D by (auto simp add: field_simps intro!:mult_nonneg_nonneg)
    30.9        also have "\<dots> = (B * C * D * norm (y - x)) * norm (y - x)" by(auto simp add:field_simps)
   30.10        also have "\<dots> < e * norm (y - x)" apply(rule mult_strict_right_mono)
   30.11  	using as(3)[unfolded vector_dist_norm] and as(2) unfolding pos_less_divide_eq[OF bcd] by (auto simp add:field_simps)
    31.1 --- a/src/HOL/Multivariate_Analysis/Determinants.thy	Fri Feb 05 14:33:31 2010 +0100
    31.2 +++ b/src/HOL/Multivariate_Analysis/Determinants.thy	Fri Feb 05 14:33:50 2010 +0100
    31.3 @@ -44,7 +44,7 @@
    31.4                               else setprod f {m..n})"
    31.5    by (auto simp add: atLeastAtMostSuc_conv)
    31.6  
    31.7 -lemma setprod_le: assumes fS: "finite S" and fg: "\<forall>x\<in>S. f x \<ge> 0 \<and> f x \<le> (g x :: 'a::ordered_idom)"
    31.8 +lemma setprod_le: assumes fS: "finite S" and fg: "\<forall>x\<in>S. f x \<ge> 0 \<and> f x \<le> (g x :: 'a::linordered_idom)"
    31.9    shows "setprod f S \<le> setprod g S"
   31.10  using fS fg
   31.11  apply(induct S)
   31.12 @@ -61,7 +61,7 @@
   31.13    apply simp
   31.14    done
   31.15  
   31.16 -lemma setprod_le_1: assumes fS: "finite S" and f: "\<forall>x\<in>S. f x \<ge> 0 \<and> f x \<le> (1::'a::ordered_idom)"
   31.17 +lemma setprod_le_1: assumes fS: "finite S" and f: "\<forall>x\<in>S. f x \<ge> 0 \<and> f x \<le> (1::'a::linordered_idom)"
   31.18    shows "setprod f S \<le> 1"
   31.19  using setprod_le[OF fS f] unfolding setprod_1 .
   31.20  
   31.21 @@ -277,7 +277,7 @@
   31.22  qed
   31.23  
   31.24  lemma det_identical_rows:
   31.25 -  fixes A :: "'a::ordered_idom^'n^'n"
   31.26 +  fixes A :: "'a::linordered_idom^'n^'n"
   31.27    assumes ij: "i \<noteq> j"
   31.28    and r: "row i A = row j A"
   31.29    shows "det A = 0"
   31.30 @@ -295,7 +295,7 @@
   31.31  qed
   31.32  
   31.33  lemma det_identical_columns:
   31.34 -  fixes A :: "'a::ordered_idom^'n^'n"
   31.35 +  fixes A :: "'a::linordered_idom^'n^'n"
   31.36    assumes ij: "i \<noteq> j"
   31.37    and r: "column i A = column j A"
   31.38    shows "det A = 0"
   31.39 @@ -407,7 +407,7 @@
   31.40    unfolding vector_smult_lzero .
   31.41  
   31.42  lemma det_row_operation:
   31.43 -  fixes A :: "'a::ordered_idom^'n^'n"
   31.44 +  fixes A :: "'a::linordered_idom^'n^'n"
   31.45    assumes ij: "i \<noteq> j"
   31.46    shows "det (\<chi> k. if k = i then row i A + c *s row j A else row k A) = det A"
   31.47  proof-
   31.48 @@ -421,7 +421,7 @@
   31.49  qed
   31.50  
   31.51  lemma det_row_span:
   31.52 -  fixes A :: "'a:: ordered_idom^'n^'n"
   31.53 +  fixes A :: "'a:: linordered_idom^'n^'n"
   31.54    assumes x: "x \<in> span {row j A |j. j \<noteq> i}"
   31.55    shows "det (\<chi> k. if k = i then row i A + x else row k A) = det A"
   31.56  proof-
   31.57 @@ -462,7 +462,7 @@
   31.58  (* ------------------------------------------------------------------------- *)
   31.59  
   31.60  lemma det_dependent_rows:
   31.61 -  fixes A:: "'a::ordered_idom^'n^'n"
   31.62 +  fixes A:: "'a::linordered_idom^'n^'n"
   31.63    assumes d: "dependent (rows A)"
   31.64    shows "det A = 0"
   31.65  proof-
   31.66 @@ -488,7 +488,7 @@
   31.67    ultimately show ?thesis by blast
   31.68  qed
   31.69  
   31.70 -lemma det_dependent_columns: assumes d: "dependent(columns (A::'a::ordered_idom^'n^'n))" shows "det A = 0"
   31.71 +lemma det_dependent_columns: assumes d: "dependent(columns (A::'a::linordered_idom^'n^'n))" shows "det A = 0"
   31.72  by (metis d det_dependent_rows rows_transp det_transp)
   31.73  
   31.74  (* ------------------------------------------------------------------------- *)
   31.75 @@ -608,7 +608,7 @@
   31.76  qed
   31.77  
   31.78  lemma det_mul:
   31.79 -  fixes A B :: "'a::ordered_idom^'n^'n"
   31.80 +  fixes A B :: "'a::linordered_idom^'n^'n"
   31.81    shows "det (A ** B) = det A * det B"
   31.82  proof-
   31.83    let ?U = "UNIV :: 'n set"
   31.84 @@ -761,7 +761,7 @@
   31.85  (* ------------------------------------------------------------------------- *)
   31.86  
   31.87  lemma cramer_lemma_transp:
   31.88 -  fixes A:: "'a::ordered_idom^'n^'n" and x :: "'a ^'n"
   31.89 +  fixes A:: "'a::linordered_idom^'n^'n" and x :: "'a ^'n"
   31.90    shows "det ((\<chi> i. if i = k then setsum (\<lambda>i. x$i *s row i A) (UNIV::'n set)
   31.91                             else row i A)::'a^'n^'n) = x$k * det A"
   31.92    (is "?lhs = ?rhs")
   31.93 @@ -797,7 +797,7 @@
   31.94  qed
   31.95  
   31.96  lemma cramer_lemma:
   31.97 -  fixes A :: "'a::ordered_idom ^'n^'n"
   31.98 +  fixes A :: "'a::linordered_idom ^'n^'n"
   31.99    shows "det((\<chi> i j. if j = k then (A *v x)$i else A$i$j):: 'a^'n^'n) = x$k * det A"
  31.100  proof-
  31.101    let ?U = "UNIV :: 'n set"
  31.102 @@ -893,7 +893,7 @@
  31.103  qed
  31.104  
  31.105  lemma det_orthogonal_matrix:
  31.106 -  fixes Q:: "'a::ordered_idom^'n^'n"
  31.107 +  fixes Q:: "'a::linordered_idom^'n^'n"
  31.108    assumes oQ: "orthogonal_matrix Q"
  31.109    shows "det Q = 1 \<or> det Q = - 1"
  31.110  proof-
  31.111 @@ -1034,7 +1034,7 @@
  31.112  definition "rotoinversion_matrix Q \<longleftrightarrow> orthogonal_matrix Q \<and> det Q = - 1"
  31.113  
  31.114  lemma orthogonal_rotation_or_rotoinversion:
  31.115 -  fixes Q :: "'a::ordered_idom^'n^'n"
  31.116 +  fixes Q :: "'a::linordered_idom^'n^'n"
  31.117    shows " orthogonal_matrix Q \<longleftrightarrow> rotation_matrix Q \<or> rotoinversion_matrix Q"
  31.118    by (metis rotoinversion_matrix_def rotation_matrix_def det_orthogonal_matrix)
  31.119  (* ------------------------------------------------------------------------- *)
    32.1 --- a/src/HOL/Multivariate_Analysis/Euclidean_Space.thy	Fri Feb 05 14:33:31 2010 +0100
    32.2 +++ b/src/HOL/Multivariate_Analysis/Euclidean_Space.thy	Fri Feb 05 14:33:50 2010 +0100
    32.3 @@ -459,7 +459,7 @@
    32.4    done
    32.5  
    32.6  lemma setsum_nonneg_eq_0_iff:
    32.7 -  fixes f :: "'a \<Rightarrow> 'b::pordered_ab_group_add"
    32.8 +  fixes f :: "'a \<Rightarrow> 'b::ordered_ab_group_add"
    32.9    shows "\<lbrakk>finite A; \<forall>x\<in>A. 0 \<le> f x\<rbrakk> \<Longrightarrow> setsum f A = 0 \<longleftrightarrow> (\<forall>x\<in>A. f x = 0)"
   32.10    apply (induct set: finite, simp)
   32.11    apply (simp add: add_nonneg_eq_0_iff setsum_nonneg)
   32.12 @@ -836,10 +836,10 @@
   32.13  lemma dot_rneg: "(x::'a::ring ^ 'n) \<bullet> (-y) = -(x \<bullet> y)" by vector
   32.14  lemma dot_lzero[simp]: "0 \<bullet> x = (0::'a::{comm_monoid_add, mult_zero})" by vector
   32.15  lemma dot_rzero[simp]: "x \<bullet> 0 = (0::'a::{comm_monoid_add, mult_zero})" by vector
   32.16 -lemma dot_pos_le[simp]: "(0::'a\<Colon>ordered_ring_strict) <= x \<bullet> x"
   32.17 +lemma dot_pos_le[simp]: "(0::'a\<Colon>linlinordered_ring_strict) <= x \<bullet> x"
   32.18    by (simp add: dot_def setsum_nonneg)
   32.19  
   32.20 -lemma setsum_squares_eq_0_iff: assumes fS: "finite F" and fp: "\<forall>x \<in> F. f x \<ge> (0 ::'a::pordered_ab_group_add)" shows "setsum f F = 0 \<longleftrightarrow> (ALL x:F. f x = 0)"
   32.21 +lemma setsum_squares_eq_0_iff: assumes fS: "finite F" and fp: "\<forall>x \<in> F. f x \<ge> (0 ::'a::ordered_ab_group_add)" shows "setsum f F = 0 \<longleftrightarrow> (ALL x:F. f x = 0)"
   32.22  using fS fp setsum_nonneg[OF fp]
   32.23  proof (induct set: finite)
   32.24    case empty thus ?case by simp
   32.25 @@ -852,10 +852,10 @@
   32.26    show ?case by (simp add: h)
   32.27  qed
   32.28  
   32.29 -lemma dot_eq_0: "x \<bullet> x = 0 \<longleftrightarrow> (x::'a::{ordered_ring_strict,ring_no_zero_divisors} ^ 'n) = 0"
   32.30 +lemma dot_eq_0: "x \<bullet> x = 0 \<longleftrightarrow> (x::'a::{linlinordered_ring_strict,ring_no_zero_divisors} ^ 'n) = 0"
   32.31    by (simp add: dot_def setsum_squares_eq_0_iff Cart_eq)
   32.32  
   32.33 -lemma dot_pos_lt[simp]: "(0 < x \<bullet> x) \<longleftrightarrow> (x::'a::{ordered_ring_strict,ring_no_zero_divisors} ^ 'n) \<noteq> 0" using dot_eq_0[of x] dot_pos_le[of x]
   32.34 +lemma dot_pos_lt[simp]: "(0 < x \<bullet> x) \<longleftrightarrow> (x::'a::{linlinordered_ring_strict,ring_no_zero_divisors} ^ 'n) \<noteq> 0" using dot_eq_0[of x] dot_pos_le[of x]
   32.35    by (auto simp add: le_less)
   32.36  
   32.37  subsection{* The collapse of the general concepts to dimension one. *}
   32.38 @@ -1146,7 +1146,7 @@
   32.39    shows "norm x1 \<le> b1 \<Longrightarrow> norm x2 \<le> b2 \<Longrightarrow> norm (x1 + x2) \<le> b1 + b2"
   32.40    by (rule order_trans [OF norm_triangle_ineq add_mono])
   32.41  
   32.42 -lemma ge_iff_diff_ge_0: "(a::'a::ordered_ring) \<ge> b == a - b \<ge> 0"
   32.43 +lemma ge_iff_diff_ge_0: "(a::'a::linordered_ring) \<ge> b == a - b \<ge> 0"
   32.44    by (simp add: ring_simps)
   32.45  
   32.46  lemma pth_1:
   32.47 @@ -3827,7 +3827,7 @@
   32.48      (* FIXME : Move to some general theory ?*)
   32.49  definition "pairwise R S \<longleftrightarrow> (\<forall>x \<in> S. \<forall>y\<in> S. x\<noteq>y \<longrightarrow> R x y)"
   32.50  
   32.51 -lemma vector_sub_project_orthogonal: "(b::'a::ordered_field^'n) \<bullet> (x - ((b \<bullet> x) / (b\<bullet>b)) *s b) = 0"
   32.52 +lemma vector_sub_project_orthogonal: "(b::'a::linordered_field^'n) \<bullet> (x - ((b \<bullet> x) / (b\<bullet>b)) *s b) = 0"
   32.53    apply (cases "b = 0", simp)
   32.54    apply (simp add: dot_rsub dot_rmult)
   32.55    unfolding times_divide_eq_right[symmetric]
    33.1 --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy	Fri Feb 05 14:33:31 2010 +0100
    33.2 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy	Fri Feb 05 14:33:50 2010 +0100
    33.3 @@ -5696,27 +5696,27 @@
    33.4  by (simp add: vector_smult_lneg[symmetric] vector_smult_assoc vector_sneg_minus1[symmetric])
    33.5  
    33.6  lemma real_affinity_le:
    33.7 - "0 < (m::'a::ordered_field) ==> (m * x + c \<le> y \<longleftrightarrow> x \<le> inverse(m) * y + -(c / m))"
    33.8 + "0 < (m::'a::linordered_field) ==> (m * x + c \<le> y \<longleftrightarrow> x \<le> inverse(m) * y + -(c / m))"
    33.9    by (simp add: field_simps inverse_eq_divide)
   33.10  
   33.11  lemma real_le_affinity:
   33.12 - "0 < (m::'a::ordered_field) ==> (y \<le> m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) \<le> x)"
   33.13 + "0 < (m::'a::linordered_field) ==> (y \<le> m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) \<le> x)"
   33.14    by (simp add: field_simps inverse_eq_divide)
   33.15  
   33.16  lemma real_affinity_lt:
   33.17 - "0 < (m::'a::ordered_field) ==> (m * x + c < y \<longleftrightarrow> x < inverse(m) * y + -(c / m))"
   33.18 + "0 < (m::'a::linordered_field) ==> (m * x + c < y \<longleftrightarrow> x < inverse(m) * y + -(c / m))"
   33.19    by (simp add: field_simps inverse_eq_divide)
   33.20  
   33.21  lemma real_lt_affinity:
   33.22 - "0 < (m::'a::ordered_field) ==> (y < m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) < x)"
   33.23 + "0 < (m::'a::linordered_field) ==> (y < m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) < x)"
   33.24    by (simp add: field_simps inverse_eq_divide)
   33.25  
   33.26  lemma real_affinity_eq:
   33.27 - "(m::'a::ordered_field) \<noteq> 0 ==> (m * x + c = y \<longleftrightarrow> x = inverse(m) * y + -(c / m))"
   33.28 + "(m::'a::linordered_field) \<noteq> 0 ==> (m * x + c = y \<longleftrightarrow> x = inverse(m) * y + -(c / m))"
   33.29    by (simp add: field_simps inverse_eq_divide)
   33.30  
   33.31  lemma real_eq_affinity:
   33.32 - "(m::'a::ordered_field) \<noteq> 0 ==> (y = m * x + c  \<longleftrightarrow> inverse(m) * y + -(c / m) = x)"
   33.33 + "(m::'a::linordered_field) \<noteq> 0 ==> (y = m * x + c  \<longleftrightarrow> inverse(m) * y + -(c / m) = x)"
   33.34    by (simp add: field_simps inverse_eq_divide)
   33.35  
   33.36  lemma vector_affinity_eq:
    34.1 --- a/src/HOL/NSA/HyperDef.thy	Fri Feb 05 14:33:31 2010 +0100
    34.2 +++ b/src/HOL/NSA/HyperDef.thy	Fri Feb 05 14:33:50 2010 +0100
    34.3 @@ -459,7 +459,7 @@
    34.4  by transfer (rule power_inverse)
    34.5    
    34.6  lemma hyperpow_hrabs:
    34.7 -  "\<And>r n. abs (r::'a::{ordered_idom} star) pow n = abs (r pow n)"
    34.8 +  "\<And>r n. abs (r::'a::{linordered_idom} star) pow n = abs (r pow n)"
    34.9  by transfer (rule power_abs [symmetric])
   34.10  
   34.11  lemma hyperpow_add:
   34.12 @@ -475,15 +475,15 @@
   34.13  by transfer simp
   34.14  
   34.15  lemma hyperpow_gt_zero:
   34.16 -  "\<And>r n. (0::'a::{ordered_semidom} star) < r \<Longrightarrow> 0 < r pow n"
   34.17 +  "\<And>r n. (0::'a::{linordered_semidom} star) < r \<Longrightarrow> 0 < r pow n"
   34.18  by transfer (rule zero_less_power)
   34.19  
   34.20  lemma hyperpow_ge_zero:
   34.21 -  "\<And>r n. (0::'a::{ordered_semidom} star) \<le> r \<Longrightarrow> 0 \<le> r pow n"
   34.22 +  "\<And>r n. (0::'a::{linordered_semidom} star) \<le> r \<Longrightarrow> 0 \<le> r pow n"
   34.23  by transfer (rule zero_le_power)
   34.24  
   34.25  lemma hyperpow_le:
   34.26 -  "\<And>x y n. \<lbrakk>(0::'a::{ordered_semidom} star) < x; x \<le> y\<rbrakk>
   34.27 +  "\<And>x y n. \<lbrakk>(0::'a::{linordered_semidom} star) < x; x \<le> y\<rbrakk>
   34.28     \<Longrightarrow> x pow n \<le> y pow n"
   34.29  by transfer (rule power_mono [OF _ order_less_imp_le])
   34.30  
   34.31 @@ -492,7 +492,7 @@
   34.32  by transfer (rule power_one)
   34.33  
   34.34  lemma hrabs_hyperpow_minus_one [simp]:
   34.35 -  "\<And>n. abs(-1 pow n) = (1::'a::{number_ring,ordered_idom} star)"
   34.36 +  "\<And>n. abs(-1 pow n) = (1::'a::{number_ring,linordered_idom} star)"
   34.37  by transfer (rule abs_power_minus_one)
   34.38  
   34.39  lemma hyperpow_mult:
   34.40 @@ -501,16 +501,16 @@
   34.41  by transfer (rule power_mult_distrib)
   34.42  
   34.43  lemma hyperpow_two_le [simp]:
   34.44 -  "(0::'a::{monoid_mult,ordered_ring_strict} star) \<le> r pow (1 + 1)"
   34.45 +  "(0::'a::{monoid_mult,linlinordered_ring_strict} star) \<le> r pow (1 + 1)"
   34.46  by (auto simp add: hyperpow_two zero_le_mult_iff)
   34.47  
   34.48  lemma hrabs_hyperpow_two [simp]:
   34.49    "abs(x pow (1 + 1)) =
   34.50 -   (x::'a::{monoid_mult,ordered_ring_strict} star) pow (1 + 1)"
   34.51 +   (x::'a::{monoid_mult,linlinordered_ring_strict} star) pow (1 + 1)"
   34.52  by (simp only: abs_of_nonneg hyperpow_two_le)
   34.53  
   34.54  lemma hyperpow_two_hrabs [simp]:
   34.55 -  "abs(x::'a::{ordered_idom} star) pow (1 + 1)  = x pow (1 + 1)"
   34.56 +  "abs(x::'a::{linordered_idom} star) pow (1 + 1)  = x pow (1 + 1)"
   34.57  by (simp add: hyperpow_hrabs)
   34.58  
   34.59  text{*The precondition could be weakened to @{term "0\<le>x"}*}
   34.60 @@ -519,11 +519,11 @@
   34.61   by (simp add: Ring_and_Field.mult_strict_mono order_less_imp_le)
   34.62  
   34.63  lemma hyperpow_two_gt_one:
   34.64 -  "\<And>r::'a::{ordered_semidom} star. 1 < r \<Longrightarrow> 1 < r pow (1 + 1)"
   34.65 +  "\<And>r::'a::{linordered_semidom} star. 1 < r \<Longrightarrow> 1 < r pow (1 + 1)"
   34.66  by transfer (simp add: power_gt1 del: power_Suc)
   34.67  
   34.68  lemma hyperpow_two_ge_one:
   34.69 -  "\<And>r::'a::{ordered_semidom} star. 1 \<le> r \<Longrightarrow> 1 \<le> r pow (1 + 1)"
   34.70 +  "\<And>r::'a::{linordered_semidom} star. 1 \<le> r \<Longrightarrow> 1 \<le> r pow (1 + 1)"
   34.71  by transfer (simp add: one_le_power del: power_Suc)
   34.72  
   34.73  lemma two_hyperpow_ge_one [simp]: "(1::hypreal) \<le> 2 pow n"
    35.1 --- a/src/HOL/NSA/HyperNat.thy	Fri Feb 05 14:33:31 2010 +0100
    35.2 +++ b/src/HOL/NSA/HyperNat.thy	Fri Feb 05 14:33:50 2010 +0100
    35.3 @@ -386,39 +386,39 @@
    35.4  by transfer (rule of_nat_mult)
    35.5  
    35.6  lemma of_hypnat_less_iff [simp]:
    35.7 -  "\<And>m n. (of_hypnat m < (of_hypnat n::'a::ordered_semidom star)) = (m < n)"
    35.8 +  "\<And>m n. (of_hypnat m < (of_hypnat n::'a::linordered_semidom star)) = (m < n)"
    35.9  by transfer (rule of_nat_less_iff)
   35.10  
   35.11  lemma of_hypnat_0_less_iff [simp]:
   35.12 -  "\<And>n. (0 < (of_hypnat n::'a::ordered_semidom star)) = (0 < n)"
   35.13 +  "\<And>n. (0 < (of_hypnat n::'a::linordered_semidom star)) = (0 < n)"
   35.14  by transfer (rule of_nat_0_less_iff)
   35.15  
   35.16  lemma of_hypnat_less_0_iff [simp]:
   35.17 -  "\<And>m. \<not> (of_hypnat m::'a::ordered_semidom star) < 0"
   35.18 +  "\<And>m. \<not> (of_hypnat m::'a::linordered_semidom star) < 0"
   35.19  by transfer (rule of_nat_less_0_iff)
   35.20  
   35.21  lemma of_hypnat_le_iff [simp]:
   35.22 -  "\<And>m n. (of_hypnat m \<le> (of_hypnat n::'a::ordered_semidom star)) = (m \<le> n)"
   35.23 +  "\<And>m n. (of_hypnat m \<le> (of_hypnat n::'a::linordered_semidom star)) = (m \<le> n)"
   35.24  by transfer (rule of_nat_le_iff)
   35.25  
   35.26  lemma of_hypnat_0_le_iff [simp]:
   35.27 -  "\<And>n. 0 \<le> (of_hypnat n::'a::ordered_semidom star)"
   35.28 +  "\<And>n. 0 \<le> (of_hypnat n::'a::linordered_semidom star)"
   35.29  by transfer (rule of_nat_0_le_iff)
   35.30  
   35.31  lemma of_hypnat_le_0_iff [simp]:
   35.32 -  "\<And>m. ((of_hypnat m::'a::ordered_semidom star) \<le> 0) = (m = 0)"
   35.33 +  "\<And>m. ((of_hypnat m::'a::linordered_semidom star) \<le> 0) = (m = 0)"
   35.34  by transfer (rule of_nat_le_0_iff)
   35.35  
   35.36  lemma of_hypnat_eq_iff [simp]:
   35.37 -  "\<And>m n. (of_hypnat m = (of_hypnat n::'a::ordered_semidom star)) = (m = n)"
   35.38 +  "\<And>m n. (of_hypnat m = (of_hypnat n::'a::linordered_semidom star)) = (m = n)"
   35.39  by transfer (rule of_nat_eq_iff)
   35.40  
   35.41  lemma of_hypnat_eq_0_iff [simp]:
   35.42 -  "\<And>m. ((of_hypnat m::'a::ordered_semidom star) = 0) = (m = 0)"
   35.43 +  "\<And>m. ((of_hypnat m::'a::linordered_semidom star) = 0) = (m = 0)"
   35.44  by transfer (rule of_nat_eq_0_iff)
   35.45  
   35.46  lemma HNatInfinite_of_hypnat_gt_zero:
   35.47 -  "N \<in> HNatInfinite \<Longrightarrow> (0::'a::ordered_semidom star) < of_hypnat N"
   35.48 +  "N \<in> HNatInfinite \<Longrightarrow> (0::'a::linordered_semidom star) < of_hypnat N"
   35.49  by (rule ccontr, simp add: linorder_not_less)
   35.50  
   35.51  end
    36.1 --- a/src/HOL/NSA/StarDef.thy	Fri Feb 05 14:33:31 2010 +0100
    36.2 +++ b/src/HOL/NSA/StarDef.thy	Fri Feb 05 14:33:50 2010 +0100
    36.3 @@ -719,7 +719,7 @@
    36.4  apply (transfer, erule (1) order_antisym)
    36.5  done
    36.6  
    36.7 -instantiation star :: (lower_semilattice) lower_semilattice
    36.8 +instantiation star :: (semilattice_inf) semilattice_inf
    36.9  begin
   36.10  
   36.11  definition
   36.12 @@ -730,7 +730,7 @@
   36.13  
   36.14  end
   36.15  
   36.16 -instantiation star :: (upper_semilattice) upper_semilattice
   36.17 +instantiation star :: (semilattice_sup) semilattice_sup
   36.18  begin
   36.19  
   36.20  definition
   36.21 @@ -833,27 +833,27 @@
   36.22  apply (transfer, rule diff_minus)
   36.23  done
   36.24  
   36.25 -instance star :: (pordered_ab_semigroup_add) pordered_ab_semigroup_add
   36.26 +instance star :: (ordered_ab_semigroup_add) ordered_ab_semigroup_add
   36.27  by (intro_classes, transfer, rule add_left_mono)
   36.28  
   36.29 -instance star :: (pordered_cancel_ab_semigroup_add) pordered_cancel_ab_semigroup_add ..
   36.30 +instance star :: (ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add ..
   36.31  
   36.32 -instance star :: (pordered_ab_semigroup_add_imp_le) pordered_ab_semigroup_add_imp_le
   36.33 +instance star :: (ordered_ab_semigroup_add_imp_le) ordered_ab_semigroup_add_imp_le
   36.34  by (intro_classes, transfer, rule add_le_imp_le_left)
   36.35  
   36.36 -instance star :: (pordered_comm_monoid_add) pordered_comm_monoid_add ..
   36.37 -instance star :: (pordered_ab_group_add) pordered_ab_group_add ..
   36.38 +instance star :: (ordered_comm_monoid_add) ordered_comm_monoid_add ..
   36.39 +instance star :: (ordered_ab_group_add) ordered_ab_group_add ..
   36.40  
   36.41 -instance star :: (pordered_ab_group_add_abs) pordered_ab_group_add_abs 
   36.42 +instance star :: (ordered_ab_group_add_abs) ordered_ab_group_add_abs 
   36.43    by intro_classes (transfer,
   36.44      simp add: abs_ge_self abs_leI abs_triangle_ineq)+
   36.45  
   36.46 -instance star :: (ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add ..
   36.47 -instance star :: (lordered_ab_group_add_meet) lordered_ab_group_add_meet ..
   36.48 -instance star :: (lordered_ab_group_add_meet) lordered_ab_group_add_meet ..
   36.49 -instance star :: (lordered_ab_group_add) lordered_ab_group_add ..
   36.50 +instance star :: (linordered_cancel_ab_semigroup_add) linordered_cancel_ab_semigroup_add ..
   36.51 +instance star :: (semilattice_inf_ab_group_add) semilattice_inf_ab_group_add ..
   36.52 +instance star :: (semilattice_inf_ab_group_add) semilattice_inf_ab_group_add ..
   36.53 +instance star :: (lattice_ab_group_add) lattice_ab_group_add ..
   36.54  
   36.55 -instance star :: (lordered_ab_group_add_abs) lordered_ab_group_add_abs
   36.56 +instance star :: (lattice_ab_group_add_abs) lattice_ab_group_add_abs
   36.57  by (intro_classes, transfer, rule abs_lattice)
   36.58  
   36.59  subsection {* Ring and field classes *}
   36.60 @@ -909,32 +909,32 @@
   36.61  instance star :: (division_by_zero) division_by_zero
   36.62  by (intro_classes, transfer, rule inverse_zero)
   36.63  
   36.64 -instance star :: (pordered_semiring) pordered_semiring
   36.65 +instance star :: (ordered_semiring) ordered_semiring
   36.66  apply (intro_classes)
   36.67  apply (transfer, erule (1) mult_left_mono)
   36.68  apply (transfer, erule (1) mult_right_mono)
   36.69  done
   36.70  
   36.71 -instance star :: (pordered_cancel_semiring) pordered_cancel_semiring ..
   36.72 +instance star :: (ordered_cancel_semiring) ordered_cancel_semiring ..
   36.73  
   36.74 -instance star :: (ordered_semiring_strict) ordered_semiring_strict
   36.75 +instance star :: (linlinordered_semiring_strict) linlinordered_semiring_strict
   36.76  apply (intro_classes)
   36.77  apply (transfer, erule (1) mult_strict_left_mono)
   36.78  apply (transfer, erule (1) mult_strict_right_mono)
   36.79  done
   36.80  
   36.81 -instance star :: (pordered_comm_semiring) pordered_comm_semiring
   36.82 +instance star :: (ordered_comm_semiring) ordered_comm_semiring
   36.83  by (intro_classes, transfer, rule mult_mono1_class.mult_mono1)
   36.84  
   36.85 -instance star :: (pordered_cancel_comm_semiring) pordered_cancel_comm_semiring ..
   36.86 +instance star :: (ordered_cancel_comm_semiring) ordered_cancel_comm_semiring ..
   36.87  
   36.88 -instance star :: (ordered_comm_semiring_strict) ordered_comm_semiring_strict
   36.89 -by (intro_classes, transfer, rule ordered_comm_semiring_strict_class.mult_strict_left_mono_comm)
   36.90 +instance star :: (linordered_comm_semiring_strict) linordered_comm_semiring_strict
   36.91 +by (intro_classes, transfer, rule mult_strict_left_mono_comm)
   36.92  
   36.93 -instance star :: (pordered_ring) pordered_ring ..
   36.94 -instance star :: (pordered_ring_abs) pordered_ring_abs
   36.95 +instance star :: (ordered_ring) ordered_ring ..
   36.96 +instance star :: (ordered_ring_abs) ordered_ring_abs
   36.97    by intro_classes  (transfer, rule abs_eq_mult)
   36.98 -instance star :: (lordered_ring) lordered_ring ..
   36.99 +instance star :: (lattice_ring) lattice_ring ..
  36.100  
  36.101  instance star :: (abs_if) abs_if
  36.102  by (intro_classes, transfer, rule abs_if)
  36.103 @@ -942,14 +942,14 @@
  36.104  instance star :: (sgn_if) sgn_if
  36.105  by (intro_classes, transfer, rule sgn_if)
  36.106  
  36.107 -instance star :: (ordered_ring_strict) ordered_ring_strict ..
  36.108 -instance star :: (pordered_comm_ring) pordered_comm_ring ..
  36.109 +instance star :: (linlinordered_ring_strict) linlinordered_ring_strict ..
  36.110 +instance star :: (ordered_comm_ring) ordered_comm_ring ..
  36.111  
  36.112 -instance star :: (ordered_semidom) ordered_semidom
  36.113 +instance star :: (linordered_semidom) linordered_semidom
  36.114  by (intro_classes, transfer, rule zero_less_one)
  36.115  
  36.116 -instance star :: (ordered_idom) ordered_idom ..
  36.117 -instance star :: (ordered_field) ordered_field ..
  36.118 +instance star :: (linordered_idom) linordered_idom ..
  36.119 +instance star :: (linordered_field) linordered_field ..
  36.120  
  36.121  
  36.122  subsection {* Power *}
    37.1 --- a/src/HOL/Nat.thy	Fri Feb 05 14:33:31 2010 +0100
    37.2 +++ b/src/HOL/Nat.thy	Fri Feb 05 14:33:50 2010 +0100
    37.3 @@ -741,7 +741,7 @@
    37.4  done
    37.5  
    37.6  text{*The naturals form an ordered @{text comm_semiring_1_cancel}*}
    37.7 -instance nat :: ordered_semidom
    37.8 +instance nat :: linordered_semidom
    37.9  proof
   37.10    fix i j k :: nat
   37.11    show "0 < (1::nat)" by simp
   37.12 @@ -1289,7 +1289,7 @@
   37.13  
   37.14  end
   37.15  
   37.16 -context ordered_semidom
   37.17 +context linordered_semidom
   37.18  begin
   37.19  
   37.20  lemma zero_le_imp_of_nat: "0 \<le> of_nat m"
   37.21 @@ -1316,7 +1316,7 @@
   37.22  lemma of_nat_le_iff [simp]: "of_nat m \<le> of_nat n \<longleftrightarrow> m \<le> n"
   37.23    by (simp add: not_less [symmetric] linorder_not_less [symmetric])
   37.24  
   37.25 -text{*Every @{text ordered_semidom} has characteristic zero.*}
   37.26 +text{*Every @{text linordered_semidom} has characteristic zero.*}
   37.27  
   37.28  subclass semiring_char_0
   37.29    proof qed (simp add: eq_iff order_eq_iff)
   37.30 @@ -1345,7 +1345,7 @@
   37.31  
   37.32  end
   37.33  
   37.34 -context ordered_idom
   37.35 +context linordered_idom
   37.36  begin
   37.37  
   37.38  lemma abs_of_nat [simp]: "\<bar>of_nat n\<bar> = of_nat n"
    38.1 --- a/src/HOL/Nat_Numeral.thy	Fri Feb 05 14:33:31 2010 +0100
    38.2 +++ b/src/HOL/Nat_Numeral.thy	Fri Feb 05 14:33:50 2010 +0100
    38.3 @@ -113,7 +113,7 @@
    38.4  
    38.5  end
    38.6  
    38.7 -context ordered_ring_strict
    38.8 +context linlinordered_ring_strict
    38.9  begin
   38.10  
   38.11  lemma sum_squares_ge_zero:
   38.12 @@ -145,7 +145,7 @@
   38.13  
   38.14  end
   38.15  
   38.16 -context ordered_semidom
   38.17 +context linordered_semidom
   38.18  begin
   38.19  
   38.20  lemma power2_le_imp_le:
   38.21 @@ -162,7 +162,7 @@
   38.22  
   38.23  end
   38.24  
   38.25 -context ordered_idom
   38.26 +context linordered_idom
   38.27  begin
   38.28  
   38.29  lemma zero_eq_power2 [simp]:
    39.1 --- a/src/HOL/Nitpick.thy	Fri Feb 05 14:33:31 2010 +0100
    39.2 +++ b/src/HOL/Nitpick.thy	Fri Feb 05 14:33:50 2010 +0100
    39.3 @@ -224,13 +224,13 @@
    39.4     "Nitpick_Nut" so that they handle the unexpanded overloaded constants
    39.5     directly, but this is slightly more tricky to implement. *)
    39.6  lemmas [nitpick_def] = div_int_inst.div_int div_int_inst.mod_int
    39.7 -    div_nat_inst.div_nat div_nat_inst.mod_nat lower_semilattice_fun_inst.inf_fun
    39.8 +    div_nat_inst.div_nat div_nat_inst.mod_nat semilattice_inf_fun_inst.inf_fun
    39.9      minus_fun_inst.minus_fun minus_int_inst.minus_int minus_nat_inst.minus_nat
   39.10      one_int_inst.one_int one_nat_inst.one_nat ord_fun_inst.less_eq_fun
   39.11      ord_int_inst.less_eq_int ord_int_inst.less_int ord_nat_inst.less_eq_nat
   39.12      ord_nat_inst.less_nat plus_int_inst.plus_int plus_nat_inst.plus_nat
   39.13      times_int_inst.times_int times_nat_inst.times_nat uminus_int_inst.uminus_int
   39.14 -    upper_semilattice_fun_inst.sup_fun zero_int_inst.zero_int
   39.15 +    semilattice_sup_fun_inst.sup_fun zero_int_inst.zero_int
   39.16      zero_nat_inst.zero_nat
   39.17  
   39.18  use "Tools/Nitpick/kodkod.ML"
    40.1 --- a/src/HOL/OrderedGroup.thy	Fri Feb 05 14:33:31 2010 +0100
    40.2 +++ b/src/HOL/OrderedGroup.thy	Fri Feb 05 14:33:50 2010 +0100
    40.3 @@ -353,7 +353,7 @@
    40.4  
    40.5  subsection {* (Partially) Ordered Groups *} 
    40.6  
    40.7 -class pordered_ab_semigroup_add = order + ab_semigroup_add +
    40.8 +class ordered_ab_semigroup_add = order + ab_semigroup_add +
    40.9    assumes add_left_mono: "a \<le> b \<Longrightarrow> c + a \<le> c + b"
   40.10  begin
   40.11  
   40.12 @@ -370,8 +370,8 @@
   40.13  
   40.14  end
   40.15  
   40.16 -class pordered_cancel_ab_semigroup_add =
   40.17 -  pordered_ab_semigroup_add + cancel_ab_semigroup_add
   40.18 +class ordered_cancel_ab_semigroup_add =
   40.19 +  ordered_ab_semigroup_add + cancel_ab_semigroup_add
   40.20  begin
   40.21  
   40.22  lemma add_strict_left_mono:
   40.23 @@ -403,8 +403,8 @@
   40.24  
   40.25  end
   40.26  
   40.27 -class pordered_ab_semigroup_add_imp_le =
   40.28 -  pordered_cancel_ab_semigroup_add +
   40.29 +class ordered_ab_semigroup_add_imp_le =
   40.30 +  ordered_cancel_ab_semigroup_add +
   40.31    assumes add_le_imp_le_left: "c + a \<le> c + b \<Longrightarrow> a \<le> b"
   40.32  begin
   40.33  
   40.34 @@ -464,8 +464,8 @@
   40.35  
   40.36  subsection {* Support for reasoning about signs *}
   40.37  
   40.38 -class pordered_comm_monoid_add =
   40.39 -  pordered_cancel_ab_semigroup_add + comm_monoid_add
   40.40 +class ordered_comm_monoid_add =
   40.41 +  ordered_cancel_ab_semigroup_add + comm_monoid_add
   40.42  begin
   40.43  
   40.44  lemma add_pos_nonneg:
   40.45 @@ -550,13 +550,13 @@
   40.46  
   40.47  end
   40.48  
   40.49 -class pordered_ab_group_add =
   40.50 -  ab_group_add + pordered_ab_semigroup_add
   40.51 +class ordered_ab_group_add =
   40.52 +  ab_group_add + ordered_ab_semigroup_add
   40.53  begin
   40.54  
   40.55 -subclass pordered_cancel_ab_semigroup_add ..
   40.56 +subclass ordered_cancel_ab_semigroup_add ..
   40.57  
   40.58 -subclass pordered_ab_semigroup_add_imp_le
   40.59 +subclass ordered_ab_semigroup_add_imp_le
   40.60  proof
   40.61    fix a b c :: 'a
   40.62    assume "c + a \<le> c + b"
   40.63 @@ -565,7 +565,7 @@
   40.64    thus "a \<le> b" by simp
   40.65  qed
   40.66  
   40.67 -subclass pordered_comm_monoid_add ..
   40.68 +subclass ordered_comm_monoid_add ..
   40.69  
   40.70  lemma max_diff_distrib_left:
   40.71    shows "max x y - z = max (x - z) (y - z)"
   40.72 @@ -675,16 +675,16 @@
   40.73  text{*Legacy - use @{text algebra_simps} *}
   40.74  lemmas group_simps[noatp] = algebra_simps
   40.75  
   40.76 -class ordered_ab_semigroup_add =
   40.77 -  linorder + pordered_ab_semigroup_add
   40.78 +class linordered_ab_semigroup_add =
   40.79 +  linorder + ordered_ab_semigroup_add
   40.80  
   40.81 -class ordered_cancel_ab_semigroup_add =
   40.82 -  linorder + pordered_cancel_ab_semigroup_add
   40.83 +class linordered_cancel_ab_semigroup_add =
   40.84 +  linorder + ordered_cancel_ab_semigroup_add
   40.85  begin
   40.86  
   40.87 -subclass ordered_ab_semigroup_add ..
   40.88 +subclass linordered_ab_semigroup_add ..
   40.89  
   40.90 -subclass pordered_ab_semigroup_add_imp_le
   40.91 +subclass ordered_ab_semigroup_add_imp_le
   40.92  proof
   40.93    fix a b c :: 'a
   40.94    assume le: "c + a <= c + b"  
   40.95 @@ -705,11 +705,10 @@
   40.96  
   40.97  end
   40.98  
   40.99 -class ordered_ab_group_add =
  40.100 -  linorder + pordered_ab_group_add
  40.101 +class linordered_ab_group_add = linorder + ordered_ab_group_add
  40.102  begin
  40.103  
  40.104 -subclass ordered_cancel_ab_semigroup_add ..
  40.105 +subclass linordered_cancel_ab_semigroup_add ..
  40.106  
  40.107  lemma neg_less_eq_nonneg:
  40.108    "- a \<le> a \<longleftrightarrow> 0 \<le> a"
  40.109 @@ -775,27 +774,27 @@
  40.110  -- {* FIXME localize the following *}
  40.111  
  40.112  lemma add_increasing:
  40.113 -  fixes c :: "'a::{pordered_ab_semigroup_add_imp_le, comm_monoid_add}"
  40.114 +  fixes c :: "'a::{ordered_ab_semigroup_add_imp_le, comm_monoid_add}"
  40.115    shows  "[|0\<le>a; b\<le>c|] ==> b \<le> a + c"
  40.116  by (insert add_mono [of 0 a b c], simp)
  40.117  
  40.118  lemma add_increasing2:
  40.119 -  fixes c :: "'a::{pordered_ab_semigroup_add_imp_le, comm_monoid_add}"
  40.120 +  fixes c :: "'a::{ordered_ab_semigroup_add_imp_le, comm_monoid_add}"
  40.121    shows  "[|0\<le>c; b\<le>a|] ==> b \<le> a + c"
  40.122  by (simp add:add_increasing add_commute[of a])
  40.123  
  40.124  lemma add_strict_increasing:
  40.125 -  fixes c :: "'a::{pordered_ab_semigroup_add_imp_le, comm_monoid_add}"
  40.126 +  fixes c :: "'a::{ordered_ab_semigroup_add_imp_le, comm_monoid_add}"
  40.127    shows "[|0<a; b\<le>c|] ==> b < a + c"
  40.128  by (insert add_less_le_mono [of 0 a b c], simp)
  40.129  
  40.130  lemma add_strict_increasing2:
  40.131 -  fixes c :: "'a::{pordered_ab_semigroup_add_imp_le, comm_monoid_add}"
  40.132 +  fixes c :: "'a::{ordered_ab_semigroup_add_imp_le, comm_monoid_add}"
  40.133    shows "[|0\<le>a; b<c|] ==> b < a + c"
  40.134  by (insert add_le_less_mono [of 0 a b c], simp)
  40.135  
  40.136  
  40.137 -class pordered_ab_group_add_abs = pordered_ab_group_add + abs +
  40.138 +class ordered_ab_group_add_abs = ordered_ab_group_add + abs +
  40.139    assumes abs_ge_zero [simp]: "\<bar>a\<bar> \<ge> 0"
  40.140      and abs_ge_self: "a \<le> \<bar>a\<bar>"
  40.141      and abs_leI: "a \<le> b \<Longrightarrow> - a \<le> b \<Longrightarrow> \<bar>a\<bar> \<le> b"
  40.142 @@ -945,7 +944,7 @@
  40.143  
  40.144  subsection {* Lattice Ordered (Abelian) Groups *}
  40.145  
  40.146 -class lordered_ab_group_add_meet = pordered_ab_group_add + lower_semilattice
  40.147 +class semilattice_inf_ab_group_add = ordered_ab_group_add + semilattice_inf
  40.148  begin
  40.149  
  40.150  lemma add_inf_distrib_left:
  40.151 @@ -967,7 +966,7 @@
  40.152  
  40.153  end
  40.154  
  40.155 -class lordered_ab_group_add_join = pordered_ab_group_add + upper_semilattice
  40.156 +class semilattice_sup_ab_group_add = ordered_ab_group_add + semilattice_sup
  40.157  begin
  40.158  
  40.159  lemma add_sup_distrib_left:
  40.160 @@ -990,11 +989,11 @@
  40.161  
  40.162  end
  40.163  
  40.164 -class lordered_ab_group_add = pordered_ab_group_add + lattice
  40.165 +class lattice_ab_group_add = ordered_ab_group_add + lattice
  40.166  begin
  40.167  
  40.168 -subclass lordered_ab_group_add_meet ..
  40.169 -subclass lordered_ab_group_add_join ..
  40.170 +subclass semilattice_inf_ab_group_add ..
  40.171 +subclass semilattice_sup_ab_group_add ..
  40.172  
  40.173  lemmas add_sup_inf_distribs = add_inf_distrib_right add_inf_distrib_left add_sup_distrib_right add_sup_distrib_left
  40.174  
  40.175 @@ -1244,7 +1243,7 @@
  40.176  lemmas add_sup_inf_distribs = add_inf_distrib_right add_inf_distrib_left add_sup_distrib_right add_sup_distrib_left
  40.177  
  40.178  
  40.179 -class lordered_ab_group_add_abs = lordered_ab_group_add + abs +
  40.180 +class lattice_ab_group_add_abs = lattice_ab_group_add + abs +
  40.181    assumes abs_lattice: "\<bar>a\<bar> = sup a (- a)"
  40.182  begin
  40.183  
  40.184 @@ -1262,7 +1261,7 @@
  40.185        pprt_def nprt_def diff_minus abs_lattice)
  40.186  qed
  40.187  
  40.188 -subclass pordered_ab_group_add_abs
  40.189 +subclass ordered_ab_group_add_abs
  40.190  proof
  40.191    have abs_ge_zero [simp]: "\<And>a. 0 \<le> \<bar>a\<bar>"
  40.192    proof -
  40.193 @@ -1297,7 +1296,7 @@
  40.194  end
  40.195  
  40.196  lemma sup_eq_if:
  40.197 -  fixes a :: "'a\<Colon>{lordered_ab_group_add, linorder}"
  40.198 +  fixes a :: "'a\<Colon>{lattice_ab_group_add, linorder}"
  40.199    shows "sup a (- a) = (if a < 0 then - a else a)"
  40.200  proof -
  40.201    note add_le_cancel_right [of a a "- a", symmetric, simplified]
  40.202 @@ -1306,7 +1305,7 @@
  40.203  qed
  40.204  
  40.205  lemma abs_if_lattice:
  40.206 -  fixes a :: "'a\<Colon>{lordered_ab_group_add_abs, linorder}"
  40.207 +  fixes a :: "'a\<Colon>{lattice_ab_group_add_abs, linorder}"
  40.208    shows "\<bar>a\<bar> = (if a < 0 then - a else a)"
  40.209  by auto
  40.210  
  40.211 @@ -1324,10 +1323,10 @@
  40.212  apply (simp add: add_right_cancel[symmetric, of "x" "-z" "z", simplified])
  40.213  done
  40.214  
  40.215 -lemma less_eqI: "(x::'a::pordered_ab_group_add) - y = x' - y' \<Longrightarrow> (x < y) = (x' < y')"
  40.216 +lemma less_eqI: "(x::'a::ordered_ab_group_add) - y = x' - y' \<Longrightarrow> (x < y) = (x' < y')"
  40.217  by (simp add: less_iff_diff_less_0[of x y] less_iff_diff_less_0[of x' y'])
  40.218  
  40.219 -lemma le_eqI: "(x::'a::pordered_ab_group_add) - y = x' - y' \<Longrightarrow> (y <= x) = (y' <= x')"
  40.220 +lemma le_eqI: "(x::'a::ordered_ab_group_add) - y = x' - y' \<Longrightarrow> (y <= x) = (y' <= x')"
  40.221  apply (simp add: le_iff_diff_le_0[of y x] le_iff_diff_le_0[of  y' x'])
  40.222  apply (simp add: neg_le_iff_le[symmetric, of "y-x" 0] neg_le_iff_le[symmetric, of "y'-x'" 0])
  40.223  done
  40.224 @@ -1340,7 +1339,7 @@
  40.225  
  40.226  lemma le_add_right_mono: 
  40.227    assumes 
  40.228 -  "a <= b + (c::'a::pordered_ab_group_add)"
  40.229 +  "a <= b + (c::'a::ordered_ab_group_add)"
  40.230    "c <= d"    
  40.231    shows "a <= b + d"
  40.232    apply (rule_tac order_trans[where y = "b+c"])
  40.233 @@ -1348,7 +1347,7 @@
  40.234    done
  40.235  
  40.236  lemma estimate_by_abs:
  40.237 -  "a + b <= (c::'a::lordered_ab_group_add_abs) \<Longrightarrow> a <= c + abs b" 
  40.238 +  "a + b <= (c::'a::lattice_ab_group_add_abs) \<Longrightarrow> a <= c + abs b" 
  40.239  proof -
  40.240    assume "a+b <= c"
  40.241    hence 2: "a <= c+(-b)" by (simp add: algebra_simps)
  40.242 @@ -1358,16 +1357,16 @@
  40.243  
  40.244  subsection {* Tools setup *}
  40.245  
  40.246 -lemma add_mono_thms_ordered_semiring [noatp]:
  40.247 -  fixes i j k :: "'a\<Colon>pordered_ab_semigroup_add"
  40.248 +lemma add_mono_thms_linordered_semiring [noatp]:
  40.249 +  fixes i j k :: "'a\<Colon>ordered_ab_semigroup_add"
  40.250    shows "i \<le> j \<and> k \<le> l \<Longrightarrow> i + k \<le> j + l"
  40.251      and "i = j \<and> k \<le> l \<Longrightarrow> i + k \<le> j + l"
  40.252      and "i \<le> j \<and> k = l \<Longrightarrow> i + k \<le> j + l"
  40.253      and "i = j \<and> k = l \<Longrightarrow> i + k = j + l"
  40.254  by (rule add_mono, clarify+)+
  40.255  
  40.256 -lemma add_mono_thms_ordered_field [noatp]:
  40.257 -  fixes i j k :: "'a\<Colon>pordered_cancel_ab_semigroup_add"
  40.258 +lemma add_mono_thms_linordered_field [noatp]:
  40.259 +  fixes i j k :: "'a\<Colon>ordered_cancel_ab_semigroup_add"
  40.260    shows "i < j \<and> k = l \<Longrightarrow> i + k < j + l"
  40.261      and "i = j \<and> k < l \<Longrightarrow> i + k < j + l"
  40.262      and "i < j \<and> k \<le> l \<Longrightarrow> i + k < j + l"
    41.1 --- a/src/HOL/Orderings.thy	Fri Feb 05 14:33:31 2010 +0100
    41.2 +++ b/src/HOL/Orderings.thy	Fri Feb 05 14:33:50 2010 +0100
    41.3 @@ -1052,7 +1052,7 @@
    41.4  
    41.5  subsection {* Dense orders *}
    41.6  
    41.7 -class dense_linear_order = linorder + 
    41.8 +class dense_linorder = linorder + 
    41.9    assumes gt_ex: "\<exists>y. x < y" 
   41.10    and lt_ex: "\<exists>y. y < x"
   41.11    and dense: "x < y \<Longrightarrow> (\<exists>z. x < z \<and> z < y)"
    42.1 --- a/src/HOL/PReal.thy	Fri Feb 05 14:33:31 2010 +0100
    42.2 +++ b/src/HOL/PReal.thy	Fri Feb 05 14:33:50 2010 +0100
    42.3 @@ -23,7 +23,7 @@
    42.4              (\<forall>y \<in> A. ((\<forall>z. 0<z & z < y --> z \<in> A) & (\<exists>u \<in> A. y < u))))"
    42.5  
    42.6  lemma interval_empty_iff:
    42.7 -  "{y. (x::'a::dense_linear_order) < y \<and> y < z} = {} \<longleftrightarrow> \<not> x < z"
    42.8 +  "{y. (x::'a::dense_linorder) < y \<and> y < z} = {} \<longleftrightarrow> \<not> x < z"
    42.9    by (auto dest: dense)
   42.10  
   42.11  
   42.12 @@ -1155,7 +1155,7 @@
   42.13      preal_add_le_cancel_right preal_add_le_cancel_left
   42.14      preal_add_left_cancel_iff preal_add_right_cancel_iff
   42.15  
   42.16 -instance preal :: ordered_cancel_ab_semigroup_add
   42.17 +instance preal :: linordered_cancel_ab_semigroup_add
   42.18  proof
   42.19    fix a b c :: preal
   42.20    show "a + b = a + c \<Longrightarrow> b = c" by (rule preal_add_left_cancel)
    43.1 --- a/src/HOL/Parity.thy	Fri Feb 05 14:33:31 2010 +0100
    43.2 +++ b/src/HOL/Parity.thy	Fri Feb 05 14:33:50 2010 +0100
    43.3 @@ -218,7 +218,7 @@
    43.4    done
    43.5  
    43.6  lemma zero_le_even_power: "even n ==>
    43.7 -    0 <= (x::'a::{ordered_ring_strict,monoid_mult}) ^ n"
    43.8 +    0 <= (x::'a::{linlinordered_ring_strict,monoid_mult}) ^ n"
    43.9    apply (simp add: even_nat_equiv_def2)
   43.10    apply (erule exE)
   43.11    apply (erule ssubst)
   43.12 @@ -227,12 +227,12 @@
   43.13    done
   43.14  
   43.15  lemma zero_le_odd_power: "odd n ==>
   43.16 -    (0 <= (x::'a::{ordered_idom}) ^ n) = (0 <= x)"
   43.17 +    (0 <= (x::'a::{linordered_idom}) ^ n) = (0 <= x)"
   43.18  apply (auto simp: odd_nat_equiv_def2 power_Suc power_add zero_le_mult_iff)
   43.19  apply (metis field_power_not_zero no_zero_divirors_neq0 order_antisym_conv zero_le_square)
   43.20  done
   43.21  
   43.22 -lemma zero_le_power_eq[presburger]: "(0 <= (x::'a::{ordered_idom}) ^ n) =
   43.23 +lemma zero_le_power_eq[presburger]: "(0 <= (x::'a::{linordered_idom}) ^ n) =
   43.24      (even n | (odd n & 0 <= x))"
   43.25    apply auto
   43.26    apply (subst zero_le_odd_power [symmetric])
   43.27 @@ -240,19 +240,19 @@
   43.28    apply (erule zero_le_even_power)
   43.29    done
   43.30  
   43.31 -lemma zero_less_power_eq[presburger]: "(0 < (x::'a::{ordered_idom}) ^ n) =
   43.32 +lemma zero_less_power_eq[presburger]: "(0 < (x::'a::{linordered_idom}) ^ n) =
   43.33      (n = 0 | (even n & x ~= 0) | (odd n & 0 < x))"
   43.34  
   43.35    unfolding order_less_le zero_le_power_eq by auto
   43.36  
   43.37 -lemma power_less_zero_eq[presburger]: "((x::'a::{ordered_idom}) ^ n < 0) =
   43.38 +lemma power_less_zero_eq[presburger]: "((x::'a::{linordered_idom}) ^ n < 0) =
   43.39      (odd n & x < 0)"
   43.40    apply (subst linorder_not_le [symmetric])+
   43.41    apply (subst zero_le_power_eq)
   43.42    apply auto
   43.43    done
   43.44  
   43.45 -lemma power_le_zero_eq[presburger]: "((x::'a::{ordered_idom}) ^ n <= 0) =
   43.46 +lemma power_le_zero_eq[presburger]: "((x::'a::{linordered_idom}) ^ n <= 0) =
   43.47      (n ~= 0 & ((odd n & x <= 0) | (even n & x = 0)))"
   43.48    apply (subst linorder_not_less [symmetric])+
   43.49    apply (subst zero_less_power_eq)
   43.50 @@ -260,7 +260,7 @@
   43.51    done
   43.52  
   43.53  lemma power_even_abs: "even n ==>
   43.54 -    (abs (x::'a::{ordered_idom}))^n = x^n"
   43.55 +    (abs (x::'a::{linordered_idom}))^n = x^n"
   43.56    apply (subst power_abs [symmetric])
   43.57    apply (simp add: zero_le_even_power)
   43.58    done
   43.59 @@ -280,7 +280,7 @@
   43.60    apply simp
   43.61    done
   43.62  
   43.63 -lemma power_mono_even: fixes x y :: "'a :: {ordered_idom}"
   43.64 +lemma power_mono_even: fixes x y :: "'a :: {linordered_idom}"
   43.65    assumes "even n" and "\<bar>x\<bar> \<le> \<bar>y\<bar>"
   43.66    shows "x^n \<le> y^n"
   43.67  proof -
   43.68 @@ -292,7 +292,7 @@
   43.69  
   43.70  lemma odd_pos: "odd (n::nat) \<Longrightarrow> 0 < n" by presburger
   43.71  
   43.72 -lemma power_mono_odd: fixes x y :: "'a :: {ordered_idom}"
   43.73 +lemma power_mono_odd: fixes x y :: "'a :: {linordered_idom}"
   43.74    assumes "odd n" and "x \<le> y"
   43.75    shows "x^n \<le> y^n"
   43.76  proof (cases "y < 0")
   43.77 @@ -372,11 +372,11 @@
   43.78  subsection {* An Equivalence for @{term [source] "0 \<le> a^n"} *}
   43.79  
   43.80  lemma even_power_le_0_imp_0:
   43.81 -    "a ^ (2*k) \<le> (0::'a::{ordered_idom}) ==> a=0"
   43.82 +    "a ^ (2*k) \<le> (0::'a::{linordered_idom}) ==> a=0"
   43.83    by (induct k) (auto simp add: zero_le_mult_iff mult_le_0_iff power_Suc)
   43.84  
   43.85  lemma zero_le_power_iff[presburger]:
   43.86 -  "(0 \<le> a^n) = (0 \<le> (a::'a::{ordered_idom}) | even n)"
   43.87 +  "(0 \<le> a^n) = (0 \<le> (a::'a::{linordered_idom}) | even n)"
   43.88  proof cases
   43.89    assume even: "even n"
   43.90    then obtain k where "n = 2*k"
    44.1 --- a/src/HOL/Power.thy	Fri Feb 05 14:33:31 2010 +0100
    44.2 +++ b/src/HOL/Power.thy	Fri Feb 05 14:33:50 2010 +0100
    44.3 @@ -130,7 +130,7 @@
    44.4  
    44.5  end
    44.6  
    44.7 -context ordered_semidom
    44.8 +context linordered_semidom
    44.9  begin
   44.10  
   44.11  lemma zero_less_power [simp]:
   44.12 @@ -323,7 +323,7 @@
   44.13  
   44.14  end
   44.15  
   44.16 -context ordered_idom
   44.17 +context linordered_idom
   44.18  begin
   44.19  
   44.20  lemma power_abs:
    45.1 --- a/src/HOL/Probability/Borel.thy	Fri Feb 05 14:33:31 2010 +0100
    45.2 +++ b/src/HOL/Probability/Borel.thy	Fri Feb 05 14:33:50 2010 +0100
    45.3 @@ -73,7 +73,7 @@
    45.4      with w have "real(Suc(natceiling(inverse(g w - f w)))) > inverse(g w - f w)"
    45.5        by (metis lessI order_le_less_trans real_natceiling_ge real_of_nat_less_iff)       hence "inverse(real(Suc(natceiling(inverse(g w - f w)))))
    45.6               < inverse(inverse(g w - f w))" 
    45.7 -      by (metis less_iff_diff_less_0 less_imp_inverse_less linorder_neqE_ordered_idom nz positive_imp_inverse_positive real_le_antisym real_less_def w)
    45.8 +      by (metis less_iff_diff_less_0 less_imp_inverse_less linorder_neqE_linordered_idom nz positive_imp_inverse_positive real_le_antisym real_less_def w)
    45.9      hence "inverse(real(Suc(natceiling(inverse(g w - f w))))) < g w - f w"
   45.10        by (metis inverse_inverse_eq order_less_le_trans real_le_refl) 
   45.11      thus "\<exists>n. f w \<le> g w - inverse(real(Suc n))" using w
    46.1 --- a/src/HOL/Quickcheck.thy	Fri Feb 05 14:33:31 2010 +0100
    46.2 +++ b/src/HOL/Quickcheck.thy	Fri Feb 05 14:33:50 2010 +0100
    46.3 @@ -164,7 +164,7 @@
    46.4  where
    46.5    "union R1 R2 = (\<lambda>s. let
    46.6       (P1, s') = R1 s; (P2, s'') = R2 s'
    46.7 -   in (upper_semilattice_class.sup P1 P2, s''))"
    46.8 +   in (semilattice_sup_class.sup P1 P2, s''))"
    46.9  
   46.10  definition if_randompred :: "bool \<Rightarrow> unit randompred"
   46.11  where
    47.1 --- a/src/HOL/RComplete.thy	Fri Feb 05 14:33:31 2010 +0100
    47.2 +++ b/src/HOL/RComplete.thy	Fri Feb 05 14:33:50 2010 +0100
    47.3 @@ -15,7 +15,7 @@
    47.4    by simp
    47.5  
    47.6  lemma abs_diff_less_iff:
    47.7 -  "(\<bar>x - a\<bar> < (r::'a::ordered_idom)) = (a - r < x \<and> x < a + r)"
    47.8 +  "(\<bar>x - a\<bar> < (r::'a::linordered_idom)) = (a - r < x \<and> x < a + r)"
    47.9    by auto
   47.10  
   47.11  subsection {* Completeness of Positive Reals *}
    48.1 --- a/src/HOL/Rational.thy	Fri Feb 05 14:33:31 2010 +0100
    48.2 +++ b/src/HOL/Rational.thy	Fri Feb 05 14:33:50 2010 +0100
    48.3 @@ -613,7 +613,7 @@
    48.4  
    48.5  end
    48.6  
    48.7 -instance rat :: ordered_field
    48.8 +instance rat :: linordered_field
    48.9  proof
   48.10    fix q r s :: rat
   48.11    show "q \<le> r ==> s + q \<le> s + r"
   48.12 @@ -760,7 +760,7 @@
   48.13  
   48.14  class field_char_0 = field + ring_char_0
   48.15  
   48.16 -subclass (in ordered_field) field_char_0 ..
   48.17 +subclass (in linordered_field) field_char_0 ..
   48.18  
   48.19  context field_char_0
   48.20  begin
   48.21 @@ -832,7 +832,7 @@
   48.22  done
   48.23  
   48.24  lemma of_rat_less:
   48.25 -  "(of_rat r :: 'a::ordered_field) < of_rat s \<longleftrightarrow> r < s"
   48.26 +  "(of_rat r :: 'a::linordered_field) < of_rat s \<longleftrightarrow> r < s"
   48.27  proof (induct r, induct s)
   48.28    fix a b c d :: int
   48.29    assume not_zero: "b > 0" "d > 0"
   48.30 @@ -841,14 +841,14 @@
   48.31      "(of_int a :: 'a) / of_int b < of_int c / of_int d
   48.32        \<longleftrightarrow> (of_int a :: 'a) * of_int d < of_int c * of_int b"
   48.33      using not_zero by (simp add: pos_less_divide_eq pos_divide_less_eq)
   48.34 -  show "(of_rat (Fract a b) :: 'a::ordered_field) < of_rat (Fract c d)
   48.35 +  show "(of_rat (Fract a b) :: 'a::linordered_field) < of_rat (Fract c d)
   48.36      \<longleftrightarrow> Fract a b < Fract c d"
   48.37      using not_zero `b * d > 0`
   48.38      by (simp add: of_rat_rat of_int_divide_less_eq of_int_mult [symmetric] del: of_int_mult)
   48.39  qed
   48.40  
   48.41  lemma of_rat_less_eq:
   48.42 -  "(of_rat r :: 'a::ordered_field) \<le> of_rat s \<longleftrightarrow> r \<le> s"
   48.43 +  "(of_rat r :: 'a::linordered_field) \<le> of_rat s \<longleftrightarrow> r \<le> s"
   48.44    unfolding le_less by (auto simp add: of_rat_less)
   48.45  
   48.46  lemmas of_rat_eq_0_iff [simp] = of_rat_eq_iff [of _ 0, simplified]
   48.47 @@ -1083,11 +1083,11 @@
   48.48    finally show ?thesis using assms by simp
   48.49  qed
   48.50  
   48.51 -lemma (in ordered_idom) sgn_greater [simp]:
   48.52 +lemma (in linordered_idom) sgn_greater [simp]:
   48.53    "0 < sgn a \<longleftrightarrow> 0 < a"
   48.54    unfolding sgn_if by auto
   48.55  
   48.56 -lemma (in ordered_idom) sgn_less [simp]:
   48.57 +lemma (in linordered_idom) sgn_less [simp]:
   48.58    "sgn a < 0 \<longleftrightarrow> a < 0"
   48.59    unfolding sgn_if by auto
   48.60  
    49.1 --- a/src/HOL/Real.thy	Fri Feb 05 14:33:31 2010 +0100
    49.2 +++ b/src/HOL/Real.thy	Fri Feb 05 14:33:50 2010 +0100
    49.3 @@ -3,7 +3,7 @@
    49.4  begin
    49.5  
    49.6  lemma field_le_epsilon:
    49.7 -  fixes x y :: "'a:: {number_ring,division_by_zero,ordered_field}"
    49.8 +  fixes x y :: "'a:: {number_ring,division_by_zero,linordered_field}"
    49.9    assumes e: "(!!e. 0 < e ==> x \<le> y + e)"
   49.10    shows "x \<le> y"
   49.11  proof (rule ccontr)
    50.1 --- a/src/HOL/RealDef.thy	Fri Feb 05 14:33:31 2010 +0100
    50.2 +++ b/src/HOL/RealDef.thy	Fri Feb 05 14:33:50 2010 +0100
    50.3 @@ -416,7 +416,7 @@
    50.4  
    50.5  subsection{*The Reals Form an Ordered Field*}
    50.6  
    50.7 -instance real :: ordered_field
    50.8 +instance real :: linordered_field
    50.9  proof
   50.10    fix x y z :: real
   50.11    show "x \<le> y ==> z + x \<le> z + y" by (rule real_add_left_mono)
   50.12 @@ -426,7 +426,7 @@
   50.13      by (simp only: real_sgn_def)
   50.14  qed
   50.15  
   50.16 -instance real :: lordered_ab_group_add ..
   50.17 +instance real :: lattice_ab_group_add ..
   50.18  
   50.19  text{*The function @{term real_of_preal} requires many proofs, but it seems
   50.20  to be essential for proving completeness of the reals from that of the
   50.21 @@ -1046,7 +1046,7 @@
   50.22  lemma abs_sum_triangle_ineq: "abs ((x::real) + y + (-l + -m)) \<le> abs(x + -l) + abs(y + -m)"
   50.23  by simp
   50.24  
   50.25 -instance real :: lordered_ring
   50.26 +instance real :: lattice_ring
   50.27  proof
   50.28    fix a::real
   50.29    show "abs a = sup a (-a)"
    51.1 --- a/src/HOL/Ring_and_Field.thy	Fri Feb 05 14:33:31 2010 +0100
    51.2 +++ b/src/HOL/Ring_and_Field.thy	Fri Feb 05 14:33:50 2010 +0100
    51.3 @@ -706,7 +706,7 @@
    51.4    assumes mult_left_mono: "a \<le> b \<Longrightarrow> 0 \<le> c \<Longrightarrow> c * a \<le> c * b"
    51.5    assumes mult_right_mono: "a \<le> b \<Longrightarrow> 0 \<le> c \<Longrightarrow> a * c \<le> b * c"
    51.6  
    51.7 -class pordered_semiring = mult_mono + semiring_0 + pordered_ab_semigroup_add 
    51.8 +class ordered_semiring = mult_mono + semiring_0 + ordered_ab_semigroup_add 
    51.9  begin
   51.10  
   51.11  lemma mult_mono:
   51.12 @@ -725,12 +725,12 @@
   51.13  
   51.14  end
   51.15  
   51.16 -class pordered_cancel_semiring = mult_mono + pordered_ab_semigroup_add
   51.17 +class ordered_cancel_semiring = mult_mono + ordered_ab_semigroup_add
   51.18    + semiring + cancel_comm_monoid_add
   51.19  begin
   51.20  
   51.21  subclass semiring_0_cancel ..
   51.22 -subclass pordered_semiring ..
   51.23 +subclass ordered_semiring ..
   51.24  
   51.25  lemma mult_nonneg_nonneg: "0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> 0 \<le> a * b"
   51.26  using mult_left_mono [of zero b a] by simp
   51.27 @@ -750,12 +750,12 @@
   51.28  
   51.29  end
   51.30  
   51.31 -class ordered_semiring = semiring + comm_monoid_add + ordered_cancel_ab_semigroup_add + mult_mono
   51.32 +class linordered_semiring = semiring + comm_monoid_add + linordered_cancel_ab_semigroup_add + mult_mono
   51.33  begin
   51.34  
   51.35 -subclass pordered_cancel_semiring ..
   51.36 -
   51.37 -subclass pordered_comm_monoid_add ..
   51.38 +subclass ordered_cancel_semiring ..
   51.39 +
   51.40 +subclass ordered_comm_monoid_add ..
   51.41  
   51.42  lemma mult_left_less_imp_less:
   51.43    "c * a < c * b \<Longrightarrow> 0 \<le> c \<Longrightarrow> a < b"
   51.44 @@ -767,16 +767,16 @@
   51.45  
   51.46  end
   51.47  
   51.48 -class ordered_semiring_1 = ordered_semiring + semiring_1
   51.49 -
   51.50 -class ordered_semiring_strict = semiring + comm_monoid_add + ordered_cancel_ab_semigroup_add +
   51.51 +class linlinordered_semiring_1 = linordered_semiring + semiring_1
   51.52 +
   51.53 +class linlinordered_semiring_strict = semiring + comm_monoid_add + linordered_cancel_ab_semigroup_add +
   51.54    assumes mult_strict_left_mono: "a < b \<Longrightarrow> 0 < c \<Longrightarrow> c * a < c * b"
   51.55    assumes mult_strict_right_mono: "a < b \<Longrightarrow> 0 < c \<Longrightarrow> a * c < b * c"
   51.56  begin
   51.57  
   51.58  subclass semiring_0_cancel ..
   51.59  
   51.60 -subclass ordered_semiring
   51.61 +subclass linordered_semiring
   51.62  proof
   51.63    fix a b c :: 'a
   51.64    assume A: "a \<le> b" "0 \<le> c"
   51.65 @@ -886,16 +886,16 @@
   51.66  
   51.67  end
   51.68  
   51.69 -class ordered_semiring_1_strict = ordered_semiring_strict + semiring_1
   51.70 +class linlinlinordered_semiring_1_strict = linlinordered_semiring_strict + semiring_1
   51.71  
   51.72  class mult_mono1 = times + zero + ord +
   51.73    assumes mult_mono1: "a \<le> b \<Longrightarrow> 0 \<le> c \<Longrightarrow> c * a \<le> c * b"
   51.74  
   51.75 -class pordered_comm_semiring = comm_semiring_0
   51.76 -  + pordered_ab_semigroup_add + mult_mono1
   51.77 +class ordered_comm_semiring = comm_semiring_0
   51.78 +  + ordered_ab_semigroup_add + mult_mono1
   51.79  begin
   51.80  
   51.81 -subclass pordered_semiring
   51.82 +subclass ordered_semiring
   51.83  proof
   51.84    fix a b c :: 'a
   51.85    assume "a \<le> b" "0 \<le> c"
   51.86 @@ -905,20 +905,20 @@
   51.87  
   51.88  end
   51.89  
   51.90 -class pordered_cancel_comm_semiring = comm_semiring_0_cancel
   51.91 -  + pordered_ab_semigroup_add + mult_mono1
   51.92 +class ordered_cancel_comm_semiring = comm_semiring_0_cancel
   51.93 +  + ordered_ab_semigroup_add + mult_mono1
   51.94  begin
   51.95  
   51.96 -subclass pordered_comm_semiring ..
   51.97 -subclass pordered_cancel_semiring ..
   51.98 +subclass ordered_comm_semiring ..
   51.99 +subclass ordered_cancel_semiring ..
  51.100  
  51.101  end
  51.102  
  51.103 -class ordered_comm_semiring_strict = comm_semiring_0 + ordered_cancel_ab_semigroup_add +
  51.104 +class linordered_comm_semiring_strict = comm_semiring_0 + linordered_cancel_ab_semigroup_add +
  51.105    assumes mult_strict_left_mono_comm: "a < b \<Longrightarrow> 0 < c \<Longrightarrow> c * a < c * b"
  51.106  begin
  51.107  
  51.108 -subclass ordered_semiring_strict
  51.109 +subclass linlinordered_semiring_strict
  51.110  proof
  51.111    fix a b c :: 'a
  51.112    assume "a < b" "0 < c"
  51.113 @@ -926,7 +926,7 @@
  51.114    thus "a * c < b * c" by (simp only: mult_commute)
  51.115  qed
  51.116  
  51.117 -subclass pordered_cancel_comm_semiring
  51.118 +subclass ordered_cancel_comm_semiring
  51.119  proof
  51.120    fix a b c :: 'a
  51.121    assume "a \<le> b" "0 \<le> c"
  51.122 @@ -937,10 +937,10 @@
  51.123  
  51.124  end
  51.125  
  51.126 -class pordered_ring = ring + pordered_cancel_semiring 
  51.127 +class ordered_ring = ring + ordered_cancel_semiring 
  51.128  begin
  51.129  
  51.130 -subclass pordered_ab_group_add ..
  51.131 +subclass ordered_ab_group_add ..
  51.132  
  51.133  text{*Legacy - use @{text algebra_simps} *}
  51.134  lemmas ring_simps[noatp] = algebra_simps
  51.135 @@ -991,32 +991,31 @@
  51.136  lemma (in sgn_if) sgn0[simp]: "sgn 0 = 0"
  51.137  by(simp add:sgn_if)
  51.138  
  51.139 -class ordered_ring = ring + ordered_semiring
  51.140 -  + ordered_ab_group_add + abs_if
  51.141 +class linordered_ring = ring + linordered_semiring + linordered_ab_group_add + abs_if
  51.142  begin
  51.143  
  51.144 -subclass pordered_ring ..
  51.145 -
  51.146 -subclass pordered_ab_group_add_abs
  51.147 +subclass ordered_ring ..
  51.148 +
  51.149 +subclass ordered_ab_group_add_abs
  51.150  proof
  51.151    fix a b
  51.152    show "\<bar>a + b\<bar> \<le> \<bar>a\<bar> + \<bar>b\<bar>"
  51.153 -by (auto simp add: abs_if not_less neg_less_eq_nonneg less_eq_neg_nonpos)
  51.154 -   (auto simp del: minus_add_distrib simp add: minus_add_distrib [symmetric]
  51.155 +    by (auto simp add: abs_if not_less neg_less_eq_nonneg less_eq_neg_nonpos)
  51.156 +    (auto simp del: minus_add_distrib simp add: minus_add_distrib [symmetric]
  51.157       neg_less_eq_nonneg less_eq_neg_nonpos, auto intro: add_nonneg_nonneg,
  51.158        auto intro!: less_imp_le add_neg_neg)
  51.159  qed (auto simp add: abs_if less_eq_neg_nonpos neg_equal_zero)
  51.160  
  51.161  end
  51.162  
  51.163 -(* The "strict" suffix can be seen as describing the combination of ordered_ring and no_zero_divisors.
  51.164 -   Basically, ordered_ring + no_zero_divisors = ordered_ring_strict.
  51.165 +(* The "strict" suffix can be seen as describing the combination of linordered_ring and no_zero_divisors.
  51.166 +   Basically, linordered_ring + no_zero_divisors = linlinordered_ring_strict.
  51.167   *)
  51.168 -class ordered_ring_strict = ring + ordered_semiring_strict
  51.169 +class linlinordered_ring_strict = ring + linlinordered_semiring_strict
  51.170    + ordered_ab_group_add + abs_if
  51.171  begin
  51.172  
  51.173 -subclass ordered_ring ..
  51.174 +subclass linordered_ring ..
  51.175  
  51.176  lemma mult_strict_left_mono_neg: "b < a \<Longrightarrow> c < 0 \<Longrightarrow> c * a < c * b"
  51.177  using mult_strict_left_mono [of b a "- c"] by simp
  51.178 @@ -1168,16 +1167,16 @@
  51.179    mult_pos_pos mult_pos_neg
  51.180    mult_neg_pos mult_neg_neg
  51.181  
  51.182 -class pordered_comm_ring = comm_ring + pordered_comm_semiring
  51.183 +class ordered_comm_ring = comm_ring + ordered_comm_semiring
  51.184  begin
  51.185  
  51.186 -subclass pordered_ring ..
  51.187 -subclass pordered_cancel_comm_semiring ..
  51.188 +subclass ordered_ring ..
  51.189 +subclass ordered_cancel_comm_semiring ..
  51.190  
  51.191  end
  51.192  
  51.193 -class ordered_semidom = comm_semiring_1_cancel + ordered_comm_semiring_strict +
  51.194 -  (*previously ordered_semiring*)
  51.195 +class linordered_semidom = comm_semiring_1_cancel + linordered_comm_semiring_strict +
  51.196 +  (*previously linordered_semiring*)
  51.197    assumes zero_less_one [simp]: "0 < 1"
  51.198  begin
  51.199  
  51.200 @@ -1202,23 +1201,23 @@
  51.201  
  51.202  end
  51.203  
  51.204 -class ordered_idom = comm_ring_1 +
  51.205 -  ordered_comm_semiring_strict + ordered_ab_group_add +
  51.206 +class linordered_idom = comm_ring_1 +
  51.207 +  linordered_comm_semiring_strict + ordered_ab_group_add +
  51.208    abs_if + sgn_if
  51.209 -  (*previously ordered_ring*)
  51.210 +  (*previously linordered_ring*)
  51.211  begin
  51.212  
  51.213 -subclass ordered_ring_strict ..
  51.214 -subclass pordered_comm_ring ..
  51.215 +subclass linlinordered_ring_strict ..
  51.216 +subclass ordered_comm_ring ..
  51.217  subclass idom ..
  51.218  
  51.219 -subclass ordered_semidom
  51.220 +subclass linordered_semidom
  51.221  proof
  51.222    have "0 \<le> 1 * 1" by (rule zero_le_square)
  51.223    thus "0 < 1" by (simp add: le_less)
  51.224  qed 
  51.225  
  51.226 -lemma linorder_neqE_ordered_idom:
  51.227 +lemma linorder_neqE_linordered_idom:
  51.228    assumes "x \<noteq> y" obtains "x < y" | "y < x"
  51.229    using assms by (rule neqE)
  51.230  
  51.231 @@ -1307,7 +1306,7 @@
  51.232  
  51.233  end
  51.234  
  51.235 -class ordered_field = field + ordered_idom
  51.236 +class linordered_field = field + linordered_idom
  51.237  
  51.238  text {* Simprules for comparisons where common factors can be cancelled. *}
  51.239  
  51.240 @@ -1437,7 +1436,7 @@
  51.241  subsection {* Ordered Fields *}
  51.242  
  51.243  lemma positive_imp_inverse_positive: 
  51.244 -assumes a_gt_0: "0 < a"  shows "0 < inverse (a::'a::ordered_field)"
  51.245 +assumes a_gt_0: "0 < a"  shows "0 < inverse (a::'a::linordered_field)"
  51.246  proof -
  51.247    have "0 < a * inverse a" 
  51.248      by (simp add: a_gt_0 [THEN order_less_imp_not_eq2] zero_less_one)
  51.249 @@ -1446,13 +1445,13 @@
  51.250  qed
  51.251  
  51.252  lemma negative_imp_inverse_negative:
  51.253 -  "a < 0 ==> inverse a < (0::'a::ordered_field)"
  51.254 +  "a < 0 ==> inverse a < (0::'a::linordered_field)"
  51.255  by (insert positive_imp_inverse_positive [of "-a"], 
  51.256      simp add: nonzero_inverse_minus_eq order_less_imp_not_eq)
  51.257  
  51.258  lemma inverse_le_imp_le:
  51.259  assumes invle: "inverse a \<le> inverse b" and apos:  "0 < a"
  51.260 -shows "b \<le> (a::'a::ordered_field)"
  51.261 +shows "b \<le> (a::'a::linordered_field)"
  51.262  proof (rule classical)
  51.263    assume "~ b \<le> a"
  51.264    hence "a < b"  by (simp add: linorder_not_le)
  51.265 @@ -1466,7 +1465,7 @@
  51.266  
  51.267  lemma inverse_positive_imp_positive:
  51.268  assumes inv_gt_0: "0 < inverse a" and nz: "a \<noteq> 0"
  51.269 -shows "0 < (a::'a::ordered_field)"
  51.270 +shows "0 < (a::'a::linordered_field)"
  51.271  proof -
  51.272    have "0 < inverse (inverse a)"
  51.273      using inv_gt_0 by (rule positive_imp_inverse_positive)
  51.274 @@ -1475,14 +1474,14 @@
  51.275  qed
  51.276  
  51.277  lemma inverse_positive_iff_positive [simp]:
  51.278 -  "(0 < inverse a) = (0 < (a::'a::{ordered_field,division_by_zero}))"
  51.279 +  "(0 < inverse a) = (0 < (a::'a::{linordered_field,division_by_zero}))"
  51.280  apply (cases "a = 0", simp)
  51.281  apply (blast intro: inverse_positive_imp_positive positive_imp_inverse_positive)
  51.282  done
  51.283  
  51.284  lemma inverse_negative_imp_negative:
  51.285  assumes inv_less_0: "inverse a < 0" and nz:  "a \<noteq> 0"
  51.286 -shows "a < (0::'a::ordered_field)"
  51.287 +shows "a < (0::'a::linordered_field)"
  51.288  proof -
  51.289    have "inverse (inverse a) < 0"
  51.290      using inv_less_0 by (rule negative_imp_inverse_negative)
  51.291 @@ -1490,20 +1489,20 @@
  51.292  qed
  51.293  
  51.294  lemma inverse_negative_iff_negative [simp]:
  51.295 -  "(inverse a < 0) = (a < (0::'a::{ordered_field,division_by_zero}))"
  51.296 +  "(inverse a < 0) = (a < (0::'a::{linordered_field,division_by_zero}))"
  51.297  apply (cases "a = 0", simp)
  51.298  apply (blast intro: inverse_negative_imp_negative negative_imp_inverse_negative)
  51.299  done
  51.300  
  51.301  lemma inverse_nonnegative_iff_nonnegative [simp]:
  51.302 -  "(0 \<le> inverse a) = (0 \<le> (a::'a::{ordered_field,division_by_zero}))"
  51.303 +  "(0 \<le> inverse a) = (0 \<le> (a::'a::{linordered_field,division_by_zero}))"
  51.304  by (simp add: linorder_not_less [symmetric])
  51.305  
  51.306  lemma inverse_nonpositive_iff_nonpositive [simp]:
  51.307 -  "(inverse a \<le> 0) = (a \<le> (0::'a::{ordered_field,division_by_zero}))"
  51.308 +  "(inverse a \<le> 0) = (a \<le> (0::'a::{linordered_field,division_by_zero}))"
  51.309  by (simp add: linorder_not_less [symmetric])
  51.310  
  51.311 -lemma ordered_field_no_lb: "\<forall> x. \<exists>y. y < (x::'a::ordered_field)"
  51.312 +lemma linlinordered_field_no_lb: "\<forall> x. \<exists>y. y < (x::'a::linordered_field)"
  51.313  proof
  51.314    fix x::'a
  51.315    have m1: "- (1::'a) < 0" by simp
  51.316 @@ -1512,7 +1511,7 @@
  51.317    thus "\<exists>y. y < x" by blast
  51.318  qed
  51.319  
  51.320 -lemma ordered_field_no_ub: "\<forall> x. \<exists>y. y > (x::'a::ordered_field)"
  51.321 +lemma linlinordered_field_no_ub: "\<forall> x. \<exists>y. y > (x::'a::linordered_field)"
  51.322  proof
  51.323    fix x::'a
  51.324    have m1: " (1::'a) > 0" by simp
  51.325 @@ -1525,7 +1524,7 @@
  51.326  
  51.327  lemma less_imp_inverse_less:
  51.328  assumes less: "a < b" and apos:  "0 < a"
  51.329 -shows "inverse b < inverse (a::'a::ordered_field)"
  51.330 +shows "inverse b < inverse (a::'a::linordered_field)"
  51.331  proof (rule ccontr)
  51.332    assume "~ inverse b < inverse a"
  51.333    hence "inverse a \<le> inverse b" by (simp add: linorder_not_less)
  51.334 @@ -1535,29 +1534,29 @@
  51.335  qed
  51.336  
  51.337  lemma inverse_less_imp_less:
  51.338 -  "[|inverse a < inverse b; 0 < a|] ==> b < (a::'a::ordered_field)"
  51.339 +  "[|inverse a < inverse b; 0 < a|] ==> b < (a::'a::linordered_field)"
  51.340  apply (simp add: order_less_le [of "inverse a"] order_less_le [of "b"])
  51.341  apply (force dest!: inverse_le_imp_le nonzero_inverse_eq_imp_eq) 
  51.342  done
  51.343  
  51.344  text{*Both premises are essential. Consider -1 and 1.*}
  51.345  lemma inverse_less_iff_less [simp,noatp]:
  51.346 -  "[|0 < a; 0 < b|] ==> (inverse a < inverse b) = (b < (a::'a::ordered_field))"
  51.347 +  "[|0 < a; 0 < b|] ==> (inverse a < inverse b) = (b < (a::'a::linordered_field))"
  51.348  by (blast intro: less_imp_inverse_less dest: inverse_less_imp_less) 
  51.349  
  51.350  lemma le_imp_inverse_le:
  51.351 -  "[|a \<le> b; 0 < a|] ==> inverse b \<le> inverse (a::'a::ordered_field)"
  51.352 +  "[|a \<le> b; 0 < a|] ==> inverse b \<le> inverse (a::'a::linordered_field)"
  51.353  by (force simp add: order_le_less less_imp_inverse_less)
  51.354  
  51.355  lemma inverse_le_iff_le [simp,noatp]:
  51.356 - "[|0 < a; 0 < b|] ==> (inverse a \<le> inverse b) = (b \<le> (a::'a::ordered_field))"
  51.357 + "[|0 < a; 0 < b|] ==> (inverse a \<le> inverse b) = (b \<le> (a::'a::linordered_field))"
  51.358  by (blast intro: le_imp_inverse_le dest: inverse_le_imp_le) 
  51.359  
  51.360  
  51.361  text{*These results refer to both operands being negative.  The opposite-sign
  51.362  case is trivial, since inverse preserves signs.*}
  51.363  lemma inverse_le_imp_le_neg:
  51.364 -  "[|inverse a \<le> inverse b; b < 0|] ==> b \<le> (a::'a::ordered_field)"
  51.365 +  "[|inverse a \<le> inverse b; b < 0|] ==> b \<le> (a::'a::linordered_field)"
  51.366  apply (rule classical) 
  51.367  apply (subgoal_tac "a < 0") 
  51.368   prefer 2 apply (force simp add: linorder_not_le intro: order_less_trans) 
  51.369 @@ -1566,7 +1565,7 @@
  51.370  done
  51.371  
  51.372  lemma less_imp_inverse_less_neg:
  51.373 -   "[|a < b; b < 0|] ==> inverse b < inverse (a::'a::ordered_field)"
  51.374 +   "[|a < b; b < 0|] ==> inverse b < inverse (a::'a::linordered_field)"
  51.375  apply (subgoal_tac "a < 0") 
  51.376   prefer 2 apply (blast intro: order_less_trans) 
  51.377  apply (insert less_imp_inverse_less [of "-b" "-a"])
  51.378 @@ -1574,7 +1573,7 @@
  51.379  done
  51.380  
  51.381  lemma inverse_less_imp_less_neg:
  51.382 -   "[|inverse a < inverse b; b < 0|] ==> b < (a::'a::ordered_field)"
  51.383 +   "[|inverse a < inverse b; b < 0|] ==> b < (a::'a::linordered_field)"
  51.384  apply (rule classical) 
  51.385  apply (subgoal_tac "a < 0") 
  51.386   prefer 2
  51.387 @@ -1584,25 +1583,25 @@
  51.388  done
  51.389  
  51.390  lemma inverse_less_iff_less_neg [simp,noatp]:
  51.391 -  "[|a < 0; b < 0|] ==> (inverse a < inverse b) = (b < (a::'a::ordered_field))"
  51.392 +  "[|a < 0; b < 0|] ==> (inverse a < inverse b) = (b < (a::'a::linordered_field))"
  51.393  apply (insert inverse_less_iff_less [of "-b" "-a"])
  51.394  apply (simp del: inverse_less_iff_less 
  51.395              add: order_less_imp_not_eq nonzero_inverse_minus_eq)
  51.396  done
  51.397  
  51.398  lemma le_imp_inverse_le_neg:
  51.399 -  "[|a \<le> b; b < 0|] ==> inverse b \<le> inverse (a::'a::ordered_field)"
  51.400 +  "[|a \<le> b; b < 0|] ==> inverse b \<le> inverse (a::'a::linordered_field)"
  51.401  by (force simp add: order_le_less less_imp_inverse_less_neg)
  51.402  
  51.403  lemma inverse_le_iff_le_neg [simp,noatp]:
  51.404 - "[|a < 0; b < 0|] ==> (inverse a \<le> inverse b) = (b \<le> (a::'a::ordered_field))"
  51.405 + "[|a < 0; b < 0|] ==> (inverse a \<le> inverse b) = (b \<le> (a::'a::linordered_field))"
  51.406  by (blast intro: le_imp_inverse_le_neg dest: inverse_le_imp_le_neg) 
  51.407  
  51.408  
  51.409  subsection{*Inverses and the Number One*}
  51.410  
  51.411  lemma one_less_inverse_iff:
  51.412 -  "(1 < inverse x) = (0 < x & x < (1::'a::{ordered_field,division_by_zero}))"
  51.413 +  "(1 < inverse x) = (0 < x & x < (1::'a::{linordered_field,division_by_zero}))"
  51.414  proof cases
  51.415    assume "0 < x"
  51.416      with inverse_less_iff_less [OF zero_less_one, of x]
  51.417 @@ -1624,22 +1623,22 @@
  51.418  by (insert inverse_eq_iff_eq [of x 1], simp) 
  51.419  
  51.420  lemma one_le_inverse_iff:
  51.421 -  "(1 \<le> inverse x) = (0 < x & x \<le> (1::'a::{ordered_field,division_by_zero}))"
  51.422 +  "(1 \<le> inverse x) = (0 < x & x \<le> (1::'a::{linordered_field,division_by_zero}))"
  51.423  by (force simp add: order_le_less one_less_inverse_iff zero_less_one 
  51.424                      eq_commute [of 1]) 
  51.425  
  51.426  lemma inverse_less_1_iff:
  51.427 -  "(inverse x < 1) = (x \<le> 0 | 1 < (x::'a::{ordered_field,division_by_zero}))"
  51.428 +  "(inverse x < 1) = (x \<le> 0 | 1 < (x::'a::{linordered_field,division_by_zero}))"
  51.429  by (simp add: linorder_not_le [symmetric] one_le_inverse_iff) 
  51.430  
  51.431  lemma inverse_le_1_iff:
  51.432 -  "(inverse x \<le> 1) = (x \<le> 0 | 1 \<le> (x::'a::{ordered_field,division_by_zero}))"
  51.433 +  "(inverse x \<le> 1) = (x \<le> 0 | 1 \<le> (x::'a::{linordered_field,division_by_zero}))"
  51.434  by (simp add: linorder_not_less [symmetric] one_less_inverse_iff) 
  51.435  
  51.436  
  51.437  subsection{*Simplification of Inequalities Involving Literal Divisors*}
  51.438  
  51.439 -lemma pos_le_divide_eq: "0 < (c::'a::ordered_field) ==> (a \<le> b/c) = (a*c \<le> b)"
  51.440 +lemma pos_le_divide_eq: "0 < (c::'a::linordered_field) ==> (a \<le> b/c) = (a*c \<le> b)"
  51.441  proof -
  51.442    assume less: "0<c"
  51.443    hence "(a \<le> b/c) = (a*c \<le> (b/c)*c)"
  51.444 @@ -1649,7 +1648,7 @@
  51.445    finally show ?thesis .
  51.446  qed
  51.447  
  51.448 -lemma neg_le_divide_eq: "c < (0::'a::ordered_field) ==> (a \<le> b/c) = (b \<le> a*c)"
  51.449 +lemma neg_le_divide_eq: "c < (0::'a::linordered_field) ==> (a \<le> b/c) = (b \<le> a*c)"
  51.450  proof -
  51.451    assume less: "c<0"
  51.452    hence "(a \<le> b/c) = ((b/c)*c \<le> a*c)"
  51.453 @@ -1663,12 +1662,12 @@
  51.454    "(a \<le> b/c) = 
  51.455     (if 0 < c then a*c \<le> b
  51.456               else if c < 0 then b \<le> a*c
  51.457 -             else  a \<le> (0::'a::{ordered_field,division_by_zero}))"
  51.458 +             else  a \<le> (0::'a::{linordered_field,division_by_zero}))"
  51.459  apply (cases "c=0", simp) 
  51.460  apply (force simp add: pos_le_divide_eq neg_le_divide_eq linorder_neq_iff) 
  51.461  done
  51.462  
  51.463 -lemma pos_divide_le_eq: "0 < (c::'a::ordered_field) ==> (b/c \<le> a) = (b \<le> a*c)"
  51.464 +lemma pos_divide_le_eq: "0 < (c::'a::linordered_field) ==> (b/c \<le> a) = (b \<le> a*c)"
  51.465  proof -
  51.466    assume less: "0<c"
  51.467    hence "(b/c \<le> a) = ((b/c)*c \<le> a*c)"
  51.468 @@ -1678,7 +1677,7 @@
  51.469    finally show ?thesis .
  51.470  qed
  51.471  
  51.472 -lemma neg_divide_le_eq: "c < (0::'a::ordered_field) ==> (b/c \<le> a) = (a*c \<le> b)"
  51.473 +lemma neg_divide_le_eq: "c < (0::'a::linordered_field) ==> (b/c \<le> a) = (a*c \<le> b)"
  51.474  proof -
  51.475    assume less: "c<0"
  51.476    hence "(b/c \<le> a) = (a*c \<le> (b/c)*c)"
  51.477 @@ -1692,13 +1691,13 @@
  51.478    "(b/c \<le> a) = 
  51.479     (if 0 < c then b \<le> a*c
  51.480               else if c < 0 then a*c \<le> b
  51.481 -             else 0 \<le> (a::'a::{ordered_field,division_by_zero}))"
  51.482 +             else 0 \<le> (a::'a::{linordered_field,division_by_zero}))"
  51.483  apply (cases "c=0", simp) 
  51.484  apply (force simp add: pos_divide_le_eq neg_divide_le_eq linorder_neq_iff) 
  51.485  done
  51.486  
  51.487  lemma pos_less_divide_eq:
  51.488 -     "0 < (c::'a::ordered_field) ==> (a < b/c) = (a*c < b)"
  51.489 +     "0 < (c::'a::linordered_field) ==> (a < b/c) = (a*c < b)"
  51.490  proof -
  51.491    assume less: "0<c"
  51.492    hence "(a < b/c) = (a*c < (b/c)*c)"
  51.493 @@ -1709,7 +1708,7 @@
  51.494  qed
  51.495  
  51.496  lemma neg_less_divide_eq:
  51.497 - "c < (0::'a::ordered_field) ==> (a < b/c) = (b < a*c)"
  51.498 + "c < (0::'a::linordered_field) ==> (a < b/c) = (b < a*c)"
  51.499  proof -
  51.500    assume less: "c<0"
  51.501    hence "(a < b/c) = ((b/c)*c < a*c)"
  51.502 @@ -1723,13 +1722,13 @@
  51.503    "(a < b/c) = 
  51.504     (if 0 < c then a*c < b
  51.505               else if c < 0 then b < a*c
  51.506 -             else  a < (0::'a::{ordered_field,division_by_zero}))"
  51.507 +             else  a < (0::'a::{linordered_field,division_by_zero}))"
  51.508  apply (cases "c=0", simp) 
  51.509  apply (force simp add: pos_less_divide_eq neg_less_divide_eq linorder_neq_iff) 
  51.510  done
  51.511  
  51.512  lemma pos_divide_less_eq:
  51.513 -     "0 < (c::'a::ordered_field) ==> (b/c < a) = (b < a*c)"
  51.514 +     "0 < (c::'a::linordered_field) ==> (b/c < a) = (b < a*c)"
  51.515  proof -
  51.516    assume less: "0<c"
  51.517    hence "(b/c < a) = ((b/c)*c < a*c)"
  51.518 @@ -1740,7 +1739,7 @@
  51.519  qed
  51.520  
  51.521  lemma neg_divide_less_eq:
  51.522 - "c < (0::'a::ordered_field) ==> (b/c < a) = (a*c < b)"
  51.523 + "c < (0::'a::linordered_field) ==> (b/c < a) = (a*c < b)"
  51.524  proof -
  51.525    assume less: "c<0"
  51.526    hence "(b/c < a) = (a*c < (b/c)*c)"
  51.527 @@ -1754,7 +1753,7 @@
  51.528    "(b/c < a) = 
  51.529     (if 0 < c then b < a*c
  51.530               else if c < 0 then a*c < b
  51.531 -             else 0 < (a::'a::{ordered_field,division_by_zero}))"
  51.532 +             else 0 < (a::'a::{linordered_field,division_by_zero}))"
  51.533  apply (cases "c=0", simp) 
  51.534  apply (force simp add: pos_divide_less_eq neg_divide_less_eq linorder_neq_iff) 
  51.535  done
  51.536 @@ -1784,7 +1783,7 @@
  51.537  
  51.538  (* Only works once linear arithmetic is installed:
  51.539  text{*An example:*}
  51.540 -lemma fixes a b c d e f :: "'a::ordered_field"
  51.541 +lemma fixes a b c d e f :: "'a::linordered_field"
  51.542  shows "\<lbrakk>a>b; c<d; e<f; 0 < u \<rbrakk> \<Longrightarrow>
  51.543   ((a-b)*(c-d)*(e-f))/((c-d)*(e-f)*(a-b)) <
  51.544   ((e-f)*(a-b)*(c-d))/((e-f)*(a-b)*(c-d)) + u"
  51.545 @@ -1800,21 +1799,21 @@
  51.546  subsection{*Division and Signs*}
  51.547  
  51.548  lemma zero_less_divide_iff:
  51.549 -     "((0::'a::{ordered_field,division_by_zero}) < a/b) = (0 < a & 0 < b | a < 0 & b < 0)"
  51.550 +     "((0::'a::{linordered_field,division_by_zero}) < a/b) = (0 < a & 0 < b | a < 0 & b < 0)"
  51.551  by (simp add: divide_inverse zero_less_mult_iff)
  51.552  
  51.553  lemma divide_less_0_iff:
  51.554 -     "(a/b < (0::'a::{ordered_field,division_by_zero})) = 
  51.555 +     "(a/b < (0::'a::{linordered_field,division_by_zero})) = 
  51.556        (0 < a & b < 0 | a < 0 & 0 < b)"
  51.557  by (simp add: divide_inverse mult_less_0_iff)
  51.558  
  51.559  lemma zero_le_divide_iff:
  51.560 -     "((0::'a::{ordered_field,division_by_zero}) \<le> a/b) =
  51.561 +     "((0::'a::{linordered_field,division_by_zero}) \<le> a/b) =
  51.562        (0 \<le> a & 0 \<le> b | a \<le> 0 & b \<le> 0)"
  51.563  by (simp add: divide_inverse zero_le_mult_iff)
  51.564  
  51.565  lemma divide_le_0_iff:
  51.566 -     "(a/b \<le> (0::'a::{ordered_field,division_by_zero})) =
  51.567 +     "(a/b \<le> (0::'a::{linordered_field,division_by_zero})) =
  51.568        (0 \<le> a & b \<le> 0 | a \<le> 0 & 0 \<le> b)"
  51.569  by (simp add: divide_inverse mult_le_0_iff)
  51.570  
  51.571 @@ -1823,36 +1822,36 @@
  51.572  by (simp add: divide_inverse)
  51.573  
  51.574  lemma divide_pos_pos:
  51.575 -  "0 < (x::'a::ordered_field) ==> 0 < y ==> 0 < x / y"
  51.576 +  "0 < (x::'a::linordered_field) ==> 0 < y ==> 0 < x / y"
  51.577  by(simp add:field_simps)
  51.578  
  51.579  
  51.580  lemma divide_nonneg_pos:
  51.581 -  "0 <= (x::'a::ordered_field) ==> 0 < y ==> 0 <= x / y"
  51.582 +  "0 <= (x::'a::linordered_field) ==> 0 < y ==> 0 <= x / y"
  51.583  by(simp add:field_simps)
  51.584  
  51.585  lemma divide_neg_pos:
  51.586 -  "(x::'a::ordered_field) < 0 ==> 0 < y ==> x / y < 0"
  51.587 +  "(x::'a::linordered_field) < 0 ==> 0 < y ==> x / y < 0"
  51.588  by(simp add:field_simps)
  51.589  
  51.590  lemma divide_nonpos_pos:
  51.591 -  "(x::'a::ordered_field) <= 0 ==> 0 < y ==> x / y <= 0"
  51.592 +  "(x::'a::linordered_field) <= 0 ==> 0 < y ==> x / y <= 0"
  51.593  by(simp add:field_simps)
  51.594  
  51.595  lemma divide_pos_neg:
  51.596 -  "0 < (x::'a::ordered_field) ==> y < 0 ==> x / y < 0"
  51.597 +  "0 < (x::'a::linordered_field) ==> y < 0 ==> x / y < 0"
  51.598  by(simp add:field_simps)
  51.599  
  51.600  lemma divide_nonneg_neg:
  51.601 -  "0 <= (x::'a::ordered_field) ==> y < 0 ==> x / y <= 0" 
  51.602 +  "0 <= (x::'a::linordered_field) ==> y < 0 ==> x / y <= 0" 
  51.603  by(simp add:field_simps)
  51.604  
  51.605  lemma divide_neg_neg:
  51.606 -  "(x::'a::ordered_field) < 0 ==> y < 0 ==> 0 < x / y"
  51.607 +  "(x::'a::linordered_field) < 0 ==> y < 0 ==> 0 < x / y"
  51.608  by(simp add:field_simps)
  51.609  
  51.610  lemma divide_nonpos_neg:
  51.611 -  "(x::'a::ordered_field) <= 0 ==> y < 0 ==> 0 <= x / y"
  51.612 +  "(x::'a::linordered_field) <= 0 ==> y < 0 ==> 0 <= x / y"
  51.613  by(simp add:field_simps)
  51.614  
  51.615  
  51.616 @@ -1885,13 +1884,13 @@
  51.617  by (simp add: eq_commute [of 1])
  51.618  
  51.619  lemma zero_eq_1_divide_iff [simp,noatp]:
  51.620 -     "((0::'a::{ordered_field,division_by_zero}) = 1/a) = (a = 0)"
  51.621 +     "((0::'a::{linordered_field,division_by_zero}) = 1/a) = (a = 0)"
  51.622  apply (cases "a=0", simp)
  51.623  apply (auto simp add: nonzero_eq_divide_eq)
  51.624  done
  51.625  
  51.626  lemma one_divide_eq_0_iff [simp,noatp]:
  51.627 -     "(1/a = (0::'a::{ordered_field,division_by_zero})) = (a = 0)"
  51.628 +     "(1/a = (0::'a::{linordered_field,division_by_zero})) = (a = 0)"
  51.629  apply (cases "a=0", simp)
  51.630  apply (insert zero_neq_one [THEN not_sym])
  51.631  apply (auto simp add: nonzero_divide_eq_eq)
  51.632 @@ -1912,22 +1911,22 @@
  51.633  subsection {* Ordering Rules for Division *}
  51.634  
  51.635  lemma divide_strict_right_mono:
  51.636 -     "[|a < b; 0 < c|] ==> a / c < b / (c::'a::ordered_field)"
  51.637 +     "[|a < b; 0 < c|] ==> a / c < b / (c::'a::linordered_field)"
  51.638  by (simp add: order_less_imp_not_eq2 divide_inverse mult_strict_right_mono 
  51.639                positive_imp_inverse_positive)
  51.640  
  51.641  lemma divide_right_mono:
  51.642 -     "[|a \<le> b; 0 \<le> c|] ==> a/c \<le> b/(c::'a::{ordered_field,division_by_zero})"
  51.643 +     "[|a \<le> b; 0 \<le> c|] ==> a/c \<le> b/(c::'a::{linordered_field,division_by_zero})"
  51.644  by (force simp add: divide_strict_right_mono order_le_less)
  51.645  
  51.646 -lemma divide_right_mono_neg: "(a::'a::{division_by_zero,ordered_field}) <= b 
  51.647 +lemma divide_right_mono_neg: "(a::'a::{division_by_zero,linordered_field}) <= b 
  51.648      ==> c <= 0 ==> b / c <= a / c"
  51.649  apply (drule divide_right_mono [of _ _ "- c"])
  51.650  apply auto
  51.651  done
  51.652  
  51.653  lemma divide_strict_right_mono_neg:
  51.654 -     "[|b < a; c < 0|] ==> a / c < b / (c::'a::ordered_field)"
  51.655 +     "[|b < a; c < 0|] ==> a / c < b / (c::'a::linordered_field)"
  51.656  apply (drule divide_strict_right_mono [of _ _ "-c"], simp)
  51.657  apply (simp add: order_less_imp_not_eq nonzero_minus_divide_right [symmetric])
  51.658  done
  51.659 @@ -1935,43 +1934,43 @@
  51.660  text{*The last premise ensures that @{term a} and @{term b} 
  51.661        have the same sign*}
  51.662  lemma divide_strict_left_mono:
  51.663 -  "[|b < a; 0 < c; 0 < a*b|] ==> c / a < c / (b::'a::ordered_field)"
  51.664 +  "[|b < a; 0 < c; 0 < a*b|] ==> c / a < c / (b::'a::linordered_field)"
  51.665  by(auto simp: field_simps times_divide_eq zero_less_mult_iff mult_strict_right_mono)
  51.666  
  51.667  lemma divide_left_mono:
  51.668 -  "[|b \<le> a; 0 \<le> c; 0 < a*b|] ==> c / a \<le> c / (b::'a::ordered_field)"
  51.669 +  "[|b \<le> a; 0 \<le> c; 0 < a*b|] ==> c / a \<le> c / (b::'a::linordered_field)"
  51.670  by(auto simp: field_simps times_divide_eq zero_less_mult_iff mult_right_mono)
  51.671  
  51.672 -lemma divide_left_mono_neg: "(a::'a::{division_by_zero,ordered_field}) <= b 
  51.673 +lemma divide_left_mono_neg: "(a::'a::{division_by_zero,linordered_field}) <= b 
  51.674      ==> c <= 0 ==> 0 < a * b ==> c / a <= c / b"
  51.675    apply (drule divide_left_mono [of _ _ "- c"])
  51.676    apply (auto simp add: mult_commute)
  51.677  done
  51.678  
  51.679  lemma divide_strict_left_mono_neg:
  51.680 -  "[|a < b; c < 0; 0 < a*b|] ==> c / a < c / (b::'a::ordered_field)"
  51.681 +  "[|a < b; c < 0; 0 < a*b|] ==> c / a < c / (b::'a::linordered_field)"
  51.682  by(auto simp: field_simps times_divide_eq zero_less_mult_iff mult_strict_right_mono_neg)
  51.683  
  51.684  
  51.685  text{*Simplify quotients that are compared with the value 1.*}
  51.686  
  51.687  lemma le_divide_eq_1 [noatp]:
  51.688 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.689 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.690    shows "(1 \<le> b / a) = ((0 < a & a \<le> b) | (a < 0 & b \<le> a))"
  51.691  by (auto simp add: le_divide_eq)
  51.692  
  51.693  lemma divide_le_eq_1 [noatp]:
  51.694 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.695 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.696    shows "(b / a \<le> 1) = ((0 < a & b \<le> a) | (a < 0 & a \<le> b) | a=0)"
  51.697  by (auto simp add: divide_le_eq)
  51.698  
  51.699  lemma less_divide_eq_1 [noatp]:
  51.700 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.701 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.702    shows "(1 < b / a) = ((0 < a & a < b) | (a < 0 & b < a))"
  51.703  by (auto simp add: less_divide_eq)
  51.704  
  51.705  lemma divide_less_eq_1 [noatp]:
  51.706 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.707 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.708    shows "(b / a < 1) = ((0 < a & b < a) | (a < 0 & a < b) | a=0)"
  51.709  by (auto simp add: divide_less_eq)
  51.710  
  51.711 @@ -1979,83 +1978,83 @@
  51.712  subsection{*Conditional Simplification Rules: No Case Splits*}
  51.713  
  51.714  lemma le_divide_eq_1_pos [simp,noatp]:
  51.715 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.716 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.717    shows "0 < a \<Longrightarrow> (1 \<le> b/a) = (a \<le> b)"
  51.718  by (auto simp add: le_divide_eq)
  51.719  
  51.720  lemma le_divide_eq_1_neg [simp,noatp]:
  51.721 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.722 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.723    shows "a < 0 \<Longrightarrow> (1 \<le> b/a) = (b \<le> a)"
  51.724  by (auto simp add: le_divide_eq)
  51.725  
  51.726  lemma divide_le_eq_1_pos [simp,noatp]:
  51.727 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.728 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.729    shows "0 < a \<Longrightarrow> (b/a \<le> 1) = (b \<le> a)"
  51.730  by (auto simp add: divide_le_eq)
  51.731  
  51.732  lemma divide_le_eq_1_neg [simp,noatp]:
  51.733 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.734 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.735    shows "a < 0 \<Longrightarrow> (b/a \<le> 1) = (a \<le> b)"
  51.736  by (auto simp add: divide_le_eq)
  51.737  
  51.738  lemma less_divide_eq_1_pos [simp,noatp]:
  51.739 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.740 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.741    shows "0 < a \<Longrightarrow> (1 < b/a) = (a < b)"
  51.742  by (auto simp add: less_divide_eq)
  51.743  
  51.744  lemma less_divide_eq_1_neg [simp,noatp]:
  51.745 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.746 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.747    shows "a < 0 \<Longrightarrow> (1 < b/a) = (b < a)"
  51.748  by (auto simp add: less_divide_eq)
  51.749  
  51.750  lemma divide_less_eq_1_pos [simp,noatp]:
  51.751 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.752 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.753    shows "0 < a \<Longrightarrow> (b/a < 1) = (b < a)"
  51.754  by (auto simp add: divide_less_eq)
  51.755  
  51.756  lemma divide_less_eq_1_neg [simp,noatp]:
  51.757 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.758 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.759    shows "a < 0 \<Longrightarrow> b/a < 1 <-> a < b"
  51.760  by (auto simp add: divide_less_eq)
  51.761  
  51.762  lemma eq_divide_eq_1 [simp,noatp]:
  51.763 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.764 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.765    shows "(1 = b/a) = ((a \<noteq> 0 & a = b))"
  51.766  by (auto simp add: eq_divide_eq)
  51.767  
  51.768  lemma divide_eq_eq_1 [simp,noatp]:
  51.769 -  fixes a :: "'a :: {ordered_field,division_by_zero}"
  51.770 +  fixes a :: "'a :: {linordered_field,division_by_zero}"
  51.771    shows "(b/a = 1) = ((a \<noteq> 0 & a = b))"
  51.772  by (auto simp add: divide_eq_eq)
  51.773  
  51.774  
  51.775  subsection {* Reasoning about inequalities with division *}
  51.776  
  51.777 -lemma mult_right_le_one_le: "0 <= (x::'a::ordered_idom) ==> 0 <= y ==> y <= 1
  51.778 +lemma mult_right_le_one_le: "0 <= (x::'a::linordered_idom) ==> 0 <= y ==> y <= 1
  51.779      ==> x * y <= x"
  51.780  by (auto simp add: mult_compare_simps)
  51.781  
  51.782 -lemma mult_left_le_one_le: "0 <= (x::'a::ordered_idom) ==> 0 <= y ==> y <= 1
  51.783 +lemma mult_left_le_one_le: "0 <= (x::'a::linordered_idom) ==> 0 <= y ==> y <= 1
  51.784      ==> y * x <= x"
  51.785  by (auto simp add: mult_compare_simps)
  51.786  
  51.787 -lemma mult_imp_div_pos_le: "0 < (y::'a::ordered_field) ==> x <= z * y ==>
  51.788 +lemma mult_imp_div_pos_le: "0 < (y::'a::linordered_field) ==> x <= z * y ==>
  51.789      x / y <= z"
  51.790  by (subst pos_divide_le_eq, assumption+)
  51.791  
  51.792 -lemma mult_imp_le_div_pos: "0 < (y::'a::ordered_field) ==> z * y <= x ==>
  51.793 +lemma mult_imp_le_div_pos: "0 < (y::'a::linordered_field) ==> z * y <= x ==>
  51.794      z <= x / y"
  51.795  by(simp add:field_simps)
  51.796  
  51.797 -lemma mult_imp_div_pos_less: "0 < (y::'a::ordered_field) ==> x < z * y ==>
  51.798 +lemma mult_imp_div_pos_less: "0 < (y::'a::linordered_field) ==> x < z * y ==>
  51.799      x / y < z"
  51.800  by(simp add:field_simps)
  51.801  
  51.802 -lemma mult_imp_less_div_pos: "0 < (y::'a::ordered_field) ==> z * y < x ==>
  51.803 +lemma mult_imp_less_div_pos: "0 < (y::'a::linordered_field) ==> z * y < x ==>
  51.804      z < x / y"
  51.805  by(simp add:field_simps)
  51.806  
  51.807 -lemma frac_le: "(0::'a::ordered_field) <= x ==> 
  51.808 +lemma frac_le: "(0::'a::linordered_field) <= x ==> 
  51.809      x <= y ==> 0 < w ==> w <= z  ==> x / z <= y / w"
  51.810    apply (rule mult_imp_div_pos_le)
  51.811    apply simp
  51.812 @@ -2065,7 +2064,7 @@
  51.813    apply simp_all
  51.814  done
  51.815  
  51.816 -lemma frac_less: "(0::'a::ordered_field) <= x ==> 
  51.817 +lemma frac_less: "(0::'a::linordered_field) <= x ==> 
  51.818      x < y ==> 0 < w ==> w <= z  ==> x / z < y / w"
  51.819    apply (rule mult_imp_div_pos_less)
  51.820    apply simp
  51.821 @@ -2075,7 +2074,7 @@
  51.822    apply simp_all
  51.823  done
  51.824  
  51.825 -lemma frac_less2: "(0::'a::ordered_field) < x ==> 
  51.826 +lemma frac_less2: "(0::'a::linordered_field) < x ==> 
  51.827      x <= y ==> 0 < w ==> w < z  ==> x / z < y / w"
  51.828    apply (rule mult_imp_div_pos_less)
  51.829    apply simp_all
  51.830 @@ -2095,7 +2094,7 @@
  51.831  
  51.832  subsection {* Ordered Fields are Dense *}
  51.833  
  51.834 -context ordered_semidom
  51.835 +context linordered_semidom
  51.836  begin
  51.837  
  51.838  lemma less_add_one: "a < a + 1"
  51.839 @@ -2110,13 +2109,13 @@
  51.840  
  51.841  end
  51.842  
  51.843 -lemma less_half_sum: "a < b ==> a < (a+b) / (1+1::'a::ordered_field)"
  51.844 +lemma less_half_sum: "a < b ==> a < (a+b) / (1+1::'a::linordered_field)"
  51.845  by (simp add: field_simps zero_less_two)
  51.846  
  51.847 -lemma gt_half_sum: "a < b ==> (a+b)/(1+1::'a::ordered_field) < b"
  51.848 +lemma gt_half_sum: "a < b ==> (a+b)/(1+1::'a::linordered_field) < b"
  51.849  by (simp add: field_simps zero_less_two)
  51.850  
  51.851 -instance ordered_field < dense_linear_order
  51.852 +instance linordered_field < dense_linorder
  51.853  proof
  51.854    fix x y :: 'a
  51.855    have "x < x + 1" by simp
  51.856 @@ -2129,7 +2128,7 @@
  51.857  
  51.858  subsection {* Absolute Value *}
  51.859  
  51.860 -context ordered_idom
  51.861 +context linordered_idom
  51.862  begin
  51.863  
  51.864  lemma mult_sgn_abs: "sgn x * abs x = x"
  51.865 @@ -2137,23 +2136,23 @@
  51.866  
  51.867  end
  51.868  
  51.869 -lemma abs_one [simp]: "abs 1 = (1::'a::ordered_idom)"
  51.870 +lemma abs_one [simp]: "abs 1 = (1::'a::linordered_idom)"
  51.871  by (simp add: abs_if zero_less_one [THEN order_less_not_sym])
  51.872  
  51.873 -class pordered_ring_abs = pordered_ring + pordered_ab_group_add_abs +
  51.874 +class ordered_ring_abs = ordered_ring + ordered_ab_group_add_abs +
  51.875    assumes abs_eq_mult:
  51.876      "(0 \<le> a \<or> a \<le> 0) \<and> (0 \<le> b \<or> b \<le> 0) \<Longrightarrow> \<bar>a * b\<bar> = \<bar>a\<bar> * \<bar>b\<bar>"
  51.877  
  51.878  
  51.879 -class lordered_ring = pordered_ring + lordered_ab_group_add_abs
  51.880 +class lattice_ring = ordered_ring + lattice_ab_group_add_abs
  51.881  begin
  51.882  
  51.883 -subclass lordered_ab_group_add_meet ..
  51.884 -subclass lordered_ab_group_add_join ..
  51.885 +subclass semilattice_inf_ab_group_add ..
  51.886 +subclass semilattice_sup_ab_group_add ..
  51.887  
  51.888  end
  51.889  
  51.890 -lemma abs_le_mult: "abs (a * b) \<le> (abs a) * (abs (b::'a::lordered_ring))" 
  51.891 +lemma abs_le_mult: "abs (a * b) \<le> (abs a) * (abs (b::'a::lattice_ring))" 
  51.892  proof -
  51.893    let ?x = "pprt a * pprt b - pprt a * nprt b - nprt a * pprt b + nprt a * nprt b"
  51.894    let ?y = "pprt a * pprt b + pprt a * nprt b + nprt a * pprt b + nprt a * nprt b"
  51.895 @@ -2194,9 +2193,9 @@
  51.896      done
  51.897  qed
  51.898  
  51.899 -instance lordered_ring \<subseteq> pordered_ring_abs
  51.900 +instance lattice_ring \<subseteq> ordered_ring_abs
  51.901  proof
  51.902 -  fix a b :: "'a\<Colon> lordered_ring"
  51.903 +  fix a b :: "'a\<Colon> lattice_ring"
  51.904    assume "(0 \<le> a \<or> a \<le> 0) \<and> (0 \<le> b \<or> b \<le> 0)"
  51.905    show "abs (a*b) = abs a * abs b"
  51.906  proof -
  51.907 @@ -2238,10 +2237,10 @@
  51.908  qed
  51.909  qed
  51.910  
  51.911 -context ordered_idom
  51.912 +context linordered_idom
  51.913  begin
  51.914  
  51.915 -subclass pordered_ring_abs proof
  51.916 +subclass ordered_ring_abs proof
  51.917  qed (auto simp add: abs_if not_less equal_neg_zero neg_equal_zero mult_less_0_iff)
  51.918  
  51.919  lemma abs_mult:
  51.920 @@ -2255,31 +2254,31 @@
  51.921  end
  51.922  
  51.923  lemma nonzero_abs_inverse:
  51.924 -     "a \<noteq> 0 ==> abs (inverse (a::'a::ordered_field)) = inverse (abs a)"
  51.925 +     "a \<noteq> 0 ==> abs (inverse (a::'a::linordered_field)) = inverse (abs a)"
  51.926  apply (auto simp add: linorder_neq_iff abs_if nonzero_inverse_minus_eq 
  51.927                        negative_imp_inverse_negative)
  51.928  apply (blast intro: positive_imp_inverse_positive elim: order_less_asym) 
  51.929  done
  51.930  
  51.931  lemma abs_inverse [simp]:
  51.932 -     "abs (inverse (a::'a::{ordered_field,division_by_zero})) = 
  51.933 +     "abs (inverse (a::'a::{linordered_field,division_by_zero})) = 
  51.934        inverse (abs a)"
  51.935  apply (cases "a=0", simp) 
  51.936  apply (simp add: nonzero_abs_inverse) 
  51.937  done
  51.938  
  51.939  lemma nonzero_abs_divide:
  51.940 -     "b \<noteq> 0 ==> abs (a / (b::'a::ordered_field)) = abs a / abs b"
  51.941 +     "b \<noteq> 0 ==> abs (a / (b::'a::linordered_field)) = abs a / abs b"
  51.942  by (simp add: divide_inverse abs_mult nonzero_abs_inverse) 
  51.943  
  51.944  lemma abs_divide [simp]:
  51.945 -     "abs (a / (b::'a::{ordered_field,division_by_zero})) = abs a / abs b"
  51.946 +     "abs (a / (b::'a::{linordered_field,division_by_zero})) = abs a / abs b"
  51.947  apply (cases "b=0", simp) 
  51.948  apply (simp add: nonzero_abs_divide) 
  51.949  done
  51.950  
  51.951  lemma abs_mult_less:
  51.952 -     "[| abs a < c; abs b < d |] ==> abs a * abs b < c*(d::'a::ordered_idom)"
  51.953 +     "[| abs a < c; abs b < d |] ==> abs a * abs b < c*(d::'a::linordered_idom)"
  51.954  proof -
  51.955    assume ac: "abs a < c"
  51.956    hence cpos: "0<c" by (blast intro: order_le_less_trans abs_ge_zero)
  51.957 @@ -2289,21 +2288,21 @@
  51.958  
  51.959  lemmas eq_minus_self_iff[noatp] = equal_neg_zero
  51.960  
  51.961 -lemma less_minus_self_iff: "(a < -a) = (a < (0::'a::ordered_idom))"
  51.962 +lemma less_minus_self_iff: "(a < -a) = (a < (0::'a::linordered_idom))"
  51.963    unfolding order_less_le less_eq_neg_nonpos equal_neg_zero ..
  51.964  
  51.965 -lemma abs_less_iff: "(abs a < b) = (a < b & -a < (b::'a::ordered_idom))" 
  51.966 +lemma abs_less_iff: "(abs a < b) = (a < b & -a < (b::'a::linordered_idom))" 
  51.967  apply (simp add: order_less_le abs_le_iff)  
  51.968  apply (auto simp add: abs_if neg_less_eq_nonneg less_eq_neg_nonpos)
  51.969  done
  51.970  
  51.971 -lemma abs_mult_pos: "(0::'a::ordered_idom) <= x ==> 
  51.972 +lemma abs_mult_pos: "(0::'a::linordered_idom) <= x ==> 
  51.973      (abs y) * x = abs (y * x)"
  51.974    apply (subst abs_mult)
  51.975    apply simp
  51.976  done
  51.977  
  51.978 -lemma abs_div_pos: "(0::'a::{division_by_zero,ordered_field}) < y ==> 
  51.979 +lemma abs_div_pos: "(0::'a::{division_by_zero,linordered_field}) < y ==> 
  51.980      abs x / y = abs (x / y)"
  51.981    apply (subst abs_divide)
  51.982    apply (simp add: order_less_imp_le)
  51.983 @@ -2314,7 +2313,7 @@
  51.984  
  51.985  lemma mult_le_prts:
  51.986    assumes
  51.987 -  "a1 <= (a::'a::lordered_ring)"
  51.988 +  "a1 <= (a::'a::lattice_ring)"
  51.989    "a <= a2"
  51.990    "b1 <= b"
  51.991    "b <= b2"
  51.992 @@ -2362,7 +2361,7 @@
  51.993  
  51.994  lemma mult_ge_prts:
  51.995    assumes
  51.996 -  "a1 <= (a::'a::lordered_ring)"
  51.997 +  "a1 <= (a::'a::lattice_ring)"
  51.998    "a <= a2"
  51.999    "b1 <= b"
 51.1000    "b <= b2"
    52.1 --- a/src/HOL/Series.thy	Fri Feb 05 14:33:31 2010 +0100
    52.2 +++ b/src/HOL/Series.thy	Fri Feb 05 14:33:50 2010 +0100
    52.3 @@ -381,7 +381,7 @@
    52.4    shows "norm x < 1 \<Longrightarrow> summable (\<lambda>n. x ^ n)"
    52.5  by (rule geometric_sums [THEN sums_summable])
    52.6  
    52.7 -lemma half: "0 < 1 / (2::'a::{number_ring,division_by_zero,ordered_field})"
    52.8 +lemma half: "0 < 1 / (2::'a::{number_ring,division_by_zero,linordered_field})"
    52.9    by arith 
   52.10  
   52.11  lemma power_half_series: "(\<lambda>n. (1/2::real)^Suc n) sums 1"
    53.1 --- a/src/HOL/SupInf.thy	Fri Feb 05 14:33:31 2010 +0100
    53.2 +++ b/src/HOL/SupInf.thy	Fri Feb 05 14:33:50 2010 +0100
    53.3 @@ -7,17 +7,17 @@
    53.4  begin
    53.5  
    53.6  lemma minus_max_eq_min:
    53.7 -  fixes x :: "'a::{lordered_ab_group_add, linorder}"
    53.8 +  fixes x :: "'a::{lattice_ab_group_add, linorder}"
    53.9    shows "- (max x y) = min (-x) (-y)"
   53.10  by (metis le_imp_neg_le linorder_linear min_max.inf_absorb2 min_max.le_iff_inf min_max.le_iff_sup min_max.sup_absorb1)
   53.11  
   53.12  lemma minus_min_eq_max:
   53.13 -  fixes x :: "'a::{lordered_ab_group_add, linorder}"
   53.14 +  fixes x :: "'a::{lattice_ab_group_add, linorder}"
   53.15    shows "- (min x y) = max (-x) (-y)"
   53.16  by (metis minus_max_eq_min minus_minus)
   53.17  
   53.18  lemma minus_Max_eq_Min [simp]:
   53.19 -  fixes S :: "'a::{lordered_ab_group_add, linorder} set"
   53.20 +  fixes S :: "'a::{lattice_ab_group_add, linorder} set"
   53.21    shows "finite S \<Longrightarrow> S \<noteq> {} \<Longrightarrow> - (Max S) = Min (uminus ` S)"
   53.22  proof (induct S rule: finite_ne_induct)
   53.23    case (singleton x)
   53.24 @@ -28,7 +28,7 @@
   53.25  qed
   53.26  
   53.27  lemma minus_Min_eq_Max [simp]:
   53.28 -  fixes S :: "'a::{lordered_ab_group_add, linorder} set"
   53.29 +  fixes S :: "'a::{lattice_ab_group_add, linorder} set"
   53.30    shows "finite S \<Longrightarrow> S \<noteq> {} \<Longrightarrow> - (Min S) = Max (uminus ` S)"
   53.31  proof (induct S rule: finite_ne_induct)
   53.32    case (singleton x)
    54.1 --- a/src/HOL/Tools/Nitpick/minipick.ML	Fri Feb 05 14:33:31 2010 +0100
    54.2 +++ b/src/HOL/Tools/Nitpick/minipick.ML	Fri Feb 05 14:33:50 2010 +0100
    54.3 @@ -200,19 +200,19 @@
    54.4           else
    54.5             raise NOT_SUPPORTED "transitive closure for function or pair type"
    54.6         | Const (@{const_name trancl}, _) => to_R_rep Ts (eta_expand Ts t 1)
    54.7 -       | Const (@{const_name lower_semilattice_class.inf},
    54.8 +       | Const (@{const_name semilattice_inf_class.inf},
    54.9                  Type ("fun", [Type ("fun", [_, @{typ bool}]), _])) $ t1 $ t2 =>
   54.10           Intersect (to_R_rep Ts t1, to_R_rep Ts t2)
   54.11 -       | Const (@{const_name lower_semilattice_class.inf}, _) $ _ =>
   54.12 +       | Const (@{const_name semilattice_inf_class.inf}, _) $ _ =>
   54.13           to_R_rep Ts (eta_expand Ts t 1)
   54.14 -       | Const (@{const_name lower_semilattice_class.inf}, _) =>
   54.15 +       | Const (@{const_name semilattice_inf_class.inf}, _) =>
   54.16           to_R_rep Ts (eta_expand Ts t 2)
   54.17 -       | Const (@{const_name upper_semilattice_class.sup},
   54.18 +       | Const (@{const_name semilattice_sup_class.sup},
   54.19                  Type ("fun", [Type ("fun", [_, @{typ bool}]), _])) $ t1 $ t2 =>
   54.20           Union (to_R_rep Ts t1, to_R_rep Ts t2)
   54.21 -       | Const (@{const_name upper_semilattice_class.sup}, _) $ _ =>
   54.22 +       | Const (@{const_name semilattice_sup_class.sup}, _) $ _ =>
   54.23           to_R_rep Ts (eta_expand Ts t 1)
   54.24 -       | Const (@{const_name upper_semilattice_class.sup}, _) =>
   54.25 +       | Const (@{const_name semilattice_sup_class.sup}, _) =>
   54.26           to_R_rep Ts (eta_expand Ts t 2)
   54.27         | Const (@{const_name minus_class.minus},
   54.28                  Type ("fun", [Type ("fun", [_, @{typ bool}]), _])) $ t1 $ t2 =>
    55.1 --- a/src/HOL/Tools/Nitpick/nitpick_hol.ML	Fri Feb 05 14:33:31 2010 +0100
    55.2 +++ b/src/HOL/Tools/Nitpick/nitpick_hol.ML	Fri Feb 05 14:33:50 2010 +0100
    55.3 @@ -343,8 +343,8 @@
    55.4    [((@{const_name of_nat}, nat_T --> int_T), 0),
    55.5     ((@{const_name of_nat}, @{typ "unsigned_bit word => signed_bit word"}), 0)]
    55.6  val built_in_set_consts =
    55.7 -  [(@{const_name lower_semilattice_fun_inst.inf_fun}, 2),
    55.8 -   (@{const_name upper_semilattice_fun_inst.sup_fun}, 2),
    55.9 +  [(@{const_name semilattice_inf_fun_inst.inf_fun}, 2),
   55.10 +   (@{const_name semilattice_sup_fun_inst.sup_fun}, 2),
   55.11     (@{const_name minus_fun_inst.minus_fun}, 2),
   55.12     (@{const_name ord_fun_inst.less_eq_fun}, 2)]
   55.13  
   55.14 @@ -2592,11 +2592,11 @@
   55.15                  if gfp then
   55.16                    (lbfp_prefix,
   55.17                     @{const "op |"},
   55.18 -                   @{const_name upper_semilattice_fun_inst.sup_fun})
   55.19 +                   @{const_name semilattice_sup_fun_inst.sup_fun})
   55.20                  else
   55.21                    (ubfp_prefix,
   55.22                     @{const "op &"},
   55.23 -                   @{const_name lower_semilattice_fun_inst.inf_fun})
   55.24 +                   @{const_name semilattice_inf_fun_inst.inf_fun})
   55.25                (* unit -> term *)
   55.26                fun pos () = unrolled_inductive_pred_const ext_ctxt gfp x
   55.27                             |> aux ss Ts js depth polar
    56.1 --- a/src/HOL/Tools/Nitpick/nitpick_mono.ML	Fri Feb 05 14:33:31 2010 +0100
    56.2 +++ b/src/HOL/Tools/Nitpick/nitpick_mono.ML	Fri Feb 05 14:33:50 2010 +0100
    56.3 @@ -667,9 +667,9 @@
    56.4                  in (CFun (ab_set_C, S Minus, ba_set_C), accum) end
    56.5                | @{const_name trancl} => do_fragile_set_operation T accum
    56.6                | @{const_name rtrancl} => (print_g "*** rtrancl"; unsolvable)
    56.7 -              | @{const_name lower_semilattice_fun_inst.inf_fun} =>
    56.8 +              | @{const_name semilattice_inf_fun_inst.inf_fun} =>
    56.9                  do_robust_set_operation T accum
   56.10 -              | @{const_name upper_semilattice_fun_inst.sup_fun} =>
   56.11 +              | @{const_name semilattice_sup_fun_inst.sup_fun} =>
   56.12                  do_robust_set_operation T accum
   56.13                | @{const_name finite} =>
   56.14                  let val C1 = ctype_for (domain_type (domain_type T)) in
    57.1 --- a/src/HOL/Tools/Nitpick/nitpick_nut.ML	Fri Feb 05 14:33:31 2010 +0100
    57.2 +++ b/src/HOL/Tools/Nitpick/nitpick_nut.ML	Fri Feb 05 14:33:50 2010 +0100
    57.3 @@ -655,10 +655,10 @@
    57.4          | (Const (@{const_name of_nat},
    57.5                    T as @{typ "unsigned_bit word => signed_bit word"}), []) =>
    57.6            Cst (NatToInt, T, Any)
    57.7 -        | (Const (@{const_name lower_semilattice_fun_inst.inf_fun}, T),
    57.8 +        | (Const (@{const_name semilattice_inf_fun_inst.inf_fun}, T),
    57.9                    [t1, t2]) =>
   57.10            Op2 (Intersect, nth_range_type 2 T, Any, sub t1, sub t2)
   57.11 -        | (Const (@{const_name upper_semilattice_fun_inst.sup_fun}, T),
   57.12 +        | (Const (@{const_name semilattice_sup_fun_inst.sup_fun}, T),
   57.13                    [t1, t2]) =>
   57.14            Op2 (Union, nth_range_type 2 T, Any, sub t1, sub t2)
   57.15          | (t0 as Const (@{const_name minus_fun_inst.minus_fun}, T), [t1, t2]) =>
    58.1 --- a/src/HOL/Tools/int_arith.ML	Fri Feb 05 14:33:31 2010 +0100
    58.2 +++ b/src/HOL/Tools/int_arith.ML	Fri Feb 05 14:33:50 2010 +0100
    58.3 @@ -71,8 +71,8 @@
    58.4  
    58.5  val lhss' =
    58.6    [@{cpat "(?x::?'a::ring_char_0) = (?y::?'a)"},
    58.7 -   @{cpat "(?x::?'a::ordered_idom) < (?y::?'a)"},
    58.8 -   @{cpat "(?x::?'a::ordered_idom) <= (?y::?'a)"}]
    58.9 +   @{cpat "(?x::?'a::linordered_idom) < (?y::?'a)"},
   58.10 +   @{cpat "(?x::?'a::linordered_idom) <= (?y::?'a)"}]
   58.11  
   58.12  val zero_one_idom_simproc =
   58.13    make_simproc {lhss = lhss' , name = "zero_one_idom_simproc",
   58.14 @@ -80,9 +80,9 @@
   58.15  
   58.16  val fast_int_arith_simproc =
   58.17    Simplifier.simproc @{theory} "fast_int_arith"
   58.18 -     ["(m::'a::{ordered_idom,number_ring}) < n",
   58.19 -      "(m::'a::{ordered_idom,number_ring}) <= n",
   58.20 -      "(m::'a::{ordered_idom,number_ring}) = n"] (K Lin_Arith.simproc);
   58.21 +     ["(m::'a::{linordered_idom,number_ring}) < n",
   58.22 +      "(m::'a::{linordered_idom,number_ring}) <= n",
   58.23 +      "(m::'a::{linordered_idom,number_ring}) = n"] (K Lin_Arith.simproc);
   58.24  
   58.25  val global_setup = Simplifier.map_simpset
   58.26    (fn simpset => simpset addsimprocs [fast_int_arith_simproc]);
    59.1 --- a/src/HOL/Tools/lin_arith.ML	Fri Feb 05 14:33:31 2010 +0100
    59.2 +++ b/src/HOL/Tools/lin_arith.ML	Fri Feb 05 14:33:50 2010 +0100
    59.3 @@ -236,7 +236,7 @@
    59.4  end handle Rat.DIVZERO => NONE;
    59.5  
    59.6  fun of_lin_arith_sort thy U =
    59.7 -  Sign.of_sort thy (U, @{sort Ring_and_Field.ordered_idom});
    59.8 +  Sign.of_sort thy (U, @{sort Ring_and_Field.linordered_idom});
    59.9  
   59.10  fun allows_lin_arith thy (discrete : string list) (U as Type (D, [])) : bool * bool =
   59.11        if of_lin_arith_sort thy U then (true, member (op =) discrete D)
   59.12 @@ -804,12 +804,12 @@
   59.13  
   59.14  val init_arith_data =
   59.15    Fast_Arith.map_data (fn {add_mono_thms, mult_mono_thms, inj_thms, lessD, number_of, ...} =>
   59.16 -   {add_mono_thms = @{thms add_mono_thms_ordered_semiring} @ @{thms add_mono_thms_ordered_field} @ add_mono_thms,
   59.17 +   {add_mono_thms = @{thms add_mono_thms_linordered_semiring} @ @{thms add_mono_thms_linordered_field} @ add_mono_thms,
   59.18      mult_mono_thms = @{thm mult_strict_left_mono} :: @{thm mult_left_mono} ::
   59.19        @{lemma "a = b ==> c*a = c*b" by (rule arg_cong)} :: mult_mono_thms,
   59.20      inj_thms = inj_thms,
   59.21      lessD = lessD @ [@{thm "Suc_leI"}],
   59.22 -    neqE = [@{thm linorder_neqE_nat}, @{thm linorder_neqE_ordered_idom}],
   59.23 +    neqE = [@{thm linorder_neqE_nat}, @{thm linorder_neqE_linordered_idom}],
   59.24      simpset = HOL_basic_ss
   59.25        addsimps @{thms ring_distribs}
   59.26        addsimps [@{thm if_True}, @{thm if_False}]
    60.1 --- a/src/HOL/Tools/numeral_simprocs.ML	Fri Feb 05 14:33:31 2010 +0100
    60.2 +++ b/src/HOL/Tools/numeral_simprocs.ML	Fri Feb 05 14:33:50 2010 +0100
    60.3 @@ -256,20 +256,20 @@
    60.4        "(l::'a::number_ring) = m * n"],
    60.5       K EqCancelNumerals.proc),
    60.6      ("intless_cancel_numerals",
    60.7 -     ["(l::'a::{ordered_idom,number_ring}) + m < n",
    60.8 -      "(l::'a::{ordered_idom,number_ring}) < m + n",
    60.9 -      "(l::'a::{ordered_idom,number_ring}) - m < n",
   60.10 -      "(l::'a::{ordered_idom,number_ring}) < m - n",
   60.11 -      "(l::'a::{ordered_idom,number_ring}) * m < n",
   60.12 -      "(l::'a::{ordered_idom,number_ring}) < m * n"],
   60.13 +     ["(l::'a::{linordered_idom,number_ring}) + m < n",
   60.14 +      "(l::'a::{linordered_idom,number_ring}) < m + n",
   60.15 +      "(l::'a::{linordered_idom,number_ring}) - m < n",
   60.16 +      "(l::'a::{linordered_idom,number_ring}) < m - n",
   60.17 +      "(l::'a::{linordered_idom,number_ring}) * m < n",
   60.18 +      "(l::'a::{linordered_idom,number_ring}) < m * n"],
   60.19       K LessCancelNumerals.proc),
   60.20      ("intle_cancel_numerals",
   60.21 -     ["(l::'a::{ordered_idom,number_ring}) + m <= n",
   60.22 -      "(l::'a::{ordered_idom,number_ring}) <= m + n",
   60.23 -      "(l::'a::{ordered_idom,number_ring}) - m <= n",
   60.24 -      "(l::'a::{ordered_idom,number_ring}) <= m - n",
   60.25 -      "(l::'a::{ordered_idom,number_ring}) * m <= n",
   60.26 -      "(l::'a::{ordered_idom,number_ring}) <= m * n"],
   60.27 +     ["(l::'a::{linordered_idom,number_ring}) + m <= n",
   60.28 +      "(l::'a::{linordered_idom,number_ring}) <= m + n",
   60.29 +      "(l::'a::{linordered_idom,number_ring}) - m <= n",
   60.30 +      "(l::'a::{linordered_idom,number_ring}) <= m - n",
   60.31 +      "(l::'a::{linordered_idom,number_ring}) * m <= n",
   60.32 +      "(l::'a::{linordered_idom,number_ring}) <= m * n"],
   60.33       K LeCancelNumerals.proc)];
   60.34  
   60.35  structure CombineNumeralsData =
   60.36 @@ -432,12 +432,12 @@
   60.37        "(l::'a::{idom,number_ring}) = m * n"],
   60.38       K EqCancelNumeralFactor.proc),
   60.39      ("ring_less_cancel_numeral_factor",
   60.40 -     ["(l::'a::{ordered_idom,number_ring}) * m < n",
   60.41 -      "(l::'a::{ordered_idom,number_ring}) < m * n"],
   60.42 +     ["(l::'a::{linordered_idom,number_ring}) * m < n",
   60.43 +      "(l::'a::{linordered_idom,number_ring}) < m * n"],
   60.44       K LessCancelNumeralFactor.proc),
   60.45      ("ring_le_cancel_numeral_factor",
   60.46 -     ["(l::'a::{ordered_idom,number_ring}) * m <= n",
   60.47 -      "(l::'a::{ordered_idom,number_ring}) <= m * n"],
   60.48 +     ["(l::'a::{linordered_idom,number_ring}) * m <= n",
   60.49 +      "(l::'a::{linordered_idom,number_ring}) <= m * n"],
   60.50       K LeCancelNumeralFactor.proc),
   60.51      ("int_div_cancel_numeral_factors",
   60.52       ["((l::'a::{semiring_div,number_ring}) * m) div n",
   60.53 @@ -582,13 +582,13 @@
   60.54       ["(l::'a::idom) * m = n",
   60.55        "(l::'a::idom) = m * n"],
   60.56       K EqCancelFactor.proc),
   60.57 -    ("ordered_ring_le_cancel_factor",
   60.58 -     ["(l::'a::ordered_ring) * m <= n",
   60.59 -      "(l::'a::ordered_ring) <= m * n"],
   60.60 +    ("linlinordered_ring_le_cancel_factor",
   60.61 +     ["(l::'a::linordered_ring) * m <= n",
   60.62 +      "(l::'a::linordered_ring) <= m * n"],
   60.63       K LeCancelFactor.proc),
   60.64 -    ("ordered_ring_less_cancel_factor",
   60.65 -     ["(l::'a::ordered_ring) * m < n",
   60.66 -      "(l::'a::ordered_ring) < m * n"],
   60.67 +    ("linlinordered_ring_less_cancel_factor",
   60.68 +     ["(l::'a::linordered_ring) * m < n",
   60.69 +      "(l::'a::linordered_ring) < m * n"],
   60.70       K LessCancelFactor.proc),
   60.71      ("int_div_cancel_factor",
   60.72       ["((l::'a::semiring_div) * m) div n", "(l::'a::semiring_div) div (m * n)"],
    61.1 --- a/src/HOL/Transcendental.thy	Fri Feb 05 14:33:31 2010 +0100
    61.2 +++ b/src/HOL/Transcendental.thy	Fri Feb 05 14:33:50 2010 +0100
    61.3 @@ -381,7 +381,7 @@
    61.4  done
    61.5  
    61.6  lemma real_setsum_nat_ivl_bounded2:
    61.7 -  fixes K :: "'a::ordered_semidom"
    61.8 +  fixes K :: "'a::linordered_semidom"
    61.9    assumes f: "\<And>p::nat. p < n \<Longrightarrow> f p \<le> K"
   61.10    assumes K: "0 \<le> K"
   61.11    shows "setsum f {0..<n-k} \<le> of_nat n * K"
    62.1 --- a/src/HOL/ZF/Games.thy	Fri Feb 05 14:33:31 2010 +0100
    62.2 +++ b/src/HOL/ZF/Games.thy	Fri Feb 05 14:33:50 2010 +0100
    62.3 @@ -922,7 +922,7 @@
    62.4    apply (auto simp add: Pg_def quotient_def)
    62.5    done
    62.6  
    62.7 -instance Pg :: pordered_ab_group_add 
    62.8 +instance Pg :: ordered_ab_group_add 
    62.9  proof
   62.10    fix a b c :: Pg
   62.11    show "a - b = a + (- b)" by (simp add: Pg_diff_def)
    63.1 --- a/src/HOL/ex/Numeral.thy	Fri Feb 05 14:33:31 2010 +0100
    63.2 +++ b/src/HOL/ex/Numeral.thy	Fri Feb 05 14:33:50 2010 +0100
    63.3 @@ -442,12 +442,12 @@
    63.4  end
    63.5  
    63.6  subsubsection {*
    63.7 -  Comparisons: class @{text ordered_semidom}
    63.8 +  Comparisons: class @{text linordered_semidom}
    63.9  *}
   63.10  
   63.11  text {*  Could be perhaps more general than here. *}
   63.12  
   63.13 -context ordered_semidom
   63.14 +context linordered_semidom
   63.15  begin
   63.16  
   63.17  lemma of_num_pos [numeral]: "0 < of_num n"
   63.18 @@ -490,7 +490,7 @@
   63.19  
   63.20  end
   63.21  
   63.22 -context ordered_idom
   63.23 +context linordered_idom
   63.24  begin
   63.25  
   63.26  lemma minus_of_num_less_of_num_iff: "- of_num m < of_num n"
   63.27 @@ -896,19 +896,19 @@
   63.28  declare (in semiring_char_0) of_num_eq_one_iff [simp]
   63.29  declare (in semiring_char_0) one_eq_of_num_iff [simp]
   63.30  
   63.31 -declare (in ordered_semidom) of_num_pos [simp]
   63.32 -declare (in ordered_semidom) of_num_less_eq_iff [simp]
   63.33 -declare (in ordered_semidom) of_num_less_eq_one_iff [simp]
   63.34 -declare (in ordered_semidom) one_less_eq_of_num_iff [simp]
   63.35 -declare (in ordered_semidom) of_num_less_iff [simp]
   63.36 -declare (in ordered_semidom) of_num_less_one_iff [simp]
   63.37 -declare (in ordered_semidom) one_less_of_num_iff [simp]
   63.38 -declare (in ordered_semidom) of_num_nonneg [simp]
   63.39 -declare (in ordered_semidom) of_num_less_zero_iff [simp]
   63.40 -declare (in ordered_semidom) of_num_le_zero_iff [simp]
   63.41 +declare (in linordered_semidom) of_num_pos [simp]
   63.42 +declare (in linordered_semidom) of_num_less_eq_iff [simp]
   63.43 +declare (in linordered_semidom) of_num_less_eq_one_iff [simp]
   63.44 +declare (in linordered_semidom) one_less_eq_of_num_iff [simp]
   63.45 +declare (in linordered_semidom) of_num_less_iff [simp]
   63.46 +declare (in linordered_semidom) of_num_less_one_iff [simp]
   63.47 +declare (in linordered_semidom) one_less_of_num_iff [simp]
   63.48 +declare (in linordered_semidom) of_num_nonneg [simp]
   63.49 +declare (in linordered_semidom) of_num_less_zero_iff [simp]
   63.50 +declare (in linordered_semidom) of_num_le_zero_iff [simp]
   63.51  
   63.52 -declare (in ordered_idom) le_signed_numeral_special [simp]
   63.53 -declare (in ordered_idom) less_signed_numeral_special [simp]
   63.54 +declare (in linordered_idom) le_signed_numeral_special [simp]
   63.55 +declare (in linordered_idom) less_signed_numeral_special [simp]
   63.56  
   63.57  declare (in semiring_1_minus) Dig_of_num_minus_one [simp]
   63.58  declare (in semiring_1_minus) Dig_one_minus_of_num [simp]
    64.1 --- a/src/HOL/ex/RPred.thy	Fri Feb 05 14:33:31 2010 +0100
    64.2 +++ b/src/HOL/ex/RPred.thy	Fri Feb 05 14:33:50 2010 +0100
    64.3 @@ -25,7 +25,7 @@
    64.4  (* (infixl "\<squnion>" 80) *)
    64.5  where
    64.6    "supp RP1 RP2 = (\<lambda>s. let (P1, s') = RP1 s; (P2, s'') = RP2 s'
    64.7 -  in (upper_semilattice_class.sup P1 P2, s''))"
    64.8 +  in (semilattice_sup_class.sup P1 P2, s''))"
    64.9  
   64.10  definition if_rpred :: "bool \<Rightarrow> unit rpred"
   64.11  where
    65.1 --- a/src/HOL/ex/ReflectionEx.thy	Fri Feb 05 14:33:31 2010 +0100
    65.2 +++ b/src/HOL/ex/ReflectionEx.thy	Fri Feb 05 14:33:50 2010 +0100
    65.3 @@ -385,7 +385,7 @@
    65.4  (* An example for equations containing type variables *)
    65.5  datatype prod = Zero | One | Var nat | Mul prod prod 
    65.6    | Pw prod nat | PNM nat nat prod
    65.7 -consts Iprod :: " prod \<Rightarrow> ('a::{ordered_idom}) list \<Rightarrow>'a" 
    65.8 +consts Iprod :: " prod \<Rightarrow> ('a::{linordered_idom}) list \<Rightarrow>'a" 
    65.9  primrec
   65.10    "Iprod Zero vs = 0"
   65.11    "Iprod One vs = 1"
   65.12 @@ -397,7 +397,7 @@
   65.13  datatype sgn = Pos prod | Neg prod | ZeroEq prod | NZeroEq prod | Tr | F 
   65.14    | Or sgn sgn | And sgn sgn
   65.15  
   65.16 -consts Isgn :: " sgn \<Rightarrow> ('a::{ordered_idom}) list \<Rightarrow>bool"
   65.17 +consts Isgn :: " sgn \<Rightarrow> ('a::{linordered_idom}) list \<Rightarrow>bool"
   65.18  primrec 
   65.19    "Isgn Tr vs = True"
   65.20    "Isgn F vs = False"
   65.21 @@ -410,7 +410,7 @@
   65.22  
   65.23  lemmas eqs = Isgn.simps Iprod.simps
   65.24  
   65.25 -lemma "(x::'a::{ordered_idom})^4 * y * z * y^2 * z^23 > 0"
   65.26 +lemma "(x::'a::{linordered_idom})^4 * y * z * y^2 * z^23 > 0"
   65.27    apply (reify eqs)
   65.28    oops
   65.29