# HG changeset patch # User kleing # Date 1139743741 -3600 # Node ID 5652a536b7e8f2c78e617208b5f8c57b5250c360 # Parent 0e6ec4fd204c6b3c8f0bafa6776fe489c778a906 * include generalised MVT in HyperReal (contributed by Benjamin Porter) * add non-denumerability of continuum in Real, includes closed intervals on real (contributed by Benjamin Porter, #22 in http://www.cs.ru.nl/~freek/100/) diff -r 0e6ec4fd204c -r 5652a536b7e8 src/HOL/Hyperreal/Lim.thy --- a/src/HOL/Hyperreal/Lim.thy Sun Feb 12 10:42:19 2006 +0100 +++ b/src/HOL/Hyperreal/Lim.thy Sun Feb 12 12:29:01 2006 +0100 @@ -3,6 +3,7 @@ Author : Jacques D. Fleuriot Copyright : 1998 University of Cambridge Conversion to Isar and new proofs by Lawrence C Paulson, 2004 + GMVT by Benjamin Porter, 2005 *) header{*Limits, Continuity and Differentiation*} @@ -15,16 +16,16 @@ constdefs LIM :: "[real=>real,real,real] => bool" - ("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60) + ("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60) "f -- a --> L == \r > 0. \s > 0. \x. x \ a & \x + -a\ < s - --> \f x + -L\ < r" + --> \f x + -L\ < r" NSLIM :: "[real=>real,real,real] => bool" - ("((_)/ -- (_)/ --NS> (_))" [60, 0, 60] 60) + ("((_)/ -- (_)/ --NS> (_))" [60, 0, 60] 60) "f -- a --NS> L == (\x. (x \ hypreal_of_real a & - x @= hypreal_of_real a --> - ( *f* f) x @= hypreal_of_real L))" + x @= hypreal_of_real a --> + ( *f* f) x @= hypreal_of_real L))" isCont :: "[real=>real,real] => bool" "isCont f a == (f -- a --> (f a))" @@ -32,29 +33,29 @@ isNSCont :: "[real=>real,real] => bool" --{*NS definition dispenses with limit notions*} "isNSCont f a == (\y. y @= hypreal_of_real a --> - ( *f* f) y @= hypreal_of_real (f a))" + ( *f* f) y @= hypreal_of_real (f a))" deriv:: "[real=>real,real,real] => bool" --{*Differentiation: D is derivative of function f at x*} - ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) + ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) "DERIV f x :> D == ((%h. (f(x + h) + -f x)/h) -- 0 --> D)" nsderiv :: "[real=>real,real,real] => bool" - ("(NSDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) + ("(NSDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) "NSDERIV f x :> D == (\h \ Infinitesimal - {0}. - (( *f* f)(hypreal_of_real x + h) + - - hypreal_of_real (f x))/h @= hypreal_of_real D)" + (( *f* f)(hypreal_of_real x + h) + + - hypreal_of_real (f x))/h @= hypreal_of_real D)" differentiable :: "[real=>real,real] => bool" (infixl "differentiable" 60) "f differentiable x == (\D. DERIV f x :> D)" - NSdifferentiable :: "[real=>real,real] => bool" + NSdifferentiable :: "[real=>real,real] => bool" (infixl "NSdifferentiable" 60) "f NSdifferentiable x == (\D. NSDERIV f x :> D)" increment :: "[real=>real,real,hypreal] => hypreal" "increment f x h == (@inc. f NSdifferentiable x & - inc = ( *f* f)(hypreal_of_real x + h) + -hypreal_of_real (f x))" + inc = ( *f* f)(hypreal_of_real x + h) + -hypreal_of_real (f x))" isUCont :: "(real=>real) => bool" "isUCont f == \r > 0. \s > 0. \x y. \x + -y\ < s --> \f x + -f y\ < r" @@ -133,7 +134,7 @@ lemma LIM_diff: "[| f -- x --> l; g -- x --> m |] ==> (%x. f(x) - g(x)) -- x --> l-m" -by (simp add: diff_minus LIM_add_minus) +by (simp add: diff_minus LIM_add_minus) lemma LIM_const_not_eq: "k \ L ==> ~ ((%x. k) -- a --> L)" @@ -146,7 +147,7 @@ assume s: "0 a < s/2 + a" by arith next - from s show "\s / 2 + a - a\ < s" by (simp add: abs_if) + from s show "\s / 2 + a - a\ < s" by (simp add: abs_if) next from s show "~ \k-L\ < L-k" by (simp add: abs_if) } qed @@ -159,7 +160,7 @@ assume s: "0 a < s/2 + a" by arith next - from s show "\s / 2 + a - a\ < s" by (simp add: abs_if) + from s show "\s / 2 + a - a\ < s" by (simp add: abs_if) next from s show "~ \k-L\ < k-L" by (simp add: abs_if) } qed @@ -167,11 +168,11 @@ lemma LIM_const_eq: "(%x. k) -- x --> L ==> k = L" apply (rule ccontr) -apply (blast dest: LIM_const_not_eq) +apply (blast dest: LIM_const_not_eq) done lemma LIM_unique: "[| f -- a --> L; f -- a --> M |] ==> L = M" -apply (drule LIM_diff, assumption) +apply (drule LIM_diff, assumption) apply (auto dest!: LIM_const_eq) done @@ -198,7 +199,7 @@ assume "x \ a \ \x-a\ < min fs gs" with fs_lt gs_lt have "\f x\ < 1" and "\g x\ < r" by (auto simp add: fs_lt) - hence "\f x\ * \g x\ < 1*r" by (rule abs_mult_less) + hence "\f x\ * \g x\ < 1*r" by (rule abs_mult_less) thus "\f x\ * \g x\ < r" by simp qed qed @@ -228,7 +229,7 @@ apply (simp add: Infinitesimal_FreeUltrafilterNat_iff, safe) apply (rule_tac x = xa in star_cases) apply (auto simp add: real_add_minus_iff starfun star_n_minus star_of_def star_n_add star_n_eq_iff) -apply (rule bexI [OF _ Rep_star_star_n], clarify) +apply (rule bexI [OF _ Rep_star_star_n], clarify) apply (drule_tac x = u in spec, clarify) apply (drule_tac x = s in spec, clarify) apply (subgoal_tac "\n::nat. (Xa n) \ x & \(Xa n) + - x\ < s --> \f (Xa n) + - L\ < u") @@ -594,7 +595,7 @@ lemma lemma_LIMu: "\s>0.\z y. \z + - y\ < s & r \ \f z + -f y\ ==> \n::nat. \z y. \z + -y\ < inverse(real(Suc n)) & r \ \f z + -f y\" apply clarify -apply (cut_tac n1 = n +apply (cut_tac n1 = n in real_of_nat_Suc_gt_zero [THEN positive_imp_inverse_positive], auto) done @@ -772,8 +773,8 @@ apply (drule_tac [!] hypreal_not_eq_minus_iff [THEN iffD1]) apply (subgoal_tac [2] "( *f* (%z. z-x)) u \ (0::hypreal) ") apply (auto simp add: diff_minus - approx_minus_iff [THEN iffD1, THEN mem_infmal_iff [THEN iffD2]] - Infinitesimal_subset_HFinite [THEN subsetD]) + approx_minus_iff [THEN iffD1, THEN mem_infmal_iff [THEN iffD2]] + Infinitesimal_subset_HFinite [THEN subsetD]) done lemma NSDERIVD4: @@ -881,7 +882,7 @@ ==> NSDERIV (%x. f x * g x) x :> (Da * g(x)) + (Db * f(x))" apply (auto simp add: NSDERIV_NSLIM_iff NSLIM_def) apply (auto dest!: spec - simp add: starfun_lambda_cancel lemma_nsderiv1) + simp add: starfun_lambda_cancel lemma_nsderiv1) apply (simp (no_asm) add: add_divide_distrib) apply (drule bex_Infinitesimal_iff2 [THEN iffD2])+ apply (auto simp add: times_divide_eq_right [symmetric] @@ -1330,7 +1331,7 @@ apply (auto simp add: Bolzano_bisect_le Let_def split_def) done -lemma eq_divide_2_times_iff: "((x::real) = y / (2 * z)) = (2 * x = y/z)" +lemma eq_divide_2_times_iff: "((x::real) = y / (2 * z)) = (2 * x = y/z)" apply (auto) apply (drule_tac f = "%u. (1/2) *u" in arg_cong) apply (simp) @@ -1498,7 +1499,7 @@ lemma isCont_has_Ub: "[| a \ b; \x. a \ x & x \ b --> isCont f x |] ==> \M. (\x. a \ x & x \ b --> f(x) \ M) & (\N. N < M --> (\x. a \ x & x \ b & N < f(x)))" -apply (cut_tac S = "Collect (%y. \x. a \ x & x \ b & y = f x)" +apply (cut_tac S = "Collect (%y. \x. a \ x & x \ b & y = f x)" in lemma_reals_complete) apply auto apply (drule isCont_bounded, assumption) @@ -1601,12 +1602,12 @@ assume "0 < h" "h < s" with all [of h] show "f x < f (x+h)" proof (simp add: abs_if pos_less_divide_eq diff_minus [symmetric] - split add: split_if_asm) + split add: split_if_asm) assume "~ (f (x+h) - f x) / h < l" and h: "0 < h" with l have "0 < (f (x+h) - f x) / h" by arith thus "f x < f (x+h)" - by (simp add: pos_less_divide_eq h) + by (simp add: pos_less_divide_eq h) qed qed qed @@ -1630,12 +1631,12 @@ assume "0 < h" "h < s" with all [of "-h"] show "f x < f (x-h)" proof (simp add: abs_if pos_less_divide_eq diff_minus [symmetric] - split add: split_if_asm) + split add: split_if_asm) assume " - ((f (x-h) - f x) / h) < l" and h: "0 < h" with l have "0 < (f (x-h) - f x) / h" by arith thus "f x < f (x-h)" - by (simp add: pos_less_divide_eq h) + by (simp add: pos_less_divide_eq h) qed qed qed @@ -1742,9 +1743,9 @@ hence ax': "ay. \x'-y\ < d \ a \ y \ y \ b" - by blast + by blast hence bound': "\y. \x'-y\ < d \ f x' \ f y" using x'_min - by blast + by blast from differentiableD [OF dif [OF ax'b]] obtain l where der: "DERIV f x' :> l" .. have "l=0" by (rule DERIV_local_min [OF der d bound']) @@ -1759,7 +1760,7 @@ obtain r where ar: "a < r" and rb: "r < b" by blast from lemma_interval [OF ar rb] obtain d where d: "0y. \r-y\ < d \ a \ y \ y \ b" - by blast + by blast have eq_fb: "\z. a \ z --> z \ b --> f z = f b" proof (clarify) fix z::real @@ -1798,7 +1799,7 @@ hence ba: "b-a \ 0" by arith show ?thesis by (rule real_mult_left_cancel [OF ba, THEN iffD1], - simp add: right_diff_distrib, + simp add: right_diff_distrib, simp add: left_diff_distrib) qed @@ -1888,10 +1889,10 @@ done lemma real_average_minus_first [simp]: "((a + b) /2 - a) = (b-a)/(2::real)" -by (simp) +by (simp) lemma real_average_minus_second [simp]: "((b + a)/2 - a) = (b-a)/(2::real)" -by (simp) +by (simp) text{*Gallileo's "trick": average velocity = av. of end velocities*} @@ -2060,6 +2061,319 @@ qed qed + +lemma differentiable_const: "(\z. a) differentiable x" + apply (unfold differentiable_def) + apply (rule_tac x=0 in exI) + apply simp + done + +lemma differentiable_sum: + assumes "f differentiable x" + and "g differentiable x" + shows "(\x. f x + g x) differentiable x" +proof - + from prems have "\D. DERIV f x :> D" by (unfold differentiable_def) + then obtain df where "DERIV f x :> df" .. + moreover from prems have "\D. DERIV g x :> D" by (unfold differentiable_def) + then obtain dg where "DERIV g x :> dg" .. + ultimately have "DERIV (\x. f x + g x) x :> df + dg" by (rule DERIV_add) + hence "\D. DERIV (\x. f x + g x) x :> D" by auto + thus ?thesis by (fold differentiable_def) +qed + +lemma differentiable_diff: + assumes "f differentiable x" + and "g differentiable x" + shows "(\x. f x - g x) differentiable x" +proof - + from prems have "f differentiable x" by simp + moreover + from prems have "\D. DERIV g x :> D" by (unfold differentiable_def) + then obtain dg where "DERIV g x :> dg" .. + then have "DERIV (\x. - g x) x :> -dg" by (rule DERIV_minus) + hence "\D. DERIV (\x. - g x) x :> D" by auto + hence "(\x. - g x) differentiable x" by (fold differentiable_def) + ultimately + show ?thesis + by (auto simp: real_diff_def dest: differentiable_sum) +qed + +lemma differentiable_mult: + assumes "f differentiable x" + and "g differentiable x" + shows "(\x. f x * g x) differentiable x" +proof - + from prems have "\D. DERIV f x :> D" by (unfold differentiable_def) + then obtain df where "DERIV f x :> df" .. + moreover from prems have "\D. DERIV g x :> D" by (unfold differentiable_def) + then obtain dg where "DERIV g x :> dg" .. + ultimately have "DERIV (\x. f x * g x) x :> df * g x + dg * f x" by (simp add: DERIV_mult) + hence "\D. DERIV (\x. f x * g x) x :> D" by auto + thus ?thesis by (fold differentiable_def) +qed + + +theorem GMVT: + assumes alb: "a < b" + and fc: "\x. a \ x \ x \ b \ isCont f x" + and fd: "\x. a < x \ x < b \ f differentiable x" + and gc: "\x. a \ x \ x \ b \ isCont g x" + and gd: "\x. a < x \ x < b \ g differentiable x" + shows "\g'c f'c c. DERIV g c :> g'c \ DERIV f c :> f'c \ a < c \ c < b \ ((f b - f a) * g'c) = ((g b - g a) * f'c)" +proof - + let ?h = "\x. (f b - f a)*(g x) - (g b - g a)*(f x)" + from prems have "a < b" by simp + moreover have "\x. a \ x \ x \ b \ isCont ?h x" + proof - + have "\x. a <= x \ x <= b \ isCont (\x. f b - f a) x" by simp + with gc have "\x. a <= x \ x <= b \ isCont (\x. (f b - f a) * g x) x" + by (auto intro: isCont_mult) + moreover + have "\x. a <= x \ x <= b \ isCont (\x. g b - g a) x" by simp + with fc have "\x. a <= x \ x <= b \ isCont (\x. (g b - g a) * f x) x" + by (auto intro: isCont_mult) + ultimately show ?thesis + by (fastsimp intro: isCont_diff) + qed + moreover + have "\x. a < x \ x < b \ ?h differentiable x" + proof - + have "\x. a < x \ x < b \ (\x. f b - f a) differentiable x" by (simp add: differentiable_const) + with gd have "\x. a < x \ x < b \ (\x. (f b - f a) * g x) differentiable x" by (simp add: differentiable_mult) + moreover + have "\x. a < x \ x < b \ (\x. g b - g a) differentiable x" by (simp add: differentiable_const) + with fd have "\x. a < x \ x < b \ (\x. (g b - g a) * f x) differentiable x" by (simp add: differentiable_mult) + ultimately show ?thesis by (simp add: differentiable_diff) + qed + ultimately have "\l z. a < z \ z < b \ DERIV ?h z :> l \ ?h b - ?h a = (b - a) * l" by (rule MVT) + then obtain l where ldef: "\z. a < z \ z < b \ DERIV ?h z :> l \ ?h b - ?h a = (b - a) * l" .. + then obtain c where cdef: "a < c \ c < b \ DERIV ?h c :> l \ ?h b - ?h a = (b - a) * l" .. + + from cdef have cint: "a < c \ c < b" by auto + with gd have "g differentiable c" by simp + hence "\D. DERIV g c :> D" by (rule differentiableD) + then obtain g'c where g'cdef: "DERIV g c :> g'c" .. + + from cdef have "a < c \ c < b" by auto + with fd have "f differentiable c" by simp + hence "\D. DERIV f c :> D" by (rule differentiableD) + then obtain f'c where f'cdef: "DERIV f c :> f'c" .. + + from cdef have "DERIV ?h c :> l" by auto + moreover + { + from g'cdef have "DERIV (\x. (f b - f a) * g x) c :> g'c * (f b - f a)" + apply (insert DERIV_const [where k="f b - f a"]) + apply (drule meta_spec [of _ c]) + apply (drule DERIV_mult [where f="(\x. f b - f a)" and g=g]) + by simp_all + moreover from f'cdef have "DERIV (\x. (g b - g a) * f x) c :> f'c * (g b - g a)" + apply (insert DERIV_const [where k="g b - g a"]) + apply (drule meta_spec [of _ c]) + apply (drule DERIV_mult [where f="(\x. g b - g a)" and g=f]) + by simp_all + ultimately have "DERIV ?h c :> g'c * (f b - f a) - f'c * (g b - g a)" + by (simp add: DERIV_diff) + } + ultimately have leq: "l = g'c * (f b - f a) - f'c * (g b - g a)" by (rule DERIV_unique) + + { + from cdef have "?h b - ?h a = (b - a) * l" by auto + also with leq have "\ = (b - a) * (g'c * (f b - f a) - f'c * (g b - g a))" by simp + finally have "?h b - ?h a = (b - a) * (g'c * (f b - f a) - f'c * (g b - g a))" by simp + } + moreover + { + have "?h b - ?h a = + ((f b)*(g b) - (f a)*(g b) - (g b)*(f b) + (g a)*(f b)) - + ((f b)*(g a) - (f a)*(g a) - (g b)*(f a) + (g a)*(f a))" + by (simp add: mult_ac add_ac real_diff_mult_distrib) + hence "?h b - ?h a = 0" by auto + } + ultimately have "(b - a) * (g'c * (f b - f a) - f'c * (g b - g a)) = 0" by auto + with alb have "g'c * (f b - f a) - f'c * (g b - g a) = 0" by simp + hence "g'c * (f b - f a) = f'c * (g b - g a)" by simp + hence "(f b - f a) * g'c = (g b - g a) * f'c" by (simp add: mult_ac) + + with g'cdef f'cdef cint show ?thesis by auto +qed + + +lemma LIMSEQ_SEQ_conv1: + assumes "X -- a --> L" + shows "\S. (\n. S n \ a) \ S ----> a \ (\n. X (S n)) ----> L" +proof - + { + from prems have Xdef: "\r > 0. \s > 0. \x. x \ a & \x + -a\ < s --> \X x + -L\ < r" by (unfold LIM_def) + + fix S + assume as: "(\n. S n \ a) \ S ----> a" + then have "S ----> a" by auto + then have Sdef: "(\r. 0 < r --> (\no. \n. no \ n --> \S n + -a\ < r))" by (unfold LIMSEQ_def) + { + fix r + from Xdef have Xdef2: "0 < r --> (\s > 0. \x. x \ a \ \x + -a\ < s --> \X x + -L\ < r)" by simp + { + assume rgz: "0 < r" + + from Xdef2 rgz have "\s > 0. \x. x \ a \ \x + -a\ < s --> \X x + -L\ < r" by simp + then obtain s where sdef: "s > 0 \ (\x. x\a \ \x + -a\ < s \ \X x + -L\ < r)" by auto + then have aux: "\x. x\a \ \x + -a\ < s \ \X x + -L\ < r" by auto + { + fix n + from aux have "S n \ a \ \S n + -a\ < s \ \X (S n) + -L\ < r" by simp + with as have imp2: "\S n + -a\ < s --> \X (S n) + -L\ < r" by auto + } + hence "\n. \S n + -a\ < s --> \X (S n) + -L\ < r" .. + moreover + from Sdef sdef have imp1: "\no. \n. no \ n --> \S n + -a\ < s" by auto + then obtain no where "\n. no \ n --> \S n + -a\ < s" by auto + ultimately have "\n. no \ n \ \X (S n) + -L\ < r" by simp + hence "\no. \n. no \ n \ \X (S n) + -L\ < r" by auto + } + } + hence "(\r. 0 < r --> (\no. \n. no \ n --> \X (S n) + -L\ < r))" by simp + hence "(\n. X (S n)) ----> L" by (fold LIMSEQ_def) + } + thus ?thesis by simp +qed + +lemma LIMSEQ_SEQ_conv2: + assumes "\S. (\n. S n \ a) \ S ----> a \ (\n. X (S n)) ----> L" + shows "X -- a --> L" +proof (rule ccontr) + assume "\ (X -- a --> L)" + hence "\ (\r > 0. \s > 0. \x. x \ a & \x + -a\ < s --> \X x + -L\ < r)" by (unfold LIM_def) + hence "\r > 0. \s > 0. \x. \(x \ a \ \x + -a\ < s --> \X x + -L\ < r)" by simp + hence "\r > 0. \s > 0. \x. (x \ a \ \x + -a\ < s \ \X x + -L\ \ r)" by (simp add: linorder_not_less) + then obtain r where rdef: "r > 0 \ (\s > 0. \x. (x \ a \ \x + -a\ < s \ \X x + -L\ \ r))" by auto + + let ?F = "\n::nat. SOME x. x\a \ \x + -a\ < inverse (real (Suc n)) \ \X x + -L\ \ r" + have "?F ----> a" + proof - + { + fix e::real + assume "0 < e" + (* choose no such that inverse (real (Suc n)) < e *) + have "\no. inverse (real (Suc no)) < e" by (rule reals_Archimedean) + then obtain m where nodef: "inverse (real (Suc m)) < e" by auto + { + fix n + assume mlen: "m \ n" + then have + "inverse (real (Suc n)) \ inverse (real (Suc m))" + by auto + moreover have + "\?F n + -a\ < inverse (real (Suc n))" + proof - + from rdef have + "\x. x\a \ \x + -a\ < inverse (real (Suc n)) \ \X x + -L\ \ r" + by simp + hence + "(?F n)\a \ \(?F n) + -a\ < inverse (real (Suc n)) \ \X (?F n) + -L\ \ r" + by (simp add: some_eq_ex [symmetric]) + thus ?thesis by simp + qed + moreover from nodef have + "inverse (real (Suc m)) < e" . + ultimately have "\?F n + -a\ < e" by arith + } + then have "\no. \n. no \ n --> \?F n + -a\ < e" by auto + } + thus ?thesis by (unfold LIMSEQ_def, simp) + qed + + moreover have "\n. ?F n \ a" + proof - + { + fix n + from rdef have + "\x. x\a \ \x + -a\ < inverse (real (Suc n)) \ \X x + -L\ \ r" + by simp + hence "?F n \ a" by (simp add: some_eq_ex [symmetric]) + } + thus ?thesis .. + qed + moreover from prems have "\S. (\n. S n \ a) \ S ----> a \ (\n. X (S n)) ----> L" by simp + ultimately have "(\n. X (?F n)) ----> L" by simp + + moreover have "\ ((\n. X (?F n)) ----> L)" + proof - + { + fix no::nat + obtain n where "n = no + 1" by simp + then have nolen: "no \ n" by simp + (* We prove this by showing that for any m there is an n\m such that |X (?F n) - L| \ r *) + from rdef have "\s > 0. \x. (x \ a \ \x + -a\ < s \ \X x + -L\ \ r)" .. + + then have "\x. x\a \ \x + -a\ < inverse (real (Suc n)) \ \X x + -L\ \ r" by simp + + hence "\X (?F n) + -L\ \ r" by (simp add: some_eq_ex [symmetric]) + with nolen have "\n. no \ n \ \X (?F n) + -L\ \ r" by auto + } + then have "(\no. \n. no \ n \ \X (?F n) + -L\ \ r)" by simp + with rdef have "\e>0. (\no. \n. no \ n \ \X (?F n) + -L\ \ e)" by auto + thus ?thesis by (unfold LIMSEQ_def, auto simp add: linorder_not_less) + qed + ultimately show False by simp +qed + + +lemma LIMSEQ_SEQ_conv: + "(\S. (\n. S n \ a) \ S ----> a \ (\n. X (S n)) ----> L) = (X -- a --> L)" +proof + assume "\S. (\n. S n \ a) \ S ----> a \ (\n. X (S n)) ----> L" + show "X -- a --> L" by (rule LIMSEQ_SEQ_conv2) +next + assume "(X -- a --> L)" + show "\S. (\n. S n \ a) \ S ----> a \ (\n. X (S n)) ----> L" by (rule LIMSEQ_SEQ_conv1) +qed + +lemma real_sqz: + fixes a::real + assumes "a < c" + shows "\b. a < b \ b < c" +proof + let ?b = "(a + c) / 2" + have "a < ?b" by simp + moreover + have "?b < c" by simp + ultimately + show "a < ?b \ ?b < c" by simp +qed + +lemma LIM_offset: + assumes "(\x. f x) -- a --> L" + shows "(\x. f (x+c)) -- (a-c) --> L" +proof - + have "f -- a --> L" . + hence + fd: "\r > 0. \s > 0. \x. x \ a & \x + -a\ < s --> \f x + -L\ < r" + by (unfold LIM_def) + { + fix r::real + assume rgz: "0 < r" + with fd have "\s > 0. \x. x\a \ \x + -a\ < s --> \f x + -L\ < r" by simp + then obtain s where sgz: "s > 0" and ax: "\x. x\a \ \x + -a\ < s \ \f x + -L\ < r" by auto + from ax have ax2: "\x. (x+c)\a \ \(x+c) + -a\ < s \ \f (x+c) + -L\ < r" by auto + { + fix x::real + from ax2 have nt: "(x+c)\a \ \(x+c) + -a\ < s \ \f (x+c) + -L\ < r" .. + moreover have "((x+c)\a) = (x\(a-c))" by auto + moreover have "((x+c) + -a) = (x + -(a-c))" by simp + ultimately have "x\(a-c) \ \x + -(a-c)\ < s \ \f (x+c) + -L\ < r" by simp + } + then have "\x. x\(a-c) \ \x + -(a-c)\ < s \ \f (x+c) + -L\ < r" .. + with sgz have "\s > 0. \x. x\(a-c) \ \x + -(a-c)\ < s \ \f (x+c) + -L\ < r" by auto + } + then have + "\r > 0. \s > 0. \x. x \ (a-c) & \x + -(a-c)\ < s --> \f (x+c) + -L\ < r" by simp + thus ?thesis by (fold LIM_def) +qed + + + ML {* val LIM_def = thm"LIM_def"; diff -r 0e6ec4fd204c -r 5652a536b7e8 src/HOL/Real/ContNotDenum.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/HOL/Real/ContNotDenum.thy Sun Feb 12 12:29:01 2006 +0100 @@ -0,0 +1,578 @@ +(* Title : HOL/Real/ContNonDenum + ID : $Id$ + Author : Benjamin Porter, Monash University, NICTA, 2005 +*) + +header {* Non-denumerability of the Continuum. *} + +theory ContNotDenum +imports RComplete +begin + +section {* Abstract *} + +text {* The following document presents a proof that the Continuum is +uncountable. It is formalised in the Isabelle/Isar theorem proving +system. + +{\em Theorem:} The Continuum @{text "\"} is not denumerable. In other +words, there does not exist a function f:@{text "\\\"} such that f is +surjective. + +{\em Outline:} An elegant informal proof of this result uses Cantor's +Diagonalisation argument. The proof presented here is not this +one. First we formalise some properties of closed intervals, then we +prove the Nested Interval Property. This property relies on the +completeness of the Real numbers and is the foundation for our +argument. Informally it states that an intersection of countable +closed intervals (where each successive interval is a subset of the +last) is non-empty. We then assume a surjective function f:@{text +"\\\"} exists and find a real x such that x is not in the range of f +by generating a sequence of closed intervals then using the NIP. *} + +section {* Closed Intervals *} + +text {* This section formalises some properties of closed intervals. *} + +subsection {* Definition *} + +constdefs closed_int :: "real \ real \ real set" + "closed_int x y \ {z. x \ z \ z \ y}" + +subsection {* Properties *} + +lemma closed_int_subset: + assumes xy: "x1 \ x0" "y1 \ y0" + shows "closed_int x1 y1 \ closed_int x0 y0" +proof - + { + fix x::real + assume "x \ closed_int x1 y1" + hence "x \ x1 \ x \ y1" by (unfold closed_int_def, simp) + with xy have "x \ x0 \ x \ y0" by auto + hence "x \ closed_int x0 y0" by (unfold closed_int_def, simp) + } + thus ?thesis by auto +qed + +lemma closed_int_least: + assumes a: "a \ b" + shows "a \ closed_int a b \ (\x \ closed_int a b. a \ x)" +proof + from a have "a\{x. a\x \ x\b}" by simp + thus "a \ closed_int a b" by (unfold closed_int_def) +next + have "\x\{x. a\x \ x\b}. a\x" by simp + thus "\x \ closed_int a b. a \ x" by (unfold closed_int_def) +qed + +lemma closed_int_most: + assumes a: "a \ b" + shows "b \ closed_int a b \ (\x \ closed_int a b. x \ b)" +proof + from a have "b\{x. a\x \ x\b}" by simp + thus "b \ closed_int a b" by (unfold closed_int_def) +next + have "\x\{x. a\x \ x\b}. x\b" by simp + thus "\x \ closed_int a b. x\b" by (unfold closed_int_def) +qed + +lemma closed_not_empty: + shows "a \ b \ \x. x \ closed_int a b" + by (auto dest: closed_int_least) + +lemma closed_mem: + assumes "a \ c" and "c \ b" + shows "c \ closed_int a b" + by (unfold closed_int_def) auto + +lemma closed_subset: + assumes ac: "a \ b" "c \ d" + assumes closed: "closed_int a b \ closed_int c d" + shows "b \ c" +proof - + from closed have "\x\closed_int a b. x\closed_int c d" by auto + hence "\x. a\x \ x\b \ c\x \ x\d" by (unfold closed_int_def, auto) + with ac have "c\b \ b\d" by simp + thus ?thesis by auto +qed + + +section {* Nested Interval Property *} + +theorem NIP: + fixes f::"nat \ real set" + assumes subset: "\n. f (Suc n) \ f n" + and closed: "\n. \a b. f n = closed_int a b \ a \ b" + shows "(\n. f n) \ {}" +proof - + let ?g = "\n. (SOME c. c\(f n) \ (\x\(f n). c \ x))" + have ne: "\n. \x. x\(f n)" + proof + fix n + from closed have "\a b. f n = closed_int a b \ a \ b" by simp + then obtain a and b where fn: "f n = closed_int a b \ a \ b" by auto + hence "a \ b" .. + with closed_not_empty have "\x. x\closed_int a b" by simp + with fn show "\x. x\(f n)" by simp + qed + + have gdef: "\n. (?g n)\(f n) \ (\x\(f n). (?g n)\x)" + proof + fix n + from closed have "\a b. f n = closed_int a b \ a \ b" .. + then obtain a and b where ff: "f n = closed_int a b" and "a \ b" by auto + hence "a \ b" by simp + hence "a\closed_int a b \ (\x\closed_int a b. a \ x)" by (rule closed_int_least) + with ff have "a\(f n) \ (\x\(f n). a \ x)" by simp + hence "\c. c\(f n) \ (\x\(f n). c \ x)" .. + thus "(?g n)\(f n) \ (\x\(f n). (?g n)\x)" by (rule someI_ex) + qed + + -- "A denotes the set of all left-most points of all the intervals ..." + moreover obtain A where Adef: "A = ?g ` \" by simp + ultimately have "\x. x\A" + proof - + have "(0::nat) \ \" by simp + moreover have "?g 0 = ?g 0" by simp + ultimately have "?g 0 \ ?g ` \" by (rule rev_image_eqI) + with Adef have "?g 0 \ A" by simp + thus ?thesis .. + qed + + -- "Now show that A is bounded above ..." + moreover have "\y. isUb (UNIV::real set) A y" + proof - + { + fix n + from ne have ex: "\x. x\(f n)" .. + from gdef have "(?g n)\(f n) \ (\x\(f n). (?g n)\x)" by simp + moreover + from closed have "\a b. f n = closed_int a b \ a \ b" .. + then obtain a and b where "f n = closed_int a b \ a \ b" by auto + hence "b\(f n) \ (\x\(f n). x \ b)" using closed_int_most by blast + ultimately have "\x\(f n). (?g n) \ b" by simp + with ex have "(?g n) \ b" by auto + hence "\b. (?g n) \ b" by auto + } + hence aux: "\n. \b. (?g n) \ b" .. + + have fs: "\n::nat. f n \ f 0" + proof (rule allI, induct_tac n) + show "f 0 \ f 0" by simp + next + fix n + assume "f n \ f 0" + moreover from subset have "f (Suc n) \ f n" .. + ultimately show "f (Suc n) \ f 0" by simp + qed + have "\n. (?g n)\(f 0)" + proof + fix n + from gdef have "(?g n)\(f n) \ (\x\(f n). (?g n)\x)" by simp + hence "?g n \ f n" .. + with fs show "?g n \ f 0" by auto + qed + moreover from closed + obtain a and b where "f 0 = closed_int a b" and alb: "a \ b" by blast + ultimately have "\n. ?g n \ closed_int a b" by auto + with alb have "\n. ?g n \ b" using closed_int_most by blast + with Adef have "\y\A. y\b" by auto + hence "A *<= b" by (unfold setle_def) + moreover have "b \ (UNIV::real set)" by simp + ultimately have "A *<= b \ b \ (UNIV::real set)" by simp + hence "isUb (UNIV::real set) A b" by (unfold isUb_def) + thus ?thesis by auto + qed + -- "by the Axiom Of Completeness, A has a least upper bound ..." + ultimately have "\t. isLub UNIV A t" by (rule reals_complete) + + -- "denote this least upper bound as t ..." + then obtain t where tdef: "isLub UNIV A t" .. + + -- "and finally show that this least upper bound is in all the intervals..." + have "\n. t \ f n" + proof + fix n::nat + from closed obtain a and b where + int: "f n = closed_int a b" and alb: "a \ b" by blast + + have "t \ a" + proof - + have "a \ A" + proof - + (* by construction *) + from alb int have ain: "a\f n \ (\x\f n. a \ x)" + using closed_int_least by blast + moreover have "\e. e\f n \ (\x\f n. e \ x) \ e = a" + proof clarsimp + fix e + assume ein: "e \ f n" and lt: "\x\f n. e \ x" + from lt ain have aux: "\x\f n. a \ x \ e \ x" by auto + + from ein aux have "a \ e \ e \ e" by auto + moreover from ain aux have "a \ a \ e \ a" by auto + ultimately show "e = a" by simp + qed + hence "\e. e\f n \ (\x\f n. e \ x) \ e = a" by simp + ultimately have "(?g n) = a" by (rule some_equality) + moreover + { + have "n = of_nat n" by simp + moreover have "of_nat n \ \" by simp + ultimately have "n \ \" + apply - + apply (subst(asm) eq_sym_conv) + apply (erule subst) + . + } + with Adef have "(?g n) \ A" by auto + ultimately show ?thesis by simp + qed + with tdef show "a \ t" by (rule isLubD2) + qed + moreover have "t \ b" + proof - + have "isUb UNIV A b" + proof - + { + from alb int have + ain: "b\f n \ (\x\f n. x \ b)" using closed_int_most by blast + + have subsetd: "\m. \n. f (n + m) \ f n" + proof (rule allI, induct_tac m) + show "\n. f (n + 0) \ f n" by simp + next + fix m n + assume pp: "\p. f (p + n) \ f p" + { + fix p + from pp have "f (p + n) \ f p" by simp + moreover from subset have "f (Suc (p + n)) \ f (p + n)" by auto + hence "f (p + (Suc n)) \ f (p + n)" by simp + ultimately have "f (p + (Suc n)) \ f p" by simp + } + thus "\p. f (p + Suc n) \ f p" .. + qed + have subsetm: "\\ \. \ \ \ \ (f \) \ (f \)" + proof ((rule allI)+, rule impI) + fix \::nat and \::nat + assume "\ \ \" + hence "\k. \ = \ + k" by (simp only: le_iff_add) + then obtain k where "\ = \ + k" .. + moreover + from subsetd have "f (\ + k) \ f \" by simp + ultimately show "f \ \ f \" by auto + qed + + fix m + { + assume "m \ n" + with subsetm have "f m \ f n" by simp + with ain have "\x\f m. x \ b" by auto + moreover + from gdef have "?g m \ f m \ (\x\f m. ?g m \ x)" by simp + ultimately have "?g m \ b" by auto + } + moreover + { + assume "\(m \ n)" + hence "m < n" by simp + with subsetm have sub: "(f n) \ (f m)" by simp + from closed obtain ma and mb where + "f m = closed_int ma mb \ ma \ mb" by blast + hence one: "ma \ mb" and fm: "f m = closed_int ma mb" by auto + from one alb sub fm int have "ma \ b" using closed_subset by blast + moreover have "(?g m) = ma" + proof - + from gdef have "?g m \ f m \ (\x\f m. ?g m \ x)" .. + moreover from one have + "ma \ closed_int ma mb \ (\x\closed_int ma mb. ma \ x)" + by (rule closed_int_least) + with fm have "ma\f m \ (\x\f m. ma \ x)" by simp + ultimately have "ma \ ?g m \ ?g m \ ma" by auto + thus "?g m = ma" by auto + qed + ultimately have "?g m \ b" by simp + } + ultimately have "?g m \ b" by (rule case_split) + } + with Adef have "\y\A. y\b" by auto + hence "A *<= b" by (unfold setle_def) + moreover have "b \ (UNIV::real set)" by simp + ultimately have "A *<= b \ b \ (UNIV::real set)" by simp + thus "isUb (UNIV::real set) A b" by (unfold isUb_def) + qed + with tdef show "t \ b" by (rule isLub_le_isUb) + qed + ultimately have "t \ closed_int a b" by (rule closed_mem) + with int show "t \ f n" by simp + qed + hence "t \ (\n. f n)" by auto + thus ?thesis by auto +qed + +section {* Generating the intervals *} + +subsubsection {* Existence of non-singleton closed intervals *} + +text {* This lemma asserts that given any non-singleton closed +interval (a,b) and any element c, there exists a closed interval that +is a subset of (a,b) and that does not contain c and is a +non-singleton itself. *} + +lemma closed_subset_ex: + fixes c::real + assumes alb: "a < b" + shows + "\ka kb. ka < kb \ closed_int ka kb \ closed_int a b \ c \ (closed_int ka kb)" +proof - + { + assume clb: "c < b" + { + assume cla: "c < a" + from alb cla clb have "c \ closed_int a b" by (unfold closed_int_def, auto) + with alb have + "a < b \ closed_int a b \ closed_int a b \ c \ closed_int a b" + by auto + hence + "\ka kb. ka < kb \ closed_int ka kb \ closed_int a b \ c \ (closed_int ka kb)" + by auto + } + moreover + { + assume ncla: "\(c < a)" + with clb have cdef: "a \ c \ c < b" by simp + obtain ka where kadef: "ka = (c + b)/2" by blast + + from kadef clb have kalb: "ka < b" by auto + moreover from kadef cdef have kagc: "ka > c" by simp + ultimately have "c\(closed_int ka b)" by (unfold closed_int_def, auto) + moreover from cdef kagc have "ka \ a" by simp + hence "closed_int ka b \ closed_int a b" by (unfold closed_int_def, auto) + ultimately have + "ka < b \ closed_int ka b \ closed_int a b \ c \ closed_int ka b" + using kalb by auto + hence + "\ka kb. ka < kb \ closed_int ka kb \ closed_int a b \ c \ (closed_int ka kb)" + by auto + + } + ultimately have + "\ka kb. ka < kb \ closed_int ka kb \ closed_int a b \ c \ (closed_int ka kb)" + by (rule case_split) + } + moreover + { + assume "\ (c < b)" + hence cgeb: "c \ b" by simp + + obtain kb where kbdef: "kb = (a + b)/2" by blast + with alb have kblb: "kb < b" by auto + with kbdef cgeb have "a < kb \ kb < c" by auto + moreover hence "c \ (closed_int a kb)" by (unfold closed_int_def, auto) + moreover from kblb have + "closed_int a kb \ closed_int a b" by (unfold closed_int_def, auto) + ultimately have + "a < kb \ closed_int a kb \ closed_int a b \ c\closed_int a kb" + by simp + hence + "\ka kb. ka < kb \ closed_int ka kb \ closed_int a b \ c \ (closed_int ka kb)" + by auto + } + ultimately show ?thesis by (rule case_split) +qed + +subsection {* newInt: Interval generation *} + +text {* Given a function f:@{text "\\\"}, newInt (Suc n) f returns a +closed interval such that @{text "newInt (Suc n) f \ newInt n f"} and +does not contain @{text "f (Suc n)"}. With the base case defined such +that @{text "(f 0)\newInt 0 f"}. *} + +subsubsection {* Definition *} + +consts newInt :: "nat \ (nat \ real) \ (real set)" +primrec +"newInt 0 f = closed_int (f 0 + 1) (f 0 + 2)" +"newInt (Suc n) f = + (SOME e. (\e1 e2. + e1 < e2 \ + e = closed_int e1 e2 \ + e \ (newInt n f) \ + (f (Suc n)) \ e) + )" + +subsubsection {* Properties *} + +text {* We now show that every application of newInt returns an +appropriate interval. *} + +lemma newInt_ex: + "\a b. a < b \ + newInt (Suc n) f = closed_int a b \ + newInt (Suc n) f \ newInt n f \ + f (Suc n) \ newInt (Suc n) f" +proof (induct n) + case 0 + + let ?e = "SOME e. \e1 e2. + e1 < e2 \ + e = closed_int e1 e2 \ + e \ closed_int (f 0 + 1) (f 0 + 2) \ + f (Suc 0) \ e" + + have "newInt (Suc 0) f = ?e" by auto + moreover + have "f 0 + 1 < f 0 + 2" by simp + with closed_subset_ex have + "\ka kb. ka < kb \ closed_int ka kb \ closed_int (f 0 + 1) (f 0 + 2) \ + f (Suc 0) \ (closed_int ka kb)" . + hence + "\e. \ka kb. ka < kb \ e = closed_int ka kb \ + e \ closed_int (f 0 + 1) (f 0 + 2) \ f (Suc 0) \ e" by simp + hence + "\ka kb. ka < kb \ ?e = closed_int ka kb \ + ?e \ closed_int (f 0 + 1) (f 0 + 2) \ f (Suc 0) \ ?e" + by (rule someI_ex) + ultimately have "\e1 e2. e1 < e2 \ + newInt (Suc 0) f = closed_int e1 e2 \ + newInt (Suc 0) f \ closed_int (f 0 + 1) (f 0 + 2) \ + f (Suc 0) \ newInt (Suc 0) f" by simp + thus + "\a b. a < b \ newInt (Suc 0) f = closed_int a b \ + newInt (Suc 0) f \ newInt 0 f \ f (Suc 0) \ newInt (Suc 0) f" + by simp +next + case (Suc n) + hence "\a b. + a < b \ + newInt (Suc n) f = closed_int a b \ + newInt (Suc n) f \ newInt n f \ + f (Suc n) \ newInt (Suc n) f" by simp + then obtain a and b where ab: "a < b \ + newInt (Suc n) f = closed_int a b \ + newInt (Suc n) f \ newInt n f \ + f (Suc n) \ newInt (Suc n) f" by auto + hence cab: "closed_int a b = newInt (Suc n) f" by simp + + let ?e = "SOME e. \e1 e2. + e1 < e2 \ + e = closed_int e1 e2 \ + e \ closed_int a b \ + f (Suc (Suc n)) \ e" + from cab have ni: "newInt (Suc (Suc n)) f = ?e" by auto + + from ab have "a < b" by simp + with closed_subset_ex have + "\ka kb. ka < kb \ closed_int ka kb \ closed_int a b \ + f (Suc (Suc n)) \ closed_int ka kb" . + hence + "\e. \ka kb. ka < kb \ e = closed_int ka kb \ + closed_int ka kb \ closed_int a b \ f (Suc (Suc n)) \ closed_int ka kb" + by simp + hence + "\e. \ka kb. ka < kb \ e = closed_int ka kb \ + e \ closed_int a b \ f (Suc (Suc n)) \ e" by simp + hence + "\ka kb. ka < kb \ ?e = closed_int ka kb \ + ?e \ closed_int a b \ f (Suc (Suc n)) \ ?e" by (rule someI_ex) + with ab ni show + "\ka kb. ka < kb \ + newInt (Suc (Suc n)) f = closed_int ka kb \ + newInt (Suc (Suc n)) f \ newInt (Suc n) f \ + f (Suc (Suc n)) \ newInt (Suc (Suc n)) f" by auto +qed + +lemma newInt_subset: + "newInt (Suc n) f \ newInt n f" + using newInt_ex by auto + + +text {* Another fundamental property is that no element in the range +of f is in the intersection of all closed intervals generated by +newInt. *} + +lemma newInt_inter: + "\n. f n \ (\n. newInt n f)" +proof + fix n::nat + { + assume n0: "n = 0" + moreover have "newInt 0 f = closed_int (f 0 + 1) (f 0 + 2)" by simp + ultimately have "f n \ newInt n f" by (unfold closed_int_def, simp) + } + moreover + { + assume "\ n = 0" + hence "n > 0" by simp + then obtain m where ndef: "n = Suc m" by (auto simp add: gr0_conv_Suc) + + from newInt_ex have + "\a b. a < b \ (newInt (Suc m) f) = closed_int a b \ + newInt (Suc m) f \ newInt m f \ f (Suc m) \ newInt (Suc m) f" . + then have "f (Suc m) \ newInt (Suc m) f" by auto + with ndef have "f n \ newInt n f" by simp + } + ultimately have "f n \ newInt n f" by (rule case_split) + thus "f n \ (\n. newInt n f)" by auto +qed + + +lemma newInt_notempty: + "(\n. newInt n f) \ {}" +proof - + let ?g = "\n. newInt n f" + have "\n. ?g (Suc n) \ ?g n" + proof + fix n + show "?g (Suc n) \ ?g n" by (rule newInt_subset) + qed + moreover have "\n. \a b. ?g n = closed_int a b \ a \ b" + proof + fix n::nat + { + assume "n = 0" + then have + "?g n = closed_int (f 0 + 1) (f 0 + 2) \ (f 0 + 1 \ f 0 + 2)" + by simp + hence "\a b. ?g n = closed_int a b \ a \ b" by blast + } + moreover + { + assume "\ n = 0" + then have "n > 0" by simp + then obtain m where nd: "n = Suc m" by (auto simp add: gr0_conv_Suc) + + have + "\a b. a < b \ (newInt (Suc m) f) = closed_int a b \ + (newInt (Suc m) f) \ (newInt m f) \ (f (Suc m)) \ (newInt (Suc m) f)" + by (rule newInt_ex) + then obtain a and b where + "a < b \ (newInt (Suc m) f) = closed_int a b" by auto + with nd have "?g n = closed_int a b \ a \ b" by auto + hence "\a b. ?g n = closed_int a b \ a \ b" by blast + } + ultimately show "\a b. ?g n = closed_int a b \ a \ b" by (rule case_split) + qed + ultimately show ?thesis by (rule NIP) +qed + + +section {* Final Theorem *} + +theorem real_non_denum: + shows "\ (\f::nat\real. surj f)" +proof -- "by contradiction" + assume "\f::nat\real. surj f" + then obtain f::"nat\real" where "surj f" by auto + hence rangeF: "range f = UNIV" by (rule surj_range) + -- "We now produce a real number x that is not in the range of f, using the properties of newInt. " + have "\x. x \ (\n. newInt n f)" using newInt_notempty by blast + moreover have "\n. f n \ (\n. newInt n f)" by (rule newInt_inter) + ultimately obtain x where "x \ (\n. newInt n f)" and "\n. f n \ x" by blast + moreover from rangeF have "x \ range f" by simp + ultimately show False by blast +qed + +end \ No newline at end of file diff -r 0e6ec4fd204c -r 5652a536b7e8 src/HOL/Real/Real.thy --- a/src/HOL/Real/Real.thy Sun Feb 12 10:42:19 2006 +0100 +++ b/src/HOL/Real/Real.thy Sun Feb 12 12:29:01 2006 +0100 @@ -1,4 +1,4 @@ theory Real -imports RComplete RealPow +imports ContNotDenum RealPow begin end \ No newline at end of file diff -r 0e6ec4fd204c -r 5652a536b7e8 src/HOL/Real/RealDef.thy --- a/src/HOL/Real/RealDef.thy Sun Feb 12 10:42:19 2006 +0100 +++ b/src/HOL/Real/RealDef.thy Sun Feb 12 12:29:01 2006 +0100 @@ -929,7 +929,6 @@ instance real :: number_ring by (intro_classes, simp add: real_number_of_def) - text{*Collapse applications of @{term real} to @{term number_of}*} lemma real_number_of [simp]: "real (number_of v :: int) = number_of v" by (simp add: real_of_int_def of_int_number_of_eq) @@ -945,6 +944,19 @@ setup real_arith_setup + +lemma real_diff_mult_distrib: + fixes a::real + shows "a * (b - c) = a * b - a * c" +proof - + have "a * (b - c) = a * (b + -c)" by simp + also have "\ = (b + -c) * a" by simp + also have "\ = b*a + (-c)*a" by (rule real_add_mult_distrib) + also have "\ = a*b - a*c" by simp + finally show ?thesis . +qed + + subsection{* Simprules combining x+y and 0: ARE THEY NEEDED?*} text{*Needed in this non-standard form by Hyperreal/Transcendental*} @@ -1027,7 +1039,6 @@ done - ML {* val real_lbound_gt_zero = thm"real_lbound_gt_zero";