        {"id":1878,"date":"2023-12-26T06:00:01","date_gmt":"2023-12-26T04:00:01","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1878"},"modified":"2023-12-24T20:56:25","modified_gmt":"2023-12-24T18:56:25","slug":"26-dic-23","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/26-dic-23\/","title":{"rendered":"En \u211d, si x \u2264 y, entonces y \u2270 x \u2194 x \u2260 y"},"content":{"rendered":"\n<p>Demostrar con Lean4 que si &#92;(x&#92;) e &#92;(y&#92;) son n\u00fameros reales tales que &#92;(x \u2264 y&#92;), entonces &#92;(y \u2270 x \u2194 x \u2260 y&#92;).<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\nvariable {x y : \u211d}\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraci\u00f3n en lenguaje natural<\/b><\/p>\n<p>Para demostrar la equivalencia, demostraremos cada una de las implicaciones.<\/p>\n<p>Para demostrar la primera, supongamos que &#92;(y \u2270 x&#92;) y que &#92;(x = y&#92;). Entonces, &#92;(y \u2264 x&#92;) que es una contradicci\u00f3n.<\/p>\n<p>Para demostrar la segunda, supongamos que &#92;(x \u2260 y&#92;) y que &#92;(y \u2264 x&#92;). Entonces, por la hip\u00f3tesis y la antisimetr\u00eda, se tiene que &#92;(x = y&#92;) lo que es una contradicci\u00f3n.<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\nvariable {x y : \u211d}\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\nby\n  constructor\n  . show \u00acy \u2264 x \u2192 x \u2260 y\n    { intro h1\n      -- h1 : \u00acy \u2264 x\n      -- \u22a2 x \u2260 y\n      intro h2\n      -- h2 : x = y\n      -- \u22a2 False\n      have h3 : y \u2264 x := by rw [h2]\n      show False\n      exact h1 h3 }\n  . show x \u2260 y \u2192 \u00acy \u2264 x\n    { intro h1\n      -- h1 : x \u2260 y\n      -- \u22a2 \u00acy \u2264 x\n      intro h2\n      -- h2 : y \u2264 x\n      -- \u22a2 False\n      have h3 : x = y := le_antisymm h h2\n      show False\n      exact h1 h3 }\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\nby\n  constructor\n  . show \u00acy \u2264 x \u2192 x \u2260 y\n    { intro h1\n      -- h1 : \u00acy \u2264 x\n      -- \u22a2 x \u2260 y\n      intro h2\n      -- h2 : x = y\n      -- \u22a2 False\n      show False\n      exact h1 (by rw [h2]) }\n  . show x \u2260 y \u2192 \u00acy \u2264 x\n    { intro h1\n      -- h1 : x \u2260 y\n      -- \u22a2 \u00acy \u2264 x\n      intro h2\n      -- h2 : y \u2264 x\n      -- \u22a2 False\n      show False\n      exact h1 (le_antisymm h h2) }\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\nby\n  constructor\n  . show \u00acy \u2264 x \u2192 x \u2260 y\n    { intro h1 h2\n      exact h1 (by rw [h2]) }\n  . show x \u2260 y \u2192 \u00acy \u2264 x\n    { intro h1 h2\n      exact h1 (le_antisymm h h2) }\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\nby\n  constructor\n  . intro h1 h2\n    exact h1 (by rw [h2])\n  . intro h1 h2\n    exact h1 (le_antisymm h h2)\n\n-- 5\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\nby\n  constructor\n  . exact fun h1 h2 \u21a6 h1 (by rw [h2])\n  . exact fun h1 h2 \u21a6 h1 (le_antisymm h h2)\n\n-- 6\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\n  \u27e8fun h1 h2 \u21a6 h1 (by rw [h2]),\n   fun h1 h2 \u21a6 h1 (le_antisymm h h2)\u27e9\n\n-- 7\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\nby\n  constructor\n  . show \u00acy \u2264 x \u2192 x \u2260 y\n    { intro h1\n      -- h1 : \u00acy \u2264 x\n      -- \u22a2 x \u2260 y\n      contrapose! h1\n      -- h1 : x = y\n      -- \u22a2 y \u2264 x\n      calc y = x := h1.symm\n           _ \u2264 x := by rfl }\n  . show x \u2260 y \u2192 \u00acy \u2264 x\n    { intro h2\n      -- h2 : x \u2260 y\n      -- \u22a2 \u00acy \u2264 x\n      contrapose! h2\n      -- h2 : y \u2264 x\n      -- \u22a2 x = y\n      show x = y\n      exact le_antisymm h h2 }\n\n-- 8\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : x \u2264 y)\n  : \u00acy \u2264 x \u2194 x \u2260 y :=\nby\n  constructor\n  \u00b7 -- \u22a2 \u00acy \u2264 x \u2192 x \u2260 y\n    contrapose!\n    -- \u22a2 x = y \u2192 y \u2264 x\n    rintro rfl\n    -- \u22a2 x \u2264 x\n    rfl\n  . -- \u22a2 x \u2260 y \u2192 \u00acy \u2264 x\n    contrapose!\n    -- \u22a2 y \u2264 x \u2192 x = y\n    exact le_antisymm h\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\/CNS_de_distintos.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. 36.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si &#92;(x&#92;) e &#92;(y&#92;) son n\u00fameros reales tales que &#92;(x \u2264 y&#92;), entonces &#92;(y \u2270 x \u2194 x \u2260 y&#92;). Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Real.Basic variable {x y : \u211d} example (h : x \u2264 y) : \u00acy \u2264 x \u2194 x \u2260 y := 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\/1878"}],"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=1878"}],"version-history":[{"count":4,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1878\/revisions"}],"predecessor-version":[{"id":1882,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1878\/revisions\/1882"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}