        {"id":1611,"date":"2023-09-29T06:00:46","date_gmt":"2023-09-29T04:00:46","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1611"},"modified":"2023-09-10T12:49:21","modified_gmt":"2023-09-10T10:49:21","slug":"29-sep-23","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/29-sep-23\/","title":{"rendered":"En los anillos ordenados, {a \u2264 b, 0 \u2264 c} \u22a2 ac \u2264 bc"},"content":{"rendered":"<p>Demostrar con Lean4 que, en los anillos ordenados,<br \/>\n\\[ \\{a \u2264 b, 0 \u2264 c\\} \u22a2 ac \u2264 bc \\]<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\r\nimport Mathlib.Algebra.Order.Ring.Defs\r\nvariable {R : Type _} [StrictOrderedRing R]\r\nvariable (a b c : R)\r\n\r\nexample\r\n  (h1 : a \u2264 b)\r\n  (h2 : 0 \u2264 c)\r\n  : a * c \u2264 b * c :=\r\nby sorry\r\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraci\u00f3n en lenguaje natural<\/b><\/p>\n<p><br \/>\nSe usar\u00e1n los siguientes lemas:<br \/>\n\\begin{align}<br \/>\n   &#038;0 \u2264 a &#8211; b \u2194 b \u2264 a           \\tag{L1} \\\\<br \/>\n   &#038;0 \u2264 a \u2192 0 \u2264 b \u2192 0 \u2264 ab      \\tag{L2} \\\\<br \/>\n   &#038;(a &#8211; b)c = ac &#8211; bc          \\tag{L3}<br \/>\n\\end{align}<\/p>\n<p>Supongamos que<br \/>\n\\begin{align}<br \/>\n   a &#038;\u2264 b \\tag{1} \\\\<br \/>\n   0 &#038;\u2264 c<br \/>\n\\end{align}<br \/>\nDe (1), por L1, se tiene<br \/>\n\\[   0 \u2264 b &#8211; a \\]<br \/>\ny con (2), por L2, se tiene<br \/>\n\\[   0 \u2264 (b &#8211; a)c \\]<br \/>\nque, por L3, da<br \/>\n\\[   0 \u2264 bc &#8211; ac \\]<br \/>\ny, aplic\u00e1ndole L1, se tiene<br \/>\n\\[   ac \u2264 bc \\]<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\r\nimport Mathlib.Algebra.Order.Ring.Defs\r\nvariable {R : Type _} [StrictOrderedRing R]\r\nvariable (a b c : R)\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h1 : a \u2264 b)\r\n  (h2 : 0 \u2264 c)\r\n  : a * c \u2264 b * c :=\r\nby\r\n  have h3 : 0 \u2264 b - a :=\r\n    sub_nonneg.mpr h1\r\n  have h4 : 0 \u2264 b * c - a * c := calc\r\n    0 \u2264 (b - a) * c   := mul_nonneg h3 h2\r\n    _ = b * c - a * c := sub_mul b a c\r\n  show a * c \u2264 b * c\r\n  exact sub_nonneg.mp h4\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h1 : a \u2264 b)\r\n  (h2 : 0 \u2264 c)\r\n  : a * c \u2264 b * c :=\r\nby\r\n  have h3 : 0 \u2264 b - a := sub_nonneg.mpr h1\r\n  have h4 : 0 \u2264 (b - a) * c := mul_nonneg h3 h2\r\n  -- h4 : 0 \u2264 b * c - a * c\r\n  rw [sub_mul] at h4\r\n  -- a * c \u2264 b * c\r\n  exact sub_nonneg.mp h4\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h1 : a \u2264 b)\r\n  (h2 : 0 \u2264 c)\r\n  : a * c \u2264 b * c :=\r\nby\r\n  -- 0 \u2264 b * c - a * c\r\n  apply sub_nonneg.mp\r\n  -- 0 \u2264 (b - a) * c\r\n  rw [\u2190 sub_mul]\r\n  apply mul_nonneg\r\n  . -- 0 \u2264 b - a\r\n    exact sub_nonneg.mpr h1\r\n  . -- 0 \u2264 c\r\n    exact h2\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h1 : a \u2264 b)\r\n  (h2 : 0 \u2264 c)\r\n  : a * c \u2264 b * c :=\r\nby\r\n  apply sub_nonneg.mp\r\n  rw [\u2190 sub_mul]\r\n  apply mul_nonneg (sub_nonneg.mpr h1) h2\r\n\r\n-- 5\u00aa demostraci\u00f3n\r\nexample\r\n  (h1 : a \u2264 b)\r\n  (h2 : 0 \u2264 c)\r\n  : a * c \u2264 b * c :=\r\n-- by apply?\r\nmul_le_mul_of_nonneg_right h1 h2\r\n\r\n-- Lemas usados\r\n-- ============\r\n\r\n-- #check (mul_le_mul_of_nonneg_right : a \u2264 b \u2192 0 \u2264 c \u2192 a * c \u2264 b * c)\r\n-- #check (mul_nonneg : 0 \u2264 a \u2192 0 \u2264 b \u2192 0 \u2264 a * b)\r\n-- #check (sub_mul a b c : (a - b) * c = a * c - b * c)\r\n-- #check (sub_nonneg : 0 \u2264 a - b \u2194 b \u2264 a)\r\n<\/pre>\n<p><b>Demostraciones interactivas<\/b><\/p>\n<p>Se puede interactuar con las demostraciones anteriores en <a href=\"https:\/\/lean.math.hhu.de\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus2\/main\/src\/Ejercicio_sobre_anillos_ordenados_3.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. 22.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que, en los anillos ordenados, \\[ \\{a \u2264 b, 0 \u2264 c\\} \u22a2 ac \u2264 bc \\] Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Algebra.Order.Ring.Defs variable {R : Type _} [StrictOrderedRing R] variable (a b c : R) example (h1 : a \u2264 b) (h2 : 0 \u2264 c) : a * c \u2264 b * c := 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":[294,297],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1611"}],"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=1611"}],"version-history":[{"count":3,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1611\/revisions"}],"predecessor-version":[{"id":1614,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1611\/revisions\/1614"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}