        {"id":553,"date":"2021-07-12T06:00:49","date_gmt":"2021-07-12T04:00:49","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=553"},"modified":"2021-07-04T17:08:13","modified_gmt":"2021-07-04T15:08:13","slug":"unicidad-del-limite-de-las-sucesiones-convergentes","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/unicidad-del-limite-de-las-sucesiones-convergentes\/","title":{"rendered":"Unicidad del l\u00edmite de las sucesiones convergentes"},"content":{"rendered":"<p>En Lean, una sucesi\u00f3n u\u2080, u\u2081, u\u2082, &#8230; se puede representar mediante una funci\u00f3n (u : \u2115 \u2192 \u211d) de forma que u(n) es u\u2099.<\/p>\n<p>Se define que a es el l\u00edmite de la sucesi\u00f3n u, por<\/p>\n<pre lang=\"text\">\n   def limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=\n   \u03bb u a, \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n - a| < \u03b5\n<\/pre>\n<p>donde se usa la notaci\u00f3n |x| para el valor absoluto de x<\/p>\n<pre lang=\"text\">\n   notation `|`x`|` := abs x\n<\/pre>\n<p>Demostrar que cada sucesi\u00f3n tiene como m\u00e1ximo un l\u00edmite.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\n\nvariables {u : \u2115 \u2192 \u211d}\nvariables {a b : \u211d}\n\nnotation `|`x`|` := abs x\n\ndef limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=\n\u03bb u c, \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n - c| < \u03b5\n\nexample\n  (ha : limite u a)\n  (hb : limite u b)\n  : a = b :=\nsorry\n<\/pre>\n<p>[expand title=\"Soluciones con Lean\"]<\/p>\n<pre lang=\"lean\">\r\nimport data.real.basic\r\n\r\nvariables {u : \u2115 \u2192 \u211d}\r\nvariables {a b : \u211d}\r\n\r\nnotation `|`x`|` := abs x\r\n\r\ndef limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=\r\n\u03bb u c, \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n - c| < \u03b5\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (ha : limite u a)\r\n  (hb : limite u b)\r\n  : a = b :=\r\nbegin\r\n  by_contra h,\r\n  wlog hab : a < b,\r\n  { have : a < b \u2228 a = b \u2228 b < a := lt_trichotomy a b,\r\n    tauto },\r\n  set \u03b5 := b - a with h\u03b5,\r\n  specialize ha (\u03b5\/2),\r\n  have h\u03b52 : \u03b5\/2 > 0 := by linarith,\r\n  specialize ha h\u03b52,\r\n  cases ha with A hA,\r\n  cases hb (\u03b5\/2) (by linarith) with B hB,\r\n  set N := max A B with hN,\r\n  have hAN : A \u2264 N := le_max_left A B,\r\n  have hBN : B \u2264 N := le_max_right A B,\r\n  specialize hA N hAN,\r\n  specialize hB N hBN,\r\n  rw abs_lt at hA hB,\r\n  linarith,\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (ha : limite u a)\r\n  (hb : limite u b)\r\n  : a = b :=\r\nbegin\r\n  by_contra h,\r\n  wlog hab : a < b,\r\n  { have : a < b \u2228 a = b \u2228 b < a := lt_trichotomy a b,\r\n    tauto },\r\n  set \u03b5 := b - a with h\u03b5,\r\n  cases ha (\u03b5\/2) (by linarith) with A hA,\r\n  cases hb (\u03b5\/2) (by linarith) with B hB,\r\n  set N := max A B with hN,\r\n  have hAN : A \u2264 N := le_max_left A B,\r\n  have hBN : B \u2264 N := le_max_right A B,\r\n  specialize hA N hAN,\r\n  specialize hB N hBN,\r\n  rw abs_lt at hA hB,\r\n  linarith,\r\nend\r\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/leanprover-community.github.io\/lean-web-editor\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus\/main\/src\/Unicidad_del_limite_de_las_sucesiones_convergentes.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p>En los comentarios se pueden escribir otras soluciones, escribiendo el c\u00f3digo entre una l\u00ednea con &#60;pre lang=&quot;lean&quot;&#62; y otra con &#60;\/pre&#62;<br \/>\n[\/expand]<\/p>\n<p>[expand title=\"Soluciones con Isabelle\/HOL\"]<\/p>\n<pre lang=\"isar\">\r\ntheory Unicidad_del_limite_de_las_sucesiones_convergentes\r\nimports Main HOL.Real\r\nbegin\r\n\r\ndefinition limite :: \"(nat \u21d2 real) \u21d2 real \u21d2 bool\"\r\n  where \"limite u c \u27f7 (\u2200\u03b5>0. \u2203k::nat. \u2200n\u2265k. \u00a6u n - c\u00a6 < \u03b5)\"\r\n\r\nlemma aux :\r\n  assumes \"limite u a\"\r\n          \"limite u b\"\r\n  shows   \"b \u2264 a\"\r\nproof (rule ccontr)\r\n  assume \"\u00ac b \u2264 a\"\r\n  let ?\u03b5 = \"b - a\"\r\n  have \"0 < ?\u03b5\/2\" \r\n    using \u2039\u00ac b \u2264 a\u203a by auto\r\n  obtain A where hA : \"\u2200n\u2265A. \u00a6u n - a\u00a6 < ?\u03b5\/2\" \r\n    using assms(1) limite_def \u20390 < ?\u03b5\/2\u203a by blast\r\n  obtain B where hB : \"\u2200n\u2265B. \u00a6u n - b\u00a6 < ?\u03b5\/2\" \r\n    using assms(2) limite_def \u20390 < ?\u03b5\/2\u203a by blast\r\n  let ?C = \"max A B\"\r\n  have hCa : \"\u2200n\u2265?C. \u00a6u n - a\u00a6 < ?\u03b5\/2\" \r\n    using hA by simp\r\n  have hCb : \"\u2200n\u2265?C. \u00a6u n - b\u00a6 < ?\u03b5\/2\" \r\n    using hB by simp\r\n  have \"\u2200n\u2265?C. \u00a6a - b\u00a6 < ?\u03b5\"\r\n  proof (intro allI impI)\r\n    fix n assume \"n \u2265 ?C\"\r\n    have \"\u00a6a - b\u00a6 = \u00a6(a - u n) + (u n - b)\u00a6\" by simp\r\n    also have \"\u2026 \u2264 \u00a6u n - a\u00a6 + \u00a6u n - b\u00a6\" by simp\r\n    finally show \"\u00a6a - b\u00a6 < b - a\" \r\n      using hCa hCb \u2039n \u2265 ?C\u203a by fastforce\r\n  qed\r\n  then show False by fastforce\r\nqed\r\n\r\ntheorem\r\n  assumes \"limite u a\"\r\n          \"limite u b\"\r\n  shows   \"a = b\"\r\nproof (rule antisym)\r\n  show \"a \u2264 b\" using assms(2) assms(1) by (rule aux)\r\nnext \r\n  show \"b \u2264 a\" using assms(1) assms(2) by (rule aux)\r\nqed\r\n\r\nend\r\n<\/pre>\n<p>En los comentarios se pueden escribir otras soluciones, escribiendo el c\u00f3digo entre una l\u00ednea con &#60;pre lang=&quot;isar&quot;&#62; y otra con &#60;\/pre&#62;<br \/>\n[\/expand]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>En Lean, una sucesi\u00f3n u\u2080, u\u2081, u\u2082, &#8230; se puede representar mediante una funci\u00f3n (u : \u2115 \u2192 \u211d) de forma que u(n) es u\u2099. Se define que a es el l\u00edmite de la sucesi\u00f3n u, por def limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop := \u03bb u a, \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n &#8211; a| < \u03b5 donde se usa la notaci\u00f3n |x| para el valor absoluto de x notation `|`x`|` := abs x Demostrar que cada sucesi\u00f3n tiene como m\u00e1ximo un l\u00edmite. Para ello, completar la siguiente teor\u00eda de Lean: import data.real.basic variables {u : \u2115 \u2192 \u211d} variables {a b : \u211d} notation `|`x`|` := abs x def limite : (\u2115 \u2192 \u211d)...\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":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_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\/553"}],"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=553"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/553\/revisions"}],"predecessor-version":[{"id":563,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/553\/revisions\/563"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}