more symbols;
authorwenzelm
Mon Dec 28 01:28:28 2015 +0100 (2015-12-28)
changeset 619451135b8de26c3
parent 61944 5d06ecfdb472
child 61946 844881193616
more symbols;
src/HOL/Algebra/IntRing.thy
src/HOL/Decision_Procs/Approximation.thy
src/HOL/Decision_Procs/Cooper.thy
src/HOL/Decision_Procs/Ferrack.thy
src/HOL/Decision_Procs/MIR.thy
src/HOL/Decision_Procs/Polynomial_List.thy
src/HOL/Library/BigO.thy
src/HOL/Library/Extended_Real.thy
src/HOL/Library/Float.thy
src/HOL/Library/Fundamental_Theorem_Algebra.thy
src/HOL/Library/Infinite_Set.thy
src/HOL/Library/Polynomial.thy
src/HOL/Library/positivstellensatz.ML
src/HOL/Matrix_LP/ComputeFloat.thy
src/HOL/Matrix_LP/LP.thy
src/HOL/Matrix_LP/Matrix.thy
src/HOL/Matrix_LP/SparseMatrix.thy
src/HOL/Metis_Examples/Big_O.thy
src/HOL/Multivariate_Analysis/Bounded_Continuous_Function.thy
src/HOL/Multivariate_Analysis/Bounded_Linear_Function.thy
src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy
src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy
src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy
src/HOL/Multivariate_Analysis/Complex_Transcendental.thy
src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy
src/HOL/Multivariate_Analysis/Derivative.thy
src/HOL/Multivariate_Analysis/Fashoda.thy
src/HOL/Multivariate_Analysis/Integration.thy
src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy
src/HOL/Multivariate_Analysis/PolyRoots.thy
src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy
src/HOL/Multivariate_Analysis/Weierstrass.thy
src/HOL/Multivariate_Analysis/ex/Approximations.thy
src/HOL/NSA/HLog.thy
src/HOL/NSA/HSeries.thy
src/HOL/NSA/HTranscendental.thy
src/HOL/NSA/HyperDef.thy
src/HOL/NSA/NSA.thy
src/HOL/NSA/NSComplex.thy
src/HOL/NSA/NatStar.thy
src/HOL/NSA/Star.thy
src/HOL/NSA/StarDef.thy
src/HOL/Old_Number_Theory/EulerFermat.thy
src/HOL/Old_Number_Theory/Legacy_GCD.thy
src/HOL/Probability/Bochner_Integration.thy
src/HOL/Probability/Interval_Integral.thy
src/HOL/Probability/Lebesgue_Measure.thy
src/HOL/Probability/Set_Integral.thy
src/HOL/SMT_Examples/SMT_Examples.thy
src/HOL/SMT_Examples/SMT_Tests.thy
src/HOL/Word/Bit_Representation.thy
src/HOL/ex/Arith_Examples.thy
src/HOL/ex/Dedekind_Real.thy
src/HOL/ex/Normalization_by_Evaluation.thy
src/HOL/ex/PresburgerEx.thy
src/HOL/ex/Set_Theory.thy
     1.1 --- a/src/HOL/Algebra/IntRing.thy	Mon Dec 28 01:26:34 2015 +0100
     1.2 +++ b/src/HOL/Algebra/IntRing.thy	Mon Dec 28 01:28:28 2015 +0100
     1.3 @@ -13,7 +13,7 @@
     1.4  
     1.5  lemma dvds_eq_abseq:
     1.6    fixes k :: int
     1.7 -  shows "l dvd k \<and> k dvd l \<longleftrightarrow> abs l = abs k"
     1.8 +  shows "l dvd k \<and> k dvd l \<longleftrightarrow> \<bar>l\<bar> = \<bar>k\<bar>"
     1.9  apply rule
    1.10   apply (simp add: zdvd_antisym_abs)
    1.11  apply (simp add: dvd_if_abs_eq)
    1.12 @@ -281,7 +281,7 @@
    1.13    finally show ?thesis .
    1.14  qed
    1.15  
    1.16 -lemma Idl_eq_abs: "Idl\<^bsub>\<Z>\<^esub> {k} = Idl\<^bsub>\<Z>\<^esub> {l} \<longleftrightarrow> abs l = abs k"
    1.17 +lemma Idl_eq_abs: "Idl\<^bsub>\<Z>\<^esub> {k} = Idl\<^bsub>\<Z>\<^esub> {l} \<longleftrightarrow> \<bar>l\<bar> = \<bar>k\<bar>"
    1.18    apply (subst dvds_eq_abseq[symmetric])
    1.19    apply (rule dvds_eq_Idl[symmetric])
    1.20    done
     2.1 --- a/src/HOL/Decision_Procs/Approximation.thy	Mon Dec 28 01:26:34 2015 +0100
     2.2 +++ b/src/HOL/Decision_Procs/Approximation.thy	Mon Dec 28 01:28:28 2015 +0100
     2.3 @@ -170,10 +170,10 @@
     2.4  "float_power_bnds prec n l u =
     2.5    (if 0 < l then (power_down_fl prec l n, power_up_fl prec u n)
     2.6    else if odd n then
     2.7 -    (- power_up_fl prec (abs l) n,
     2.8 -      if u < 0 then - power_down_fl prec (abs u) n else power_up_fl prec u n)
     2.9 -  else if u < 0 then (power_down_fl prec (abs u) n, power_up_fl prec (abs l) n)
    2.10 -  else (0, power_up_fl prec (max (abs l) (abs u)) n))"
    2.11 +    (- power_up_fl prec \<bar>l\<bar> n,
    2.12 +      if u < 0 then - power_down_fl prec \<bar>u\<bar> n else power_up_fl prec u n)
    2.13 +  else if u < 0 then (power_down_fl prec \<bar>u\<bar> n, power_up_fl prec \<bar>l\<bar> n)
    2.14 +  else (0, power_up_fl prec (max \<bar>l\<bar> \<bar>u\<bar>) n))"
    2.15  
    2.16  lemma le_minus_power_downI: "0 \<le> x \<Longrightarrow> x ^ n \<le> - a \<Longrightarrow> a \<le> - power_down prec x n"
    2.17    by (subst le_minus_iff) (auto intro: power_down_le power_mono_odd)
    2.18 @@ -2679,7 +2679,7 @@
    2.19  "interpret_floatarith (Arctan a) vs   = arctan (interpret_floatarith a vs)" |
    2.20  "interpret_floatarith (Min a b) vs    = min (interpret_floatarith a vs) (interpret_floatarith b vs)" |
    2.21  "interpret_floatarith (Max a b) vs    = max (interpret_floatarith a vs) (interpret_floatarith b vs)" |
    2.22 -"interpret_floatarith (Abs a) vs      = abs (interpret_floatarith a vs)" |
    2.23 +"interpret_floatarith (Abs a) vs      = \<bar>interpret_floatarith a vs\<bar>" |
    2.24  "interpret_floatarith Pi vs           = pi" |
    2.25  "interpret_floatarith (Sqrt a) vs     = sqrt (interpret_floatarith a vs)" |
    2.26  "interpret_floatarith (Exp a) vs      = exp (interpret_floatarith a vs)" |
     3.1 --- a/src/HOL/Decision_Procs/Cooper.thy	Mon Dec 28 01:26:34 2015 +0100
     3.2 +++ b/src/HOL/Decision_Procs/Cooper.thy	Mon Dec 28 01:28:28 2015 +0100
     3.3 @@ -618,11 +618,11 @@
     3.4  | "simpfm (NEq a) = (let a' = simpnum a in case a' of C v \<Rightarrow> if v \<noteq> 0 then T else F | _ \<Rightarrow> NEq a')"
     3.5  | "simpfm (Dvd i a) =
     3.6      (if i = 0 then simpfm (Eq a)
     3.7 -     else if abs i = 1 then T
     3.8 +     else if \<bar>i\<bar> = 1 then T
     3.9       else let a' = simpnum a in case a' of C v \<Rightarrow> if i dvd v then T else F | _ \<Rightarrow> Dvd i a')"
    3.10  | "simpfm (NDvd i a) =
    3.11      (if i = 0 then simpfm (NEq a)
    3.12 -     else if abs i = 1 then F
    3.13 +     else if \<bar>i\<bar> = 1 then F
    3.14       else let a' = simpnum a in case a' of C v \<Rightarrow> if \<not>( i dvd v) then T else F | _ \<Rightarrow> NDvd i a')"
    3.15  | "simpfm p = p"
    3.16    by pat_completeness auto
    3.17 @@ -718,7 +718,7 @@
    3.18    let ?sa = "simpnum a"
    3.19    from simpnum_ci have sa: "Inum bs ?sa = Inum bs a"
    3.20      by simp
    3.21 -  consider "i = 0" | "abs i = 1" | "i \<noteq> 0" "abs i \<noteq> 1" by blast
    3.22 +  consider "i = 0" | "\<bar>i\<bar> = 1" | "i \<noteq> 0" "\<bar>i\<bar> \<noteq> 1" by blast
    3.23    then show ?case
    3.24    proof cases
    3.25      case 1
    3.26 @@ -740,7 +740,7 @@
    3.27      proof cases
    3.28        case 1
    3.29        with sa[symmetric] i show ?thesis
    3.30 -        by (cases "abs i = 1") auto
    3.31 +        by (cases "\<bar>i\<bar> = 1") auto
    3.32      next
    3.33        case 2
    3.34        then have "simpfm (Dvd i a) = Dvd i ?sa"
    3.35 @@ -753,7 +753,7 @@
    3.36    let ?sa = "simpnum a"
    3.37    from simpnum_ci have sa: "Inum bs ?sa = Inum bs a"
    3.38      by simp
    3.39 -  consider "i = 0" | "abs i = 1" | "i \<noteq> 0" "abs i \<noteq> 1" by blast
    3.40 +  consider "i = 0" | "\<bar>i\<bar> = 1" | "i \<noteq> 0" "\<bar>i\<bar> \<noteq> 1" by blast
    3.41    then show ?case
    3.42    proof cases
    3.43      case 1
    3.44 @@ -775,7 +775,7 @@
    3.45      proof cases
    3.46        case 1
    3.47        with sa[symmetric] i show ?thesis
    3.48 -        by (cases "abs i = 1") auto
    3.49 +        by (cases "\<bar>i\<bar> = 1") auto
    3.50      next
    3.51        case 2
    3.52        then have "simpfm (NDvd i a) = NDvd i ?sa"
    3.53 @@ -1046,16 +1046,16 @@
    3.54      (if i = 0 then zlfm (Eq a)
    3.55       else
    3.56        let (c, r) = zsplit0 a in
    3.57 -        if c = 0 then Dvd (abs i) r
    3.58 -        else if c > 0 then Dvd (abs i) (CN 0 c r)
    3.59 -        else Dvd (abs i) (CN 0 (- c) (Neg r)))"
    3.60 +        if c = 0 then Dvd \<bar>i\<bar> r
    3.61 +        else if c > 0 then Dvd \<bar>i\<bar> (CN 0 c r)
    3.62 +        else Dvd \<bar>i\<bar> (CN 0 (- c) (Neg r)))"
    3.63    "zlfm (NDvd i a) =
    3.64      (if i = 0 then zlfm (NEq a)
    3.65       else
    3.66        let (c, r) = zsplit0 a in
    3.67 -        if c = 0 then NDvd (abs i) r
    3.68 -        else if c > 0 then NDvd (abs i) (CN 0 c r)
    3.69 -        else NDvd (abs i) (CN 0 (- c) (Neg r)))"
    3.70 +        if c = 0 then NDvd \<bar>i\<bar> r
    3.71 +        else if c > 0 then NDvd \<bar>i\<bar> (CN 0 c r)
    3.72 +        else NDvd \<bar>i\<bar> (CN 0 (- c) (Neg r)))"
    3.73    "zlfm (NOT (And p q)) = Or (zlfm (NOT p)) (zlfm (NOT q))"
    3.74    "zlfm (NOT (Or p q)) = And (zlfm (NOT p)) (zlfm (NOT q))"
    3.75    "zlfm (NOT (Imp p q)) = And (zlfm p) (zlfm (NOT q))"
    3.76 @@ -1213,7 +1213,7 @@
    3.77      case 4
    3.78      then have l: "?L (?l (Dvd j a))"
    3.79        by (simp add: nb Let_def split_def)
    3.80 -    with Ia 4 dvd_minus_iff[of "abs j" "?c*i + ?N ?r"] show ?thesis
    3.81 +    with Ia 4 dvd_minus_iff[of "\<bar>j\<bar>" "?c*i + ?N ?r"] show ?thesis
    3.82        by (simp add: Let_def split_def)
    3.83    qed
    3.84  next
    3.85 @@ -1253,7 +1253,7 @@
    3.86      case 4
    3.87      then have l: "?L (?l (Dvd j a))"
    3.88        by (simp add: nb Let_def split_def)
    3.89 -    with Ia 4 dvd_minus_iff[of "abs j" "?c*i + ?N ?r"] show ?thesis
    3.90 +    with Ia 4 dvd_minus_iff[of "\<bar>j\<bar>" "?c*i + ?N ?r"] show ?thesis
    3.91        by (simp add: Let_def split_def)
    3.92    qed
    3.93  qed auto
     4.1 --- a/src/HOL/Decision_Procs/Ferrack.thy	Mon Dec 28 01:26:34 2015 +0100
     4.2 +++ b/src/HOL/Decision_Procs/Ferrack.thy	Mon Dec 28 01:28:28 2015 +0100
     4.3 @@ -455,8 +455,8 @@
     4.4  
     4.5  fun maxcoeff:: "num \<Rightarrow> int"
     4.6  where
     4.7 -  "maxcoeff (C i) = abs i"
     4.8 -| "maxcoeff (CN n c t) = max (abs c) (maxcoeff t)"
     4.9 +  "maxcoeff (C i) = \<bar>i\<bar>"
    4.10 +| "maxcoeff (CN n c t) = max \<bar>c\<bar> (maxcoeff t)"
    4.11  | "maxcoeff t = 1"
    4.12  
    4.13  lemma maxcoeff_pos: "maxcoeff t \<ge> 0"
    4.14 @@ -498,7 +498,7 @@
    4.15  
    4.16  declare dvd_trans [trans add]
    4.17  
    4.18 -lemma natabs0: "nat (abs x) = 0 \<longleftrightarrow> x = 0"
    4.19 +lemma natabs0: "nat \<bar>x\<bar> = 0 \<longleftrightarrow> x = 0"
    4.20    by arith
    4.21  
    4.22  lemma numgcd0:
    4.23 @@ -536,8 +536,8 @@
    4.24  
    4.25  fun ismaxcoeff:: "num \<Rightarrow> int \<Rightarrow> bool"
    4.26  where
    4.27 -  "ismaxcoeff (C i) = (\<lambda>x. abs i \<le> x)"
    4.28 -| "ismaxcoeff (CN n c t) = (\<lambda>x. abs c \<le> x \<and> ismaxcoeff t x)"
    4.29 +  "ismaxcoeff (C i) = (\<lambda>x. \<bar>i\<bar> \<le> x)"
    4.30 +| "ismaxcoeff (CN n c t) = (\<lambda>x. \<bar>c\<bar> \<le> x \<and> ismaxcoeff t x)"
    4.31  | "ismaxcoeff t = (\<lambda>x. True)"
    4.32  
    4.33  lemma ismaxcoeff_mono: "ismaxcoeff t c \<Longrightarrow> c \<le> c' \<Longrightarrow> ismaxcoeff t c'"
    4.34 @@ -547,18 +547,18 @@
    4.35  proof (induct t rule: maxcoeff.induct)
    4.36    case (2 n c t)
    4.37    then have H:"ismaxcoeff t (maxcoeff t)" .
    4.38 -  have thh: "maxcoeff t \<le> max (abs c) (maxcoeff t)"
    4.39 +  have thh: "maxcoeff t \<le> max \<bar>c\<bar> (maxcoeff t)"
    4.40      by simp
    4.41    from ismaxcoeff_mono[OF H thh] show ?case
    4.42      by simp
    4.43  qed simp_all
    4.44  
    4.45  lemma zgcd_gt1: "gcd i j > (1::int) \<Longrightarrow>
    4.46 -  abs i > 1 \<and> abs j > 1 \<or> abs i = 0 \<and> abs j > 1 \<or> abs i > 1 \<and> abs j = 0"
    4.47 -  apply (cases "abs i = 0", simp_all add: gcd_int_def)
    4.48 -  apply (cases "abs j = 0", simp_all)
    4.49 -  apply (cases "abs i = 1", simp_all)
    4.50 -  apply (cases "abs j = 1", simp_all)
    4.51 +  \<bar>i\<bar> > 1 \<and> \<bar>j\<bar> > 1 \<or> \<bar>i\<bar> = 0 \<and> \<bar>j\<bar> > 1 \<or> \<bar>i\<bar> > 1 \<and> \<bar>j\<bar> = 0"
    4.52 +  apply (cases "\<bar>i\<bar> = 0", simp_all add: gcd_int_def)
    4.53 +  apply (cases "\<bar>j\<bar> = 0", simp_all)
    4.54 +  apply (cases "\<bar>i\<bar> = 1", simp_all)
    4.55 +  apply (cases "\<bar>j\<bar> = 1", simp_all)
    4.56    apply auto
    4.57    done
    4.58  
    4.59 @@ -577,7 +577,7 @@
    4.60    from 2 have th: "gcd c ?g > 1"
    4.61      by simp
    4.62    from zgcd_gt1[OF th] numgcdh_pos[OF mp, where t="t"]
    4.63 -  consider "abs c > 1" "?g > 1" | "abs c = 0" "?g > 1" | "?g = 0"
    4.64 +  consider "\<bar>c\<bar> > 1" "?g > 1" | "\<bar>c\<bar> = 0" "?g > 1" | "?g = 0"
    4.65      by auto
    4.66    then show ?case
    4.67    proof cases
    4.68 @@ -744,11 +744,11 @@
    4.69  lemma maxcoeff_nz: "nozerocoeff t \<Longrightarrow> maxcoeff t = 0 \<Longrightarrow> t = C 0"
    4.70  proof (induct t rule: maxcoeff.induct)
    4.71    case (2 n c t)
    4.72 -  then have cnz: "c \<noteq> 0" and mx: "max (abs c) (maxcoeff t) = 0"
    4.73 +  then have cnz: "c \<noteq> 0" and mx: "max \<bar>c\<bar> (maxcoeff t) = 0"
    4.74      by simp_all
    4.75 -  have "max (abs c) (maxcoeff t) \<ge> abs c"
    4.76 +  have "max \<bar>c\<bar> (maxcoeff t) \<ge> \<bar>c\<bar>"
    4.77      by simp
    4.78 -  with cnz have "max (abs c) (maxcoeff t) > 0"
    4.79 +  with cnz have "max \<bar>c\<bar> (maxcoeff t) > 0"
    4.80      by arith
    4.81    with 2 show ?case
    4.82      by simp
     5.1 --- a/src/HOL/Decision_Procs/MIR.thy	Mon Dec 28 01:26:34 2015 +0100
     5.2 +++ b/src/HOL/Decision_Procs/MIR.thy	Mon Dec 28 01:28:28 2015 +0100
     5.3 @@ -48,19 +48,19 @@
     5.4    by (auto simp add: rdvd_def dvd_def) (rule_tac x="k" in exI, simp only: of_int_mult[symmetric])
     5.5  
     5.6  
     5.7 -lemma rdvd_abs1: "(abs (real_of_int d) rdvd t) = (real_of_int (d ::int) rdvd t)"
     5.8 +lemma rdvd_abs1: "(\<bar>real_of_int d\<bar> rdvd t) = (real_of_int (d ::int) rdvd t)"
     5.9  proof
    5.10    assume d: "real_of_int d rdvd t"
    5.11    from d int_rdvd_real have d2: "d dvd \<lfloor>t\<rfloor>" and ti: "real_of_int \<lfloor>t\<rfloor> = t"
    5.12      by auto
    5.13  
    5.14 -  from iffD2[OF abs_dvd_iff] d2 have "(abs d) dvd \<lfloor>t\<rfloor>" by blast
    5.15 -  with ti int_rdvd_real[symmetric] have "real_of_int (abs d) rdvd t" by blast
    5.16 -  thus "abs (real_of_int d) rdvd t" by simp
    5.17 +  from iffD2[OF abs_dvd_iff] d2 have "\<bar>d\<bar> dvd \<lfloor>t\<rfloor>" by blast
    5.18 +  with ti int_rdvd_real[symmetric] have "real_of_int \<bar>d\<bar> rdvd t" by blast
    5.19 +  thus "\<bar>real_of_int d\<bar> rdvd t" by simp
    5.20  next
    5.21 -  assume "abs (real_of_int d) rdvd t" hence "real_of_int (abs d) rdvd t" by simp
    5.22 -  with int_rdvd_real[where i="abs d" and x="t"]
    5.23 -  have d2: "abs d dvd \<lfloor>t\<rfloor>" and ti: "real_of_int \<lfloor>t\<rfloor> = t"
    5.24 +  assume "\<bar>real_of_int d\<bar> rdvd t" hence "real_of_int \<bar>d\<bar> rdvd t" by simp
    5.25 +  with int_rdvd_real[where i="\<bar>d\<bar>" and x="t"]
    5.26 +  have d2: "\<bar>d\<bar> dvd \<lfloor>t\<rfloor>" and ti: "real_of_int \<lfloor>t\<rfloor> = t"
    5.27      by auto
    5.28    from iffD1[OF abs_dvd_iff] d2 have "d dvd \<lfloor>t\<rfloor>" by blast
    5.29    with ti int_rdvd_real[symmetric] show "real_of_int d rdvd t" by blast
    5.30 @@ -528,9 +528,9 @@
    5.31    "lex_bnd t s \<equiv> lex_ns (bnds t) (bnds s)"
    5.32  
    5.33  fun maxcoeff:: "num \<Rightarrow> int" where
    5.34 -  "maxcoeff (C i) = abs i"
    5.35 -| "maxcoeff (CN n c t) = max (abs c) (maxcoeff t)"
    5.36 -| "maxcoeff (CF c t s) = max (abs c) (maxcoeff s)"
    5.37 +  "maxcoeff (C i) = \<bar>i\<bar>"
    5.38 +| "maxcoeff (CN n c t) = max \<bar>c\<bar> (maxcoeff t)"
    5.39 +| "maxcoeff (CF c t s) = max \<bar>c\<bar> (maxcoeff s)"
    5.40  | "maxcoeff t = 1"
    5.41  
    5.42  lemma maxcoeff_pos: "maxcoeff t \<ge> 0"
    5.43 @@ -602,9 +602,9 @@
    5.44  qed (auto simp add: numgcd_def gp)
    5.45  
    5.46  fun ismaxcoeff:: "num \<Rightarrow> int \<Rightarrow> bool" where
    5.47 -  "ismaxcoeff (C i) = (\<lambda> x. abs i \<le> x)"
    5.48 -| "ismaxcoeff (CN n c t) = (\<lambda>x. abs c \<le> x \<and> (ismaxcoeff t x))"
    5.49 -| "ismaxcoeff (CF c s t) = (\<lambda>x. abs c \<le> x \<and> (ismaxcoeff t x))"
    5.50 +  "ismaxcoeff (C i) = (\<lambda> x. \<bar>i\<bar> \<le> x)"
    5.51 +| "ismaxcoeff (CN n c t) = (\<lambda>x. \<bar>c\<bar> \<le> x \<and> (ismaxcoeff t x))"
    5.52 +| "ismaxcoeff (CF c s t) = (\<lambda>x. \<bar>c\<bar> \<le> x \<and> (ismaxcoeff t x))"
    5.53  | "ismaxcoeff t = (\<lambda>x. True)"
    5.54  
    5.55  lemma ismaxcoeff_mono: "ismaxcoeff t c \<Longrightarrow> c \<le> c' \<Longrightarrow> ismaxcoeff t c'"
    5.56 @@ -614,7 +614,7 @@
    5.57  proof (induct t rule: maxcoeff.induct)
    5.58    case (2 n c t)
    5.59    hence H:"ismaxcoeff t (maxcoeff t)" .
    5.60 -  have thh: "maxcoeff t \<le> max (abs c) (maxcoeff t)" by simp
    5.61 +  have thh: "maxcoeff t \<le> max \<bar>c\<bar> (maxcoeff t)" by simp
    5.62    from ismaxcoeff_mono[OF H thh] show ?case by simp
    5.63  next
    5.64    case (3 c t s)
    5.65 @@ -623,12 +623,12 @@
    5.66    from ismaxcoeff_mono[OF H1 thh1] show ?case by simp
    5.67  qed simp_all
    5.68  
    5.69 -lemma zgcd_gt1: "gcd i j > (1::int) \<Longrightarrow> ((abs i > 1 \<and> abs j > 1) \<or> (abs i = 0 \<and> abs j > 1) \<or> (abs i > 1 \<and> abs j = 0))"
    5.70 +lemma zgcd_gt1: "gcd i j > (1::int) \<Longrightarrow> ((\<bar>i\<bar> > 1 \<and> \<bar>j\<bar> > 1) \<or> (\<bar>i\<bar> = 0 \<and> \<bar>j\<bar> > 1) \<or> (\<bar>i\<bar> > 1 \<and> \<bar>j\<bar> = 0))"
    5.71    apply (unfold gcd_int_def)
    5.72    apply (cases "i = 0", simp_all)
    5.73    apply (cases "j = 0", simp_all)
    5.74 -  apply (cases "abs i = 1", simp_all)
    5.75 -  apply (cases "abs j = 1", simp_all)
    5.76 +  apply (cases "\<bar>i\<bar> = 1", simp_all)
    5.77 +  apply (cases "\<bar>j\<bar> = 1", simp_all)
    5.78    apply auto
    5.79    done
    5.80  
    5.81 @@ -644,17 +644,17 @@
    5.82    let ?g = "numgcdh t m"
    5.83    from 2 have th:"gcd c ?g > 1" by simp
    5.84    from zgcd_gt1[OF th] numgcdh_pos[OF mp, where t="t"]
    5.85 -  have "(abs c > 1 \<and> ?g > 1) \<or> (abs c = 0 \<and> ?g > 1) \<or> (abs c > 1 \<and> ?g = 0)" by simp
    5.86 -  moreover {assume "abs c > 1" and gp: "?g > 1" with 2
    5.87 +  have "(\<bar>c\<bar> > 1 \<and> ?g > 1) \<or> (\<bar>c\<bar> = 0 \<and> ?g > 1) \<or> (\<bar>c\<bar> > 1 \<and> ?g = 0)" by simp
    5.88 +  moreover {assume "\<bar>c\<bar> > 1" and gp: "?g > 1" with 2
    5.89      have th: "dvdnumcoeff t ?g" by simp
    5.90      have th': "gcd c ?g dvd ?g" by simp
    5.91      from dvdnumcoeff_trans[OF th' th] have ?case by simp }
    5.92 -  moreover {assume "abs c = 0 \<and> ?g > 1"
    5.93 +  moreover {assume "\<bar>c\<bar> = 0 \<and> ?g > 1"
    5.94      with 2 have th: "dvdnumcoeff t ?g" by simp
    5.95      have th': "gcd c ?g dvd ?g" by simp
    5.96      from dvdnumcoeff_trans[OF th' th] have ?case by simp
    5.97      hence ?case by simp }
    5.98 -  moreover {assume "abs c > 1" and g0:"?g = 0"
    5.99 +  moreover {assume "\<bar>c\<bar> > 1" and g0:"?g = 0"
   5.100      from numgcdh0[OF g0] have "m=0". with 2 g0 have ?case by simp }
   5.101    ultimately show ?case by blast
   5.102  next
   5.103 @@ -662,17 +662,17 @@
   5.104    let ?g = "numgcdh t m"
   5.105    from 3 have th:"gcd c ?g > 1" by simp
   5.106    from zgcd_gt1[OF th] numgcdh_pos[OF mp, where t="t"]
   5.107 -  have "(abs c > 1 \<and> ?g > 1) \<or> (abs c = 0 \<and> ?g > 1) \<or> (abs c > 1 \<and> ?g = 0)" by simp
   5.108 -  moreover {assume "abs c > 1" and gp: "?g > 1" with 3
   5.109 +  have "(\<bar>c\<bar> > 1 \<and> ?g > 1) \<or> (\<bar>c\<bar> = 0 \<and> ?g > 1) \<or> (\<bar>c\<bar> > 1 \<and> ?g = 0)" by simp
   5.110 +  moreover {assume "\<bar>c\<bar> > 1" and gp: "?g > 1" with 3
   5.111      have th: "dvdnumcoeff t ?g" by simp
   5.112      have th': "gcd c ?g dvd ?g" by simp
   5.113      from dvdnumcoeff_trans[OF th' th] have ?case by simp }
   5.114 -  moreover {assume "abs c = 0 \<and> ?g > 1"
   5.115 +  moreover {assume "\<bar>c\<bar> = 0 \<and> ?g > 1"
   5.116      with 3 have th: "dvdnumcoeff t ?g" by simp
   5.117      have th': "gcd c ?g dvd ?g" by simp
   5.118      from dvdnumcoeff_trans[OF th' th] have ?case by simp
   5.119      hence ?case by simp }
   5.120 -  moreover {assume "abs c > 1" and g0:"?g = 0"
   5.121 +  moreover {assume "\<bar>c\<bar> > 1" and g0:"?g = 0"
   5.122      from numgcdh0[OF g0] have "m=0". with 3 g0 have ?case by simp }
   5.123    ultimately show ?case by blast
   5.124  qed auto
   5.125 @@ -904,15 +904,15 @@
   5.126  lemma maxcoeff_nz: "nozerocoeff t \<Longrightarrow> maxcoeff t = 0 \<Longrightarrow> t = C 0"
   5.127  proof (induct t rule: maxcoeff.induct)
   5.128    case (2 n c t)
   5.129 -  hence cnz: "c \<noteq>0" and mx: "max (abs c) (maxcoeff t) = 0" by simp+
   5.130 -  have "max (abs c) (maxcoeff t) \<ge> abs c" by simp
   5.131 -  with cnz have "max (abs c) (maxcoeff t) > 0" by arith
   5.132 +  hence cnz: "c \<noteq>0" and mx: "max \<bar>c\<bar> (maxcoeff t) = 0" by simp+
   5.133 +  have "max \<bar>c\<bar> (maxcoeff t) \<ge> \<bar>c\<bar>" by simp
   5.134 +  with cnz have "max \<bar>c\<bar> (maxcoeff t) > 0" by arith
   5.135    with 2 show ?case by simp
   5.136  next
   5.137    case (3 c s t)
   5.138 -  hence cnz: "c \<noteq>0" and mx: "max (abs c) (maxcoeff t) = 0" by simp+
   5.139 -  have "max (abs c) (maxcoeff t) \<ge> abs c" by simp
   5.140 -  with cnz have "max (abs c) (maxcoeff t) > 0" by arith
   5.141 +  hence cnz: "c \<noteq>0" and mx: "max \<bar>c\<bar> (maxcoeff t) = 0" by simp+
   5.142 +  have "max \<bar>c\<bar> (maxcoeff t) \<ge> \<bar>c\<bar>" by simp
   5.143 +  with cnz have "max \<bar>c\<bar> (maxcoeff t) > 0" by arith
   5.144    with 3 show ?case by simp
   5.145  qed auto
   5.146  
   5.147 @@ -1152,10 +1152,10 @@
   5.148  | "simpfm (Eq a) = (let a' = simpnum a in case a' of C v \<Rightarrow> if (v = 0)  then T else F | _ \<Rightarrow> Eq (reducecoeff a'))"
   5.149  | "simpfm (NEq a) = (let a' = simpnum a in case a' of C v \<Rightarrow> if (v \<noteq> 0)  then T else F | _ \<Rightarrow> NEq (reducecoeff a'))"
   5.150  | "simpfm (Dvd i a) = (if i=0 then simpfm (Eq a)
   5.151 -             else if (abs i = 1) \<and> check_int a then T
   5.152 +             else if (\<bar>i\<bar> = 1) \<and> check_int a then T
   5.153               else let a' = simpnum a in case a' of C v \<Rightarrow> if (i dvd v)  then T else F | _ \<Rightarrow> (let (d,t) = simpdvd i a' in Dvd d t))"
   5.154  | "simpfm (NDvd i a) = (if i=0 then simpfm (NEq a)
   5.155 -             else if (abs i = 1) \<and> check_int a then F
   5.156 +             else if (\<bar>i\<bar> = 1) \<and> check_int a then F
   5.157               else let a' = simpnum a in case a' of C v \<Rightarrow> if (\<not>(i dvd v)) then T else F | _ \<Rightarrow> (let (d,t) = simpdvd i a' in NDvd d t))"
   5.158  | "simpfm p = p"
   5.159  by pat_completeness auto
   5.160 @@ -1266,10 +1266,10 @@
   5.161    ultimately show ?case by blast
   5.162  next
   5.163    case (12 i a)  let ?sa = "simpnum a"   have sa: "Inum bs ?sa = Inum bs a" by simp
   5.164 -  have "i=0 \<or> (abs i = 1 \<and> check_int a) \<or> (i\<noteq>0 \<and> ((abs i \<noteq> 1) \<or> (\<not> check_int a)))" by auto
   5.165 +  have "i=0 \<or> (\<bar>i\<bar> = 1 \<and> check_int a) \<or> (i\<noteq>0 \<and> ((\<bar>i\<bar> \<noteq> 1) \<or> (\<not> check_int a)))" by auto
   5.166    {assume "i=0" hence ?case using "12.hyps" by (simp add: rdvd_left_0_eq Let_def)}
   5.167    moreover
   5.168 -  {assume ai1: "abs i = 1" and ai: "check_int a"
   5.169 +  {assume ai1: "\<bar>i\<bar> = 1" and ai: "check_int a"
   5.170      hence "i=1 \<or> i= - 1" by arith
   5.171      moreover {assume i1: "i = 1"
   5.172        from rdvd_left1_int[OF check_int[OF ai, simplified isint_iff]]
   5.173 @@ -1280,9 +1280,9 @@
   5.174        have ?case using i1 ai by simp }
   5.175      ultimately have ?case by blast}
   5.176    moreover
   5.177 -  {assume inz: "i\<noteq>0" and cond: "(abs i \<noteq> 1) \<or> (\<not> check_int a)"
   5.178 +  {assume inz: "i\<noteq>0" and cond: "(\<bar>i\<bar> \<noteq> 1) \<or> (\<not> check_int a)"
   5.179      {fix v assume "?sa = C v" hence ?case using sa[symmetric] inz cond
   5.180 -        by (cases "abs i = 1", auto simp add: int_rdvd_iff) }
   5.181 +        by (cases "\<bar>i\<bar> = 1", auto simp add: int_rdvd_iff) }
   5.182      moreover {assume H:"\<not> (\<exists> v. ?sa = C v)"
   5.183        hence th: "simpfm (Dvd i a) = Dvd (fst (simpdvd i ?sa)) (snd (simpdvd i ?sa))" using inz cond by (cases ?sa, auto simp add: Let_def split_def)
   5.184        from simpnum_nz have nz:"nozerocoeff ?sa" by simp
   5.185 @@ -1291,10 +1291,10 @@
   5.186    ultimately show ?case by blast
   5.187  next
   5.188    case (13 i a)  let ?sa = "simpnum a"   have sa: "Inum bs ?sa = Inum bs a" by simp
   5.189 -  have "i=0 \<or> (abs i = 1 \<and> check_int a) \<or> (i\<noteq>0 \<and> ((abs i \<noteq> 1) \<or> (\<not> check_int a)))" by auto
   5.190 +  have "i=0 \<or> (\<bar>i\<bar> = 1 \<and> check_int a) \<or> (i\<noteq>0 \<and> ((\<bar>i\<bar> \<noteq> 1) \<or> (\<not> check_int a)))" by auto
   5.191    {assume "i=0" hence ?case using "13.hyps" by (simp add: rdvd_left_0_eq Let_def)}
   5.192    moreover
   5.193 -  {assume ai1: "abs i = 1" and ai: "check_int a"
   5.194 +  {assume ai1: "\<bar>i\<bar> = 1" and ai: "check_int a"
   5.195      hence "i=1 \<or> i= - 1" by arith
   5.196      moreover {assume i1: "i = 1"
   5.197        from rdvd_left1_int[OF check_int[OF ai, simplified isint_iff]]
   5.198 @@ -1305,9 +1305,9 @@
   5.199        have ?case using i1 ai by simp }
   5.200      ultimately have ?case by blast}
   5.201    moreover
   5.202 -  {assume inz: "i\<noteq>0" and cond: "(abs i \<noteq> 1) \<or> (\<not> check_int a)"
   5.203 +  {assume inz: "i\<noteq>0" and cond: "(\<bar>i\<bar> \<noteq> 1) \<or> (\<not> check_int a)"
   5.204      {fix v assume "?sa = C v" hence ?case using sa[symmetric] inz cond
   5.205 -        by (cases "abs i = 1", auto simp add: int_rdvd_iff) }
   5.206 +        by (cases "\<bar>i\<bar> = 1", auto simp add: int_rdvd_iff) }
   5.207      moreover {assume H:"\<not> (\<exists> v. ?sa = C v)"
   5.208        hence th: "simpfm (NDvd i a) = NDvd (fst (simpdvd i ?sa)) (snd (simpdvd i ?sa))" using inz cond
   5.209          by (cases ?sa, auto simp add: Let_def split_def)
   5.210 @@ -1599,14 +1599,14 @@
   5.211        else (Or (NEq (CN 0 (-c) (Floor (Neg r)))) (NEq (Add (Floor (Neg r)) r))))"
   5.212    "zlfm (Dvd i a) = (if i=0 then zlfm (Eq a)
   5.213    else (let (c,r) = zsplit0 a in
   5.214 -              if c=0 then Dvd (abs i) r else
   5.215 -      if c>0 then And (Eq (Sub (Floor r) r)) (Dvd (abs i) (CN 0 c (Floor r)))
   5.216 -      else And (Eq (Sub (Floor r) r)) (Dvd (abs i) (CN 0 (-c) (Neg (Floor r))))))"
   5.217 +              if c=0 then Dvd \<bar>i\<bar> r else
   5.218 +      if c>0 then And (Eq (Sub (Floor r) r)) (Dvd \<bar>i\<bar> (CN 0 c (Floor r)))
   5.219 +      else And (Eq (Sub (Floor r) r)) (Dvd \<bar>i\<bar> (CN 0 (-c) (Neg (Floor r))))))"
   5.220    "zlfm (NDvd i a) = (if i=0 then zlfm (NEq a)
   5.221    else (let (c,r) = zsplit0 a in
   5.222 -              if c=0 then NDvd (abs i) r else
   5.223 -      if c>0 then Or (NEq (Sub (Floor r) r)) (NDvd (abs i) (CN 0 c (Floor r)))
   5.224 -      else Or (NEq (Sub (Floor r) r)) (NDvd (abs i) (CN 0 (-c) (Neg (Floor r))))))"
   5.225 +              if c=0 then NDvd \<bar>i\<bar> r else
   5.226 +      if c>0 then Or (NEq (Sub (Floor r) r)) (NDvd \<bar>i\<bar> (CN 0 c (Floor r)))
   5.227 +      else Or (NEq (Sub (Floor r) r)) (NDvd \<bar>i\<bar> (CN 0 (-c) (Neg (Floor r))))))"
   5.228    "zlfm (NOT (And p q)) = disj (zlfm (NOT p)) (zlfm (NOT q))"
   5.229    "zlfm (NOT (Or p q)) = conj (zlfm (NOT p)) (zlfm (NOT q))"
   5.230    "zlfm (NOT (Imp p q)) = conj (zlfm p) (zlfm (NOT q))"
   5.231 @@ -1865,11 +1865,11 @@
   5.232        by (simp add: nb Let_def split_def isint_Floor isint_neg)
   5.233      have "?I (Dvd j a) = (real_of_int j rdvd (real_of_int (?c * i) + (?N ?r)))"
   5.234        using Ia by (simp add: Let_def split_def)
   5.235 -    also have "\<dots> = (real_of_int (abs j) rdvd real_of_int (?c*i) + (?N ?r))"
   5.236 +    also have "\<dots> = (real_of_int \<bar>j\<bar> rdvd real_of_int (?c*i) + (?N ?r))"
   5.237        by (simp only: rdvd_abs1[where d="j" and t="real_of_int (?c*i) + ?N ?r", symmetric]) simp
   5.238 -    also have "\<dots> = ((abs j) dvd \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> \<and>
   5.239 +    also have "\<dots> = (\<bar>j\<bar> dvd \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> \<and>
   5.240         (real_of_int \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> = (real_of_int (?c*i) + (?N ?r))))"
   5.241 -      by(simp only: int_rdvd_real[where i="abs j" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps)
   5.242 +      by(simp only: int_rdvd_real[where i="\<bar>j\<bar>" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps)
   5.243      also have "\<dots> = (?I (?l (Dvd j a)))" using cp cnz jnz
   5.244        by (simp add: Let_def split_def int_rdvd_iff[symmetric]
   5.245          del: of_int_mult) (auto simp add: ac_simps)
   5.246 @@ -1879,13 +1879,13 @@
   5.247        by (simp add: nb Let_def split_def isint_Floor isint_neg)
   5.248      have "?I (Dvd j a) = (real_of_int j rdvd (real_of_int (?c * i) + (?N ?r)))"
   5.249        using Ia by (simp add: Let_def split_def)
   5.250 -    also have "\<dots> = (real_of_int (abs j) rdvd real_of_int (?c*i) + (?N ?r))"
   5.251 +    also have "\<dots> = (real_of_int \<bar>j\<bar> rdvd real_of_int (?c*i) + (?N ?r))"
   5.252        by (simp only: rdvd_abs1[where d="j" and t="real_of_int (?c*i) + ?N ?r", symmetric]) simp
   5.253 -    also have "\<dots> = ((abs j) dvd \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> \<and>
   5.254 +    also have "\<dots> = (\<bar>j\<bar> dvd \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> \<and>
   5.255         (real_of_int \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> = (real_of_int (?c*i) + (?N ?r))))"
   5.256 -      by(simp only: int_rdvd_real[where i="abs j" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps)
   5.257 +      by(simp only: int_rdvd_real[where i="\<bar>j\<bar>" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps)
   5.258      also have "\<dots> = (?I (?l (Dvd j a)))" using cn cnz jnz
   5.259 -      using rdvd_minus [where d="abs j" and t="real_of_int (?c*i + \<lfloor>?N ?r\<rfloor>)", simplified, symmetric]
   5.260 +      using rdvd_minus [where d="\<bar>j\<bar>" and t="real_of_int (?c*i + \<lfloor>?N ?r\<rfloor>)", simplified, symmetric]
   5.261        by (simp add: Let_def split_def int_rdvd_iff[symmetric]
   5.262          del: of_int_mult) (auto simp add: ac_simps)
   5.263      finally have ?case using l jnz by blast }
   5.264 @@ -1911,11 +1911,11 @@
   5.265        by (simp add: nb Let_def split_def isint_Floor isint_neg)
   5.266      have "?I (NDvd j a) = (\<not> (real_of_int j rdvd (real_of_int (?c * i) + (?N ?r))))"
   5.267        using Ia by (simp add: Let_def split_def)
   5.268 -    also have "\<dots> = (\<not> (real_of_int (abs j) rdvd real_of_int (?c*i) + (?N ?r)))"
   5.269 +    also have "\<dots> = (\<not> (real_of_int \<bar>j\<bar> rdvd real_of_int (?c*i) + (?N ?r)))"
   5.270        by (simp only: rdvd_abs1[where d="j" and t="real_of_int (?c*i) + ?N ?r", symmetric]) simp
   5.271 -    also have "\<dots> = (\<not> ((abs j) dvd \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> \<and>
   5.272 +    also have "\<dots> = (\<not> (\<bar>j\<bar> dvd \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> \<and>
   5.273         (real_of_int \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> = (real_of_int (?c*i) + (?N ?r)))))"
   5.274 -      by(simp only: int_rdvd_real[where i="abs j" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps)
   5.275 +      by(simp only: int_rdvd_real[where i="\<bar>j\<bar>" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps)
   5.276      also have "\<dots> = (?I (?l (NDvd j a)))" using cp cnz jnz
   5.277        by (simp add: Let_def split_def int_rdvd_iff[symmetric]
   5.278          del: of_int_mult) (auto simp add: ac_simps)
   5.279 @@ -1925,13 +1925,13 @@
   5.280        by (simp add: nb Let_def split_def isint_Floor isint_neg)
   5.281      have "?I (NDvd j a) = (\<not> (real_of_int j rdvd (real_of_int (?c * i) + (?N ?r))))"
   5.282        using Ia by (simp add: Let_def split_def)
   5.283 -    also have "\<dots> = (\<not> (real_of_int (abs j) rdvd real_of_int (?c*i) + (?N ?r)))"
   5.284 +    also have "\<dots> = (\<not> (real_of_int \<bar>j\<bar> rdvd real_of_int (?c*i) + (?N ?r)))"
   5.285        by (simp only: rdvd_abs1[where d="j" and t="real_of_int (?c*i) + ?N ?r", symmetric]) simp
   5.286 -    also have "\<dots> = (\<not> ((abs j) dvd \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> \<and>
   5.287 +    also have "\<dots> = (\<not> (\<bar>j\<bar> dvd \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> \<and>
   5.288         (real_of_int \<lfloor>(?N ?r) + real_of_int (?c*i)\<rfloor> = (real_of_int (?c*i) + (?N ?r)))))"
   5.289 -      by(simp only: int_rdvd_real[where i="abs j" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps)
   5.290 +      by(simp only: int_rdvd_real[where i="\<bar>j\<bar>" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps)
   5.291      also have "\<dots> = (?I (?l (NDvd j a)))" using cn cnz jnz
   5.292 -      using rdvd_minus [where d="abs j" and t="real_of_int (?c*i + \<lfloor>?N ?r\<rfloor>)", simplified, symmetric]
   5.293 +      using rdvd_minus [where d="\<bar>j\<bar>" and t="real_of_int (?c*i + \<lfloor>?N ?r\<rfloor>)", simplified, symmetric]
   5.294        by (simp add: Let_def split_def int_rdvd_iff[symmetric]
   5.295          del: of_int_mult) (auto simp add: ac_simps)
   5.296      finally have ?case using l jnz by blast }
   5.297 @@ -3261,7 +3261,7 @@
   5.298      from iszlfm_gen [OF lp,rule_format, where y="a"] have lp':"iszlfm p (a#bs)" .
   5.299      from \<rho>'[OF lp' d dp, rule_format, OF nob] have th:"\<forall> x. ?P x \<longrightarrow> ?P (x - ?d)" by blast
   5.300      from minusinf_inf[OF lp] obtain z where z:"\<forall> x<z. ?MP x = ?P x" by blast
   5.301 -    have zp: "abs (x - z) + 1 \<ge> 0" by arith
   5.302 +    have zp: "\<bar>x - z\<bar> + 1 \<ge> 0" by arith
   5.303      from decr_lemma[OF dp,where x="x" and z="z"]
   5.304        decr_mult_lemma[OF dp th zp, rule_format, OF px] z have th:"\<exists> x. ?MP x" by auto
   5.305      with minusinf_bex[OF lp] px nob have ?thesis by blast}
   5.306 @@ -3860,12 +3860,12 @@
   5.307  definition DVD :: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm" where
   5.308    DVD_def: "DVD i c t =
   5.309    (if i=0 then eq c t else
   5.310 -  if c = 0 then (Dvd i t) else if c >0 then DVDJ (abs i) c t else DVDJ (abs i) (-c) (Neg t))"
   5.311 +  if c = 0 then (Dvd i t) else if c >0 then DVDJ \<bar>i\<bar> c t else DVDJ \<bar>i\<bar> (-c) (Neg t))"
   5.312  
   5.313  definition  NDVD :: "int \<Rightarrow> int \<Rightarrow> num \<Rightarrow> fm" where
   5.314    "NDVD i c t =
   5.315    (if i=0 then neq c t else
   5.316 -  if c = 0 then (NDvd i t) else if c >0 then NDVDJ (abs i) c t else NDVDJ (abs i) (-c) (Neg t))"
   5.317 +  if c = 0 then (NDvd i t) else if c >0 then NDVDJ \<bar>i\<bar> c t else NDVDJ \<bar>i\<bar> (-c) (Neg t))"
   5.318  
   5.319  lemma DVD_mono:
   5.320    assumes xp: "0\<le> x" and x1: "x < 1"
   5.321 @@ -5671,7 +5671,7 @@
   5.322  lemma "\<forall>x::real. \<exists>y \<le> x. (\<lfloor>x\<rfloor> = \<lceil>y\<rceil>)"
   5.323    by mir
   5.324  
   5.325 -lemma "\<forall>(x::real) (y::real). \<lfloor>x\<rfloor> = \<lfloor>y\<rfloor> \<longrightarrow> 0 \<le> abs (y - x) \<and> abs (y - x) \<le> 1"
   5.326 +lemma "\<forall>(x::real) (y::real). \<lfloor>x\<rfloor> = \<lfloor>y\<rfloor> \<longrightarrow> 0 \<le> \<bar>y - x\<bar> \<and> \<bar>y - x\<bar> \<le> 1"
   5.327    by mir
   5.328  
   5.329  end
     6.1 --- a/src/HOL/Decision_Procs/Polynomial_List.thy	Mon Dec 28 01:26:34 2015 +0100
     6.2 +++ b/src/HOL/Decision_Procs/Polynomial_List.thy	Mon Dec 28 01:28:28 2015 +0100
     6.3 @@ -1118,7 +1118,7 @@
     6.4  text \<open>Bound for polynomial.\<close>
     6.5  lemma poly_mono:
     6.6    fixes x :: "'a::linordered_idom"
     6.7 -  shows "abs x \<le> k \<Longrightarrow> abs (poly p x) \<le> poly (map abs p) k"
     6.8 +  shows "\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k"
     6.9  proof (induct p)
    6.10    case Nil
    6.11    then show ?case by simp
    6.12 @@ -1126,7 +1126,7 @@
    6.13    case (Cons a p)
    6.14    then show ?case
    6.15      apply auto
    6.16 -    apply (rule_tac y = "abs a + abs (x * poly p x)" in order_trans)
    6.17 +    apply (rule_tac y = "\<bar>a\<bar> + \<bar>x * poly p x\<bar>" in order_trans)
    6.18      apply (rule abs_triangle_ineq)
    6.19      apply (auto intro!: mult_mono simp add: abs_mult)
    6.20      done
     7.1 --- a/src/HOL/Library/BigO.thy	Mon Dec 28 01:26:34 2015 +0100
     7.2 +++ b/src/HOL/Library/BigO.thy	Mon Dec 28 01:28:28 2015 +0100
     7.3 @@ -35,19 +35,19 @@
     7.4  subsection \<open>Definitions\<close>
     7.5  
     7.6  definition bigo :: "('a \<Rightarrow> 'b::linordered_idom) \<Rightarrow> ('a \<Rightarrow> 'b) set"  ("(1O'(_'))")
     7.7 -  where "O(f:: 'a \<Rightarrow> 'b) = {h. \<exists>c. \<forall>x. abs (h x) \<le> c * abs (f x)}"
     7.8 +  where "O(f:: 'a \<Rightarrow> 'b) = {h. \<exists>c. \<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>}"
     7.9  
    7.10  lemma bigo_pos_const:
    7.11 -  "(\<exists>c::'a::linordered_idom. \<forall>x. abs (h x) \<le> c * abs (f x)) \<longleftrightarrow>
    7.12 -    (\<exists>c. 0 < c \<and> (\<forall>x. abs (h x) \<le> c * abs (f x)))"
    7.13 +  "(\<exists>c::'a::linordered_idom. \<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>) \<longleftrightarrow>
    7.14 +    (\<exists>c. 0 < c \<and> (\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>))"
    7.15    apply auto
    7.16    apply (case_tac "c = 0")
    7.17    apply simp
    7.18    apply (rule_tac x = "1" in exI)
    7.19    apply simp
    7.20 -  apply (rule_tac x = "abs c" in exI)
    7.21 +  apply (rule_tac x = "\<bar>c\<bar>" in exI)
    7.22    apply auto
    7.23 -  apply (subgoal_tac "c * abs (f x) \<le> abs c * abs (f x)")
    7.24 +  apply (subgoal_tac "c * \<bar>f x\<bar> \<le> \<bar>c\<bar> * \<bar>f x\<bar>")
    7.25    apply (erule_tac x = x in allE)
    7.26    apply force
    7.27    apply (rule mult_right_mono)
    7.28 @@ -55,7 +55,7 @@
    7.29    apply (rule abs_ge_zero)
    7.30    done
    7.31  
    7.32 -lemma bigo_alt_def: "O(f) = {h. \<exists>c. 0 < c \<and> (\<forall>x. abs (h x) \<le> c * abs (f x))}"
    7.33 +lemma bigo_alt_def: "O(f) = {h. \<exists>c. 0 < c \<and> (\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>)}"
    7.34    by (auto simp add: bigo_def bigo_pos_const)
    7.35  
    7.36  lemma bigo_elt_subset [intro]: "f \<in> O(g) \<Longrightarrow> O(f) \<le> O(g)"
    7.37 @@ -65,7 +65,7 @@
    7.38    apply simp
    7.39    apply (rule allI)
    7.40    apply (drule_tac x = "xa" in spec)+
    7.41 -  apply (subgoal_tac "ca * abs (f xa) \<le> ca * (c * abs (g xa))")
    7.42 +  apply (subgoal_tac "ca * \<bar>f xa\<bar> \<le> ca * (c * \<bar>g xa\<bar>)")
    7.43    apply (erule order_trans)
    7.44    apply (simp add: ac_simps)
    7.45    apply (rule mult_left_mono, assumption)
    7.46 @@ -110,29 +110,29 @@
    7.47    apply (rule subsetI)
    7.48    apply (auto simp add: bigo_def bigo_pos_const func_plus set_plus_def)
    7.49    apply (subst bigo_pos_const [symmetric])+
    7.50 -  apply (rule_tac x = "\<lambda>n. if abs (g n) \<le> (abs (f n)) then x n else 0" in exI)
    7.51 +  apply (rule_tac x = "\<lambda>n. if \<bar>g n\<bar> \<le> \<bar>f n\<bar> then x n else 0" in exI)
    7.52    apply (rule conjI)
    7.53    apply (rule_tac x = "c + c" in exI)
    7.54    apply (clarsimp)
    7.55 -  apply (subgoal_tac "c * abs (f xa + g xa) \<le> (c + c) * abs (f xa)")
    7.56 +  apply (subgoal_tac "c * \<bar>f xa + g xa\<bar> \<le> (c + c) * \<bar>f xa\<bar>")
    7.57    apply (erule_tac x = xa in allE)
    7.58    apply (erule order_trans)
    7.59    apply (simp)
    7.60 -  apply (subgoal_tac "c * abs (f xa + g xa) \<le> c * (abs (f xa) + abs (g xa))")
    7.61 +  apply (subgoal_tac "c * \<bar>f xa + g xa\<bar> \<le> c * (\<bar>f xa\<bar> + \<bar>g xa\<bar>)")
    7.62    apply (erule order_trans)
    7.63    apply (simp add: ring_distribs)
    7.64    apply (rule mult_left_mono)
    7.65    apply (simp add: abs_triangle_ineq)
    7.66    apply (simp add: order_less_le)
    7.67 -  apply (rule_tac x = "\<lambda>n. if (abs (f n)) < abs (g n) then x n else 0" in exI)
    7.68 +  apply (rule_tac x = "\<lambda>n. if \<bar>f n\<bar> < \<bar>g n\<bar> then x n else 0" in exI)
    7.69    apply (rule conjI)
    7.70    apply (rule_tac x = "c + c" in exI)
    7.71    apply auto
    7.72 -  apply (subgoal_tac "c * abs (f xa + g xa) \<le> (c + c) * abs (g xa)")
    7.73 +  apply (subgoal_tac "c * \<bar>f xa + g xa\<bar> \<le> (c + c) * \<bar>g xa\<bar>")
    7.74    apply (erule_tac x = xa in allE)
    7.75    apply (erule order_trans)
    7.76    apply simp
    7.77 -  apply (subgoal_tac "c * abs (f xa + g xa) \<le> c * (abs (f xa) + abs (g xa))")
    7.78 +  apply (subgoal_tac "c * \<bar>f xa + g xa\<bar> \<le> c * (\<bar>f xa\<bar> + \<bar>g xa\<bar>)")
    7.79    apply (erule order_trans)
    7.80    apply (simp add: ring_distribs)
    7.81    apply (rule mult_left_mono)
    7.82 @@ -162,8 +162,8 @@
    7.83    apply (drule_tac x = "xa" in spec)+
    7.84    apply (subgoal_tac "0 \<le> f xa + g xa")
    7.85    apply (simp add: ring_distribs)
    7.86 -  apply (subgoal_tac "abs (a xa + b xa) \<le> abs (a xa) + abs (b xa)")
    7.87 -  apply (subgoal_tac "abs (a xa) + abs (b xa) \<le> max c ca * f xa + max c ca * g xa")
    7.88 +  apply (subgoal_tac "\<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>")
    7.89 +  apply (subgoal_tac "\<bar>a xa\<bar> + \<bar>b xa\<bar> \<le> max c ca * f xa + max c ca * g xa")
    7.90    apply force
    7.91    apply (rule add_mono)
    7.92    apply (subgoal_tac "c * f xa \<le> max c ca * f xa")
    7.93 @@ -183,7 +183,7 @@
    7.94  
    7.95  lemma bigo_bounded_alt: "\<forall>x. 0 \<le> f x \<Longrightarrow> \<forall>x. f x \<le> c * g x \<Longrightarrow> f \<in> O(g)"
    7.96    apply (auto simp add: bigo_def)
    7.97 -  apply (rule_tac x = "abs c" in exI)
    7.98 +  apply (rule_tac x = "\<bar>c\<bar>" in exI)
    7.99    apply auto
   7.100    apply (drule_tac x = x in spec)+
   7.101    apply (simp add: abs_mult [symmetric])
   7.102 @@ -202,21 +202,21 @@
   7.103    apply force
   7.104    done
   7.105  
   7.106 -lemma bigo_abs: "(\<lambda>x. abs (f x)) =o O(f)"
   7.107 +lemma bigo_abs: "(\<lambda>x. \<bar>f x\<bar>) =o O(f)"
   7.108    apply (unfold bigo_def)
   7.109    apply auto
   7.110    apply (rule_tac x = 1 in exI)
   7.111    apply auto
   7.112    done
   7.113  
   7.114 -lemma bigo_abs2: "f =o O(\<lambda>x. abs (f x))"
   7.115 +lemma bigo_abs2: "f =o O(\<lambda>x. \<bar>f x\<bar>)"
   7.116    apply (unfold bigo_def)
   7.117    apply auto
   7.118    apply (rule_tac x = 1 in exI)
   7.119    apply auto
   7.120    done
   7.121  
   7.122 -lemma bigo_abs3: "O(f) = O(\<lambda>x. abs (f x))"
   7.123 +lemma bigo_abs3: "O(f) = O(\<lambda>x. \<bar>f x\<bar>)"
   7.124    apply (rule equalityI)
   7.125    apply (rule bigo_elt_subset)
   7.126    apply (rule bigo_abs2)
   7.127 @@ -224,15 +224,15 @@
   7.128    apply (rule bigo_abs)
   7.129    done
   7.130  
   7.131 -lemma bigo_abs4: "f =o g +o O(h) \<Longrightarrow> (\<lambda>x. abs (f x)) =o (\<lambda>x. abs (g x)) +o O(h)"
   7.132 +lemma bigo_abs4: "f =o g +o O(h) \<Longrightarrow> (\<lambda>x. \<bar>f x\<bar>) =o (\<lambda>x. \<bar>g x\<bar>) +o O(h)"
   7.133    apply (drule set_plus_imp_minus)
   7.134    apply (rule set_minus_imp_plus)
   7.135    apply (subst fun_diff_def)
   7.136  proof -
   7.137    assume a: "f - g \<in> O(h)"
   7.138 -  have "(\<lambda>x. abs (f x) - abs (g x)) =o O(\<lambda>x. abs (abs (f x) - abs (g x)))"
   7.139 +  have "(\<lambda>x. \<bar>f x\<bar> - \<bar>g x\<bar>) =o O(\<lambda>x. \<bar>\<bar>f x\<bar> - \<bar>g x\<bar>\<bar>)"
   7.140      by (rule bigo_abs2)
   7.141 -  also have "\<dots> \<subseteq> O(\<lambda>x. abs (f x - g x))"
   7.142 +  also have "\<dots> \<subseteq> O(\<lambda>x. \<bar>f x - g x\<bar>)"
   7.143      apply (rule bigo_elt_subset)
   7.144      apply (rule bigo_bounded)
   7.145      apply force
   7.146 @@ -246,10 +246,10 @@
   7.147      done
   7.148    also from a have "\<dots> \<subseteq> O(h)"
   7.149      by (rule bigo_elt_subset)
   7.150 -  finally show "(\<lambda>x. abs (f x) - abs (g x)) \<in> O(h)".
   7.151 +  finally show "(\<lambda>x. \<bar>f x\<bar> - \<bar>g x\<bar>) \<in> O(h)".
   7.152  qed
   7.153  
   7.154 -lemma bigo_abs5: "f =o O(g) \<Longrightarrow> (\<lambda>x. abs (f x)) =o O(g)"
   7.155 +lemma bigo_abs5: "f =o O(g) \<Longrightarrow> (\<lambda>x. \<bar>f x\<bar>) =o O(g)"
   7.156    by (unfold bigo_def, auto)
   7.157  
   7.158  lemma bigo_elt_subset2 [intro]: "f \<in> g +o O(h) \<Longrightarrow> O(f) \<subseteq> O(g) + O(h)"
   7.159 @@ -257,16 +257,16 @@
   7.160    assume "f \<in> g +o O(h)"
   7.161    also have "\<dots> \<subseteq> O(g) + O(h)"
   7.162      by (auto del: subsetI)
   7.163 -  also have "\<dots> = O(\<lambda>x. abs (g x)) + O(\<lambda>x. abs (h x))"
   7.164 +  also have "\<dots> = O(\<lambda>x. \<bar>g x\<bar>) + O(\<lambda>x. \<bar>h x\<bar>)"
   7.165      apply (subst bigo_abs3 [symmetric])+
   7.166      apply (rule refl)
   7.167      done
   7.168 -  also have "\<dots> = O((\<lambda>x. abs (g x)) + (\<lambda>x. abs (h x)))"
   7.169 +  also have "\<dots> = O((\<lambda>x. \<bar>g x\<bar>) + (\<lambda>x. \<bar>h x\<bar>))"
   7.170      by (rule bigo_plus_eq [symmetric]) auto
   7.171    finally have "f \<in> \<dots>" .
   7.172    then have "O(f) \<subseteq> \<dots>"
   7.173      by (elim bigo_elt_subset)
   7.174 -  also have "\<dots> = O(\<lambda>x. abs (g x)) + O(\<lambda>x. abs (h x))"
   7.175 +  also have "\<dots> = O(\<lambda>x. \<bar>g x\<bar>) + O(\<lambda>x. \<bar>h x\<bar>)"
   7.176      by (rule bigo_plus_eq, auto)
   7.177    finally show ?thesis
   7.178      by (simp add: bigo_abs3 [symmetric])
   7.179 @@ -279,7 +279,7 @@
   7.180    apply (rule_tac x = "c * ca" in exI)
   7.181    apply (rule allI)
   7.182    apply (erule_tac x = x in allE)+
   7.183 -  apply (subgoal_tac "c * ca * abs (f x * g x) = (c * abs (f x)) * (ca * abs (g x))")
   7.184 +  apply (subgoal_tac "c * ca * \<bar>f x * g x\<bar> = (c * \<bar>f x\<bar>) * (ca * \<bar>g x\<bar>)")
   7.185    apply (erule ssubst)
   7.186    apply (subst abs_mult)
   7.187    apply (rule mult_mono)
   7.188 @@ -293,7 +293,7 @@
   7.189    apply (rule_tac x = c in exI)
   7.190    apply auto
   7.191    apply (drule_tac x = x in spec)
   7.192 -  apply (subgoal_tac "abs (f x) * abs (b x) \<le> abs (f x) * (c * abs (g x))")
   7.193 +  apply (subgoal_tac "\<bar>f x\<bar> * \<bar>b x\<bar> \<le> \<bar>f x\<bar> * (c * \<bar>g x\<bar>)")
   7.194    apply (force simp add: ac_simps)
   7.195    apply (rule mult_left_mono, assumption)
   7.196    apply (rule abs_ge_zero)
   7.197 @@ -450,7 +450,7 @@
   7.198    fixes c :: "'a::linordered_field"
   7.199    shows "c \<noteq> 0 \<Longrightarrow> (\<lambda>x. 1) \<in> O(\<lambda>x. c)"
   7.200    apply (simp add: bigo_def)
   7.201 -  apply (rule_tac x = "abs (inverse c)" in exI)
   7.202 +  apply (rule_tac x = "\<bar>inverse c\<bar>" in exI)
   7.203    apply (simp add: abs_mult [symmetric])
   7.204    done
   7.205  
   7.206 @@ -473,7 +473,7 @@
   7.207  
   7.208  lemma bigo_const_mult1: "(\<lambda>x. c * f x) \<in> O(f)"
   7.209    apply (simp add: bigo_def)
   7.210 -  apply (rule_tac x = "abs c" in exI)
   7.211 +  apply (rule_tac x = "\<bar>c\<bar>" in exI)
   7.212    apply (auto simp add: abs_mult [symmetric])
   7.213    done
   7.214  
   7.215 @@ -486,7 +486,7 @@
   7.216    fixes c :: "'a::linordered_field"
   7.217    shows "c \<noteq> 0 \<Longrightarrow> f \<in> O(\<lambda>x. c * f x)"
   7.218    apply (simp add: bigo_def)
   7.219 -  apply (rule_tac x = "abs (inverse c)" in exI)
   7.220 +  apply (rule_tac x = "\<bar>inverse c\<bar>" in exI)
   7.221    apply (simp add: abs_mult mult.assoc [symmetric])
   7.222    done
   7.223  
   7.224 @@ -516,15 +516,15 @@
   7.225    apply (auto intro!: simp add: bigo_def elt_set_times_def func_times)
   7.226    apply (rule_tac x = "\<lambda>y. inverse c * x y" in exI)
   7.227    apply (simp add: mult.assoc [symmetric] abs_mult)
   7.228 -  apply (rule_tac x = "abs (inverse c) * ca" in exI)
   7.229 +  apply (rule_tac x = "\<bar>inverse c\<bar> * ca" in exI)
   7.230    apply auto
   7.231    done
   7.232  
   7.233  lemma bigo_const_mult6 [intro]: "(\<lambda>x. c) *o O(f) \<subseteq> O(f)"
   7.234    apply (auto intro!: simp add: bigo_def elt_set_times_def func_times)
   7.235 -  apply (rule_tac x = "ca * abs c" in exI)
   7.236 +  apply (rule_tac x = "ca * \<bar>c\<bar>" in exI)
   7.237    apply (rule allI)
   7.238 -  apply (subgoal_tac "ca * abs c * abs (f x) = abs c * (ca * abs (f x))")
   7.239 +  apply (subgoal_tac "ca * \<bar>c\<bar> * \<bar>f x\<bar> = \<bar>c\<bar> * (ca * \<bar>f x\<bar>)")
   7.240    apply (erule ssubst)
   7.241    apply (subst abs_mult)
   7.242    apply (rule mult_left_mono)
   7.243 @@ -559,10 +559,10 @@
   7.244  subsection \<open>Setsum\<close>
   7.245  
   7.246  lemma bigo_setsum_main: "\<forall>x. \<forall>y \<in> A x. 0 \<le> h x y \<Longrightarrow>
   7.247 -    \<exists>c. \<forall>x. \<forall>y \<in> A x. abs (f x y) \<le> c * (h x y) \<Longrightarrow>
   7.248 +    \<exists>c. \<forall>x. \<forall>y \<in> A x. \<bar>f x y\<bar> \<le> c * h x y \<Longrightarrow>
   7.249        (\<lambda>x. \<Sum>y \<in> A x. f x y) =o O(\<lambda>x. \<Sum>y \<in> A x. h x y)"
   7.250    apply (auto simp add: bigo_def)
   7.251 -  apply (rule_tac x = "abs c" in exI)
   7.252 +  apply (rule_tac x = "\<bar>c\<bar>" in exI)
   7.253    apply (subst abs_of_nonneg) back back
   7.254    apply (rule setsum_nonneg)
   7.255    apply force
   7.256 @@ -583,7 +583,7 @@
   7.257    done
   7.258  
   7.259  lemma bigo_setsum1: "\<forall>x y. 0 \<le> h x y \<Longrightarrow>
   7.260 -    \<exists>c. \<forall>x y. abs (f x y) \<le> c * h x y \<Longrightarrow>
   7.261 +    \<exists>c. \<forall>x y. \<bar>f x y\<bar> \<le> c * h x y \<Longrightarrow>
   7.262        (\<lambda>x. \<Sum>y \<in> A x. f x y) =o O(\<lambda>x. \<Sum>y \<in> A x. h x y)"
   7.263    apply (rule bigo_setsum_main)
   7.264    apply force
   7.265 @@ -593,12 +593,12 @@
   7.266    done
   7.267  
   7.268  lemma bigo_setsum2: "\<forall>y. 0 \<le> h y \<Longrightarrow>
   7.269 -    \<exists>c. \<forall>y. abs (f y) \<le> c * (h y) \<Longrightarrow>
   7.270 +    \<exists>c. \<forall>y. \<bar>f y\<bar> \<le> c * (h y) \<Longrightarrow>
   7.271        (\<lambda>x. \<Sum>y \<in> A x. f y) =o O(\<lambda>x. \<Sum>y \<in> A x. h y)"
   7.272    by (rule bigo_setsum1) auto
   7.273  
   7.274  lemma bigo_setsum3: "f =o O(h) \<Longrightarrow>
   7.275 -    (\<lambda>x. \<Sum>y \<in> A x. l x y * f (k x y)) =o O(\<lambda>x. \<Sum>y \<in> A x. abs (l x y * h (k x y)))"
   7.276 +    (\<lambda>x. \<Sum>y \<in> A x. l x y * f (k x y)) =o O(\<lambda>x. \<Sum>y \<in> A x. \<bar>l x y * h (k x y)\<bar>)"
   7.277    apply (rule bigo_setsum1)
   7.278    apply (rule allI)+
   7.279    apply (rule abs_ge_zero)
   7.280 @@ -616,7 +616,7 @@
   7.281  lemma bigo_setsum4: "f =o g +o O(h) \<Longrightarrow>
   7.282      (\<lambda>x. \<Sum>y \<in> A x. l x y * f (k x y)) =o
   7.283        (\<lambda>x. \<Sum>y \<in> A x. l x y * g (k x y)) +o
   7.284 -        O(\<lambda>x. \<Sum>y \<in> A x. abs (l x y * h (k x y)))"
   7.285 +        O(\<lambda>x. \<Sum>y \<in> A x. \<bar>l x y * h (k x y)\<bar>)"
   7.286    apply (rule set_minus_imp_plus)
   7.287    apply (subst fun_diff_def)
   7.288    apply (subst setsum_subtractf [symmetric])
   7.289 @@ -631,7 +631,7 @@
   7.290        (\<lambda>x. \<Sum>y \<in> A x. l x y * f (k x y)) =o
   7.291          O(\<lambda>x. \<Sum>y \<in> A x. l x y * h (k x y))"
   7.292    apply (subgoal_tac "(\<lambda>x. \<Sum>y \<in> A x. l x y * h (k x y)) =
   7.293 -      (\<lambda>x. \<Sum>y \<in> A x. abs (l x y * h (k x y)))")
   7.294 +      (\<lambda>x. \<Sum>y \<in> A x. \<bar>l x y * h (k x y)\<bar>)")
   7.295    apply (erule ssubst)
   7.296    apply (erule bigo_setsum3)
   7.297    apply (rule ext)
   7.298 @@ -715,7 +715,7 @@
   7.299  definition lesso :: "('a \<Rightarrow> 'b::linordered_idom) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b"  (infixl "<o" 70)
   7.300    where "f <o g = (\<lambda>x. max (f x - g x) 0)"
   7.301  
   7.302 -lemma bigo_lesseq1: "f =o O(h) \<Longrightarrow> \<forall>x. abs (g x) \<le> abs (f x) \<Longrightarrow> g =o O(h)"
   7.303 +lemma bigo_lesseq1: "f =o O(h) \<Longrightarrow> \<forall>x. \<bar>g x\<bar> \<le> \<bar>f x\<bar> \<Longrightarrow> g =o O(h)"
   7.304    apply (unfold bigo_def)
   7.305    apply clarsimp
   7.306    apply (rule_tac x = c in exI)
   7.307 @@ -724,7 +724,7 @@
   7.308    apply (erule spec)+
   7.309    done
   7.310  
   7.311 -lemma bigo_lesseq2: "f =o O(h) \<Longrightarrow> \<forall>x. abs (g x) \<le> f x \<Longrightarrow> g =o O(h)"
   7.312 +lemma bigo_lesseq2: "f =o O(h) \<Longrightarrow> \<forall>x. \<bar>g x\<bar> \<le> f x \<Longrightarrow> g =o O(h)"
   7.313    apply (erule bigo_lesseq1)
   7.314    apply (rule allI)
   7.315    apply (drule_tac x = x in spec)
   7.316 @@ -741,7 +741,7 @@
   7.317    done
   7.318  
   7.319  lemma bigo_lesseq4: "f =o O(h) \<Longrightarrow>
   7.320 -    \<forall>x. 0 \<le> g x \<Longrightarrow> \<forall>x. g x \<le> abs (f x) \<Longrightarrow> g =o O(h)"
   7.321 +    \<forall>x. 0 \<le> g x \<Longrightarrow> \<forall>x. g x \<le> \<bar>f x\<bar> \<Longrightarrow> g =o O(h)"
   7.322    apply (erule bigo_lesseq1)
   7.323    apply (rule allI)
   7.324    apply (subst abs_of_nonneg)
   7.325 @@ -819,13 +819,13 @@
   7.326    apply (auto simp add: func_plus fun_diff_def algebra_simps split: split_max abs_split)
   7.327    done
   7.328  
   7.329 -lemma bigo_lesso5: "f <o g =o O(h) \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * abs (h x)"
   7.330 +lemma bigo_lesso5: "f <o g =o O(h) \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * \<bar>h x\<bar>"
   7.331    apply (simp only: lesso_def bigo_alt_def)
   7.332    apply clarsimp
   7.333    apply (rule_tac x = c in exI)
   7.334    apply (rule allI)
   7.335    apply (drule_tac x = x in spec)
   7.336 -  apply (subgoal_tac "abs (max (f x - g x) 0) = max (f x - g x) 0")
   7.337 +  apply (subgoal_tac "\<bar>max (f x - g x) 0\<bar> = max (f x - g x) 0")
   7.338    apply (clarsimp simp add: algebra_simps)
   7.339    apply (rule abs_of_nonneg)
   7.340    apply (rule max.cobounded2)
   7.341 @@ -856,7 +856,7 @@
   7.342    apply (rule order_le_less_trans)
   7.343    apply assumption
   7.344    apply (rule order_less_le_trans)
   7.345 -  apply (subgoal_tac "c * abs (g n) < c * (r / c)")
   7.346 +  apply (subgoal_tac "c * \<bar>g n\<bar> < c * (r / c)")
   7.347    apply assumption
   7.348    apply (erule mult_strict_left_mono)
   7.349    apply assumption
     8.1 --- a/src/HOL/Library/Extended_Real.thy	Mon Dec 28 01:26:34 2015 +0100
     8.2 +++ b/src/HOL/Library/Extended_Real.thy	Mon Dec 28 01:28:28 2015 +0100
     8.3 @@ -3484,7 +3484,7 @@
     8.4    fixes a :: real
     8.5    assumes "a \<le> x"
     8.6      and "x \<le> b"
     8.7 -  shows "abs x \<le> max (abs a) (abs b)"
     8.8 +  shows "\<bar>x\<bar> \<le> max \<bar>a\<bar> \<bar>b\<bar>"
     8.9    by (metis abs_less_iff assms leI le_max_iff_disj
    8.10      less_eq_real_def less_le_not_le less_minus_iff minus_minus)
    8.11  
     9.1 --- a/src/HOL/Library/Float.thy	Mon Dec 28 01:26:34 2015 +0100
     9.2 +++ b/src/HOL/Library/Float.thy	Mon Dec 28 01:28:28 2015 +0100
     9.3 @@ -110,7 +110,7 @@
     9.4  lemma minus_float[simp]: "x \<in> float \<Longrightarrow> y \<in> float \<Longrightarrow> x - y \<in> float"
     9.5    using plus_float [of x "- y"] by simp
     9.6  
     9.7 -lemma abs_float[simp]: "x \<in> float \<Longrightarrow> abs x \<in> float"
     9.8 +lemma abs_float[simp]: "x \<in> float \<Longrightarrow> \<bar>x\<bar> \<in> float"
     9.9    by (cases x rule: linorder_cases[of 0]) auto
    9.10  
    9.11  lemma sgn_of_float[simp]: "x \<in> float \<Longrightarrow> sgn x \<in> float"
    9.12 @@ -594,7 +594,7 @@
    9.13  qualified lemma compute_is_float_zero[code]: "is_float_zero (Float m e) \<longleftrightarrow> 0 = m"
    9.14    by transfer (auto simp add: is_float_zero_def)
    9.15  
    9.16 -qualified lemma compute_float_abs[code]: "abs (Float m e) = Float (abs m) e"
    9.17 +qualified lemma compute_float_abs[code]: "\<bar>Float m e\<bar> = Float \<bar>m\<bar> e"
    9.18    by transfer (simp add: abs_mult)
    9.19  
    9.20  qualified lemma compute_float_eq[code]: "equal_class.equal f g = is_float_zero (f - g)"
    9.21 @@ -1186,7 +1186,7 @@
    9.22  begin
    9.23  
    9.24  qualified lemma compute_float_round_down[code]:
    9.25 -  "float_round_down prec (Float m e) = (let d = bitlen (abs m) - int prec in
    9.26 +  "float_round_down prec (Float m e) = (let d = bitlen \<bar>m\<bar> - int prec in
    9.27      if 0 < d then Float (div_twopow m (nat d)) (e + d)
    9.28               else Float m e)"
    9.29    using Float.compute_float_down[of "prec - bitlen \<bar>m\<bar> - e" m e, symmetric]
    9.30 @@ -1543,8 +1543,8 @@
    9.31  
    9.32  lemma sum_neq_zeroI:
    9.33    fixes a k :: real
    9.34 -  shows "abs a \<ge> k \<Longrightarrow> abs b < k \<Longrightarrow> a + b \<noteq> 0"
    9.35 -    and "abs a > k \<Longrightarrow> abs b \<le> k \<Longrightarrow> a + b \<noteq> 0"
    9.36 +  shows "\<bar>a\<bar> \<ge> k \<Longrightarrow> \<bar>b\<bar> < k \<Longrightarrow> a + b \<noteq> 0"
    9.37 +    and "\<bar>a\<bar> > k \<Longrightarrow> \<bar>b\<bar> \<le> k \<Longrightarrow> a + b \<noteq> 0"
    9.38    by auto
    9.39  
    9.40  lemma abs_real_le_2_powr_bitlen[simp]: "\<bar>real_of_int m2\<bar> < 2 powr real_of_int (bitlen \<bar>m2\<bar>)"
    9.41 @@ -1564,7 +1564,7 @@
    9.42    fixes ai p q :: int
    9.43      and a b :: real
    9.44    assumes "a * 2 powr p = ai"
    9.45 -    and b_le_1: "abs (b * 2 powr (p + 1)) \<le> 1"
    9.46 +    and b_le_1: "\<bar>b * 2 powr (p + 1)\<bar> \<le> 1"
    9.47      and leqp: "q \<le> p"
    9.48    shows "\<lfloor>(a + b) * 2 powr q\<rfloor> = \<lfloor>(2 * ai + sgn b) * 2 powr (q - p - 1)\<rfloor>"
    9.49  proof -
    9.50 @@ -1576,7 +1576,7 @@
    9.51        by (simp add: assms(1)[symmetric] powr_add[symmetric] algebra_simps powr_mult_base)
    9.52    next
    9.53      case 2
    9.54 -    then have "b * 2 powr p < abs (b * 2 powr (p + 1))"
    9.55 +    then have "b * 2 powr p < \<bar>b * 2 powr (p + 1)\<bar>"
    9.56        by simp
    9.57      also note b_le_1
    9.58      finally have b_less_1: "b * 2 powr real_of_int p < 1" .
    9.59 @@ -1635,7 +1635,7 @@
    9.60  lemma log2_abs_int_add_less_half_sgn_eq:
    9.61    fixes ai :: int
    9.62      and b :: real
    9.63 -  assumes "abs b \<le> 1/2"
    9.64 +  assumes "\<bar>b\<bar> \<le> 1/2"
    9.65      and "ai \<noteq> 0"
    9.66    shows "\<lfloor>log 2 \<bar>real_of_int ai + b\<bar>\<rfloor> = \<lfloor>log 2 \<bar>ai + sgn b / 2\<bar>\<rfloor>"
    9.67  proof (cases "b = 0")
    9.68 @@ -1664,21 +1664,21 @@
    9.69    have "\<bar>ai\<bar> = 2 powr k + r"
    9.70      using \<open>k \<ge> 0\<close> by (auto simp: k_def r_def powr_realpow[symmetric])
    9.71  
    9.72 -  have pos: "abs b < 1 \<Longrightarrow> 0 < 2 powr k + (r + b)" for b :: real
    9.73 +  have pos: "\<bar>b\<bar> < 1 \<Longrightarrow> 0 < 2 powr k + (r + b)" for b :: real
    9.74      using \<open>0 \<le> k\<close> \<open>ai \<noteq> 0\<close>
    9.75      by (auto simp add: r_def powr_realpow[symmetric] abs_if sgn_if algebra_simps
    9.76        split: split_if_asm)
    9.77    have less: "\<bar>sgn ai * b\<bar> < 1"
    9.78      and less': "\<bar>sgn (sgn ai * b) / 2\<bar> < 1"
    9.79 -    using \<open>abs b \<le> _\<close> by (auto simp: abs_if sgn_if split: split_if_asm)
    9.80 +    using \<open>\<bar>b\<bar> \<le> _\<close> by (auto simp: abs_if sgn_if split: split_if_asm)
    9.81  
    9.82 -  have floor_eq: "\<And>b::real. abs b \<le> 1 / 2 \<Longrightarrow>
    9.83 +  have floor_eq: "\<And>b::real. \<bar>b\<bar> \<le> 1 / 2 \<Longrightarrow>
    9.84        \<lfloor>log 2 (1 + (r + b) / 2 powr k)\<rfloor> = (if r = 0 \<and> b < 0 then -1 else 0)"
    9.85      using \<open>k \<ge> 0\<close> r r_le
    9.86      by (auto simp: floor_log_eq_powr_iff powr_minus_divide field_simps sgn_if)
    9.87  
    9.88    from \<open>real_of_int \<bar>ai\<bar> = _\<close> have "\<bar>ai + b\<bar> = 2 powr k + (r + sgn ai * b)"
    9.89 -    using \<open>abs b <= _\<close> \<open>0 \<le> k\<close> r
    9.90 +    using \<open>\<bar>b\<bar> <= _\<close> \<open>0 \<le> k\<close> r
    9.91      by (auto simp add: sgn_if abs_if)
    9.92    also have "\<lfloor>log 2 \<dots>\<rfloor> = \<lfloor>log 2 (2 powr k + r + sgn (sgn ai * b) / 2)\<rfloor>"
    9.93    proof -
    9.94 @@ -1690,14 +1690,14 @@
    9.95      also
    9.96      let ?if = "if r = 0 \<and> sgn ai * b < 0 then -1 else 0"
    9.97      have "\<lfloor>log 2 (1 + (r + sgn ai * b) / 2 powr k)\<rfloor> = ?if"
    9.98 -      using \<open>abs b <= _\<close>
    9.99 +      using \<open>\<bar>b\<bar> <= _\<close>
   9.100        by (intro floor_eq) (auto simp: abs_mult sgn_if)
   9.101      also
   9.102      have "\<dots> = \<lfloor>log 2 (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k)\<rfloor>"
   9.103        by (subst floor_eq) (auto simp: sgn_if)
   9.104      also have "k + \<dots> = \<lfloor>log 2 (2 powr k * (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k))\<rfloor>"
   9.105        unfolding floor_add2[symmetric]
   9.106 -      using pos[OF less'] \<open>abs b \<le> _\<close>
   9.107 +      using pos[OF less'] \<open>\<bar>b\<bar> \<le> _\<close>
   9.108        by (simp add: field_simps add_log_eq_powr)
   9.109      also have "2 powr k * (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k) =
   9.110          2 powr k + r + sgn (sgn ai * b) / 2"
   9.111 @@ -1885,7 +1885,7 @@
   9.112  lemma float_zero[simp]: "real_of_float (Float 0 e) = 0"
   9.113    by simp
   9.114  
   9.115 -lemma abs_div_2_less: "a \<noteq> 0 \<Longrightarrow> a \<noteq> -1 \<Longrightarrow> abs((a::int) div 2) < abs a"
   9.116 +lemma abs_div_2_less: "a \<noteq> 0 \<Longrightarrow> a \<noteq> -1 \<Longrightarrow> \<bar>(a::int) div 2\<bar> < \<bar>a\<bar>"
   9.117    by arith
   9.118  
   9.119  lemma lapprox_rat: "real_of_float (lapprox_rat prec x y) \<le> real_of_int x / real_of_int y"
    10.1 --- a/src/HOL/Library/Fundamental_Theorem_Algebra.thy	Mon Dec 28 01:26:34 2015 +0100
    10.2 +++ b/src/HOL/Library/Fundamental_Theorem_Algebra.thy	Mon Dec 28 01:28:28 2015 +0100
    10.3 @@ -136,9 +136,9 @@
    10.4    proof -
    10.5      from that z xy have "2 * x \<le> 1" "2 * x \<ge> -1" "2 * y \<le> 1" "2 * y \<ge> -1"
    10.6        by (simp_all add: cmod_def power2_eq_square algebra_simps)
    10.7 -    then have "abs (2 * x) \<le> 1" "abs (2 * y) \<le> 1"
    10.8 +    then have "\<bar>2 * x\<bar> \<le> 1" "\<bar>2 * y\<bar> \<le> 1"
    10.9        by simp_all
   10.10 -    then have "(abs (2 * x))\<^sup>2 \<le> 1\<^sup>2" "(abs (2 * y))\<^sup>2 \<le> 1\<^sup>2"
   10.11 +    then have "\<bar>2 * x\<bar>\<^sup>2 \<le> 1\<^sup>2" "\<bar>2 * y\<bar>\<^sup>2 \<le> 1\<^sup>2"
   10.12        by - (rule power_mono, simp, simp)+
   10.13      then have th0: "4 * x\<^sup>2 \<le> 1" "4 * y\<^sup>2 \<le> 1"
   10.14        by (simp_all add: power_mult_distrib)
    11.1 --- a/src/HOL/Library/Infinite_Set.thy	Mon Dec 28 01:26:34 2015 +0100
    11.2 +++ b/src/HOL/Library/Infinite_Set.thy	Mon Dec 28 01:28:28 2015 +0100
    11.3 @@ -56,12 +56,12 @@
    11.4  lemma infinite_int_iff_infinite_nat_abs: "infinite (S::int set) \<longleftrightarrow> infinite ((nat o abs) ` S)"
    11.5    by (auto simp: transfer_nat_int_set_relations o_def image_comp dest: finite_image_absD)
    11.6  
    11.7 -proposition infinite_int_iff_unbounded_le: "infinite (S::int set) \<longleftrightarrow> (\<forall>m. \<exists>n. abs n \<ge> m \<and> n \<in> S)"
    11.8 +proposition infinite_int_iff_unbounded_le: "infinite (S::int set) \<longleftrightarrow> (\<forall>m. \<exists>n. \<bar>n\<bar> \<ge> m \<and> n \<in> S)"
    11.9    apply (simp add: infinite_int_iff_infinite_nat_abs infinite_nat_iff_unbounded_le o_def image_def)
   11.10    apply (metis abs_ge_zero nat_le_eq_zle le_nat_iff)
   11.11    done
   11.12  
   11.13 -proposition infinite_int_iff_unbounded: "infinite (S::int set) \<longleftrightarrow> (\<forall>m. \<exists>n. abs n > m \<and> n \<in> S)"
   11.14 +proposition infinite_int_iff_unbounded: "infinite (S::int set) \<longleftrightarrow> (\<forall>m. \<exists>n. \<bar>n\<bar> > m \<and> n \<in> S)"
   11.15    apply (simp add: infinite_int_iff_infinite_nat_abs infinite_nat_iff_unbounded o_def image_def)
   11.16    apply (metis (full_types) nat_le_iff nat_mono not_le)
   11.17    done
    12.1 --- a/src/HOL/Library/Polynomial.thy	Mon Dec 28 01:26:34 2015 +0100
    12.2 +++ b/src/HOL/Library/Polynomial.thy	Mon Dec 28 01:28:28 2015 +0100
    12.3 @@ -1062,7 +1062,7 @@
    12.4    "x \<le> y \<longleftrightarrow> x = y \<or> pos_poly (y - x)"
    12.5  
    12.6  definition
    12.7 -  "abs (x::'a poly) = (if x < 0 then - x else x)"
    12.8 +  "\<bar>x::'a poly\<bar> = (if x < 0 then - x else x)"
    12.9  
   12.10  definition
   12.11    "sgn (x::'a poly) = (if x = 0 then 0 else if 0 < x then 1 else - 1)"
    13.1 --- a/src/HOL/Library/positivstellensatz.ML	Mon Dec 28 01:26:34 2015 +0100
    13.2 +++ b/src/HOL/Library/positivstellensatz.ML	Mon Dec 28 01:28:28 2015 +0100
    13.3 @@ -221,12 +221,12 @@
    13.4        @{thms "HOL.all_simps"(1-4)} @ @{thms "ex_simps"(1-4)});
    13.5  
    13.6  val real_abs_thms1 = @{lemma
    13.7 -  "((-1 * abs(x::real) >= r) = (-1 * x >= r & 1 * x >= r))" and
    13.8 -  "((-1 * abs(x) + a >= r) = (a + -1 * x >= r & a + 1 * x >= r))" and
    13.9 -  "((a + -1 * abs(x) >= r) = (a + -1 * x >= r & a + 1 * x >= r))" and
   13.10 -  "((a + -1 * abs(x) + b >= r) = (a + -1 * x + b >= r & a + 1 * x + b >= r))" and
   13.11 -  "((a + b + -1 * abs(x) >= r) = (a + b + -1 * x >= r & a + b + 1 * x >= r))" and
   13.12 -  "((a + b + -1 * abs(x) + c >= r) = (a + b + -1 * x + c >= r & a + b + 1 * x + c >= r))" and
   13.13 +  "((-1 * \<bar>x::real\<bar> >= r) = (-1 * x >= r & 1 * x >= r))" and
   13.14 +  "((-1 * \<bar>x\<bar> + a >= r) = (a + -1 * x >= r & a + 1 * x >= r))" and
   13.15 +  "((a + -1 * \<bar>x\<bar> >= r) = (a + -1 * x >= r & a + 1 * x >= r))" and
   13.16 +  "((a + -1 * \<bar>x\<bar> + b >= r) = (a + -1 * x + b >= r & a + 1 * x + b >= r))" and
   13.17 +  "((a + b + -1 * \<bar>x\<bar> >= r) = (a + b + -1 * x >= r & a + b + 1 * x >= r))" and
   13.18 +  "((a + b + -1 * \<bar>x\<bar> + c >= r) = (a + b + -1 * x + c >= r & a + b + 1 * x + c >= r))" and
   13.19    "((-1 * max x y >= r) = (-1 * x >= r & -1 * y >= r))" and
   13.20    "((-1 * max x y + a >= r) = (a + -1 * x >= r & a + -1 * y >= r))" and
   13.21    "((a + -1 * max x y >= r) = (a + -1 * x >= r & a + -1 * y >= r))" and
   13.22 @@ -245,12 +245,12 @@
   13.23    "((a + min x y + b >= r) = (a + x + b >= r & a + y  + b >= r))" and
   13.24    "((a + b + min x y >= r) = (a + b + x >= r & a + b + y >= r))" and
   13.25    "((a + b + min x y + c >= r) = (a + b + x + c >= r & a + b + y + c >= r))" and
   13.26 -  "((-1 * abs(x) > r) = (-1 * x > r & 1 * x > r))" and
   13.27 -  "((-1 * abs(x) + a > r) = (a + -1 * x > r & a + 1 * x > r))" and
   13.28 -  "((a + -1 * abs(x) > r) = (a + -1 * x > r & a + 1 * x > r))" and
   13.29 -  "((a + -1 * abs(x) + b > r) = (a + -1 * x + b > r & a + 1 * x + b > r))" and
   13.30 -  "((a + b + -1 * abs(x) > r) = (a + b + -1 * x > r & a + b + 1 * x > r))" and
   13.31 -  "((a + b + -1 * abs(x) + c > r) = (a + b + -1 * x + c > r & a + b + 1 * x + c > r))" and
   13.32 +  "((-1 * \<bar>x\<bar> > r) = (-1 * x > r & 1 * x > r))" and
   13.33 +  "((-1 * \<bar>x\<bar> + a > r) = (a + -1 * x > r & a + 1 * x > r))" and
   13.34 +  "((a + -1 * \<bar>x\<bar> > r) = (a + -1 * x > r & a + 1 * x > r))" and
   13.35 +  "((a + -1 * \<bar>x\<bar> + b > r) = (a + -1 * x + b > r & a + 1 * x + b > r))" and
   13.36 +  "((a + b + -1 * \<bar>x\<bar> > r) = (a + b + -1 * x > r & a + b + 1 * x > r))" and
   13.37 +  "((a + b + -1 * \<bar>x\<bar> + c > r) = (a + b + -1 * x + c > r & a + b + 1 * x + c > r))" and
   13.38    "((-1 * max x y > r) = ((-1 * x > r) & -1 * y > r))" and
   13.39    "((-1 * max x y + a > r) = (a + -1 * x > r & a + -1 * y > r))" and
   13.40    "((a + -1 * max x y > r) = (a + -1 * x > r & a + -1 * y > r))" and
   13.41 @@ -265,7 +265,7 @@
   13.42    "((a + b + min x y + c > r) = (a + b + x + c > r & a + b + y + c > r))"
   13.43    by auto};
   13.44  
   13.45 -val abs_split' = @{lemma "P (abs (x::'a::linordered_idom)) == (x >= 0 & P x | x < 0 & P (-x))"
   13.46 +val abs_split' = @{lemma "P \<bar>x::'a::linordered_idom\<bar> == (x >= 0 & P x | x < 0 & P (-x))"
   13.47    by (atomize (full)) (auto split add: abs_split)};
   13.48  
   13.49  val max_split = @{lemma "P (max x y) == ((x::'a::linorder) <= y & P y | x > y & P x)"
    14.1 --- a/src/HOL/Matrix_LP/ComputeFloat.thy	Mon Dec 28 01:26:34 2015 +0100
    14.2 +++ b/src/HOL/Matrix_LP/ComputeFloat.thy	Mon Dec 28 01:28:28 2015 +0100
    14.3 @@ -106,7 +106,7 @@
    14.4  lemma int_mod_zmod: "int (a mod b) = (int a) mod (int b)"
    14.5  by (rule zmod_int)
    14.6  
    14.7 -lemma abs_div_2_less: "a \<noteq> 0 \<Longrightarrow> a \<noteq> -1 \<Longrightarrow> abs((a::int) div 2) < abs a"
    14.8 +lemma abs_div_2_less: "a \<noteq> 0 \<Longrightarrow> a \<noteq> -1 \<Longrightarrow> \<bar>(a::int) div 2\<bar> < \<bar>a\<bar>"
    14.9  by arith
   14.10  
   14.11  lemma norm_0_1: "(1::_::numeral) = Numeral1"
   14.12 @@ -195,7 +195,7 @@
   14.13    by (simp add: float_def mult_le_0_iff) (simp add: not_less [symmetric])
   14.14  
   14.15  lemma float_abs:
   14.16 -  "abs (float (a,b)) = (if 0 <= a then (float (a,b)) else (float (-a,b)))"
   14.17 +  "\<bar>float (a,b)\<bar> = (if 0 <= a then (float (a,b)) else (float (-a,b)))"
   14.18    by (simp add: float_def abs_if mult_less_0_iff not_less)
   14.19  
   14.20  lemma float_zero:
    15.1 --- a/src/HOL/Matrix_LP/LP.thy	Mon Dec 28 01:26:34 2015 +0100
    15.2 +++ b/src/HOL/Matrix_LP/LP.thy	Mon Dec 28 01:28:28 2015 +0100
    15.3 @@ -19,47 +19,47 @@
    15.4    assumes
    15.5    "A * x \<le> (b::'a::lattice_ring)"
    15.6    "0 \<le> y"
    15.7 -  "abs (A - A') \<le> \<delta>_A"
    15.8 +  "\<bar>A - A'\<bar> \<le> \<delta>_A"
    15.9    "b \<le> b'"
   15.10 -  "abs (c - c') \<le> \<delta>_c"
   15.11 -  "abs x \<le> r"
   15.12 +  "\<bar>c - c'\<bar> \<le> \<delta>_c"
   15.13 +  "\<bar>x\<bar> \<le> r"
   15.14    shows
   15.15 -  "c * x \<le> y * b' + (y * \<delta>_A + abs (y * A' - c') + \<delta>_c) * r"
   15.16 +  "c * x \<le> y * b' + (y * \<delta>_A + \<bar>y * A' - c'\<bar> + \<delta>_c) * r"
   15.17  proof -
   15.18    from assms have 1: "y * b <= y * b'" by (simp add: mult_left_mono)
   15.19    from assms have 2: "y * (A * x) <= y * b" by (simp add: mult_left_mono) 
   15.20    have 3: "y * (A * x) = c * x + (y * (A - A') + (y * A' - c') + (c'-c)) * x" by (simp add: algebra_simps)  
   15.21    from 1 2 3 have 4: "c * x + (y * (A - A') + (y * A' - c') + (c'-c)) * x <= y * b'" by simp
   15.22 -  have 5: "c * x <= y * b' + abs((y * (A - A') + (y * A' - c') + (c'-c)) * x)"
   15.23 +  have 5: "c * x <= y * b' + \<bar>(y * (A - A') + (y * A' - c') + (c'-c)) * x\<bar>"
   15.24      by (simp only: 4 estimate_by_abs)  
   15.25 -  have 6: "abs((y * (A - A') + (y * A' - c') + (c'-c)) * x) <= abs (y * (A - A') + (y * A' - c') + (c'-c)) * abs x"
   15.26 +  have 6: "\<bar>(y * (A - A') + (y * A' - c') + (c'-c)) * x\<bar> <= \<bar>y * (A - A') + (y * A' - c') + (c'-c)\<bar> * \<bar>x\<bar>"
   15.27      by (simp add: abs_le_mult)
   15.28 -  have 7: "(abs (y * (A - A') + (y * A' - c') + (c'-c))) * abs x <= (abs (y * (A-A') + (y*A'-c')) + abs(c'-c)) * abs x"
   15.29 +  have 7: "(\<bar>y * (A - A') + (y * A' - c') + (c'-c)\<bar>) * \<bar>x\<bar> <= (\<bar>y * (A-A') + (y*A'-c')\<bar> + \<bar>c' - c\<bar>) * \<bar>x\<bar>"
   15.30      by(rule abs_triangle_ineq [THEN mult_right_mono]) simp
   15.31 -  have 8: " (abs (y * (A-A') + (y*A'-c')) + abs(c'-c)) * abs x <=  (abs (y * (A-A')) + abs (y*A'-c') + abs(c'-c)) * abs x"
   15.32 +  have 8: "(\<bar>y * (A-A') + (y*A'-c')\<bar> + \<bar>c' - c\<bar>) * \<bar>x\<bar> <= (\<bar>y * (A-A')\<bar> + \<bar>y*A'-c'\<bar> + \<bar>c' - c\<bar>) * \<bar>x\<bar>"
   15.33      by (simp add: abs_triangle_ineq mult_right_mono)    
   15.34 -  have 9: "(abs (y * (A-A')) + abs (y*A'-c') + abs(c'-c)) * abs x <= (abs y * abs (A-A') + abs (y*A'-c') + abs (c'-c)) * abs x"
   15.35 +  have 9: "(\<bar>y * (A-A')\<bar> + \<bar>y*A'-c'\<bar> + \<bar>c'-c\<bar>) * \<bar>x\<bar> <= (\<bar>y\<bar> * \<bar>A-A'\<bar> + \<bar>y*A'-c'\<bar> + \<bar>c'-c\<bar>) * \<bar>x\<bar>"
   15.36      by (simp add: abs_le_mult mult_right_mono)  
   15.37    have 10: "c'-c = -(c-c')" by (simp add: algebra_simps)
   15.38 -  have 11: "abs (c'-c) = abs (c-c')" 
   15.39 +  have 11: "\<bar>c'-c\<bar> = \<bar>c-c'\<bar>"
   15.40      by (subst 10, subst abs_minus_cancel, simp)
   15.41 -  have 12: "(abs y * abs (A-A') + abs (y*A'-c') + abs (c'-c)) * abs x <= (abs y * abs (A-A') + abs (y*A'-c') + \<delta>_c) * abs x"
   15.42 +  have 12: "(\<bar>y\<bar> * \<bar>A-A'\<bar> + \<bar>y*A'-c'\<bar> + \<bar>c'-c\<bar>) * \<bar>x\<bar> <= (\<bar>y\<bar> * \<bar>A-A'\<bar> + \<bar>y*A'-c'\<bar> + \<delta>_c) * \<bar>x\<bar>"
   15.43      by (simp add: 11 assms mult_right_mono)
   15.44 -  have 13: "(abs y * abs (A-A') + abs (y*A'-c') + \<delta>_c) * abs x <= (abs y * \<delta>_A + abs (y*A'-c') + \<delta>_c) * abs x"
   15.45 +  have 13: "(\<bar>y\<bar> * \<bar>A-A'\<bar> + \<bar>y*A'-c'\<bar> + \<delta>_c) * \<bar>x\<bar> <= (\<bar>y\<bar> * \<delta>_A + \<bar>y*A'-c'\<bar> + \<delta>_c) * \<bar>x\<bar>"
   15.46      by (simp add: assms mult_right_mono mult_left_mono)  
   15.47 -  have r: "(abs y * \<delta>_A + abs (y*A'-c') + \<delta>_c) * abs x <=  (abs y * \<delta>_A + abs (y*A'-c') + \<delta>_c) * r"
   15.48 +  have r: "(\<bar>y\<bar> * \<delta>_A + \<bar>y*A'-c'\<bar> + \<delta>_c) * \<bar>x\<bar> <= (\<bar>y\<bar> * \<delta>_A + \<bar>y*A'-c'\<bar> + \<delta>_c) * r"
   15.49      apply (rule mult_left_mono)
   15.50      apply (simp add: assms)
   15.51      apply (rule_tac add_mono[of "0::'a" _ "0", simplified])+
   15.52      apply (rule mult_left_mono[of "0" "\<delta>_A", simplified])
   15.53      apply (simp_all)
   15.54 -    apply (rule order_trans[where y="abs (A-A')"], simp_all add: assms)
   15.55 -    apply (rule order_trans[where y="abs (c-c')"], simp_all add: assms)
   15.56 +    apply (rule order_trans[where y="\<bar>A-A'\<bar>"], simp_all add: assms)
   15.57 +    apply (rule order_trans[where y="\<bar>c-c'\<bar>"], simp_all add: assms)
   15.58      done    
   15.59 -  from 6 7 8 9 12 13 r have 14:" abs((y * (A - A') + (y * A' - c') + (c'-c)) * x) <=(abs y * \<delta>_A + abs (y*A'-c') + \<delta>_c) * r"     
   15.60 +  from 6 7 8 9 12 13 r have 14: "\<bar>(y * (A - A') + (y * A' - c') + (c'-c)) * x\<bar> <= (\<bar>y\<bar> * \<delta>_A + \<bar>y*A'-c'\<bar> + \<delta>_c) * r"
   15.61      by (simp)
   15.62    show ?thesis
   15.63 -    apply (rule le_add_right_mono[of _ _ "abs((y * (A - A') + (y * A' - c') + (c'-c)) * x)"])
   15.64 +    apply (rule le_add_right_mono[of _ _ "\<bar>(y * (A - A') + (y * A' - c') + (c'-c)) * x\<bar>"])
   15.65      apply (simp_all only: 5 14[simplified abs_of_nonneg[of y, simplified assms]])
   15.66      done
   15.67  qed
   15.68 @@ -68,14 +68,14 @@
   15.69    assumes
   15.70    "A1 <= (A::'a::lattice_ring)"
   15.71    "A <= A2" 
   15.72 -  shows "abs (A-A1) <= A2-A1"
   15.73 +  shows "\<bar>A-A1\<bar> <= A2-A1"
   15.74  proof -
   15.75    have "0 <= A - A1"    
   15.76    proof -
   15.77      from assms add_right_mono [of A1 A "- A1"] show ?thesis by simp
   15.78    qed
   15.79 -  then have "abs (A-A1) = A-A1" by (rule abs_of_nonneg)
   15.80 -  with assms show "abs (A-A1) <= (A2-A1)" by simp
   15.81 +  then have "\<bar>A-A1\<bar> = A-A1" by (rule abs_of_nonneg)
   15.82 +  with assms show "\<bar>A-A1\<bar> <= (A2-A1)" by simp
   15.83  qed
   15.84  
   15.85  lemma mult_le_prts:
    16.1 --- a/src/HOL/Matrix_LP/Matrix.thy	Mon Dec 28 01:26:34 2015 +0100
    16.2 +++ b/src/HOL/Matrix_LP/Matrix.thy	Mon Dec 28 01:28:28 2015 +0100
    16.3 @@ -918,8 +918,8 @@
    16.4  apply (simp add: move_matrix_def)
    16.5  apply (auto)
    16.6  by (subst RepAbs_matrix,
    16.7 -  rule exI[of _ "(nrows A)+(nat (abs y))"], auto, rule nrows, arith,
    16.8 -  rule exI[of _ "(ncols A)+(nat (abs x))"], auto, rule ncols, arith)+
    16.9 +  rule exI[of _ "(nrows A)+(nat \<bar>y\<bar>)"], auto, rule nrows, arith,
   16.10 +  rule exI[of _ "(ncols A)+(nat \<bar>x\<bar>)"], auto, rule ncols, arith)+
   16.11  
   16.12  lemma move_matrix_0_0[simp]: "move_matrix A 0 0 = A"
   16.13  by (simp add: move_matrix_def)
   16.14 @@ -1496,7 +1496,7 @@
   16.15  begin
   16.16  
   16.17  definition
   16.18 -  abs_matrix_def: "abs (A :: 'a matrix) = sup A (- A)"
   16.19 +  abs_matrix_def: "\<bar>A :: 'a matrix\<bar> = sup A (- A)"
   16.20  
   16.21  instance ..
   16.22  
   16.23 @@ -1613,7 +1613,7 @@
   16.24  instance matrix :: (lattice_ring) lattice_ring
   16.25  proof
   16.26    fix A B C :: "('a :: lattice_ring) matrix"
   16.27 -  show "abs A = sup A (-A)" 
   16.28 +  show "\<bar>A\<bar> = sup A (-A)" 
   16.29      by (simp add: abs_matrix_def)
   16.30  qed
   16.31  
   16.32 @@ -1814,7 +1814,7 @@
   16.33  lemma Rep_minus[simp]: "Rep_matrix (-(A::_::group_add)) x y = - (Rep_matrix A x y)"
   16.34  by (simp add: minus_matrix_def)
   16.35  
   16.36 -lemma Rep_abs[simp]: "Rep_matrix (abs (A::_::lattice_ab_group_add)) x y = abs (Rep_matrix A x y)"
   16.37 +lemma Rep_abs[simp]: "Rep_matrix \<bar>A::_::lattice_ab_group_add\<bar> x y = \<bar>Rep_matrix A x y\<bar>"
   16.38  by (simp add: abs_lattice sup_matrix_def)
   16.39  
   16.40  end
    17.1 --- a/src/HOL/Matrix_LP/SparseMatrix.thy	Mon Dec 28 01:26:34 2015 +0100
    17.2 +++ b/src/HOL/Matrix_LP/SparseMatrix.thy	Mon Dec 28 01:28:28 2015 +0100
    17.3 @@ -108,7 +108,7 @@
    17.4  primrec abs_spvec :: "('a::lattice_ab_group_add_abs) spvec \<Rightarrow> 'a spvec"
    17.5  where
    17.6    "abs_spvec [] = []"
    17.7 -| "abs_spvec (a#as) = (fst a, abs (snd a))#(abs_spvec as)"
    17.8 +| "abs_spvec (a#as) = (fst a, \<bar>snd a\<bar>)#(abs_spvec as)"
    17.9  
   17.10  lemma sparse_row_vector_minus: 
   17.11    "sparse_row_vector (minus_spvec v) = - (sparse_row_vector v)"
   17.12 @@ -127,7 +127,7 @@
   17.13    (*FIXME move*)
   17.14  
   17.15  lemma sparse_row_vector_abs:
   17.16 -  "sorted_spvec (v :: 'a::lattice_ring spvec) \<Longrightarrow> sparse_row_vector (abs_spvec v) = abs (sparse_row_vector v)"
   17.17 +  "sorted_spvec (v :: 'a::lattice_ring spvec) \<Longrightarrow> sparse_row_vector (abs_spvec v) = \<bar>sparse_row_vector v\<bar>"
   17.18    apply (induct v)
   17.19    apply simp_all
   17.20    apply (frule_tac sorted_spvec_cons1, simp)
   17.21 @@ -770,7 +770,7 @@
   17.22  qed
   17.23      
   17.24  lemma sparse_row_matrix_abs:
   17.25 -  "sorted_spvec A \<Longrightarrow> sorted_spmat A \<Longrightarrow> sparse_row_matrix (abs_spmat A) = abs (sparse_row_matrix A)"
   17.26 +  "sorted_spvec A \<Longrightarrow> sorted_spmat A \<Longrightarrow> sparse_row_matrix (abs_spmat A) = \<bar>sparse_row_matrix A\<bar>"
   17.27    apply (induct A)
   17.28    apply (simp_all add: sparse_row_vector_abs sparse_row_matrix_cons)
   17.29    apply (frule_tac sorted_spvec_cons1, simp)
   17.30 @@ -1060,7 +1060,7 @@
   17.31    "A <= sparse_row_matrix A2"
   17.32    "sparse_row_matrix c1 <= c"
   17.33    "c <= sparse_row_matrix c2"
   17.34 -  "abs x \<le> sparse_row_matrix r"
   17.35 +  "\<bar>x\<bar> \<le> sparse_row_matrix r"
   17.36    shows
   17.37    "c * x \<le> sparse_row_matrix (add_spmat (mult_spmat y b, mult_spmat (add_spmat (add_spmat (mult_spmat y (diff_spmat A2 A1), 
   17.38    abs_spmat (diff_spmat (mult_spmat y A1) c1)), diff_spmat c2 c1)) r))"
    18.1 --- a/src/HOL/Metis_Examples/Big_O.thy	Mon Dec 28 01:26:34 2015 +0100
    18.2 +++ b/src/HOL/Metis_Examples/Big_O.thy	Mon Dec 28 01:28:28 2015 +0100
    18.3 @@ -17,12 +17,12 @@
    18.4  subsection {* Definitions *}
    18.5  
    18.6  definition bigo :: "('a => 'b::linordered_idom) => ('a => 'b) set" ("(1O'(_'))") where
    18.7 -  "O(f::('a => 'b)) == {h. \<exists>c. \<forall>x. abs (h x) <= c * abs (f x)}"
    18.8 +  "O(f::('a => 'b)) == {h. \<exists>c. \<forall>x. \<bar>h x\<bar> <= c * \<bar>f x\<bar>}"
    18.9  
   18.10  lemma bigo_pos_const:
   18.11    "(\<exists>c::'a::linordered_idom.
   18.12 -    \<forall>x. abs (h x) \<le> c * abs (f x))
   18.13 -    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. abs(h x) \<le> c * abs (f x)))"
   18.14 +    \<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>)
   18.15 +    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>))"
   18.16    by (metis (no_types) abs_ge_zero
   18.17        algebra_simps mult.comm_neutral
   18.18        mult_nonpos_nonneg not_le_imp_less order_trans zero_less_one)
   18.19 @@ -33,12 +33,12 @@
   18.20  
   18.21  lemma
   18.22    "(\<exists>c::'a::linordered_idom.
   18.23 -    \<forall>x. abs (h x) \<le> c * abs (f x))
   18.24 -    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. abs(h x) \<le> c * abs (f x)))"
   18.25 +    \<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>)
   18.26 +    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>))"
   18.27    apply auto
   18.28    apply (case_tac "c = 0", simp)
   18.29    apply (rule_tac x = "1" in exI, simp)
   18.30 -  apply (rule_tac x = "abs c" in exI, auto)
   18.31 +  apply (rule_tac x = "\<bar>c\<bar>" in exI, auto)
   18.32  proof -
   18.33    fix c :: 'a and x :: 'b
   18.34    assume A1: "\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>"
   18.35 @@ -64,12 +64,12 @@
   18.36  
   18.37  lemma
   18.38    "(\<exists>c::'a::linordered_idom.
   18.39 -    \<forall>x. abs (h x) \<le> c * abs (f x))
   18.40 -    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. abs(h x) \<le> c * abs (f x)))"
   18.41 +    \<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>)
   18.42 +    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>))"
   18.43    apply auto
   18.44    apply (case_tac "c = 0", simp)
   18.45    apply (rule_tac x = "1" in exI, simp)
   18.46 -  apply (rule_tac x = "abs c" in exI, auto)
   18.47 +  apply (rule_tac x = "\<bar>c\<bar>" in exI, auto)
   18.48  proof -
   18.49    fix c :: 'a and x :: 'b
   18.50    assume A1: "\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>"
   18.51 @@ -87,12 +87,12 @@
   18.52  
   18.53  lemma
   18.54    "(\<exists>c::'a::linordered_idom.
   18.55 -    \<forall>x. abs (h x) \<le> c * abs (f x))
   18.56 -    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. abs(h x) \<le> c * abs (f x)))"
   18.57 +    \<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>)
   18.58 +    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>))"
   18.59    apply auto
   18.60    apply (case_tac "c = 0", simp)
   18.61    apply (rule_tac x = "1" in exI, simp)
   18.62 -  apply (rule_tac x = "abs c" in exI, auto)
   18.63 +  apply (rule_tac x = "\<bar>c\<bar>" in exI, auto)
   18.64  proof -
   18.65    fix c :: 'a and x :: 'b
   18.66    assume A1: "\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>"
   18.67 @@ -107,12 +107,12 @@
   18.68  
   18.69  lemma
   18.70    "(\<exists>c::'a::linordered_idom.
   18.71 -    \<forall>x. abs (h x) \<le> c * abs (f x))
   18.72 -    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. abs(h x) \<le> c * abs (f x)))"
   18.73 +    \<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>)
   18.74 +    \<longleftrightarrow> (\<exists>c. 0 < c \<and> (\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>))"
   18.75    apply auto
   18.76    apply (case_tac "c = 0", simp)
   18.77    apply (rule_tac x = "1" in exI, simp)
   18.78 -  apply (rule_tac x = "abs c" in exI, auto)
   18.79 +  apply (rule_tac x = "\<bar>c\<bar>" in exI, auto)
   18.80  proof -
   18.81    fix c :: 'a and x :: 'b
   18.82    assume A1: "\<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>"
   18.83 @@ -125,7 +125,7 @@
   18.84  
   18.85  sledgehammer_params [isar_proofs, compress = 1]
   18.86  
   18.87 -lemma bigo_alt_def: "O(f) = {h. \<exists>c. (0 < c \<and> (\<forall>x. abs (h x) <= c * abs (f x)))}"
   18.88 +lemma bigo_alt_def: "O(f) = {h. \<exists>c. (0 < c \<and> (\<forall>x. \<bar>h x\<bar> <= c * \<bar>f x\<bar>))}"
   18.89  by (auto simp add: bigo_def bigo_pos_const)
   18.90  
   18.91  lemma bigo_elt_subset [intro]: "f : O(g) \<Longrightarrow> O(f) \<le> O(g)"
   18.92 @@ -160,25 +160,25 @@
   18.93  apply (rule subsetI)
   18.94  apply (auto simp add: bigo_def bigo_pos_const func_plus set_plus_def)
   18.95  apply (subst bigo_pos_const [symmetric])+
   18.96 -apply (rule_tac x = "\<lambda>n. if abs (g n) <= (abs (f n)) then x n else 0" in exI)
   18.97 +apply (rule_tac x = "\<lambda>n. if \<bar>g n\<bar> <= \<bar>f n\<bar> then x n else 0" in exI)
   18.98  apply (rule conjI)
   18.99   apply (rule_tac x = "c + c" in exI)
  18.100   apply clarsimp
  18.101 - apply (subgoal_tac "c * abs (f xa + g xa) <= (c + c) * abs (f xa)")
  18.102 + apply (subgoal_tac "c * \<bar>f xa + g xa\<bar> <= (c + c) * \<bar>f xa\<bar>")
  18.103    apply (metis mult_2 order_trans)
  18.104 - apply (subgoal_tac "c * abs (f xa + g xa) <= c * (abs (f xa) + abs (g xa))")
  18.105 + apply (subgoal_tac "c * \<bar>f xa + g xa\<bar> <= c * (\<bar>f xa\<bar> + \<bar>g xa\<bar>)")
  18.106    apply (erule order_trans)
  18.107    apply (simp add: ring_distribs)
  18.108   apply (rule mult_left_mono)
  18.109    apply (simp add: abs_triangle_ineq)
  18.110   apply (simp add: order_less_le)
  18.111 -apply (rule_tac x = "\<lambda>n. if (abs (f n)) < abs (g n) then x n else 0" in exI)
  18.112 +apply (rule_tac x = "\<lambda>n. if \<bar>f n\<bar> < \<bar>g n\<bar> then x n else 0" in exI)
  18.113  apply (rule conjI)
  18.114   apply (rule_tac x = "c + c" in exI)
  18.115   apply auto
  18.116 -apply (subgoal_tac "c * abs (f xa + g xa) <= (c + c) * abs (g xa)")
  18.117 +apply (subgoal_tac "c * \<bar>f xa + g xa\<bar> <= (c + c) * \<bar>g xa\<bar>")
  18.118   apply (metis order_trans mult_2)
  18.119 -apply (subgoal_tac "c * abs (f xa + g xa) <= c * (abs (f xa) + abs (g xa))")
  18.120 +apply (subgoal_tac "c * \<bar>f xa + g xa\<bar> <= c * (\<bar>f xa\<bar> + \<bar>g xa\<bar>)")
  18.121   apply (erule order_trans)
  18.122   apply (simp add: ring_distribs)
  18.123  by (metis abs_triangle_ineq mult_le_cancel_left_pos)
  18.124 @@ -200,9 +200,8 @@
  18.125  apply (drule_tac x = "xa" in spec)+
  18.126  apply (subgoal_tac "0 <= f xa + g xa")
  18.127   apply (simp add: ring_distribs)
  18.128 - apply (subgoal_tac "abs (a xa + b xa) <= abs (a xa) + abs (b xa)")
  18.129 -  apply (subgoal_tac "abs (a xa) + abs (b xa) <=
  18.130 -           max c ca * f xa + max c ca * g xa")
  18.131 + apply (subgoal_tac "\<bar>a xa + b xa\<bar> <= \<bar>a xa\<bar> + \<bar>b xa\<bar>")
  18.132 +  apply (subgoal_tac "\<bar>a xa\<bar> + \<bar>b xa\<bar> <= max c ca * f xa + max c ca * g xa")
  18.133     apply (metis order_trans)
  18.134    defer 1
  18.135    apply (metis abs_triangle_ineq)
  18.136 @@ -236,17 +235,17 @@
  18.137  by (metis add_le_cancel_left diff_add_cancel func_plus le_fun_def
  18.138            algebra_simps)
  18.139  
  18.140 -lemma bigo_abs: "(\<lambda>x. abs(f x)) =o O(f)"
  18.141 +lemma bigo_abs: "(\<lambda>x. \<bar>f x\<bar>) =o O(f)"
  18.142  apply (unfold bigo_def)
  18.143  apply auto
  18.144  by (metis mult_1 order_refl)
  18.145  
  18.146 -lemma bigo_abs2: "f =o O(\<lambda>x. abs(f x))"
  18.147 +lemma bigo_abs2: "f =o O(\<lambda>x. \<bar>f x\<bar>)"
  18.148  apply (unfold bigo_def)
  18.149  apply auto
  18.150  by (metis mult_1 order_refl)
  18.151  
  18.152 -lemma bigo_abs3: "O(f) = O(\<lambda>x. abs(f x))"
  18.153 +lemma bigo_abs3: "O(f) = O(\<lambda>x. \<bar>f x\<bar>)"
  18.154  proof -
  18.155    have F1: "\<forall>v u. u \<in> O(v) \<longrightarrow> O(u) \<subseteq> O(v)" by (metis bigo_elt_subset)
  18.156    have F2: "\<forall>u. (\<lambda>R. \<bar>u R\<bar>) \<in> O(u)" by (metis bigo_abs)
  18.157 @@ -254,15 +253,15 @@
  18.158    thus "O(f) = O(\<lambda>x. \<bar>f x\<bar>)" using F1 F2 by auto
  18.159  qed
  18.160  
  18.161 -lemma bigo_abs4: "f =o g +o O(h) \<Longrightarrow> (\<lambda>x. abs (f x)) =o (\<lambda>x. abs (g x)) +o O(h)"
  18.162 +lemma bigo_abs4: "f =o g +o O(h) \<Longrightarrow> (\<lambda>x. \<bar>f x\<bar>) =o (\<lambda>x. \<bar>g x\<bar>) +o O(h)"
  18.163    apply (drule set_plus_imp_minus)
  18.164    apply (rule set_minus_imp_plus)
  18.165    apply (subst fun_diff_def)
  18.166  proof -
  18.167    assume a: "f - g : O(h)"
  18.168 -  have "(\<lambda>x. abs (f x) - abs (g x)) =o O(\<lambda>x. abs(abs (f x) - abs (g x)))"
  18.169 +  have "(\<lambda>x. \<bar>f x\<bar> - \<bar>g x\<bar>) =o O(\<lambda>x. \<bar>\<bar>f x\<bar> - \<bar>g x\<bar>\<bar>)"
  18.170      by (rule bigo_abs2)
  18.171 -  also have "... <= O(\<lambda>x. abs (f x - g x))"
  18.172 +  also have "... <= O(\<lambda>x. \<bar>f x - g x\<bar>)"
  18.173      apply (rule bigo_elt_subset)
  18.174      apply (rule bigo_bounded)
  18.175       apply (metis abs_ge_zero)
  18.176 @@ -274,10 +273,10 @@
  18.177      done
  18.178    also have "... <= O(h)"
  18.179      using a by (rule bigo_elt_subset)
  18.180 -  finally show "(\<lambda>x. abs (f x) - abs (g x)) : O(h)".
  18.181 +  finally show "(\<lambda>x. \<bar>f x\<bar> - \<bar>g x\<bar>) : O(h)" .
  18.182  qed
  18.183  
  18.184 -lemma bigo_abs5: "f =o O(g) \<Longrightarrow> (\<lambda>x. abs(f x)) =o O(g)"
  18.185 +lemma bigo_abs5: "f =o O(g) \<Longrightarrow> (\<lambda>x. \<bar>f x\<bar>) =o O(g)"
  18.186  by (unfold bigo_def, auto)
  18.187  
  18.188  lemma bigo_elt_subset2 [intro]: "f : g +o O(h) \<Longrightarrow> O(f) <= O(g) + O(h)"
  18.189 @@ -285,14 +284,14 @@
  18.190    assume "f : g +o O(h)"
  18.191    also have "... <= O(g) + O(h)"
  18.192      by (auto del: subsetI)
  18.193 -  also have "... = O(\<lambda>x. abs(g x)) + O(\<lambda>x. abs(h x))"
  18.194 +  also have "... = O(\<lambda>x. \<bar>g x\<bar>) + O(\<lambda>x. \<bar>h x\<bar>)"
  18.195      by (metis bigo_abs3)
  18.196 -  also have "... = O((\<lambda>x. abs(g x)) + (\<lambda>x. abs(h x)))"
  18.197 +  also have "... = O((\<lambda>x. \<bar>g x\<bar>) + (\<lambda>x. \<bar>h x\<bar>))"
  18.198      by (rule bigo_plus_eq [symmetric], auto)
  18.199    finally have "f : ...".
  18.200    then have "O(f) <= ..."
  18.201      by (elim bigo_elt_subset)
  18.202 -  also have "... = O(\<lambda>x. abs(g x)) + O(\<lambda>x. abs(h x))"
  18.203 +  also have "... = O(\<lambda>x. \<bar>g x\<bar>) + O(\<lambda>x. \<bar>h x\<bar>)"
  18.204      by (rule bigo_plus_eq, auto)
  18.205    finally show ?thesis
  18.206      by (simp add: bigo_abs3 [symmetric])
  18.207 @@ -307,7 +306,7 @@
  18.208  apply (rule_tac x = "c * ca" in exI)
  18.209  apply (rule allI)
  18.210  apply (erule_tac x = x in allE)+
  18.211 -apply (subgoal_tac "c * ca * abs (f x * g x) = (c * abs(f x)) * (ca * abs (g x))")
  18.212 +apply (subgoal_tac "c * ca * \<bar>f x * g x\<bar> = (c * \<bar>f x\<bar>) * (ca * \<bar>g x\<bar>)")
  18.213   apply (metis (no_types) abs_ge_zero abs_mult mult_mono')
  18.214  by (metis mult.assoc mult.left_commute abs_of_pos mult.left_commute abs_mult)
  18.215  
  18.216 @@ -466,9 +465,9 @@
  18.217      simp add: bigo_def elt_set_times_def func_times
  18.218      simp del: abs_mult ac_simps)
  18.219  (* sledgehammer *)
  18.220 -  apply (rule_tac x = "ca * (abs c)" in exI)
  18.221 +  apply (rule_tac x = "ca * \<bar>c\<bar>" in exI)
  18.222    apply (rule allI)
  18.223 -  apply (subgoal_tac "ca * abs(c) * abs(f x) = abs(c) * (ca * abs(f x))")
  18.224 +  apply (subgoal_tac "ca * \<bar>c\<bar> * \<bar>f x\<bar> = \<bar>c\<bar> * (ca * \<bar>f x\<bar>)")
  18.225    apply (erule ssubst)
  18.226    apply (subst abs_mult)
  18.227    apply (rule mult_left_mono)
  18.228 @@ -493,10 +492,10 @@
  18.229  subsection {* Setsum *}
  18.230  
  18.231  lemma bigo_setsum_main: "\<forall>x. \<forall>y \<in> A x. 0 <= h x y \<Longrightarrow>
  18.232 -    \<exists>c. \<forall>x. \<forall>y \<in> A x. abs (f x y) <= c * (h x y) \<Longrightarrow>
  18.233 +    \<exists>c. \<forall>x. \<forall>y \<in> A x. \<bar>f x y\<bar> <= c * (h x y) \<Longrightarrow>
  18.234        (\<lambda>x. SUM y : A x. f x y) =o O(\<lambda>x. SUM y : A x. h x y)"
  18.235  apply (auto simp add: bigo_def)
  18.236 -apply (rule_tac x = "abs c" in exI)
  18.237 +apply (rule_tac x = "\<bar>c\<bar>" in exI)
  18.238  apply (subst abs_of_nonneg) back back
  18.239   apply (rule setsum_nonneg)
  18.240   apply force
  18.241 @@ -508,19 +507,19 @@
  18.242  by (metis abs_ge_self abs_mult_pos order_trans)
  18.243  
  18.244  lemma bigo_setsum1: "\<forall>x y. 0 <= h x y \<Longrightarrow>
  18.245 -    \<exists>c. \<forall>x y. abs (f x y) <= c * (h x y) \<Longrightarrow>
  18.246 +    \<exists>c. \<forall>x y. \<bar>f x y\<bar> <= c * (h x y) \<Longrightarrow>
  18.247        (\<lambda>x. SUM y : A x. f x y) =o O(\<lambda>x. SUM y : A x. h x y)"
  18.248  by (metis (no_types) bigo_setsum_main)
  18.249  
  18.250  lemma bigo_setsum2: "\<forall>y. 0 <= h y \<Longrightarrow>
  18.251 -    \<exists>c. \<forall>y. abs (f y) <= c * (h y) \<Longrightarrow>
  18.252 +    \<exists>c. \<forall>y. \<bar>f y\<bar> <= c * (h y) \<Longrightarrow>
  18.253        (\<lambda>x. SUM y : A x. f y) =o O(\<lambda>x. SUM y : A x. h y)"
  18.254  apply (rule bigo_setsum1)
  18.255  by metis+
  18.256  
  18.257  lemma bigo_setsum3: "f =o O(h) \<Longrightarrow>
  18.258      (\<lambda>x. SUM y : A x. (l x y) * f(k x y)) =o
  18.259 -      O(\<lambda>x. SUM y : A x. abs(l x y * h(k x y)))"
  18.260 +      O(\<lambda>x. SUM y : A x. \<bar>l x y * h(k x y)\<bar>)"
  18.261  apply (rule bigo_setsum1)
  18.262   apply (rule allI)+
  18.263   apply (rule abs_ge_zero)
  18.264 @@ -531,7 +530,7 @@
  18.265  lemma bigo_setsum4: "f =o g +o O(h) \<Longrightarrow>
  18.266      (\<lambda>x. SUM y : A x. l x y * f(k x y)) =o
  18.267        (\<lambda>x. SUM y : A x. l x y * g(k x y)) +o
  18.268 -        O(\<lambda>x. SUM y : A x. abs(l x y * h(k x y)))"
  18.269 +        O(\<lambda>x. SUM y : A x. \<bar>l x y * h(k x y)\<bar>)"
  18.270  apply (rule set_minus_imp_plus)
  18.271  apply (subst fun_diff_def)
  18.272  apply (subst setsum_subtractf [symmetric])
  18.273 @@ -544,7 +543,7 @@
  18.274        (\<lambda>x. SUM y : A x. (l x y) * f(k x y)) =o
  18.275          O(\<lambda>x. SUM y : A x. (l x y) * h(k x y))"
  18.276  apply (subgoal_tac "(\<lambda>x. SUM y : A x. (l x y) * h(k x y)) =
  18.277 -      (\<lambda>x. SUM y : A x. abs((l x y) * h(k x y)))")
  18.278 +      (\<lambda>x. SUM y : A x. \<bar>(l x y) * h(k x y)\<bar>)")
  18.279   apply (erule ssubst)
  18.280   apply (erule bigo_setsum3)
  18.281  apply (rule ext)
  18.282 @@ -616,14 +615,14 @@
  18.283  definition lesso :: "('a => 'b::linordered_idom) => ('a => 'b) => ('a => 'b)" (infixl "<o" 70) where
  18.284    "f <o g == (\<lambda>x. max (f x - g x) 0)"
  18.285  
  18.286 -lemma bigo_lesseq1: "f =o O(h) \<Longrightarrow> \<forall>x. abs (g x) <= abs (f x) \<Longrightarrow>
  18.287 +lemma bigo_lesseq1: "f =o O(h) \<Longrightarrow> \<forall>x. \<bar>g x\<bar> <= \<bar>f x\<bar> \<Longrightarrow>
  18.288      g =o O(h)"
  18.289    apply (unfold bigo_def)
  18.290    apply clarsimp
  18.291  apply (blast intro: order_trans)
  18.292  done
  18.293  
  18.294 -lemma bigo_lesseq2: "f =o O(h) \<Longrightarrow> \<forall>x. abs (g x) <= f x \<Longrightarrow>
  18.295 +lemma bigo_lesseq2: "f =o O(h) \<Longrightarrow> \<forall>x. \<bar>g x\<bar> <= f x \<Longrightarrow>
  18.296        g =o O(h)"
  18.297    apply (erule bigo_lesseq1)
  18.298  apply (blast intro: abs_ge_self order_trans)
  18.299 @@ -638,7 +637,7 @@
  18.300  done
  18.301  
  18.302  lemma bigo_lesseq4: "f =o O(h) \<Longrightarrow>
  18.303 -    \<forall>x. 0 <= g x \<Longrightarrow> \<forall>x. g x <= abs (f x) \<Longrightarrow>
  18.304 +    \<forall>x. 0 <= g x \<Longrightarrow> \<forall>x. g x <= \<bar>f x\<bar> \<Longrightarrow>
  18.305        g =o O(h)"
  18.306    apply (erule bigo_lesseq1)
  18.307    apply (rule allI)
  18.308 @@ -703,7 +702,7 @@
  18.309  by (auto simp add: func_plus fun_diff_def algebra_simps
  18.310      split: split_max abs_split)
  18.311  
  18.312 -lemma bigo_lesso5: "f <o g =o O(h) \<Longrightarrow> \<exists>C. \<forall>x. f x <= g x + C * abs (h x)"
  18.313 +lemma bigo_lesso5: "f <o g =o O(h) \<Longrightarrow> \<exists>C. \<forall>x. f x <= g x + C * \<bar>h x\<bar>"
  18.314  apply (simp only: lesso_def bigo_alt_def)
  18.315  apply clarsimp
  18.316  by (metis add.commute diff_le_eq)
    19.1 --- a/src/HOL/Multivariate_Analysis/Bounded_Continuous_Function.thy	Mon Dec 28 01:26:34 2015 +0100
    19.2 +++ b/src/HOL/Multivariate_Analysis/Bounded_Continuous_Function.thy	Mon Dec 28 01:28:28 2015 +0100
    19.3 @@ -307,7 +307,7 @@
    19.4    proof (intro bcontfunI)
    19.5      fix x
    19.6      assume "\<And>x. dist (f x) 0 \<le> y"
    19.7 -    then show "dist (a *\<^sub>R f x) 0 \<le> abs a * y"
    19.8 +    then show "dist (a *\<^sub>R f x) 0 \<le> \<bar>a\<bar> * y"
    19.9        by (metis norm_cmul_rule_thm norm_conv_dist)
   19.10    qed (simp add: continuous_intros)
   19.11  qed
    20.1 --- a/src/HOL/Multivariate_Analysis/Bounded_Linear_Function.thy	Mon Dec 28 01:26:34 2015 +0100
    20.2 +++ b/src/HOL/Multivariate_Analysis/Bounded_Linear_Function.thy	Mon Dec 28 01:28:28 2015 +0100
    20.3 @@ -398,7 +398,7 @@
    20.4    by transfer (auto simp: algebra_simps setsum_subtractf)
    20.5  
    20.6  lemma norm_blinfun_of_matrix:
    20.7 -  "norm (blinfun_of_matrix a) \<le> (\<Sum>i\<in>Basis. \<Sum>j\<in>Basis. abs (a i j))"
    20.8 +  "norm (blinfun_of_matrix a) \<le> (\<Sum>i\<in>Basis. \<Sum>j\<in>Basis. \<bar>a i j\<bar>)"
    20.9    apply (rule norm_blinfun_bound)
   20.10     apply (simp add: setsum_nonneg)
   20.11    apply (simp only: blinfun_of_matrix_apply setsum_left_distrib)
   20.12 @@ -413,7 +413,7 @@
   20.13  proof -
   20.14    have "\<And>i j. i \<in> Basis \<Longrightarrow> j \<in> Basis \<Longrightarrow> Zfun (\<lambda>x. norm (b x i j - a i j)) F"
   20.15      using assms unfolding tendsto_Zfun_iff Zfun_norm_iff .
   20.16 -  hence "Zfun (\<lambda>x. (\<Sum>i\<in>Basis. \<Sum>j\<in>Basis. abs (b x i j - a i j))) F"
   20.17 +  hence "Zfun (\<lambda>x. (\<Sum>i\<in>Basis. \<Sum>j\<in>Basis. \<bar>b x i j - a i j\<bar>)) F"
   20.18      by (auto intro!: Zfun_setsum)
   20.19    thus ?thesis
   20.20      unfolding tendsto_Zfun_iff blinfun_of_matrix_minus
    21.1 --- a/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy	Mon Dec 28 01:26:34 2015 +0100
    21.2 +++ b/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy	Mon Dec 28 01:28:28 2015 +0100
    21.3 @@ -1473,7 +1473,7 @@
    21.4      using kuhn_labelling_lemma[OF *] by blast
    21.5    note label = this [rule_format]
    21.6    have lem1: "\<forall>x\<in>unit_cube. \<forall>y\<in>unit_cube. \<forall>i\<in>Basis. label x i \<noteq> label y i \<longrightarrow>
    21.7 -    abs (f x \<bullet> i - x \<bullet> i) \<le> norm (f y - f x) + norm (y - x)"
    21.8 +    \<bar>f x \<bullet> i - x \<bullet> i\<bar> \<le> norm (f y - f x) + norm (y - x)"
    21.9    proof safe
   21.10      fix x y :: 'a
   21.11      assume x: "x \<in> unit_cube"
   21.12 @@ -1481,8 +1481,8 @@
   21.13      fix i
   21.14      assume i: "label x i \<noteq> label y i" "i \<in> Basis"
   21.15      have *: "\<And>x y fx fy :: real. x \<le> fx \<and> fy \<le> y \<or> fx \<le> x \<and> y \<le> fy \<Longrightarrow>
   21.16 -      abs (fx - x) \<le> abs (fy - fx) + abs (y - x)" by auto
   21.17 -    have "\<bar>(f x - x) \<bullet> i\<bar> \<le> abs ((f y - f x)\<bullet>i) + abs ((y - x)\<bullet>i)"
   21.18 +      \<bar>fx - x\<bar> \<le> \<bar>fy - fx\<bar> + \<bar>y - x\<bar>" by auto
   21.19 +    have "\<bar>(f x - x) \<bullet> i\<bar> \<le> \<bar>(f y - f x)\<bullet>i\<bar> + \<bar>(y - x)\<bullet>i\<bar>"
   21.20        unfolding inner_simps
   21.21        apply (rule *)
   21.22        apply (cases "label x i = 0")
   21.23 @@ -1531,7 +1531,7 @@
   21.24    qed
   21.25    have "\<exists>e>0. \<forall>x\<in>unit_cube. \<forall>y\<in>unit_cube. \<forall>z\<in>unit_cube. \<forall>i\<in>Basis.
   21.26      norm (x - z) < e \<and> norm (y - z) < e \<and> label x i \<noteq> label y i \<longrightarrow>
   21.27 -      abs ((f(z) - z)\<bullet>i) < d / (real n)"
   21.28 +      \<bar>(f(z) - z)\<bullet>i\<bar> < d / (real n)"
   21.29    proof -
   21.30      have d': "d / real n / 8 > 0"
   21.31        using d(1) by (simp add: n_def DIM_positive)
   21.32 @@ -1559,10 +1559,10 @@
   21.33          "norm (y - z) < min (e / 2) (d / real n / 8)"
   21.34          "label x i \<noteq> label y i"
   21.35        assume i: "i \<in> Basis"
   21.36 -      have *: "\<And>z fz x fx n1 n2 n3 n4 d4 d :: real. abs(fx - x) \<le> n1 + n2 \<Longrightarrow>
   21.37 -        abs (fx - fz) \<le> n3 \<Longrightarrow> abs (x - z) \<le> n4 \<Longrightarrow>
   21.38 +      have *: "\<And>z fz x fx n1 n2 n3 n4 d4 d :: real. \<bar>fx - x\<bar> \<le> n1 + n2 \<Longrightarrow>
   21.39 +        \<bar>fx - fz\<bar> \<le> n3 \<Longrightarrow> \<bar>x - z\<bar> \<le> n4 \<Longrightarrow>
   21.40          n1 < d4 \<Longrightarrow> n2 < 2 * d4 \<Longrightarrow> n3 < d4 \<Longrightarrow> n4 < d4 \<Longrightarrow>
   21.41 -        (8 * d4 = d) \<Longrightarrow> abs(fz - z) < d"
   21.42 +        (8 * d4 = d) \<Longrightarrow> \<bar>fz - z\<bar> < d"
   21.43          by auto
   21.44        show "\<bar>(f z - z) \<bullet> i\<bar> < d / real n"
   21.45          unfolding inner_simps
   21.46 @@ -1669,7 +1669,7 @@
   21.47                 (label (\<Sum>i\<in>Basis. (real (s (b' i)) / real p) *\<^sub>R i) \<circ> b) i"
   21.48      by (rule kuhn_lemma[OF q1 q2 q3])
   21.49    def z \<equiv> "(\<Sum>i\<in>Basis. (real (q (b' i)) / real p) *\<^sub>R i)::'a"
   21.50 -  have "\<exists>i\<in>Basis. d / real n \<le> abs ((f z - z)\<bullet>i)"
   21.51 +  have "\<exists>i\<in>Basis. d / real n \<le> \<bar>(f z - z)\<bullet>i\<bar>"
   21.52    proof (rule ccontr)
   21.53      have "\<forall>i\<in>Basis. q (b' i) \<in> {0..p}"
   21.54        using q(1) b'
    22.1 --- a/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy	Mon Dec 28 01:26:34 2015 +0100
    22.2 +++ b/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy	Mon Dec 28 01:28:28 2015 +0100
    22.3 @@ -792,7 +792,7 @@
    22.4      dot_rowvector_columnvector matrix_transpose_mul matrix_mul_assoc ..
    22.5  
    22.6  
    22.7 -lemma infnorm_cart:"infnorm (x::real^'n) = Sup {abs(x$i) |i. i\<in>UNIV}"
    22.8 +lemma infnorm_cart:"infnorm (x::real^'n) = Sup {\<bar>x$i\<bar> |i. i\<in>UNIV}"
    22.9    by (simp add: infnorm_def inner_axis Basis_vec_def) (metis (lifting) inner_axis real_inner_1_right)
   22.10  
   22.11  lemma component_le_infnorm_cart: "\<bar>x$i\<bar> \<le> infnorm (x::real^'n)"
   22.12 @@ -1243,10 +1243,10 @@
   22.13  lemma norm_vector_1: "norm (x :: _^1) = norm (x$1)"
   22.14    by (simp add: norm_vec_def)
   22.15  
   22.16 -lemma norm_real: "norm(x::real ^ 1) = abs(x$1)"
   22.17 +lemma norm_real: "norm(x::real ^ 1) = \<bar>x$1\<bar>"
   22.18    by (simp add: norm_vector_1)
   22.19  
   22.20 -lemma dist_real: "dist(x::real ^ 1) y = abs((x$1) - (y$1))"
   22.21 +lemma dist_real: "dist(x::real ^ 1) y = \<bar>(x$1) - (y$1)\<bar>"
   22.22    by (auto simp add: norm_real dist_norm)
   22.23  
   22.24  
    23.1 --- a/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy	Mon Dec 28 01:26:34 2015 +0100
    23.2 +++ b/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy	Mon Dec 28 01:28:28 2015 +0100
    23.3 @@ -3862,7 +3862,7 @@
    23.4  
    23.5  lemma winding_number_big_meets:
    23.6    fixes z::complex
    23.7 -  assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and "abs (Re (winding_number \<gamma> z)) \<ge> 1"
    23.8 +  assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and "\<bar>Re (winding_number \<gamma> z)\<bar> \<ge> 1"
    23.9        and w: "w \<noteq> z"
   23.10    shows "\<exists>a::real. 0 < a \<and> z + a*(w - z) \<in> path_image \<gamma>"
   23.11  proof -
   23.12 @@ -3888,7 +3888,7 @@
   23.13    shows
   23.14    "\<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>; w \<noteq> z;
   23.15      \<And>a::real. 0 < a \<Longrightarrow> z + a*(w - z) \<notin> path_image \<gamma>\<rbrakk>
   23.16 -   \<Longrightarrow> abs (Re(winding_number \<gamma> z)) < 1"
   23.17 +   \<Longrightarrow> \<bar>Re(winding_number \<gamma> z)\<bar> < 1"
   23.18     by (auto simp: not_less dest: winding_number_big_meets)
   23.19  
   23.20  text\<open>One way of proving that WN=1 for a loop.\<close>
   23.21 @@ -4319,7 +4319,7 @@
   23.22    { assume wnz_12: "\<bar>Re (winding_number \<gamma> z)\<bar> > 1/2"
   23.23      have "isCont (winding_number \<gamma>) z"
   23.24        by (metis continuous_at_winding_number valid_path_imp_path \<gamma> z)
   23.25 -    then obtain d where "d>0" and d: "\<And>x'. dist x' z < d \<Longrightarrow> dist (winding_number \<gamma> x') (winding_number \<gamma> z) < abs(Re(winding_number \<gamma> z)) - 1/2"
   23.26 +    then obtain d where "d>0" and d: "\<And>x'. dist x' z < d \<Longrightarrow> dist (winding_number \<gamma> x') (winding_number \<gamma> z) < \<bar>Re(winding_number \<gamma> z)\<bar> - 1/2"
   23.27        using continuous_at_eps_delta wnz_12 diff_gt_0_iff_gt by blast
   23.28      def z' \<equiv> "z - (d / (2 * cmod a)) *\<^sub>R a"
   23.29      have *: "a \<bullet> z' \<le> b - d / 3 * cmod a"
   23.30 @@ -4479,7 +4479,7 @@
   23.31          done
   23.32      }
   23.33      then have "\<exists>e. 0 < e \<and>
   23.34 -              (\<forall>t1 t2. t1 \<in> {0..1} \<and> t2 \<in> {0..1} \<and> abs(t1 - t) < e \<and> abs(t2 - t) < e
   23.35 +              (\<forall>t1 t2. t1 \<in> {0..1} \<and> t2 \<in> {0..1} \<and> \<bar>t1 - t\<bar> < e \<and> \<bar>t2 - t\<bar> < e
   23.36                  \<longrightarrow> (\<exists>d. 0 < d \<and>
   23.37                       (\<forall>g1 g2. valid_path g1 \<and> valid_path g2 \<and>
   23.38                         (\<forall>u \<in> {0..1}.
   23.39 @@ -4490,7 +4490,7 @@
   23.40    }
   23.41    then obtain ee where ee:
   23.42         "\<And>t. t \<in> {0..1} \<Longrightarrow> ee t > 0 \<and>
   23.43 -          (\<forall>t1 t2. t1 \<in> {0..1} \<longrightarrow> t2 \<in> {0..1} \<longrightarrow> abs(t1 - t) < ee t \<longrightarrow> abs(t2 - t) < ee t
   23.44 +          (\<forall>t1 t2. t1 \<in> {0..1} \<longrightarrow> t2 \<in> {0..1} \<longrightarrow> \<bar>t1 - t\<bar> < ee t \<longrightarrow> \<bar>t2 - t\<bar> < ee t
   23.45              \<longrightarrow> (\<exists>d. 0 < d \<and>
   23.46                   (\<forall>g1 g2. valid_path g1 \<and> valid_path g2 \<and>
   23.47                     (\<forall>u \<in> {0..1}.
   23.48 @@ -4867,7 +4867,7 @@
   23.49      with assms show ?thesis by simp
   23.50    next
   23.51      case 2
   23.52 -    have [simp]: "abs r = r" using \<open>r > 0\<close> by linarith
   23.53 +    have [simp]: "\<bar>r\<bar> = r" using \<open>r > 0\<close> by linarith
   23.54      have [simp]: "cmod (complex_of_real t - complex_of_real s) = t-s"
   23.55        by (metis "2" abs_of_pos diff_gt_0_iff_gt norm_of_real of_real_diff)
   23.56      have "finite (part_circlepath z r s t -` {y} \<inter> {0..1})" if "y \<in> k" for y
   23.57 @@ -4940,7 +4940,7 @@
   23.58  qed
   23.59  
   23.60  proposition simple_path_part_circlepath:
   23.61 -    "simple_path(part_circlepath z r s t) \<longleftrightarrow> (r \<noteq> 0 \<and> s \<noteq> t \<and> abs(s - t) \<le> 2*pi)"
   23.62 +    "simple_path(part_circlepath z r s t) \<longleftrightarrow> (r \<noteq> 0 \<and> s \<noteq> t \<and> \<bar>s - t\<bar> \<le> 2*pi)"
   23.63  proof (cases "r = 0 \<or> s = t")
   23.64    case True
   23.65    then show ?thesis
   23.66 @@ -4952,17 +4952,17 @@
   23.67    have *: "\<And>x y z s t. ii*((1 - x) * s + x * t) = ii*(((1 - y) * s + y * t)) + z  \<longleftrightarrow> ii*(x - y) * (t - s) = z"
   23.68      by (simp add: algebra_simps)
   23.69    have abs01: "\<And>x y::real. 0 \<le> x \<and> x \<le> 1 \<and> 0 \<le> y \<and> y \<le> 1
   23.70 -                      \<Longrightarrow> (x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0 \<longleftrightarrow> abs(x - y) \<in> {0,1})"
   23.71 +                      \<Longrightarrow> (x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0 \<longleftrightarrow> \<bar>x - y\<bar> \<in> {0,1})"
   23.72      by auto
   23.73 -  have abs_away: "\<And>P. (\<forall>x\<in>{0..1}. \<forall>y\<in>{0..1}. P(abs(x - y))) \<longleftrightarrow> (\<forall>x::real. 0 \<le> x \<and> x \<le> 1 \<longrightarrow> P x)"
   23.74 +  have abs_away: "\<And>P. (\<forall>x\<in>{0..1}. \<forall>y\<in>{0..1}. P \<bar>x - y\<bar>) \<longleftrightarrow> (\<forall>x::real. 0 \<le> x \<and> x \<le> 1 \<longrightarrow> P x)"
   23.75      by force
   23.76    have **: "\<And>x y. (\<exists>n. (complex_of_real x - of_real y) * (of_real t - of_real s) = 2 * (of_int n * of_real pi)) \<longleftrightarrow>
   23.77 -                  (\<exists>n. abs(x - y) * (t - s) = 2 * (of_int n * pi))"
   23.78 +                  (\<exists>n. \<bar>x - y\<bar> * (t - s) = 2 * (of_int n * pi))"
   23.79      by (force simp: algebra_simps abs_if dest: arg_cong [where f=Re] arg_cong [where f=complex_of_real]
   23.80                      intro: exI [where x = "-n" for n])
   23.81    have 1: "\<forall>x. 0 \<le> x \<and> x \<le> 1 \<longrightarrow> (\<exists>n. x * (t - s) = 2 * (real_of_int n * pi)) \<longrightarrow> x = 0 \<or> x = 1 \<Longrightarrow> \<bar>s - t\<bar> \<le> 2 * pi"
   23.82      apply (rule ccontr)
   23.83 -    apply (drule_tac x="2*pi / abs(t-s)" in spec)
   23.84 +    apply (drule_tac x="2*pi / \<bar>t - s\<bar>" in spec)
   23.85      using False
   23.86      apply (simp add: abs_minus_commute divide_simps)
   23.87      apply (frule_tac x=1 in spec)
   23.88 @@ -4986,7 +4986,7 @@
   23.89  qed
   23.90  
   23.91  proposition arc_part_circlepath:
   23.92 -  assumes "r \<noteq> 0" "s \<noteq> t" "abs(s - t) < 2*pi"
   23.93 +  assumes "r \<noteq> 0" "s \<noteq> t" "\<bar>s - t\<bar> < 2*pi"
   23.94      shows "arc (part_circlepath z r s t)"
   23.95  proof -
   23.96    have *: "x = y" if eq: "\<i> * (linepath s t x) = \<i> * (linepath s t y) + 2 * of_int n * complex_of_real pi * \<i>"
   23.97 @@ -5111,7 +5111,7 @@
   23.98  qed
   23.99  
  23.100  proposition path_image_circlepath [simp]:
  23.101 -    "path_image (circlepath z r) = sphere z (abs r)"
  23.102 +    "path_image (circlepath z r) = sphere z \<bar>r\<bar>"
  23.103    using path_image_circlepath_minus
  23.104    by (force simp add: path_image_circlepath_nonneg abs_if)
  23.105  
  23.106 @@ -6163,7 +6163,7 @@
  23.107    with inf [unfolded Lim_at_infinity, rule_format, of "norm(f z)/2"]
  23.108    obtain B where B: "\<And>x. B \<le> cmod x \<Longrightarrow> norm (f x) * 2 < cmod (f z)"
  23.109      by (auto simp: dist_norm)
  23.110 -  def R \<equiv> "1 + abs B + norm z"
  23.111 +  def R \<equiv> "1 + \<bar>B\<bar> + norm z"
  23.112    have "R > 0" unfolding R_def by (meson abs_add_one_gt_zero le_less_trans less_add_same_cancel2 norm_ge_zero)
  23.113    have *: "((\<lambda>u. f u / (u - z)) has_contour_integral 2 * complex_of_real pi * \<i> * f z) (circlepath z R)"
  23.114      apply (rule Cauchy_integral_circlepath)
    24.1 --- a/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy	Mon Dec 28 01:26:34 2015 +0100
    24.2 +++ b/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy	Mon Dec 28 01:28:28 2015 +0100
    24.3 @@ -8,7 +8,7 @@
    24.4  
    24.5  lemma cmod_add_real_less:
    24.6    assumes "Im z \<noteq> 0" "r\<noteq>0"
    24.7 -    shows "cmod (z + r) < cmod z + abs r"
    24.8 +    shows "cmod (z + r) < cmod z + \<bar>r\<bar>"
    24.9  proof (cases z)
   24.10    case (Complex x y)
   24.11    have "r * x / \<bar>r\<bar> < sqrt (x*x + y*y)"
   24.12 @@ -23,7 +23,7 @@
   24.13      done
   24.14  qed
   24.15  
   24.16 -lemma cmod_diff_real_less: "Im z \<noteq> 0 \<Longrightarrow> x\<noteq>0 \<Longrightarrow> cmod (z - x) < cmod z + abs x"
   24.17 +lemma cmod_diff_real_less: "Im z \<noteq> 0 \<Longrightarrow> x\<noteq>0 \<Longrightarrow> cmod (z - x) < cmod z + \<bar>x\<bar>"
   24.18    using cmod_add_real_less [of z "-x"]
   24.19    by simp
   24.20  
   24.21 @@ -205,7 +205,7 @@
   24.22    finally show ?thesis .
   24.23  qed
   24.24  
   24.25 -lemma exp_complex_eqI: "abs(Im w - Im z) < 2*pi \<Longrightarrow> exp w = exp z \<Longrightarrow> w = z"
   24.26 +lemma exp_complex_eqI: "\<bar>Im w - Im z\<bar> < 2*pi \<Longrightarrow> exp w = exp z \<Longrightarrow> w = z"
   24.27    by (auto simp: exp_eq abs_mult)
   24.28  
   24.29  lemma exp_integer_2pi:
   24.30 @@ -361,7 +361,7 @@
   24.31    finally show ?thesis .
   24.32  qed
   24.33  
   24.34 -lemma dist_exp_ii_1: "norm(exp(ii * of_real t) - 1) = 2 * abs(sin(t / 2))"
   24.35 +lemma dist_exp_ii_1: "norm(exp(ii * of_real t) - 1) = 2 * \<bar>sin(t / 2)\<bar>"
   24.36    apply (simp add: exp_Euler cmod_def power2_diff sin_of_real cos_of_real algebra_simps)
   24.37    using cos_double_sin [of "t/2"]
   24.38    apply (simp add: real_sqrt_mult)
   24.39 @@ -579,7 +579,7 @@
   24.40  declare power_Suc [simp]
   24.41  
   24.42  text\<open>32-bit Approximation to e\<close>
   24.43 -lemma e_approx_32: "abs(exp(1) - 5837465777 / 2147483648) \<le> (inverse(2 ^ 32)::real)"
   24.44 +lemma e_approx_32: "\<bar>exp(1) - 5837465777 / 2147483648\<bar> \<le> (inverse(2 ^ 32)::real)"
   24.45    using Taylor_exp [of 1 14] exp_le
   24.46    apply (simp add: setsum_left_distrib in_Reals_norm Re_exp atMost_nat_numeral fact_numeral)
   24.47    apply (simp only: pos_le_divide_eq [symmetric], linarith)
   24.48 @@ -1055,14 +1055,14 @@
   24.49  
   24.50  lemma Re_Ln_pos_lt:
   24.51    assumes "z \<noteq> 0"
   24.52 -    shows "abs(Im(Ln z)) < pi/2 \<longleftrightarrow> 0 < Re(z)"
   24.53 +    shows "\<bar>Im(Ln z)\<bar> < pi/2 \<longleftrightarrow> 0 < Re(z)"
   24.54  proof -
   24.55    { fix w
   24.56      assume "w = Ln z"
   24.57      then have w: "Im w \<le> pi" "- pi < Im w"
   24.58        using Im_Ln_le_pi [of z]  mpi_less_Im_Ln [of z]  assms
   24.59        by auto
   24.60 -    then have "abs(Im w) < pi/2 \<longleftrightarrow> 0 < Re(exp w)"
   24.61 +    then have "\<bar>Im w\<bar> < pi/2 \<longleftrightarrow> 0 < Re(exp w)"
   24.62        apply (auto simp: Re_exp zero_less_mult_iff cos_gt_zero_pi)
   24.63        using cos_lt_zero_pi [of "-(Im w)"] cos_lt_zero_pi [of "(Im w)"]
   24.64        apply (simp add: abs_if split: split_if_asm)
   24.65 @@ -1077,14 +1077,14 @@
   24.66  
   24.67  lemma Re_Ln_pos_le:
   24.68    assumes "z \<noteq> 0"
   24.69 -    shows "abs(Im(Ln z)) \<le> pi/2 \<longleftrightarrow> 0 \<le> Re(z)"
   24.70 +    shows "\<bar>Im(Ln z)\<bar> \<le> pi/2 \<longleftrightarrow> 0 \<le> Re(z)"
   24.71  proof -
   24.72    { fix w
   24.73      assume "w = Ln z"
   24.74      then have w: "Im w \<le> pi" "- pi < Im w"
   24.75        using Im_Ln_le_pi [of z]  mpi_less_Im_Ln [of z]  assms
   24.76        by auto
   24.77 -    then have "abs(Im w) \<le> pi/2 \<longleftrightarrow> 0 \<le> Re(exp w)"
   24.78 +    then have "\<bar>Im w\<bar> \<le> pi/2 \<longleftrightarrow> 0 \<le> Re(exp w)"
   24.79        apply (auto simp: Re_exp zero_le_mult_iff cos_ge_zero)
   24.80        using cos_lt_zero_pi [of "- (Im w)"] cos_lt_zero_pi [of "(Im w)"] not_le
   24.81        apply (auto simp: abs_if split: split_if_asm)
   24.82 @@ -1132,7 +1132,7 @@
   24.83      by auto
   24.84  qed
   24.85  
   24.86 -lemma Re_Ln_pos_lt_imp: "0 < Re(z) \<Longrightarrow> abs(Im(Ln z)) < pi/2"
   24.87 +lemma Re_Ln_pos_lt_imp: "0 < Re(z) \<Longrightarrow> \<bar>Im(Ln z)\<bar> < pi/2"
   24.88    by (metis Re_Ln_pos_lt less_irrefl zero_complex.simps(1))
   24.89  
   24.90  lemma Im_Ln_pos_lt_imp: "0 < Im(z) \<Longrightarrow> 0 < Im(Ln z) \<and> Im(Ln z) < pi"
   24.91 @@ -1834,7 +1834,7 @@
   24.92    assumes "\<bar>Re z\<bar> < pi/2"
   24.93      shows "Arctan(tan z) = z"
   24.94  proof -
   24.95 -  have ge_pi2: "\<And>n::int. abs (of_int (2*n + 1) * pi/2) \<ge> pi/2"
   24.96 +  have ge_pi2: "\<And>n::int. \<bar>of_int (2*n + 1) * pi/2\<bar> \<ge> pi/2"
   24.97      by (case_tac n rule: int_cases) (auto simp: abs_mult)
   24.98    have "exp (\<i>*z)*exp (\<i>*z) = -1 \<longleftrightarrow> exp (2*\<i>*z) = -1"
   24.99      by (metis distrib_right exp_add mult_2)
  24.100 @@ -1863,8 +1863,8 @@
  24.101  qed
  24.102  
  24.103  lemma
  24.104 -  assumes "Re z = 0 \<Longrightarrow> abs(Im z) < 1"
  24.105 -  shows Re_Arctan_bounds: "abs(Re(Arctan z)) < pi/2"
  24.106 +  assumes "Re z = 0 \<Longrightarrow> \<bar>Im z\<bar> < 1"
  24.107 +  shows Re_Arctan_bounds: "\<bar>Re(Arctan z)\<bar> < pi/2"
  24.108      and has_field_derivative_Arctan: "(Arctan has_field_derivative inverse(1 + z\<^sup>2)) (at z)"
  24.109  proof -
  24.110    have nz0: "1 + \<i>*z \<noteq> 0"
  24.111 @@ -1889,7 +1889,7 @@
  24.112      using assms
  24.113      apply (auto simp: algebra_simps abs_square_less_1 [unfolded power2_eq_square])
  24.114      done
  24.115 -  show "abs(Re(Arctan z)) < pi/2"
  24.116 +  show "\<bar>Re(Arctan z)\<bar> < pi/2"
  24.117      unfolding Arctan_def divide_complex_def
  24.118      using mpi_less_Im_Ln [OF nzi]
  24.119      by (auto simp: abs_if intro: Im_Ln_less_pi * [unfolded divide_complex_def])
  24.120 @@ -1903,31 +1903,31 @@
  24.121      done
  24.122  qed
  24.123  
  24.124 -lemma complex_differentiable_at_Arctan: "(Re z = 0 \<Longrightarrow> abs(Im z) < 1) \<Longrightarrow> Arctan complex_differentiable at z"
  24.125 +lemma complex_differentiable_at_Arctan: "(Re z = 0 \<Longrightarrow> \<bar>Im z\<bar> < 1) \<Longrightarrow> Arctan complex_differentiable at z"
  24.126    using has_field_derivative_Arctan
  24.127    by (auto simp: complex_differentiable_def)
  24.128  
  24.129  lemma complex_differentiable_within_Arctan:
  24.130 -    "(Re z = 0 \<Longrightarrow> abs(Im z) < 1) \<Longrightarrow> Arctan complex_differentiable (at z within s)"
  24.131 +    "(Re z = 0 \<Longrightarrow> \<bar>Im z\<bar> < 1) \<Longrightarrow> Arctan complex_differentiable (at z within s)"
  24.132    using complex_differentiable_at_Arctan complex_differentiable_at_within by blast
  24.133  
  24.134  declare has_field_derivative_Arctan [derivative_intros]
  24.135  declare has_field_derivative_Arctan [THEN DERIV_chain2, derivative_intros]
  24.136  
  24.137  lemma continuous_at_Arctan:
  24.138 -    "(Re z = 0 \<Longrightarrow> abs(Im z) < 1) \<Longrightarrow> continuous (at z) Arctan"
  24.139 +    "(Re z = 0 \<Longrightarrow> \<bar>Im z\<bar> < 1) \<Longrightarrow> continuous (at z) Arctan"
  24.140    by (simp add: complex_differentiable_imp_continuous_at complex_differentiable_within_Arctan)
  24.141  
  24.142  lemma continuous_within_Arctan:
  24.143 -    "(Re z = 0 \<Longrightarrow> abs(Im z) < 1) \<Longrightarrow> continuous (at z within s) Arctan"
  24.144 +    "(Re z = 0 \<Longrightarrow> \<bar>Im z\<bar> < 1) \<Longrightarrow> continuous (at z within s) Arctan"
  24.145    using continuous_at_Arctan continuous_at_imp_continuous_within by blast
  24.146  
  24.147  lemma continuous_on_Arctan [continuous_intros]:
  24.148 -    "(\<And>z. z \<in> s \<Longrightarrow> Re z = 0 \<Longrightarrow> abs \<bar>Im z\<bar> < 1) \<Longrightarrow> continuous_on s Arctan"
  24.149 +    "(\<And>z. z \<in> s \<Longrightarrow> Re z = 0 \<Longrightarrow> \<bar>Im z\<bar> < 1) \<Longrightarrow> continuous_on s Arctan"
  24.150    by (auto simp: continuous_at_imp_continuous_on continuous_within_Arctan)
  24.151  
  24.152  lemma holomorphic_on_Arctan:
  24.153 -    "(\<And>z. z \<in> s \<Longrightarrow> Re z = 0 \<Longrightarrow> abs \<bar>Im z\<bar> < 1) \<Longrightarrow> Arctan holomorphic_on s"
  24.154 +    "(\<And>z. z \<in> s \<Longrightarrow> Re z = 0 \<Longrightarrow> \<bar>Im z\<bar> < 1) \<Longrightarrow> Arctan holomorphic_on s"
  24.155    by (simp add: complex_differentiable_within_Arctan holomorphic_on_def)
  24.156  
  24.157  
  24.158 @@ -1988,17 +1988,17 @@
  24.159  lemma arctan_less_pi4_neg: "-1 < x \<Longrightarrow> -(pi/4) < arctan x"
  24.160    by (metis arctan_less_iff arctan_minus arctan_one)
  24.161  
  24.162 -lemma arctan_less_pi4: "abs x < 1 \<Longrightarrow> abs(arctan x) < pi/4"
  24.163 +lemma arctan_less_pi4: "\<bar>x\<bar> < 1 \<Longrightarrow> \<bar>arctan x\<bar> < pi/4"
  24.164    by (metis abs_less_iff arctan_less_pi4_pos arctan_minus)
  24.165  
  24.166 -lemma arctan_le_pi4: "abs x \<le> 1 \<Longrightarrow> abs(arctan x) \<le> pi/4"
  24.167 +lemma arctan_le_pi4: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>arctan x\<bar> \<le> pi/4"
  24.168    by (metis abs_le_iff arctan_le_iff arctan_minus arctan_one)
  24.169  
  24.170 -lemma abs_arctan: "abs(arctan x) = arctan(abs x)"
  24.171 +lemma abs_arctan: "\<bar>arctan x\<bar> = arctan \<bar>x\<bar>"
  24.172    by (simp add: abs_if arctan_minus)
  24.173  
  24.174  lemma arctan_add_raw:
  24.175 -  assumes "abs(arctan x + arctan y) < pi/2"
  24.176 +  assumes "\<bar>arctan x + arctan y\<bar> < pi/2"
  24.177      shows "arctan x + arctan y = arctan((x + y) / (1 - x * y))"
  24.178  proof (rule arctan_unique [symmetric])
  24.179    show 12: "- (pi / 2) < arctan x + arctan y" "arctan x + arctan y < pi / 2"
  24.180 @@ -2027,7 +2027,7 @@
  24.181  qed
  24.182  
  24.183  lemma arctan_add_small:
  24.184 -  assumes "abs(x * y) < 1"
  24.185 +  assumes "\<bar>x * y\<bar> < 1"
  24.186      shows "(arctan x + arctan y = arctan((x + y) / (1 - x * y)))"
  24.187  proof (cases "x = 0 \<or> y = 0")
  24.188    case True then show ?thesis
  24.189 @@ -2044,7 +2044,7 @@
  24.190  qed
  24.191  
  24.192  lemma abs_arctan_le:
  24.193 -  fixes x::real shows "abs(arctan x) \<le> abs x"
  24.194 +  fixes x::real shows "\<bar>arctan x\<bar> \<le> \<bar>x\<bar>"
  24.195  proof -
  24.196    { fix w::complex and z::complex
  24.197      assume *: "w \<in> \<real>" "z \<in> \<real>"
  24.198 @@ -2064,7 +2064,7 @@
  24.199  lemma arctan_le_self: "0 \<le> x \<Longrightarrow> arctan x \<le> x"
  24.200    by (metis abs_arctan_le abs_of_nonneg zero_le_arctan_iff)
  24.201  
  24.202 -lemma abs_tan_ge: "abs x < pi/2 \<Longrightarrow> abs x \<le> abs(tan x)"
  24.203 +lemma abs_tan_ge: "\<bar>x\<bar> < pi/2 \<Longrightarrow> \<bar>x\<bar> \<le> \<bar>tan x\<bar>"
  24.204    by (metis abs_arctan_le abs_less_iff arctan_tan minus_less_iff)
  24.205  
  24.206  
  24.207 @@ -2078,7 +2078,7 @@
  24.208    apply auto
  24.209    by (metis complex_i_mult_minus diff_add_cancel diff_minus_eq_add diff_self mult.assoc mult.left_commute numeral_One power2_csqrt power2_eq_square zero_neq_numeral)
  24.210  
  24.211 -lemma Arcsin_range_lemma: "abs (Re z) < 1 \<Longrightarrow> 0 < Re(\<i> * z + csqrt(1 - z\<^sup>2))"
  24.212 +lemma Arcsin_range_lemma: "\<bar>Re z\<bar> < 1 \<Longrightarrow> 0 < Re(\<i> * z + csqrt(1 - z\<^sup>2))"
  24.213    using Complex.cmod_power2 [of z, symmetric]
  24.214    by (simp add: real_less_rsqrt algebra_simps Re_power2 cmod_square_less_1_plus)
  24.215  
  24.216 @@ -2393,7 +2393,7 @@
  24.217  
  24.218  subsection\<open>Upper and Lower Bounds for Inverse Sine and Cosine\<close>
  24.219  
  24.220 -lemma Arcsin_bounds: "\<bar>Re z\<bar> < 1 \<Longrightarrow> abs(Re(Arcsin z)) < pi/2"
  24.221 +lemma Arcsin_bounds: "\<bar>Re z\<bar> < 1 \<Longrightarrow> \<bar>Re(Arcsin z)\<bar> < pi/2"
  24.222    unfolding Re_Arcsin
  24.223    by (blast intro: Re_Ln_pos_lt_imp Arcsin_range_lemma)
  24.224  
  24.225 @@ -2405,14 +2405,14 @@
  24.226    unfolding Re_Arccos
  24.227    by (blast intro!: mpi_less_Im_Ln Im_Ln_le_pi Arccos_body_lemma)
  24.228  
  24.229 -lemma Re_Arccos_bound: "abs(Re(Arccos z)) \<le> pi"
  24.230 +lemma Re_Arccos_bound: "\<bar>Re(Arccos z)\<bar> \<le> pi"
  24.231    by (meson Re_Arccos_bounds abs_le_iff less_eq_real_def minus_less_iff)
  24.232  
  24.233  lemma Re_Arcsin_bounds: "-pi < Re(Arcsin z) & Re(Arcsin z) \<le> pi"
  24.234    unfolding Re_Arcsin
  24.235    by (blast intro!: mpi_less_Im_Ln Im_Ln_le_pi Arcsin_body_lemma)
  24.236  
  24.237 -lemma Re_Arcsin_bound: "abs(Re(Arcsin z)) \<le> pi"
  24.238 +lemma Re_Arcsin_bound: "\<bar>Re(Arcsin z)\<bar> \<le> pi"
  24.239    by (meson Re_Arcsin_bounds abs_le_iff less_eq_real_def minus_less_iff)
  24.240  
  24.241  
  24.242 @@ -2521,7 +2521,7 @@
  24.243  subsection\<open>Relationship with Arcsin on the Real Numbers\<close>
  24.244  
  24.245  lemma Im_Arcsin_of_real:
  24.246 -  assumes "abs x \<le> 1"
  24.247 +  assumes "\<bar>x\<bar> \<le> 1"
  24.248      shows "Im (Arcsin (of_real x)) = 0"
  24.249  proof -
  24.250    have "csqrt (1 - (of_real x)\<^sup>2) = (if x^2 \<le> 1 then sqrt (1 - x^2) else \<i> * sqrt (x^2 - 1))"
  24.251 @@ -2539,7 +2539,7 @@
  24.252    by (metis Im_Arcsin_of_real Re_complex_of_real Reals_cases complex_is_Real_iff)
  24.253  
  24.254  lemma arcsin_eq_Re_Arcsin:
  24.255 -  assumes "abs x \<le> 1"
  24.256 +  assumes "\<bar>x\<bar> \<le> 1"
  24.257      shows "arcsin x = Re (Arcsin (of_real x))"
  24.258  unfolding arcsin_def
  24.259  proof (rule the_equality, safe)
  24.260 @@ -2564,14 +2564,14 @@
  24.261      done
  24.262  qed
  24.263  
  24.264 -lemma of_real_arcsin: "abs x \<le> 1 \<Longrightarrow> of_real(arcsin x) = Arcsin(of_real x)"
  24.265 +lemma of_real_arcsin: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> of_real(arcsin x) = Arcsin(of_real x)"
  24.266    by (metis Im_Arcsin_of_real add.right_neutral arcsin_eq_Re_Arcsin complex_eq mult_zero_right of_real_0)
  24.267  
  24.268  
  24.269  subsection\<open>Relationship with Arccos on the Real Numbers\<close>
  24.270  
  24.271  lemma Im_Arccos_of_real:
  24.272 -  assumes "abs x \<le> 1"
  24.273 +  assumes "\<bar>x\<bar> \<le> 1"
  24.274      shows "Im (Arccos (of_real x)) = 0"
  24.275  proof -
  24.276    have "csqrt (1 - (of_real x)\<^sup>2) = (if x^2 \<le> 1 then sqrt (1 - x^2) else \<i> * sqrt (x^2 - 1))"
  24.277 @@ -2589,7 +2589,7 @@
  24.278    by (metis Im_Arccos_of_real Re_complex_of_real Reals_cases complex_is_Real_iff)
  24.279  
  24.280  lemma arccos_eq_Re_Arccos:
  24.281 -  assumes "abs x \<le> 1"
  24.282 +  assumes "\<bar>x\<bar> \<le> 1"
  24.283      shows "arccos x = Re (Arccos (of_real x))"
  24.284  unfolding arccos_def
  24.285  proof (rule the_equality, safe)
  24.286 @@ -2614,7 +2614,7 @@
  24.287      done
  24.288  qed
  24.289  
  24.290 -lemma of_real_arccos: "abs x \<le> 1 \<Longrightarrow> of_real(arccos x) = Arccos(of_real x)"
  24.291 +lemma of_real_arccos: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> of_real(arccos x) = Arccos(of_real x)"
  24.292    by (metis Im_Arccos_of_real add.right_neutral arccos_eq_Re_Arccos complex_eq mult_zero_right of_real_0)
  24.293  
  24.294  subsection\<open>Some interrelationships among the real inverse trig functions.\<close>
    25.1 --- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy	Mon Dec 28 01:26:34 2015 +0100
    25.2 +++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy	Mon Dec 28 01:28:28 2015 +0100
    25.3 @@ -3328,13 +3328,13 @@
    25.4      ultimately have **: "(1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x \<in> affine hull S"
    25.5        using as affine_affine_hull[of S] mem_affine[of "affine hull S" y x "(1 / e)" "-((1 - e) / e)"]
    25.6        by (simp add: algebra_simps)
    25.7 -    have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = abs(1/e) * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)"
    25.8 +    have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \<bar>1/e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)"
    25.9        unfolding dist_norm norm_scaleR[symmetric]
   25.10        apply (rule arg_cong[where f=norm])
   25.11        using \<open>e > 0\<close>
   25.12        apply (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps)
   25.13        done
   25.14 -    also have "\<dots> = abs (1/e) * norm (x - e *\<^sub>R (x - c) - y)"
   25.15 +    also have "\<dots> = \<bar>1/e\<bar> * norm (x - e *\<^sub>R (x - c) - y)"
   25.16        by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps)
   25.17      also have "\<dots> < d"
   25.18        using as[unfolded dist_norm] and \<open>e > 0\<close>
   25.19 @@ -6076,15 +6076,15 @@
   25.20    fixes s :: "('a::real_normed_vector) set"
   25.21    assumes "open s"
   25.22      and "convex_on s f"
   25.23 -    and "\<forall>x\<in>s. abs(f x) \<le> b"
   25.24 +    and "\<forall>x\<in>s. \<bar>f x\<bar> \<le> b"
   25.25    shows "continuous_on s f"
   25.26    apply (rule continuous_at_imp_continuous_on)
   25.27    unfolding continuous_at_real_range
   25.28  proof (rule,rule,rule)
   25.29    fix x and e :: real
   25.30    assume "x \<in> s" "e > 0"
   25.31 -  def B \<equiv> "abs b + 1"
   25.32 -  have B: "0 < B" "\<And>x. x\<in>s \<Longrightarrow> abs (f x) \<le> B"
   25.33 +  def B \<equiv> "\<bar>b\<bar> + 1"
   25.34 +  have B: "0 < B" "\<And>x. x\<in>s \<Longrightarrow> \<bar>f x\<bar> \<le> B"
   25.35      unfolding B_def
   25.36      defer
   25.37      apply (drule assms(3)[rule_format])
   25.38 @@ -6193,7 +6193,7 @@
   25.39    fixes x :: "'a::real_normed_vector"
   25.40    assumes "convex_on (cball x e) f"
   25.41      and "\<forall>y \<in> cball x e. f y \<le> b"
   25.42 -  shows "\<forall>y \<in> cball x e. abs (f y) \<le> b + 2 * abs (f x)"
   25.43 +  shows "\<forall>y \<in> cball x e. \<bar>f y\<bar> \<le> b + 2 * \<bar>f x\<bar>"
   25.44    apply rule
   25.45  proof (cases "0 \<le> e")
   25.46    case True
   25.47 @@ -6310,7 +6310,7 @@
   25.48      apply (rule e(1))
   25.49      apply (rule dsube)
   25.50      done
   25.51 -  then have "\<forall>y\<in>cball x d. abs (f y) \<le> k + 2 * abs (f x)"
   25.52 +  then have "\<forall>y\<in>cball x d. \<bar>f y\<bar> \<le> k + 2 * \<bar>f x\<bar>"
   25.53      apply (rule convex_bounds_lemma)
   25.54      apply (rule ballI)
   25.55      apply (rule k [rule_format])
   25.56 @@ -6751,13 +6751,13 @@
   25.57      assume as: "dist (x - e *\<^sub>R (x - c)) y < e * d"
   25.58      have *: "y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x"
   25.59        using \<open>e > 0\<close> by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib)
   25.60 -    have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = abs(1/e) * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)"
   25.61 +    have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \<bar>1/e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)"
   25.62        unfolding dist_norm
   25.63        unfolding norm_scaleR[symmetric]
   25.64        apply (rule arg_cong[where f=norm])
   25.65        using \<open>e > 0\<close>
   25.66        by (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps)
   25.67 -    also have "\<dots> = abs (1/e) * norm (x - e *\<^sub>R (x - c) - y)"
   25.68 +    also have "\<dots> = \<bar>1/e\<bar> * norm (x - e *\<^sub>R (x - c) - y)"
   25.69        by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps)
   25.70      also have "\<dots> < d"
   25.71        using as[unfolded dist_norm] and \<open>e > 0\<close>
   25.72 @@ -7001,7 +7001,7 @@
   25.73      proof (rule setsum_mono)
   25.74        fix i :: 'a
   25.75        assume i: "i \<in> Basis"
   25.76 -      then have "abs (y\<bullet>i - x\<bullet>i) < ?d"
   25.77 +      then have "\<bar>y\<bullet>i - x\<bullet>i\<bar> < ?d"
   25.78          apply -
   25.79          apply (rule le_less_trans)
   25.80          using Basis_le_norm[OF i, of "y - x"]
   25.81 @@ -7186,7 +7186,7 @@
   25.82            assume "i \<in> d"
   25.83            with d have i: "i \<in> Basis"
   25.84              by auto
   25.85 -          have "abs (y\<bullet>i - x\<bullet>i) < ?d"
   25.86 +          have "\<bar>y\<bullet>i - x\<bullet>i\<bar> < ?d"
   25.87              apply (rule le_less_trans)
   25.88              using Basis_le_norm[OF i, of "y - x"]
   25.89              using y[unfolded min_less_iff_conj dist_norm, THEN conjunct2]
   25.90 @@ -9860,7 +9860,7 @@
   25.91  lemma setdist_singletons [simp]: "setdist {x} {y} = dist x y"
   25.92    by (simp add: setdist_def)
   25.93  
   25.94 -lemma setdist_Lipschitz: "abs(setdist {x} s - setdist {y} s) \<le> dist x y"
   25.95 +lemma setdist_Lipschitz: "\<bar>setdist {x} s - setdist {y} s\<bar> \<le> dist x y"
   25.96    apply (subst setdist_singletons [symmetric])
   25.97    by (metis abs_diff_le_iff diff_le_eq setdist_triangle setdist_sym)
   25.98  
    26.1 --- a/src/HOL/Multivariate_Analysis/Derivative.thy	Mon Dec 28 01:26:34 2015 +0100
    26.2 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy	Mon Dec 28 01:28:28 2015 +0100
    26.3 @@ -372,7 +372,7 @@
    26.4    fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
    26.5    assumes "(f has_derivative f') (at x within s)"
    26.6      and "(f has_derivative f'') (at x within s)"
    26.7 -    and "\<forall>i\<in>Basis. \<forall>e>0. \<exists>d. 0 < abs d \<and> abs d < e \<and> (x + d *\<^sub>R i) \<in> s"
    26.8 +    and "\<forall>i\<in>Basis. \<forall>e>0. \<exists>d. 0 < \<bar>d\<bar> \<and> \<bar>d\<bar> < e \<and> (x + d *\<^sub>R i) \<in> s"
    26.9    shows "f' = f''"
   26.10  proof -
   26.11    note as = assms(1,2)[unfolded has_derivative_def]
   26.12 @@ -415,9 +415,9 @@
   26.13      obtain c where c: "0 < \<bar>c\<bar>" "\<bar>c\<bar> < d \<and> x + c *\<^sub>R i \<in> s"
   26.14        using assms(3) i d(1) by blast
   26.15      have *: "norm (- ((1 / \<bar>c\<bar>) *\<^sub>R f' (c *\<^sub>R i)) + (1 / \<bar>c\<bar>) *\<^sub>R f'' (c *\<^sub>R i)) =
   26.16 -        norm ((1 / abs c) *\<^sub>R (- (f' (c *\<^sub>R i)) + f'' (c *\<^sub>R i)))"
   26.17 +        norm ((1 / \<bar>c\<bar>) *\<^sub>R (- (f' (c *\<^sub>R i)) + f'' (c *\<^sub>R i)))"
   26.18        unfolding scaleR_right_distrib by auto
   26.19 -    also have "\<dots> = norm ((1 / abs c) *\<^sub>R (c *\<^sub>R (- (f' i) + f'' i)))"
   26.20 +    also have "\<dots> = norm ((1 / \<bar>c\<bar>) *\<^sub>R (c *\<^sub>R (- (f' i) + f'' i)))"
   26.21        unfolding f'.scaleR f''.scaleR
   26.22        unfolding scaleR_right_distrib scaleR_minus_right
   26.23        by auto
    27.1 --- a/src/HOL/Multivariate_Analysis/Fashoda.thy	Mon Dec 28 01:26:34 2015 +0100
    27.2 +++ b/src/HOL/Multivariate_Analysis/Fashoda.thy	Mon Dec 28 01:28:28 2015 +0100
    27.3 @@ -82,19 +82,19 @@
    27.4  
    27.5  lemma infnorm_2:
    27.6    fixes x :: "real^2"
    27.7 -  shows "infnorm x = max (abs (x$1)) (abs (x$2))"
    27.8 +  shows "infnorm x = max \<bar>x$1\<bar> \<bar>x$2\<bar>"
    27.9    unfolding infnorm_cart UNIV_2 by (rule cSup_eq) auto
   27.10  
   27.11  lemma infnorm_eq_1_2:
   27.12    fixes x :: "real^2"
   27.13    shows "infnorm x = 1 \<longleftrightarrow>
   27.14 -    abs (x$1) \<le> 1 \<and> abs (x$2) \<le> 1 \<and> (x$1 = -1 \<or> x$1 = 1 \<or> x$2 = -1 \<or> x$2 = 1)"
   27.15 +    \<bar>x$1\<bar> \<le> 1 \<and> \<bar>x$2\<bar> \<le> 1 \<and> (x$1 = -1 \<or> x$1 = 1 \<or> x$2 = -1 \<or> x$2 = 1)"
   27.16    unfolding infnorm_2 by auto
   27.17  
   27.18  lemma infnorm_eq_1_imp:
   27.19    fixes x :: "real^2"
   27.20    assumes "infnorm x = 1"
   27.21 -  shows "abs (x$1) \<le> 1" and "abs (x$2) \<le> 1"
   27.22 +  shows "\<bar>x$1\<bar> \<le> 1" and "\<bar>x$2\<bar> \<le> 1"
   27.23    using assms unfolding infnorm_eq_1_2 by auto
   27.24  
   27.25  lemma fashoda_unit:
    28.1 --- a/src/HOL/Multivariate_Analysis/Integration.thy	Mon Dec 28 01:26:34 2015 +0100
    28.2 +++ b/src/HOL/Multivariate_Analysis/Integration.thy	Mon Dec 28 01:28:28 2015 +0100
    28.3 @@ -499,7 +499,7 @@
    28.4  lemma content_real: "a \<le> b \<Longrightarrow> content {a..b} = b - a"
    28.5    by (auto simp: interval_upperbound_def interval_lowerbound_def SUP_def INF_def content_def)
    28.6  
    28.7 -lemma abs_eq_content: "abs (y - x) = (if x\<le>y then content {x .. y} else content {y..x})"
    28.8 +lemma abs_eq_content: "\<bar>y - x\<bar> = (if x\<le>y then content {x .. y} else content {y..x})"
    28.9    by (auto simp: content_real)
   28.10  
   28.11  lemma content_singleton[simp]: "content {a} = 0"
   28.12 @@ -2116,7 +2116,7 @@
   28.13      proof (rule exI [where x=n], clarify)
   28.14        fix x y
   28.15        assume xy: "x\<in>cbox (A n) (B n)" "y\<in>cbox (A n) (B n)"
   28.16 -      have "dist x y \<le> setsum (\<lambda>i. abs((x - y)\<bullet>i)) Basis"
   28.17 +      have "dist x y \<le> setsum (\<lambda>i. \<bar>(x - y)\<bullet>i\<bar>) Basis"
   28.18          unfolding dist_norm by(rule norm_le_l1)
   28.19        also have "\<dots> \<le> setsum (\<lambda>i. B n\<bullet>i - A n\<bullet>i) Basis"
   28.20        proof (rule setsum_mono)
   28.21 @@ -3140,7 +3140,7 @@
   28.22         apply (rule has_integralD[OF fj[unfolded interval_split[OF k]] e])
   28.23         apply (simp add: interval_split[symmetric] k)
   28.24         done
   28.25 -  let ?d = "\<lambda>x. if x\<bullet>k = c then (d1 x \<inter> d2 x) else ball x (abs(x\<bullet>k - c)) \<inter> d1 x \<inter> d2 x"
   28.26 +  let ?d = "\<lambda>x. if x\<bullet>k = c then (d1 x \<inter> d2 x) else ball x \<bar>x\<bullet>k - c\<bar> \<inter> d1 x \<inter> d2 x"
   28.27    have "gauge ?d"
   28.28      using d1 d2 unfolding gauge_def by auto
   28.29    then show ?case
   28.30 @@ -4659,11 +4659,11 @@
   28.31  lemma interval_doublesplit:
   28.32    fixes a :: "'a::euclidean_space"
   28.33    assumes "k \<in> Basis"
   28.34 -  shows "cbox a b \<inter> {x . abs(x\<bullet>k - c) \<le> (e::real)} =
   28.35 +  shows "cbox a b \<inter> {x . \<bar>x\<bullet>k - c\<bar> \<le> (e::real)} =
   28.36      cbox (\<Sum>i\<in>Basis. (if i = k then max (a\<bullet>k) (c - e) else a\<bullet>i) *\<^sub>R i)
   28.37       (\<Sum>i\<in>Basis. (if i = k then min (b\<bullet>k) (c + e) else b\<bullet>i) *\<^sub>R i)"
   28.38  proof -
   28.39 -  have *: "\<And>x c e::real. abs(x - c) \<le> e \<longleftrightarrow> x \<ge> c - e \<and> x \<le> c + e"
   28.40 +  have *: "\<And>x c e::real. \<bar>x - c\<bar> \<le> e \<longleftrightarrow> x \<ge> c - e \<and> x \<le> c + e"
   28.41      by auto
   28.42    have **: "\<And>s P Q. s \<inter> {x. P x \<and> Q x} = (s \<inter> {x. Q x}) \<inter> {x. P x}"
   28.43      by blast
   28.44 @@ -4675,10 +4675,10 @@
   28.45    fixes a :: "'a::euclidean_space"
   28.46    assumes "p division_of (cbox a b)"
   28.47      and k: "k \<in> Basis"
   28.48 -  shows "{l \<inter> {x. abs(x\<bullet>k - c) \<le> e} |l. l \<in> p \<and> l \<inter> {x. abs(x\<bullet>k - c) \<le> e} \<noteq> {}}
   28.49 -         division_of  (cbox a b \<inter> {x. abs(x\<bullet>k - c) \<le> e})"
   28.50 -proof -
   28.51 -  have *: "\<And>x c. abs (x - c) \<le> e \<longleftrightarrow> x \<ge> c - e \<and> x \<le> c + e"
   28.52 +  shows "{l \<inter> {x. \<bar>x\<bullet>k - c\<bar> \<le> e} |l. l \<in> p \<and> l \<inter> {x. \<bar>x\<bullet>k - c\<bar> \<le> e} \<noteq> {}}
   28.53 +         division_of  (cbox a b \<inter> {x. \<bar>x\<bullet>k - c\<bar> \<le> e})"
   28.54 +proof -
   28.55 +  have *: "\<And>x c. \<bar>x - c\<bar> \<le> e \<longleftrightarrow> x \<ge> c - e \<and> x \<le> c + e"
   28.56      by auto
   28.57    have **: "\<And>p q p' q'. p division_of q \<Longrightarrow> p = p' \<Longrightarrow> q = q' \<Longrightarrow> p' division_of q'"
   28.58      by auto
   28.59 @@ -4700,7 +4700,7 @@
   28.60    fixes a :: "'a::euclidean_space"
   28.61    assumes "0 < e"
   28.62      and k: "k \<in> Basis"
   28.63 -  obtains d where "0 < d" and "content (cbox a b \<inter> {x. abs(x\<bullet>k - c) \<le> d}) < e"
   28.64 +  obtains d where "0 < d" and "content (cbox a b \<inter> {x. \<bar>x\<bullet>k - c\<bar> \<le> d}) < e"
   28.65  proof (cases "content (cbox a b) = 0")
   28.66    case True
   28.67    then have ce: "content (cbox a b) < e"
   28.68 @@ -4780,7 +4780,7 @@
   28.69      fix p
   28.70      assume p: "p tagged_division_of (cbox a b) \<and> (\<lambda>x. ball x d) fine p"
   28.71      have *: "(\<Sum>(x, ka)\<in>p. content ka *\<^sub>R ?i x) =
   28.72 -      (\<Sum>(x, ka)\<in>p. content (ka \<inter> {x. abs(x\<bullet>k - c) \<le> d}) *\<^sub>R ?i x)"
   28.73 +      (\<Sum>(x, ka)\<in>p. content (ka \<inter> {x. \<bar>x\<bullet>k - c\<bar> \<le> d}) *\<^sub>R ?i x)"
   28.74        apply (rule setsum.cong)
   28.75        apply (rule refl)
   28.76        unfolding split_paired_all real_scaleR_def mult_cancel_right split_conv
   28.77 @@ -6695,7 +6695,7 @@
   28.78  
   28.79  lemma content_image_affinity_cbox:
   28.80    "content((\<lambda>x::'a::euclidean_space. m *\<^sub>R x + c) ` cbox a b) =
   28.81 -    abs m ^ DIM('a) * content (cbox a b)" (is "?l = ?r")
   28.82 +    \<bar>m\<bar> ^ DIM('a) * content (cbox a b)" (is "?l = ?r")
   28.83  proof -
   28.84    {
   28.85      presume *: "cbox a b \<noteq> {} \<Longrightarrow> ?thesis"
   28.86 @@ -6743,7 +6743,7 @@
   28.87    fixes a :: "'a::euclidean_space"
   28.88    assumes "(f has_integral i) (cbox a b)"
   28.89        and "m \<noteq> 0"
   28.90 -  shows "((\<lambda>x. f(m *\<^sub>R x + c)) has_integral ((1 / (abs(m) ^ DIM('a))) *\<^sub>R i)) ((\<lambda>x. (1 / m) *\<^sub>R x + -((1 / m) *\<^sub>R c)) ` cbox a b)"
   28.91 +  shows "((\<lambda>x. f(m *\<^sub>R x + c)) has_integral ((1 / (\<bar>m\<bar> ^ DIM('a))) *\<^sub>R i)) ((\<lambda>x. (1 / m) *\<^sub>R x + -((1 / m) *\<^sub>R c)) ` cbox a b)"
   28.92    apply (rule has_integral_twiddle)
   28.93    using assms
   28.94    apply (safe intro!: interval_image_affinity_interval content_image_affinity_cbox)
   28.95 @@ -6807,7 +6807,7 @@
   28.96  
   28.97  lemma content_image_stretch_interval:
   28.98    "content ((\<lambda>x::'a::euclidean_space. (\<Sum>k\<in>Basis. (m k * (x\<bullet>k))*\<^sub>R k)::'a) ` cbox a b) =
   28.99 -    abs (setprod m Basis) * content (cbox a b)"
  28.100 +    \<bar>setprod m Basis\<bar> * content (cbox a b)"
  28.101  proof (cases "cbox a b = {}")
  28.102    case True
  28.103    then show ?thesis
  28.104 @@ -6847,7 +6847,7 @@
  28.105    assumes "(f has_integral i) (cbox a b)"
  28.106      and "\<forall>k\<in>Basis. m k \<noteq> 0"
  28.107    shows "((\<lambda>x. f (\<Sum>k\<in>Basis. (m k * (x\<bullet>k))*\<^sub>R k)) has_integral
  28.108 -    ((1/(abs(setprod m Basis))) *\<^sub>R i)) ((\<lambda>x. (\<Sum>k\<in>Basis. (1 / m k * (x\<bullet>k))*\<^sub>R k)) ` cbox a b)"
  28.109 +    ((1/ \<bar>setprod m Basis\<bar>) *\<^sub>R i)) ((\<lambda>x. (\<Sum>k\<in>Basis. (1 / m k * (x\<bullet>k))*\<^sub>R k)) ` cbox a b)"
  28.110    apply (rule has_integral_twiddle[where f=f])
  28.111    unfolding zero_less_abs_iff content_image_stretch_interval
  28.112    unfolding image_stretch_interval empty_as_interval euclidean_eq_iff[where 'a='a]
  28.113 @@ -8829,8 +8829,8 @@
  28.114      unfolding fine_inter
  28.115    proof (safe, goal_cases)
  28.116      have **: "\<And>i j g1 g2 h1 h2 f1 f2. g1 - h2 \<le> f1 - f2 \<Longrightarrow> f1 - f2 \<le> h1 - g2 \<Longrightarrow>
  28.117 -      abs (i - j) < e / 3 \<Longrightarrow> abs (g2 - i) < e / 3 \<Longrightarrow>  abs (g1 - i) < e / 3 \<Longrightarrow>
  28.118 -      abs (h2 - j) < e / 3 \<Longrightarrow> abs (h1 - j) < e / 3 \<Longrightarrow> abs (f1 - f2) < e"
  28.119 +      \<bar>i - j\<bar> < e / 3 \<Longrightarrow> \<bar>g2 - i\<bar> < e / 3 \<Longrightarrow> \<bar>g1 - i\<bar> < e / 3 \<Longrightarrow>
  28.120 +      \<bar>h2 - j\<bar> < e / 3 \<Longrightarrow> \<bar>h1 - j\<bar> < e / 3 \<Longrightarrow> \<bar>f1 - f2\<bar> < e"
  28.121      using \<open>e > 0\<close> by arith
  28.122      case prems: (1 p1 p2)
  28.123      note tagged_division_ofD(2-4) note * = this[OF prems(1)] this[OF prems(4)]
  28.124 @@ -8996,9 +8996,9 @@
  28.125        have **: "ball 0 B1 \<subseteq> ball (0::'n) (max B1 B2)" "ball 0 B2 \<subseteq> ball (0::'n) (max B1 B2)"
  28.126          by auto
  28.127        have *: "\<And>ga gc ha hc fa fc::real.
  28.128 -        abs (ga - i) < e / 3 \<and> abs (gc - i) < e / 3 \<and> abs (ha - j) < e / 3 \<and>
  28.129 -        abs (hc - j) < e / 3 \<and> abs (i - j) < e / 3 \<and> ga \<le> fa \<and> fa \<le> ha \<and> gc \<le> fc \<and> fc \<le> hc \<Longrightarrow>
  28.130 -        abs (fa - fc) < e"
  28.131 +        \<bar>ga - i\<bar> < e / 3 \<and> \<bar>gc - i\<bar> < e / 3 \<and> \<bar>ha - j\<bar> < e / 3 \<and>
  28.132 +        \<bar>hc - j\<bar> < e / 3 \<and> \<bar>i - j\<bar> < e / 3 \<and> ga \<le> fa \<and> fa \<le> ha \<and> gc \<le> fc \<and> fc \<le> hc \<Longrightarrow>
  28.133 +        \<bar>fa - fc\<bar> < e"
  28.134          by (simp add: abs_real_def split: split_if_asm)
  28.135        show "norm (integral (cbox a b) (\<lambda>x. if x \<in> s then f x else 0) - integral (cbox c d)
  28.136          (\<lambda>x. if x \<in> s then f x else 0)) < e"
  28.137 @@ -9875,7 +9875,7 @@
  28.138          case 3
  28.139          note comb = integral_combine_tagged_division_topdown[OF assms(1)[rule_format] p(1)]
  28.140          have *: "\<And>sr sx ss ks kr::real. kr = sr \<longrightarrow> ks = ss \<longrightarrow>
  28.141 -          ks \<le> i \<and> sr \<le> sx \<and> sx \<le> ss \<and> 0 \<le> i\<bullet>1 - kr\<bullet>1 \<and> i\<bullet>1 - kr\<bullet>1 < e/4 \<longrightarrow> abs (sx - i) < e/4"
  28.142 +          ks \<le> i \<and> sr \<le> sx \<and> sx \<le> ss \<and> 0 \<le> i\<bullet>1 - kr\<bullet>1 \<and> i\<bullet>1 - kr\<bullet>1 < e/4 \<longrightarrow> \<bar>sx - i\<bar> < e/4"
  28.143            by auto
  28.144          show ?case
  28.145            unfolding real_norm_def
  28.146 @@ -10087,8 +10087,8 @@
  28.147            apply (subst norm_minus_commute)
  28.148            apply auto
  28.149            done
  28.150 -        have *: "\<And>f1 f2 g. abs (f1 - i) < e / 2 \<longrightarrow> abs (f2 - g) < e / 2 \<longrightarrow>
  28.151 -          f1 \<le> f2 \<longrightarrow> f2 \<le> i \<longrightarrow> abs (g - i) < e"
  28.152 +        have *: "\<And>f1 f2 g. \<bar>f1 - i\<bar> < e / 2 \<longrightarrow> \<bar>f2 - g\<bar> < e / 2 \<longrightarrow>
  28.153 +          f1 \<le> f2 \<longrightarrow> f2 \<le> i \<longrightarrow> \<bar>g - i\<bar> < e"
  28.154            unfolding real_inner_1_right by arith
  28.155          show "norm (integral (cbox a b) (\<lambda>x. if x \<in> s then g x else 0) - i) < e"
  28.156            unfolding real_norm_def
  28.157 @@ -10305,7 +10305,7 @@
  28.158      done
  28.159    have norm: "norm ig < dia + e"
  28.160      if "norm sg \<le> dsa"
  28.161 -    and "abs (dsa - dia) < e / 2"
  28.162 +    and "\<bar>dsa - dia\<bar> < e / 2"
  28.163      and "norm (sg - ig) < e / 2"
  28.164      for e dsa dia and sg ig :: 'a
  28.165      apply (rule le_less_trans[OF norm_triangle_sub[of ig sg]])
  28.166 @@ -10445,7 +10445,7 @@
  28.167      (\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on s"
  28.168    unfolding absolutely_integrable_on_def
  28.169    using integrable_cmul[of f s c]
  28.170 -  using integrable_cmul[of "\<lambda>x. norm (f x)" s "abs c"]
  28.171 +  using integrable_cmul[of "\<lambda>x. norm (f x)" s "\<bar>c\<bar>"]
  28.172    by auto
  28.173  
  28.174  lemma absolutely_integrable_neg[intro]:
  28.175 @@ -10463,7 +10463,7 @@
  28.176  
  28.177  lemma absolutely_integrable_abs[intro]:
  28.178    "f absolutely_integrable_on s \<Longrightarrow>
  28.179 -    (\<lambda>x. abs(f x::real)) absolutely_integrable_on s"
  28.180 +    (\<lambda>x. \<bar>f x::real\<bar>) absolutely_integrable_on s"
  28.181    apply (drule absolutely_integrable_norm)
  28.182    unfolding real_norm_def
  28.183    apply assumption
  28.184 @@ -10510,7 +10510,7 @@
  28.185  lemma helplemma:
  28.186    assumes "setsum (\<lambda>x. norm (f x - g x)) s < e"
  28.187      and "finite s"
  28.188 -  shows "abs (setsum (\<lambda>x. norm(f x)) s - setsum (\<lambda>x. norm(g x)) s) < e"
  28.189 +  shows "\<bar>setsum (\<lambda>x. norm(f x)) s - setsum (\<lambda>x. norm(g x)) s\<bar> < e"
  28.190    unfolding setsum_subtractf[symmetric]
  28.191    apply (rule le_less_trans[OF setsum_abs])
  28.192    apply (rule le_less_trans[OF _ assms(1)])
  28.193 @@ -10709,8 +10709,8 @@
  28.194          done
  28.195        note snd_p = division_ofD[OF division_of_tagged_division[OF p(1)]]
  28.196  
  28.197 -      have *: "\<And>sni sni' sf sf'. abs (sf' - sni') < e / 2 \<longrightarrow> ?S - e / 2 < sni \<and> sni' \<le> ?S \<and>
  28.198 -        sni \<le> sni' \<and> sf' = sf \<longrightarrow> abs (sf - ?S) < e"
  28.199 +      have *: "\<And>sni sni' sf sf'. \<bar>sf' - sni'\<bar> < e / 2 \<longrightarrow> ?S - e / 2 < sni \<and> sni' \<le> ?S \<and>
  28.200 +        sni \<le> sni' \<and> sf' = sf \<longrightarrow> \<bar>sf - ?S\<bar> < e"
  28.201          by arith
  28.202        show "norm ((\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) - ?S) < e"
  28.203          unfolding real_norm_def
  28.204 @@ -11061,7 +11061,7 @@
  28.205      proof -
  28.206        fix a b :: 'n
  28.207        assume ab: "ball 0 (K + 1) \<subseteq> cbox a b"
  28.208 -      have *: "\<forall>s s1. ?S - e < s1 \<and> s1 \<le> s \<and> s < ?S + e \<longrightarrow> abs (s - ?S) < e"
  28.209 +      have *: "\<forall>s s1. ?S - e < s1 \<and> s1 \<le> s \<and> s < ?S + e \<longrightarrow> \<bar>s - ?S\<bar> < e"
  28.210          by arith
  28.211        show "norm (integral (cbox a b) (\<lambda>x. if x \<in> UNIV then norm (f x) else 0) - ?S) < e"
  28.212          unfolding real_norm_def
  28.213 @@ -11121,8 +11121,8 @@
  28.214            p: "p tagged_division_of (cbox a b)" "d1 fine p" "d2 fine p"
  28.215            by (rule fine_division_exists [OF gauge_inter [OF d1(1) d2(1)], of a b])
  28.216              (auto simp add: fine_inter)
  28.217 -        have *: "\<And>sf sf' si di. sf' = sf \<longrightarrow> si \<le> ?S \<longrightarrow> abs (sf - si) < e / 2 \<longrightarrow>
  28.218 -          abs (sf' - di) < e / 2 \<longrightarrow> di < ?S + e"
  28.219 +        have *: "\<And>sf sf' si di. sf' = sf \<longrightarrow> si \<le> ?S \<longrightarrow> \<bar>sf - si\<bar> < e / 2 \<longrightarrow>
  28.220 +          \<bar>sf' - di\<bar> < e / 2 \<longrightarrow> di < ?S + e"
  28.221            by arith
  28.222          show "integral (cbox a b) (\<lambda>x. if x \<in> UNIV then norm (f x) else 0) < ?S + e"
  28.223            apply (subst if_P)
  28.224 @@ -11136,7 +11136,7 @@
  28.225              unfolding tagged_division_of_def split_def
  28.226              apply auto
  28.227              done
  28.228 -          show "abs ((\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\<lambda>x. norm(f x))) < e / 2"
  28.229 +          show "\<bar>(\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\<lambda>x. norm(f x))\<bar> < e / 2"
  28.230              using d1(2)[rule_format,OF conjI[OF p(1,2)]]
  28.231              by (simp only: real_norm_def)
  28.232            show "(\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) = (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x))"
  28.233 @@ -11295,7 +11295,7 @@
  28.234    fixes f :: "'a::euclidean_space => 'b::euclidean_space"
  28.235      and T :: "'c::euclidean_space \<Rightarrow> 'b"
  28.236    assumes f: "f absolutely_integrable_on s"
  28.237 -  shows "(\<lambda>x. (\<Sum>i\<in>Basis. abs(f x\<bullet>T i) *\<^sub>R i)) absolutely_integrable_on s"
  28.238 +  shows "(\<lambda>x. (\<Sum>i\<in>Basis. \<bar>f x\<bullet>T i\<bar> *\<^sub>R i)) absolutely_integrable_on s"
  28.239    (is "?Tf absolutely_integrable_on s")
  28.240  proof -
  28.241    have if_distrib: "\<And>P A B x. (if P then A else B) *\<^sub>R x = (if P then A *\<^sub>R x else B *\<^sub>R x)"
  28.242 @@ -11350,7 +11350,7 @@
  28.243  lemma absolutely_integrable_abs_eq:
  28.244    fixes f::"'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  28.245    shows "f absolutely_integrable_on s \<longleftrightarrow> f integrable_on s \<and>
  28.246 -    (\<lambda>x. (\<Sum>i\<in>Basis. abs(f x\<bullet>i) *\<^sub>R i)::'m) integrable_on s"
  28.247 +    (\<lambda>x. (\<Sum>i\<in>Basis. \<bar>f x\<bullet>i\<bar> *\<^sub>R i)::'m) integrable_on s"
  28.248    (is "?l = ?r")
  28.249  proof
  28.250    assume ?l
  28.251 @@ -11976,7 +11976,7 @@
  28.252          apply safe
  28.253        proof goal_cases
  28.254          case prems: (1 n)
  28.255 -        have *: "\<And>y ix. y < Inf ?S + r \<longrightarrow> Inf ?S \<le> ix \<longrightarrow> ix \<le> y \<longrightarrow> abs(ix - Inf ?S) < r"
  28.256 +        have *: "\<And>y ix. y < Inf ?S + r \<longrightarrow> Inf ?S \<le> ix \<longrightarrow> ix \<le> y \<longrightarrow> \<bar>ix - Inf ?S\<bar> < r"
  28.257            by arith
  28.258          show ?case
  28.259            unfolding real_norm_def
  28.260 @@ -12046,7 +12046,7 @@
  28.261          apply safe
  28.262        proof goal_cases
  28.263          case prems: (1 n)
  28.264 -        have *: "\<And>y ix. Sup ?S - r < y \<longrightarrow> ix \<le> Sup ?S \<longrightarrow> y \<le> ix \<longrightarrow> abs(ix - Sup ?S) < r"
  28.265 +        have *: "\<And>y ix. Sup ?S - r < y \<longrightarrow> ix \<le> Sup ?S \<longrightarrow> y \<le> ix \<longrightarrow> \<bar>ix - Sup ?S\<bar> < r"
  28.266            by arith
  28.267          show ?case
  28.268            apply simp
    29.1 --- a/src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy	Mon Dec 28 01:26:34 2015 +0100
    29.2 +++ b/src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy	Mon Dec 28 01:28:28 2015 +0100
    29.3 @@ -13,7 +13,7 @@
    29.4    assumes eucl_sup: "sup x y = (\<Sum>i\<in>Basis. sup (x \<bullet> i) (y \<bullet> i) *\<^sub>R i)"
    29.5    assumes eucl_Inf: "Inf X = (\<Sum>i\<in>Basis. (INF x:X. x \<bullet> i) *\<^sub>R i)"
    29.6    assumes eucl_Sup: "Sup X = (\<Sum>i\<in>Basis. (SUP x:X. x \<bullet> i) *\<^sub>R i)"
    29.7 -  assumes eucl_abs: "abs x = (\<Sum>i\<in>Basis. abs (x \<bullet> i) *\<^sub>R i)"
    29.8 +  assumes eucl_abs: "\<bar>x\<bar> = (\<Sum>i\<in>Basis. \<bar>x \<bullet> i\<bar> *\<^sub>R i)"
    29.9  begin
   29.10  
   29.11  subclass order
   29.12 @@ -55,7 +55,7 @@
   29.13    and inner_Basis_SUP_left: "i \<in> Basis \<Longrightarrow> (SUP x:X. f x) \<bullet> i = (SUP x:X. f x \<bullet> i)"
   29.14    using eucl_Sup [of "f ` X"] eucl_Inf [of "f ` X"] by (simp_all add: comp_def)
   29.15  
   29.16 -lemma abs_inner: "i \<in> Basis \<Longrightarrow> abs x \<bullet> i = abs (x \<bullet> i)"
   29.17 +lemma abs_inner: "i \<in> Basis \<Longrightarrow> \<bar>x\<bar> \<bullet> i = \<bar>x \<bullet> i\<bar>"
   29.18    by (auto simp: eucl_abs)
   29.19  
   29.20  lemma
   29.21 @@ -159,12 +159,13 @@
   29.22    shows "i \<in> Basis \<longleftrightarrow> fst i = 0 \<and> snd i \<in> Basis \<or> snd i = 0 \<and> fst i \<in> Basis"
   29.23    by (cases i) (auto simp: Basis_prod_def)
   29.24  
   29.25 -instantiation prod::(abs, abs) abs
   29.26 +instantiation prod :: (abs, abs) abs
   29.27  begin
   29.28  
   29.29 -definition "abs x = (abs (fst x), abs (snd x))"
   29.30 +definition "\<bar>x\<bar> = (\<bar>fst x\<bar>, \<bar>snd x\<bar>)"
   29.31  
   29.32 -instance proof qed
   29.33 +instance ..
   29.34 +
   29.35  end
   29.36  
   29.37  instance prod :: (ordered_euclidean_space, ordered_euclidean_space) ordered_euclidean_space
   29.38 @@ -269,7 +270,7 @@
   29.39  definition "sup x y = (\<chi> i. sup (x $ i) (y $ i))"
   29.40  definition "Inf X = (\<chi> i. (INF x:X. x $ i))"
   29.41  definition "Sup X = (\<chi> i. (SUP x:X. x $ i))"
   29.42 -definition "abs x = (\<chi> i. abs (x $ i))"
   29.43 +definition "\<bar>x\<bar> = (\<chi> i. \<bar>x $ i\<bar>)"
   29.44  
   29.45  instance
   29.46    apply standard
    30.1 --- a/src/HOL/Multivariate_Analysis/PolyRoots.thy	Mon Dec 28 01:26:34 2015 +0100
    30.2 +++ b/src/HOL/Multivariate_Analysis/PolyRoots.thy	Mon Dec 28 01:28:28 2015 +0100
    30.3 @@ -169,7 +169,7 @@
    30.4      qed
    30.5  qed
    30.6  
    30.7 -lemma norm_lemma_xy: "\<lbrakk>abs b + 1 \<le> norm(y) - a; norm(x) \<le> a\<rbrakk> \<Longrightarrow> b \<le> norm(x + y)"
    30.8 +lemma norm_lemma_xy: "\<lbrakk>\<bar>b\<bar> + 1 \<le> norm(y) - a; norm(x) \<le> a\<rbrakk> \<Longrightarrow> b \<le> norm(x + y)"
    30.9    by (metis abs_add_one_not_less_self add.commute diff_le_eq dual_order.trans le_less_linear
   30.10           norm_diff_ineq)
   30.11  
   30.12 @@ -196,7 +196,7 @@
   30.13        by auto
   30.14      show ?thesis
   30.15      unfolding eventually_at_infinity
   30.16 -    proof (rule exI [where x="max M (max 1 ((abs B + 1) / (norm (c (Suc n)) / 2)))"], clarsimp)
   30.17 +    proof (rule exI [where x="max M (max 1 ((\<bar>B\<bar> + 1) / (norm (c (Suc n)) / 2)))"], clarsimp)
   30.18        fix z::'a
   30.19        assume les: "M \<le> norm z"  "1 \<le> norm z"  "(\<bar>B\<bar> * 2 + 2) / norm (c (Suc n)) \<le> norm z"
   30.20        then have "\<bar>B\<bar> * 2 + 2 \<le> norm z * norm (c (Suc n))"
    31.1 --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy	Mon Dec 28 01:26:34 2015 +0100
    31.2 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy	Mon Dec 28 01:28:28 2015 +0100
    31.3 @@ -3201,7 +3201,7 @@
    31.4    by (simp add: bounded_iff bdd_above_def)
    31.5  
    31.6  lemma bounded_realI:
    31.7 -  assumes "\<forall>x\<in>s. abs (x::real) \<le> B"
    31.8 +  assumes "\<forall>x\<in>s. \<bar>x::real\<bar> \<le> B"
    31.9    shows "bounded s"
   31.10    unfolding bounded_def dist_real_def
   31.11    by (metis abs_minus_commute assms diff_0_right)
   31.12 @@ -3275,7 +3275,7 @@
   31.13  
   31.14  lemma bounded_pos: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x \<le> b)"
   31.15    apply (simp add: bounded_iff)
   31.16 -  apply (subgoal_tac "\<And>x (y::real). 0 < 1 + abs y \<and> (x \<le> y \<longrightarrow> x \<le> 1 + abs y)")
   31.17 +  apply (subgoal_tac "\<And>x (y::real). 0 < 1 + \<bar>y\<bar> \<and> (x \<le> y \<longrightarrow> x \<le> 1 + \<bar>y\<bar>)")
   31.18    apply metis
   31.19    apply arith
   31.20    done
   31.21 @@ -5905,7 +5905,7 @@
   31.22      then obtain e where "e>0"
   31.23        and e:"\<forall>x'. dist x' x < e \<longrightarrow> x' \<in> s" using assms(2)[unfolded open_dist, THEN bspec[where x=x]]
   31.24        by auto
   31.25 -    have "e * abs c > 0"
   31.26 +    have "e * \<bar>c\<bar> > 0"
   31.27        using assms(1)[unfolded zero_less_abs_iff[symmetric]] \<open>e>0\<close> by auto
   31.28      moreover
   31.29      {
   31.30 @@ -5923,7 +5923,7 @@
   31.31          by auto
   31.32      }
   31.33      ultimately have "\<exists>e>0. \<forall>x'. dist x' (c *\<^sub>R x) < e \<longrightarrow> x' \<in> op *\<^sub>R c ` s"
   31.34 -      apply (rule_tac x="e * abs c" in exI)
   31.35 +      apply (rule_tac x="e * \<bar>c\<bar>" in exI)
   31.36        apply auto
   31.37        done
   31.38    }
   31.39 @@ -6221,22 +6221,22 @@
   31.40  
   31.41  lemma open_real:
   31.42    fixes s :: "real set"
   31.43 -  shows "open s \<longleftrightarrow> (\<forall>x \<in> s. \<exists>e>0. \<forall>x'. abs(x' - x) < e --> x' \<in> s)"
   31.44 +  shows "open s \<longleftrightarrow> (\<forall>x \<in> s. \<exists>e>0. \<forall>x'. \<bar>x' - x\<bar> < e --> x' \<in> s)"
   31.45    unfolding open_dist dist_norm by simp
   31.46  
   31.47  lemma islimpt_approachable_real:
   31.48    fixes s :: "real set"
   31.49 -  shows "x islimpt s \<longleftrightarrow> (\<forall>e>0.  \<exists>x'\<in> s. x' \<noteq> x \<and> abs(x' - x) < e)"
   31.50 +  shows "x islimpt s \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e)"
   31.51    unfolding islimpt_approachable dist_norm by simp
   31.52  
   31.53  lemma closed_real:
   31.54    fixes s :: "real set"
   31.55 -  shows "closed s \<longleftrightarrow> (\<forall>x. (\<forall>e>0.  \<exists>x' \<in> s. x' \<noteq> x \<and> abs(x' - x) < e) \<longrightarrow> x \<in> s)"
   31.56 +  shows "closed s \<longleftrightarrow> (\<forall>x. (\<forall>e>0.  \<exists>x' \<in> s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e) \<longrightarrow> x \<in> s)"
   31.57    unfolding closed_limpt islimpt_approachable dist_norm by simp
   31.58  
   31.59  lemma continuous_at_real_range:
   31.60    fixes f :: "'a::real_normed_vector \<Rightarrow> real"
   31.61 -  shows "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'. norm(x' - x) < d --> abs(f x' - f x) < e)"
   31.62 +  shows "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'. norm(x' - x) < d --> \<bar>f x' - f x\<bar> < e)"
   31.63    unfolding continuous_at
   31.64    unfolding Lim_at
   31.65    unfolding dist_nz[symmetric]
   31.66 @@ -6255,7 +6255,7 @@
   31.67  lemma continuous_on_real_range:
   31.68    fixes f :: "'a::real_normed_vector \<Rightarrow> real"
   31.69    shows "continuous_on s f \<longleftrightarrow>
   31.70 -    (\<forall>x \<in> s. \<forall>e>0. \<exists>d>0. (\<forall>x' \<in> s. norm(x' - x) < d \<longrightarrow> abs(f x' - f x) < e))"
   31.71 +    (\<forall>x \<in> s. \<forall>e>0. \<exists>d>0. (\<forall>x' \<in> s. norm(x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e))"
   31.72    unfolding continuous_on_iff dist_norm by simp
   31.73  
   31.74  text \<open>Hence some handy theorems on distance, diameter etc. of/from a set.\<close>
    32.1 --- a/src/HOL/Multivariate_Analysis/Weierstrass.thy	Mon Dec 28 01:26:34 2015 +0100
    32.2 +++ b/src/HOL/Multivariate_Analysis/Weierstrass.thy	Mon Dec 28 01:28:28 2015 +0100
    32.3 @@ -65,7 +65,7 @@
    32.4    fixes f :: "real \<Rightarrow> real"
    32.5    assumes contf: "continuous_on {0..1} f" and e: "0 < e"
    32.6      shows "\<exists>N. \<forall>n x. N \<le> n \<and> x \<in> {0..1}
    32.7 -                    \<longrightarrow> abs(f x - (\<Sum>k = 0..n. f(k/n) * Bernstein n k x)) < e"
    32.8 +                    \<longrightarrow> \<bar>f x - (\<Sum>k = 0..n. f(k/n) * Bernstein n k x)\<bar> < e"
    32.9  proof -
   32.10    have "bounded (f ` {0..1})"
   32.11      using compact_continuous_image compact_imp_bounded contf by blast
   32.12 @@ -110,7 +110,7 @@
   32.13        assume k: "k \<le> n"
   32.14        then have kn: "0 \<le> k / n" "k / n \<le> 1"
   32.15          by (auto simp: divide_simps)
   32.16 -      consider (lessd) "abs(x - k / n) < d" | (ged) "d \<le> abs(x - k / n)"
   32.17 +      consider (lessd) "\<bar>x - k / n\<bar> < d" | (ged) "d \<le> \<bar>x - k / n\<bar>"
   32.18          by linarith
   32.19        then have "\<bar>(f x - f (k/n))\<bar> \<le> e/2 + 2 * M / d\<^sup>2 * (x - k/n)\<^sup>2"
   32.20        proof cases
   32.21 @@ -758,7 +758,7 @@
   32.22            "\<And>x y. x \<in> s \<and> y \<in> s \<and> ~(x = y) \<Longrightarrow> \<exists>f. P(f) \<and> ~(f x = f y)"
   32.23            "continuous_on s f"
   32.24         "0 < e"
   32.25 -    shows "\<exists>g. P(g) \<and> (\<forall>x \<in> s. abs(f x - g x) < e)"
   32.26 +    shows "\<exists>g. P(g) \<and> (\<forall>x \<in> s. \<bar>f x - g x\<bar> < e)"
   32.27  proof -
   32.28    interpret PR: function_ring_on "Collect P"
   32.29      apply unfold_locales
   32.30 @@ -1081,7 +1081,7 @@
   32.31  lemma Stone_Weierstrass_real_polynomial_function:
   32.32    fixes f :: "'a::euclidean_space \<Rightarrow> real"
   32.33    assumes "compact s" "continuous_on s f" "0 < e"
   32.34 -    shows "\<exists>g. real_polynomial_function g \<and> (\<forall>x \<in> s. abs(f x - g x) < e)"
   32.35 +    shows "\<exists>g. real_polynomial_function g \<and> (\<forall>x \<in> s. \<bar>f x - g x\<bar> < e)"
   32.36  proof -
   32.37    interpret PR: function_ring_on "Collect real_polynomial_function"
   32.38      apply unfold_locales
   32.39 @@ -1102,14 +1102,14 @@
   32.40  proof -
   32.41    { fix b :: 'b
   32.42      assume "b \<in> Basis"
   32.43 -    have "\<exists>p. real_polynomial_function p \<and> (\<forall>x \<in> s. abs(f x \<bullet> b - p x) < e / DIM('b))"
   32.44 +    have "\<exists>p. real_polynomial_function p \<and> (\<forall>x \<in> s. \<bar>f x \<bullet> b - p x\<bar> < e / DIM('b))"
   32.45        apply (rule exE [OF Stone_Weierstrass_real_polynomial_function [OF s _, of "\<lambda>x. f x \<bullet> b" "e / card Basis"]])
   32.46        using e f
   32.47        apply (auto simp: Euclidean_Space.DIM_positive intro: continuous_intros)
   32.48        done
   32.49    }
   32.50    then obtain pf where pf:
   32.51 -      "\<And>b. b \<in> Basis \<Longrightarrow> real_polynomial_function (pf b) \<and> (\<forall>x \<in> s. abs(f x \<bullet> b - pf b x) < e / DIM('b))"
   32.52 +      "\<And>b. b \<in> Basis \<Longrightarrow> real_polynomial_function (pf b) \<and> (\<forall>x \<in> s. \<bar>f x \<bullet> b - pf b x\<bar> < e / DIM('b))"
   32.53        apply (rule bchoice [rule_format, THEN exE])
   32.54        apply assumption
   32.55        apply (force simp add: intro: that)
    33.1 --- a/src/HOL/Multivariate_Analysis/ex/Approximations.thy	Mon Dec 28 01:26:34 2015 +0100
    33.2 +++ b/src/HOL/Multivariate_Analysis/ex/Approximations.thy	Mon Dec 28 01:28:28 2015 +0100
    33.3 @@ -24,7 +24,7 @@
    33.4  qed
    33.5  
    33.6  (*32-bit approximation. SLOW simplification steps: big calculations with the rewriting engine*)
    33.7 -lemma pi_approx_32: "abs(pi - 13493037705/4294967296) \<le> inverse(2 ^ 32)"
    33.8 +lemma pi_approx_32: "\<bar>pi - 13493037705/4294967296\<bar> \<le> inverse(2 ^ 32)"
    33.9    apply (simp only: abs_diff_le_iff)
   33.10    apply (rule sin_pi6_straddle, simp_all)
   33.11     using Taylor_sin [of "1686629713/3221225472" 11]
    34.1 --- a/src/HOL/NSA/HLog.thy	Mon Dec 28 01:26:34 2015 +0100
    34.2 +++ b/src/HOL/NSA/HLog.thy	Mon Dec 28 01:28:28 2015 +0100
    34.3 @@ -117,7 +117,7 @@
    34.4  
    34.5  lemma hlog_hrabs_HInfinite_Infinitesimal:
    34.6       "[| x : HFinite - Infinitesimal; a : HInfinite; 0 < a |]  
    34.7 -      ==> hlog a (abs x) : Infinitesimal"
    34.8 +      ==> hlog a \<bar>x\<bar> : Infinitesimal"
    34.9  apply (frule HInfinite_gt_zero_gt_one)
   34.10  apply (auto intro!: starfun_ln_HFinite_not_Infinitesimal
   34.11              HInfinite_inverse_Infinitesimal Infinitesimal_HFinite_mult2 
    35.1 --- a/src/HOL/NSA/HSeries.thy	Mon Dec 28 01:26:34 2015 +0100
    35.2 +++ b/src/HOL/NSA/HSeries.thy	Mon Dec 28 01:28:28 2015 +0100
    35.3 @@ -68,7 +68,7 @@
    35.4  lemma sumhr_split_diff: "n<p ==> sumhr(0,p,f) - sumhr(0,n,f) = sumhr(n,p,f)"
    35.5  by (drule_tac f = f in sumhr_split_add [symmetric], simp)
    35.6  
    35.7 -lemma sumhr_hrabs: "!!m n. abs(sumhr(m,n,f)) \<le> sumhr(m,n,%i. abs(f i))"
    35.8 +lemma sumhr_hrabs: "!!m n. \<bar>sumhr(m,n,f)\<bar> \<le> sumhr(m,n,%i. \<bar>f i\<bar>)"
    35.9  unfolding sumhr_app by transfer (rule setsum_abs)
   35.10  
   35.11  text{* other general version also needed *}
   35.12 @@ -130,7 +130,7 @@
   35.13  unfolding sumhr_app by transfer (rule refl)
   35.14  
   35.15  lemma sumhr_hrabs_approx [simp]: "sumhr(0, M, f) @= sumhr(0, N, f)
   35.16 -      ==> abs (sumhr(M, N, f)) @= 0"
   35.17 +      ==> \<bar>sumhr(M, N, f)\<bar> @= 0"
   35.18  apply (cut_tac x = M and y = N in linorder_less_linear)
   35.19  apply (auto simp add: approx_refl)
   35.20  apply (drule approx_sym [THEN approx_minus_iff [THEN iffD1]])
   35.21 @@ -167,7 +167,7 @@
   35.22  
   35.23  lemma NSsummable_NSCauchy:
   35.24       "NSsummable f =
   35.25 -      (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite. abs (sumhr(M,N,f)) @= 0)"
   35.26 +      (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite. \<bar>sumhr(M,N,f)\<bar> @= 0)"
   35.27  apply (auto simp add: summable_NSsummable_iff [symmetric]
   35.28         summable_iff_convergent convergent_NSconvergent_iff atLeast0LessThan[symmetric]
   35.29         NSCauchy_NSconvergent_iff [symmetric] NSCauchy_def starfunNat_sumr)
   35.30 @@ -189,14 +189,14 @@
   35.31  
   35.32  text{*Nonstandard comparison test*}
   35.33  lemma NSsummable_comparison_test:
   35.34 -     "[| \<exists>N. \<forall>n. N \<le> n --> abs(f n) \<le> g n; NSsummable g |] ==> NSsummable f"
   35.35 +     "[| \<exists>N. \<forall>n. N \<le> n --> \<bar>f n\<bar> \<le> g n; NSsummable g |] ==> NSsummable f"
   35.36  apply (fold summable_NSsummable_iff)
   35.37  apply (rule summable_comparison_test, simp, assumption)
   35.38  done
   35.39  
   35.40  lemma NSsummable_rabs_comparison_test:
   35.41 -     "[| \<exists>N. \<forall>n. N \<le> n --> abs(f n) \<le> g n; NSsummable g |]
   35.42 -      ==> NSsummable (%k. abs (f k))"
   35.43 +     "[| \<exists>N. \<forall>n. N \<le> n --> \<bar>f n\<bar> \<le> g n; NSsummable g |]
   35.44 +      ==> NSsummable (%k. \<bar>f k\<bar>)"
   35.45  apply (rule NSsummable_comparison_test)
   35.46  apply (auto)
   35.47  done
    36.1 --- a/src/HOL/NSA/HTranscendental.thy	Mon Dec 28 01:26:34 2015 +0100
    36.2 +++ b/src/HOL/NSA/HTranscendental.thy	Mon Dec 28 01:28:28 2015 +0100
    36.3 @@ -103,14 +103,14 @@
    36.4  lemma hypreal_sqrt_ge_zero: "0 \<le> x ==> 0 \<le> ( *f* sqrt)(x)"
    36.5  by (auto intro: hypreal_sqrt_gt_zero simp add: order_le_less)
    36.6  
    36.7 -lemma hypreal_sqrt_hrabs [simp]: "!!x. ( *f* sqrt)(x\<^sup>2) = abs(x)"
    36.8 +lemma hypreal_sqrt_hrabs [simp]: "!!x. ( *f* sqrt)(x\<^sup>2) = \<bar>x\<bar>"
    36.9  by (transfer, simp)
   36.10  
   36.11 -lemma hypreal_sqrt_hrabs2 [simp]: "!!x. ( *f* sqrt)(x*x) = abs(x)"
   36.12 +lemma hypreal_sqrt_hrabs2 [simp]: "!!x. ( *f* sqrt)(x*x) = \<bar>x\<bar>"
   36.13  by (transfer, simp)
   36.14  
   36.15  lemma hypreal_sqrt_hyperpow_hrabs [simp]:
   36.16 -     "!!x. ( *f* sqrt)(x pow (hypnat_of_nat 2)) = abs(x)"
   36.17 +     "!!x. ( *f* sqrt)(x pow (hypnat_of_nat 2)) = \<bar>x\<bar>"
   36.18  by (transfer, simp)
   36.19  
   36.20  lemma star_sqrt_HFinite: "\<lbrakk>x \<in> HFinite; 0 \<le> x\<rbrakk> \<Longrightarrow> ( *f* sqrt) x \<in> HFinite"
    37.1 --- a/src/HOL/NSA/HyperDef.thy	Mon Dec 28 01:26:34 2015 +0100
    37.2 +++ b/src/HOL/NSA/HyperDef.thy	Mon Dec 28 01:28:28 2015 +0100
    37.3 @@ -216,8 +216,7 @@
    37.4  lemma star_n_one_num: "1 = star_n (%n. 1)"
    37.5  by (simp only: star_one_def star_of_def)
    37.6  
    37.7 -lemma star_n_abs:
    37.8 -     "abs (star_n X) = star_n (%n. abs (X n))"
    37.9 +lemma star_n_abs: "\<bar>star_n X\<bar> = star_n (%n. \<bar>X n\<bar>)"
   37.10  by (simp only: star_abs_def starfun_star_n)
   37.11  
   37.12  lemma hypreal_omega_gt_zero [simp]: "0 < omega"
   37.13 @@ -280,17 +279,16 @@
   37.14  
   37.15  subsection{*Absolute Value Function for the Hyperreals*}
   37.16  
   37.17 -lemma hrabs_add_less:
   37.18 -     "[| abs x < r; abs y < s |] ==> abs(x+y) < r + (s::hypreal)"
   37.19 +lemma hrabs_add_less: "[| \<bar>x\<bar> < r; \<bar>y\<bar> < s |] ==> \<bar>x + y\<bar> < r + (s::hypreal)"
   37.20  by (simp add: abs_if split: split_if_asm)
   37.21  
   37.22 -lemma hrabs_less_gt_zero: "abs x < r ==> (0::hypreal) < r"
   37.23 +lemma hrabs_less_gt_zero: "\<bar>x\<bar> < r ==> (0::hypreal) < r"
   37.24  by (blast intro!: order_le_less_trans abs_ge_zero)
   37.25  
   37.26 -lemma hrabs_disj: "abs x = (x::'a::abs_if) | abs x = -x"
   37.27 +lemma hrabs_disj: "\<bar>x\<bar> = (x::'a::abs_if) \<or> \<bar>x\<bar> = -x"
   37.28  by (simp add: abs_if)
   37.29  
   37.30 -lemma hrabs_add_lemma_disj: "(y::hypreal) + - x + (y + - z) = abs (x + - z) ==> y = z | x = y"
   37.31 +lemma hrabs_add_lemma_disj: "(y::hypreal) + - x + (y + - z) = \<bar>x + - z\<bar> ==> y = z | x = y"
   37.32  by (simp add: abs_if split add: split_if_asm)
   37.33  
   37.34  
   37.35 @@ -364,8 +362,7 @@
   37.36  
   37.37  (*FIXME: This and RealPow.abs_realpow_two should be replaced by an abstract
   37.38    result proved in Rings or Fields*)
   37.39 -lemma hrabs_hrealpow_two [simp]:
   37.40 -     "abs(x ^ Suc (Suc 0)) = (x::hypreal) ^ Suc (Suc 0)"
   37.41 +lemma hrabs_hrealpow_two [simp]: "\<bar>x ^ Suc (Suc 0)\<bar> = (x::hypreal) ^ Suc (Suc 0)"
   37.42  by (simp add: abs_mult)
   37.43  
   37.44  lemma two_hrealpow_ge_one [simp]: "(1::hypreal) \<le> 2 ^ n"
   37.45 @@ -427,7 +424,7 @@
   37.46  by transfer (rule power_inverse [symmetric])
   37.47  
   37.48  lemma hyperpow_hrabs:
   37.49 -  "\<And>r n. abs (r::'a::{linordered_idom} star) pow n = abs (r pow n)"
   37.50 +  "\<And>r n. \<bar>r::'a::{linordered_idom} star\<bar> pow n = \<bar>r pow n\<bar>"
   37.51  by transfer (rule power_abs [symmetric])
   37.52  
   37.53  lemma hyperpow_add:
   37.54 @@ -460,7 +457,7 @@
   37.55  by transfer (rule power_one)
   37.56  
   37.57  lemma hrabs_hyperpow_minus [simp]:
   37.58 -  "\<And>(a::'a::{linordered_idom} star) n. abs((-a) pow n) = abs (a pow n)"
   37.59 +  "\<And>(a::'a::{linordered_idom} star) n. \<bar>(-a) pow n\<bar> = \<bar>a pow n\<bar>"
   37.60  by transfer (rule abs_power_minus)
   37.61  
   37.62  lemma hyperpow_mult:
   37.63 @@ -473,12 +470,12 @@
   37.64  by (auto simp add: hyperpow_two zero_le_mult_iff)
   37.65  
   37.66  lemma hrabs_hyperpow_two [simp]:
   37.67 -  "abs(x pow 2) =
   37.68 +  "\<bar>x pow 2\<bar> =
   37.69     (x::'a::{monoid_mult,linordered_ring_strict} star) pow 2"
   37.70  by (simp only: abs_of_nonneg hyperpow_two_le)
   37.71  
   37.72  lemma hyperpow_two_hrabs [simp]:
   37.73 -  "abs(x::'a::{linordered_idom} star) pow 2 = x pow 2"
   37.74 +  "\<bar>x::'a::{linordered_idom} star\<bar> pow 2 = x pow 2"
   37.75  by (simp add: hyperpow_hrabs)
   37.76  
   37.77  text{*The precondition could be weakened to @{term "0\<le>x"}*}
    38.1 --- a/src/HOL/NSA/NSA.thy	Mon Dec 28 01:26:34 2015 +0100
    38.2 +++ b/src/HOL/NSA/NSA.thy	Mon Dec 28 01:28:28 2015 +0100
    38.3 @@ -181,7 +181,7 @@
    38.4  lemma Reals_add_cancel: "\<lbrakk>x + y \<in> \<real>; y \<in> \<real>\<rbrakk> \<Longrightarrow> x \<in> \<real>"
    38.5  by (drule (1) Reals_diff, simp)
    38.6  
    38.7 -lemma SReal_hrabs: "(x::hypreal) \<in> \<real> ==> abs x \<in> \<real>"
    38.8 +lemma SReal_hrabs: "(x::hypreal) \<in> \<real> ==> \<bar>x\<bar> \<in> \<real>"
    38.9  by (simp add: Reals_eq_Standard)
   38.10  
   38.11  lemma SReal_hypreal_of_real [simp]: "hypreal_of_real x \<in> \<real>"
   38.12 @@ -280,7 +280,7 @@
   38.13  lemma HFiniteD: "x \<in> HFinite ==> \<exists>t \<in> Reals. hnorm x < t"
   38.14  by (simp add: HFinite_def)
   38.15  
   38.16 -lemma HFinite_hrabs_iff [iff]: "(abs (x::hypreal) \<in> HFinite) = (x \<in> HFinite)"
   38.17 +lemma HFinite_hrabs_iff [iff]: "(\<bar>x::hypreal\<bar> \<in> HFinite) = (x \<in> HFinite)"
   38.18  by (simp add: HFinite_def)
   38.19  
   38.20  lemma HFinite_hnorm_iff [iff]:
   38.21 @@ -355,7 +355,7 @@
   38.22  by (simp add: Infinitesimal_def)
   38.23  
   38.24  lemma Infinitesimal_hrabs_iff [iff]:
   38.25 -  "(abs (x::hypreal) \<in> Infinitesimal) = (x \<in> Infinitesimal)"
   38.26 +  "(\<bar>x::hypreal\<bar> \<in> Infinitesimal) = (x \<in> Infinitesimal)"
   38.27  by (simp add: abs_if)
   38.28  
   38.29  lemma Infinitesimal_of_hypreal_iff [simp]:
   38.30 @@ -509,7 +509,7 @@
   38.31  by auto
   38.32  
   38.33  lemma HFinite_diff_Infinitesimal_hrabs:
   38.34 -  "(x::hypreal) \<in> HFinite - Infinitesimal ==> abs x \<in> HFinite - Infinitesimal"
   38.35 +  "(x::hypreal) \<in> HFinite - Infinitesimal ==> \<bar>x\<bar> \<in> HFinite - Infinitesimal"
   38.36  by blast
   38.37  
   38.38  lemma hnorm_le_Infinitesimal:
   38.39 @@ -521,11 +521,11 @@
   38.40  by (erule hnorm_le_Infinitesimal, erule order_less_imp_le)
   38.41  
   38.42  lemma hrabs_le_Infinitesimal:
   38.43 -     "[| e \<in> Infinitesimal; abs (x::hypreal) \<le> e |] ==> x \<in> Infinitesimal"
   38.44 +     "[| e \<in> Infinitesimal; \<bar>x::hypreal\<bar> \<le> e |] ==> x \<in> Infinitesimal"
   38.45  by (erule hnorm_le_Infinitesimal, simp)
   38.46  
   38.47  lemma hrabs_less_Infinitesimal:
   38.48 -      "[| e \<in> Infinitesimal; abs (x::hypreal) < e |] ==> x \<in> Infinitesimal"
   38.49 +      "[| e \<in> Infinitesimal; \<bar>x::hypreal\<bar> < e |] ==> x \<in> Infinitesimal"
   38.50  by (erule hnorm_less_Infinitesimal, simp)
   38.51  
   38.52  lemma Infinitesimal_interval:
   38.53 @@ -540,7 +540,7 @@
   38.54  
   38.55  
   38.56  lemma lemma_Infinitesimal_hyperpow:
   38.57 -     "[| (x::hypreal) \<in> Infinitesimal; 0 < N |] ==> abs (x pow N) \<le> abs x"
   38.58 +     "[| (x::hypreal) \<in> Infinitesimal; 0 < N |] ==> \<bar>x pow N\<bar> \<le> \<bar>x\<bar>"
   38.59  apply (unfold Infinitesimal_def)
   38.60  apply (auto intro!: hyperpow_Suc_le_self2
   38.61            simp add: hyperpow_hrabs [symmetric] hypnat_gt_zero_iff2 abs_ge_zero)
   38.62 @@ -1239,7 +1239,7 @@
   38.63       "[| (x::hypreal) \<in> HFinite;
   38.64           isLub \<real> {s. s \<in> \<real> & s < x} t;
   38.65           r \<in> \<real>; 0 < r |]
   38.66 -      ==> abs (x - t) < r"
   38.67 +      ==> \<bar>x - t\<bar> < r"
   38.68  apply (frule lemma_st_part1a)
   38.69  apply (frule_tac [4] lemma_st_part2a, auto)
   38.70  apply (drule order_le_imp_less_or_eq)+
   38.71 @@ -1250,7 +1250,7 @@
   38.72  
   38.73  lemma lemma_st_part_major2:
   38.74       "[| (x::hypreal) \<in> HFinite; isLub \<real> {s. s \<in> \<real> & s < x} t |]
   38.75 -      ==> \<forall>r \<in> Reals. 0 < r --> abs (x - t) < r"
   38.76 +      ==> \<forall>r \<in> Reals. 0 < r --> \<bar>x - t\<bar> < r"
   38.77  by (blast dest!: lemma_st_part_major)
   38.78  
   38.79  
   38.80 @@ -1258,7 +1258,7 @@
   38.81  text{*Existence of real and Standard Part Theorem*}
   38.82  lemma lemma_st_part_Ex:
   38.83       "(x::hypreal) \<in> HFinite
   38.84 -       ==> \<exists>t \<in> Reals. \<forall>r \<in> Reals. 0 < r --> abs (x - t) < r"
   38.85 +       ==> \<exists>t \<in> Reals. \<forall>r \<in> Reals. 0 < r --> \<bar>x - t\<bar> < r"
   38.86  apply (frule lemma_st_part_lub, safe)
   38.87  apply (frule isLubD1a)
   38.88  apply (blast dest: lemma_st_part_major2)
   38.89 @@ -1483,13 +1483,13 @@
   38.90  apply (simp (no_asm) add: HInfinite_HFinite_iff)
   38.91  done
   38.92  
   38.93 -lemma approx_hrabs_disj: "abs (x::hypreal) @= x | abs x @= -x"
   38.94 +lemma approx_hrabs_disj: "\<bar>x::hypreal\<bar> @= x \<or> \<bar>x\<bar> @= -x"
   38.95  by (cut_tac x = x in hrabs_disj, auto)
   38.96  
   38.97  
   38.98  subsection{*Theorems about Monads*}
   38.99  
  38.100 -lemma monad_hrabs_Un_subset: "monad (abs x) \<le> monad(x::hypreal) Un monad(-x)"
  38.101 +lemma monad_hrabs_Un_subset: "monad \<bar>x\<bar> \<le> monad(x::hypreal) Un monad(-x)"
  38.102  by (rule_tac x1 = x in hrabs_disj [THEN disjE], auto)
  38.103  
  38.104  lemma Infinitesimal_monad_eq: "e \<in> Infinitesimal ==> monad (x+e) = monad x"
  38.105 @@ -1505,7 +1505,7 @@
  38.106  apply (simp (no_asm) add: Infinitesimal_monad_zero_iff [symmetric])
  38.107  done
  38.108  
  38.109 -lemma monad_zero_hrabs_iff: "((x::hypreal) \<in> monad 0) = (abs x \<in> monad 0)"
  38.110 +lemma monad_zero_hrabs_iff: "((x::hypreal) \<in> monad 0) = (\<bar>x\<bar> \<in> monad 0)"
  38.111  apply (rule_tac x1 = x in hrabs_disj [THEN disjE])
  38.112  apply (auto simp add: monad_zero_minus_iff [symmetric])
  38.113  done
  38.114 @@ -1543,7 +1543,7 @@
  38.115  done
  38.116  
  38.117  lemma Infinitesimal_approx_hrabs:
  38.118 -     "[| x @= y; (x::hypreal) \<in> Infinitesimal |] ==> abs x @= abs y"
  38.119 +     "[| x @= y; (x::hypreal) \<in> Infinitesimal |] ==> \<bar>x\<bar> @= \<bar>y\<bar>"
  38.120  apply (drule Infinitesimal_monad_zero_iff [THEN iffD1])
  38.121  apply (blast intro: approx_mem_monad_zero monad_zero_hrabs_iff [THEN iffD1] mem_monad_approx approx_trans3)
  38.122  done
  38.123 @@ -1577,25 +1577,25 @@
  38.124       "[|(x::hypreal) < 0; x \<notin> Infinitesimal; x @= y|] ==> y < 0"
  38.125  by (blast dest: Ball_mem_monad_less_zero approx_subset_monad)
  38.126  
  38.127 -theorem approx_hrabs: "(x::hypreal) @= y ==> abs x @= abs y"
  38.128 +theorem approx_hrabs: "(x::hypreal) @= y ==> \<bar>x\<bar> @= \<bar>y\<bar>"
  38.129  by (drule approx_hnorm, simp)
  38.130  
  38.131 -lemma approx_hrabs_zero_cancel: "abs(x::hypreal) @= 0 ==> x @= 0"
  38.132 +lemma approx_hrabs_zero_cancel: "\<bar>x::hypreal\<bar> @= 0 ==> x @= 0"
  38.133  apply (cut_tac x = x in hrabs_disj)
  38.134  apply (auto dest: approx_minus)
  38.135  done
  38.136  
  38.137  lemma approx_hrabs_add_Infinitesimal:
  38.138 -  "(e::hypreal) \<in> Infinitesimal ==> abs x @= abs(x+e)"
  38.139 +  "(e::hypreal) \<in> Infinitesimal ==> \<bar>x\<bar> @= \<bar>x + e\<bar>"
  38.140  by (fast intro: approx_hrabs Infinitesimal_add_approx_self)
  38.141  
  38.142  lemma approx_hrabs_add_minus_Infinitesimal:
  38.143 -     "(e::hypreal) \<in> Infinitesimal ==> abs x @= abs(x + -e)"
  38.144 +     "(e::hypreal) \<in> Infinitesimal ==> \<bar>x\<bar> @= \<bar>x + -e\<bar>"
  38.145  by (fast intro: approx_hrabs Infinitesimal_add_minus_approx_self)
  38.146  
  38.147  lemma hrabs_add_Infinitesimal_cancel:
  38.148       "[| (e::hypreal) \<in> Infinitesimal; e' \<in> Infinitesimal;
  38.149 -         abs(x+e) = abs(y+e')|] ==> abs x @= abs y"
  38.150 +         \<bar>x + e\<bar> = \<bar>y + e'\<bar>|] ==> \<bar>x\<bar> @= \<bar>y\<bar>"
  38.151  apply (drule_tac x = x in approx_hrabs_add_Infinitesimal)
  38.152  apply (drule_tac x = y in approx_hrabs_add_Infinitesimal)
  38.153  apply (auto intro: approx_trans2)
  38.154 @@ -1603,7 +1603,7 @@
  38.155  
  38.156  lemma hrabs_add_minus_Infinitesimal_cancel:
  38.157       "[| (e::hypreal) \<in> Infinitesimal; e' \<in> Infinitesimal;
  38.158 -         abs(x + -e) = abs(y + -e')|] ==> abs x @= abs y"
  38.159 +         \<bar>x + -e\<bar> = \<bar>y + -e'\<bar>|] ==> \<bar>x\<bar> @= \<bar>y\<bar>"
  38.160  apply (drule_tac x = x in approx_hrabs_add_minus_Infinitesimal)
  38.161  apply (drule_tac x = y in approx_hrabs_add_minus_Infinitesimal)
  38.162  apply (auto intro: approx_trans2)
  38.163 @@ -1623,8 +1623,8 @@
  38.164  done
  38.165  
  38.166  lemma Infinitesimal_add_hrabs_hypreal_of_real_less:
  38.167 -     "[| x \<in> Infinitesimal; abs(hypreal_of_real r) < hypreal_of_real y |]
  38.168 -      ==> abs (hypreal_of_real r + x) < hypreal_of_real y"
  38.169 +     "[| x \<in> Infinitesimal; \<bar>hypreal_of_real r\<bar> < hypreal_of_real y |]
  38.170 +      ==> \<bar>hypreal_of_real r + x\<bar> < hypreal_of_real y"
  38.171  apply (drule_tac x = "hypreal_of_real r" in approx_hrabs_add_Infinitesimal)
  38.172  apply (drule approx_sym [THEN bex_Infinitesimal_iff2 [THEN iffD2]])
  38.173  apply (auto intro!: Infinitesimal_add_hypreal_of_real_less
  38.174 @@ -1633,8 +1633,8 @@
  38.175  done
  38.176  
  38.177  lemma Infinitesimal_add_hrabs_hypreal_of_real_less2:
  38.178 -     "[| x \<in> Infinitesimal;  abs(hypreal_of_real r) < hypreal_of_real y |]
  38.179 -      ==> abs (x + hypreal_of_real r) < hypreal_of_real y"
  38.180 +     "[| x \<in> Infinitesimal;  \<bar>hypreal_of_real r\<bar> < hypreal_of_real y |]
  38.181 +      ==> \<bar>x + hypreal_of_real r\<bar> < hypreal_of_real y"
  38.182  apply (rule add.commute [THEN subst])
  38.183  apply (erule Infinitesimal_add_hrabs_hypreal_of_real_less, assumption)
  38.184  done
  38.185 @@ -1738,7 +1738,7 @@
  38.186  
  38.187  lemma monad_hrabs_less:
  38.188       "[| y \<in> monad x; 0 < hypreal_of_real e |]
  38.189 -      ==> abs (y - x) < hypreal_of_real e"
  38.190 +      ==> \<bar>y - x\<bar> < hypreal_of_real e"
  38.191  apply (drule mem_monad_approx [THEN approx_sym])
  38.192  apply (drule bex_Infinitesimal_iff [THEN iffD2])
  38.193  apply (auto dest!: InfinitesimalD)
  38.194 @@ -1901,7 +1901,7 @@
  38.195  apply (rule st_le, auto)
  38.196  done
  38.197  
  38.198 -lemma st_hrabs: "x \<in> HFinite ==> abs(st x) = st(abs x)"
  38.199 +lemma st_hrabs: "x \<in> HFinite ==> \<bar>st x\<bar> = st \<bar>x\<bar>"
  38.200  apply (simp add: linorder_not_le st_zero_le abs_if st_minus
  38.201     linorder_not_less)
  38.202  apply (auto dest!: st_zero_ge [OF order_less_imp_le])
  38.203 @@ -2077,12 +2077,12 @@
  38.204  lemma finite_real_of_nat_le_real: "finite {n::nat. real n \<le> u}"
  38.205  by (auto simp add: lemma_real_le_Un_eq lemma_finite_omega_set finite_real_of_nat_less_real)
  38.206  
  38.207 -lemma finite_rabs_real_of_nat_le_real: "finite {n::nat. abs(real n) \<le> u}"
  38.208 +lemma finite_rabs_real_of_nat_le_real: "finite {n::nat. \<bar>real n\<bar> \<le> u}"
  38.209  apply (simp (no_asm) add: finite_real_of_nat_le_real)
  38.210  done
  38.211  
  38.212  lemma rabs_real_of_nat_le_real_FreeUltrafilterNat:
  38.213 -     "\<not> eventually (\<lambda>n. abs(real n) \<le> u) FreeUltrafilterNat"
  38.214 +     "\<not> eventually (\<lambda>n. \<bar>real n\<bar> \<le> u) FreeUltrafilterNat"
  38.215  by (blast intro!: FreeUltrafilterNat.finite finite_rabs_real_of_nat_le_real)
  38.216  
  38.217  lemma FreeUltrafilterNat_nat_gt_real: "eventually (\<lambda>n. u < real n) FreeUltrafilterNat"
  38.218 @@ -2092,8 +2092,8 @@
  38.219  done
  38.220  
  38.221  (*--------------------------------------------------------------
  38.222 - The complement of {n. abs(real n) \<le> u} =
  38.223 - {n. u < abs (real n)} is in FreeUltrafilterNat
  38.224 + The complement of {n. \<bar>real n\<bar> \<le> u} =
  38.225 + {n. u < \<bar>real n\<bar>} is in FreeUltrafilterNat
  38.226   by property of (free) ultrafilters
  38.227   --------------------------------------------------------------*)
  38.228  
    39.1 --- a/src/HOL/NSA/NSComplex.thy	Mon Dec 28 01:26:34 2015 +0100
    39.2 +++ b/src/HOL/NSA/NSComplex.thy	Mon Dec 28 01:28:28 2015 +0100
    39.3 @@ -228,8 +228,8 @@
    39.4  subsection{*Modulus (Absolute Value) of Nonstandard Complex Number*}
    39.5  
    39.6  lemma hcomplex_of_hypreal_abs:
    39.7 -     "hcomplex_of_hypreal (abs x) =
    39.8 -      hcomplex_of_hypreal(hcmod(hcomplex_of_hypreal x))"
    39.9 +     "hcomplex_of_hypreal \<bar>x\<bar> =
   39.10 +      hcomplex_of_hypreal (hcmod (hcomplex_of_hypreal x))"
   39.11  by simp
   39.12  
   39.13  lemma HComplex_inject [simp]:
   39.14 @@ -447,10 +447,10 @@
   39.15      "!!y. hIm (iii * hcomplex_of_hypreal y) = y"
   39.16  by transfer simp
   39.17  
   39.18 -lemma hcmod_mult_i [simp]: "!!y. hcmod (iii * hcomplex_of_hypreal y) = abs y"
   39.19 +lemma hcmod_mult_i [simp]: "!!y. hcmod (iii * hcomplex_of_hypreal y) = \<bar>y\<bar>"
   39.20  by transfer (simp add: norm_complex_def)
   39.21  
   39.22 -lemma hcmod_mult_i2 [simp]: "!!y. hcmod (hcomplex_of_hypreal y * iii) = abs y"
   39.23 +lemma hcmod_mult_i2 [simp]: "!!y. hcmod (hcomplex_of_hypreal y * iii) = \<bar>y\<bar>"
   39.24  by transfer (simp add: norm_complex_def)
   39.25  
   39.26  (*---------------------------------------------------------------------------*)
   39.27 @@ -506,11 +506,10 @@
   39.28  by transfer (simp add: cmod_unit_one)
   39.29  
   39.30  lemma hcmod_complex_polar [simp]:
   39.31 -  "!!r a. hcmod (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) =
   39.32 -      abs r"
   39.33 +  "!!r a. hcmod (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = \<bar>r\<bar>"
   39.34  by transfer (simp add: cmod_complex_polar)
   39.35  
   39.36 -lemma hcmod_hrcis [simp]: "!!r a. hcmod(hrcis r a) = abs r"
   39.37 +lemma hcmod_hrcis [simp]: "!!r a. hcmod(hrcis r a) = \<bar>r\<bar>"
   39.38  by transfer (rule complex_mod_rcis)
   39.39  
   39.40  (*---------------------------------------------------------------------------*)
    40.1 --- a/src/HOL/NSA/NatStar.thy	Mon Dec 28 01:26:34 2015 +0100
    40.2 +++ b/src/HOL/NSA/NatStar.thy	Mon Dec 28 01:28:28 2015 +0100
    40.3 @@ -96,7 +96,7 @@
    40.4  
    40.5  text{*Nonstandard extension with absolute value*}
    40.6  
    40.7 -lemma starfun_abs: "!!N. ( *f* (%n. abs (f n))) N = abs(( *f* f) N)"
    40.8 +lemma starfun_abs: "!!N. ( *f* (%n. \<bar>f n\<bar>)) N = \<bar>( *f* f) N\<bar>"
    40.9  by (transfer, rule refl)
   40.10  
   40.11  text{*The hyperpow function as a nonstandard extension of realpow*}
    41.1 --- a/src/HOL/NSA/Star.thy	Mon Dec 28 01:26:34 2015 +0100
    41.2 +++ b/src/HOL/NSA/Star.thy	Mon Dec 28 01:28:28 2015 +0100
    41.3 @@ -282,8 +282,7 @@
    41.4  text{*Alternative definition for hrabs with rabs function
    41.5     applied entrywise to equivalence class representative.
    41.6     This is easily proved using starfun and ns extension thm*}
    41.7 -lemma hypreal_hrabs:
    41.8 -     "abs (star_n X) = star_n (%n. abs (X n))"
    41.9 +lemma hypreal_hrabs: "\<bar>star_n X\<bar> = star_n (%n. \<bar>X n\<bar>)"
   41.10  by (simp only: starfun_rabs_hrabs [symmetric] starfun)
   41.11  
   41.12  text{*nonstandard extension of set through nonstandard extension
   41.13 @@ -291,13 +290,12 @@
   41.14     where we replace rabs by some arbitrary function f and hrabs
   41.15     by its NS extenson. See second NS set extension below.*}
   41.16  lemma STAR_rabs_add_minus:
   41.17 -   "*s* {x. abs (x + - y) < r} =
   41.18 -     {x. abs(x + -star_of y) < star_of r}"
   41.19 +   "*s* {x. \<bar>x + - y\<bar> < r} = {x. \<bar>x + -star_of y\<bar> < star_of r}"
   41.20  by (transfer, rule refl)
   41.21  
   41.22  lemma STAR_starfun_rabs_add_minus:
   41.23 -  "*s* {x. abs (f x + - y) < r} =
   41.24 -       {x. abs(( *f* f) x + -star_of y) < star_of r}"
   41.25 +  "*s* {x. \<bar>f x + - y\<bar> < r} =
   41.26 +       {x. \<bar>( *f* f) x + -star_of y\<bar> < star_of r}"
   41.27  by (transfer, rule refl)
   41.28  
   41.29  text{*Another characterization of Infinitesimal and one of @= relation.
    42.1 --- a/src/HOL/NSA/StarDef.thy	Mon Dec 28 01:26:34 2015 +0100
    42.2 +++ b/src/HOL/NSA/StarDef.thy	Mon Dec 28 01:28:28 2015 +0100
    42.3 @@ -583,7 +583,7 @@
    42.4  lemma Standard_inverse: "x \<in> Standard \<Longrightarrow> inverse x \<in> Standard"
    42.5  by (simp add: star_inverse_def)
    42.6  
    42.7 -lemma Standard_abs: "x \<in> Standard \<Longrightarrow> abs x \<in> Standard"
    42.8 +lemma Standard_abs: "x \<in> Standard \<Longrightarrow> \<bar>x\<bar> \<in> Standard"
    42.9  by (simp add: star_abs_def)
   42.10  
   42.11  lemma Standard_mod: "\<lbrakk>x \<in> Standard; y \<in> Standard\<rbrakk> \<Longrightarrow> x mod y \<in> Standard"
   42.12 @@ -618,7 +618,7 @@
   42.13  lemma star_of_mod: "star_of (x mod y) = star_of x mod star_of y"
   42.14  by transfer (rule refl)
   42.15  
   42.16 -lemma star_of_abs: "star_of (abs x) = abs (star_of x)"
   42.17 +lemma star_of_abs: "star_of \<bar>x\<bar> = \<bar>star_of x\<bar>"
   42.18  by transfer (rule refl)
   42.19  
   42.20  text {* @{term star_of} preserves numerals *}
    43.1 --- a/src/HOL/Old_Number_Theory/EulerFermat.thy	Mon Dec 28 01:26:34 2015 +0100
    43.2 +++ b/src/HOL/Old_Number_Theory/EulerFermat.thy	Mon Dec 28 01:28:28 2015 +0100
    43.3 @@ -53,7 +53,7 @@
    43.4  definition zcongm :: "int => int => int => bool"
    43.5    where "zcongm m = (\<lambda>a b. zcong a b m)"
    43.6  
    43.7 -lemma abs_eq_1_iff [iff]: "(abs z = (1::int)) = (z = 1 \<or> z = -1)"
    43.8 +lemma abs_eq_1_iff [iff]: "(\<bar>z\<bar> = (1::int)) = (z = 1 \<or> z = -1)"
    43.9    -- \<open>LCP: not sure why this lemma is needed now\<close>
   43.10    by (auto simp add: abs_if)
   43.11  
    44.1 --- a/src/HOL/Old_Number_Theory/Legacy_GCD.thy	Mon Dec 28 01:26:34 2015 +0100
    44.2 +++ b/src/HOL/Old_Number_Theory/Legacy_GCD.thy	Mon Dec 28 01:28:28 2015 +0100
    44.3 @@ -566,7 +566,7 @@
    44.4  
    44.5  definition
    44.6    zgcd :: "int \<Rightarrow> int \<Rightarrow> int" where
    44.7 -  "zgcd i j = int (gcd (nat (abs i)) (nat (abs j)))"
    44.8 +  "zgcd i j = int (gcd (nat \<bar>i\<bar>) (nat \<bar>j\<bar>))"
    44.9  
   44.10  lemma zgcd_zdvd1 [iff, algebra]: "zgcd i j dvd i"
   44.11  by (simp add: zgcd_def int_dvd_iff)
   44.12 @@ -611,7 +611,7 @@
   44.13      done
   44.14  qed
   44.15  
   44.16 -lemma int_nat_abs: "int (nat (abs x)) = abs x" by arith
   44.17 +lemma int_nat_abs: "int (nat \<bar>x\<bar>) = \<bar>x\<bar>" by arith
   44.18  
   44.19  lemma zgcd_greatest:
   44.20    assumes "k dvd m" and "k dvd n"
   44.21 @@ -654,10 +654,10 @@
   44.22    with zgcd_pos show "?g' = 1" by simp
   44.23  qed
   44.24  
   44.25 -lemma zgcd_0 [simp, algebra]: "zgcd m 0 = abs m"
   44.26 +lemma zgcd_0 [simp, algebra]: "zgcd m 0 = \<bar>m\<bar>"
   44.27    by (simp add: zgcd_def abs_if)
   44.28  
   44.29 -lemma zgcd_0_left [simp, algebra]: "zgcd 0 m = abs m"
   44.30 +lemma zgcd_0_left [simp, algebra]: "zgcd 0 m = \<bar>m\<bar>"
   44.31    by (simp add: zgcd_def abs_if)
   44.32  
   44.33  lemma zgcd_non_0: "0 < n ==> zgcd m n = zgcd n (m mod n)"
   44.34 @@ -704,7 +704,7 @@
   44.35        add: minus_mult_right nat_mult_distrib zgcd_def abs_if
   44.36            mult_less_0_iff gcd_mult_distrib2 [symmetric] of_nat_mult)
   44.37  
   44.38 -lemma zgcd_zmult_distrib2_abs: "zgcd (k * m) (k * n) = abs k * zgcd m n"
   44.39 +lemma zgcd_zmult_distrib2_abs: "zgcd (k * m) (k * n) = \<bar>k\<bar> * zgcd m n"
   44.40    by (simp add: abs_if zgcd_zmult_distrib2)
   44.41  
   44.42  lemma zgcd_self [simp]: "0 \<le> m ==> zgcd m m = m"
   44.43 @@ -717,7 +717,7 @@
   44.44    by (cut_tac k = k and m = n and n = 1 in zgcd_zmult_distrib2, simp_all)
   44.45  
   44.46  
   44.47 -definition "zlcm i j = int (lcm(nat(abs i)) (nat(abs j)))"
   44.48 +definition "zlcm i j = int (lcm (nat \<bar>i\<bar>) (nat \<bar>j\<bar>))"
   44.49  
   44.50  lemma dvd_zlcm_self1[simp, algebra]: "i dvd zlcm i j"
   44.51  by(simp add:zlcm_def dvd_int_iff)
   44.52 @@ -729,7 +729,7 @@
   44.53  lemma dvd_imp_dvd_zlcm1:
   44.54    assumes "k dvd i" shows "k dvd (zlcm i j)"
   44.55  proof -
   44.56 -  have "nat(abs k) dvd nat(abs i)" using \<open>k dvd i\<close>
   44.57 +  have "nat \<bar>k\<bar> dvd nat \<bar>i\<bar>" using \<open>k dvd i\<close>
   44.58      by(simp add:int_dvd_iff[symmetric] dvd_int_iff[symmetric])
   44.59    thus ?thesis by(simp add:zlcm_def dvd_int_iff)(blast intro: dvd_trans)
   44.60  qed
   44.61 @@ -737,16 +737,16 @@
   44.62  lemma dvd_imp_dvd_zlcm2:
   44.63    assumes "k dvd j" shows "k dvd (zlcm i j)"
   44.64  proof -
   44.65 -  have "nat(abs k) dvd nat(abs j)" using \<open>k dvd j\<close>
   44.66 +  have "nat \<bar>k\<bar> dvd nat \<bar>j\<bar>" using \<open>k dvd j\<close>
   44.67      by(simp add:int_dvd_iff[symmetric] dvd_int_iff[symmetric])
   44.68    thus ?thesis by(simp add:zlcm_def dvd_int_iff)(blast intro: dvd_trans)
   44.69  qed
   44.70  
   44.71  
   44.72 -lemma zdvd_self_abs1: "(d::int) dvd (abs d)"
   44.73 +lemma zdvd_self_abs1: "(d::int) dvd \<bar>d\<bar>"
   44.74  by (case_tac "d <0", simp_all)
   44.75  
   44.76 -lemma zdvd_self_abs2: "(abs (d::int)) dvd d"
   44.77 +lemma zdvd_self_abs2: "\<bar>d::int\<bar> dvd d"
   44.78  by (case_tac "d<0", simp_all)
   44.79  
   44.80  (* lcm a b is positive for positive a and b *)
   44.81 @@ -776,8 +776,8 @@
   44.82    and bnz: "b \<noteq> 0" 
   44.83    shows "0 < zlcm a b"
   44.84  proof-
   44.85 -  let ?na = "nat (abs a)"
   44.86 -  let ?nb = "nat (abs b)"
   44.87 +  let ?na = "nat \<bar>a\<bar>"
   44.88 +  let ?nb = "nat \<bar>b\<bar>"
   44.89    have nap: "?na >0" using anz by simp
   44.90    have nbp: "?nb >0" using bnz by simp
   44.91    have "0 < lcm ?na ?nb" by (rule lcm_pos[OF nap nbp])
    45.1 --- a/src/HOL/Probability/Bochner_Integration.thy	Mon Dec 28 01:26:34 2015 +0100
    45.2 +++ b/src/HOL/Probability/Bochner_Integration.thy	Mon Dec 28 01:28:28 2015 +0100
    45.3 @@ -2352,7 +2352,7 @@
    45.4  
    45.5  lemma integral_0_iff:
    45.6    fixes f :: "'a \<Rightarrow> real"
    45.7 -  shows "integrable M f \<Longrightarrow> (\<integral>x. abs (f x) \<partial>M) = 0 \<longleftrightarrow> emeasure M {x\<in>space M. f x \<noteq> 0} = 0"
    45.8 +  shows "integrable M f \<Longrightarrow> (\<integral>x. \<bar>f x\<bar> \<partial>M) = 0 \<longleftrightarrow> emeasure M {x\<in>space M. f x \<noteq> 0} = 0"
    45.9    using integral_norm_eq_0_iff[of M f] by simp
   45.10  
   45.11  lemma (in finite_measure) integrable_const[intro!, simp]: "integrable M (\<lambda>x. a)"
    46.1 --- a/src/HOL/Probability/Interval_Integral.thy	Mon Dec 28 01:26:34 2015 +0100
    46.2 +++ b/src/HOL/Probability/Interval_Integral.thy	Mon Dec 28 01:28:28 2015 +0100
    46.3 @@ -1087,7 +1087,7 @@
    46.4  
    46.5  lemma interval_integral_norm2:
    46.6    "interval_lebesgue_integrable lborel a b f \<Longrightarrow> 
    46.7 -    norm (LBINT t=a..b. f t) \<le> abs (LBINT t=a..b. norm (f t))"
    46.8 +    norm (LBINT t=a..b. f t) \<le> \<bar>LBINT t=a..b. norm (f t)\<bar>"
    46.9  proof (induct a b rule: linorder_wlog)
   46.10    case (sym a b) then show ?case
   46.11      by (simp add: interval_integral_endpoints_reverse[of a b] interval_integrable_endpoints_reverse[of a b])
    47.1 --- a/src/HOL/Probability/Lebesgue_Measure.thy	Mon Dec 28 01:26:34 2015 +0100
    47.2 +++ b/src/HOL/Probability/Lebesgue_Measure.thy	Mon Dec 28 01:28:28 2015 +0100
    47.3 @@ -695,13 +695,13 @@
    47.4  
    47.5  lemma lborel_distr_mult':
    47.6    assumes "(c::real) \<noteq> 0"
    47.7 -  shows "lborel = density (distr lborel borel (op * c)) (\<lambda>_. abs c)"
    47.8 +  shows "lborel = density (distr lborel borel (op * c)) (\<lambda>_. \<bar>c\<bar>)"
    47.9  proof-
   47.10    have "lborel = density lborel (\<lambda>_. 1)" by (rule density_1[symmetric])
   47.11 -  also from assms have "(\<lambda>_. 1 :: ereal) = (\<lambda>_. inverse (abs c) * abs c)" by (intro ext) simp
   47.12 -  also have "density lborel ... = density (density lborel (\<lambda>_. inverse (abs c))) (\<lambda>_. abs c)"
   47.13 +  also from assms have "(\<lambda>_. 1 :: ereal) = (\<lambda>_. inverse \<bar>c\<bar> * \<bar>c\<bar>)" by (intro ext) simp
   47.14 +  also have "density lborel ... = density (density lborel (\<lambda>_. inverse \<bar>c\<bar>)) (\<lambda>_. \<bar>c\<bar>)"
   47.15      by (subst density_density_eq) auto
   47.16 -  also from assms have "density lborel (\<lambda>_. inverse (abs c)) = distr lborel borel (op * c)"
   47.17 +  also from assms have "density lborel (\<lambda>_. inverse \<bar>c\<bar>) = distr lborel borel (op * c)"
   47.18      by (rule lborel_distr_mult[symmetric])
   47.19    finally show ?thesis .
   47.20  qed
    48.1 --- a/src/HOL/Probability/Set_Integral.thy	Mon Dec 28 01:26:34 2015 +0100
    48.2 +++ b/src/HOL/Probability/Set_Integral.thy	Mon Dec 28 01:28:28 2015 +0100
    48.3 @@ -65,7 +65,7 @@
    48.4  *)
    48.5  
    48.6  (*
    48.7 -lemma indicator_abs_eq: "\<And>A x. abs (indicator A x) = ((indicator A x) :: real)"
    48.8 +lemma indicator_abs_eq: "\<And>A x. \<bar>indicator A x\<bar> = ((indicator A x) :: real)"
    48.9    by (auto simp add: indicator_def)
   48.10  *)
   48.11  
   48.12 @@ -517,7 +517,7 @@
   48.13  "CLINT x:A|M. f" == "CONST complex_set_lebesgue_integral M A (\<lambda>x. f)"
   48.14  
   48.15  (*
   48.16 -lemma cmod_mult: "cmod ((a :: real) * (x :: complex)) = abs a * cmod x"
   48.17 +lemma cmod_mult: "cmod ((a :: real) * (x :: complex)) = \<bar>a\<bar> * cmod x"
   48.18    apply (simp add: norm_mult)
   48.19    by (subst norm_mult, auto)
   48.20  *)
    49.1 --- a/src/HOL/SMT_Examples/SMT_Examples.thy	Mon Dec 28 01:26:34 2015 +0100
    49.2 +++ b/src/HOL/SMT_Examples/SMT_Examples.thy	Mon Dec 28 01:28:28 2015 +0100
    49.3 @@ -258,7 +258,7 @@
    49.4  lemma "(3 :: int) + 1 = 4" by smt
    49.5  lemma "x + (y + z) = y + (z + (x::int))" by smt
    49.6  lemma "max (3::int) 8 > 5" by smt
    49.7 -lemma "abs (x :: real) + abs y \<ge> abs (x + y)" by smt
    49.8 +lemma "\<bar>x :: real\<bar> + \<bar>y\<bar> \<ge> \<bar>x + y\<bar>" by smt
    49.9  lemma "P ((2::int) < 3) = P True" by smt
   49.10  lemma "x + 3 \<ge> 4 \<or> x < (1::int)" by smt
   49.11  
   49.12 @@ -303,9 +303,9 @@
   49.13  processor.
   49.14  *}
   49.15  
   49.16 -lemma "\<lbrakk> x3 = abs x2 - x1; x4 = abs x3 - x2; x5 = abs x4 - x3;
   49.17 -         x6 = abs x5 - x4; x7 = abs x6 - x5; x8 = abs x7 - x6;
   49.18 -         x9 = abs x8 - x7; x10 = abs x9 - x8; x11 = abs x10 - x9 \<rbrakk>
   49.19 +lemma "\<lbrakk> x3 = \<bar>x2\<bar> - x1; x4 = \<bar>x3\<bar> - x2; x5 = \<bar>x4\<bar> - x3;
   49.20 +         x6 = \<bar>x5\<bar> - x4; x7 = \<bar>x6\<bar> - x5; x8 = \<bar>x7\<bar> - x6;
   49.21 +         x9 = \<bar>x8\<bar> - x7; x10 = \<bar>x9\<bar> - x8; x11 = \<bar>x10\<bar> - x9 \<rbrakk>
   49.22   \<Longrightarrow> x1 = x10 \<and> x2 = (x11::int)"
   49.23    by smt
   49.24  
   49.25 @@ -320,7 +320,7 @@
   49.26  
   49.27  lemma
   49.28    assumes "x \<noteq> (0::real)"
   49.29 -  shows "x + x \<noteq> (let P = (abs x > 1) in if P \<or> \<not> P then 4 else 2) * x"
   49.30 +  shows "x + x \<noteq> (let P = (\<bar>x\<bar> > 1) in if P \<or> \<not> P then 4 else 2) * x"
   49.31    using assms [[z3_extensions]] by smt
   49.32  
   49.33  
    50.1 --- a/src/HOL/SMT_Examples/SMT_Tests.thy	Mon Dec 28 01:26:34 2015 +0100
    50.2 +++ b/src/HOL/SMT_Examples/SMT_Tests.thy	Mon Dec 28 01:28:28 2015 +0100
    50.3 @@ -336,11 +336,11 @@
    50.4    by smt+
    50.5  
    50.6  lemma
    50.7 -  "abs (x::int) \<ge> 0"
    50.8 -  "(abs x = 0) = (x = 0)"
    50.9 -  "(x \<ge> 0) = (abs x = x)"
   50.10 -  "(x \<le> 0) = (abs x = -x)"
   50.11 -  "abs (abs x) = abs x"
   50.12 +  "\<bar>x::int\<bar> \<ge> 0"
   50.13 +  "(\<bar>x\<bar> = 0) = (x = 0)"
   50.14 +  "(x \<ge> 0) = (\<bar>x\<bar> = x)"
   50.15 +  "(x \<le> 0) = (\<bar>x\<bar> = -x)"
   50.16 +  "\<bar>\<bar>x\<bar>\<bar> = \<bar>x\<bar>"
   50.17    by smt+
   50.18  
   50.19  lemma
   50.20 @@ -349,7 +349,7 @@
   50.21    "z < x \<and> z < y \<longrightarrow> z < min x y"
   50.22    "min x y = min y x"
   50.23    "x \<ge> 0 \<longrightarrow> min x 0 = 0"
   50.24 -  "min x y \<le> abs (x + y)"
   50.25 +  "min x y \<le> \<bar>x + y\<bar>"
   50.26    by smt+
   50.27  
   50.28  lemma
   50.29 @@ -358,7 +358,7 @@
   50.30    "z > x \<and> z > y \<longrightarrow> z > max x y"
   50.31    "max x y = max y x"
   50.32    "x \<ge> 0 \<longrightarrow> max x 0 = x"
   50.33 -  "max x y \<ge> - abs x - abs y"
   50.34 +  "max x y \<ge> - \<bar>x\<bar> - \<bar>y\<bar>"
   50.35    by smt+
   50.36  
   50.37  lemma
   50.38 @@ -448,11 +448,11 @@
   50.39    by smt+
   50.40  
   50.41  lemma
   50.42 -  "abs (x::real) \<ge> 0"
   50.43 -  "(abs x = 0) = (x = 0)"
   50.44 -  "(x \<ge> 0) = (abs x = x)"
   50.45 -  "(x \<le> 0) = (abs x = -x)"
   50.46 -  "abs (abs x) = abs x"
   50.47 +  "\<bar>x::real\<bar> \<ge> 0"
   50.48 +  "(\<bar>x\<bar> = 0) = (x = 0)"
   50.49 +  "(x \<ge> 0) = (\<bar>x\<bar> = x)"
   50.50 +  "(x \<le> 0) = (\<bar>x\<bar> = -x)"
   50.51 +  "\<bar>\<bar>x\<bar>\<bar> = \<bar>x\<bar>"
   50.52    by smt+
   50.53  
   50.54  lemma
   50.55 @@ -461,7 +461,7 @@
   50.56    "z < x \<and> z < y \<longrightarrow> z < min x y"
   50.57    "min x y = min y x"
   50.58    "x \<ge> 0 \<longrightarrow> min x 0 = 0"
   50.59 -  "min x y \<le> abs (x + y)"
   50.60 +  "min x y \<le> \<bar>x + y\<bar>"
   50.61    by smt+
   50.62  
   50.63  lemma
   50.64 @@ -470,7 +470,7 @@
   50.65    "z > x \<and> z > y \<longrightarrow> z > max x y"
   50.66    "max x y = max y x"
   50.67    "x \<ge> 0 \<longrightarrow> max x 0 = x"
   50.68 -  "max x y \<ge> - abs x - abs y"
   50.69 +  "max x y \<ge> - \<bar>x\<bar> - \<bar>y\<bar>"
   50.70    by smt+
   50.71  
   50.72  lemma
    51.1 --- a/src/HOL/Word/Bit_Representation.thy	Mon Dec 28 01:26:34 2015 +0100
    51.2 +++ b/src/HOL/Word/Bit_Representation.thy	Mon Dec 28 01:28:28 2015 +0100
    51.3 @@ -172,7 +172,7 @@
    51.4  
    51.5  lemma bin_abs_lem:
    51.6    "bin = (w BIT b) ==> bin ~= -1 --> bin ~= 0 -->
    51.7 -    nat (abs w) < nat (abs bin)"
    51.8 +    nat \<bar>w\<bar> < nat \<bar>bin\<bar>"
    51.9    apply clarsimp
   51.10    apply (unfold Bit_def)
   51.11    apply (cases b)
    52.1 --- a/src/HOL/ex/Arith_Examples.thy	Mon Dec 28 01:26:34 2015 +0100
    52.2 +++ b/src/HOL/ex/Arith_Examples.thy	Mon Dec 28 01:28:28 2015 +0100
    52.3 @@ -63,13 +63,13 @@
    52.4  lemma "(i::int) < j ==> min i j < max i j"
    52.5    by linarith
    52.6  
    52.7 -lemma "(0::int) <= abs i"
    52.8 +lemma "(0::int) <= \<bar>i\<bar>"
    52.9    by linarith
   52.10  
   52.11 -lemma "(i::int) <= abs i"
   52.12 +lemma "(i::int) <= \<bar>i\<bar>"
   52.13    by linarith
   52.14  
   52.15 -lemma "abs (abs (i::int)) = abs i"
   52.16 +lemma "\<bar>\<bar>i::int\<bar>\<bar> = \<bar>i\<bar>"
   52.17    by linarith
   52.18  
   52.19  text \<open>Also testing subgoals with bound variables.\<close>
   52.20 @@ -127,7 +127,7 @@
   52.21  lemma "-(i::int) * 1 = 0 ==> i = 0"
   52.22    by linarith
   52.23  
   52.24 -lemma "[| (0::int) < abs i; abs i * 1 < abs i * j |] ==> 1 < abs i * j"
   52.25 +lemma "[| (0::int) < \<bar>i\<bar>; \<bar>i\<bar> * 1 < \<bar>i\<bar> * j |] ==> 1 < \<bar>i\<bar> * j"
   52.26    by linarith
   52.27  
   52.28  
   52.29 @@ -227,13 +227,13 @@
   52.30  text \<open>Splitting of inequalities of different type.\<close>
   52.31  
   52.32  lemma "[| (a::nat) ~= b; (i::int) ~= j; a < 2; b < 2 |] ==>
   52.33 -  a + b <= nat (max (abs i) (abs j))"
   52.34 +  a + b <= nat (max \<bar>i\<bar> \<bar>j\<bar>)"
   52.35    by linarith
   52.36  
   52.37  text \<open>Again, but different order.\<close>
   52.38  
   52.39  lemma "[| (i::int) ~= j; (a::nat) ~= b; a < 2; b < 2 |] ==>
   52.40 -  a + b <= nat (max (abs i) (abs j))"
   52.41 +  a + b <= nat (max \<bar>i\<bar> \<bar>j\<bar>)"
   52.42    by linarith
   52.43  
   52.44  end
    53.1 --- a/src/HOL/ex/Dedekind_Real.thy	Mon Dec 28 01:26:34 2015 +0100
    53.2 +++ b/src/HOL/ex/Dedekind_Real.thy	Mon Dec 28 01:28:28 2015 +0100
    53.3 @@ -1231,7 +1231,7 @@
    53.4    real_less_def: "x < (y::real) \<longleftrightarrow> x \<le> y \<and> x \<noteq> y"
    53.5  
    53.6  definition
    53.7 -  real_abs_def:  "abs (r::real) = (if r < 0 then - r else r)"
    53.8 +  real_abs_def: "\<bar>r::real\<bar> = (if r < 0 then - r else r)"
    53.9  
   53.10  definition
   53.11    real_sgn_def: "sgn (x::real) = (if x=0 then 0 else if 0<x then 1 else - 1)"
    54.1 --- a/src/HOL/ex/Normalization_by_Evaluation.thy	Mon Dec 28 01:26:34 2015 +0100
    54.2 +++ b/src/HOL/ex/Normalization_by_Evaluation.thy	Mon Dec 28 01:28:28 2015 +0100
    54.3 @@ -92,14 +92,14 @@
    54.4  
    54.5  lemma "(2::int) + 3 - 1 + (- k) * 2 = 4 + - k * 2" by normalization
    54.6  lemma "(-4::int) * 2 = -8" by normalization
    54.7 -lemma "abs ((-4::int) + 2 * 1) = 2" by normalization
    54.8 +lemma "\<bar>(-4::int) + 2 * 1\<bar> = 2" by normalization
    54.9  lemma "(2::int) + 3 = 5" by normalization
   54.10  lemma "(2::int) + 3 * (- 4) * (- 1) = 14" by normalization
   54.11  lemma "(2::int) + 3 * (- 4) * 1 + 0 = -10" by normalization
   54.12  lemma "(2::int) < 3" by normalization
   54.13  lemma "(2::int) <= 3" by normalization
   54.14 -lemma "abs ((-4::int) + 2 * 1) = 2" by normalization
   54.15 -lemma "4 - 42 * abs (3 + (-7::int)) = -164" by normalization
   54.16 +lemma "\<bar>(-4::int) + 2 * 1\<bar> = 2" by normalization
   54.17 +lemma "4 - 42 * \<bar>3 + (-7::int)\<bar> = -164" by normalization
   54.18  lemma "(if (0::nat) \<le> (x::nat) then 0::nat else x) = 0" by normalization
   54.19  lemma "4 = Suc (Suc (Suc (Suc 0)))" by normalization
   54.20  lemma "nat 4 = Suc (Suc (Suc (Suc 0)))" by normalization
    55.1 --- a/src/HOL/ex/PresburgerEx.thy	Mon Dec 28 01:26:34 2015 +0100
    55.2 +++ b/src/HOL/ex/PresburgerEx.thy	Mon Dec 28 01:28:28 2015 +0100
    55.3 @@ -100,9 +100,9 @@
    55.4  
    55.5  Warning: it takes (in 2006) over 4.2 minutes!\<close>
    55.6  
    55.7 -lemma "\<lbrakk> x3 = abs x2 - x1; x4 = abs x3 - x2; x5 = abs x4 - x3;
    55.8 -         x6 = abs x5 - x4; x7 = abs x6 - x5; x8 = abs x7 - x6;
    55.9 -         x9 = abs x8 - x7; x10 = abs x9 - x8; x11 = abs x10 - x9 \<rbrakk>
   55.10 +lemma "\<lbrakk> x3 = \<bar>x2\<bar> - x1; x4 = \<bar>x3\<bar> - x2; x5 = \<bar>x4\<bar> - x3;
   55.11 +         x6 = \<bar>x5\<bar> - x4; x7 = \<bar>x6\<bar> - x5; x8 = \<bar>x7\<bar> - x6;
   55.12 +         x9 = \<bar>x8\<bar> - x7; x10 = \<bar>x9\<bar> - x8; x11 = \<bar>x10\<bar> - x9 \<rbrakk>
   55.13   \<Longrightarrow> x1 = x10 & x2 = (x11::int)"
   55.14  by arith
   55.15  
    56.1 --- a/src/HOL/ex/Set_Theory.thy	Mon Dec 28 01:26:34 2015 +0100
    56.2 +++ b/src/HOL/ex/Set_Theory.thy	Mon Dec 28 01:28:28 2015 +0100
    56.3 @@ -193,8 +193,8 @@
    56.4    \<comment> \<open>Example 7.\<close>
    56.5    by force
    56.6  
    56.7 -lemma "(\<forall>u v. u < (0::int) \<longrightarrow> u \<noteq> abs v)
    56.8 -    \<longrightarrow> (\<exists>A::int set. -2 \<in> A & (\<forall>y. abs y \<notin> A))"
    56.9 +lemma "(\<forall>u v. u < (0::int) \<longrightarrow> u \<noteq> \<bar>v\<bar>)
   56.10 +    \<longrightarrow> (\<exists>A::int set. -2 \<in> A & (\<forall>y. \<bar>y\<bar> \<notin> A))"
   56.11    \<comment> \<open>Example 8 needs a small hint.\<close>
   56.12    by force
   56.13      \<comment> \<open>not \<open>blast\<close>, which can't simplify \<open>-2 < 0\<close>\<close>