{"id":7543,"date":"2021-01-08T06:00:59","date_gmt":"2021-01-08T05:00:59","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/?p=7543"},"modified":"2021-01-08T19:52:53","modified_gmt":"2021-01-08T18:52:53","slug":"formatus-pruebas-en-lean-de-los-supremos-de-las-sucesiones-no-decrecientes-son-sus-limites","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/formatus-pruebas-en-lean-de-los-supremos-de-las-sucesiones-no-decrecientes-son-sus-limites\/","title":{"rendered":"ForMatUS: Pruebas en Lean de &#8220;Los supremos de las sucesiones no decrecientes son sus l\u00edmites&#8221;"},"content":{"rendered":"<p>He a\u00f1adido a la lista <a href=\"https:\/\/bit.ly\/2QwnT30\">DAO (Demostraci\u00f3n Asistida por Ordenador) con Lean<\/a> el <a href=\"https:\/\/youtu.be\/XiVr8m4NYCc\">v\u00eddeo<\/a> en el que se comentan 4 pruebas en Lean de la propiedad<\/p>\n<blockquote><p>\n  Los supremos de las sucesiones no decrecientes son sus l\u00edmites\n<\/p><\/blockquote>\n<p>usando los estilos declarativo y aplicativo.<\/p>\n<p>A continuaci\u00f3n, se muestra el v\u00eddeo<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/XiVr8m4NYCc\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>y el <a href=\"https:\/\/bit.ly\/3sdCwKe\">c\u00f3digo<\/a> de la teor\u00eda utilizada<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\n\nvariable (u : \u2115 \u2192 \u211d)\nvariable (M : \u211d)\n\n-- ----------------------------------------------------\n-- Nota. Se usar\u00e1n las siguientes notaciones y\n-- definiciones estudiadas anteriormente:\n-- + |x| = abs x\n-- + limite u c :\n--      \u2200 \u03b5 > 0, \u2203 N, \u2200 n \u2265 N, |u n - c| \u2264 \u03b5\n-- ----------------------------------------------------\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| \u2264 \u03b5\n\n-- ----------------------------------------------------\n-- Ejercicio 1. Definir la funci\u00f3n\n--    no_decreciente : (\u2115 \u2192 \u211d) \u2192 Prop\n-- tal que (no_decreciente) expresa que la sucesi\u00f3n u\n-- es no decreciente.\n-- ----------------------------------------------------\n\ndef no_decreciente : (\u2115 \u2192 \u211d) \u2192 Prop\n| u := \u2200 n m, n \u2264 m \u2192 u n \u2264 u m\n\n-- ----------------------------------------------------\n-- Ejercicio 2. Definir la funci\u00f3n\n--    es_sup_suc : \u211d \u2192 (\u2115 \u2192 \u211d) \u2192 Prop\n-- tal que (es_sup_suc M u) expresa que M es el supremo\n-- de la sucesi\u00f3n u.\n-- ----------------------------------------------------\n\ndef es_sup_suc : \u211d \u2192 (\u2115 \u2192 \u211d) \u2192 Prop\n| M u := (\u2200 n, u n \u2264 M) \u2227 \u2200 \u03b5 > 0, \u2203 n\u2080, u n\u2080 \u2265 M - \u03b5\n\n-- ----------------------------------------------------\n-- Ejercicio 3. Demostrar que si M es un supremo de la\n-- sucesi\u00f3n no decreciente u, entonces el l\u00edmite de u\n-- es M.\n-- ----------------------------------------------------\n\n-- 1\u00aa demostraci\u00f3n\nexample\n  (h : es_sup_suc M u)\n  (h' : no_decreciente u)\n  : limite u M :=\nbegin\n  -- unfold limite,\n  intros \u03b5 h\u03b5,\n  -- unfold es_sup_suc at h,\n  cases h with hM\u2081 hM\u2082,\n  cases hM\u2082 \u03b5 h\u03b5 with n\u2080 hn\u2080,\n  use n\u2080,\n  intros n hn,\n  rw abs_le,\n  split,\n  { -- unfold no_decreciente at h',\n    specialize h' n\u2080 n hn,\n    calc -\u03b5\n         = (M - \u03b5) - M : by ring\n     ... \u2264 u n\u2080 - M    : sub_le_sub_right hn\u2080 M\n     ... \u2264 u n - M     : sub_le_sub_right h' M },\n  { calc u n - M\n         \u2264 M - M       : sub_le_sub_right (hM\u2081 n) M\n     ... = 0           : sub_self M\n     ... \u2264 \u03b5           : le_of_lt h\u03b5, },\nend\n\n-- 2\u00aa demostraci\u00f3n\nexample\n  (h : es_sup_suc M u)\n  (h' : no_decreciente u)\n  : limite u M :=\nbegin\n  intros \u03b5 h\u03b5,\n  cases h with hM\u2081 hM\u2082,\n  cases hM\u2082 \u03b5 h\u03b5 with n\u2080 hn\u2080,\n  use n\u2080,\n  intros n hn,\n  rw abs_le,\n  split,\n  { linarith [h' n\u2080 n hn] },\n  { linarith [hM\u2081 n] },\nend\n\n-- 3\u00aa demostraci\u00f3n\nexample\n  (h : es_sup_suc M u)\n  (h' : no_decreciente u)\n  : limite u M :=\nbegin\n  intros \u03b5 h\u03b5,\n  cases h with hM\u2081 hM\u2082,\n  cases hM\u2082 \u03b5 h\u03b5 with n\u2080 hn\u2080,\n  use n\u2080,\n  intros n hn,\n  rw abs_le,\n  split ; linarith [h' n\u2080 n hn, hM\u2081 n],\nend\n\n-- 4\u00aa demostraci\u00f3n\nexample\n  (h : es_sup_suc M u)\n  (h' : no_decreciente u)\n  : limite u M :=\nassume \u03b5,\nassume h\u03b5 : \u03b5 > 0,\nhave hM\u2081 : \u2200 (n : \u2115), u n \u2264 M,\n  from h.left,\nhave hM\u2082 : \u2200 (\u03b5 : \u211d), \u03b5 > 0 \u2192 (\u2203 (n\u2080 : \u2115), u n\u2080 \u2265 M - \u03b5),\n  from h.right,\nexists.elim (hM\u2082 \u03b5 h\u03b5)\n  ( assume n\u2080,\n    assume hn\u2080 : u n\u2080 \u2265 M - \u03b5,\n    have h1 : \u2200 n, n \u2265 n\u2080 \u2192 |u n - M| \u2264 \u03b5,\n      { assume n,\n        assume hn : n \u2265 n\u2080,\n        have h2 : -\u03b5 \u2264 u n - M,\n          { have h'a : u n\u2080 \u2264 u n,\n              from h' n\u2080 n hn,\n            calc -\u03b5\n                 = (M - \u03b5) - M : by ring\n             ... \u2264 u n\u2080 - M    : sub_le_sub_right hn\u2080 M\n             ... \u2264 u n - M     : sub_le_sub_right h'a M },\n        have h3 : u n - M \u2264 \u03b5,\n          { calc u n - M\n                 \u2264 M - M       : sub_le_sub_right (hM\u2081 n) M\n             ... = 0           : sub_self M\n             ... \u2264 \u03b5           : le_of_lt h\u03b5 },\n        show |u n - M| \u2264 \u03b5,\n          from abs_le.mpr (and.intro h2 h3) },\n    show \u2203 N, \u2200 n, n \u2265 N \u2192 |u n - M| \u2264 \u03b5,\n      from exists.intro n\u2080 h1)\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>He a\u00f1adido a la lista DAO (Demostraci\u00f3n Asistida por Ordenador) con Lean el v\u00eddeo en el que se comentan 4 pruebas en Lean de la propiedad Los supremos de las sucesiones no decrecientes son sus l\u00edmites usando los estilos declarativo y aplicativo. A continuaci\u00f3n, se muestra el v\u00eddeo y el c\u00f3digo de la teor\u00eda utilizada&#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\/7543"}],"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=7543"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7543\/revisions"}],"predecessor-version":[{"id":7550,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7543\/revisions\/7550"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/media?parent=7543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/categories?post=7543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/tags?post=7543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}