        {"id":760,"date":"2021-09-14T05:00:10","date_gmt":"2021-09-14T03:00:10","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=760"},"modified":"2021-09-08T19:29:00","modified_gmt":"2021-09-08T17:29:00","slug":"si-x-es-el-supremo-de-a-entonces-c1","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/si-x-es-el-supremo-de-a-entonces-c1\/","title":{"rendered":"Si x es el supremo de A, entonces \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a"},"content":{"rendered":"<p>En Lean se puede definir que x es una cota superior de A por<\/p>\n<pre lang=\"text\">\n   def cota_superior (A : set \u211d) (x : \u211d) :=\n     \u2200 a \u2208 A, a \u2264 x\n<\/pre>\n<p>y x es el supremo de A por<\/p>\n<pre lang=\"text\">\n   def es_supremo (A : set \u211d) (x : \u211d) :=\n     cota_superior A x \u2227 \u2200 y, cota_superior A y \u2192 x \u2264 y\n<\/pre>\n<p>Demostrar que si x es el supremo de A, entonces<\/p>\n<pre lang=\"text\">\n   \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\nvariable {A : set \u211d}\nvariable {x : \u211d}\n\ndef cota_superior (A : set \u211d) (x : \u211d) :=\n  \u2200 a \u2208 A, a \u2264 x\n\ndef es_supremo (A : set \u211d) (x : \u211d) :=\n  cota_superior A x \u2227 \u2200 y, cota_superior A y \u2192 x \u2264 y\n\nexample\n  (hx : es_supremo A x)\n  : \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a :=\nsorry\n<\/pre>\n<p>[expand title=\"Soluciones con Lean\"]<\/p>\n<pre lang=\"lean\">\r\nimport data.real.basic\r\nvariable {A : set \u211d}\r\nvariable {x : \u211d}\r\n\r\ndef cota_superior (A : set \u211d) (x : \u211d) :=\r\n  \u2200 a \u2208 A, a \u2264 x\r\n\r\ndef es_supremo (A : set \u211d) (x : \u211d) :=\r\n  cota_superior A x \u2227 \u2200 y, cota_superior A y \u2192 x \u2264 y\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\nexample\r\n  (hx : es_supremo A x)\r\n  : \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a :=\r\nbegin\r\n  intros y hy,\r\n  by_contradiction,\r\n  push_neg at h,\r\n  have h1 : x \u2264 y := hx.2 y h,\r\n  replace h1 : \u00ac(y < x) := not_lt_of_le h1,\r\n  exact h1 hy,\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\nexample\r\n  (hx : es_supremo A x)\r\n  : \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a :=\r\nbegin\r\n  intros y hy,\r\n  by_contradiction,\r\n  push_neg at h,\r\n  apply absurd hy,\r\n  apply not_lt_of_le,\r\n  apply hx.2 y,\r\n  exact h,\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\nexample\r\n  (hx : es_supremo A x)\r\n  : \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a :=\r\nbegin\r\n  intros y hy,\r\n  by_contradiction,\r\n  push_neg at h,\r\n  exact absurd hy (not_lt_of_le (hx.2 y h)),\r\nend\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\nexample\r\n  (hx : es_supremo A x)\r\n  : \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a :=\r\nbegin\r\n  intros y hy,\r\n  contrapose hy,\r\n  push_neg at hy,\r\n  push_neg,\r\n  unfold es_supremo at hx,\r\n  cases hx with h1 h2,\r\n  apply h2 y,\r\n  unfold cota_superior,\r\n  exact hy,\r\nend\r\n\r\n-- 5\u00aa demostraci\u00f3n\r\nexample\r\n  (hx : es_supremo A x)\r\n  : \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a :=\r\nbegin\r\n  intros y hy,\r\n  contrapose hy,\r\n  push_neg at hy,\r\n  push_neg,\r\n  cases hx with h1 h2,\r\n  exact h2 y hy,\r\nend\r\n\r\n-- 6\u00aa demostraci\u00f3n\r\nexample\r\n  (hx : es_supremo A x)\r\n  : \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a :=\r\nbegin\r\n  intros y hy,\r\n  contrapose hy,\r\n  push_neg at hy,\r\n  push_neg,\r\n  exact hx.right y hy,\r\nend\r\n\r\n-- 7\u00aa demostraci\u00f3n\r\nexample\r\n  (hx : es_supremo A x)\r\n  : \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a :=\r\nbegin\r\n  intro y,\r\n  contrapose!,\r\n  exact hx.right y,\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\/Si_x_es_el_supremo_de_A_entonces_forall_y_y_lt_x_to_exists_a_in_A_y_lt_a.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 \"Si_x_es_el_supremo_de_A_entonces_forall_y_y_lt_x_to_exists_a_in_A_y_lt_a\"\r\n  imports Main HOL.Real\r\nbegin\r\n\r\ndefinition cota_superior :: \"(real set) \u21d2 real \u21d2 bool\" where\r\n  \"cota_superior A x \u27f7 (\u2200a\u2208A. a \u2264 x)\"\r\n\r\ndefinition es_supremo :: \"(real set) \u21d2 real \u21d2 bool\" where\r\n  \"es_supremo A x \u27f7 (cota_superior A x \u2227\r\n                       (\u2200 y. cota_superior A y \u27f6 x \u2264 y))\"\r\n\r\n(* 1\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"es_supremo A x\"\r\n  shows   \"\u2200y<x. \u2203a\u2208A. y < a\"\r\nproof (intro allI impI)\r\n  fix y\r\n  assume \"y < x\"\r\n  show \"\u2203a\u2208A. y < a\"\r\n  proof (rule ccontr)\r\n    assume \"\u00ac (\u2203a\u2208A. y < a)\"\r\n    then have \"\u2200a\u2208A. a \u2264 y\"\r\n      by auto\r\n    then have \"cota_superior A y\"\r\n      using cota_superior_def by simp\r\n    then have \"x \u2264 y\"\r\n      using assms es_supremo_def by simp\r\n    then have \"x < x\"\r\n      using \u2039y < x\u203a by simp\r\n    then show False by simp\r\n  qed\r\nqed\r\n\r\n(* 2\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"es_supremo A x\"\r\n  shows   \"\u2200y<x. \u2203a\u2208A. y < a\"\r\nproof (intro allI impI)\r\n  fix y\r\n  assume \"y < x\"\r\n  show \"\u2203a\u2208A. y < a\"\r\n  proof (rule ccontr)\r\n    assume \"\u00ac (\u2203a\u2208A. y < a)\"\r\n    then have \"cota_superior A y\"\r\n      using cota_superior_def by auto\r\n    then show \"False\"\r\n      using assms es_supremo_def \u2039y < x\u203a by auto\r\n  qed\r\nqed\r\n\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 x es una cota superior de A por def cota_superior (A : set \u211d) (x : \u211d) := \u2200 a \u2208 A, a \u2264 x y x es el supremo de A por def es_supremo (A : set \u211d) (x : \u211d) := cota_superior A x \u2227 \u2200 y, cota_superior A y \u2192 x \u2264 y Demostrar que si x es el supremo de A, entonces \u2200 y, y < x \u2192 \u2203 a \u2208 A, y < a Para ello, completar la siguiente teor\u00eda de Lean: import data.real.basic variable {A : set \u211d} variable {x : \u211d} def cota_superior (A : set \u211d) (x : \u211d) := \u2200 a \u2208 A, a \u2264 x def es_supremo (A :...\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":[13],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/760"}],"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=760"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/760\/revisions"}],"predecessor-version":[{"id":762,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/760\/revisions\/762"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}