(* Sufficient_condition_of_continuity.thy -- If f is continuous at a and the limit of u(n) is a, then the limit of f(u(n)) is f(a). -- José A. Alonso Jiménez -- Seville, September 4, 2024 -- ------------------------------------------------------------------ *) (* --------------------------------------------------------------------- -- In Isabelle/HOL, we can define that a is the limit of the sequence u -- by: -- definition is_limite :: "(nat \ real) \ real \ bool" where -- "is_limite u c \ (\\>0. \k. \n\k. \u n - c\ \ \)" -- and that f is continuous at a by: -- definition continuous_at :: "(real \ real) \ real \ bool" where -- "continuous_at f a \ -- (\\>0. \\>0. \x. \x - a\ \ \ \ \f x - f a\ \ \)" -- -- To prove that if the function f is continuous at the point a, and the -- sequence u(n) converges to a, then the sequence f(u(n)) converges to -- f(a). -- ------------------------------------------------------------------ *) theory Sufficient_condition_of_continuity imports Main HOL.Real begin definition is_limite :: "(nat \ real) \ real \ bool" where "is_limite u c \ (\\>0. \k. \n\k. \u n - c\ \ \)" definition continuous_at :: "(real \ real) \ real \ bool" where "continuous_at f a \ (\\>0. \\>0. \x. \x - a\ \ \ \ \f x - f a\ \ \)" (* Proof 1 *) lemma assumes "continuous_at f a" "is_limite u a" shows "is_limite (f \ u) (f a)" proof (unfold is_limite_def; intro allI impI) fix \ :: real assume "0 < \" then obtain \ where h\1 : "\ > 0" and h\2 :" (\x. \x - a\ \ \ \ \f x - f a\ \ \)" using assms(1) continuous_at_def by auto obtain k where hk : "\n\k. \u n - a\ \ \" using assms(2) is_limite_def h\1 by auto have "\n\k. \(f \ u) n - f a\ \ \" proof (intro allI impI) fix n assume "n \ k" then have "\u n - a\ \ \" using hk by auto then show "\(f \ u) n - f a\ \ \" using h\2 by simp qed then show "\k. \n\k. \(f \ u) n - f a\ \ \" by auto qed (* Proof 2 *) lemma assumes "continuous_at f a" "is_limite u a" shows "is_limite (f \ u) (f a)" proof (unfold is_limite_def; intro allI impI) fix \ :: real assume "0 < \" then obtain \ where h\1 : "\ > 0" and h\2 :" (\x. \x - a\ \ \ \ \f x - f a\ \ \)" using assms(1) continuous_at_def by auto obtain k where hk : "\n\k. \u n - a\ \ \" using assms(2) is_limite_def h\1 by auto have "\n\k. \(f \ u) n - f a\ \ \" using hk h\2 by simp then show "\k. \n\k. \(f \ u) n - f a\ \ \" by auto qed (* Proof 3 *) lemma assumes "continuous_at f a" "is_limite u a" shows "is_limite (f \ u) (f a)" proof (unfold is_limite_def; intro allI impI) fix \ :: real assume "0 < \" then obtain \ where h\1 : "\ > 0" and h\2 :" (\x. \x - a\ \ \ \ \f x - f a\ \ \)" using assms(1) continuous_at_def by auto obtain k where hk : "\n\k. \u n - a\ \ \" using assms(2) is_limite_def h\1 by auto then show "\k. \n\k. \(f \ u) n - f a\ \ \" using hk h\2 by auto qed (* Proof 4 *) lemma assumes "continuous_at f a" "is_limite u a" shows "is_limite (f \ u) (f a)" proof (unfold is_limite_def; intro allI impI) fix \ :: real assume "0 < \" then obtain \ where h\ : "\ > 0 \ (\x. \x - a\ \ \ \ \f x - f a\ \ \)" using assms(1) continuous_at_def by auto then obtain k where "\n\k. \u n - a\ \ \" using assms(2) is_limite_def by auto then show "\k. \n\k. \(f \ u) n - f a\ \ \" using h\ by auto qed (* Proof 5 *) lemma assumes "continuous_at f a" "is_limite u a" shows "is_limite (f \ u) (f a)" using assms continuous_at_def is_limite_def by force end