(* Limite_de_sucesiones_no_decrecientes.thy -- Si u es una sucesión no decreciente y su límite es a, entonces u(n) ≤ a para todo n -- José A. Alonso Jiménez -- Sevilla, 27-julio-2024 -- ------------------------------------------------------------------ *) (* --------------------------------------------------------------------- -- En Isabelle/HOL, una sucesión u\<^sub>0, u\<^sub>1, u\<^sub>2, u\<^sub>3, ... se puede representar -- mediante una función (u : \ \ \) de forma que u(n) es u\<^sub>n. -- -- En Isabelle/HOL, se define que a es el límite de la sucesión u, por -- definition limite :: "(nat \ real) \ real \ bool" -- where "limite u a \ (\\>0. \N. \k\N. \u k - a\ < \)" -- y que la sucesión u es no decreciente por -- definition no_decreciente :: "(nat \ real) \ bool" -- where "no_decreciente u \ (\ n m. n \ m \ u n \ u m)" -- -- Demostrar que si u es una sucesión no decreciente y su límite es a, -- entonces u(n) \ a para todo n. -- ------------------------------------------------------------------ *) theory Limite_de_sucesiones_no_decrecientes imports Main HOL.Real begin definition limite :: "(nat \ real) \ real \ bool" where "limite u a \ (\\>0. \N. \k\N. \u k - a\ < \)" definition no_decreciente :: "(nat \ real) \ bool" where "no_decreciente u \ (\ n m. n \ m \ u n \ u m)" (* 1\ demostración *) lemma assumes "limite u a" "no_decreciente u" shows "\ n. u n \ a" proof (rule allI) fix n show "u n \ a" proof (rule ccontr) assume "\ u n \ a" then have "a < u n" by (rule not_le_imp_less) then have H : "u n - a > 0" by (simp only: diff_gt_0_iff_gt) then obtain m where hm : "\p\m. \u p - a\ < u n - a" using assms(1) limite_def by blast let ?k = "max n m" have "n \ ?k" by (simp only: assms(2) no_decreciente_def) then have "u n \ u ?k" using assms(2) no_decreciente_def by blast have "\u ?k - a\ < u n - a" by (simp only: hm) also have "\ \ u ?k - a" using \u n \ u ?k\ by (rule diff_right_mono) finally have "\u ?k - a\ < u ?k - a" by this then have "\ u ?k - a \ \u ?k - a\" by (simp only: not_le_imp_less) moreover have "u ?k - a \ \u ?k - a\" by (rule abs_ge_self) ultimately show False by (rule notE) qed qed (* 2\ demostración *) lemma assumes "limite u a" "no_decreciente u" shows "\ n. u n \ a" proof (rule allI) fix n show "u n \ a" proof (rule ccontr) assume "\ u n \ a" then have H : "u n - a > 0" by simp then obtain m where hm : "\p\m. \u p - a\ < u n - a" using assms(1) limite_def by blast let ?k = "max n m" have "\u ?k - a\ < u n - a" using hm by simp moreover have "u n \ u ?k" using assms(2) no_decreciente_def by simp ultimately have "\u ?k - a\ < u ?k - a" by simp then show False by simp qed qed (* 3\ demostración *) lemma assumes "limite u a" "no_decreciente u" shows "\ n. u n \ a" proof fix n show "u n \ a" proof (rule ccontr) assume "\ u n \ a" then obtain m where hm : "\p\m. \u p - a\ < u n - a" using assms(1) limite_def by fastforce let ?k = "max n m" have "\u ?k - a\ < u n - a" using hm by simp moreover have "u n \ u ?k" using assms(2) no_decreciente_def by simp ultimately show False by simp qed qed end