        {"id":1911,"date":"2024-01-05T06:00:57","date_gmt":"2024-01-05T04:00:57","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1911"},"modified":"2023-12-31T19:26:44","modified_gmt":"2023-12-31T17:26:44","slug":"05-ene-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/05-ene-24\/","title":{"rendered":"Si \u2264 es un preorden, entonces < es transitiva"},"content":{"rendered":"\n<p>Demostrar con Lean4 que si &#92;(\u2264&#92;) es un preorden, entonces &#92;(&lt;&#92;) es transitiva.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Tactic\nvariable {\u03b1 : Type _} [Preorder \u03b1]\nvariable (a b c : \u03b1)\n\nexample : a < b \u2192 b < c \u2192 a < c :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraci\u00f3n en lenguaje natural<\/b><\/p>\n<p>Se usar\u00e1 la siguiente propiedad de los pre\u00f3rdenes<br \/>\n&#92;[ (\u2200 a, b)[a &lt; b \u2194 a \u2264 b \u2227 b \u2270 a] &#92;]<br \/>\nCon dicha propiedad, lo que tenemos que demostrar se transforma en<br \/>\n&#92;[ a \u2264 b \u2227 b \u2270 a \u2192 b \u2264 c \u2227 c \u2270 b \u2192 a \u2264 c \u2227 c \u2270 a &#92;]<br \/>\nPara demostrarla, supongamos que<br \/>\n&#92;begin{align}<br \/>\n   &amp;a \u2264 b &#92;tag{(1)} &#92;&#92;<br \/>\n   &amp;b \u2270 a &#92;tag{(2)} &#92;&#92;<br \/>\n   &amp;b \u2264 c &#92;tag{(3)} &#92;&#92;<br \/>\n   &amp;c \u2270 b &#92;tag{(4)}<br \/>\n&#92;end{align}<br \/>\ny tenemos que demostrar las siguientes relaciones<br \/>\n&#92;begin{align}<br \/>\n   &amp;a \u2264 c &#92;tag{(5)} &#92;&#92;<br \/>\n   &amp;c \u2270 a &#92;tag{(6)}<br \/>\n&#92;end{align}<\/p>\n<p>La (5) se tiene aplicando la propiedad transitiva a (1) y (3).<\/p>\n<p>Para demostrar la (6), supongamos que<br \/>\n&#92;[ c \u2264 a &#92;tag{(7)} &#92;]<br \/>\nentonces, junto a la (1), por la propieda transitiva se tiene<br \/>\n&#92;[ c \u2264 b &#92;]<br \/>\nque es una contradicci\u00f3n con la (4).<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\nimport Mathlib.Tactic\nvariable {\u03b1 : Type _} [Preorder \u03b1]\nvariable (a b c : \u03b1)\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a < b \u2192 b < c \u2192 a < c :=\nby\n  simp only [lt_iff_le_not_le]\n  -- \u22a2 a \u2264 b \u2227 \u00acb \u2264 a \u2192 b \u2264 c \u2227 \u00acc \u2264 b \u2192 a \u2264 c \u2227 \u00acc \u2264 a\n  rintro \u27e8h1 : a \u2264 b, _h2 : \u00acb \u2264 a\u27e9 \u27e8h3 : b \u2264 c, h4 : \u00acc \u2264 b\u27e9\n  -- \u22a2 a \u2264 c \u2227 \u00acc \u2264 a\n  constructor\n  . -- \u22a2 a \u2264 c\n    exact le_trans h1 h3\n  . -- \u22a2 \u00acc \u2264 a\n    contrapose! h4\n    -- h4 : c \u2264 a\n    -- \u22a2 c \u2264 b\n    exact le_trans h4 h1\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a < b \u2192 b < c \u2192 a < c :=\nby\n  simp only [lt_iff_le_not_le]\n  -- \u22a2 a \u2264 b \u2227 \u00acb \u2264 a \u2192 b \u2264 c \u2227 \u00acc \u2264 b \u2192 a \u2264 c \u2227 \u00acc \u2264 a\n  rintro \u27e8h1 : a \u2264 b, _h2 : \u00acb \u2264 a\u27e9 \u27e8h3 : b \u2264 c, h4 : \u00acc \u2264 b\u27e9\n  -- \u22a2 a \u2264 c \u2227 \u00acc \u2264 a\n  constructor\n  . -- \u22a2 a \u2264 c\n    exact le_trans h1 h3\n  . -- \u22a2 \u00acc \u2264 a\n    rintro (h5 : c \u2264 a)\n    -- \u22a2 False\n    have h6 : c \u2264 b := le_trans h5 h1\n    show False\n    exact h4 h6\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a < b \u2192 b < c \u2192 a < c :=\nby\n  simp only [lt_iff_le_not_le]\n  -- \u22a2 a \u2264 b \u2227 \u00acb \u2264 a \u2192 b \u2264 c \u2227 \u00acc \u2264 b \u2192 a \u2264 c \u2227 \u00acc \u2264 a\n  rintro \u27e8h1 : a \u2264 b, _h2 : \u00acb \u2264 a\u27e9 \u27e8h3 : b \u2264 c, h4 : \u00acc \u2264 b\u27e9\n  -- \u22a2 a \u2264 c \u2227 \u00acc \u2264 a\n  constructor\n  . -- \u22a2 a \u2264 c\n    exact le_trans h1 h3\n  . -- \u22a2 \u00acc \u2264 a\n    exact fun h5 \u21a6 h4 (le_trans h5 h1)\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a < b \u2192 b < c \u2192 a < c :=\nby\n  simp only [lt_iff_le_not_le]\n  -- \u22a2 a \u2264 b \u2227 \u00acb \u2264 a \u2192 b \u2264 c \u2227 \u00acc \u2264 b \u2192 a \u2264 c \u2227 \u00acc \u2264 a\n  rintro \u27e8h1 : a \u2264 b, _h2 : \u00acb \u2264 a\u27e9 \u27e8h3 : b \u2264 c, h4 : \u00acc \u2264 b\u27e9\n  -- \u22a2 a \u2264 c \u2227 \u00acc \u2264 a\n  exact \u27e8le_trans h1 h3, fun h5 \u21a6 h4 (le_trans h5 h1)\u27e9\n\n-- 5\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a < b \u2192 b < c \u2192 a < c :=\nby\n  simp only [lt_iff_le_not_le]\n  -- \u22a2 a \u2264 b \u2227 \u00acb \u2264 a \u2192 b \u2264 c \u2227 \u00acc \u2264 b \u2192 a \u2264 c \u2227 \u00acc \u2264 a\n  exact fun \u27e8h1, _h2\u27e9 \u27e8h3, h4\u27e9 \u21a6 \u27e8le_trans h1 h3,\n                                  fun h5 \u21a6 h4 (le_trans h5 h1)\u27e9\n\n-- 6\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a < b \u2192 b < c \u2192 a < c :=\n  lt_trans\n\n-- Lemas usados\n-- ============\n\n-- #check (lt_iff_le_not_le : a < b \u2194 a \u2264 b \u2227 \u00acb \u2264 a)\n-- #check (le_trans : a \u2264 b \u2192 b \u2264 c \u2192 a \u2264 c)\n-- #check (lt_trans : a < b \u2192 b < c \u2192 a < c)\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\/Preorden_transitiva.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. 38.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si &#92;(\u2264&#92;) es un preorden, entonces &#92;(&lt;&#92;) es transitiva. Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Tactic variable {\u03b1 : Type _} [Preorder \u03b1] variable (a b c : \u03b1) example : a < b \u2192 b < c \u2192 a < c := by sorry\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":[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\/1911"}],"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=1911"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1911\/revisions"}],"predecessor-version":[{"id":1912,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1911\/revisions\/1912"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}