# HG changeset patch # User wenzelm # Date 1451262508 -3600 # Node ID 1135b8de26c3b3e050428aec1266371a1f27e7f4 # Parent 5d06ecfdb472e6a613cf0d66b4bcabd33c1cdb9e more symbols; diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Algebra/IntRing.thy --- a/src/HOL/Algebra/IntRing.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Algebra/IntRing.thy Mon Dec 28 01:28:28 2015 +0100 @@ -13,7 +13,7 @@ lemma dvds_eq_abseq: fixes k :: int - shows "l dvd k \ k dvd l \ abs l = abs k" + shows "l dvd k \ k dvd l \ \l\ = \k\" apply rule apply (simp add: zdvd_antisym_abs) apply (simp add: dvd_if_abs_eq) @@ -281,7 +281,7 @@ finally show ?thesis . qed -lemma Idl_eq_abs: "Idl\<^bsub>\\<^esub> {k} = Idl\<^bsub>\\<^esub> {l} \ abs l = abs k" +lemma Idl_eq_abs: "Idl\<^bsub>\\<^esub> {k} = Idl\<^bsub>\\<^esub> {l} \ \l\ = \k\" apply (subst dvds_eq_abseq[symmetric]) apply (rule dvds_eq_Idl[symmetric]) done diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Decision_Procs/Approximation.thy --- a/src/HOL/Decision_Procs/Approximation.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Decision_Procs/Approximation.thy Mon Dec 28 01:28:28 2015 +0100 @@ -170,10 +170,10 @@ "float_power_bnds prec n l u = (if 0 < l then (power_down_fl prec l n, power_up_fl prec u n) else if odd n then - (- power_up_fl prec (abs l) n, - if u < 0 then - power_down_fl prec (abs u) n else power_up_fl prec u n) - else if u < 0 then (power_down_fl prec (abs u) n, power_up_fl prec (abs l) n) - else (0, power_up_fl prec (max (abs l) (abs u)) n))" + (- power_up_fl prec \l\ n, + if u < 0 then - power_down_fl prec \u\ n else power_up_fl prec u n) + else if u < 0 then (power_down_fl prec \u\ n, power_up_fl prec \l\ n) + else (0, power_up_fl prec (max \l\ \u\) n))" lemma le_minus_power_downI: "0 \ x \ x ^ n \ - a \ a \ - power_down prec x n" by (subst le_minus_iff) (auto intro: power_down_le power_mono_odd) @@ -2679,7 +2679,7 @@ "interpret_floatarith (Arctan a) vs = arctan (interpret_floatarith a vs)" | "interpret_floatarith (Min a b) vs = min (interpret_floatarith a vs) (interpret_floatarith b vs)" | "interpret_floatarith (Max a b) vs = max (interpret_floatarith a vs) (interpret_floatarith b vs)" | -"interpret_floatarith (Abs a) vs = abs (interpret_floatarith a vs)" | +"interpret_floatarith (Abs a) vs = \interpret_floatarith a vs\" | "interpret_floatarith Pi vs = pi" | "interpret_floatarith (Sqrt a) vs = sqrt (interpret_floatarith a vs)" | "interpret_floatarith (Exp a) vs = exp (interpret_floatarith a vs)" | diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Decision_Procs/Cooper.thy --- a/src/HOL/Decision_Procs/Cooper.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Decision_Procs/Cooper.thy Mon Dec 28 01:28:28 2015 +0100 @@ -618,11 +618,11 @@ | "simpfm (NEq a) = (let a' = simpnum a in case a' of C v \ if v \ 0 then T else F | _ \ NEq a')" | "simpfm (Dvd i a) = (if i = 0 then simpfm (Eq a) - else if abs i = 1 then T + else if \i\ = 1 then T else let a' = simpnum a in case a' of C v \ if i dvd v then T else F | _ \ Dvd i a')" | "simpfm (NDvd i a) = (if i = 0 then simpfm (NEq a) - else if abs i = 1 then F + else if \i\ = 1 then F else let a' = simpnum a in case a' of C v \ if \( i dvd v) then T else F | _ \ NDvd i a')" | "simpfm p = p" by pat_completeness auto @@ -718,7 +718,7 @@ let ?sa = "simpnum a" from simpnum_ci have sa: "Inum bs ?sa = Inum bs a" by simp - consider "i = 0" | "abs i = 1" | "i \ 0" "abs i \ 1" by blast + consider "i = 0" | "\i\ = 1" | "i \ 0" "\i\ \ 1" by blast then show ?case proof cases case 1 @@ -740,7 +740,7 @@ proof cases case 1 with sa[symmetric] i show ?thesis - by (cases "abs i = 1") auto + by (cases "\i\ = 1") auto next case 2 then have "simpfm (Dvd i a) = Dvd i ?sa" @@ -753,7 +753,7 @@ let ?sa = "simpnum a" from simpnum_ci have sa: "Inum bs ?sa = Inum bs a" by simp - consider "i = 0" | "abs i = 1" | "i \ 0" "abs i \ 1" by blast + consider "i = 0" | "\i\ = 1" | "i \ 0" "\i\ \ 1" by blast then show ?case proof cases case 1 @@ -775,7 +775,7 @@ proof cases case 1 with sa[symmetric] i show ?thesis - by (cases "abs i = 1") auto + by (cases "\i\ = 1") auto next case 2 then have "simpfm (NDvd i a) = NDvd i ?sa" @@ -1046,16 +1046,16 @@ (if i = 0 then zlfm (Eq a) else let (c, r) = zsplit0 a in - if c = 0 then Dvd (abs i) r - else if c > 0 then Dvd (abs i) (CN 0 c r) - else Dvd (abs i) (CN 0 (- c) (Neg r)))" + if c = 0 then Dvd \i\ r + else if c > 0 then Dvd \i\ (CN 0 c r) + else Dvd \i\ (CN 0 (- c) (Neg r)))" "zlfm (NDvd i a) = (if i = 0 then zlfm (NEq a) else let (c, r) = zsplit0 a in - if c = 0 then NDvd (abs i) r - else if c > 0 then NDvd (abs i) (CN 0 c r) - else NDvd (abs i) (CN 0 (- c) (Neg r)))" + if c = 0 then NDvd \i\ r + else if c > 0 then NDvd \i\ (CN 0 c r) + else NDvd \i\ (CN 0 (- c) (Neg r)))" "zlfm (NOT (And p q)) = Or (zlfm (NOT p)) (zlfm (NOT q))" "zlfm (NOT (Or p q)) = And (zlfm (NOT p)) (zlfm (NOT q))" "zlfm (NOT (Imp p q)) = And (zlfm p) (zlfm (NOT q))" @@ -1213,7 +1213,7 @@ case 4 then have l: "?L (?l (Dvd j a))" by (simp add: nb Let_def split_def) - with Ia 4 dvd_minus_iff[of "abs j" "?c*i + ?N ?r"] show ?thesis + with Ia 4 dvd_minus_iff[of "\j\" "?c*i + ?N ?r"] show ?thesis by (simp add: Let_def split_def) qed next @@ -1253,7 +1253,7 @@ case 4 then have l: "?L (?l (Dvd j a))" by (simp add: nb Let_def split_def) - with Ia 4 dvd_minus_iff[of "abs j" "?c*i + ?N ?r"] show ?thesis + with Ia 4 dvd_minus_iff[of "\j\" "?c*i + ?N ?r"] show ?thesis by (simp add: Let_def split_def) qed qed auto diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Decision_Procs/Ferrack.thy --- a/src/HOL/Decision_Procs/Ferrack.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Decision_Procs/Ferrack.thy Mon Dec 28 01:28:28 2015 +0100 @@ -455,8 +455,8 @@ fun maxcoeff:: "num \ int" where - "maxcoeff (C i) = abs i" -| "maxcoeff (CN n c t) = max (abs c) (maxcoeff t)" + "maxcoeff (C i) = \i\" +| "maxcoeff (CN n c t) = max \c\ (maxcoeff t)" | "maxcoeff t = 1" lemma maxcoeff_pos: "maxcoeff t \ 0" @@ -498,7 +498,7 @@ declare dvd_trans [trans add] -lemma natabs0: "nat (abs x) = 0 \ x = 0" +lemma natabs0: "nat \x\ = 0 \ x = 0" by arith lemma numgcd0: @@ -536,8 +536,8 @@ fun ismaxcoeff:: "num \ int \ bool" where - "ismaxcoeff (C i) = (\x. abs i \ x)" -| "ismaxcoeff (CN n c t) = (\x. abs c \ x \ ismaxcoeff t x)" + "ismaxcoeff (C i) = (\x. \i\ \ x)" +| "ismaxcoeff (CN n c t) = (\x. \c\ \ x \ ismaxcoeff t x)" | "ismaxcoeff t = (\x. True)" lemma ismaxcoeff_mono: "ismaxcoeff t c \ c \ c' \ ismaxcoeff t c'" @@ -547,18 +547,18 @@ proof (induct t rule: maxcoeff.induct) case (2 n c t) then have H:"ismaxcoeff t (maxcoeff t)" . - have thh: "maxcoeff t \ max (abs c) (maxcoeff t)" + have thh: "maxcoeff t \ max \c\ (maxcoeff t)" by simp from ismaxcoeff_mono[OF H thh] show ?case by simp qed simp_all lemma zgcd_gt1: "gcd i j > (1::int) \ - abs i > 1 \ abs j > 1 \ abs i = 0 \ abs j > 1 \ abs i > 1 \ abs j = 0" - apply (cases "abs i = 0", simp_all add: gcd_int_def) - apply (cases "abs j = 0", simp_all) - apply (cases "abs i = 1", simp_all) - apply (cases "abs j = 1", simp_all) + \i\ > 1 \ \j\ > 1 \ \i\ = 0 \ \j\ > 1 \ \i\ > 1 \ \j\ = 0" + apply (cases "\i\ = 0", simp_all add: gcd_int_def) + apply (cases "\j\ = 0", simp_all) + apply (cases "\i\ = 1", simp_all) + apply (cases "\j\ = 1", simp_all) apply auto done @@ -577,7 +577,7 @@ from 2 have th: "gcd c ?g > 1" by simp from zgcd_gt1[OF th] numgcdh_pos[OF mp, where t="t"] - consider "abs c > 1" "?g > 1" | "abs c = 0" "?g > 1" | "?g = 0" + consider "\c\ > 1" "?g > 1" | "\c\ = 0" "?g > 1" | "?g = 0" by auto then show ?case proof cases @@ -744,11 +744,11 @@ lemma maxcoeff_nz: "nozerocoeff t \ maxcoeff t = 0 \ t = C 0" proof (induct t rule: maxcoeff.induct) case (2 n c t) - then have cnz: "c \ 0" and mx: "max (abs c) (maxcoeff t) = 0" + then have cnz: "c \ 0" and mx: "max \c\ (maxcoeff t) = 0" by simp_all - have "max (abs c) (maxcoeff t) \ abs c" + have "max \c\ (maxcoeff t) \ \c\" by simp - with cnz have "max (abs c) (maxcoeff t) > 0" + with cnz have "max \c\ (maxcoeff t) > 0" by arith with 2 show ?case by simp diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Decision_Procs/MIR.thy --- a/src/HOL/Decision_Procs/MIR.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Decision_Procs/MIR.thy Mon Dec 28 01:28:28 2015 +0100 @@ -48,19 +48,19 @@ by (auto simp add: rdvd_def dvd_def) (rule_tac x="k" in exI, simp only: of_int_mult[symmetric]) -lemma rdvd_abs1: "(abs (real_of_int d) rdvd t) = (real_of_int (d ::int) rdvd t)" +lemma rdvd_abs1: "(\real_of_int d\ rdvd t) = (real_of_int (d ::int) rdvd t)" proof assume d: "real_of_int d rdvd t" from d int_rdvd_real have d2: "d dvd \t\" and ti: "real_of_int \t\ = t" by auto - from iffD2[OF abs_dvd_iff] d2 have "(abs d) dvd \t\" by blast - with ti int_rdvd_real[symmetric] have "real_of_int (abs d) rdvd t" by blast - thus "abs (real_of_int d) rdvd t" by simp + from iffD2[OF abs_dvd_iff] d2 have "\d\ dvd \t\" by blast + with ti int_rdvd_real[symmetric] have "real_of_int \d\ rdvd t" by blast + thus "\real_of_int d\ rdvd t" by simp next - assume "abs (real_of_int d) rdvd t" hence "real_of_int (abs d) rdvd t" by simp - with int_rdvd_real[where i="abs d" and x="t"] - have d2: "abs d dvd \t\" and ti: "real_of_int \t\ = t" + assume "\real_of_int d\ rdvd t" hence "real_of_int \d\ rdvd t" by simp + with int_rdvd_real[where i="\d\" and x="t"] + have d2: "\d\ dvd \t\" and ti: "real_of_int \t\ = t" by auto from iffD1[OF abs_dvd_iff] d2 have "d dvd \t\" by blast with ti int_rdvd_real[symmetric] show "real_of_int d rdvd t" by blast @@ -528,9 +528,9 @@ "lex_bnd t s \ lex_ns (bnds t) (bnds s)" fun maxcoeff:: "num \ int" where - "maxcoeff (C i) = abs i" -| "maxcoeff (CN n c t) = max (abs c) (maxcoeff t)" -| "maxcoeff (CF c t s) = max (abs c) (maxcoeff s)" + "maxcoeff (C i) = \i\" +| "maxcoeff (CN n c t) = max \c\ (maxcoeff t)" +| "maxcoeff (CF c t s) = max \c\ (maxcoeff s)" | "maxcoeff t = 1" lemma maxcoeff_pos: "maxcoeff t \ 0" @@ -602,9 +602,9 @@ qed (auto simp add: numgcd_def gp) fun ismaxcoeff:: "num \ int \ bool" where - "ismaxcoeff (C i) = (\ x. abs i \ x)" -| "ismaxcoeff (CN n c t) = (\x. abs c \ x \ (ismaxcoeff t x))" -| "ismaxcoeff (CF c s t) = (\x. abs c \ x \ (ismaxcoeff t x))" + "ismaxcoeff (C i) = (\ x. \i\ \ x)" +| "ismaxcoeff (CN n c t) = (\x. \c\ \ x \ (ismaxcoeff t x))" +| "ismaxcoeff (CF c s t) = (\x. \c\ \ x \ (ismaxcoeff t x))" | "ismaxcoeff t = (\x. True)" lemma ismaxcoeff_mono: "ismaxcoeff t c \ c \ c' \ ismaxcoeff t c'" @@ -614,7 +614,7 @@ proof (induct t rule: maxcoeff.induct) case (2 n c t) hence H:"ismaxcoeff t (maxcoeff t)" . - have thh: "maxcoeff t \ max (abs c) (maxcoeff t)" by simp + have thh: "maxcoeff t \ max \c\ (maxcoeff t)" by simp from ismaxcoeff_mono[OF H thh] show ?case by simp next case (3 c t s) @@ -623,12 +623,12 @@ from ismaxcoeff_mono[OF H1 thh1] show ?case by simp qed simp_all -lemma zgcd_gt1: "gcd i j > (1::int) \ ((abs i > 1 \ abs j > 1) \ (abs i = 0 \ abs j > 1) \ (abs i > 1 \ abs j = 0))" +lemma zgcd_gt1: "gcd i j > (1::int) \ ((\i\ > 1 \ \j\ > 1) \ (\i\ = 0 \ \j\ > 1) \ (\i\ > 1 \ \j\ = 0))" apply (unfold gcd_int_def) apply (cases "i = 0", simp_all) apply (cases "j = 0", simp_all) - apply (cases "abs i = 1", simp_all) - apply (cases "abs j = 1", simp_all) + apply (cases "\i\ = 1", simp_all) + apply (cases "\j\ = 1", simp_all) apply auto done @@ -644,17 +644,17 @@ let ?g = "numgcdh t m" from 2 have th:"gcd c ?g > 1" by simp from zgcd_gt1[OF th] numgcdh_pos[OF mp, where t="t"] - have "(abs c > 1 \ ?g > 1) \ (abs c = 0 \ ?g > 1) \ (abs c > 1 \ ?g = 0)" by simp - moreover {assume "abs c > 1" and gp: "?g > 1" with 2 + have "(\c\ > 1 \ ?g > 1) \ (\c\ = 0 \ ?g > 1) \ (\c\ > 1 \ ?g = 0)" by simp + moreover {assume "\c\ > 1" and gp: "?g > 1" with 2 have th: "dvdnumcoeff t ?g" by simp have th': "gcd c ?g dvd ?g" by simp from dvdnumcoeff_trans[OF th' th] have ?case by simp } - moreover {assume "abs c = 0 \ ?g > 1" + moreover {assume "\c\ = 0 \ ?g > 1" with 2 have th: "dvdnumcoeff t ?g" by simp have th': "gcd c ?g dvd ?g" by simp from dvdnumcoeff_trans[OF th' th] have ?case by simp hence ?case by simp } - moreover {assume "abs c > 1" and g0:"?g = 0" + moreover {assume "\c\ > 1" and g0:"?g = 0" from numgcdh0[OF g0] have "m=0". with 2 g0 have ?case by simp } ultimately show ?case by blast next @@ -662,17 +662,17 @@ let ?g = "numgcdh t m" from 3 have th:"gcd c ?g > 1" by simp from zgcd_gt1[OF th] numgcdh_pos[OF mp, where t="t"] - have "(abs c > 1 \ ?g > 1) \ (abs c = 0 \ ?g > 1) \ (abs c > 1 \ ?g = 0)" by simp - moreover {assume "abs c > 1" and gp: "?g > 1" with 3 + have "(\c\ > 1 \ ?g > 1) \ (\c\ = 0 \ ?g > 1) \ (\c\ > 1 \ ?g = 0)" by simp + moreover {assume "\c\ > 1" and gp: "?g > 1" with 3 have th: "dvdnumcoeff t ?g" by simp have th': "gcd c ?g dvd ?g" by simp from dvdnumcoeff_trans[OF th' th] have ?case by simp } - moreover {assume "abs c = 0 \ ?g > 1" + moreover {assume "\c\ = 0 \ ?g > 1" with 3 have th: "dvdnumcoeff t ?g" by simp have th': "gcd c ?g dvd ?g" by simp from dvdnumcoeff_trans[OF th' th] have ?case by simp hence ?case by simp } - moreover {assume "abs c > 1" and g0:"?g = 0" + moreover {assume "\c\ > 1" and g0:"?g = 0" from numgcdh0[OF g0] have "m=0". with 3 g0 have ?case by simp } ultimately show ?case by blast qed auto @@ -904,15 +904,15 @@ lemma maxcoeff_nz: "nozerocoeff t \ maxcoeff t = 0 \ t = C 0" proof (induct t rule: maxcoeff.induct) case (2 n c t) - hence cnz: "c \0" and mx: "max (abs c) (maxcoeff t) = 0" by simp+ - have "max (abs c) (maxcoeff t) \ abs c" by simp - with cnz have "max (abs c) (maxcoeff t) > 0" by arith + hence cnz: "c \0" and mx: "max \c\ (maxcoeff t) = 0" by simp+ + have "max \c\ (maxcoeff t) \ \c\" by simp + with cnz have "max \c\ (maxcoeff t) > 0" by arith with 2 show ?case by simp next case (3 c s t) - hence cnz: "c \0" and mx: "max (abs c) (maxcoeff t) = 0" by simp+ - have "max (abs c) (maxcoeff t) \ abs c" by simp - with cnz have "max (abs c) (maxcoeff t) > 0" by arith + hence cnz: "c \0" and mx: "max \c\ (maxcoeff t) = 0" by simp+ + have "max \c\ (maxcoeff t) \ \c\" by simp + with cnz have "max \c\ (maxcoeff t) > 0" by arith with 3 show ?case by simp qed auto @@ -1152,10 +1152,10 @@ | "simpfm (Eq a) = (let a' = simpnum a in case a' of C v \ if (v = 0) then T else F | _ \ Eq (reducecoeff a'))" | "simpfm (NEq a) = (let a' = simpnum a in case a' of C v \ if (v \ 0) then T else F | _ \ NEq (reducecoeff a'))" | "simpfm (Dvd i a) = (if i=0 then simpfm (Eq a) - else if (abs i = 1) \ check_int a then T + else if (\i\ = 1) \ check_int a then T else let a' = simpnum a in case a' of C v \ if (i dvd v) then T else F | _ \ (let (d,t) = simpdvd i a' in Dvd d t))" | "simpfm (NDvd i a) = (if i=0 then simpfm (NEq a) - else if (abs i = 1) \ check_int a then F + else if (\i\ = 1) \ check_int a then F else let a' = simpnum a in case a' of C v \ if (\(i dvd v)) then T else F | _ \ (let (d,t) = simpdvd i a' in NDvd d t))" | "simpfm p = p" by pat_completeness auto @@ -1266,10 +1266,10 @@ ultimately show ?case by blast next case (12 i a) let ?sa = "simpnum a" have sa: "Inum bs ?sa = Inum bs a" by simp - have "i=0 \ (abs i = 1 \ check_int a) \ (i\0 \ ((abs i \ 1) \ (\ check_int a)))" by auto + have "i=0 \ (\i\ = 1 \ check_int a) \ (i\0 \ ((\i\ \ 1) \ (\ check_int a)))" by auto {assume "i=0" hence ?case using "12.hyps" by (simp add: rdvd_left_0_eq Let_def)} moreover - {assume ai1: "abs i = 1" and ai: "check_int a" + {assume ai1: "\i\ = 1" and ai: "check_int a" hence "i=1 \ i= - 1" by arith moreover {assume i1: "i = 1" from rdvd_left1_int[OF check_int[OF ai, simplified isint_iff]] @@ -1280,9 +1280,9 @@ have ?case using i1 ai by simp } ultimately have ?case by blast} moreover - {assume inz: "i\0" and cond: "(abs i \ 1) \ (\ check_int a)" + {assume inz: "i\0" and cond: "(\i\ \ 1) \ (\ check_int a)" {fix v assume "?sa = C v" hence ?case using sa[symmetric] inz cond - by (cases "abs i = 1", auto simp add: int_rdvd_iff) } + by (cases "\i\ = 1", auto simp add: int_rdvd_iff) } moreover {assume H:"\ (\ v. ?sa = C v)" 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) from simpnum_nz have nz:"nozerocoeff ?sa" by simp @@ -1291,10 +1291,10 @@ ultimately show ?case by blast next case (13 i a) let ?sa = "simpnum a" have sa: "Inum bs ?sa = Inum bs a" by simp - have "i=0 \ (abs i = 1 \ check_int a) \ (i\0 \ ((abs i \ 1) \ (\ check_int a)))" by auto + have "i=0 \ (\i\ = 1 \ check_int a) \ (i\0 \ ((\i\ \ 1) \ (\ check_int a)))" by auto {assume "i=0" hence ?case using "13.hyps" by (simp add: rdvd_left_0_eq Let_def)} moreover - {assume ai1: "abs i = 1" and ai: "check_int a" + {assume ai1: "\i\ = 1" and ai: "check_int a" hence "i=1 \ i= - 1" by arith moreover {assume i1: "i = 1" from rdvd_left1_int[OF check_int[OF ai, simplified isint_iff]] @@ -1305,9 +1305,9 @@ have ?case using i1 ai by simp } ultimately have ?case by blast} moreover - {assume inz: "i\0" and cond: "(abs i \ 1) \ (\ check_int a)" + {assume inz: "i\0" and cond: "(\i\ \ 1) \ (\ check_int a)" {fix v assume "?sa = C v" hence ?case using sa[symmetric] inz cond - by (cases "abs i = 1", auto simp add: int_rdvd_iff) } + by (cases "\i\ = 1", auto simp add: int_rdvd_iff) } moreover {assume H:"\ (\ v. ?sa = C v)" hence th: "simpfm (NDvd i a) = NDvd (fst (simpdvd i ?sa)) (snd (simpdvd i ?sa))" using inz cond by (cases ?sa, auto simp add: Let_def split_def) @@ -1599,14 +1599,14 @@ else (Or (NEq (CN 0 (-c) (Floor (Neg r)))) (NEq (Add (Floor (Neg r)) r))))" "zlfm (Dvd i a) = (if i=0 then zlfm (Eq a) else (let (c,r) = zsplit0 a in - if c=0 then Dvd (abs i) r else - if c>0 then And (Eq (Sub (Floor r) r)) (Dvd (abs i) (CN 0 c (Floor r))) - else And (Eq (Sub (Floor r) r)) (Dvd (abs i) (CN 0 (-c) (Neg (Floor r))))))" + if c=0 then Dvd \i\ r else + if c>0 then And (Eq (Sub (Floor r) r)) (Dvd \i\ (CN 0 c (Floor r))) + else And (Eq (Sub (Floor r) r)) (Dvd \i\ (CN 0 (-c) (Neg (Floor r))))))" "zlfm (NDvd i a) = (if i=0 then zlfm (NEq a) else (let (c,r) = zsplit0 a in - if c=0 then NDvd (abs i) r else - if c>0 then Or (NEq (Sub (Floor r) r)) (NDvd (abs i) (CN 0 c (Floor r))) - else Or (NEq (Sub (Floor r) r)) (NDvd (abs i) (CN 0 (-c) (Neg (Floor r))))))" + if c=0 then NDvd \i\ r else + if c>0 then Or (NEq (Sub (Floor r) r)) (NDvd \i\ (CN 0 c (Floor r))) + else Or (NEq (Sub (Floor r) r)) (NDvd \i\ (CN 0 (-c) (Neg (Floor r))))))" "zlfm (NOT (And p q)) = disj (zlfm (NOT p)) (zlfm (NOT q))" "zlfm (NOT (Or p q)) = conj (zlfm (NOT p)) (zlfm (NOT q))" "zlfm (NOT (Imp p q)) = conj (zlfm p) (zlfm (NOT q))" @@ -1865,11 +1865,11 @@ by (simp add: nb Let_def split_def isint_Floor isint_neg) have "?I (Dvd j a) = (real_of_int j rdvd (real_of_int (?c * i) + (?N ?r)))" using Ia by (simp add: Let_def split_def) - also have "\ = (real_of_int (abs j) rdvd real_of_int (?c*i) + (?N ?r))" + also have "\ = (real_of_int \j\ rdvd real_of_int (?c*i) + (?N ?r))" by (simp only: rdvd_abs1[where d="j" and t="real_of_int (?c*i) + ?N ?r", symmetric]) simp - also have "\ = ((abs j) dvd \(?N ?r) + real_of_int (?c*i)\ \ + also have "\ = (\j\ dvd \(?N ?r) + real_of_int (?c*i)\ \ (real_of_int \(?N ?r) + real_of_int (?c*i)\ = (real_of_int (?c*i) + (?N ?r))))" - by(simp only: int_rdvd_real[where i="abs j" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps) + by(simp only: int_rdvd_real[where i="\j\" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps) also have "\ = (?I (?l (Dvd j a)))" using cp cnz jnz by (simp add: Let_def split_def int_rdvd_iff[symmetric] del: of_int_mult) (auto simp add: ac_simps) @@ -1879,13 +1879,13 @@ by (simp add: nb Let_def split_def isint_Floor isint_neg) have "?I (Dvd j a) = (real_of_int j rdvd (real_of_int (?c * i) + (?N ?r)))" using Ia by (simp add: Let_def split_def) - also have "\ = (real_of_int (abs j) rdvd real_of_int (?c*i) + (?N ?r))" + also have "\ = (real_of_int \j\ rdvd real_of_int (?c*i) + (?N ?r))" by (simp only: rdvd_abs1[where d="j" and t="real_of_int (?c*i) + ?N ?r", symmetric]) simp - also have "\ = ((abs j) dvd \(?N ?r) + real_of_int (?c*i)\ \ + also have "\ = (\j\ dvd \(?N ?r) + real_of_int (?c*i)\ \ (real_of_int \(?N ?r) + real_of_int (?c*i)\ = (real_of_int (?c*i) + (?N ?r))))" - by(simp only: int_rdvd_real[where i="abs j" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps) + by(simp only: int_rdvd_real[where i="\j\" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps) also have "\ = (?I (?l (Dvd j a)))" using cn cnz jnz - using rdvd_minus [where d="abs j" and t="real_of_int (?c*i + \?N ?r\)", simplified, symmetric] + using rdvd_minus [where d="\j\" and t="real_of_int (?c*i + \?N ?r\)", simplified, symmetric] by (simp add: Let_def split_def int_rdvd_iff[symmetric] del: of_int_mult) (auto simp add: ac_simps) finally have ?case using l jnz by blast } @@ -1911,11 +1911,11 @@ by (simp add: nb Let_def split_def isint_Floor isint_neg) have "?I (NDvd j a) = (\ (real_of_int j rdvd (real_of_int (?c * i) + (?N ?r))))" using Ia by (simp add: Let_def split_def) - also have "\ = (\ (real_of_int (abs j) rdvd real_of_int (?c*i) + (?N ?r)))" + also have "\ = (\ (real_of_int \j\ rdvd real_of_int (?c*i) + (?N ?r)))" by (simp only: rdvd_abs1[where d="j" and t="real_of_int (?c*i) + ?N ?r", symmetric]) simp - also have "\ = (\ ((abs j) dvd \(?N ?r) + real_of_int (?c*i)\ \ + also have "\ = (\ (\j\ dvd \(?N ?r) + real_of_int (?c*i)\ \ (real_of_int \(?N ?r) + real_of_int (?c*i)\ = (real_of_int (?c*i) + (?N ?r)))))" - by(simp only: int_rdvd_real[where i="abs j" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps) + by(simp only: int_rdvd_real[where i="\j\" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps) also have "\ = (?I (?l (NDvd j a)))" using cp cnz jnz by (simp add: Let_def split_def int_rdvd_iff[symmetric] del: of_int_mult) (auto simp add: ac_simps) @@ -1925,13 +1925,13 @@ by (simp add: nb Let_def split_def isint_Floor isint_neg) have "?I (NDvd j a) = (\ (real_of_int j rdvd (real_of_int (?c * i) + (?N ?r))))" using Ia by (simp add: Let_def split_def) - also have "\ = (\ (real_of_int (abs j) rdvd real_of_int (?c*i) + (?N ?r)))" + also have "\ = (\ (real_of_int \j\ rdvd real_of_int (?c*i) + (?N ?r)))" by (simp only: rdvd_abs1[where d="j" and t="real_of_int (?c*i) + ?N ?r", symmetric]) simp - also have "\ = (\ ((abs j) dvd \(?N ?r) + real_of_int (?c*i)\ \ + also have "\ = (\ (\j\ dvd \(?N ?r) + real_of_int (?c*i)\ \ (real_of_int \(?N ?r) + real_of_int (?c*i)\ = (real_of_int (?c*i) + (?N ?r)))))" - by(simp only: int_rdvd_real[where i="abs j" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps) + by(simp only: int_rdvd_real[where i="\j\" and x="real_of_int (?c*i) + (?N ?r)"]) (simp only: ac_simps) also have "\ = (?I (?l (NDvd j a)))" using cn cnz jnz - using rdvd_minus [where d="abs j" and t="real_of_int (?c*i + \?N ?r\)", simplified, symmetric] + using rdvd_minus [where d="\j\" and t="real_of_int (?c*i + \?N ?r\)", simplified, symmetric] by (simp add: Let_def split_def int_rdvd_iff[symmetric] del: of_int_mult) (auto simp add: ac_simps) finally have ?case using l jnz by blast } @@ -3261,7 +3261,7 @@ from iszlfm_gen [OF lp,rule_format, where y="a"] have lp':"iszlfm p (a#bs)" . from \'[OF lp' d dp, rule_format, OF nob] have th:"\ x. ?P x \ ?P (x - ?d)" by blast from minusinf_inf[OF lp] obtain z where z:"\ x 0" by arith + have zp: "\x - z\ + 1 \ 0" by arith from decr_lemma[OF dp,where x="x" and z="z"] decr_mult_lemma[OF dp th zp, rule_format, OF px] z have th:"\ x. ?MP x" by auto with minusinf_bex[OF lp] px nob have ?thesis by blast} @@ -3860,12 +3860,12 @@ definition DVD :: "int \ int \ num \ fm" where DVD_def: "DVD i c t = (if i=0 then eq c t else - if c = 0 then (Dvd i t) else if c >0 then DVDJ (abs i) c t else DVDJ (abs i) (-c) (Neg t))" + if c = 0 then (Dvd i t) else if c >0 then DVDJ \i\ c t else DVDJ \i\ (-c) (Neg t))" definition NDVD :: "int \ int \ num \ fm" where "NDVD i c t = (if i=0 then neq c t else - if c = 0 then (NDvd i t) else if c >0 then NDVDJ (abs i) c t else NDVDJ (abs i) (-c) (Neg t))" + if c = 0 then (NDvd i t) else if c >0 then NDVDJ \i\ c t else NDVDJ \i\ (-c) (Neg t))" lemma DVD_mono: assumes xp: "0\ x" and x1: "x < 1" @@ -5671,7 +5671,7 @@ lemma "\x::real. \y \ x. (\x\ = \y\)" by mir -lemma "\(x::real) (y::real). \x\ = \y\ \ 0 \ abs (y - x) \ abs (y - x) \ 1" +lemma "\(x::real) (y::real). \x\ = \y\ \ 0 \ \y - x\ \ \y - x\ \ 1" by mir end diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Decision_Procs/Polynomial_List.thy --- a/src/HOL/Decision_Procs/Polynomial_List.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Decision_Procs/Polynomial_List.thy Mon Dec 28 01:28:28 2015 +0100 @@ -1118,7 +1118,7 @@ text \Bound for polynomial.\ lemma poly_mono: fixes x :: "'a::linordered_idom" - shows "abs x \ k \ abs (poly p x) \ poly (map abs p) k" + shows "\x\ \ k \ \poly p x\ \ poly (map abs p) k" proof (induct p) case Nil then show ?case by simp @@ -1126,7 +1126,7 @@ case (Cons a p) then show ?case apply auto - apply (rule_tac y = "abs a + abs (x * poly p x)" in order_trans) + apply (rule_tac y = "\a\ + \x * poly p x\" in order_trans) apply (rule abs_triangle_ineq) apply (auto intro!: mult_mono simp add: abs_mult) done diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Library/BigO.thy --- a/src/HOL/Library/BigO.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Library/BigO.thy Mon Dec 28 01:28:28 2015 +0100 @@ -35,19 +35,19 @@ subsection \Definitions\ definition bigo :: "('a \ 'b::linordered_idom) \ ('a \ 'b) set" ("(1O'(_'))") - where "O(f:: 'a \ 'b) = {h. \c. \x. abs (h x) \ c * abs (f x)}" + where "O(f:: 'a \ 'b) = {h. \c. \x. \h x\ \ c * \f x\}" lemma bigo_pos_const: - "(\c::'a::linordered_idom. \x. abs (h x) \ c * abs (f x)) \ - (\c. 0 < c \ (\x. abs (h x) \ c * abs (f x)))" + "(\c::'a::linordered_idom. \x. \h x\ \ c * \f x\) \ + (\c. 0 < c \ (\x. \h x\ \ c * \f x\))" apply auto apply (case_tac "c = 0") apply simp apply (rule_tac x = "1" in exI) apply simp - apply (rule_tac x = "abs c" in exI) + apply (rule_tac x = "\c\" in exI) apply auto - apply (subgoal_tac "c * abs (f x) \ abs c * abs (f x)") + apply (subgoal_tac "c * \f x\ \ \c\ * \f x\") apply (erule_tac x = x in allE) apply force apply (rule mult_right_mono) @@ -55,7 +55,7 @@ apply (rule abs_ge_zero) done -lemma bigo_alt_def: "O(f) = {h. \c. 0 < c \ (\x. abs (h x) \ c * abs (f x))}" +lemma bigo_alt_def: "O(f) = {h. \c. 0 < c \ (\x. \h x\ \ c * \f x\)}" by (auto simp add: bigo_def bigo_pos_const) lemma bigo_elt_subset [intro]: "f \ O(g) \ O(f) \ O(g)" @@ -65,7 +65,7 @@ apply simp apply (rule allI) apply (drule_tac x = "xa" in spec)+ - apply (subgoal_tac "ca * abs (f xa) \ ca * (c * abs (g xa))") + apply (subgoal_tac "ca * \f xa\ \ ca * (c * \g xa\)") apply (erule order_trans) apply (simp add: ac_simps) apply (rule mult_left_mono, assumption) @@ -110,29 +110,29 @@ apply (rule subsetI) apply (auto simp add: bigo_def bigo_pos_const func_plus set_plus_def) apply (subst bigo_pos_const [symmetric])+ - apply (rule_tac x = "\n. if abs (g n) \ (abs (f n)) then x n else 0" in exI) + apply (rule_tac x = "\n. if \g n\ \ \f n\ then x n else 0" in exI) apply (rule conjI) apply (rule_tac x = "c + c" in exI) apply (clarsimp) - apply (subgoal_tac "c * abs (f xa + g xa) \ (c + c) * abs (f xa)") + apply (subgoal_tac "c * \f xa + g xa\ \ (c + c) * \f xa\") apply (erule_tac x = xa in allE) apply (erule order_trans) apply (simp) - apply (subgoal_tac "c * abs (f xa + g xa) \ c * (abs (f xa) + abs (g xa))") + apply (subgoal_tac "c * \f xa + g xa\ \ c * (\f xa\ + \g xa\)") apply (erule order_trans) apply (simp add: ring_distribs) apply (rule mult_left_mono) apply (simp add: abs_triangle_ineq) apply (simp add: order_less_le) - apply (rule_tac x = "\n. if (abs (f n)) < abs (g n) then x n else 0" in exI) + apply (rule_tac x = "\n. if \f n\ < \g n\ then x n else 0" in exI) apply (rule conjI) apply (rule_tac x = "c + c" in exI) apply auto - apply (subgoal_tac "c * abs (f xa + g xa) \ (c + c) * abs (g xa)") + apply (subgoal_tac "c * \f xa + g xa\ \ (c + c) * \g xa\") apply (erule_tac x = xa in allE) apply (erule order_trans) apply simp - apply (subgoal_tac "c * abs (f xa + g xa) \ c * (abs (f xa) + abs (g xa))") + apply (subgoal_tac "c * \f xa + g xa\ \ c * (\f xa\ + \g xa\)") apply (erule order_trans) apply (simp add: ring_distribs) apply (rule mult_left_mono) @@ -162,8 +162,8 @@ apply (drule_tac x = "xa" in spec)+ apply (subgoal_tac "0 \ f xa + g xa") apply (simp add: ring_distribs) - apply (subgoal_tac "abs (a xa + b xa) \ abs (a xa) + abs (b xa)") - apply (subgoal_tac "abs (a xa) + abs (b xa) \ max c ca * f xa + max c ca * g xa") + apply (subgoal_tac "\a xa + b xa\ \ \a xa\ + \b xa\") + apply (subgoal_tac "\a xa\ + \b xa\ \ max c ca * f xa + max c ca * g xa") apply force apply (rule add_mono) apply (subgoal_tac "c * f xa \ max c ca * f xa") @@ -183,7 +183,7 @@ lemma bigo_bounded_alt: "\x. 0 \ f x \ \x. f x \ c * g x \ f \ O(g)" apply (auto simp add: bigo_def) - apply (rule_tac x = "abs c" in exI) + apply (rule_tac x = "\c\" in exI) apply auto apply (drule_tac x = x in spec)+ apply (simp add: abs_mult [symmetric]) @@ -202,21 +202,21 @@ apply force done -lemma bigo_abs: "(\x. abs (f x)) =o O(f)" +lemma bigo_abs: "(\x. \f x\) =o O(f)" apply (unfold bigo_def) apply auto apply (rule_tac x = 1 in exI) apply auto done -lemma bigo_abs2: "f =o O(\x. abs (f x))" +lemma bigo_abs2: "f =o O(\x. \f x\)" apply (unfold bigo_def) apply auto apply (rule_tac x = 1 in exI) apply auto done -lemma bigo_abs3: "O(f) = O(\x. abs (f x))" +lemma bigo_abs3: "O(f) = O(\x. \f x\)" apply (rule equalityI) apply (rule bigo_elt_subset) apply (rule bigo_abs2) @@ -224,15 +224,15 @@ apply (rule bigo_abs) done -lemma bigo_abs4: "f =o g +o O(h) \ (\x. abs (f x)) =o (\x. abs (g x)) +o O(h)" +lemma bigo_abs4: "f =o g +o O(h) \ (\x. \f x\) =o (\x. \g x\) +o O(h)" apply (drule set_plus_imp_minus) apply (rule set_minus_imp_plus) apply (subst fun_diff_def) proof - assume a: "f - g \ O(h)" - have "(\x. abs (f x) - abs (g x)) =o O(\x. abs (abs (f x) - abs (g x)))" + have "(\x. \f x\ - \g x\) =o O(\x. \\f x\ - \g x\\)" by (rule bigo_abs2) - also have "\ \ O(\x. abs (f x - g x))" + also have "\ \ O(\x. \f x - g x\)" apply (rule bigo_elt_subset) apply (rule bigo_bounded) apply force @@ -246,10 +246,10 @@ done also from a have "\ \ O(h)" by (rule bigo_elt_subset) - finally show "(\x. abs (f x) - abs (g x)) \ O(h)". + finally show "(\x. \f x\ - \g x\) \ O(h)". qed -lemma bigo_abs5: "f =o O(g) \ (\x. abs (f x)) =o O(g)" +lemma bigo_abs5: "f =o O(g) \ (\x. \f x\) =o O(g)" by (unfold bigo_def, auto) lemma bigo_elt_subset2 [intro]: "f \ g +o O(h) \ O(f) \ O(g) + O(h)" @@ -257,16 +257,16 @@ assume "f \ g +o O(h)" also have "\ \ O(g) + O(h)" by (auto del: subsetI) - also have "\ = O(\x. abs (g x)) + O(\x. abs (h x))" + also have "\ = O(\x. \g x\) + O(\x. \h x\)" apply (subst bigo_abs3 [symmetric])+ apply (rule refl) done - also have "\ = O((\x. abs (g x)) + (\x. abs (h x)))" + also have "\ = O((\x. \g x\) + (\x. \h x\))" by (rule bigo_plus_eq [symmetric]) auto finally have "f \ \" . then have "O(f) \ \" by (elim bigo_elt_subset) - also have "\ = O(\x. abs (g x)) + O(\x. abs (h x))" + also have "\ = O(\x. \g x\) + O(\x. \h x\)" by (rule bigo_plus_eq, auto) finally show ?thesis by (simp add: bigo_abs3 [symmetric]) @@ -279,7 +279,7 @@ apply (rule_tac x = "c * ca" in exI) apply (rule allI) apply (erule_tac x = x in allE)+ - apply (subgoal_tac "c * ca * abs (f x * g x) = (c * abs (f x)) * (ca * abs (g x))") + apply (subgoal_tac "c * ca * \f x * g x\ = (c * \f x\) * (ca * \g x\)") apply (erule ssubst) apply (subst abs_mult) apply (rule mult_mono) @@ -293,7 +293,7 @@ apply (rule_tac x = c in exI) apply auto apply (drule_tac x = x in spec) - apply (subgoal_tac "abs (f x) * abs (b x) \ abs (f x) * (c * abs (g x))") + apply (subgoal_tac "\f x\ * \b x\ \ \f x\ * (c * \g x\)") apply (force simp add: ac_simps) apply (rule mult_left_mono, assumption) apply (rule abs_ge_zero) @@ -450,7 +450,7 @@ fixes c :: "'a::linordered_field" shows "c \ 0 \ (\x. 1) \ O(\x. c)" apply (simp add: bigo_def) - apply (rule_tac x = "abs (inverse c)" in exI) + apply (rule_tac x = "\inverse c\" in exI) apply (simp add: abs_mult [symmetric]) done @@ -473,7 +473,7 @@ lemma bigo_const_mult1: "(\x. c * f x) \ O(f)" apply (simp add: bigo_def) - apply (rule_tac x = "abs c" in exI) + apply (rule_tac x = "\c\" in exI) apply (auto simp add: abs_mult [symmetric]) done @@ -486,7 +486,7 @@ fixes c :: "'a::linordered_field" shows "c \ 0 \ f \ O(\x. c * f x)" apply (simp add: bigo_def) - apply (rule_tac x = "abs (inverse c)" in exI) + apply (rule_tac x = "\inverse c\" in exI) apply (simp add: abs_mult mult.assoc [symmetric]) done @@ -516,15 +516,15 @@ apply (auto intro!: simp add: bigo_def elt_set_times_def func_times) apply (rule_tac x = "\y. inverse c * x y" in exI) apply (simp add: mult.assoc [symmetric] abs_mult) - apply (rule_tac x = "abs (inverse c) * ca" in exI) + apply (rule_tac x = "\inverse c\ * ca" in exI) apply auto done lemma bigo_const_mult6 [intro]: "(\x. c) *o O(f) \ O(f)" apply (auto intro!: simp add: bigo_def elt_set_times_def func_times) - apply (rule_tac x = "ca * abs c" in exI) + apply (rule_tac x = "ca * \c\" in exI) apply (rule allI) - apply (subgoal_tac "ca * abs c * abs (f x) = abs c * (ca * abs (f x))") + apply (subgoal_tac "ca * \c\ * \f x\ = \c\ * (ca * \f x\)") apply (erule ssubst) apply (subst abs_mult) apply (rule mult_left_mono) @@ -559,10 +559,10 @@ subsection \Setsum\ lemma bigo_setsum_main: "\x. \y \ A x. 0 \ h x y \ - \c. \x. \y \ A x. abs (f x y) \ c * (h x y) \ + \c. \x. \y \ A x. \f x y\ \ c * h x y \ (\x. \y \ A x. f x y) =o O(\x. \y \ A x. h x y)" apply (auto simp add: bigo_def) - apply (rule_tac x = "abs c" in exI) + apply (rule_tac x = "\c\" in exI) apply (subst abs_of_nonneg) back back apply (rule setsum_nonneg) apply force @@ -583,7 +583,7 @@ done lemma bigo_setsum1: "\x y. 0 \ h x y \ - \c. \x y. abs (f x y) \ c * h x y \ + \c. \x y. \f x y\ \ c * h x y \ (\x. \y \ A x. f x y) =o O(\x. \y \ A x. h x y)" apply (rule bigo_setsum_main) apply force @@ -593,12 +593,12 @@ done lemma bigo_setsum2: "\y. 0 \ h y \ - \c. \y. abs (f y) \ c * (h y) \ + \c. \y. \f y\ \ c * (h y) \ (\x. \y \ A x. f y) =o O(\x. \y \ A x. h y)" by (rule bigo_setsum1) auto lemma bigo_setsum3: "f =o O(h) \ - (\x. \y \ A x. l x y * f (k x y)) =o O(\x. \y \ A x. abs (l x y * h (k x y)))" + (\x. \y \ A x. l x y * f (k x y)) =o O(\x. \y \ A x. \l x y * h (k x y)\)" apply (rule bigo_setsum1) apply (rule allI)+ apply (rule abs_ge_zero) @@ -616,7 +616,7 @@ lemma bigo_setsum4: "f =o g +o O(h) \ (\x. \y \ A x. l x y * f (k x y)) =o (\x. \y \ A x. l x y * g (k x y)) +o - O(\x. \y \ A x. abs (l x y * h (k x y)))" + O(\x. \y \ A x. \l x y * h (k x y)\)" apply (rule set_minus_imp_plus) apply (subst fun_diff_def) apply (subst setsum_subtractf [symmetric]) @@ -631,7 +631,7 @@ (\x. \y \ A x. l x y * f (k x y)) =o O(\x. \y \ A x. l x y * h (k x y))" apply (subgoal_tac "(\x. \y \ A x. l x y * h (k x y)) = - (\x. \y \ A x. abs (l x y * h (k x y)))") + (\x. \y \ A x. \l x y * h (k x y)\)") apply (erule ssubst) apply (erule bigo_setsum3) apply (rule ext) @@ -715,7 +715,7 @@ definition lesso :: "('a \ 'b::linordered_idom) \ ('a \ 'b) \ 'a \ 'b" (infixl "x. max (f x - g x) 0)" -lemma bigo_lesseq1: "f =o O(h) \ \x. abs (g x) \ abs (f x) \ g =o O(h)" +lemma bigo_lesseq1: "f =o O(h) \ \x. \g x\ \ \f x\ \ g =o O(h)" apply (unfold bigo_def) apply clarsimp apply (rule_tac x = c in exI) @@ -724,7 +724,7 @@ apply (erule spec)+ done -lemma bigo_lesseq2: "f =o O(h) \ \x. abs (g x) \ f x \ g =o O(h)" +lemma bigo_lesseq2: "f =o O(h) \ \x. \g x\ \ f x \ g =o O(h)" apply (erule bigo_lesseq1) apply (rule allI) apply (drule_tac x = x in spec) @@ -741,7 +741,7 @@ done lemma bigo_lesseq4: "f =o O(h) \ - \x. 0 \ g x \ \x. g x \ abs (f x) \ g =o O(h)" + \x. 0 \ g x \ \x. g x \ \f x\ \ g =o O(h)" apply (erule bigo_lesseq1) apply (rule allI) apply (subst abs_of_nonneg) @@ -819,13 +819,13 @@ apply (auto simp add: func_plus fun_diff_def algebra_simps split: split_max abs_split) done -lemma bigo_lesso5: "f \C. \x. f x \ g x + C * abs (h x)" +lemma bigo_lesso5: "f \C. \x. f x \ g x + C * \h x\" apply (simp only: lesso_def bigo_alt_def) apply clarsimp apply (rule_tac x = c in exI) apply (rule allI) apply (drule_tac x = x in spec) - apply (subgoal_tac "abs (max (f x - g x) 0) = max (f x - g x) 0") + apply (subgoal_tac "\max (f x - g x) 0\ = max (f x - g x) 0") apply (clarsimp simp add: algebra_simps) apply (rule abs_of_nonneg) apply (rule max.cobounded2) @@ -856,7 +856,7 @@ apply (rule order_le_less_trans) apply assumption apply (rule order_less_le_trans) - apply (subgoal_tac "c * abs (g n) < c * (r / c)") + apply (subgoal_tac "c * \g n\ < c * (r / c)") apply assumption apply (erule mult_strict_left_mono) apply assumption diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Library/Extended_Real.thy --- a/src/HOL/Library/Extended_Real.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Library/Extended_Real.thy Mon Dec 28 01:28:28 2015 +0100 @@ -3484,7 +3484,7 @@ fixes a :: real assumes "a \ x" and "x \ b" - shows "abs x \ max (abs a) (abs b)" + shows "\x\ \ max \a\ \b\" by (metis abs_less_iff assms leI le_max_iff_disj less_eq_real_def less_le_not_le less_minus_iff minus_minus) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Library/Float.thy --- a/src/HOL/Library/Float.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Library/Float.thy Mon Dec 28 01:28:28 2015 +0100 @@ -110,7 +110,7 @@ lemma minus_float[simp]: "x \ float \ y \ float \ x - y \ float" using plus_float [of x "- y"] by simp -lemma abs_float[simp]: "x \ float \ abs x \ float" +lemma abs_float[simp]: "x \ float \ \x\ \ float" by (cases x rule: linorder_cases[of 0]) auto lemma sgn_of_float[simp]: "x \ float \ sgn x \ float" @@ -594,7 +594,7 @@ qualified lemma compute_is_float_zero[code]: "is_float_zero (Float m e) \ 0 = m" by transfer (auto simp add: is_float_zero_def) -qualified lemma compute_float_abs[code]: "abs (Float m e) = Float (abs m) e" +qualified lemma compute_float_abs[code]: "\Float m e\ = Float \m\ e" by transfer (simp add: abs_mult) qualified lemma compute_float_eq[code]: "equal_class.equal f g = is_float_zero (f - g)" @@ -1186,7 +1186,7 @@ begin qualified lemma compute_float_round_down[code]: - "float_round_down prec (Float m e) = (let d = bitlen (abs m) - int prec in + "float_round_down prec (Float m e) = (let d = bitlen \m\ - int prec in if 0 < d then Float (div_twopow m (nat d)) (e + d) else Float m e)" using Float.compute_float_down[of "prec - bitlen \m\ - e" m e, symmetric] @@ -1543,8 +1543,8 @@ lemma sum_neq_zeroI: fixes a k :: real - shows "abs a \ k \ abs b < k \ a + b \ 0" - and "abs a > k \ abs b \ k \ a + b \ 0" + shows "\a\ \ k \ \b\ < k \ a + b \ 0" + and "\a\ > k \ \b\ \ k \ a + b \ 0" by auto lemma abs_real_le_2_powr_bitlen[simp]: "\real_of_int m2\ < 2 powr real_of_int (bitlen \m2\)" @@ -1564,7 +1564,7 @@ fixes ai p q :: int and a b :: real assumes "a * 2 powr p = ai" - and b_le_1: "abs (b * 2 powr (p + 1)) \ 1" + and b_le_1: "\b * 2 powr (p + 1)\ \ 1" and leqp: "q \ p" shows "\(a + b) * 2 powr q\ = \(2 * ai + sgn b) * 2 powr (q - p - 1)\" proof - @@ -1576,7 +1576,7 @@ by (simp add: assms(1)[symmetric] powr_add[symmetric] algebra_simps powr_mult_base) next case 2 - then have "b * 2 powr p < abs (b * 2 powr (p + 1))" + then have "b * 2 powr p < \b * 2 powr (p + 1)\" by simp also note b_le_1 finally have b_less_1: "b * 2 powr real_of_int p < 1" . @@ -1635,7 +1635,7 @@ lemma log2_abs_int_add_less_half_sgn_eq: fixes ai :: int and b :: real - assumes "abs b \ 1/2" + assumes "\b\ \ 1/2" and "ai \ 0" shows "\log 2 \real_of_int ai + b\\ = \log 2 \ai + sgn b / 2\\" proof (cases "b = 0") @@ -1664,21 +1664,21 @@ have "\ai\ = 2 powr k + r" using \k \ 0\ by (auto simp: k_def r_def powr_realpow[symmetric]) - have pos: "abs b < 1 \ 0 < 2 powr k + (r + b)" for b :: real + have pos: "\b\ < 1 \ 0 < 2 powr k + (r + b)" for b :: real using \0 \ k\ \ai \ 0\ by (auto simp add: r_def powr_realpow[symmetric] abs_if sgn_if algebra_simps split: split_if_asm) have less: "\sgn ai * b\ < 1" and less': "\sgn (sgn ai * b) / 2\ < 1" - using \abs b \ _\ by (auto simp: abs_if sgn_if split: split_if_asm) + using \\b\ \ _\ by (auto simp: abs_if sgn_if split: split_if_asm) - have floor_eq: "\b::real. abs b \ 1 / 2 \ + have floor_eq: "\b::real. \b\ \ 1 / 2 \ \log 2 (1 + (r + b) / 2 powr k)\ = (if r = 0 \ b < 0 then -1 else 0)" using \k \ 0\ r r_le by (auto simp: floor_log_eq_powr_iff powr_minus_divide field_simps sgn_if) from \real_of_int \ai\ = _\ have "\ai + b\ = 2 powr k + (r + sgn ai * b)" - using \abs b <= _\ \0 \ k\ r + using \\b\ <= _\ \0 \ k\ r by (auto simp add: sgn_if abs_if) also have "\log 2 \\ = \log 2 (2 powr k + r + sgn (sgn ai * b) / 2)\" proof - @@ -1690,14 +1690,14 @@ also let ?if = "if r = 0 \ sgn ai * b < 0 then -1 else 0" have "\log 2 (1 + (r + sgn ai * b) / 2 powr k)\ = ?if" - using \abs b <= _\ + using \\b\ <= _\ by (intro floor_eq) (auto simp: abs_mult sgn_if) also have "\ = \log 2 (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k)\" by (subst floor_eq) (auto simp: sgn_if) also have "k + \ = \log 2 (2 powr k * (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k))\" unfolding floor_add2[symmetric] - using pos[OF less'] \abs b \ _\ + using pos[OF less'] \\b\ \ _\ by (simp add: field_simps add_log_eq_powr) also have "2 powr k * (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k) = 2 powr k + r + sgn (sgn ai * b) / 2" @@ -1885,7 +1885,7 @@ lemma float_zero[simp]: "real_of_float (Float 0 e) = 0" by simp -lemma abs_div_2_less: "a \ 0 \ a \ -1 \ abs((a::int) div 2) < abs a" +lemma abs_div_2_less: "a \ 0 \ a \ -1 \ \(a::int) div 2\ < \a\" by arith lemma lapprox_rat: "real_of_float (lapprox_rat prec x y) \ real_of_int x / real_of_int y" diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Library/Fundamental_Theorem_Algebra.thy --- a/src/HOL/Library/Fundamental_Theorem_Algebra.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Library/Fundamental_Theorem_Algebra.thy Mon Dec 28 01:28:28 2015 +0100 @@ -136,9 +136,9 @@ proof - from that z xy have "2 * x \ 1" "2 * x \ -1" "2 * y \ 1" "2 * y \ -1" by (simp_all add: cmod_def power2_eq_square algebra_simps) - then have "abs (2 * x) \ 1" "abs (2 * y) \ 1" + then have "\2 * x\ \ 1" "\2 * y\ \ 1" by simp_all - then have "(abs (2 * x))\<^sup>2 \ 1\<^sup>2" "(abs (2 * y))\<^sup>2 \ 1\<^sup>2" + then have "\2 * x\\<^sup>2 \ 1\<^sup>2" "\2 * y\\<^sup>2 \ 1\<^sup>2" by - (rule power_mono, simp, simp)+ then have th0: "4 * x\<^sup>2 \ 1" "4 * y\<^sup>2 \ 1" by (simp_all add: power_mult_distrib) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Library/Infinite_Set.thy --- a/src/HOL/Library/Infinite_Set.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Library/Infinite_Set.thy Mon Dec 28 01:28:28 2015 +0100 @@ -56,12 +56,12 @@ lemma infinite_int_iff_infinite_nat_abs: "infinite (S::int set) \ infinite ((nat o abs) ` S)" by (auto simp: transfer_nat_int_set_relations o_def image_comp dest: finite_image_absD) -proposition infinite_int_iff_unbounded_le: "infinite (S::int set) \ (\m. \n. abs n \ m \ n \ S)" +proposition infinite_int_iff_unbounded_le: "infinite (S::int set) \ (\m. \n. \n\ \ m \ n \ S)" apply (simp add: infinite_int_iff_infinite_nat_abs infinite_nat_iff_unbounded_le o_def image_def) apply (metis abs_ge_zero nat_le_eq_zle le_nat_iff) done -proposition infinite_int_iff_unbounded: "infinite (S::int set) \ (\m. \n. abs n > m \ n \ S)" +proposition infinite_int_iff_unbounded: "infinite (S::int set) \ (\m. \n. \n\ > m \ n \ S)" apply (simp add: infinite_int_iff_infinite_nat_abs infinite_nat_iff_unbounded o_def image_def) apply (metis (full_types) nat_le_iff nat_mono not_le) done diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Library/Polynomial.thy --- a/src/HOL/Library/Polynomial.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Library/Polynomial.thy Mon Dec 28 01:28:28 2015 +0100 @@ -1062,7 +1062,7 @@ "x \ y \ x = y \ pos_poly (y - x)" definition - "abs (x::'a poly) = (if x < 0 then - x else x)" + "\x::'a poly\ = (if x < 0 then - x else x)" definition "sgn (x::'a poly) = (if x = 0 then 0 else if 0 < x then 1 else - 1)" diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Library/positivstellensatz.ML --- a/src/HOL/Library/positivstellensatz.ML Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Library/positivstellensatz.ML Mon Dec 28 01:28:28 2015 +0100 @@ -221,12 +221,12 @@ @{thms "HOL.all_simps"(1-4)} @ @{thms "ex_simps"(1-4)}); val real_abs_thms1 = @{lemma - "((-1 * abs(x::real) >= r) = (-1 * x >= r & 1 * x >= r))" and - "((-1 * abs(x) + a >= r) = (a + -1 * x >= r & a + 1 * x >= r))" and - "((a + -1 * abs(x) >= r) = (a + -1 * x >= r & a + 1 * x >= r))" and - "((a + -1 * abs(x) + b >= r) = (a + -1 * x + b >= r & a + 1 * x + b >= r))" and - "((a + b + -1 * abs(x) >= r) = (a + b + -1 * x >= r & a + b + 1 * x >= r))" and - "((a + b + -1 * abs(x) + c >= r) = (a + b + -1 * x + c >= r & a + b + 1 * x + c >= r))" and + "((-1 * \x::real\ >= r) = (-1 * x >= r & 1 * x >= r))" and + "((-1 * \x\ + a >= r) = (a + -1 * x >= r & a + 1 * x >= r))" and + "((a + -1 * \x\ >= r) = (a + -1 * x >= r & a + 1 * x >= r))" and + "((a + -1 * \x\ + b >= r) = (a + -1 * x + b >= r & a + 1 * x + b >= r))" and + "((a + b + -1 * \x\ >= r) = (a + b + -1 * x >= r & a + b + 1 * x >= r))" and + "((a + b + -1 * \x\ + c >= r) = (a + b + -1 * x + c >= r & a + b + 1 * x + c >= r))" and "((-1 * max x y >= r) = (-1 * x >= r & -1 * y >= r))" and "((-1 * max x y + a >= r) = (a + -1 * x >= r & a + -1 * y >= r))" and "((a + -1 * max x y >= r) = (a + -1 * x >= r & a + -1 * y >= r))" and @@ -245,12 +245,12 @@ "((a + min x y + b >= r) = (a + x + b >= r & a + y + b >= r))" and "((a + b + min x y >= r) = (a + b + x >= r & a + b + y >= r))" and "((a + b + min x y + c >= r) = (a + b + x + c >= r & a + b + y + c >= r))" and - "((-1 * abs(x) > r) = (-1 * x > r & 1 * x > r))" and - "((-1 * abs(x) + a > r) = (a + -1 * x > r & a + 1 * x > r))" and - "((a + -1 * abs(x) > r) = (a + -1 * x > r & a + 1 * x > r))" and - "((a + -1 * abs(x) + b > r) = (a + -1 * x + b > r & a + 1 * x + b > r))" and - "((a + b + -1 * abs(x) > r) = (a + b + -1 * x > r & a + b + 1 * x > r))" and - "((a + b + -1 * abs(x) + c > r) = (a + b + -1 * x + c > r & a + b + 1 * x + c > r))" and + "((-1 * \x\ > r) = (-1 * x > r & 1 * x > r))" and + "((-1 * \x\ + a > r) = (a + -1 * x > r & a + 1 * x > r))" and + "((a + -1 * \x\ > r) = (a + -1 * x > r & a + 1 * x > r))" and + "((a + -1 * \x\ + b > r) = (a + -1 * x + b > r & a + 1 * x + b > r))" and + "((a + b + -1 * \x\ > r) = (a + b + -1 * x > r & a + b + 1 * x > r))" and + "((a + b + -1 * \x\ + c > r) = (a + b + -1 * x + c > r & a + b + 1 * x + c > r))" and "((-1 * max x y > r) = ((-1 * x > r) & -1 * y > r))" and "((-1 * max x y + a > r) = (a + -1 * x > r & a + -1 * y > r))" and "((a + -1 * max x y > r) = (a + -1 * x > r & a + -1 * y > r))" and @@ -265,7 +265,7 @@ "((a + b + min x y + c > r) = (a + b + x + c > r & a + b + y + c > r))" by auto}; -val abs_split' = @{lemma "P (abs (x::'a::linordered_idom)) == (x >= 0 & P x | x < 0 & P (-x))" +val abs_split' = @{lemma "P \x::'a::linordered_idom\ == (x >= 0 & P x | x < 0 & P (-x))" by (atomize (full)) (auto split add: abs_split)}; val max_split = @{lemma "P (max x y) == ((x::'a::linorder) <= y & P y | x > y & P x)" diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Matrix_LP/ComputeFloat.thy --- a/src/HOL/Matrix_LP/ComputeFloat.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Matrix_LP/ComputeFloat.thy Mon Dec 28 01:28:28 2015 +0100 @@ -106,7 +106,7 @@ lemma int_mod_zmod: "int (a mod b) = (int a) mod (int b)" by (rule zmod_int) -lemma abs_div_2_less: "a \ 0 \ a \ -1 \ abs((a::int) div 2) < abs a" +lemma abs_div_2_less: "a \ 0 \ a \ -1 \ \(a::int) div 2\ < \a\" by arith lemma norm_0_1: "(1::_::numeral) = Numeral1" @@ -195,7 +195,7 @@ by (simp add: float_def mult_le_0_iff) (simp add: not_less [symmetric]) lemma float_abs: - "abs (float (a,b)) = (if 0 <= a then (float (a,b)) else (float (-a,b)))" + "\float (a,b)\ = (if 0 <= a then (float (a,b)) else (float (-a,b)))" by (simp add: float_def abs_if mult_less_0_iff not_less) lemma float_zero: diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Matrix_LP/LP.thy --- a/src/HOL/Matrix_LP/LP.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Matrix_LP/LP.thy Mon Dec 28 01:28:28 2015 +0100 @@ -19,47 +19,47 @@ assumes "A * x \ (b::'a::lattice_ring)" "0 \ y" - "abs (A - A') \ \_A" + "\A - A'\ \ \_A" "b \ b'" - "abs (c - c') \ \_c" - "abs x \ r" + "\c - c'\ \ \_c" + "\x\ \ r" shows - "c * x \ y * b' + (y * \_A + abs (y * A' - c') + \_c) * r" + "c * x \ y * b' + (y * \_A + \y * A' - c'\ + \_c) * r" proof - from assms have 1: "y * b <= y * b'" by (simp add: mult_left_mono) from assms have 2: "y * (A * x) <= y * b" by (simp add: mult_left_mono) have 3: "y * (A * x) = c * x + (y * (A - A') + (y * A' - c') + (c'-c)) * x" by (simp add: algebra_simps) from 1 2 3 have 4: "c * x + (y * (A - A') + (y * A' - c') + (c'-c)) * x <= y * b'" by simp - have 5: "c * x <= y * b' + abs((y * (A - A') + (y * A' - c') + (c'-c)) * x)" + have 5: "c * x <= y * b' + \(y * (A - A') + (y * A' - c') + (c'-c)) * x\" by (simp only: 4 estimate_by_abs) - have 6: "abs((y * (A - A') + (y * A' - c') + (c'-c)) * x) <= abs (y * (A - A') + (y * A' - c') + (c'-c)) * abs x" + have 6: "\(y * (A - A') + (y * A' - c') + (c'-c)) * x\ <= \y * (A - A') + (y * A' - c') + (c'-c)\ * \x\" by (simp add: abs_le_mult) - 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" + have 7: "(\y * (A - A') + (y * A' - c') + (c'-c)\) * \x\ <= (\y * (A-A') + (y*A'-c')\ + \c' - c\) * \x\" by(rule abs_triangle_ineq [THEN mult_right_mono]) simp - 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" + have 8: "(\y * (A-A') + (y*A'-c')\ + \c' - c\) * \x\ <= (\y * (A-A')\ + \y*A'-c'\ + \c' - c\) * \x\" by (simp add: abs_triangle_ineq mult_right_mono) - 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" + have 9: "(\y * (A-A')\ + \y*A'-c'\ + \c'-c\) * \x\ <= (\y\ * \A-A'\ + \y*A'-c'\ + \c'-c\) * \x\" by (simp add: abs_le_mult mult_right_mono) have 10: "c'-c = -(c-c')" by (simp add: algebra_simps) - have 11: "abs (c'-c) = abs (c-c')" + have 11: "\c'-c\ = \c-c'\" by (subst 10, subst abs_minus_cancel, simp) - 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') + \_c) * abs x" + have 12: "(\y\ * \A-A'\ + \y*A'-c'\ + \c'-c\) * \x\ <= (\y\ * \A-A'\ + \y*A'-c'\ + \_c) * \x\" by (simp add: 11 assms mult_right_mono) - have 13: "(abs y * abs (A-A') + abs (y*A'-c') + \_c) * abs x <= (abs y * \_A + abs (y*A'-c') + \_c) * abs x" + have 13: "(\y\ * \A-A'\ + \y*A'-c'\ + \_c) * \x\ <= (\y\ * \_A + \y*A'-c'\ + \_c) * \x\" by (simp add: assms mult_right_mono mult_left_mono) - have r: "(abs y * \_A + abs (y*A'-c') + \_c) * abs x <= (abs y * \_A + abs (y*A'-c') + \_c) * r" + have r: "(\y\ * \_A + \y*A'-c'\ + \_c) * \x\ <= (\y\ * \_A + \y*A'-c'\ + \_c) * r" apply (rule mult_left_mono) apply (simp add: assms) apply (rule_tac add_mono[of "0::'a" _ "0", simplified])+ apply (rule mult_left_mono[of "0" "\_A", simplified]) apply (simp_all) - apply (rule order_trans[where y="abs (A-A')"], simp_all add: assms) - apply (rule order_trans[where y="abs (c-c')"], simp_all add: assms) + apply (rule order_trans[where y="\A-A'\"], simp_all add: assms) + apply (rule order_trans[where y="\c-c'\"], simp_all add: assms) done - from 6 7 8 9 12 13 r have 14:" abs((y * (A - A') + (y * A' - c') + (c'-c)) * x) <=(abs y * \_A + abs (y*A'-c') + \_c) * r" + from 6 7 8 9 12 13 r have 14: "\(y * (A - A') + (y * A' - c') + (c'-c)) * x\ <= (\y\ * \_A + \y*A'-c'\ + \_c) * r" by (simp) show ?thesis - apply (rule le_add_right_mono[of _ _ "abs((y * (A - A') + (y * A' - c') + (c'-c)) * x)"]) + apply (rule le_add_right_mono[of _ _ "\(y * (A - A') + (y * A' - c') + (c'-c)) * x\"]) apply (simp_all only: 5 14[simplified abs_of_nonneg[of y, simplified assms]]) done qed @@ -68,14 +68,14 @@ assumes "A1 <= (A::'a::lattice_ring)" "A <= A2" - shows "abs (A-A1) <= A2-A1" + shows "\A-A1\ <= A2-A1" proof - have "0 <= A - A1" proof - from assms add_right_mono [of A1 A "- A1"] show ?thesis by simp qed - then have "abs (A-A1) = A-A1" by (rule abs_of_nonneg) - with assms show "abs (A-A1) <= (A2-A1)" by simp + then have "\A-A1\ = A-A1" by (rule abs_of_nonneg) + with assms show "\A-A1\ <= (A2-A1)" by simp qed lemma mult_le_prts: diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Matrix_LP/Matrix.thy --- a/src/HOL/Matrix_LP/Matrix.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Matrix_LP/Matrix.thy Mon Dec 28 01:28:28 2015 +0100 @@ -918,8 +918,8 @@ apply (simp add: move_matrix_def) apply (auto) by (subst RepAbs_matrix, - rule exI[of _ "(nrows A)+(nat (abs y))"], auto, rule nrows, arith, - rule exI[of _ "(ncols A)+(nat (abs x))"], auto, rule ncols, arith)+ + rule exI[of _ "(nrows A)+(nat \y\)"], auto, rule nrows, arith, + rule exI[of _ "(ncols A)+(nat \x\)"], auto, rule ncols, arith)+ lemma move_matrix_0_0[simp]: "move_matrix A 0 0 = A" by (simp add: move_matrix_def) @@ -1496,7 +1496,7 @@ begin definition - abs_matrix_def: "abs (A :: 'a matrix) = sup A (- A)" + abs_matrix_def: "\A :: 'a matrix\ = sup A (- A)" instance .. @@ -1613,7 +1613,7 @@ instance matrix :: (lattice_ring) lattice_ring proof fix A B C :: "('a :: lattice_ring) matrix" - show "abs A = sup A (-A)" + show "\A\ = sup A (-A)" by (simp add: abs_matrix_def) qed @@ -1814,7 +1814,7 @@ lemma Rep_minus[simp]: "Rep_matrix (-(A::_::group_add)) x y = - (Rep_matrix A x y)" by (simp add: minus_matrix_def) -lemma Rep_abs[simp]: "Rep_matrix (abs (A::_::lattice_ab_group_add)) x y = abs (Rep_matrix A x y)" +lemma Rep_abs[simp]: "Rep_matrix \A::_::lattice_ab_group_add\ x y = \Rep_matrix A x y\" by (simp add: abs_lattice sup_matrix_def) end diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Matrix_LP/SparseMatrix.thy --- a/src/HOL/Matrix_LP/SparseMatrix.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Matrix_LP/SparseMatrix.thy Mon Dec 28 01:28:28 2015 +0100 @@ -108,7 +108,7 @@ primrec abs_spvec :: "('a::lattice_ab_group_add_abs) spvec \ 'a spvec" where "abs_spvec [] = []" -| "abs_spvec (a#as) = (fst a, abs (snd a))#(abs_spvec as)" +| "abs_spvec (a#as) = (fst a, \snd a\)#(abs_spvec as)" lemma sparse_row_vector_minus: "sparse_row_vector (minus_spvec v) = - (sparse_row_vector v)" @@ -127,7 +127,7 @@ (*FIXME move*) lemma sparse_row_vector_abs: - "sorted_spvec (v :: 'a::lattice_ring spvec) \ sparse_row_vector (abs_spvec v) = abs (sparse_row_vector v)" + "sorted_spvec (v :: 'a::lattice_ring spvec) \ sparse_row_vector (abs_spvec v) = \sparse_row_vector v\" apply (induct v) apply simp_all apply (frule_tac sorted_spvec_cons1, simp) @@ -770,7 +770,7 @@ qed lemma sparse_row_matrix_abs: - "sorted_spvec A \ sorted_spmat A \ sparse_row_matrix (abs_spmat A) = abs (sparse_row_matrix A)" + "sorted_spvec A \ sorted_spmat A \ sparse_row_matrix (abs_spmat A) = \sparse_row_matrix A\" apply (induct A) apply (simp_all add: sparse_row_vector_abs sparse_row_matrix_cons) apply (frule_tac sorted_spvec_cons1, simp) @@ -1060,7 +1060,7 @@ "A <= sparse_row_matrix A2" "sparse_row_matrix c1 <= c" "c <= sparse_row_matrix c2" - "abs x \ sparse_row_matrix r" + "\x\ \ sparse_row_matrix r" shows "c * x \ sparse_row_matrix (add_spmat (mult_spmat y b, mult_spmat (add_spmat (add_spmat (mult_spmat y (diff_spmat A2 A1), abs_spmat (diff_spmat (mult_spmat y A1) c1)), diff_spmat c2 c1)) r))" diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Metis_Examples/Big_O.thy --- a/src/HOL/Metis_Examples/Big_O.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Metis_Examples/Big_O.thy Mon Dec 28 01:28:28 2015 +0100 @@ -17,12 +17,12 @@ subsection {* Definitions *} definition bigo :: "('a => 'b::linordered_idom) => ('a => 'b) set" ("(1O'(_'))") where - "O(f::('a => 'b)) == {h. \c. \x. abs (h x) <= c * abs (f x)}" + "O(f::('a => 'b)) == {h. \c. \x. \h x\ <= c * \f x\}" lemma bigo_pos_const: "(\c::'a::linordered_idom. - \x. abs (h x) \ c * abs (f x)) - \ (\c. 0 < c \ (\x. abs(h x) \ c * abs (f x)))" + \x. \h x\ \ c * \f x\) + \ (\c. 0 < c \ (\x. \h x\ \ c * \f x\))" by (metis (no_types) abs_ge_zero algebra_simps mult.comm_neutral mult_nonpos_nonneg not_le_imp_less order_trans zero_less_one) @@ -33,12 +33,12 @@ lemma "(\c::'a::linordered_idom. - \x. abs (h x) \ c * abs (f x)) - \ (\c. 0 < c \ (\x. abs(h x) \ c * abs (f x)))" + \x. \h x\ \ c * \f x\) + \ (\c. 0 < c \ (\x. \h x\ \ c * \f x\))" apply auto apply (case_tac "c = 0", simp) apply (rule_tac x = "1" in exI, simp) - apply (rule_tac x = "abs c" in exI, auto) + apply (rule_tac x = "\c\" in exI, auto) proof - fix c :: 'a and x :: 'b assume A1: "\x. \h x\ \ c * \f x\" @@ -64,12 +64,12 @@ lemma "(\c::'a::linordered_idom. - \x. abs (h x) \ c * abs (f x)) - \ (\c. 0 < c \ (\x. abs(h x) \ c * abs (f x)))" + \x. \h x\ \ c * \f x\) + \ (\c. 0 < c \ (\x. \h x\ \ c * \f x\))" apply auto apply (case_tac "c = 0", simp) apply (rule_tac x = "1" in exI, simp) - apply (rule_tac x = "abs c" in exI, auto) + apply (rule_tac x = "\c\" in exI, auto) proof - fix c :: 'a and x :: 'b assume A1: "\x. \h x\ \ c * \f x\" @@ -87,12 +87,12 @@ lemma "(\c::'a::linordered_idom. - \x. abs (h x) \ c * abs (f x)) - \ (\c. 0 < c \ (\x. abs(h x) \ c * abs (f x)))" + \x. \h x\ \ c * \f x\) + \ (\c. 0 < c \ (\x. \h x\ \ c * \f x\))" apply auto apply (case_tac "c = 0", simp) apply (rule_tac x = "1" in exI, simp) - apply (rule_tac x = "abs c" in exI, auto) + apply (rule_tac x = "\c\" in exI, auto) proof - fix c :: 'a and x :: 'b assume A1: "\x. \h x\ \ c * \f x\" @@ -107,12 +107,12 @@ lemma "(\c::'a::linordered_idom. - \x. abs (h x) \ c * abs (f x)) - \ (\c. 0 < c \ (\x. abs(h x) \ c * abs (f x)))" + \x. \h x\ \ c * \f x\) + \ (\c. 0 < c \ (\x. \h x\ \ c * \f x\))" apply auto apply (case_tac "c = 0", simp) apply (rule_tac x = "1" in exI, simp) - apply (rule_tac x = "abs c" in exI, auto) + apply (rule_tac x = "\c\" in exI, auto) proof - fix c :: 'a and x :: 'b assume A1: "\x. \h x\ \ c * \f x\" @@ -125,7 +125,7 @@ sledgehammer_params [isar_proofs, compress = 1] -lemma bigo_alt_def: "O(f) = {h. \c. (0 < c \ (\x. abs (h x) <= c * abs (f x)))}" +lemma bigo_alt_def: "O(f) = {h. \c. (0 < c \ (\x. \h x\ <= c * \f x\))}" by (auto simp add: bigo_def bigo_pos_const) lemma bigo_elt_subset [intro]: "f : O(g) \ O(f) \ O(g)" @@ -160,25 +160,25 @@ apply (rule subsetI) apply (auto simp add: bigo_def bigo_pos_const func_plus set_plus_def) apply (subst bigo_pos_const [symmetric])+ -apply (rule_tac x = "\n. if abs (g n) <= (abs (f n)) then x n else 0" in exI) +apply (rule_tac x = "\n. if \g n\ <= \f n\ then x n else 0" in exI) apply (rule conjI) apply (rule_tac x = "c + c" in exI) apply clarsimp - apply (subgoal_tac "c * abs (f xa + g xa) <= (c + c) * abs (f xa)") + apply (subgoal_tac "c * \f xa + g xa\ <= (c + c) * \f xa\") apply (metis mult_2 order_trans) - apply (subgoal_tac "c * abs (f xa + g xa) <= c * (abs (f xa) + abs (g xa))") + apply (subgoal_tac "c * \f xa + g xa\ <= c * (\f xa\ + \g xa\)") apply (erule order_trans) apply (simp add: ring_distribs) apply (rule mult_left_mono) apply (simp add: abs_triangle_ineq) apply (simp add: order_less_le) -apply (rule_tac x = "\n. if (abs (f n)) < abs (g n) then x n else 0" in exI) +apply (rule_tac x = "\n. if \f n\ < \g n\ then x n else 0" in exI) apply (rule conjI) apply (rule_tac x = "c + c" in exI) apply auto -apply (subgoal_tac "c * abs (f xa + g xa) <= (c + c) * abs (g xa)") +apply (subgoal_tac "c * \f xa + g xa\ <= (c + c) * \g xa\") apply (metis order_trans mult_2) -apply (subgoal_tac "c * abs (f xa + g xa) <= c * (abs (f xa) + abs (g xa))") +apply (subgoal_tac "c * \f xa + g xa\ <= c * (\f xa\ + \g xa\)") apply (erule order_trans) apply (simp add: ring_distribs) by (metis abs_triangle_ineq mult_le_cancel_left_pos) @@ -200,9 +200,8 @@ apply (drule_tac x = "xa" in spec)+ apply (subgoal_tac "0 <= f xa + g xa") apply (simp add: ring_distribs) - apply (subgoal_tac "abs (a xa + b xa) <= abs (a xa) + abs (b xa)") - apply (subgoal_tac "abs (a xa) + abs (b xa) <= - max c ca * f xa + max c ca * g xa") + apply (subgoal_tac "\a xa + b xa\ <= \a xa\ + \b xa\") + apply (subgoal_tac "\a xa\ + \b xa\ <= max c ca * f xa + max c ca * g xa") apply (metis order_trans) defer 1 apply (metis abs_triangle_ineq) @@ -236,17 +235,17 @@ by (metis add_le_cancel_left diff_add_cancel func_plus le_fun_def algebra_simps) -lemma bigo_abs: "(\x. abs(f x)) =o O(f)" +lemma bigo_abs: "(\x. \f x\) =o O(f)" apply (unfold bigo_def) apply auto by (metis mult_1 order_refl) -lemma bigo_abs2: "f =o O(\x. abs(f x))" +lemma bigo_abs2: "f =o O(\x. \f x\)" apply (unfold bigo_def) apply auto by (metis mult_1 order_refl) -lemma bigo_abs3: "O(f) = O(\x. abs(f x))" +lemma bigo_abs3: "O(f) = O(\x. \f x\)" proof - have F1: "\v u. u \ O(v) \ O(u) \ O(v)" by (metis bigo_elt_subset) have F2: "\u. (\R. \u R\) \ O(u)" by (metis bigo_abs) @@ -254,15 +253,15 @@ thus "O(f) = O(\x. \f x\)" using F1 F2 by auto qed -lemma bigo_abs4: "f =o g +o O(h) \ (\x. abs (f x)) =o (\x. abs (g x)) +o O(h)" +lemma bigo_abs4: "f =o g +o O(h) \ (\x. \f x\) =o (\x. \g x\) +o O(h)" apply (drule set_plus_imp_minus) apply (rule set_minus_imp_plus) apply (subst fun_diff_def) proof - assume a: "f - g : O(h)" - have "(\x. abs (f x) - abs (g x)) =o O(\x. abs(abs (f x) - abs (g x)))" + have "(\x. \f x\ - \g x\) =o O(\x. \\f x\ - \g x\\)" by (rule bigo_abs2) - also have "... <= O(\x. abs (f x - g x))" + also have "... <= O(\x. \f x - g x\)" apply (rule bigo_elt_subset) apply (rule bigo_bounded) apply (metis abs_ge_zero) @@ -274,10 +273,10 @@ done also have "... <= O(h)" using a by (rule bigo_elt_subset) - finally show "(\x. abs (f x) - abs (g x)) : O(h)". + finally show "(\x. \f x\ - \g x\) : O(h)" . qed -lemma bigo_abs5: "f =o O(g) \ (\x. abs(f x)) =o O(g)" +lemma bigo_abs5: "f =o O(g) \ (\x. \f x\) =o O(g)" by (unfold bigo_def, auto) lemma bigo_elt_subset2 [intro]: "f : g +o O(h) \ O(f) <= O(g) + O(h)" @@ -285,14 +284,14 @@ assume "f : g +o O(h)" also have "... <= O(g) + O(h)" by (auto del: subsetI) - also have "... = O(\x. abs(g x)) + O(\x. abs(h x))" + also have "... = O(\x. \g x\) + O(\x. \h x\)" by (metis bigo_abs3) - also have "... = O((\x. abs(g x)) + (\x. abs(h x)))" + also have "... = O((\x. \g x\) + (\x. \h x\))" by (rule bigo_plus_eq [symmetric], auto) finally have "f : ...". then have "O(f) <= ..." by (elim bigo_elt_subset) - also have "... = O(\x. abs(g x)) + O(\x. abs(h x))" + also have "... = O(\x. \g x\) + O(\x. \h x\)" by (rule bigo_plus_eq, auto) finally show ?thesis by (simp add: bigo_abs3 [symmetric]) @@ -307,7 +306,7 @@ apply (rule_tac x = "c * ca" in exI) apply (rule allI) apply (erule_tac x = x in allE)+ -apply (subgoal_tac "c * ca * abs (f x * g x) = (c * abs(f x)) * (ca * abs (g x))") +apply (subgoal_tac "c * ca * \f x * g x\ = (c * \f x\) * (ca * \g x\)") apply (metis (no_types) abs_ge_zero abs_mult mult_mono') by (metis mult.assoc mult.left_commute abs_of_pos mult.left_commute abs_mult) @@ -466,9 +465,9 @@ simp add: bigo_def elt_set_times_def func_times simp del: abs_mult ac_simps) (* sledgehammer *) - apply (rule_tac x = "ca * (abs c)" in exI) + apply (rule_tac x = "ca * \c\" in exI) apply (rule allI) - apply (subgoal_tac "ca * abs(c) * abs(f x) = abs(c) * (ca * abs(f x))") + apply (subgoal_tac "ca * \c\ * \f x\ = \c\ * (ca * \f x\)") apply (erule ssubst) apply (subst abs_mult) apply (rule mult_left_mono) @@ -493,10 +492,10 @@ subsection {* Setsum *} lemma bigo_setsum_main: "\x. \y \ A x. 0 <= h x y \ - \c. \x. \y \ A x. abs (f x y) <= c * (h x y) \ + \c. \x. \y \ A x. \f x y\ <= c * (h x y) \ (\x. SUM y : A x. f x y) =o O(\x. SUM y : A x. h x y)" apply (auto simp add: bigo_def) -apply (rule_tac x = "abs c" in exI) +apply (rule_tac x = "\c\" in exI) apply (subst abs_of_nonneg) back back apply (rule setsum_nonneg) apply force @@ -508,19 +507,19 @@ by (metis abs_ge_self abs_mult_pos order_trans) lemma bigo_setsum1: "\x y. 0 <= h x y \ - \c. \x y. abs (f x y) <= c * (h x y) \ + \c. \x y. \f x y\ <= c * (h x y) \ (\x. SUM y : A x. f x y) =o O(\x. SUM y : A x. h x y)" by (metis (no_types) bigo_setsum_main) lemma bigo_setsum2: "\y. 0 <= h y \ - \c. \y. abs (f y) <= c * (h y) \ + \c. \y. \f y\ <= c * (h y) \ (\x. SUM y : A x. f y) =o O(\x. SUM y : A x. h y)" apply (rule bigo_setsum1) by metis+ lemma bigo_setsum3: "f =o O(h) \ (\x. SUM y : A x. (l x y) * f(k x y)) =o - O(\x. SUM y : A x. abs(l x y * h(k x y)))" + O(\x. SUM y : A x. \l x y * h(k x y)\)" apply (rule bigo_setsum1) apply (rule allI)+ apply (rule abs_ge_zero) @@ -531,7 +530,7 @@ lemma bigo_setsum4: "f =o g +o O(h) \ (\x. SUM y : A x. l x y * f(k x y)) =o (\x. SUM y : A x. l x y * g(k x y)) +o - O(\x. SUM y : A x. abs(l x y * h(k x y)))" + O(\x. SUM y : A x. \l x y * h(k x y)\)" apply (rule set_minus_imp_plus) apply (subst fun_diff_def) apply (subst setsum_subtractf [symmetric]) @@ -544,7 +543,7 @@ (\x. SUM y : A x. (l x y) * f(k x y)) =o O(\x. SUM y : A x. (l x y) * h(k x y))" apply (subgoal_tac "(\x. SUM y : A x. (l x y) * h(k x y)) = - (\x. SUM y : A x. abs((l x y) * h(k x y)))") + (\x. SUM y : A x. \(l x y) * h(k x y)\)") apply (erule ssubst) apply (erule bigo_setsum3) apply (rule ext) @@ -616,14 +615,14 @@ definition lesso :: "('a => 'b::linordered_idom) => ('a => 'b) => ('a => 'b)" (infixl "x. max (f x - g x) 0)" -lemma bigo_lesseq1: "f =o O(h) \ \x. abs (g x) <= abs (f x) \ +lemma bigo_lesseq1: "f =o O(h) \ \x. \g x\ <= \f x\ \ g =o O(h)" apply (unfold bigo_def) apply clarsimp apply (blast intro: order_trans) done -lemma bigo_lesseq2: "f =o O(h) \ \x. abs (g x) <= f x \ +lemma bigo_lesseq2: "f =o O(h) \ \x. \g x\ <= f x \ g =o O(h)" apply (erule bigo_lesseq1) apply (blast intro: abs_ge_self order_trans) @@ -638,7 +637,7 @@ done lemma bigo_lesseq4: "f =o O(h) \ - \x. 0 <= g x \ \x. g x <= abs (f x) \ + \x. 0 <= g x \ \x. g x <= \f x\ \ g =o O(h)" apply (erule bigo_lesseq1) apply (rule allI) @@ -703,7 +702,7 @@ by (auto simp add: func_plus fun_diff_def algebra_simps split: split_max abs_split) -lemma bigo_lesso5: "f \C. \x. f x <= g x + C * abs (h x)" +lemma bigo_lesso5: "f \C. \x. f x <= g x + C * \h x\" apply (simp only: lesso_def bigo_alt_def) apply clarsimp by (metis add.commute diff_le_eq) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Bounded_Continuous_Function.thy --- a/src/HOL/Multivariate_Analysis/Bounded_Continuous_Function.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Bounded_Continuous_Function.thy Mon Dec 28 01:28:28 2015 +0100 @@ -307,7 +307,7 @@ proof (intro bcontfunI) fix x assume "\x. dist (f x) 0 \ y" - then show "dist (a *\<^sub>R f x) 0 \ abs a * y" + then show "dist (a *\<^sub>R f x) 0 \ \a\ * y" by (metis norm_cmul_rule_thm norm_conv_dist) qed (simp add: continuous_intros) qed diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Bounded_Linear_Function.thy --- a/src/HOL/Multivariate_Analysis/Bounded_Linear_Function.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Bounded_Linear_Function.thy Mon Dec 28 01:28:28 2015 +0100 @@ -398,7 +398,7 @@ by transfer (auto simp: algebra_simps setsum_subtractf) lemma norm_blinfun_of_matrix: - "norm (blinfun_of_matrix a) \ (\i\Basis. \j\Basis. abs (a i j))" + "norm (blinfun_of_matrix a) \ (\i\Basis. \j\Basis. \a i j\)" apply (rule norm_blinfun_bound) apply (simp add: setsum_nonneg) apply (simp only: blinfun_of_matrix_apply setsum_left_distrib) @@ -413,7 +413,7 @@ proof - have "\i j. i \ Basis \ j \ Basis \ Zfun (\x. norm (b x i j - a i j)) F" using assms unfolding tendsto_Zfun_iff Zfun_norm_iff . - hence "Zfun (\x. (\i\Basis. \j\Basis. abs (b x i j - a i j))) F" + hence "Zfun (\x. (\i\Basis. \j\Basis. \b x i j - a i j\)) F" by (auto intro!: Zfun_setsum) thus ?thesis unfolding tendsto_Zfun_iff blinfun_of_matrix_minus diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy --- a/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy Mon Dec 28 01:28:28 2015 +0100 @@ -1473,7 +1473,7 @@ using kuhn_labelling_lemma[OF *] by blast note label = this [rule_format] have lem1: "\x\unit_cube. \y\unit_cube. \i\Basis. label x i \ label y i \ - abs (f x \ i - x \ i) \ norm (f y - f x) + norm (y - x)" + \f x \ i - x \ i\ \ norm (f y - f x) + norm (y - x)" proof safe fix x y :: 'a assume x: "x \ unit_cube" @@ -1481,8 +1481,8 @@ fix i assume i: "label x i \ label y i" "i \ Basis" have *: "\x y fx fy :: real. x \ fx \ fy \ y \ fx \ x \ y \ fy \ - abs (fx - x) \ abs (fy - fx) + abs (y - x)" by auto - have "\(f x - x) \ i\ \ abs ((f y - f x)\i) + abs ((y - x)\i)" + \fx - x\ \ \fy - fx\ + \y - x\" by auto + have "\(f x - x) \ i\ \ \(f y - f x)\i\ + \(y - x)\i\" unfolding inner_simps apply (rule *) apply (cases "label x i = 0") @@ -1531,7 +1531,7 @@ qed have "\e>0. \x\unit_cube. \y\unit_cube. \z\unit_cube. \i\Basis. norm (x - z) < e \ norm (y - z) < e \ label x i \ label y i \ - abs ((f(z) - z)\i) < d / (real n)" + \(f(z) - z)\i\ < d / (real n)" proof - have d': "d / real n / 8 > 0" using d(1) by (simp add: n_def DIM_positive) @@ -1559,10 +1559,10 @@ "norm (y - z) < min (e / 2) (d / real n / 8)" "label x i \ label y i" assume i: "i \ Basis" - have *: "\z fz x fx n1 n2 n3 n4 d4 d :: real. abs(fx - x) \ n1 + n2 \ - abs (fx - fz) \ n3 \ abs (x - z) \ n4 \ + have *: "\z fz x fx n1 n2 n3 n4 d4 d :: real. \fx - x\ \ n1 + n2 \ + \fx - fz\ \ n3 \ \x - z\ \ n4 \ n1 < d4 \ n2 < 2 * d4 \ n3 < d4 \ n4 < d4 \ - (8 * d4 = d) \ abs(fz - z) < d" + (8 * d4 = d) \ \fz - z\ < d" by auto show "\(f z - z) \ i\ < d / real n" unfolding inner_simps @@ -1669,7 +1669,7 @@ (label (\i\Basis. (real (s (b' i)) / real p) *\<^sub>R i) \ b) i" by (rule kuhn_lemma[OF q1 q2 q3]) def z \ "(\i\Basis. (real (q (b' i)) / real p) *\<^sub>R i)::'a" - have "\i\Basis. d / real n \ abs ((f z - z)\i)" + have "\i\Basis. d / real n \ \(f z - z)\i\" proof (rule ccontr) have "\i\Basis. q (b' i) \ {0..p}" using q(1) b' diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy Mon Dec 28 01:28:28 2015 +0100 @@ -792,7 +792,7 @@ dot_rowvector_columnvector matrix_transpose_mul matrix_mul_assoc .. -lemma infnorm_cart:"infnorm (x::real^'n) = Sup {abs(x$i) |i. i\UNIV}" +lemma infnorm_cart:"infnorm (x::real^'n) = Sup {\x$i\ |i. i\UNIV}" by (simp add: infnorm_def inner_axis Basis_vec_def) (metis (lifting) inner_axis real_inner_1_right) lemma component_le_infnorm_cart: "\x$i\ \ infnorm (x::real^'n)" @@ -1243,10 +1243,10 @@ lemma norm_vector_1: "norm (x :: _^1) = norm (x$1)" by (simp add: norm_vec_def) -lemma norm_real: "norm(x::real ^ 1) = abs(x$1)" +lemma norm_real: "norm(x::real ^ 1) = \x$1\" by (simp add: norm_vector_1) -lemma dist_real: "dist(x::real ^ 1) y = abs((x$1) - (y$1))" +lemma dist_real: "dist(x::real ^ 1) y = \(x$1) - (y$1)\" by (auto simp add: norm_real dist_norm) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy --- a/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Mon Dec 28 01:28:28 2015 +0100 @@ -3862,7 +3862,7 @@ lemma winding_number_big_meets: fixes z::complex - assumes \: "valid_path \" and z: "z \ path_image \" and "abs (Re (winding_number \ z)) \ 1" + assumes \: "valid_path \" and z: "z \ path_image \" and "\Re (winding_number \ z)\ \ 1" and w: "w \ z" shows "\a::real. 0 < a \ z + a*(w - z) \ path_image \" proof - @@ -3888,7 +3888,7 @@ shows "\valid_path \; z \ path_image \; w \ z; \a::real. 0 < a \ z + a*(w - z) \ path_image \\ - \ abs (Re(winding_number \ z)) < 1" + \ \Re(winding_number \ z)\ < 1" by (auto simp: not_less dest: winding_number_big_meets) text\One way of proving that WN=1 for a loop.\ @@ -4319,7 +4319,7 @@ { assume wnz_12: "\Re (winding_number \ z)\ > 1/2" have "isCont (winding_number \) z" by (metis continuous_at_winding_number valid_path_imp_path \ z) - then obtain d where "d>0" and d: "\x'. dist x' z < d \ dist (winding_number \ x') (winding_number \ z) < abs(Re(winding_number \ z)) - 1/2" + then obtain d where "d>0" and d: "\x'. dist x' z < d \ dist (winding_number \ x') (winding_number \ z) < \Re(winding_number \ z)\ - 1/2" using continuous_at_eps_delta wnz_12 diff_gt_0_iff_gt by blast def z' \ "z - (d / (2 * cmod a)) *\<^sub>R a" have *: "a \ z' \ b - d / 3 * cmod a" @@ -4479,7 +4479,7 @@ done } then have "\e. 0 < e \ - (\t1 t2. t1 \ {0..1} \ t2 \ {0..1} \ abs(t1 - t) < e \ abs(t2 - t) < e + (\t1 t2. t1 \ {0..1} \ t2 \ {0..1} \ \t1 - t\ < e \ \t2 - t\ < e \ (\d. 0 < d \ (\g1 g2. valid_path g1 \ valid_path g2 \ (\u \ {0..1}. @@ -4490,7 +4490,7 @@ } then obtain ee where ee: "\t. t \ {0..1} \ ee t > 0 \ - (\t1 t2. t1 \ {0..1} \ t2 \ {0..1} \ abs(t1 - t) < ee t \ abs(t2 - t) < ee t + (\t1 t2. t1 \ {0..1} \ t2 \ {0..1} \ \t1 - t\ < ee t \ \t2 - t\ < ee t \ (\d. 0 < d \ (\g1 g2. valid_path g1 \ valid_path g2 \ (\u \ {0..1}. @@ -4867,7 +4867,7 @@ with assms show ?thesis by simp next case 2 - have [simp]: "abs r = r" using \r > 0\ by linarith + have [simp]: "\r\ = r" using \r > 0\ by linarith have [simp]: "cmod (complex_of_real t - complex_of_real s) = t-s" by (metis "2" abs_of_pos diff_gt_0_iff_gt norm_of_real of_real_diff) have "finite (part_circlepath z r s t -` {y} \ {0..1})" if "y \ k" for y @@ -4940,7 +4940,7 @@ qed proposition simple_path_part_circlepath: - "simple_path(part_circlepath z r s t) \ (r \ 0 \ s \ t \ abs(s - t) \ 2*pi)" + "simple_path(part_circlepath z r s t) \ (r \ 0 \ s \ t \ \s - t\ \ 2*pi)" proof (cases "r = 0 \ s = t") case True then show ?thesis @@ -4952,17 +4952,17 @@ have *: "\x y z s t. ii*((1 - x) * s + x * t) = ii*(((1 - y) * s + y * t)) + z \ ii*(x - y) * (t - s) = z" by (simp add: algebra_simps) have abs01: "\x y::real. 0 \ x \ x \ 1 \ 0 \ y \ y \ 1 - \ (x = y \ x = 0 \ y = 1 \ x = 1 \ y = 0 \ abs(x - y) \ {0,1})" + \ (x = y \ x = 0 \ y = 1 \ x = 1 \ y = 0 \ \x - y\ \ {0,1})" by auto - have abs_away: "\P. (\x\{0..1}. \y\{0..1}. P(abs(x - y))) \ (\x::real. 0 \ x \ x \ 1 \ P x)" + have abs_away: "\P. (\x\{0..1}. \y\{0..1}. P \x - y\) \ (\x::real. 0 \ x \ x \ 1 \ P x)" by force have **: "\x y. (\n. (complex_of_real x - of_real y) * (of_real t - of_real s) = 2 * (of_int n * of_real pi)) \ - (\n. abs(x - y) * (t - s) = 2 * (of_int n * pi))" + (\n. \x - y\ * (t - s) = 2 * (of_int n * pi))" by (force simp: algebra_simps abs_if dest: arg_cong [where f=Re] arg_cong [where f=complex_of_real] intro: exI [where x = "-n" for n]) have 1: "\x. 0 \ x \ x \ 1 \ (\n. x * (t - s) = 2 * (real_of_int n * pi)) \ x = 0 \ x = 1 \ \s - t\ \ 2 * pi" apply (rule ccontr) - apply (drule_tac x="2*pi / abs(t-s)" in spec) + apply (drule_tac x="2*pi / \t - s\" in spec) using False apply (simp add: abs_minus_commute divide_simps) apply (frule_tac x=1 in spec) @@ -4986,7 +4986,7 @@ qed proposition arc_part_circlepath: - assumes "r \ 0" "s \ t" "abs(s - t) < 2*pi" + assumes "r \ 0" "s \ t" "\s - t\ < 2*pi" shows "arc (part_circlepath z r s t)" proof - have *: "x = y" if eq: "\ * (linepath s t x) = \ * (linepath s t y) + 2 * of_int n * complex_of_real pi * \" @@ -5111,7 +5111,7 @@ qed proposition path_image_circlepath [simp]: - "path_image (circlepath z r) = sphere z (abs r)" + "path_image (circlepath z r) = sphere z \r\" using path_image_circlepath_minus by (force simp add: path_image_circlepath_nonneg abs_if) @@ -6163,7 +6163,7 @@ with inf [unfolded Lim_at_infinity, rule_format, of "norm(f z)/2"] obtain B where B: "\x. B \ cmod x \ norm (f x) * 2 < cmod (f z)" by (auto simp: dist_norm) - def R \ "1 + abs B + norm z" + def R \ "1 + \B\ + norm z" have "R > 0" unfolding R_def by (meson abs_add_one_gt_zero le_less_trans less_add_same_cancel2 norm_ge_zero) have *: "((\u. f u / (u - z)) has_contour_integral 2 * complex_of_real pi * \ * f z) (circlepath z R)" apply (rule Cauchy_integral_circlepath) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Complex_Transcendental.thy --- a/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy Mon Dec 28 01:28:28 2015 +0100 @@ -8,7 +8,7 @@ lemma cmod_add_real_less: assumes "Im z \ 0" "r\0" - shows "cmod (z + r) < cmod z + abs r" + shows "cmod (z + r) < cmod z + \r\" proof (cases z) case (Complex x y) have "r * x / \r\ < sqrt (x*x + y*y)" @@ -23,7 +23,7 @@ done qed -lemma cmod_diff_real_less: "Im z \ 0 \ x\0 \ cmod (z - x) < cmod z + abs x" +lemma cmod_diff_real_less: "Im z \ 0 \ x\0 \ cmod (z - x) < cmod z + \x\" using cmod_add_real_less [of z "-x"] by simp @@ -205,7 +205,7 @@ finally show ?thesis . qed -lemma exp_complex_eqI: "abs(Im w - Im z) < 2*pi \ exp w = exp z \ w = z" +lemma exp_complex_eqI: "\Im w - Im z\ < 2*pi \ exp w = exp z \ w = z" by (auto simp: exp_eq abs_mult) lemma exp_integer_2pi: @@ -361,7 +361,7 @@ finally show ?thesis . qed -lemma dist_exp_ii_1: "norm(exp(ii * of_real t) - 1) = 2 * abs(sin(t / 2))" +lemma dist_exp_ii_1: "norm(exp(ii * of_real t) - 1) = 2 * \sin(t / 2)\" apply (simp add: exp_Euler cmod_def power2_diff sin_of_real cos_of_real algebra_simps) using cos_double_sin [of "t/2"] apply (simp add: real_sqrt_mult) @@ -579,7 +579,7 @@ declare power_Suc [simp] text\32-bit Approximation to e\ -lemma e_approx_32: "abs(exp(1) - 5837465777 / 2147483648) \ (inverse(2 ^ 32)::real)" +lemma e_approx_32: "\exp(1) - 5837465777 / 2147483648\ \ (inverse(2 ^ 32)::real)" using Taylor_exp [of 1 14] exp_le apply (simp add: setsum_left_distrib in_Reals_norm Re_exp atMost_nat_numeral fact_numeral) apply (simp only: pos_le_divide_eq [symmetric], linarith) @@ -1055,14 +1055,14 @@ lemma Re_Ln_pos_lt: assumes "z \ 0" - shows "abs(Im(Ln z)) < pi/2 \ 0 < Re(z)" + shows "\Im(Ln z)\ < pi/2 \ 0 < Re(z)" proof - { fix w assume "w = Ln z" then have w: "Im w \ pi" "- pi < Im w" using Im_Ln_le_pi [of z] mpi_less_Im_Ln [of z] assms by auto - then have "abs(Im w) < pi/2 \ 0 < Re(exp w)" + then have "\Im w\ < pi/2 \ 0 < Re(exp w)" apply (auto simp: Re_exp zero_less_mult_iff cos_gt_zero_pi) using cos_lt_zero_pi [of "-(Im w)"] cos_lt_zero_pi [of "(Im w)"] apply (simp add: abs_if split: split_if_asm) @@ -1077,14 +1077,14 @@ lemma Re_Ln_pos_le: assumes "z \ 0" - shows "abs(Im(Ln z)) \ pi/2 \ 0 \ Re(z)" + shows "\Im(Ln z)\ \ pi/2 \ 0 \ Re(z)" proof - { fix w assume "w = Ln z" then have w: "Im w \ pi" "- pi < Im w" using Im_Ln_le_pi [of z] mpi_less_Im_Ln [of z] assms by auto - then have "abs(Im w) \ pi/2 \ 0 \ Re(exp w)" + then have "\Im w\ \ pi/2 \ 0 \ Re(exp w)" apply (auto simp: Re_exp zero_le_mult_iff cos_ge_zero) using cos_lt_zero_pi [of "- (Im w)"] cos_lt_zero_pi [of "(Im w)"] not_le apply (auto simp: abs_if split: split_if_asm) @@ -1132,7 +1132,7 @@ by auto qed -lemma Re_Ln_pos_lt_imp: "0 < Re(z) \ abs(Im(Ln z)) < pi/2" +lemma Re_Ln_pos_lt_imp: "0 < Re(z) \ \Im(Ln z)\ < pi/2" by (metis Re_Ln_pos_lt less_irrefl zero_complex.simps(1)) lemma Im_Ln_pos_lt_imp: "0 < Im(z) \ 0 < Im(Ln z) \ Im(Ln z) < pi" @@ -1834,7 +1834,7 @@ assumes "\Re z\ < pi/2" shows "Arctan(tan z) = z" proof - - have ge_pi2: "\n::int. abs (of_int (2*n + 1) * pi/2) \ pi/2" + have ge_pi2: "\n::int. \of_int (2*n + 1) * pi/2\ \ pi/2" by (case_tac n rule: int_cases) (auto simp: abs_mult) have "exp (\*z)*exp (\*z) = -1 \ exp (2*\*z) = -1" by (metis distrib_right exp_add mult_2) @@ -1863,8 +1863,8 @@ qed lemma - assumes "Re z = 0 \ abs(Im z) < 1" - shows Re_Arctan_bounds: "abs(Re(Arctan z)) < pi/2" + assumes "Re z = 0 \ \Im z\ < 1" + shows Re_Arctan_bounds: "\Re(Arctan z)\ < pi/2" and has_field_derivative_Arctan: "(Arctan has_field_derivative inverse(1 + z\<^sup>2)) (at z)" proof - have nz0: "1 + \*z \ 0" @@ -1889,7 +1889,7 @@ using assms apply (auto simp: algebra_simps abs_square_less_1 [unfolded power2_eq_square]) done - show "abs(Re(Arctan z)) < pi/2" + show "\Re(Arctan z)\ < pi/2" unfolding Arctan_def divide_complex_def using mpi_less_Im_Ln [OF nzi] by (auto simp: abs_if intro: Im_Ln_less_pi * [unfolded divide_complex_def]) @@ -1903,31 +1903,31 @@ done qed -lemma complex_differentiable_at_Arctan: "(Re z = 0 \ abs(Im z) < 1) \ Arctan complex_differentiable at z" +lemma complex_differentiable_at_Arctan: "(Re z = 0 \ \Im z\ < 1) \ Arctan complex_differentiable at z" using has_field_derivative_Arctan by (auto simp: complex_differentiable_def) lemma complex_differentiable_within_Arctan: - "(Re z = 0 \ abs(Im z) < 1) \ Arctan complex_differentiable (at z within s)" + "(Re z = 0 \ \Im z\ < 1) \ Arctan complex_differentiable (at z within s)" using complex_differentiable_at_Arctan complex_differentiable_at_within by blast declare has_field_derivative_Arctan [derivative_intros] declare has_field_derivative_Arctan [THEN DERIV_chain2, derivative_intros] lemma continuous_at_Arctan: - "(Re z = 0 \ abs(Im z) < 1) \ continuous (at z) Arctan" + "(Re z = 0 \ \Im z\ < 1) \ continuous (at z) Arctan" by (simp add: complex_differentiable_imp_continuous_at complex_differentiable_within_Arctan) lemma continuous_within_Arctan: - "(Re z = 0 \ abs(Im z) < 1) \ continuous (at z within s) Arctan" + "(Re z = 0 \ \Im z\ < 1) \ continuous (at z within s) Arctan" using continuous_at_Arctan continuous_at_imp_continuous_within by blast lemma continuous_on_Arctan [continuous_intros]: - "(\z. z \ s \ Re z = 0 \ abs \Im z\ < 1) \ continuous_on s Arctan" + "(\z. z \ s \ Re z = 0 \ \Im z\ < 1) \ continuous_on s Arctan" by (auto simp: continuous_at_imp_continuous_on continuous_within_Arctan) lemma holomorphic_on_Arctan: - "(\z. z \ s \ Re z = 0 \ abs \Im z\ < 1) \ Arctan holomorphic_on s" + "(\z. z \ s \ Re z = 0 \ \Im z\ < 1) \ Arctan holomorphic_on s" by (simp add: complex_differentiable_within_Arctan holomorphic_on_def) @@ -1988,17 +1988,17 @@ lemma arctan_less_pi4_neg: "-1 < x \ -(pi/4) < arctan x" by (metis arctan_less_iff arctan_minus arctan_one) -lemma arctan_less_pi4: "abs x < 1 \ abs(arctan x) < pi/4" +lemma arctan_less_pi4: "\x\ < 1 \ \arctan x\ < pi/4" by (metis abs_less_iff arctan_less_pi4_pos arctan_minus) -lemma arctan_le_pi4: "abs x \ 1 \ abs(arctan x) \ pi/4" +lemma arctan_le_pi4: "\x\ \ 1 \ \arctan x\ \ pi/4" by (metis abs_le_iff arctan_le_iff arctan_minus arctan_one) -lemma abs_arctan: "abs(arctan x) = arctan(abs x)" +lemma abs_arctan: "\arctan x\ = arctan \x\" by (simp add: abs_if arctan_minus) lemma arctan_add_raw: - assumes "abs(arctan x + arctan y) < pi/2" + assumes "\arctan x + arctan y\ < pi/2" shows "arctan x + arctan y = arctan((x + y) / (1 - x * y))" proof (rule arctan_unique [symmetric]) show 12: "- (pi / 2) < arctan x + arctan y" "arctan x + arctan y < pi / 2" @@ -2027,7 +2027,7 @@ qed lemma arctan_add_small: - assumes "abs(x * y) < 1" + assumes "\x * y\ < 1" shows "(arctan x + arctan y = arctan((x + y) / (1 - x * y)))" proof (cases "x = 0 \ y = 0") case True then show ?thesis @@ -2044,7 +2044,7 @@ qed lemma abs_arctan_le: - fixes x::real shows "abs(arctan x) \ abs x" + fixes x::real shows "\arctan x\ \ \x\" proof - { fix w::complex and z::complex assume *: "w \ \" "z \ \" @@ -2064,7 +2064,7 @@ lemma arctan_le_self: "0 \ x \ arctan x \ x" by (metis abs_arctan_le abs_of_nonneg zero_le_arctan_iff) -lemma abs_tan_ge: "abs x < pi/2 \ abs x \ abs(tan x)" +lemma abs_tan_ge: "\x\ < pi/2 \ \x\ \ \tan x\" by (metis abs_arctan_le abs_less_iff arctan_tan minus_less_iff) @@ -2078,7 +2078,7 @@ apply auto 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) -lemma Arcsin_range_lemma: "abs (Re z) < 1 \ 0 < Re(\ * z + csqrt(1 - z\<^sup>2))" +lemma Arcsin_range_lemma: "\Re z\ < 1 \ 0 < Re(\ * z + csqrt(1 - z\<^sup>2))" using Complex.cmod_power2 [of z, symmetric] by (simp add: real_less_rsqrt algebra_simps Re_power2 cmod_square_less_1_plus) @@ -2393,7 +2393,7 @@ subsection\Upper and Lower Bounds for Inverse Sine and Cosine\ -lemma Arcsin_bounds: "\Re z\ < 1 \ abs(Re(Arcsin z)) < pi/2" +lemma Arcsin_bounds: "\Re z\ < 1 \ \Re(Arcsin z)\ < pi/2" unfolding Re_Arcsin by (blast intro: Re_Ln_pos_lt_imp Arcsin_range_lemma) @@ -2405,14 +2405,14 @@ unfolding Re_Arccos by (blast intro!: mpi_less_Im_Ln Im_Ln_le_pi Arccos_body_lemma) -lemma Re_Arccos_bound: "abs(Re(Arccos z)) \ pi" +lemma Re_Arccos_bound: "\Re(Arccos z)\ \ pi" by (meson Re_Arccos_bounds abs_le_iff less_eq_real_def minus_less_iff) lemma Re_Arcsin_bounds: "-pi < Re(Arcsin z) & Re(Arcsin z) \ pi" unfolding Re_Arcsin by (blast intro!: mpi_less_Im_Ln Im_Ln_le_pi Arcsin_body_lemma) -lemma Re_Arcsin_bound: "abs(Re(Arcsin z)) \ pi" +lemma Re_Arcsin_bound: "\Re(Arcsin z)\ \ pi" by (meson Re_Arcsin_bounds abs_le_iff less_eq_real_def minus_less_iff) @@ -2521,7 +2521,7 @@ subsection\Relationship with Arcsin on the Real Numbers\ lemma Im_Arcsin_of_real: - assumes "abs x \ 1" + assumes "\x\ \ 1" shows "Im (Arcsin (of_real x)) = 0" proof - have "csqrt (1 - (of_real x)\<^sup>2) = (if x^2 \ 1 then sqrt (1 - x^2) else \ * sqrt (x^2 - 1))" @@ -2539,7 +2539,7 @@ by (metis Im_Arcsin_of_real Re_complex_of_real Reals_cases complex_is_Real_iff) lemma arcsin_eq_Re_Arcsin: - assumes "abs x \ 1" + assumes "\x\ \ 1" shows "arcsin x = Re (Arcsin (of_real x))" unfolding arcsin_def proof (rule the_equality, safe) @@ -2564,14 +2564,14 @@ done qed -lemma of_real_arcsin: "abs x \ 1 \ of_real(arcsin x) = Arcsin(of_real x)" +lemma of_real_arcsin: "\x\ \ 1 \ of_real(arcsin x) = Arcsin(of_real x)" by (metis Im_Arcsin_of_real add.right_neutral arcsin_eq_Re_Arcsin complex_eq mult_zero_right of_real_0) subsection\Relationship with Arccos on the Real Numbers\ lemma Im_Arccos_of_real: - assumes "abs x \ 1" + assumes "\x\ \ 1" shows "Im (Arccos (of_real x)) = 0" proof - have "csqrt (1 - (of_real x)\<^sup>2) = (if x^2 \ 1 then sqrt (1 - x^2) else \ * sqrt (x^2 - 1))" @@ -2589,7 +2589,7 @@ by (metis Im_Arccos_of_real Re_complex_of_real Reals_cases complex_is_Real_iff) lemma arccos_eq_Re_Arccos: - assumes "abs x \ 1" + assumes "\x\ \ 1" shows "arccos x = Re (Arccos (of_real x))" unfolding arccos_def proof (rule the_equality, safe) @@ -2614,7 +2614,7 @@ done qed -lemma of_real_arccos: "abs x \ 1 \ of_real(arccos x) = Arccos(of_real x)" +lemma of_real_arccos: "\x\ \ 1 \ of_real(arccos x) = Arccos(of_real x)" by (metis Im_Arccos_of_real add.right_neutral arccos_eq_Re_Arccos complex_eq mult_zero_right of_real_0) subsection\Some interrelationships among the real inverse trig functions.\ diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Mon Dec 28 01:28:28 2015 +0100 @@ -3328,13 +3328,13 @@ ultimately have **: "(1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x \ affine hull S" using as affine_affine_hull[of S] mem_affine[of "affine hull S" y x "(1 / e)" "-((1 - e) / e)"] by (simp add: algebra_simps) - 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)" + have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \1/e\ * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)" unfolding dist_norm norm_scaleR[symmetric] apply (rule arg_cong[where f=norm]) using \e > 0\ apply (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps) done - also have "\ = abs (1/e) * norm (x - e *\<^sub>R (x - c) - y)" + also have "\ = \1/e\ * norm (x - e *\<^sub>R (x - c) - y)" by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps) also have "\ < d" using as[unfolded dist_norm] and \e > 0\ @@ -6076,15 +6076,15 @@ fixes s :: "('a::real_normed_vector) set" assumes "open s" and "convex_on s f" - and "\x\s. abs(f x) \ b" + and "\x\s. \f x\ \ b" shows "continuous_on s f" apply (rule continuous_at_imp_continuous_on) unfolding continuous_at_real_range proof (rule,rule,rule) fix x and e :: real assume "x \ s" "e > 0" - def B \ "abs b + 1" - have B: "0 < B" "\x. x\s \ abs (f x) \ B" + def B \ "\b\ + 1" + have B: "0 < B" "\x. x\s \ \f x\ \ B" unfolding B_def defer apply (drule assms(3)[rule_format]) @@ -6193,7 +6193,7 @@ fixes x :: "'a::real_normed_vector" assumes "convex_on (cball x e) f" and "\y \ cball x e. f y \ b" - shows "\y \ cball x e. abs (f y) \ b + 2 * abs (f x)" + shows "\y \ cball x e. \f y\ \ b + 2 * \f x\" apply rule proof (cases "0 \ e") case True @@ -6310,7 +6310,7 @@ apply (rule e(1)) apply (rule dsube) done - then have "\y\cball x d. abs (f y) \ k + 2 * abs (f x)" + then have "\y\cball x d. \f y\ \ k + 2 * \f x\" apply (rule convex_bounds_lemma) apply (rule ballI) apply (rule k [rule_format]) @@ -6751,13 +6751,13 @@ assume as: "dist (x - e *\<^sub>R (x - c)) y < e * d" have *: "y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x" using \e > 0\ by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib) - 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)" + have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \1/e\ * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)" unfolding dist_norm unfolding norm_scaleR[symmetric] apply (rule arg_cong[where f=norm]) using \e > 0\ by (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps) - also have "\ = abs (1/e) * norm (x - e *\<^sub>R (x - c) - y)" + also have "\ = \1/e\ * norm (x - e *\<^sub>R (x - c) - y)" by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps) also have "\ < d" using as[unfolded dist_norm] and \e > 0\ @@ -7001,7 +7001,7 @@ proof (rule setsum_mono) fix i :: 'a assume i: "i \ Basis" - then have "abs (y\i - x\i) < ?d" + then have "\y\i - x\i\ < ?d" apply - apply (rule le_less_trans) using Basis_le_norm[OF i, of "y - x"] @@ -7186,7 +7186,7 @@ assume "i \ d" with d have i: "i \ Basis" by auto - have "abs (y\i - x\i) < ?d" + have "\y\i - x\i\ < ?d" apply (rule le_less_trans) using Basis_le_norm[OF i, of "y - x"] using y[unfolded min_less_iff_conj dist_norm, THEN conjunct2] @@ -9860,7 +9860,7 @@ lemma setdist_singletons [simp]: "setdist {x} {y} = dist x y" by (simp add: setdist_def) -lemma setdist_Lipschitz: "abs(setdist {x} s - setdist {y} s) \ dist x y" +lemma setdist_Lipschitz: "\setdist {x} s - setdist {y} s\ \ dist x y" apply (subst setdist_singletons [symmetric]) by (metis abs_diff_le_iff diff_le_eq setdist_triangle setdist_sym) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Derivative.thy --- a/src/HOL/Multivariate_Analysis/Derivative.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy Mon Dec 28 01:28:28 2015 +0100 @@ -372,7 +372,7 @@ fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" assumes "(f has_derivative f') (at x within s)" and "(f has_derivative f'') (at x within s)" - and "\i\Basis. \e>0. \d. 0 < abs d \ abs d < e \ (x + d *\<^sub>R i) \ s" + and "\i\Basis. \e>0. \d. 0 < \d\ \ \d\ < e \ (x + d *\<^sub>R i) \ s" shows "f' = f''" proof - note as = assms(1,2)[unfolded has_derivative_def] @@ -415,9 +415,9 @@ obtain c where c: "0 < \c\" "\c\ < d \ x + c *\<^sub>R i \ s" using assms(3) i d(1) by blast have *: "norm (- ((1 / \c\) *\<^sub>R f' (c *\<^sub>R i)) + (1 / \c\) *\<^sub>R f'' (c *\<^sub>R i)) = - norm ((1 / abs c) *\<^sub>R (- (f' (c *\<^sub>R i)) + f'' (c *\<^sub>R i)))" + norm ((1 / \c\) *\<^sub>R (- (f' (c *\<^sub>R i)) + f'' (c *\<^sub>R i)))" unfolding scaleR_right_distrib by auto - also have "\ = norm ((1 / abs c) *\<^sub>R (c *\<^sub>R (- (f' i) + f'' i)))" + also have "\ = norm ((1 / \c\) *\<^sub>R (c *\<^sub>R (- (f' i) + f'' i)))" unfolding f'.scaleR f''.scaleR unfolding scaleR_right_distrib scaleR_minus_right by auto diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Fashoda.thy --- a/src/HOL/Multivariate_Analysis/Fashoda.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Fashoda.thy Mon Dec 28 01:28:28 2015 +0100 @@ -82,19 +82,19 @@ lemma infnorm_2: fixes x :: "real^2" - shows "infnorm x = max (abs (x$1)) (abs (x$2))" + shows "infnorm x = max \x$1\ \x$2\" unfolding infnorm_cart UNIV_2 by (rule cSup_eq) auto lemma infnorm_eq_1_2: fixes x :: "real^2" shows "infnorm x = 1 \ - abs (x$1) \ 1 \ abs (x$2) \ 1 \ (x$1 = -1 \ x$1 = 1 \ x$2 = -1 \ x$2 = 1)" + \x$1\ \ 1 \ \x$2\ \ 1 \ (x$1 = -1 \ x$1 = 1 \ x$2 = -1 \ x$2 = 1)" unfolding infnorm_2 by auto lemma infnorm_eq_1_imp: fixes x :: "real^2" assumes "infnorm x = 1" - shows "abs (x$1) \ 1" and "abs (x$2) \ 1" + shows "\x$1\ \ 1" and "\x$2\ \ 1" using assms unfolding infnorm_eq_1_2 by auto lemma fashoda_unit: diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Integration.thy --- a/src/HOL/Multivariate_Analysis/Integration.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Integration.thy Mon Dec 28 01:28:28 2015 +0100 @@ -499,7 +499,7 @@ lemma content_real: "a \ b \ content {a..b} = b - a" by (auto simp: interval_upperbound_def interval_lowerbound_def SUP_def INF_def content_def) -lemma abs_eq_content: "abs (y - x) = (if x\y then content {x .. y} else content {y..x})" +lemma abs_eq_content: "\y - x\ = (if x\y then content {x .. y} else content {y..x})" by (auto simp: content_real) lemma content_singleton[simp]: "content {a} = 0" @@ -2116,7 +2116,7 @@ proof (rule exI [where x=n], clarify) fix x y assume xy: "x\cbox (A n) (B n)" "y\cbox (A n) (B n)" - have "dist x y \ setsum (\i. abs((x - y)\i)) Basis" + have "dist x y \ setsum (\i. \(x - y)\i\) Basis" unfolding dist_norm by(rule norm_le_l1) also have "\ \ setsum (\i. B n\i - A n\i) Basis" proof (rule setsum_mono) @@ -3140,7 +3140,7 @@ apply (rule has_integralD[OF fj[unfolded interval_split[OF k]] e]) apply (simp add: interval_split[symmetric] k) done - let ?d = "\x. if x\k = c then (d1 x \ d2 x) else ball x (abs(x\k - c)) \ d1 x \ d2 x" + let ?d = "\x. if x\k = c then (d1 x \ d2 x) else ball x \x\k - c\ \ d1 x \ d2 x" have "gauge ?d" using d1 d2 unfolding gauge_def by auto then show ?case @@ -4659,11 +4659,11 @@ lemma interval_doublesplit: fixes a :: "'a::euclidean_space" assumes "k \ Basis" - shows "cbox a b \ {x . abs(x\k - c) \ (e::real)} = + shows "cbox a b \ {x . \x\k - c\ \ (e::real)} = cbox (\i\Basis. (if i = k then max (a\k) (c - e) else a\i) *\<^sub>R i) (\i\Basis. (if i = k then min (b\k) (c + e) else b\i) *\<^sub>R i)" proof - - have *: "\x c e::real. abs(x - c) \ e \ x \ c - e \ x \ c + e" + have *: "\x c e::real. \x - c\ \ e \ x \ c - e \ x \ c + e" by auto have **: "\s P Q. s \ {x. P x \ Q x} = (s \ {x. Q x}) \ {x. P x}" by blast @@ -4675,10 +4675,10 @@ fixes a :: "'a::euclidean_space" assumes "p division_of (cbox a b)" and k: "k \ Basis" - shows "{l \ {x. abs(x\k - c) \ e} |l. l \ p \ l \ {x. abs(x\k - c) \ e} \ {}} - division_of (cbox a b \ {x. abs(x\k - c) \ e})" -proof - - have *: "\x c. abs (x - c) \ e \ x \ c - e \ x \ c + e" + shows "{l \ {x. \x\k - c\ \ e} |l. l \ p \ l \ {x. \x\k - c\ \ e} \ {}} + division_of (cbox a b \ {x. \x\k - c\ \ e})" +proof - + have *: "\x c. \x - c\ \ e \ x \ c - e \ x \ c + e" by auto have **: "\p q p' q'. p division_of q \ p = p' \ q = q' \ p' division_of q'" by auto @@ -4700,7 +4700,7 @@ fixes a :: "'a::euclidean_space" assumes "0 < e" and k: "k \ Basis" - obtains d where "0 < d" and "content (cbox a b \ {x. abs(x\k - c) \ d}) < e" + obtains d where "0 < d" and "content (cbox a b \ {x. \x\k - c\ \ d}) < e" proof (cases "content (cbox a b) = 0") case True then have ce: "content (cbox a b) < e" @@ -4780,7 +4780,7 @@ fix p assume p: "p tagged_division_of (cbox a b) \ (\x. ball x d) fine p" have *: "(\(x, ka)\p. content ka *\<^sub>R ?i x) = - (\(x, ka)\p. content (ka \ {x. abs(x\k - c) \ d}) *\<^sub>R ?i x)" + (\(x, ka)\p. content (ka \ {x. \x\k - c\ \ d}) *\<^sub>R ?i x)" apply (rule setsum.cong) apply (rule refl) unfolding split_paired_all real_scaleR_def mult_cancel_right split_conv @@ -6695,7 +6695,7 @@ lemma content_image_affinity_cbox: "content((\x::'a::euclidean_space. m *\<^sub>R x + c) ` cbox a b) = - abs m ^ DIM('a) * content (cbox a b)" (is "?l = ?r") + \m\ ^ DIM('a) * content (cbox a b)" (is "?l = ?r") proof - { presume *: "cbox a b \ {} \ ?thesis" @@ -6743,7 +6743,7 @@ fixes a :: "'a::euclidean_space" assumes "(f has_integral i) (cbox a b)" and "m \ 0" - shows "((\x. f(m *\<^sub>R x + c)) has_integral ((1 / (abs(m) ^ DIM('a))) *\<^sub>R i)) ((\x. (1 / m) *\<^sub>R x + -((1 / m) *\<^sub>R c)) ` cbox a b)" + shows "((\x. f(m *\<^sub>R x + c)) has_integral ((1 / (\m\ ^ DIM('a))) *\<^sub>R i)) ((\x. (1 / m) *\<^sub>R x + -((1 / m) *\<^sub>R c)) ` cbox a b)" apply (rule has_integral_twiddle) using assms apply (safe intro!: interval_image_affinity_interval content_image_affinity_cbox) @@ -6807,7 +6807,7 @@ lemma content_image_stretch_interval: "content ((\x::'a::euclidean_space. (\k\Basis. (m k * (x\k))*\<^sub>R k)::'a) ` cbox a b) = - abs (setprod m Basis) * content (cbox a b)" + \setprod m Basis\ * content (cbox a b)" proof (cases "cbox a b = {}") case True then show ?thesis @@ -6847,7 +6847,7 @@ assumes "(f has_integral i) (cbox a b)" and "\k\Basis. m k \ 0" shows "((\x. f (\k\Basis. (m k * (x\k))*\<^sub>R k)) has_integral - ((1/(abs(setprod m Basis))) *\<^sub>R i)) ((\x. (\k\Basis. (1 / m k * (x\k))*\<^sub>R k)) ` cbox a b)" + ((1/ \setprod m Basis\) *\<^sub>R i)) ((\x. (\k\Basis. (1 / m k * (x\k))*\<^sub>R k)) ` cbox a b)" apply (rule has_integral_twiddle[where f=f]) unfolding zero_less_abs_iff content_image_stretch_interval unfolding image_stretch_interval empty_as_interval euclidean_eq_iff[where 'a='a] @@ -8829,8 +8829,8 @@ unfolding fine_inter proof (safe, goal_cases) have **: "\i j g1 g2 h1 h2 f1 f2. g1 - h2 \ f1 - f2 \ f1 - f2 \ h1 - g2 \ - abs (i - j) < e / 3 \ abs (g2 - i) < e / 3 \ abs (g1 - i) < e / 3 \ - abs (h2 - j) < e / 3 \ abs (h1 - j) < e / 3 \ abs (f1 - f2) < e" + \i - j\ < e / 3 \ \g2 - i\ < e / 3 \ \g1 - i\ < e / 3 \ + \h2 - j\ < e / 3 \ \h1 - j\ < e / 3 \ \f1 - f2\ < e" using \e > 0\ by arith case prems: (1 p1 p2) note tagged_division_ofD(2-4) note * = this[OF prems(1)] this[OF prems(4)] @@ -8996,9 +8996,9 @@ have **: "ball 0 B1 \ ball (0::'n) (max B1 B2)" "ball 0 B2 \ ball (0::'n) (max B1 B2)" by auto have *: "\ga gc ha hc fa fc::real. - abs (ga - i) < e / 3 \ abs (gc - i) < e / 3 \ abs (ha - j) < e / 3 \ - abs (hc - j) < e / 3 \ abs (i - j) < e / 3 \ ga \ fa \ fa \ ha \ gc \ fc \ fc \ hc \ - abs (fa - fc) < e" + \ga - i\ < e / 3 \ \gc - i\ < e / 3 \ \ha - j\ < e / 3 \ + \hc - j\ < e / 3 \ \i - j\ < e / 3 \ ga \ fa \ fa \ ha \ gc \ fc \ fc \ hc \ + \fa - fc\ < e" by (simp add: abs_real_def split: split_if_asm) show "norm (integral (cbox a b) (\x. if x \ s then f x else 0) - integral (cbox c d) (\x. if x \ s then f x else 0)) < e" @@ -9875,7 +9875,7 @@ case 3 note comb = integral_combine_tagged_division_topdown[OF assms(1)[rule_format] p(1)] have *: "\sr sx ss ks kr::real. kr = sr \ ks = ss \ - ks \ i \ sr \ sx \ sx \ ss \ 0 \ i\1 - kr\1 \ i\1 - kr\1 < e/4 \ abs (sx - i) < e/4" + ks \ i \ sr \ sx \ sx \ ss \ 0 \ i\1 - kr\1 \ i\1 - kr\1 < e/4 \ \sx - i\ < e/4" by auto show ?case unfolding real_norm_def @@ -10087,8 +10087,8 @@ apply (subst norm_minus_commute) apply auto done - have *: "\f1 f2 g. abs (f1 - i) < e / 2 \ abs (f2 - g) < e / 2 \ - f1 \ f2 \ f2 \ i \ abs (g - i) < e" + have *: "\f1 f2 g. \f1 - i\ < e / 2 \ \f2 - g\ < e / 2 \ + f1 \ f2 \ f2 \ i \ \g - i\ < e" unfolding real_inner_1_right by arith show "norm (integral (cbox a b) (\x. if x \ s then g x else 0) - i) < e" unfolding real_norm_def @@ -10305,7 +10305,7 @@ done have norm: "norm ig < dia + e" if "norm sg \ dsa" - and "abs (dsa - dia) < e / 2" + and "\dsa - dia\ < e / 2" and "norm (sg - ig) < e / 2" for e dsa dia and sg ig :: 'a apply (rule le_less_trans[OF norm_triangle_sub[of ig sg]]) @@ -10445,7 +10445,7 @@ (\x. c *\<^sub>R f x) absolutely_integrable_on s" unfolding absolutely_integrable_on_def using integrable_cmul[of f s c] - using integrable_cmul[of "\x. norm (f x)" s "abs c"] + using integrable_cmul[of "\x. norm (f x)" s "\c\"] by auto lemma absolutely_integrable_neg[intro]: @@ -10463,7 +10463,7 @@ lemma absolutely_integrable_abs[intro]: "f absolutely_integrable_on s \ - (\x. abs(f x::real)) absolutely_integrable_on s" + (\x. \f x::real\) absolutely_integrable_on s" apply (drule absolutely_integrable_norm) unfolding real_norm_def apply assumption @@ -10510,7 +10510,7 @@ lemma helplemma: assumes "setsum (\x. norm (f x - g x)) s < e" and "finite s" - shows "abs (setsum (\x. norm(f x)) s - setsum (\x. norm(g x)) s) < e" + shows "\setsum (\x. norm(f x)) s - setsum (\x. norm(g x)) s\ < e" unfolding setsum_subtractf[symmetric] apply (rule le_less_trans[OF setsum_abs]) apply (rule le_less_trans[OF _ assms(1)]) @@ -10709,8 +10709,8 @@ done note snd_p = division_ofD[OF division_of_tagged_division[OF p(1)]] - have *: "\sni sni' sf sf'. abs (sf' - sni') < e / 2 \ ?S - e / 2 < sni \ sni' \ ?S \ - sni \ sni' \ sf' = sf \ abs (sf - ?S) < e" + have *: "\sni sni' sf sf'. \sf' - sni'\ < e / 2 \ ?S - e / 2 < sni \ sni' \ ?S \ + sni \ sni' \ sf' = sf \ \sf - ?S\ < e" by arith show "norm ((\(x, k)\p. content k *\<^sub>R norm (f x)) - ?S) < e" unfolding real_norm_def @@ -11061,7 +11061,7 @@ proof - fix a b :: 'n assume ab: "ball 0 (K + 1) \ cbox a b" - have *: "\s s1. ?S - e < s1 \ s1 \ s \ s < ?S + e \ abs (s - ?S) < e" + have *: "\s s1. ?S - e < s1 \ s1 \ s \ s < ?S + e \ \s - ?S\ < e" by arith show "norm (integral (cbox a b) (\x. if x \ UNIV then norm (f x) else 0) - ?S) < e" unfolding real_norm_def @@ -11121,8 +11121,8 @@ p: "p tagged_division_of (cbox a b)" "d1 fine p" "d2 fine p" by (rule fine_division_exists [OF gauge_inter [OF d1(1) d2(1)], of a b]) (auto simp add: fine_inter) - have *: "\sf sf' si di. sf' = sf \ si \ ?S \ abs (sf - si) < e / 2 \ - abs (sf' - di) < e / 2 \ di < ?S + e" + have *: "\sf sf' si di. sf' = sf \ si \ ?S \ \sf - si\ < e / 2 \ + \sf' - di\ < e / 2 \ di < ?S + e" by arith show "integral (cbox a b) (\x. if x \ UNIV then norm (f x) else 0) < ?S + e" apply (subst if_P) @@ -11136,7 +11136,7 @@ unfolding tagged_division_of_def split_def apply auto done - show "abs ((\(x, k)\p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\x. norm(f x))) < e / 2" + show "\(\(x, k)\p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\x. norm(f x))\ < e / 2" using d1(2)[rule_format,OF conjI[OF p(1,2)]] by (simp only: real_norm_def) show "(\(x, k)\p. content k *\<^sub>R norm (f x)) = (\(x, k)\p. norm (content k *\<^sub>R f x))" @@ -11295,7 +11295,7 @@ fixes f :: "'a::euclidean_space => 'b::euclidean_space" and T :: "'c::euclidean_space \ 'b" assumes f: "f absolutely_integrable_on s" - shows "(\x. (\i\Basis. abs(f x\T i) *\<^sub>R i)) absolutely_integrable_on s" + shows "(\x. (\i\Basis. \f x\T i\ *\<^sub>R i)) absolutely_integrable_on s" (is "?Tf absolutely_integrable_on s") proof - have if_distrib: "\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)" @@ -11350,7 +11350,7 @@ lemma absolutely_integrable_abs_eq: fixes f::"'n::euclidean_space \ 'm::euclidean_space" shows "f absolutely_integrable_on s \ f integrable_on s \ - (\x. (\i\Basis. abs(f x\i) *\<^sub>R i)::'m) integrable_on s" + (\x. (\i\Basis. \f x\i\ *\<^sub>R i)::'m) integrable_on s" (is "?l = ?r") proof assume ?l @@ -11976,7 +11976,7 @@ apply safe proof goal_cases case prems: (1 n) - have *: "\y ix. y < Inf ?S + r \ Inf ?S \ ix \ ix \ y \ abs(ix - Inf ?S) < r" + have *: "\y ix. y < Inf ?S + r \ Inf ?S \ ix \ ix \ y \ \ix - Inf ?S\ < r" by arith show ?case unfolding real_norm_def @@ -12046,7 +12046,7 @@ apply safe proof goal_cases case prems: (1 n) - have *: "\y ix. Sup ?S - r < y \ ix \ Sup ?S \ y \ ix \ abs(ix - Sup ?S) < r" + have *: "\y ix. Sup ?S - r < y \ ix \ Sup ?S \ y \ ix \ \ix - Sup ?S\ < r" by arith show ?case apply simp diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy Mon Dec 28 01:28:28 2015 +0100 @@ -13,7 +13,7 @@ assumes eucl_sup: "sup x y = (\i\Basis. sup (x \ i) (y \ i) *\<^sub>R i)" assumes eucl_Inf: "Inf X = (\i\Basis. (INF x:X. x \ i) *\<^sub>R i)" assumes eucl_Sup: "Sup X = (\i\Basis. (SUP x:X. x \ i) *\<^sub>R i)" - assumes eucl_abs: "abs x = (\i\Basis. abs (x \ i) *\<^sub>R i)" + assumes eucl_abs: "\x\ = (\i\Basis. \x \ i\ *\<^sub>R i)" begin subclass order @@ -55,7 +55,7 @@ and inner_Basis_SUP_left: "i \ Basis \ (SUP x:X. f x) \ i = (SUP x:X. f x \ i)" using eucl_Sup [of "f ` X"] eucl_Inf [of "f ` X"] by (simp_all add: comp_def) -lemma abs_inner: "i \ Basis \ abs x \ i = abs (x \ i)" +lemma abs_inner: "i \ Basis \ \x\ \ i = \x \ i\" by (auto simp: eucl_abs) lemma @@ -159,12 +159,13 @@ shows "i \ Basis \ fst i = 0 \ snd i \ Basis \ snd i = 0 \ fst i \ Basis" by (cases i) (auto simp: Basis_prod_def) -instantiation prod::(abs, abs) abs +instantiation prod :: (abs, abs) abs begin -definition "abs x = (abs (fst x), abs (snd x))" +definition "\x\ = (\fst x\, \snd x\)" -instance proof qed +instance .. + end instance prod :: (ordered_euclidean_space, ordered_euclidean_space) ordered_euclidean_space @@ -269,7 +270,7 @@ definition "sup x y = (\ i. sup (x $ i) (y $ i))" definition "Inf X = (\ i. (INF x:X. x $ i))" definition "Sup X = (\ i. (SUP x:X. x $ i))" -definition "abs x = (\ i. abs (x $ i))" +definition "\x\ = (\ i. \x $ i\)" instance apply standard diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/PolyRoots.thy --- a/src/HOL/Multivariate_Analysis/PolyRoots.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/PolyRoots.thy Mon Dec 28 01:28:28 2015 +0100 @@ -169,7 +169,7 @@ qed qed -lemma norm_lemma_xy: "\abs b + 1 \ norm(y) - a; norm(x) \ a\ \ b \ norm(x + y)" +lemma norm_lemma_xy: "\\b\ + 1 \ norm(y) - a; norm(x) \ a\ \ b \ norm(x + y)" by (metis abs_add_one_not_less_self add.commute diff_le_eq dual_order.trans le_less_linear norm_diff_ineq) @@ -196,7 +196,7 @@ by auto show ?thesis unfolding eventually_at_infinity - proof (rule exI [where x="max M (max 1 ((abs B + 1) / (norm (c (Suc n)) / 2)))"], clarsimp) + proof (rule exI [where x="max M (max 1 ((\B\ + 1) / (norm (c (Suc n)) / 2)))"], clarsimp) fix z::'a assume les: "M \ norm z" "1 \ norm z" "(\B\ * 2 + 2) / norm (c (Suc n)) \ norm z" then have "\B\ * 2 + 2 \ norm z * norm (c (Suc n))" diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Mon Dec 28 01:28:28 2015 +0100 @@ -3201,7 +3201,7 @@ by (simp add: bounded_iff bdd_above_def) lemma bounded_realI: - assumes "\x\s. abs (x::real) \ B" + assumes "\x\s. \x::real\ \ B" shows "bounded s" unfolding bounded_def dist_real_def by (metis abs_minus_commute assms diff_0_right) @@ -3275,7 +3275,7 @@ lemma bounded_pos: "bounded S \ (\b>0. \x\ S. norm x \ b)" apply (simp add: bounded_iff) - apply (subgoal_tac "\x (y::real). 0 < 1 + abs y \ (x \ y \ x \ 1 + abs y)") + apply (subgoal_tac "\x (y::real). 0 < 1 + \y\ \ (x \ y \ x \ 1 + \y\)") apply metis apply arith done @@ -5905,7 +5905,7 @@ then obtain e where "e>0" and e:"\x'. dist x' x < e \ x' \ s" using assms(2)[unfolded open_dist, THEN bspec[where x=x]] by auto - have "e * abs c > 0" + have "e * \c\ > 0" using assms(1)[unfolded zero_less_abs_iff[symmetric]] \e>0\ by auto moreover { @@ -5923,7 +5923,7 @@ by auto } ultimately have "\e>0. \x'. dist x' (c *\<^sub>R x) < e \ x' \ op *\<^sub>R c ` s" - apply (rule_tac x="e * abs c" in exI) + apply (rule_tac x="e * \c\" in exI) apply auto done } @@ -6221,22 +6221,22 @@ lemma open_real: fixes s :: "real set" - shows "open s \ (\x \ s. \e>0. \x'. abs(x' - x) < e --> x' \ s)" + shows "open s \ (\x \ s. \e>0. \x'. \x' - x\ < e --> x' \ s)" unfolding open_dist dist_norm by simp lemma islimpt_approachable_real: fixes s :: "real set" - shows "x islimpt s \ (\e>0. \x'\ s. x' \ x \ abs(x' - x) < e)" + shows "x islimpt s \ (\e>0. \x'\ s. x' \ x \ \x' - x\ < e)" unfolding islimpt_approachable dist_norm by simp lemma closed_real: fixes s :: "real set" - shows "closed s \ (\x. (\e>0. \x' \ s. x' \ x \ abs(x' - x) < e) \ x \ s)" + shows "closed s \ (\x. (\e>0. \x' \ s. x' \ x \ \x' - x\ < e) \ x \ s)" unfolding closed_limpt islimpt_approachable dist_norm by simp lemma continuous_at_real_range: fixes f :: "'a::real_normed_vector \ real" - shows "continuous (at x) f \ (\e>0. \d>0. \x'. norm(x' - x) < d --> abs(f x' - f x) < e)" + shows "continuous (at x) f \ (\e>0. \d>0. \x'. norm(x' - x) < d --> \f x' - f x\ < e)" unfolding continuous_at unfolding Lim_at unfolding dist_nz[symmetric] @@ -6255,7 +6255,7 @@ lemma continuous_on_real_range: fixes f :: "'a::real_normed_vector \ real" shows "continuous_on s f \ - (\x \ s. \e>0. \d>0. (\x' \ s. norm(x' - x) < d \ abs(f x' - f x) < e))" + (\x \ s. \e>0. \d>0. (\x' \ s. norm(x' - x) < d \ \f x' - f x\ < e))" unfolding continuous_on_iff dist_norm by simp text \Hence some handy theorems on distance, diameter etc. of/from a set.\ diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/Weierstrass.thy --- a/src/HOL/Multivariate_Analysis/Weierstrass.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Weierstrass.thy Mon Dec 28 01:28:28 2015 +0100 @@ -65,7 +65,7 @@ fixes f :: "real \ real" assumes contf: "continuous_on {0..1} f" and e: "0 < e" shows "\N. \n x. N \ n \ x \ {0..1} - \ abs(f x - (\k = 0..n. f(k/n) * Bernstein n k x)) < e" + \ \f x - (\k = 0..n. f(k/n) * Bernstein n k x)\ < e" proof - have "bounded (f ` {0..1})" using compact_continuous_image compact_imp_bounded contf by blast @@ -110,7 +110,7 @@ assume k: "k \ n" then have kn: "0 \ k / n" "k / n \ 1" by (auto simp: divide_simps) - consider (lessd) "abs(x - k / n) < d" | (ged) "d \ abs(x - k / n)" + consider (lessd) "\x - k / n\ < d" | (ged) "d \ \x - k / n\" by linarith then have "\(f x - f (k/n))\ \ e/2 + 2 * M / d\<^sup>2 * (x - k/n)\<^sup>2" proof cases @@ -758,7 +758,7 @@ "\x y. x \ s \ y \ s \ ~(x = y) \ \f. P(f) \ ~(f x = f y)" "continuous_on s f" "0 < e" - shows "\g. P(g) \ (\x \ s. abs(f x - g x) < e)" + shows "\g. P(g) \ (\x \ s. \f x - g x\ < e)" proof - interpret PR: function_ring_on "Collect P" apply unfold_locales @@ -1081,7 +1081,7 @@ lemma Stone_Weierstrass_real_polynomial_function: fixes f :: "'a::euclidean_space \ real" assumes "compact s" "continuous_on s f" "0 < e" - shows "\g. real_polynomial_function g \ (\x \ s. abs(f x - g x) < e)" + shows "\g. real_polynomial_function g \ (\x \ s. \f x - g x\ < e)" proof - interpret PR: function_ring_on "Collect real_polynomial_function" apply unfold_locales @@ -1102,14 +1102,14 @@ proof - { fix b :: 'b assume "b \ Basis" - have "\p. real_polynomial_function p \ (\x \ s. abs(f x \ b - p x) < e / DIM('b))" + have "\p. real_polynomial_function p \ (\x \ s. \f x \ b - p x\ < e / DIM('b))" apply (rule exE [OF Stone_Weierstrass_real_polynomial_function [OF s _, of "\x. f x \ b" "e / card Basis"]]) using e f apply (auto simp: Euclidean_Space.DIM_positive intro: continuous_intros) done } then obtain pf where pf: - "\b. b \ Basis \ real_polynomial_function (pf b) \ (\x \ s. abs(f x \ b - pf b x) < e / DIM('b))" + "\b. b \ Basis \ real_polynomial_function (pf b) \ (\x \ s. \f x \ b - pf b x\ < e / DIM('b))" apply (rule bchoice [rule_format, THEN exE]) apply assumption apply (force simp add: intro: that) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Multivariate_Analysis/ex/Approximations.thy --- a/src/HOL/Multivariate_Analysis/ex/Approximations.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/ex/Approximations.thy Mon Dec 28 01:28:28 2015 +0100 @@ -24,7 +24,7 @@ qed (*32-bit approximation. SLOW simplification steps: big calculations with the rewriting engine*) -lemma pi_approx_32: "abs(pi - 13493037705/4294967296) \ inverse(2 ^ 32)" +lemma pi_approx_32: "\pi - 13493037705/4294967296\ \ inverse(2 ^ 32)" apply (simp only: abs_diff_le_iff) apply (rule sin_pi6_straddle, simp_all) using Taylor_sin [of "1686629713/3221225472" 11] diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/HLog.thy --- a/src/HOL/NSA/HLog.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/HLog.thy Mon Dec 28 01:28:28 2015 +0100 @@ -117,7 +117,7 @@ lemma hlog_hrabs_HInfinite_Infinitesimal: "[| x : HFinite - Infinitesimal; a : HInfinite; 0 < a |] - ==> hlog a (abs x) : Infinitesimal" + ==> hlog a \x\ : Infinitesimal" apply (frule HInfinite_gt_zero_gt_one) apply (auto intro!: starfun_ln_HFinite_not_Infinitesimal HInfinite_inverse_Infinitesimal Infinitesimal_HFinite_mult2 diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/HSeries.thy --- a/src/HOL/NSA/HSeries.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/HSeries.thy Mon Dec 28 01:28:28 2015 +0100 @@ -68,7 +68,7 @@ lemma sumhr_split_diff: "n

