        {"id":768,"date":"2021-09-17T05:00:02","date_gmt":"2021-09-17T03:00:02","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=768"},"modified":"2021-09-14T12:06:10","modified_gmt":"2021-09-14T10:06:10","slug":"si-f-es-continua-en-a-y-el-limite-de-un-es-a-entonces-el-limite-de-fun-es-fa","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/si-f-es-continua-en-a-y-el-limite-de-un-es-a-entonces-el-limite-de-fun-es-fa\/","title":{"rendered":"Si f es continua en a y el l\u00edmite de u(n) es a, entonces el l\u00edmite de f(u(n)) es f(a)"},"content":{"rendered":"<p>En Lean, se puede definir que a es el l\u00edmite de la sucesi\u00f3n u por<\/p>\n<pre lang=\"text\">\n   def limite (u : \u2115 \u2192 \u211d) (a : \u211d) :=\n     \u2200 \u03b5 > 0, \u2203 k, \u2200 n \u2265 k, |u n - a| < \u03b5\n<\/pre>\n<p>y que f es continua en a por<\/p>\n<pre lang=\"text\">\n   def continua_en_punto (f : \u211d \u2192 \u211d) (a : \u211d) :=\n     \u2200 \u03b5 > 0, \u2203 \u03b4 > 0, \u2200 x, |x - a| \u2264 \u03b4 \u2192 |f x - f a| \u2264 \u03b5\n<\/pre>\n<p>Demostrar que si f es continua en a y el l\u00edmite de u\u2099 es a, entonces el l\u00edmite de f(u\u2099) es f(a).<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\n\nvariable {f : \u211d \u2192 \u211d}\nvariable {a : \u211d}\nvariable {u : \u2115 \u2192 \u211d}\n\nnotation `|`x`|` := abs x\n\ndef limite (u : \u2115 \u2192 \u211d) (a : \u211d) :=\n  \u2200 \u03b5 > 0, \u2203 k, \u2200 n \u2265 k, |u n - a| \u2264 \u03b5\n\ndef continua_en_punto (f : \u211d \u2192 \u211d) (a : \u211d) :=\n  \u2200 \u03b5 > 0, \u2203 \u03b4 > 0, \u2200 x, |x - a| \u2264 \u03b4 \u2192 |f x - f a| \u2264 \u03b5\n\nexample\n  (hf : continua_en_punto f a)\n  (hu : limite u a)\n  : limite (f \u2218 u) (f a) :=\nsorry\n<\/pre>\n<p>[expand title=\"Soluciones con Lean\"]<\/p>\n<pre lang=\"lean\">\r\nimport data.real.basic\r\n\r\nvariable {f : \u211d \u2192 \u211d}\r\nvariable {a : \u211d}\r\nvariable {u : \u2115 \u2192 \u211d}\r\n\r\nnotation `|`x`|` := abs x\r\n\r\ndef limite (u : \u2115 \u2192 \u211d) (a : \u211d) :=\r\n  \u2200 \u03b5 > 0, \u2203 k, \u2200 n \u2265 k, |u n - a| \u2264 \u03b5\r\n\r\ndef continua_en_punto (f : \u211d \u2192 \u211d) (a : \u211d) :=\r\n  \u2200 \u03b5 > 0, \u2203 \u03b4 > 0, \u2200 x, |x - a| \u2264 \u03b4 \u2192 |f x - f a| \u2264 \u03b5\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\nexample\r\n  (hf : continua_en_punto f a)\r\n  (hu : limite u a)\r\n  : limite (f \u2218 u) (f a) :=\r\nbegin\r\n  intros \u03b5 h\u03b5,\r\n  rcases hf \u03b5 h\u03b5 with \u27e8\u03b4, h\u03b41, h\u03b42\u27e9,\r\n  cases hu \u03b4 h\u03b41 with k hk,\r\n  use k,\r\n  intros n hn,\r\n  apply h\u03b42,\r\n  exact hk n hn,\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\nexample\r\n  (hf : continua_en_punto f a)\r\n  (hu : limite u a)\r\n  : limite (f \u2218 u) (f a) :=\r\nbegin\r\n  intros \u03b5 h\u03b5,\r\n  rcases hf \u03b5 h\u03b5 with \u27e8\u03b4, h\u03b41, h\u03b42\u27e9,\r\n  cases hu \u03b4 h\u03b41 with k hk,\r\n  exact \u27e8k, \u03bb n hn, h\u03b42 (u n) (hk n hn)\u27e9,\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\nexample\r\n  (hf : continua_en_punto f a)\r\n  (hu : limite u a)\r\n  : limite (f \u2218 u) (f a) :=\r\nbegin\r\n  intros \u03b5 h\u03b5,\r\n  obtain \u27e8\u03b4, h\u03b41, h\u03b42\u27e9 := hf \u03b5 h\u03b5,\r\n  obtain \u27e8k, hk\u27e9 := hu \u03b4 h\u03b41,\r\n  exact \u27e8k, \u03bb n hn, h\u03b42 (u n) (hk n hn)\u27e9,\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\/CS_de_continuidad.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 CS_de_continuidad\r\nimports Main HOL.Real\r\nbegin\r\n\r\ndefinition limite :: \"(nat \u21d2 real) \u21d2 real \u21d2 bool\" where\r\n  \"limite u c \u27f7 (\u2200\u03b5>0. \u2203k. \u2200n\u2265k. \u00a6u n - c\u00a6 \u2264 \u03b5)\"\r\n\r\ndefinition continua_en_punto :: \"(real \u21d2 real) \u21d2 real \u21d2 bool\" where\r\n  \"continua_en_punto f a \u27f7\r\n   (\u2200\u03b5>0. \u2203\u03b4>0. \u2200x. \u00a6x - a\u00a6 \u2264 \u03b4 \u27f6 \u00a6f x - f a\u00a6 \u2264 \u03b5)\"\r\n\r\n(* 1\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"continua_en_punto f a\"\r\n          \"limite u a\"\r\n  shows \"limite (f \u2218 u) (f a)\"\r\nproof (unfold limite_def; intro allI impI)\r\n  fix \u03b5 :: real\r\n  assume \"0 < \u03b5\"\r\n  then obtain \u03b4 where h\u03b41 : \"\u03b4 > 0\" and\r\n                      h\u03b42 :\" (\u2200x. \u00a6x - a\u00a6 \u2264 \u03b4 \u27f6 \u00a6f x - f a\u00a6 \u2264 \u03b5)\"\r\n    using assms(1) continua_en_punto_def by auto\r\n  obtain k where hk : \"\u2200n\u2265k. \u00a6u n - a\u00a6 \u2264 \u03b4\"\r\n    using assms(2) limite_def h\u03b41 by auto\r\n  have \"\u2200n\u2265k. \u00a6(f \u2218 u) n - f a\u00a6 \u2264 \u03b5\"\r\n  proof (intro allI impI)\r\n    fix n\r\n    assume \"n \u2265 k\"\r\n    then have \"\u00a6u n - a\u00a6 \u2264 \u03b4\"\r\n      using hk by auto\r\n    then show \"\u00a6(f \u2218 u) n - f a\u00a6 \u2264 \u03b5\"\r\n      using h\u03b42 by simp\r\n  qed\r\n  then show \"\u2203k. \u2200n\u2265k. \u00a6(f \u2218 u) n - f a\u00a6 \u2264 \u03b5\"\r\n    by auto\r\nqed\r\n\r\n(* 2\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"continua_en_punto f a\"\r\n          \"limite u a\"\r\n  shows \"limite (f \u2218 u) (f a)\"\r\nproof (unfold limite_def; intro allI impI)\r\n  fix \u03b5 :: real\r\n  assume \"0 < \u03b5\"\r\n  then obtain \u03b4 where h\u03b41 : \"\u03b4 > 0\" and\r\n                      h\u03b42 :\" (\u2200x. \u00a6x - a\u00a6 \u2264 \u03b4 \u27f6 \u00a6f x - f a\u00a6 \u2264 \u03b5)\"\r\n    using assms(1) continua_en_punto_def by auto\r\n  obtain k where hk : \"\u2200n\u2265k. \u00a6u n - a\u00a6 \u2264 \u03b4\"\r\n    using assms(2) limite_def h\u03b41 by auto\r\n  have \"\u2200n\u2265k. \u00a6(f \u2218 u) n - f a\u00a6 \u2264 \u03b5\"\r\n    using hk h\u03b42 by simp\r\n  then show \"\u2203k. \u2200n\u2265k. \u00a6(f \u2218 u) n - f a\u00a6 \u2264 \u03b5\"\r\n    by auto\r\nqed\r\n\r\n(* 3\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"continua_en_punto f a\"\r\n          \"limite u a\"\r\n  shows \"limite (f \u2218 u) (f a)\"\r\nproof (unfold limite_def; intro allI impI)\r\n  fix \u03b5 :: real\r\n  assume \"0 < \u03b5\"\r\n  then obtain \u03b4 where h\u03b41 : \"\u03b4 > 0\" and\r\n                      h\u03b42 :\" (\u2200x. \u00a6x - a\u00a6 \u2264 \u03b4 \u27f6 \u00a6f x - f a\u00a6 \u2264 \u03b5)\"\r\n    using assms(1) continua_en_punto_def by auto\r\n  obtain k where hk : \"\u2200n\u2265k. \u00a6u n - a\u00a6 \u2264 \u03b4\"\r\n    using assms(2) limite_def h\u03b41 by auto\r\n  then show \"\u2203k. \u2200n\u2265k. \u00a6(f \u2218 u) n - f a\u00a6 \u2264 \u03b5\"\r\n    using hk h\u03b42 by auto\r\nqed\r\n\r\n(* 4\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"continua_en_punto f a\"\r\n          \"limite u a\"\r\n  shows \"limite (f \u2218 u) (f a)\"\r\nproof (unfold limite_def; intro allI impI)\r\n  fix \u03b5 :: real\r\n  assume \"0 < \u03b5\"\r\n  then obtain \u03b4 where\r\n              h\u03b4 : \"\u03b4 > 0 \u2227 (\u2200x. \u00a6x - a\u00a6 \u2264 \u03b4 \u27f6 \u00a6f x - f a\u00a6 \u2264 \u03b5)\"\r\n    using assms(1) continua_en_punto_def by auto\r\n  then obtain k where \"\u2200n\u2265k. \u00a6u n - a\u00a6 \u2264 \u03b4\"\r\n    using assms(2) limite_def by auto\r\n  then show \"\u2203k. \u2200n\u2265k. \u00a6(f \u2218 u) n - f a\u00a6 \u2264 \u03b5\"\r\n    using h\u03b4 by auto\r\nqed\r\n\r\n(* 5\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"continua_en_punto f a\"\r\n          \"limite u a\"\r\n  shows \"limite (f \u2218 u) (f a)\"\r\n  using assms continua_en_punto_def limite_def\r\n  by force\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, se puede definir que a es el l\u00edmite de la sucesi\u00f3n u por def limite (u : \u2115 \u2192 \u211d) (a : \u211d) := \u2200 \u03b5 > 0, \u2203 k, \u2200 n \u2265 k, |u n &#8211; a| < \u03b5 y que f es continua en a por def continua_en_punto (f : \u211d \u2192 \u211d) (a : \u211d) := \u2200 \u03b5 > 0, \u2203 \u03b4 > 0, \u2200 x, |x &#8211; a| \u2264 \u03b4 \u2192 |f x &#8211; f a| \u2264 \u03b5 Demostrar que si f es continua en a y el l\u00edmite de u\u2099 es a, entonces el l\u00edmite de f(u\u2099) es f(a). Para ello, completar la siguiente teor\u00eda de Lean: import data.real.basic variable {f : \u211d \u2192 \u211d} variable {a :&#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":[279],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/768"}],"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=768"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/768\/revisions"}],"predecessor-version":[{"id":769,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/768\/revisions\/769"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}