        {"id":577,"date":"2021-07-17T07:02:55","date_gmt":"2021-07-17T05:02:55","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=577"},"modified":"2021-07-17T07:17:47","modified_gmt":"2021-07-17T05:17:47","slug":"producto-de-sucesiones-convergentes-a-cero","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/producto-de-sucesiones-convergentes-a-cero\/","title":{"rendered":"Producto de sucesiones convergentes a cero"},"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 si las sucesiones u(n) y v(n) convergen a cero, entonces u(n)\u00b7v(n) tambi\u00e9n converge a cero.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\nimport tactic\n\nvariables {u v : \u2115 \u2192 \u211d}\nvariables {: \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  (hu : limite u 0)\n  (hv : limite v 0)\n  : limite (u * v) 0 :=\nsorry\n<\/pre>\n<p>[expand title=\"Soluciones con Lean\"]<\/p>\n<pre lang=\"lean\">\r\nimport data.real.basic\r\nimport tactic\r\n\r\nvariables {u v : \u2115 \u2192 \u211d}\r\nvariables {: \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  (hu : limite u 0)\r\n  (hv : limite v 0)\r\n  : limite (u * v) 0 :=\r\nbegin\r\n  intros \u03b5 h\u03b5,\r\n  cases hu \u03b5 h\u03b5 with U hU,\r\n  cases hv 1 zero_lt_one with V hV,\r\n  set N := max U V with hN,\r\n  use N,\r\n  intros n hn,\r\n  specialize hU n (le_of_max_le_left hn),\r\n  specialize hV n (le_of_max_le_right hn),\r\n  rw sub_zero at *,\r\n  calc |(u * v) n|\r\n       = |u n * v n|   : rfl\r\n   ... = |u n| * |v n| : abs_mul (u n) (v n)\r\n   ... < \u03b5 * 1         : mul_lt_mul'' hU hV (abs_nonneg (u n)) (abs_nonneg (v n))\r\n   ... = \u03b5             : mul_one \u03b5,\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (hu : limite u 0)\r\n  (hv : limite v 0)\r\n  : limite (u * v) 0 :=\r\nbegin\r\n  intros \u03b5 h\u03b5,\r\n  cases hu \u03b5 h\u03b5 with U hU,\r\n  cases hv 1 (by linarith) with V hV,\r\n  set N := max U V with hN,\r\n  use N,\r\n  intros n hn,\r\n  specialize hU n (le_of_max_le_left hn),\r\n  specialize hV n (le_of_max_le_right hn),\r\n  rw sub_zero at *,\r\n  calc |(u * v) n|\r\n       = |u n * v n|   : rfl\r\n   ... = |u n| * |v n| : abs_mul (u n) (v n)\r\n   ... < \u03b5 * 1         : by { apply mul_lt_mul'' hU hV ; simp [abs_nonneg] }\r\n   ... = \u03b5             : mul_one \u03b5,\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (hu : limite u 0)\r\n  (hv : limite v 0)\r\n  : limite (u * v) 0 :=\r\nbegin\r\n  intros \u03b5 h\u03b5,\r\n  cases hu \u03b5 h\u03b5 with U hU,\r\n  cases hv 1 (by linarith) with V hV,\r\n  set N := max U V with hN,\r\n  use N,\r\n  intros n hn,\r\n  have hUN : U \u2264 N := le_max_left U V,\r\n  have hVN : V \u2264 N := le_max_right U V,\r\n  specialize hU n (by linarith),\r\n  specialize hV n (by linarith),\r\n  rw sub_zero at \u22a2 hU hV,\r\n  rw pi.mul_apply,\r\n  rw abs_mul,\r\n  convert mul_lt_mul'' hU hV _ _, simp,\r\n  all_goals {apply abs_nonneg},\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\/Producto_de_sucesiones_convergentes_a_cero.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 Producto_de_sucesiones_convergentes_a_cero\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\r\n  assumes \"limite u 0\"\r\n          \"limite v 0\"\r\n  shows   \"limite (\u03bb n. u n * v n) 0\"\r\nproof (unfold limite_def; intro allI impI)\r\n  fix \u03b5 :: real\r\n  assume  h\u03b5 : \"0 < \u03b5\"\r\n  then obtain U where hU : \"\u2200n\u2265U. \u00a6u n - 0\u00a6 < \u03b5\"\r\n    using assms(1) limite_def\r\n    by auto\r\n  obtain V where hV : \"\u2200n\u2265V. \u00a6v n - 0\u00a6 < 1\"\r\n    using h\u03b5 assms(2) limite_def\r\n    by fastforce\r\n  have \"\u2200n\u2265max U V. \u00a6u n * v n - 0\u00a6 < \u03b5\"\r\n  proof (intro allI impI)\r\n    fix n\r\n    assume hn : \"max U V \u2264 n\"\r\n    then have \"U \u2264 n\"\r\n      by simp\r\n    then have \"\u00a6u n - 0\u00a6 < \u03b5\"\r\n      using hU by blast\r\n    have hnV : \"V \u2264 n\"\r\n      using hn by simp\r\n    then have \"\u00a6v n - 0\u00a6 < 1\"\r\n      using hV by blast\r\n    have \"\u00a6u n * v n - 0\u00a6 = \u00a6(u n - 0) * (v n - 0)\u00a6\"\r\n      by simp\r\n    also have \"\u2026 = \u00a6u n - 0\u00a6 * \u00a6v n - 0\u00a6\"\r\n      by (simp add: abs_mult)\r\n    also have \"\u2026 < \u03b5 * 1\"\r\n      using \u2039\u00a6u n - 0\u00a6 < \u03b5\u203a \u2039\u00a6v n - 0\u00a6 < 1\u203a\r\n      by (rule abs_mult_less)\r\n    also have \"\u2026 = \u03b5\"\r\n      by simp\r\n    finally show \"\u00a6u n * v n - 0\u00a6 < \u03b5\"\r\n      by this\r\n  qed\r\n  then show \"\u2203k. \u2200n\u2265k. \u00a6u n * v n - 0\u00a6 < \u03b5\"\r\n    by (rule exI)\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 si las sucesiones u(n) y v(n) convergen a cero, entonces u(n)\u00b7v(n) tambi\u00e9n converge a cero. Para ello, completar la siguiente teor\u00eda de Lean: import data.real.basic import tactic variables {u v : \u2115 \u2192 \u211d} variables {: \u211d} notation `|`x`|`...\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\/577"}],"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=577"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/577\/revisions"}],"predecessor-version":[{"id":579,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/577\/revisions\/579"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}