sumhr(0,p,f) - sumhr(0,n,f) = sumhr(n,p,f)" by (drule_tac f = f in sumhr_split_add [symmetric], simp) -lemma sumhr_hrabs: "!!m n. abs(sumhr(m,n,f)) \ sumhr(m,n,%i. abs(f i))" +lemma sumhr_hrabs: "!!m n. \sumhr(m,n,f)\ \ sumhr(m,n,%i. \f i\)" unfolding sumhr_app by transfer (rule setsum_abs) text{* other general version also needed *} @@ -130,7 +130,7 @@ unfolding sumhr_app by transfer (rule refl) lemma sumhr_hrabs_approx [simp]: "sumhr(0, M, f) @= sumhr(0, N, f) - ==> abs (sumhr(M, N, f)) @= 0" + ==> \sumhr(M, N, f)\ @= 0" apply (cut_tac x = M and y = N in linorder_less_linear) apply (auto simp add: approx_refl) apply (drule approx_sym [THEN approx_minus_iff [THEN iffD1]]) @@ -167,7 +167,7 @@ lemma NSsummable_NSCauchy: "NSsummable f = - (\M \ HNatInfinite. \N \ HNatInfinite. abs (sumhr(M,N,f)) @= 0)" + (\M \ HNatInfinite. \N \ HNatInfinite. \sumhr(M,N,f)\ @= 0)" apply (auto simp add: summable_NSsummable_iff [symmetric] summable_iff_convergent convergent_NSconvergent_iff atLeast0LessThan[symmetric] NSCauchy_NSconvergent_iff [symmetric] NSCauchy_def starfunNat_sumr) @@ -189,14 +189,14 @@ text{*Nonstandard comparison test*} lemma NSsummable_comparison_test: - "[| \N. \n. N \ n --> abs(f n) \ g n; NSsummable g |] ==> NSsummable f" + "[| \N. \n. N \ n --> \f n\ \ g n; NSsummable g |] ==> NSsummable f" apply (fold summable_NSsummable_iff) apply (rule summable_comparison_test, simp, assumption) done lemma NSsummable_rabs_comparison_test: - "[| \N. \n. N \ n --> abs(f n) \ g n; NSsummable g |] - ==> NSsummable (%k. abs (f k))" + "[| \N. \n. N \ n --> \f n\ \ g n; NSsummable g |] + ==> NSsummable (%k. \f k\)" apply (rule NSsummable_comparison_test) apply (auto) done diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/HTranscendental.thy --- a/src/HOL/NSA/HTranscendental.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/HTranscendental.thy Mon Dec 28 01:28:28 2015 +0100 @@ -103,14 +103,14 @@ lemma hypreal_sqrt_ge_zero: "0 \ x ==> 0 \ ( *f* sqrt)(x)" by (auto intro: hypreal_sqrt_gt_zero simp add: order_le_less) -lemma hypreal_sqrt_hrabs [simp]: "!!x. ( *f* sqrt)(x\<^sup>2) = abs(x)" +lemma hypreal_sqrt_hrabs [simp]: "!!x. ( *f* sqrt)(x\<^sup>2) = \x\" by (transfer, simp) -lemma hypreal_sqrt_hrabs2 [simp]: "!!x. ( *f* sqrt)(x*x) = abs(x)" +lemma hypreal_sqrt_hrabs2 [simp]: "!!x. ( *f* sqrt)(x*x) = \x\" by (transfer, simp) lemma hypreal_sqrt_hyperpow_hrabs [simp]: - "!!x. ( *f* sqrt)(x pow (hypnat_of_nat 2)) = abs(x)" + "!!x. ( *f* sqrt)(x pow (hypnat_of_nat 2)) = \x\" by (transfer, simp) lemma star_sqrt_HFinite: "\x \ HFinite; 0 \ x\ \ ( *f* sqrt) x \ HFinite" diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/HyperDef.thy --- a/src/HOL/NSA/HyperDef.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/HyperDef.thy Mon Dec 28 01:28:28 2015 +0100 @@ -216,8 +216,7 @@ lemma star_n_one_num: "1 = star_n (%n. 1)" by (simp only: star_one_def star_of_def) -lemma star_n_abs: - "abs (star_n X) = star_n (%n. abs (X n))" +lemma star_n_abs: "\star_n X\ = star_n (%n. \X n\)" by (simp only: star_abs_def starfun_star_n) lemma hypreal_omega_gt_zero [simp]: "0 < omega" @@ -280,17 +279,16 @@ subsection{*Absolute Value Function for the Hyperreals*} -lemma hrabs_add_less: - "[| abs x < r; abs y < s |] ==> abs(x+y) < r + (s::hypreal)" +lemma hrabs_add_less: "[| \x\ < r; \y\ < s |] ==> \x + y\ < r + (s::hypreal)" by (simp add: abs_if split: split_if_asm) -lemma hrabs_less_gt_zero: "abs x < r ==> (0::hypreal) < r" +lemma hrabs_less_gt_zero: "\x\ < r ==> (0::hypreal) < r" by (blast intro!: order_le_less_trans abs_ge_zero) -lemma hrabs_disj: "abs x = (x::'a::abs_if) | abs x = -x" +lemma hrabs_disj: "\x\ = (x::'a::abs_if) \ \x\ = -x" by (simp add: abs_if) -lemma hrabs_add_lemma_disj: "(y::hypreal) + - x + (y + - z) = abs (x + - z) ==> y = z | x = y" +lemma hrabs_add_lemma_disj: "(y::hypreal) + - x + (y + - z) = \x + - z\ ==> y = z | x = y" by (simp add: abs_if split add: split_if_asm) @@ -364,8 +362,7 @@ (*FIXME: This and RealPow.abs_realpow_two should be replaced by an abstract result proved in Rings or Fields*) -lemma hrabs_hrealpow_two [simp]: - "abs(x ^ Suc (Suc 0)) = (x::hypreal) ^ Suc (Suc 0)" +lemma hrabs_hrealpow_two [simp]: "\x ^ Suc (Suc 0)\ = (x::hypreal) ^ Suc (Suc 0)" by (simp add: abs_mult) lemma two_hrealpow_ge_one [simp]: "(1::hypreal) \ 2 ^ n" @@ -427,7 +424,7 @@ by transfer (rule power_inverse [symmetric]) lemma hyperpow_hrabs: - "\r n. abs (r::'a::{linordered_idom} star) pow n = abs (r pow n)" + "\r n. \r::'a::{linordered_idom} star\ pow n = \r pow n\" by transfer (rule power_abs [symmetric]) lemma hyperpow_add: @@ -460,7 +457,7 @@ by transfer (rule power_one) lemma hrabs_hyperpow_minus [simp]: - "\(a::'a::{linordered_idom} star) n. abs((-a) pow n) = abs (a pow n)" + "\(a::'a::{linordered_idom} star) n. \(-a) pow n\ = \a pow n\" by transfer (rule abs_power_minus) lemma hyperpow_mult: @@ -473,12 +470,12 @@ by (auto simp add: hyperpow_two zero_le_mult_iff) lemma hrabs_hyperpow_two [simp]: - "abs(x pow 2) = + "\x pow 2\ = (x::'a::{monoid_mult,linordered_ring_strict} star) pow 2" by (simp only: abs_of_nonneg hyperpow_two_le) lemma hyperpow_two_hrabs [simp]: - "abs(x::'a::{linordered_idom} star) pow 2 = x pow 2" + "\x::'a::{linordered_idom} star\ pow 2 = x pow 2" by (simp add: hyperpow_hrabs) text{*The precondition could be weakened to @{term "0\x"}*} diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/NSA.thy --- a/src/HOL/NSA/NSA.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/NSA.thy Mon Dec 28 01:28:28 2015 +0100 @@ -181,7 +181,7 @@ lemma Reals_add_cancel: "\x + y \ \; y \ \\ \ x \ \" by (drule (1) Reals_diff, simp) -lemma SReal_hrabs: "(x::hypreal) \ \ ==> abs x \ \" +lemma SReal_hrabs: "(x::hypreal) \ \ ==> \x\ \ \" by (simp add: Reals_eq_Standard) lemma SReal_hypreal_of_real [simp]: "hypreal_of_real x \ \" @@ -280,7 +280,7 @@ lemma HFiniteD: "x \ HFinite ==> \t \ Reals. hnorm x < t" by (simp add: HFinite_def) -lemma HFinite_hrabs_iff [iff]: "(abs (x::hypreal) \ HFinite) = (x \ HFinite)" +lemma HFinite_hrabs_iff [iff]: "(\x::hypreal\ \ HFinite) = (x \ HFinite)" by (simp add: HFinite_def) lemma HFinite_hnorm_iff [iff]: @@ -355,7 +355,7 @@ by (simp add: Infinitesimal_def) lemma Infinitesimal_hrabs_iff [iff]: - "(abs (x::hypreal) \ Infinitesimal) = (x \ Infinitesimal)" + "(\x::hypreal\ \ Infinitesimal) = (x \ Infinitesimal)" by (simp add: abs_if) lemma Infinitesimal_of_hypreal_iff [simp]: @@ -509,7 +509,7 @@ by auto lemma HFinite_diff_Infinitesimal_hrabs: - "(x::hypreal) \ HFinite - Infinitesimal ==> abs x \ HFinite - Infinitesimal" + "(x::hypreal) \ HFinite - Infinitesimal ==> \x\ \ HFinite - Infinitesimal" by blast lemma hnorm_le_Infinitesimal: @@ -521,11 +521,11 @@ by (erule hnorm_le_Infinitesimal, erule order_less_imp_le) lemma hrabs_le_Infinitesimal: - "[| e \ Infinitesimal; abs (x::hypreal) \ e |] ==> x \ Infinitesimal" + "[| e \ Infinitesimal; \x::hypreal\ \ e |] ==> x \ Infinitesimal" by (erule hnorm_le_Infinitesimal, simp) lemma hrabs_less_Infinitesimal: - "[| e \ Infinitesimal; abs (x::hypreal) < e |] ==> x \ Infinitesimal" + "[| e \ Infinitesimal; \x::hypreal\ < e |] ==> x \ Infinitesimal" by (erule hnorm_less_Infinitesimal, simp) lemma Infinitesimal_interval: @@ -540,7 +540,7 @@ lemma lemma_Infinitesimal_hyperpow: - "[| (x::hypreal) \ Infinitesimal; 0 < N |] ==> abs (x pow N) \ abs x" + "[| (x::hypreal) \ Infinitesimal; 0 < N |] ==> \x pow N\ \ \x\" apply (unfold Infinitesimal_def) apply (auto intro!: hyperpow_Suc_le_self2 simp add: hyperpow_hrabs [symmetric] hypnat_gt_zero_iff2 abs_ge_zero) @@ -1239,7 +1239,7 @@ "[| (x::hypreal) \ HFinite; isLub \ {s. s \ \ & s < x} t; r \ \; 0 < r |] - ==> abs (x - t) < r" + ==> \x - t\ < r" apply (frule lemma_st_part1a) apply (frule_tac [4] lemma_st_part2a, auto) apply (drule order_le_imp_less_or_eq)+ @@ -1250,7 +1250,7 @@ lemma lemma_st_part_major2: "[| (x::hypreal) \ HFinite; isLub \ {s. s \ \ & s < x} t |] - ==> \r \ Reals. 0 < r --> abs (x - t) < r" + ==> \r \ Reals. 0 < r --> \x - t\ < r" by (blast dest!: lemma_st_part_major) @@ -1258,7 +1258,7 @@ text{*Existence of real and Standard Part Theorem*} lemma lemma_st_part_Ex: "(x::hypreal) \ HFinite - ==> \t \ Reals. \r \ Reals. 0 < r --> abs (x - t) < r" + ==> \t \ Reals. \r \ Reals. 0 < r --> \x - t\ < r" apply (frule lemma_st_part_lub, safe) apply (frule isLubD1a) apply (blast dest: lemma_st_part_major2) @@ -1483,13 +1483,13 @@ apply (simp (no_asm) add: HInfinite_HFinite_iff) done -lemma approx_hrabs_disj: "abs (x::hypreal) @= x | abs x @= -x" +lemma approx_hrabs_disj: "\x::hypreal\ @= x \ \x\ @= -x" by (cut_tac x = x in hrabs_disj, auto) subsection{*Theorems about Monads*} -lemma monad_hrabs_Un_subset: "monad (abs x) \ monad(x::hypreal) Un monad(-x)" +lemma monad_hrabs_Un_subset: "monad \x\ \ monad(x::hypreal) Un monad(-x)" by (rule_tac x1 = x in hrabs_disj [THEN disjE], auto) lemma Infinitesimal_monad_eq: "e \ Infinitesimal ==> monad (x+e) = monad x" @@ -1505,7 +1505,7 @@ apply (simp (no_asm) add: Infinitesimal_monad_zero_iff [symmetric]) done -lemma monad_zero_hrabs_iff: "((x::hypreal) \ monad 0) = (abs x \ monad 0)" +lemma monad_zero_hrabs_iff: "((x::hypreal) \ monad 0) = (\x\ \ monad 0)" apply (rule_tac x1 = x in hrabs_disj [THEN disjE]) apply (auto simp add: monad_zero_minus_iff [symmetric]) done @@ -1543,7 +1543,7 @@ done lemma Infinitesimal_approx_hrabs: - "[| x @= y; (x::hypreal) \ Infinitesimal |] ==> abs x @= abs y" + "[| x @= y; (x::hypreal) \ Infinitesimal |] ==> \x\ @= \y\" apply (drule Infinitesimal_monad_zero_iff [THEN iffD1]) apply (blast intro: approx_mem_monad_zero monad_zero_hrabs_iff [THEN iffD1] mem_monad_approx approx_trans3) done @@ -1577,25 +1577,25 @@ "[|(x::hypreal) < 0; x \ Infinitesimal; x @= y|] ==> y < 0" by (blast dest: Ball_mem_monad_less_zero approx_subset_monad) -theorem approx_hrabs: "(x::hypreal) @= y ==> abs x @= abs y" +theorem approx_hrabs: "(x::hypreal) @= y ==> \x\ @= \y\" by (drule approx_hnorm, simp) -lemma approx_hrabs_zero_cancel: "abs(x::hypreal) @= 0 ==> x @= 0" +lemma approx_hrabs_zero_cancel: "\x::hypreal\ @= 0 ==> x @= 0" apply (cut_tac x = x in hrabs_disj) apply (auto dest: approx_minus) done lemma approx_hrabs_add_Infinitesimal: - "(e::hypreal) \ Infinitesimal ==> abs x @= abs(x+e)" + "(e::hypreal) \ Infinitesimal ==> \x\ @= \x + e\" by (fast intro: approx_hrabs Infinitesimal_add_approx_self) lemma approx_hrabs_add_minus_Infinitesimal: - "(e::hypreal) \ Infinitesimal ==> abs x @= abs(x + -e)" + "(e::hypreal) \ Infinitesimal ==> \x\ @= \x + -e\" by (fast intro: approx_hrabs Infinitesimal_add_minus_approx_self) lemma hrabs_add_Infinitesimal_cancel: "[| (e::hypreal) \ Infinitesimal; e' \ Infinitesimal; - abs(x+e) = abs(y+e')|] ==> abs x @= abs y" + \x + e\ = \y + e'\|] ==> \x\ @= \y\" apply (drule_tac x = x in approx_hrabs_add_Infinitesimal) apply (drule_tac x = y in approx_hrabs_add_Infinitesimal) apply (auto intro: approx_trans2) @@ -1603,7 +1603,7 @@ lemma hrabs_add_minus_Infinitesimal_cancel: "[| (e::hypreal) \ Infinitesimal; e' \ Infinitesimal; - abs(x + -e) = abs(y + -e')|] ==> abs x @= abs y" + \x + -e\ = \y + -e'\|] ==> \x\ @= \y\" apply (drule_tac x = x in approx_hrabs_add_minus_Infinitesimal) apply (drule_tac x = y in approx_hrabs_add_minus_Infinitesimal) apply (auto intro: approx_trans2) @@ -1623,8 +1623,8 @@ done lemma Infinitesimal_add_hrabs_hypreal_of_real_less: - "[| x \ Infinitesimal; abs(hypreal_of_real r) < hypreal_of_real y |] - ==> abs (hypreal_of_real r + x) < hypreal_of_real y" + "[| x \ Infinitesimal; \hypreal_of_real r\ < hypreal_of_real y |] + ==> \hypreal_of_real r + x\ < hypreal_of_real y" apply (drule_tac x = "hypreal_of_real r" in approx_hrabs_add_Infinitesimal) apply (drule approx_sym [THEN bex_Infinitesimal_iff2 [THEN iffD2]]) apply (auto intro!: Infinitesimal_add_hypreal_of_real_less @@ -1633,8 +1633,8 @@ done lemma Infinitesimal_add_hrabs_hypreal_of_real_less2: - "[| x \ Infinitesimal; abs(hypreal_of_real r) < hypreal_of_real y |] - ==> abs (x + hypreal_of_real r) < hypreal_of_real y" + "[| x \ Infinitesimal; \hypreal_of_real r\ < hypreal_of_real y |] + ==> \x + hypreal_of_real r\ < hypreal_of_real y" apply (rule add.commute [THEN subst]) apply (erule Infinitesimal_add_hrabs_hypreal_of_real_less, assumption) done @@ -1738,7 +1738,7 @@ lemma monad_hrabs_less: "[| y \ monad x; 0 < hypreal_of_real e |] - ==> abs (y - x) < hypreal_of_real e" + ==> \y - x\ < hypreal_of_real e" apply (drule mem_monad_approx [THEN approx_sym]) apply (drule bex_Infinitesimal_iff [THEN iffD2]) apply (auto dest!: InfinitesimalD) @@ -1901,7 +1901,7 @@ apply (rule st_le, auto) done -lemma st_hrabs: "x \ HFinite ==> abs(st x) = st(abs x)" +lemma st_hrabs: "x \ HFinite ==> \st x\ = st \x\" apply (simp add: linorder_not_le st_zero_le abs_if st_minus linorder_not_less) apply (auto dest!: st_zero_ge [OF order_less_imp_le]) @@ -2077,12 +2077,12 @@ lemma finite_real_of_nat_le_real: "finite {n::nat. real n \ u}" by (auto simp add: lemma_real_le_Un_eq lemma_finite_omega_set finite_real_of_nat_less_real) -lemma finite_rabs_real_of_nat_le_real: "finite {n::nat. abs(real n) \ u}" +lemma finite_rabs_real_of_nat_le_real: "finite {n::nat. \real n\ \ u}" apply (simp (no_asm) add: finite_real_of_nat_le_real) done lemma rabs_real_of_nat_le_real_FreeUltrafilterNat: - "\ eventually (\n. abs(real n) \ u) FreeUltrafilterNat" + "\ eventually (\n. \real n\ \ u) FreeUltrafilterNat" by (blast intro!: FreeUltrafilterNat.finite finite_rabs_real_of_nat_le_real) lemma FreeUltrafilterNat_nat_gt_real: "eventually (\n. u < real n) FreeUltrafilterNat" @@ -2092,8 +2092,8 @@ done (*-------------------------------------------------------------- - The complement of {n. abs(real n) \ u} = - {n. u < abs (real n)} is in FreeUltrafilterNat + The complement of {n. \real n\ \ u} = + {n. u < \real n\} is in FreeUltrafilterNat by property of (free) ultrafilters --------------------------------------------------------------*) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/NSComplex.thy --- a/src/HOL/NSA/NSComplex.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/NSComplex.thy Mon Dec 28 01:28:28 2015 +0100 @@ -228,8 +228,8 @@ subsection{*Modulus (Absolute Value) of Nonstandard Complex Number*} lemma hcomplex_of_hypreal_abs: - "hcomplex_of_hypreal (abs x) = - hcomplex_of_hypreal(hcmod(hcomplex_of_hypreal x))" + "hcomplex_of_hypreal \x\ = + hcomplex_of_hypreal (hcmod (hcomplex_of_hypreal x))" by simp lemma HComplex_inject [simp]: @@ -447,10 +447,10 @@ "!!y. hIm (iii * hcomplex_of_hypreal y) = y" by transfer simp -lemma hcmod_mult_i [simp]: "!!y. hcmod (iii * hcomplex_of_hypreal y) = abs y" +lemma hcmod_mult_i [simp]: "!!y. hcmod (iii * hcomplex_of_hypreal y) = \y\" by transfer (simp add: norm_complex_def) -lemma hcmod_mult_i2 [simp]: "!!y. hcmod (hcomplex_of_hypreal y * iii) = abs y" +lemma hcmod_mult_i2 [simp]: "!!y. hcmod (hcomplex_of_hypreal y * iii) = \y\" by transfer (simp add: norm_complex_def) (*---------------------------------------------------------------------------*) @@ -506,11 +506,10 @@ by transfer (simp add: cmod_unit_one) lemma hcmod_complex_polar [simp]: - "!!r a. hcmod (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = - abs r" + "!!r a. hcmod (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = \r\" by transfer (simp add: cmod_complex_polar) -lemma hcmod_hrcis [simp]: "!!r a. hcmod(hrcis r a) = abs r" +lemma hcmod_hrcis [simp]: "!!r a. hcmod(hrcis r a) = \r\" by transfer (rule complex_mod_rcis) (*---------------------------------------------------------------------------*) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/NatStar.thy --- a/src/HOL/NSA/NatStar.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/NatStar.thy Mon Dec 28 01:28:28 2015 +0100 @@ -96,7 +96,7 @@ text{*Nonstandard extension with absolute value*} -lemma starfun_abs: "!!N. ( *f* (%n. abs (f n))) N = abs(( *f* f) N)" +lemma starfun_abs: "!!N. ( *f* (%n. \f n\)) N = \( *f* f) N\" by (transfer, rule refl) text{*The hyperpow function as a nonstandard extension of realpow*} diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/Star.thy --- a/src/HOL/NSA/Star.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/Star.thy Mon Dec 28 01:28:28 2015 +0100 @@ -282,8 +282,7 @@ text{*Alternative definition for hrabs with rabs function applied entrywise to equivalence class representative. This is easily proved using starfun and ns extension thm*} -lemma hypreal_hrabs: - "abs (star_n X) = star_n (%n. abs (X n))" +lemma hypreal_hrabs: "\star_n X\ = star_n (%n. \X n\)" by (simp only: starfun_rabs_hrabs [symmetric] starfun) text{*nonstandard extension of set through nonstandard extension @@ -291,13 +290,12 @@ where we replace rabs by some arbitrary function f and hrabs by its NS extenson. See second NS set extension below.*} lemma STAR_rabs_add_minus: - "*s* {x. abs (x + - y) < r} = - {x. abs(x + -star_of y) < star_of r}" + "*s* {x. \x + - y\ < r} = {x. \x + -star_of y\ < star_of r}" by (transfer, rule refl) lemma STAR_starfun_rabs_add_minus: - "*s* {x. abs (f x + - y) < r} = - {x. abs(( *f* f) x + -star_of y) < star_of r}" + "*s* {x. \f x + - y\ < r} = + {x. \( *f* f) x + -star_of y\ < star_of r}" by (transfer, rule refl) text{*Another characterization of Infinitesimal and one of @= relation. diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/NSA/StarDef.thy --- a/src/HOL/NSA/StarDef.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/NSA/StarDef.thy Mon Dec 28 01:28:28 2015 +0100 @@ -583,7 +583,7 @@ lemma Standard_inverse: "x \ Standard \ inverse x \ Standard" by (simp add: star_inverse_def) -lemma Standard_abs: "x \ Standard \ abs x \ Standard" +lemma Standard_abs: "x \ Standard \ \x\ \ Standard" by (simp add: star_abs_def) lemma Standard_mod: "\x \ Standard; y \ Standard\ \ x mod y \ Standard" @@ -618,7 +618,7 @@ lemma star_of_mod: "star_of (x mod y) = star_of x mod star_of y" by transfer (rule refl) -lemma star_of_abs: "star_of (abs x) = abs (star_of x)" +lemma star_of_abs: "star_of \x\ = \star_of x\" by transfer (rule refl) text {* @{term star_of} preserves numerals *} diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Old_Number_Theory/EulerFermat.thy --- a/src/HOL/Old_Number_Theory/EulerFermat.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Old_Number_Theory/EulerFermat.thy Mon Dec 28 01:28:28 2015 +0100 @@ -53,7 +53,7 @@ definition zcongm :: "int => int => int => bool" where "zcongm m = (\a b. zcong a b m)" -lemma abs_eq_1_iff [iff]: "(abs z = (1::int)) = (z = 1 \ z = -1)" +lemma abs_eq_1_iff [iff]: "(\z\ = (1::int)) = (z = 1 \ z = -1)" -- \LCP: not sure why this lemma is needed now\ by (auto simp add: abs_if) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Old_Number_Theory/Legacy_GCD.thy --- a/src/HOL/Old_Number_Theory/Legacy_GCD.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Old_Number_Theory/Legacy_GCD.thy Mon Dec 28 01:28:28 2015 +0100 @@ -566,7 +566,7 @@ definition zgcd :: "int \ int \ int" where - "zgcd i j = int (gcd (nat (abs i)) (nat (abs j)))" + "zgcd i j = int (gcd (nat \i\) (nat \j\))" lemma zgcd_zdvd1 [iff, algebra]: "zgcd i j dvd i" by (simp add: zgcd_def int_dvd_iff) @@ -611,7 +611,7 @@ done qed -lemma int_nat_abs: "int (nat (abs x)) = abs x" by arith +lemma int_nat_abs: "int (nat \x\) = \x\" by arith lemma zgcd_greatest: assumes "k dvd m" and "k dvd n" @@ -654,10 +654,10 @@ with zgcd_pos show "?g' = 1" by simp qed -lemma zgcd_0 [simp, algebra]: "zgcd m 0 = abs m" +lemma zgcd_0 [simp, algebra]: "zgcd m 0 = \m\" by (simp add: zgcd_def abs_if) -lemma zgcd_0_left [simp, algebra]: "zgcd 0 m = abs m" +lemma zgcd_0_left [simp, algebra]: "zgcd 0 m = \m\" by (simp add: zgcd_def abs_if) lemma zgcd_non_0: "0 < n ==> zgcd m n = zgcd n (m mod n)" @@ -704,7 +704,7 @@ add: minus_mult_right nat_mult_distrib zgcd_def abs_if mult_less_0_iff gcd_mult_distrib2 [symmetric] of_nat_mult) -lemma zgcd_zmult_distrib2_abs: "zgcd (k * m) (k * n) = abs k * zgcd m n" +lemma zgcd_zmult_distrib2_abs: "zgcd (k * m) (k * n) = \k\ * zgcd m n" by (simp add: abs_if zgcd_zmult_distrib2) lemma zgcd_self [simp]: "0 \ m ==> zgcd m m = m" @@ -717,7 +717,7 @@ by (cut_tac k = k and m = n and n = 1 in zgcd_zmult_distrib2, simp_all) -definition "zlcm i j = int (lcm(nat(abs i)) (nat(abs j)))" +definition "zlcm i j = int (lcm (nat \i\) (nat \j\))" lemma dvd_zlcm_self1[simp, algebra]: "i dvd zlcm i j" by(simp add:zlcm_def dvd_int_iff) @@ -729,7 +729,7 @@ lemma dvd_imp_dvd_zlcm1: assumes "k dvd i" shows "k dvd (zlcm i j)" proof - - have "nat(abs k) dvd nat(abs i)" using \k dvd i\ + have "nat \k\ dvd nat \i\" using \k dvd i\ by(simp add:int_dvd_iff[symmetric] dvd_int_iff[symmetric]) thus ?thesis by(simp add:zlcm_def dvd_int_iff)(blast intro: dvd_trans) qed @@ -737,16 +737,16 @@ lemma dvd_imp_dvd_zlcm2: assumes "k dvd j" shows "k dvd (zlcm i j)" proof - - have "nat(abs k) dvd nat(abs j)" using \k dvd j\ + have "nat \k\ dvd nat \j\" using \k dvd j\ by(simp add:int_dvd_iff[symmetric] dvd_int_iff[symmetric]) thus ?thesis by(simp add:zlcm_def dvd_int_iff)(blast intro: dvd_trans) qed -lemma zdvd_self_abs1: "(d::int) dvd (abs d)" +lemma zdvd_self_abs1: "(d::int) dvd \d\" by (case_tac "d <0", simp_all) -lemma zdvd_self_abs2: "(abs (d::int)) dvd d" +lemma zdvd_self_abs2: "\d::int\ dvd d" by (case_tac "d<0", simp_all) (* lcm a b is positive for positive a and b *) @@ -776,8 +776,8 @@ and bnz: "b \ 0" shows "0 < zlcm a b" proof- - let ?na = "nat (abs a)" - let ?nb = "nat (abs b)" + let ?na = "nat \a\" + let ?nb = "nat \b\" have nap: "?na >0" using anz by simp have nbp: "?nb >0" using bnz by simp have "0 < lcm ?na ?nb" by (rule lcm_pos[OF nap nbp]) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Probability/Bochner_Integration.thy --- a/src/HOL/Probability/Bochner_Integration.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Probability/Bochner_Integration.thy Mon Dec 28 01:28:28 2015 +0100 @@ -2352,7 +2352,7 @@ lemma integral_0_iff: fixes f :: "'a \ real" - shows "integrable M f \ (\x. abs (f x) \M) = 0 \ emeasure M {x\space M. f x \ 0} = 0" + shows "integrable M f \ (\x. \f x\ \M) = 0 \ emeasure M {x\space M. f x \ 0} = 0" using integral_norm_eq_0_iff[of M f] by simp lemma (in finite_measure) integrable_const[intro!, simp]: "integrable M (\x. a)" diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Probability/Interval_Integral.thy --- a/src/HOL/Probability/Interval_Integral.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Probability/Interval_Integral.thy Mon Dec 28 01:28:28 2015 +0100 @@ -1087,7 +1087,7 @@ lemma interval_integral_norm2: "interval_lebesgue_integrable lborel a b f \ - norm (LBINT t=a..b. f t) \ abs (LBINT t=a..b. norm (f t))" + norm (LBINT t=a..b. f t) \ \LBINT t=a..b. norm (f t)\" proof (induct a b rule: linorder_wlog) case (sym a b) then show ?case by (simp add: interval_integral_endpoints_reverse[of a b] interval_integrable_endpoints_reverse[of a b]) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Probability/Lebesgue_Measure.thy --- a/src/HOL/Probability/Lebesgue_Measure.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Probability/Lebesgue_Measure.thy Mon Dec 28 01:28:28 2015 +0100 @@ -695,13 +695,13 @@ lemma lborel_distr_mult': assumes "(c::real) \ 0" - shows "lborel = density (distr lborel borel (op * c)) (\_. abs c)" + shows "lborel = density (distr lborel borel (op * c)) (\_. \c\)" proof- have "lborel = density lborel (\_. 1)" by (rule density_1[symmetric]) - also from assms have "(\_. 1 :: ereal) = (\_. inverse (abs c) * abs c)" by (intro ext) simp - also have "density lborel ... = density (density lborel (\_. inverse (abs c))) (\_. abs c)" + also from assms have "(\_. 1 :: ereal) = (\_. inverse \c\ * \c\)" by (intro ext) simp + also have "density lborel ... = density (density lborel (\_. inverse \c\)) (\_. \c\)" by (subst density_density_eq) auto - also from assms have "density lborel (\_. inverse (abs c)) = distr lborel borel (op * c)" + also from assms have "density lborel (\_. inverse \c\) = distr lborel borel (op * c)" by (rule lborel_distr_mult[symmetric]) finally show ?thesis . qed diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Probability/Set_Integral.thy --- a/src/HOL/Probability/Set_Integral.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Probability/Set_Integral.thy Mon Dec 28 01:28:28 2015 +0100 @@ -65,7 +65,7 @@ *) (* -lemma indicator_abs_eq: "\A x. abs (indicator A x) = ((indicator A x) :: real)" +lemma indicator_abs_eq: "\A x. \indicator A x\ = ((indicator A x) :: real)" by (auto simp add: indicator_def) *) @@ -517,7 +517,7 @@ "CLINT x:A|M. f" == "CONST complex_set_lebesgue_integral M A (\x. f)" (* -lemma cmod_mult: "cmod ((a :: real) * (x :: complex)) = abs a * cmod x" +lemma cmod_mult: "cmod ((a :: real) * (x :: complex)) = \a\ * cmod x" apply (simp add: norm_mult) by (subst norm_mult, auto) *) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/SMT_Examples/SMT_Examples.thy --- a/src/HOL/SMT_Examples/SMT_Examples.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/SMT_Examples/SMT_Examples.thy Mon Dec 28 01:28:28 2015 +0100 @@ -258,7 +258,7 @@ lemma "(3 :: int) + 1 = 4" by smt lemma "x + (y + z) = y + (z + (x::int))" by smt lemma "max (3::int) 8 > 5" by smt -lemma "abs (x :: real) + abs y \ abs (x + y)" by smt +lemma "\x :: real\ + \y\ \ \x + y\" by smt lemma "P ((2::int) < 3) = P True" by smt lemma "x + 3 \ 4 \ x < (1::int)" by smt @@ -303,9 +303,9 @@ processor. *} -lemma "\ x3 = abs x2 - x1; x4 = abs x3 - x2; x5 = abs x4 - x3; - x6 = abs x5 - x4; x7 = abs x6 - x5; x8 = abs x7 - x6; - x9 = abs x8 - x7; x10 = abs x9 - x8; x11 = abs x10 - x9 \ +lemma "\ x3 = \x2\ - x1; x4 = \x3\ - x2; x5 = \x4\ - x3; + x6 = \x5\ - x4; x7 = \x6\ - x5; x8 = \x7\ - x6; + x9 = \x8\ - x7; x10 = \x9\ - x8; x11 = \x10\ - x9 \ \ x1 = x10 \ x2 = (x11::int)" by smt @@ -320,7 +320,7 @@ lemma assumes "x \ (0::real)" - shows "x + x \ (let P = (abs x > 1) in if P \ \ P then 4 else 2) * x" + shows "x + x \ (let P = (\x\ > 1) in if P \ \ P then 4 else 2) * x" using assms [[z3_extensions]] by smt diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/SMT_Examples/SMT_Tests.thy --- a/src/HOL/SMT_Examples/SMT_Tests.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/SMT_Examples/SMT_Tests.thy Mon Dec 28 01:28:28 2015 +0100 @@ -336,11 +336,11 @@ by smt+ lemma - "abs (x::int) \ 0" - "(abs x = 0) = (x = 0)" - "(x \ 0) = (abs x = x)" - "(x \ 0) = (abs x = -x)" - "abs (abs x) = abs x" + "\x::int\ \ 0" + "(\x\ = 0) = (x = 0)" + "(x \ 0) = (\x\ = x)" + "(x \ 0) = (\x\ = -x)" + "\\x\\ = \x\" by smt+ lemma @@ -349,7 +349,7 @@ "z < x \ z < y \ z < min x y" "min x y = min y x" "x \ 0 \ min x 0 = 0" - "min x y \ abs (x + y)" + "min x y \ \x + y\" by smt+ lemma @@ -358,7 +358,7 @@ "z > x \ z > y \ z > max x y" "max x y = max y x" "x \ 0 \ max x 0 = x" - "max x y \ - abs x - abs y" + "max x y \ - \x\ - \y\" by smt+ lemma @@ -448,11 +448,11 @@ by smt+ lemma - "abs (x::real) \ 0" - "(abs x = 0) = (x = 0)" - "(x \ 0) = (abs x = x)" - "(x \ 0) = (abs x = -x)" - "abs (abs x) = abs x" + "\x::real\ \ 0" + "(\x\ = 0) = (x = 0)" + "(x \ 0) = (\x\ = x)" + "(x \ 0) = (\x\ = -x)" + "\\x\\ = \x\" by smt+ lemma @@ -461,7 +461,7 @@ "z < x \ z < y \ z < min x y" "min x y = min y x" "x \ 0 \ min x 0 = 0" - "min x y \ abs (x + y)" + "min x y \ \x + y\" by smt+ lemma @@ -470,7 +470,7 @@ "z > x \ z > y \ z > max x y" "max x y = max y x" "x \ 0 \ max x 0 = x" - "max x y \ - abs x - abs y" + "max x y \ - \x\ - \y\" by smt+ lemma diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/Word/Bit_Representation.thy --- a/src/HOL/Word/Bit_Representation.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/Word/Bit_Representation.thy Mon Dec 28 01:28:28 2015 +0100 @@ -172,7 +172,7 @@ lemma bin_abs_lem: "bin = (w BIT b) ==> bin ~= -1 --> bin ~= 0 --> - nat (abs w) < nat (abs bin)" + nat \w\ < nat \bin\" apply clarsimp apply (unfold Bit_def) apply (cases b) diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/ex/Arith_Examples.thy --- a/src/HOL/ex/Arith_Examples.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/ex/Arith_Examples.thy Mon Dec 28 01:28:28 2015 +0100 @@ -63,13 +63,13 @@ lemma "(i::int) < j ==> min i j < max i j" by linarith -lemma "(0::int) <= abs i" +lemma "(0::int) <= \i\" by linarith -lemma "(i::int) <= abs i" +lemma "(i::int) <= \i\" by linarith -lemma "abs (abs (i::int)) = abs i" +lemma "\\i::int\\ = \i\" by linarith text \Also testing subgoals with bound variables.\ @@ -127,7 +127,7 @@ lemma "-(i::int) * 1 = 0 ==> i = 0" by linarith -lemma "[| (0::int) < abs i; abs i * 1 < abs i * j |] ==> 1 < abs i * j" +lemma "[| (0::int) < \i\; \i\ * 1 < \i\ * j |] ==> 1 < \i\ * j" by linarith @@ -227,13 +227,13 @@ text \Splitting of inequalities of different type.\ lemma "[| (a::nat) ~= b; (i::int) ~= j; a < 2; b < 2 |] ==> - a + b <= nat (max (abs i) (abs j))" + a + b <= nat (max \i\ \j\)" by linarith text \Again, but different order.\ lemma "[| (i::int) ~= j; (a::nat) ~= b; a < 2; b < 2 |] ==> - a + b <= nat (max (abs i) (abs j))" + a + b <= nat (max \i\ \j\)" by linarith end diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/ex/Dedekind_Real.thy --- a/src/HOL/ex/Dedekind_Real.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/ex/Dedekind_Real.thy Mon Dec 28 01:28:28 2015 +0100 @@ -1231,7 +1231,7 @@ real_less_def: "x < (y::real) \ x \ y \ x \ y" definition - real_abs_def: "abs (r::real) = (if r < 0 then - r else r)" + real_abs_def: "\r::real\ = (if r < 0 then - r else r)" definition real_sgn_def: "sgn (x::real) = (if x=0 then 0 else if 0(-4::int) + 2 * 1\ = 2" by normalization lemma "(2::int) + 3 = 5" by normalization lemma "(2::int) + 3 * (- 4) * (- 1) = 14" by normalization lemma "(2::int) + 3 * (- 4) * 1 + 0 = -10" by normalization lemma "(2::int) < 3" by normalization lemma "(2::int) <= 3" by normalization -lemma "abs ((-4::int) + 2 * 1) = 2" by normalization -lemma "4 - 42 * abs (3 + (-7::int)) = -164" by normalization +lemma "\(-4::int) + 2 * 1\ = 2" by normalization +lemma "4 - 42 * \3 + (-7::int)\ = -164" by normalization lemma "(if (0::nat) \ (x::nat) then 0::nat else x) = 0" by normalization lemma "4 = Suc (Suc (Suc (Suc 0)))" by normalization lemma "nat 4 = Suc (Suc (Suc (Suc 0)))" by normalization diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/ex/PresburgerEx.thy --- a/src/HOL/ex/PresburgerEx.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/ex/PresburgerEx.thy Mon Dec 28 01:28:28 2015 +0100 @@ -100,9 +100,9 @@ Warning: it takes (in 2006) over 4.2 minutes!\ -lemma "\ x3 = abs x2 - x1; x4 = abs x3 - x2; x5 = abs x4 - x3; - x6 = abs x5 - x4; x7 = abs x6 - x5; x8 = abs x7 - x6; - x9 = abs x8 - x7; x10 = abs x9 - x8; x11 = abs x10 - x9 \ +lemma "\ x3 = \x2\ - x1; x4 = \x3\ - x2; x5 = \x4\ - x3; + x6 = \x5\ - x4; x7 = \x6\ - x5; x8 = \x7\ - x6; + x9 = \x8\ - x7; x10 = \x9\ - x8; x11 = \x10\ - x9 \ \ x1 = x10 & x2 = (x11::int)" by arith diff -r 5d06ecfdb472 -r 1135b8de26c3 src/HOL/ex/Set_Theory.thy --- a/src/HOL/ex/Set_Theory.thy Mon Dec 28 01:26:34 2015 +0100 +++ b/src/HOL/ex/Set_Theory.thy Mon Dec 28 01:28:28 2015 +0100 @@ -193,8 +193,8 @@ \ \Example 7.\ by force -lemma "(\u v. u < (0::int) \ u \ abs v) - \ (\A::int set. -2 \ A & (\y. abs y \ A))" +lemma "(\u v. u < (0::int) \ u \ \v\) + \ (\A::int set. -2 \ A & (\y. \y\ \ A))" \ \Example 8 needs a small hint.\ by force \ \not \blast\, which can't simplify \-2 < 0\\