# HG changeset patch # User paulson # Date 1254760066 -3600 # Node ID 6f09346c7c083918dce54553437678fc3cb1ff0a # Parent c34b072518c905def5079389843d09ee06774c97 New lemmas connected with the reals and infinite series diff -r c34b072518c9 -r 6f09346c7c08 src/HOL/Real.thy --- a/src/HOL/Real.thy Mon Oct 05 16:41:06 2009 +0100 +++ b/src/HOL/Real.thy Mon Oct 05 17:27:46 2009 +0100 @@ -2,4 +2,28 @@ imports RComplete RealVector begin +lemma field_le_epsilon: + fixes x y :: "'a:: {number_ring,division_by_zero,ordered_field}" + assumes e: "(!!e. 0 < e ==> x \ y + e)" + shows "x \ y" +proof (rule ccontr) + assume xy: "\ x \ y" + hence "(x-y)/2 > 0" + by (metis half_gt_zero le_iff_diff_le_0 linorder_not_le local.xy) + hence "x \ y + (x - y) / 2" + by (rule e [of "(x-y)/2"]) + also have "... = (x - y + 2*y)/2" + by auto + (metis add_less_cancel_left add_numeral_0_right class_semiring.add_c xy e + diff_add_cancel gt_half_sum less_half_sum linorder_not_le number_of_Pls) + also have "... = (x + y) / 2" + by auto + also have "... < x" using xy + by auto + finally have "x Y ----> z ==> X ----> z" + by simp + lemma LIMSEQ_conv_tendsto: "(X ----> L) \ (X ---> L) sequentially" unfolding LIMSEQ_def tendsto_iff eventually_sequentially .. @@ -315,6 +318,39 @@ shows "[| X ----> a; Y ----> b |] ==> (%n. X n * Y n) ----> a * b" by (rule mult.LIMSEQ) +lemma increasing_LIMSEQ: + fixes f :: "nat \ real" + assumes inc: "!!n. f n \ f (Suc n)" + and bdd: "!!n. f n \ l" + and en: "!!e. 0 < e \ \n. l \ f n + e" + shows "f ----> l" +proof (auto simp add: LIMSEQ_def) + fix e :: real + assume e: "0 < e" + then obtain N where "l \ f N + e/2" + by (metis half_gt_zero e en that) + hence N: "l < f N + e" using e + by simp + { fix k + have [simp]: "!!n. \f n - l\ = l - f n" + by (simp add: bdd) + have "\f (N+k) - l\ < e" + proof (induct k) + case 0 show ?case using N + by simp + next + case (Suc k) thus ?case using N inc [of "N+k"] + by simp + qed + } note 1 = this + { fix n + have "N \ n \ \f n - l\ < e" using 1 [of "n-N"] + by simp + } note [intro] = this + show " \no. \n\no. dist (f n) l < e" + by (auto simp add: dist_real_def) + qed + lemma Bseq_inverse_lemma: fixes x :: "'a::real_normed_div_algebra" shows "\r \ norm x; 0 < r\ \ norm (inverse x) \ inverse r" diff -r c34b072518c9 -r 6f09346c7c08 src/HOL/Series.thy --- a/src/HOL/Series.thy Mon Oct 05 16:41:06 2009 +0100 +++ b/src/HOL/Series.thy Mon Oct 05 17:27:46 2009 +0100 @@ -32,6 +32,9 @@ "\i. b" == "CONST suminf (%i. b)" +lemma [trans]: "f=g ==> g sums z ==> f sums z" + by simp + lemma sumr_diff_mult_const: "setsum f {0..