        {"id":1425,"date":"2023-08-02T06:00:47","date_gmt":"2023-08-02T04:00:47","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1425"},"modified":"2023-07-27T11:28:02","modified_gmt":"2023-07-27T09:28:02","slug":"02-ago-23","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/02-ago-23\/","title":{"rendered":"Si R es un anillo y a, b, c \u2208 R tales que a+b=c+b, entonces a=c"},"content":{"rendered":"<p>Demostrar con Lean4 que si R es un anillo y a, b, c \u2208 R tales que<\/p>\n<pre lang=\"text\">\r\n   a + b = c + b\r\n<\/pre>\n<p>entonces<\/p>\n<pre lang=\"text\">\r\n   a = c\r\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\r\nimport Mathlib.Algebra.Ring.Defs\r\nimport Mathlib.Tactic\r\n\r\nvariable {R : Type _} [Ring R]\r\nvariable {a b c : R}\r\n\r\nexample\r\n  (h : a + b = c + b)\r\n  : a = c :=\r\nsorry\r\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraciones en lenguaje natural (LN<\/b><\/p>\n\n<p><b>1\u00aa demostraci\u00f3n en LN<\/b><\/p>\n<p>Por la siguiente cadena de igualdades<br \/>\n\\begin{align}<br \/>\n   a &#038;= a + 0           &#038;&#038;\\text{[por suma con cero]} \\\\<br \/>\n     &#038;= a + (b + -b)    &#038;&#038;\\text{[por suma con opuesto]} \\\\<br \/>\n     &#038;= (a + b) + -b    &#038;&#038;\\text{[por asociativa]} \\\\<br \/>\n     &#038;= (c + b) + -b    &#038;&#038;\\text{[por hip\u00f3tesis]} \\\\<br \/>\n     &#038;= c + (b + -b)    &#038;&#038;\\text{[por asociativa]} \\\\<br \/>\n     &#038;= c + 0           &#038;&#038;\\text{[por suma con opuesto]} \\\\<br \/>\n     &#038;= c               &#038;&#038;\\text{[por suma con cero]}<br \/>\n\\end{align}<\/p>\n<p><b>2\u00aa demostraci\u00f3n en LN<\/b><\/p>\n<p>Por la siguiente cadena de igualdades<br \/>\n\\begin{align}<br \/>\n   a &#038;= (a + b) + -b    \\\\<br \/>\n     &#038;= (c + b) + -b    &#038;&#038;\\text{[por hip\u00f3tesis]} \\\\<br \/>\n     &#038;= c<br \/>\n\\end{align}<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\r\nimport Mathlib.Algebra.Ring.Defs\r\nimport Mathlib.Tactic\r\n\r\nvariable {R : Type _} [Ring R]\r\nvariable {a b c : R}\r\n\r\n-- 1\u00aa demostraci\u00f3n con Lean4\r\n-- =========================\r\n\r\nexample\r\n  (h : a + b = c + b)\r\n  : a = c :=\r\ncalc\r\n  a = a + 0        := by rw [add_zero]\r\n  _ = a + (b + -b) := by rw [add_right_neg]\r\n  _ = (a + b) + -b := by rw [add_assoc]\r\n  _ = (c + b) + -b := by rw [h]\r\n  _ = c + (b + -b) := by rw [\u2190 add_assoc]\r\n  _ = c + 0        := by rw [\u2190 add_right_neg]\r\n  _ = c            := by rw [add_zero]\r\n\r\n-- 2\u00aa demostraci\u00f3n con Lean4\r\n-- =========================\r\n\r\nexample\r\n  (h : a + b = c + b)\r\n  : a = c :=\r\ncalc\r\n  a = (a + b) + -b := (add_neg_cancel_right a b).symm\r\n  _ = (c + b) + -b := by rw [h]\r\n  _ = c            := add_neg_cancel_right c b\r\n\r\n-- 3\u00aa demostraci\u00f3n con Lean4\r\n-- =========================\r\n\r\nexample\r\n  (h : a + b = c + b)\r\n  : a = c :=\r\nby\r\n  rw [\u2190 add_neg_cancel_right a b]\r\n  rw [h]\r\n  rw [add_neg_cancel_right]\r\n\r\n-- 4\u00aa demostraci\u00f3n con Lean4\r\n-- =========================\r\n\r\nexample\r\n  (h : a + b = c + b)\r\n  : a = c :=\r\nby\r\n  rw [\u2190 add_neg_cancel_right a b, h, add_neg_cancel_right]\r\n\r\n-- 5\u00aa demostraci\u00f3n con Lean4\r\n-- =========================\r\n\r\nexample\r\n  (h : a + b = c + b)\r\n  : a = c :=\r\nadd_right_cancel h\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\/Cancelativa_derecha.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. 11.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si R es un anillo y a, b, c \u2208 R tales que a + b = c + b entonces a = c Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Algebra.Ring.Defs import Mathlib.Tactic variable {R : Type _} [Ring R] variable {a b c : R} example (h : a + b = c + b) : a = c := 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":[284,297],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1425"}],"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=1425"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1425\/revisions"}],"predecessor-version":[{"id":1426,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1425\/revisions\/1426"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}