        {"id":1827,"date":"2023-12-05T06:00:27","date_gmt":"2023-12-05T04:00:27","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1827"},"modified":"2023-11-24T19:11:17","modified_gmt":"2023-11-24T17:11:17","slug":"05-dic-23","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/05-dic-23\/","title":{"rendered":"Si f no est\u00e1 acotada superiormente, entonces (\u2200a)(\u2203x)[f(x) > a]"},"content":{"rendered":"\n<p>Demostrar con Lean4 que si &#92;(f&#92;) no est\u00e1 acotada superiormente, entonces &#92;((\u2200a)(\u2203x)[f(x) > a]\u200b&#92;).<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\n\ndef CotaSuperior (f : \u211d \u2192 \u211d) (a : \u211d) : Prop :=\n  \u2200 x, f x \u2264 a\n\ndef acotadaSup (f : \u211d \u2192 \u211d) :=\n  \u2203 a, CotaSuperior f a\n\nvariable (f : \u211d \u2192 \u211d)\n\nexample\n  (h : \u00acacotadaSup f)\n  : \u2200 a, \u2203 x, f x > a :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraci\u00f3n en lenguaje natural<\/b><\/p>\n<p><b>1\u00aa demostraci\u00f3n en LN<\/b><\/p>\n<p>Usaremos los siguientes lemas<br \/>\n&#92;begin{align}<br \/>\n   &amp;\u00ac(\u2203x)P(x) \u2192 (\u2200x)\u00acP(x) &#92;tag{L1} &#92;&#92;<br \/>\n   &amp;\u00aca > b \u2192 a \u2264 b        &#92;tag{L2}<br \/>\n&#92;end{align}<\/p>\n<p>Sea &#92;(a \u2208 \u211d&#92;). Tenemos que demostrar que<br \/>\n&#92;[ (\u2203x)[f(x) > a] &#92;]<br \/>\nLo haremos por reducci\u00f3n al absurdo. Para ello, suponemos que<br \/>\n&#92;[ \u00ac(\u2203x)[f(x) > a] &#92;tag{1} &#92;]<br \/>\ny tenemos que obtener una contradicci\u00f3n. Aplicando L1 a (1) se tiene<br \/>\n&#92;[ (\u2200x)[\u00ac f(x) > a] &#92;]<br \/>\ny, aplicando L2, se tiene<br \/>\n&#92;[ (\u2200x)[f(x) \u2264 a] &#92;]<br \/>\nLo que significa que &#92;(a&#92;) es una cota superior de &#92;(f&#92;) y, por tanto &#92;(f&#92;) est\u00e1 acotada superiormente, en cotradicci\u00f3n con la hip\u00f3tesis.<\/p>\n<p><b>2\u00aa demostraci\u00f3n en LN<\/b><\/p>\n<p>Por la contrarec\u00edproca, se supone que<br \/>\n&#92;[ \u00ac(\u2200a)(\u2203x)[f(x) > a] &#92;tag{1} &#92;]<br \/>\ny tenemos que demostrar que &#92;(f&#92;) est\u00e1 acotada superiormente.<\/p>\n<p>Interiorizando la negaci\u00f3n en (1) y simplificando, se tiene que<br \/>\n&#92;[ (\u2203a)(\u2200x)[f x \u2264 a] &#92;]<br \/>\nque es lo que ten\u00edamos que demostrar.<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\n\ndef CotaSuperior (f : \u211d \u2192 \u211d) (a : \u211d) : Prop :=\n  \u2200 x, f x \u2264 a\n\ndef acotadaSup (f : \u211d \u2192 \u211d) :=\n  \u2203 a, CotaSuperior f a\n\nvariable (f : \u211d \u2192 \u211d)\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : \u00acacotadaSup f)\n  : \u2200 a, \u2203 x, f x > a :=\nby\n  intro a\n  -- a : \u211d\n  -- \u22a2 \u2203 x, f x > a\n  by_contra h1\n  -- h1 : \u00ac\u2203 x, f x > a\n  -- \u22a2 False\n  have h2 : \u2200 x, \u00ac f x > a :=\n    forall_not_of_not_exists h1\n  have h3 : \u2200 x, f x \u2264 a := by\n    intro x\n    have h3a : \u00ac f x > a := h2 x\n    show f x \u2264 a\n    exact le_of_not_gt h3a\n  have h4 : CotaSuperior f a := h3\n  have h5 : \u2203 b, CotaSuperior f b := \u27e8a, h4\u27e9\n  have h6 : acotadaSup f := h5\n  show False\n  exact h h6\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : \u00acacotadaSup f)\n  : \u2200 a, \u2203 x, f x > a :=\nby\n  intro a\n  -- a : \u211d\n  -- \u22a2 \u2203 x, f x > a\n  by_contra h1\n  -- h1 : \u00ac\u2203 x, f x > a\n  -- \u22a2 False\n  apply h\n  -- \u22a2 acotadaSup f\n  use a\n  -- \u22a2 CotaSuperior f a\n  intro x\n  -- x : \u211d\n  -- \u22a2 f x \u2264 a\n  apply le_of_not_gt\n  -- \u22a2 \u00acf x > a\n  intro h2\n  -- h2 : f x > a\n  -- \u22a2 False\n  apply h1\n  -- \u22a2 \u2203 x, f x > a\n  use x\n  -- \u22a2 f x > a\n  exact h2\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : \u00acacotadaSup f)\n  : \u2200 a, \u2203 x, f x > a :=\nby\n  unfold acotadaSup at h\n  -- h : \u00ac\u2203 a, CotaSuperior f a\n  unfold CotaSuperior at h\n  -- h : \u00ac\u2203 a, \u2200 (x : \u211d), f x \u2264 a\n  push_neg at h\n  -- \u2200 (a : \u211d), \u2203 x, f x > a\n  exact h\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : \u00acacotadaSup f)\n  : \u2200 a, \u2203 x, f x > a :=\nby\n  simp only [acotadaSup, CotaSuperior] at h\n  -- h : \u00ac\u2203 a, \u2200 (x : \u211d), f x \u2264 a\n  push_neg at h\n  -- \u2200 (a : \u211d), \u2203 x, f x > a\n  exact h\n\n-- 5\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : \u00acacotadaSup f) :\n  \u2200 a, \u2203 x, f x > a :=\nby\n  contrapose h\n  -- h : \u00ac\u2200 (a : \u211d), \u2203 x, f x > a\n  -- \u22a2 \u00ac\u00acacotadaSup f\n  push_neg at *\n  -- h : \u2203 a, \u2200 (x : \u211d), f x \u2264 a\n  -- \u22a2 acotadaSup f\n  exact h\n\n-- 6\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : \u00acacotadaSup f) :\n  \u2200 a, \u2203 x, f x > a :=\nby\n  contrapose! h\n  -- h : \u2203 a, \u2200 (x : \u211d), f x \u2264 a\n  -- \u22a2 acotadaSup f\n  exact h\n\n-- Lemas usados\n-- ============\n\n-- variable {\u03b1 : Type _}\n-- variable (P : \u03b1 \u2192 Prop)\n-- #check (forall_not_of_not_exists : (\u00ac\u2203 x, P x) \u2192 \u2200 x, \u00acP x)\n--\n-- variable (a b : \u211d)\n-- #check (le_of_not_gt : \u00aca > b \u2192 a \u2264 b)\n<\/pre>\n<p><b>Demostraciones interactivas<\/b><\/p>\n<p>Se puede interactuar con las demostraciones anteriores en <a href=\"https:\/\/live.lean-lang.org\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus2\/main\/src\/CN_no_acotada_superiormente.lean\" rel=\"noopener noreferrer\" target=\"_blank\">Lean 4 Web<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li> J. Avigad y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 33.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si &#92;(f&#92;) no est\u00e1 acotada superiormente, entonces &#92;((\u2200a)(\u2203x)[f(x) > a]\u200b&#92;). Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Real.Basic def CotaSuperior (f : \u211d \u2192 \u211d) (a : \u211d) : Prop := \u2200 x, f x \u2264 a def acotadaSup (f : \u211d \u2192 \u211d) := \u2203 a, CotaSuperior f a variable (f : \u211d \u2192 \u211d) example (h : \u00acacotadaSup f) : \u2200 a, \u2203 x, f x > a := by sorry<\/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":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1827"}],"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=1827"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1827\/revisions"}],"predecessor-version":[{"id":1830,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1827\/revisions\/1830"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}