        {"id":2234,"date":"2024-02-12T06:00:01","date_gmt":"2024-02-12T04:00:01","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=2234"},"modified":"2024-02-19T08:35:01","modified_gmt":"2024-02-19T06:35:01","slug":"12-feb-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/12-feb-24\/","title":{"rendered":"Si el l\u00edmite de la sucesi\u00f3n u\u2099 es a y c \u2208 \u211d, entonces el l\u00edmite de u\u2099+c es a+c"},"content":{"rendered":"\n<p>Demostrar con Lean4 que si el l\u00edmite de la sucesi\u00f3n &#92;(u\u2099&#92;) es &#92;(a&#92;) y &#92;(c \u2208 \u211d&#92;), entonces el l\u00edmite de &#92;(u\u2099+c&#92;) es &#92;(a+c&#92;).<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\nimport Mathlib.Tactic\nvariable {u : \u2115 \u2192 \u211d}\nvariable {a c : \u211d}\n\ndef limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=\n  fun u c \u21a6 \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n - c| < \u03b5\n\nexample\n  (h : limite u a)\n  : limite (fun i \u21a6 u i + c) (a + c) :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<h2>1. Demostraci\u00f3n en lenguaje natural<\/h2>\n<p>Sea &#92;(\u03b5 \u2208 \u211d&#92;) tal que &#92;(\u03b5 > 0&#92;). Tenemos que demostrar que<br \/>\n&#92;[ (\u2203 N)(\u2200 n \u2265 N)[|(u(n) + c) - (a + c)| &lt; \u03b5] &#92;tag{1} &#92;]<br \/>\nPuesto que el l\u00edmite de la sucesi\u00f3n &#92;(u&#92;) es &#92;(a&#92;), existe un &#92;(k&#92;) tal que<br \/>\n&#92;[ (\u2200 n \u2265 k)[|u(n) - a| &lt; \u03b5] &#92;tag{2} &#92;]<br \/>\nVeamos que con k se verifica (1); es decir, que<br \/>\n&#92;[ (\u2200 n \u2265 k)[|(u(n) + c) - (a + c)| &lt; \u03b5] &#92;]<br \/>\nSea &#92;(n \u2265 k&#92;). Entonces, por (2),<br \/>\n&#92;[ |u(n) - a| &lt; \u03b5 &#92;tag{3} &#92;]<br \/>\ny, por consiguiente,<br \/>\n&#92;begin{align}<br \/>\n   |(u(n) + c) - (a + c)| &amp;= |u(n) - a|   &#92;&#92;<br \/>\n                          &amp;&lt; \u03b5            &amp;&amp;&#92;text{[por (3)]}<br \/>\n&#92;end{align}<\/p>\n<h2>2. Demostraciones con Lean4<\/h2>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\nimport Mathlib.Tactic\nvariable {u : \u2115 \u2192 \u211d}\nvariable {a c : \u211d}\n\ndef limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=\n  fun u c \u21a6 \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n - c| < \u03b5\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : limite u a)\n  : limite (fun i \u21a6 u i + c) (a + c) :=\nby\n  intros \u03b5 h\u03b5\n  -- \u03b5 : \u211d\n  -- h\u03b5 : \u03b5 > 0\n  -- \u22a2 \u2203 N, \u2200 (n : \u2115), n \u2265 N \u2192 |(fun i => u i + c) n - (a + c)| < \u03b5\n  dsimp\n  -- \u22a2 \u2203 N, \u2200 (n : \u2115), n \u2265 N \u2192 |u n + c - (a + c)| < \u03b5\n  cases' h \u03b5 h\u03b5 with k hk\n  -- k : \u2115\n  -- hk : \u2200 (n : \u2115), n \u2265 k \u2192 |u n - a| < \u03b5\n  use k\n  -- \u22a2 \u2200 (n : \u2115), n \u2265 k \u2192 |u n + c - (a + c)| < \u03b5\n  intros n hn\n  -- n : \u2115\n  -- hn : n \u2265 k\n  calc |u n + c - (a + c)|\n       = |u n - a|         := by norm_num\n     _ < \u03b5                 := hk n hn\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : limite u a)\n  : limite (fun i \u21a6 u i + c) (a + c) :=\nby\n  intros \u03b5 h\u03b5\n  -- \u03b5 : \u211d\n  -- h\u03b5 : \u03b5 > 0\n  -- \u22a2 \u2203 N, \u2200 (n : \u2115), n \u2265 N \u2192 |(fun i => u i + c) n - (a + c)| < \u03b5\n  dsimp\n  -- \u22a2 \u2203 N, \u2200 (n : \u2115), n \u2265 N \u2192 |u n + c - (a + c)| < \u03b5\n  cases' h \u03b5 h\u03b5 with k hk\n  -- k : \u2115\n  -- hk : \u2200 (n : \u2115), n \u2265 k \u2192 |u n - a| < \u03b5\n  use k\n  -- \u22a2 \u2200 (n : \u2115), n \u2265 k \u2192 |u n + c - (a + c)| < \u03b5\n  intros n hn\n  -- n : \u2115\n  -- hn : n \u2265 k\n  -- \u22a2 |u n + c - (a + c)| < \u03b5\n  convert hk n hn using 2\n  -- \u22a2 u n + c - (a + c) = u n - a\n  ring\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : limite u a)\n  : limite (fun i \u21a6 u i + c) (a + c) :=\nby\n  intros \u03b5 h\u03b5\n  dsimp\n  convert h \u03b5 h\u03b5 using 6\n  ring\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : limite u a)\n  : limite (fun i \u21a6 u i + c) (a + c) :=\n  fun \u03b5 h\u03b5 \u21a6 (by convert h \u03b5 h\u03b5 using 6; ring)\n<\/pre>\n<p>Se puede interactuar con las demostraciones anteriores en <a href=\"https:\/\/live.lean-lang.org\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus2\/main\/src\/Limite_cuando_se_suma_una_constante.lean\" rel=\"noopener noreferrer\" target=\"_blank\">Lean 4 Web<\/a>.<\/p>\n<h2>3. Demostraciones con Isabelle\/HOL<\/h2>\n<pre lang=\"isar\">\ntheory Limite_cuando_se_suma_una_constante\nimports Main HOL.Real\nbegin\n\ndefinition limite :: \"(nat \u21d2 real) \u21d2 real \u21d2 bool\"\n  where \"limite u c \u27f7 (\u2200\u03b5>0. \u2203k::nat. \u2200n\u2265k. \u00a6u n - c\u00a6 < \u03b5)\"\n\n(* 1\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"limite u a\"\n  shows   \"limite (\u03bb i.  u i + c)  (a + c)\"\nproof (unfold limite_def)\n  show \"\u2200\u03b5>0. \u2203k. \u2200n\u2265k. \u00a6(u n + c) - (a + c)\u00a6 < \u03b5\"\n  proof (intro allI impI)\n    fix \u03b5 :: real\n    assume \"0 < \u03b5\"\n    then have \"\u2203k. \u2200n\u2265k. \u00a6u n - a\u00a6 < \u03b5\"\n      using assms limite_def by simp\n    then obtain k where \"\u2200n\u2265k. \u00a6u n - a\u00a6 < \u03b5\"\n      by (rule exE)\n    then have \"\u2200n\u2265k. \u00a6(u n + c) - (a + c)\u00a6 < \u03b5\"\n      by simp\n    then show \"\u2203k. \u2200n\u2265k. \u00a6(u n + c) - (a + c)\u00a6 < \u03b5\"\n      by (rule exI)\n  qed\nqed\n\n(* 2\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"limite u a\"\n  shows   \"limite (\u03bb i.  u i + c)  (a + c)\"\n  using assms limite_def\n  by simp\n\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si el l\u00edmite de la sucesi\u00f3n &#92;(u\u2099&#92;) es &#92;(a&#92;) y &#92;(c \u2208 \u211d&#92;), entonces el l\u00edmite de &#92;(u\u2099+c&#92;) es &#92;(a+c&#92;). Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Real.Basic import Mathlib.Tactic variable {u : \u2115 \u2192 \u211d} variable {a c : \u211d} def limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop := fun u c \u21a6 \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n &#8211; c| < \u03b5 example (h : limite u a) : limite (fun i \u21a6 u i + c) (a + c) := by sorry\n<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2234"}],"collection":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/comments?post=2234"}],"version-history":[{"count":4,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2234\/revisions"}],"predecessor-version":[{"id":2237,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2234\/revisions\/2237"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=2234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=2234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=2234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}