        {"id":735,"date":"2021-09-04T06:00:41","date_gmt":"2021-09-04T04:00:41","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=735"},"modified":"2021-08-30T14:05:37","modified_gmt":"2021-08-30T12:05:37","slug":"si-a-es-un-punto-de-acumulacion-de-la-sucesion-de-cauchy-u-entonces-a-es-el-limite-de-u","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/si-a-es-un-punto-de-acumulacion-de-la-sucesion-de-cauchy-u-entonces-a-es-el-limite-de-u\/","title":{"rendered":"Si a es un punto de acumulaci\u00f3n de la sucesi\u00f3n de Cauchy u, entonces a es el l\u00edmite de u"},"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>Para extraer una subsucesi\u00f3n se aplica una funci\u00f3n de extracci\u00f3n queconserva el orden; por ejemplo, la subsucesi\u00f3n<\/p>\n<pre lang=\"text\">\r\n   u\u2092, u\u2082, u\u2084, u\u2086, ...\r\n<\/pre>\n<p>se ha obtenido con la funci\u00f3n de extracci\u00f3n \u03c6 tal que \u03c6(n) = 2*n.<\/p>\n<p>En Lean, se puede definir que \u03c6 es una funci\u00f3n de extracci\u00f3n por<\/p>\n<pre lang=\"text\">\r\n   def extraccion (\u03c6 : \u2115 \u2192 \u2115) :=\r\n     \u2200 n m, n < m \u2192 \u03c6 n < \u03c6 m\r\n<\/pre>\n<p>que a es un l\u00edmite de u por<\/p>\n<pre lang=\"text\">\r\n   def limite (u : \u2115 \u2192 \u211d) (a : \u211d) :=\r\n     \u2200 \u03b5 > 0, \u2203 N, \u2200 k \u2265 N, |u k - a| < \u03b5\r\n<\/pre>\n<p>que a es un punto de acumulaci\u00f3n de u por<\/p>\n<pre lang=\"text\">\r\n   def punto_acumulacion (u : \u2115 \u2192 \u211d) (a : \u211d) :=\r\n     \u2203 \u03c6, extraccion \u03c6 \u2227 limite (u \u2218 \u03c6) a\r\n<\/pre>\n<p>que la sucesi\u00f3n u es de Cauchy por<\/p>\n<pre lang=\"text\">\r\n   def suc_cauchy (u : \u2115 \u2192 \u211d) :=\r\n     \u2200 \u03b5 > 0, \u2203 N, \u2200 p \u2265 N, \u2200 q \u2265 N, |u p - u q| < \u03b5\r\n<\/pre>\n<p>Demostrar que si u es una sucesi\u00f3n de Cauchy y a es un punto de acumulaci\u00f3n de u, entonces a es el l\u00edmite de u.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\r\nimport data.real.basic\r\nopen nat\r\n\r\nvariable  {u : \u2115 \u2192 \u211d}\r\nvariables {a : \u211d}\r\nvariable  {\u03c6 : \u2115 \u2192 \u2115}\r\n\r\nnotation `|`x`|` := abs x\r\n\r\ndef extraccion (\u03c6 : \u2115 \u2192 \u2115) :=\r\n  \u2200 n m, n < m \u2192 \u03c6 n < \u03c6 m\r\n\r\ndef limite (u : \u2115 \u2192 \u211d) (l : \u211d) : Prop :=\r\n  \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n - l| < \u03b5\r\n\r\ndef punto_acumulacion (u : \u2115 \u2192 \u211d) (a : \u211d) :=\r\n  \u2203 \u03c6, extraccion \u03c6 \u2227 limite (u \u2218 \u03c6) a\r\n\r\ndef suc_cauchy (u : \u2115 \u2192 \u211d) :=\r\n  \u2200 \u03b5 > 0, \u2203 N, \u2200 p \u2265 N, \u2200 q \u2265 N, |u p - u q| < \u03b5\r\n\r\nexample\r\n  (hu : suc_cauchy u)\r\n  (ha : punto_acumulacion u a)\r\n  : limite u a :=\r\nsorry\r\n<\/pre>\n<p>[expand title=\"Soluciones con Lean\"]<\/p>\n<pre lang=\"lean\">\r\nimport data.real.basic\r\nopen nat\r\n\r\nvariable  {u : \u2115 \u2192 \u211d}\r\nvariables {a : \u211d}\r\nvariable  {\u03c6 : \u2115 \u2192 \u2115}\r\n\r\nnotation `|`x`|` := abs x\r\n\r\ndef extraccion (\u03c6 : \u2115 \u2192 \u2115) :=\r\n  \u2200 n m, n < m \u2192 \u03c6 n < \u03c6 m\r\n\r\ndef limite (u : \u2115 \u2192 \u211d) (l : \u211d) : Prop :=\r\n  \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n - l| < \u03b5\r\n\r\ndef punto_acumulacion (u : \u2115 \u2192 \u211d) (a : \u211d) :=\r\n  \u2203 \u03c6, extraccion \u03c6 \u2227 limite (u \u2218 \u03c6) a\r\n\r\ndef suc_cauchy (u : \u2115 \u2192 \u211d) :=\r\n  \u2200 \u03b5 > 0, \u2203 N, \u2200 p \u2265 N, \u2200 q \u2265 N, |u p - u q| < \u03b5\r\n\r\nlemma aux1\r\n  (h : extraccion \u03c6)\r\n  : \u2200 n, n \u2264 \u03c6 n :=\r\nbegin\r\n  intro n,\r\n  induction n with m HI,\r\n  { exact nat.zero_le (\u03c6 0), },\r\n  { apply nat.succ_le_of_lt,\r\n    calc m \u2264 \u03c6 m        : HI\r\n       ... < \u03c6 (succ m) : h m (m+1) (lt_add_one m), },\r\nend\r\n\r\nlemma aux2\r\n  (h : extraccion \u03c6)\r\n  : \u2200 N N', \u2203 n \u2265 N', \u03c6 n \u2265 N :=\r\n\u03bb N N', \u27e8max N N', \u27e8le_max_right N N',\r\n                    le_trans (le_max_left N N')\r\n                             (aux1 h (max N N'))\u27e9\u27e9\r\n\r\nlemma cerca_acumulacion\r\n  (h : punto_acumulacion u a)\r\n  : \u2200 \u03b5 > 0, \u2200 N, \u2203 n \u2265 N, |u n - a| < \u03b5 :=\r\nbegin\r\n  intros \u03b5 h\u03b5 N,\r\n  rcases h with \u27e8\u03c6, h\u03c61, h\u03c62\u27e9,\r\n  cases h\u03c62 \u03b5 h\u03b5 with N' hN',\r\n  rcases aux2 h\u03c61 N N' with \u27e8m, hm, hm'\u27e9,\r\n  exact \u27e8\u03c6 m, hm', hN' _ hm\u27e9,\r\nend\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\nexample\r\n  (hu : suc_cauchy u)\r\n  (ha : punto_acumulacion u a)\r\n  : limite u a :=\r\nbegin\r\n  unfold limite,\r\n  intros \u03b5 h\u03b5,\r\n  unfold suc_cauchy at hu,\r\n  cases hu (\u03b5\/2) (half_pos h\u03b5) with N hN,\r\n  use N,\r\n  have ha' : \u2203 N' \u2265 N, |u N' - a| < \u03b5\/2,\r\n    apply cerca_acumulacion ha (\u03b5\/2) (half_pos h\u03b5),\r\n  cases ha' with N' h,\r\n  cases h with hNN' hN',\r\n  intros n hn,\r\n  calc   |u n - a|\r\n       = |(u n - u N') + (u N' - a)| : by ring_nf\r\n   ... \u2264 |u n - u N'| + |u N' - a|   : abs_add (u n - u N') (u N' - a)\r\n   ... < \u03b5\/2 + |u N' - a|            : add_lt_add_right (hN n hn N' hNN') _\r\n   ... < \u03b5\/2 + \u03b5\/2                   : add_lt_add_left hN' (\u03b5 \/ 2)\r\n   ... = \u03b5                           : add_halves \u03b5\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\nexample\r\n  (hu : suc_cauchy u)\r\n  (ha : punto_acumulacion u a)\r\n  : limite u a :=\r\nbegin\r\n  intros \u03b5 h\u03b5,\r\n  cases hu (\u03b5\/2) (by linarith) with N hN,\r\n  use N,\r\n  have ha' : \u2203 N' \u2265 N, |u N' - a| < \u03b5\/2,\r\n    apply cerca_acumulacion ha (\u03b5\/2) (by linarith),\r\n  rcases ha' with \u27e8N', hNN', hN'\u27e9,\r\n  intros n hn,\r\n  calc  |u n - a|\r\n      = |(u n - u N') + (u N' - a)| : by ring_nf\r\n  ... \u2264 |u n - u N'| + |u N' - a|   : by simp [abs_add]\r\n  ... < \u03b5                           : by linarith [hN n hn N' hNN'],\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\/Si_a_es_un_punto_de_acumulacion_de_la_sucesion_de_Cauchy_u,_entonces_a_es_el_limite_de_u.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 \"Si_a_es_un_punto_de_acumulacion_de_la_sucesion_de_Cauchy_u,_entonces_a_es_el_limite_de_u\"\r\nimports Main HOL.Real\r\nbegin\r\n\r\ndefinition extraccion :: \"(nat \u21d2 nat) \u21d2 bool\" where\r\n  \"extraccion \u03c6 \u27f7 (\u2200 n m. n < m \u27f6 \u03c6 n < \u03c6 m)\"\r\n\r\ndefinition limite :: \"(nat \u21d2 real) \u21d2 real \u21d2 bool\"\r\n  where \"limite u a \u27f7 (\u2200\u03b5>0. \u2203N. \u2200k\u2265N. \u00a6u k - a\u00a6 < \u03b5)\"\r\n\r\ndefinition punto_acumulacion :: \"(nat \u21d2 real) \u21d2 real \u21d2 bool\"\r\n  where \"punto_acumulacion u a \u27f7 (\u2203\u03c6. extraccion \u03c6 \u2227 limite (u \u2218 \u03c6) a)\"\r\n\r\ndefinition suc_cauchy :: \"(nat \u21d2 real) \u21d2 bool\"\r\n  where \"suc_cauchy u \u27f7 (\u2200\u03b5>0. \u2203k. \u2200m\u2265k. \u2200n\u2265k. \u00a6u m - u n\u00a6 < \u03b5)\"\r\n\r\n(* Lemas auxiliares *)\r\n\r\nlemma aux1 :\r\n  assumes \"extraccion \u03c6\"\r\n  shows   \"n \u2264 \u03c6 n\"\r\nproof (induct n)\r\n  show \"0 \u2264 \u03c6 0\" by simp\r\nnext\r\n  fix n assume HI : \"n \u2264 \u03c6 n\"\r\n  then show \"Suc n \u2264 \u03c6 (Suc n)\"\r\n    using assms extraccion_def\r\n    by (metis Suc_leI lessI order_le_less_subst1)\r\nqed\r\n\r\nlemma aux2 :\r\n  assumes \"extraccion \u03c6\"\r\n  shows   \"\u2200 N N'. \u2203 k \u2265 N'. \u03c6 k \u2265 N\"\r\nproof (intro allI)\r\n  fix N N' :: nat\r\n  have \"max N N' \u2265 N' \u2227 \u03c6 (max N N') \u2265 N\"\r\n    by (meson assms aux1 max.bounded_iff max.cobounded2)\r\n  then show \"\u2203k \u2265 N'. \u03c6 k \u2265 N\"\r\n    by blast\r\nqed\r\n\r\nlemma cerca_acumulacion :\r\n  assumes \"punto_acumulacion u a\"\r\n  shows   \"\u2200\u03b5>0. \u2200 N. \u2203k\u2265N. \u00a6u k - a\u00a6 < \u03b5\"\r\nproof (intro allI impI)\r\n  fix \u03b5 :: real and N :: nat\r\n  assume \"\u03b5 > 0\"\r\n  obtain \u03c6 where h\u03c61 : \"extraccion \u03c6\"\r\n             and h\u03c62 : \"limite (u \u2218 \u03c6) a\"\r\n    using assms punto_acumulacion_def by blast\r\n  obtain N' where hN' : \"\u2200k\u2265N'. \u00a6(u \u2218 \u03c6) k - a\u00a6 < \u03b5\"\r\n    using h\u03c62 limite_def \u2039\u03b5 > 0\u203a by auto\r\n  obtain m where \"m \u2265 N' \u2227 \u03c6 m \u2265 N\"\r\n    using aux2 h\u03c61 by blast\r\n  then show \"\u2203k\u2265N. \u00a6u k - a\u00a6 < \u03b5\"\r\n    using hN' by auto\r\nqed\r\n\r\n(* Demostraci\u00f3n *)\r\nlemma\r\n  assumes \"suc_cauchy u\"\r\n          \"punto_acumulacion u a\"\r\n  shows   \"limite u a\"\r\nproof (unfold limite_def; intro allI impI)\r\n  fix \u03b5 :: real\r\n  assume \"\u03b5 > 0\"\r\n  then have \"\u03b5\/2 > 0\"\r\n    by simp\r\n  then obtain N where hN : \"\u2200m\u2265N. \u2200n\u2265N. \u00a6u m - u n\u00a6 < \u03b5\/2\"\r\n    using assms(1) suc_cauchy_def\r\n    by blast\r\n  have \"\u2200k\u2265N. \u00a6u k - a\u00a6 < \u03b5\"\r\n  proof (intro allI impI)\r\n    fix k\r\n    assume hk : \"k \u2265 N\"\r\n    obtain N' where hN'1 : \"N' \u2265 N\" and\r\n                    hN'2 : \"\u00a6u N' - a\u00a6 < \u03b5\/2\"\r\n      using assms(2) cerca_acumulacion \u2039\u03b5\/2 > 0\u203a by blast\r\n    have \"\u00a6u k - a\u00a6 = \u00a6(u k - u N') + (u N'  - a)\u00a6\"\r\n      by simp\r\n    also have \"\u2026 \u2264 \u00a6u k - u N'\u00a6 + \u00a6u N'  - a\u00a6\"\r\n      by simp\r\n    also have \"\u2026 < \u03b5\/2 + \u00a6u N'  - a\u00a6\"\r\n      using hk hN hN'1 by auto\r\n    also have \"\u2026 < \u03b5\/2 + \u03b5\/2\"\r\n      using hN'2 by auto\r\n    also have \"\u2026 = \u03b5\"\r\n      by simp\r\n    finally show \"\u00a6u k - a\u00a6 < \u03b5\" .\r\n  qed\r\n  then show \"\u2203N. \u2200k\u2265N. \u00a6u k - a\u00a6 < \u03b5\"\r\n    by auto\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. Para extraer una subsucesi\u00f3n se aplica una funci\u00f3n de extracci\u00f3n queconserva el orden; por ejemplo, la subsucesi\u00f3n u\u2092, u\u2082, u\u2084, u\u2086, &#8230; se ha obtenido con la funci\u00f3n de extracci\u00f3n \u03c6 tal que \u03c6(n) = 2*n. En Lean, se puede definir que \u03c6 es una funci\u00f3n de extracci\u00f3n por def extraccion (\u03c6 : \u2115 \u2192 \u2115) := \u2200 n m, n < m \u2192 \u03c6 n < \u03c6 m que a es un l\u00edmite de u por def limite (u : \u2115 \u2192 \u211d) (a : \u211d) := \u2200 \u03b5 > 0, \u2203 N, \u2200 k \u2265 N, |u k&#8230;<\/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":[90,77,92,177,115,179,186,191,76,60,190,100,180,114,83,87,207,206,109,198,80,49,88,169,43,63,183,182,184,89,173,181,171,170,45,82,99,187,46],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/735"}],"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=735"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/735\/revisions"}],"predecessor-version":[{"id":736,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/735\/revisions\/736"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}