{"id":7528,"date":"2021-01-03T06:00:50","date_gmt":"2021-01-03T05:00:50","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/?p=7528"},"modified":"2021-01-02T18:07:32","modified_gmt":"2021-01-02T17:07:32","slug":"formatus-teorema-del-emparedado","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/formatus-teorema-del-emparedado\/","title":{"rendered":"ForMatUS: Pruebas en Lean del teorema del emparedado"},"content":{"rendered":"<p>He a\u00f1adido a la lista <a href=\"https:\/\/bit.ly\/2FcUrwQ\">L\u00f3gica con Lean<\/a> el v\u00eddeo <a href=\"https:\/\/youtu.be\/biVyszjuQjg\">Teorema del emparedado<\/a> en el que se comentan pruebas en Lean del teorema del emparedado:<\/p>\n<blockquote><p>Si dos sucesiones tienen el mismo l\u00edmite, entonces las sucesiones que est\u00e1n comprendidas entre \u00e9stas tambi\u00e9n tienen el mismo l\u00edmite.<\/p><\/blockquote>\n<p>A continuaci\u00f3n, se muestra el v\u00eddeo<\/p>\n<p><center><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/biVyszjuQjg\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/p>\n<p><\/center>y el <a href=\"https:\/\/bit.ly\/386VqdB\">c\u00f3digo<\/a> de la teor\u00eda utilizada<\/p>\n<pre lang=\"lean\">import data.real.basic\n\nvariables (u v w : \u2115 \u2192 \u211d)\nvariable  (a : \u211d)\n\n-- ----------------------------------------------------\n-- Ejercicio 1. Definir la notaci\u00f3n |x| para el valor\n-- absoluto de x.\n-- ----------------------------------------------------\n\nnotation `|`x`|` := abs x\n\n-- ----------------------------------------------------\n-- Ejercicio 2. Definir la funci\u00f3n\n--    limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop\n-- tal que (limite u c) expresa que c es el l\u00edmite de\n-- la sucesi\u00f3n u.\n-- ----------------------------------------------------\n\ndef limite : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=\n\u03bb u c, \u2200 \u03b5 &gt; 0, \u2203 N, \u2200 n \u2265 N, |u n - c| \u2264 \u03b5\n\n-- ----------------------------------------------------\n-- Ejercicio 3. Demostrar que si dos sucesiones tienen\n-- el mismo l\u00edmite, entonces las sucesiones que est\u00e1n\n-- comprendidas entre \u00e9stas tambi\u00e9n tienen el mismo\n-- l\u00edmite.\n-- ----------------------------------------------------\n\n-- Nota. En la demostraci\u00f3n se usar\u00e1 el siguiente lema:\nlemma max_ge_iff\n  {p q r : \u2115}\n  : r \u2265 max p q \u2194 r \u2265 p \u2227 r \u2265 q :=\nmax_le_iff\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (hu : limite u a)\n  (hw : limite w a)\n  (h : \u2200 n, u n \u2264 v n)\n  (h' : \u2200 n, v n \u2264 w n) :\n  limite v a :=\nbegin\n  intros \u03b5 h\u03b5,\n  cases hu \u03b5 h\u03b5 with N hN, clear hu,\n  cases hw \u03b5 h\u03b5 with N' hN', clear hw h\u03b5,\n  use max N N',\n  intros n hn,\n  rw max_ge_iff at hn,\n  specialize hN n hn.1,\n  specialize hN' n hn.2,\n  specialize h n,\n  specialize h' n,\n  clear hn,\n  rw abs_le at *,\n  split,\n  { calc -\u03b5\n         \u2264 u n - a : hN.1\n     ... \u2264 v n - a : by linarith, },\n  { calc v n - a\n         \u2264 w n - a : by linarith\n     ... \u2264 \u03b5       : hN'.2, },\nend\n\n-- 2\u00aa demostraci\u00f3n\nexample\n  (hu : limite u a)\n  (hw : limite w a)\n  (h : \u2200 n, u n \u2264 v n)\n  (h' : \u2200 n, v n \u2264 w n) :\n  limite v a :=\nbegin\n  intros \u03b5 h\u03b5,\n  cases hu \u03b5 h\u03b5 with N hN, clear hu,\n  cases hw \u03b5 h\u03b5 with N' hN', clear hw h\u03b5,\n  use max N N',\n  intros n hn,\n  rw max_ge_iff at hn,\n  specialize hN n (by linarith),\n  specialize hN' n (by linarith),\n  specialize h n,\n  specialize h' n,\n  rw abs_le at *,\n  split,\n  { linarith, },\n  { linarith, },\nend\n\n-- 3\u00aa demostraci\u00f3n\nexample\n  (hu : limite u a)\n  (hw : limite w a)\n  (h : \u2200 n, u n \u2264 v n)\n  (h' : \u2200 n, v n \u2264 w n) :\n  limite v a :=\nbegin\n  intros \u03b5 h\u03b5,\n  cases hu \u03b5 h\u03b5 with N hN, clear hu,\n  cases hw \u03b5 h\u03b5 with N' hN', clear hw h\u03b5,\n  use max N N',\n  intros n hn,\n  rw max_ge_iff at hn,\n  specialize hN n (by linarith),\n  specialize hN' n (by linarith),\n  specialize h n,\n  specialize h' n,\n  rw abs_le at *,\n  split ; linarith,\nend\n\n-- 4\u00aa demostraci\u00f3n\nexample\n  (hu : limite u a)\n  (hw : limite w a)\n  (h : \u2200 n, u n \u2264 v n)\n  (h' : \u2200 n, v n \u2264 w n) :\n  limite v a :=\nassume \u03b5,\nassume h\u03b5 : \u03b5 &gt; 0,\nexists.elim (hu \u03b5 h\u03b5)\n  ( assume N,\n    assume hN : \u2200 (n : \u2115), n \u2265 N \u2192 |u n - a| \u2264 \u03b5,\n    exists.elim (hw \u03b5 h\u03b5)\n      ( assume N',\n        assume hN' : \u2200 (n : \u2115), n \u2265 N' \u2192 |w n - a| \u2264 \u03b5,\n        show \u2203 N, \u2200 n, n \u2265 N \u2192 |v n - a| \u2264 \u03b5, from\n          exists.intro (max N N')\n            ( assume n,\n              assume hn : n \u2265 max N N',\n              have h1 : n \u2265 N \u2227 n \u2265 N',\n                from max_ge_iff.mp hn,\n              have h2 : -\u03b5 \u2264 v n - a,\n                { have h2a : |u n - a| \u2264 \u03b5,\n                    from hN n h1.1,\n                  calc -\u03b5\n                       \u2264 u n - a : and.left (abs_le.mp h2a)\n                   ... \u2264 v n - a : by linarith [h n], },\n              have h3 : v n - a \u2264 \u03b5,\n                { have h3a : |w n - a| \u2264 \u03b5,\n                    from hN' n h1.2,\n                  calc v n - a\n                       \u2264 w n - a : by linarith [h' n]\n                   ... \u2264 \u03b5       : and.right (abs_le.mp h3a), },\n              show |v n - a| \u2264 \u03b5,\n                from abs_le.mpr (and.intro h2 h3))))\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>He a\u00f1adido a la lista L\u00f3gica con Lean el v\u00eddeo Teorema del emparedado en el que se comentan pruebas en Lean del teorema del emparedado: Si dos sucesiones tienen el mismo l\u00edmite, entonces las sucesiones que est\u00e1n comprendidas entre \u00e9stas tambi\u00e9n tienen el mismo l\u00edmite. A continuaci\u00f3n, se muestra el v\u00eddeo y el c\u00f3digo de&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","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,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[335],"tags":[336],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7528"}],"collection":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/comments?post=7528"}],"version-history":[{"count":3,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7528\/revisions"}],"predecessor-version":[{"id":7531,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7528\/revisions\/7531"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/media?parent=7528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/categories?post=7528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/tags?post=7528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}