# HG changeset patch # User huffman # Date 1243314899 25200 # Node ID d54dc8956d486f67459e29c22f47a171e74509fc # Parent 5155117f9d668740cc4b6742f44e8d8cc093b524 use interval sets with gauge predicate diff -r 5155117f9d66 -r d54dc8956d48 src/HOL/Integration.thy --- a/src/HOL/Integration.thy Mon May 25 21:55:07 2009 -0700 +++ b/src/HOL/Integration.thy Mon May 25 22:14:59 2009 -0700 @@ -32,8 +32,8 @@ --{*Gauges and gauge-fine divisions*} definition - gauge :: "[real => bool, real => real] => bool" where - [code del]:"gauge E g = (\x. E x --> 0 < g(x))" + gauge :: "[real set, real => real] => bool" where + [code del]:"gauge E g = (\x\E. 0 < g(x))" definition fine :: "[real => real, ((nat => real)*(nat => real))] => bool" where @@ -50,13 +50,13 @@ definition Integral :: "[(real*real),real=>real,real] => bool" where [code del]: "Integral = (%(a,b) f k. \e > 0. - (\g. gauge(%x. a \ x & x \ b) g & + (\g. gauge {a..b} g & (\D p. tpart(a,b) (D,p) & fine(g)(D,p) --> \rsum(D,p) f - k\ < e)))" lemma Integral_def2: - "Integral = (%(a,b) f k. \e>0. (\g. gauge(%x. a \ x & x \ b) g & + "Integral = (%(a,b) f k. \e>0. (\g. gauge {a..b} g & (\D p. tpart(a,b) (D,p) & fine(g)(D,p) --> \rsum(D,p) f - k\ \ e)))" unfolding Integral_def @@ -288,7 +288,7 @@ text{*We can always find a division that is fine wrt any gauge*} lemma partition_exists: - "[| a \ b; gauge(%x. a \ x & x \ b) g |] + "[| a \ b; gauge {a..b} g |] ==> \D p. tpart(a,b) (D,p) & fine g (D,p)" apply (cut_tac P = "%(u,v). a \ u & v \ b --> (\D p. tpart (u,v) (D,p) & fine (g) (D,p))" @@ -381,23 +381,13 @@ text{*"Straddle Lemma" : Swartz and Thompson: AMM 95(7) 1988 *} -lemma choiceP: "\x. P(x) --> (\y. Q x y) ==> \f. (\x. P(x) --> Q x (f x))" -by (insert bchoice [of "Collect P" Q], simp) - -(*UNUSED -lemma choice2: "\x. (\y. R(y) & (\z. Q x y z)) ==> - \f fa. (\x. R(f x) & Q x (f x) (fa x))" -*) - - lemma strad1: "\\z::real. z \ x \ \z - x\ < s \ \(f z - f x) / (z - x) - f' x\ < e/2; 0 < s; 0 < e; a \ x; x \ b\ \ \z. \z - x\ < s -->\f z - f x - f' x * (z - x)\ \ e/2 * \z - x\" apply clarify -apply (case_tac "0 < \z - x\") - prefer 2 apply (simp add: zero_less_abs_iff) +apply (case_tac "z = x", simp) apply (drule_tac x = z in spec) apply (rule_tac z1 = "\inverse (z - x)\" in real_mult_le_cancel_iff2 [THEN iffD1]) @@ -415,14 +405,14 @@ lemma lemma_straddle: assumes f': "\x. a \ x & x \ b --> DERIV f x :> f'(x)" and "0 < e" - shows "\g. gauge(%x. a \ x & x \ b) g & + shows "\g. gauge {a..b} g & (\x u v. a \ u & u \ x & x \ v & v \ b & (v - u) < g(x) --> \(f(v) - f(u)) - (f'(x) * (v - u))\ \ e * (v - u))" proof - - have "\x. a \ x & x \ b --> + have "\x\{a..b}. (\d > 0. \u v. u \ x & x \ v & (v - u) < d --> \(f(v) - f(u)) - (f'(x) * (v - u))\ \ e * (v - u))" - proof (clarify) + proof (clarsimp) fix x :: real assume "a \ x" and "x \ b" with f' have "DERIV f x :> f'(x)" by simp then have "\r>0. \s>0. \z. z \ x \ \z - x\ < s \ \(f z - f x) / (z - x) - f' x\ < r" @@ -455,7 +445,7 @@ qed qed thus ?thesis - by (simp add: gauge_def) (drule choiceP, auto) + by (simp add: gauge_def) (drule bchoice, auto) qed lemma FTC1: "[|a \ b; \x. a \ x & x \ b --> DERIV f x :> f'(x) |] @@ -724,7 +714,7 @@ done lemma fine_left1: - "[| a \ D n; tpart (a, b) (D, p); gauge (%x. a \ x & x \ D n) g; + "[| a \ D n; tpart (a, b) (D, p); gauge {a..D n} g; fine (%x. if x < D n then min (g x) ((D n - x)/ 2) else if x = D n then min (g (D n)) (ga (D n)) else min (ga x) ((x - D n)/ 2)) (D, p) |] @@ -746,7 +736,7 @@ done lemma fine_right1: - "[| a \ D n; tpart (a, b) (D, p); gauge (%x. D n \ x & x \ b) ga; + "[| a \ D n; tpart (a, b) (D, p); gauge {D n..b} ga; fine (%x. if x < D n then min (g x) ((D n - x)/ 2) else if x = D n then min (g (D n)) (ga (D n)) else min (ga x) ((x - D n)/ 2)) (D, p) |] @@ -842,7 +832,7 @@ lemma Integral_imp_Cauchy: "(\k. Integral(a,b) f k) ==> - (\e > 0. \g. gauge (%x. a \ x & x \ b) g & + (\e > 0. \g. gauge {a..b} g & (\D1 D2 p1 p2. tpart(a,b) (D1, p1) & fine g (D1,p1) & tpart(a,b) (D2, p2) & fine g (D2,p2) --> @@ -871,7 +861,7 @@ done lemma partition_exists2: - "[| a \ b; \n. gauge (%x. a \ x & x \ b) (fa n) |] + "[| a \ b; \n. gauge {a..b} (fa n) |] ==> \n. \D p. tpart (a, b) (D, p) & fine (fa n) (D, p)" by (blast dest: partition_exists)