        {"id":986,"date":"2022-08-31T16:00:37","date_gmt":"2022-08-31T14:00:37","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=986"},"modified":"2022-09-11T13:58:28","modified_gmt":"2022-09-11T11:58:28","slug":"si-r-es-un-anillo-y-a-b-c-%e2%88%88-r-tales-que-a-b-a-c-entonces-b-c","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/si-r-es-un-anillo-y-a-b-c-%e2%88%88-r-tales-que-a-b-a-c-entonces-b-c\/","title":{"rendered":"Si R es un anillo y a, b, c \u2208 R tales que a + b = a + c, entonces b = c."},"content":{"rendered":"<p>Demostrar que si R es un anillo y a, b, c \u2208 R tales que<\/p>\n<pre lang=\"text\">\n   a + b = a + c\n<\/pre>\n<p>entonces<\/p>\n<pre lang=\"text\">\n   b = c\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport algebra.ring\nimport tactic\n\nvariables {R : Type*} [ring R]\nvariables {a b c : R}\n\nexample\n  (h : a + b = a + c)\n  : b = c :=\nsorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Soluciones con Lean<\/b><\/p>\n<pre lang=\"lean\">\nimport algebra.ring\nimport tactic\n\nvariables {R : Type*} [ring R]\nvariables {a b c : R}\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : a + b = a + c)\n  : b = c :=\ncalc b\n     = 0 + b        : by rw zero_add\n ... = (-a + a) + b : by rw add_left_neg\n ... = -a + (a + b) : by rw add_assoc\n ... = -a + (a + c) : by rw h\n ... = (-a + a) + c : by rw \u2190add_assoc\n ... = 0 + c        : by rw add_left_neg\n ... = c            : by rw zero_add\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : a + b = a + c)\n  : b = c :=\ncalc b\n     = 0 + b        : by simp\n ... = (-a + a) + b : by simp\n ... = -a + (a + b) : by simp\n ... = -a + (a + c) : by rw h\n ... = (-a + a) + c : by simp\n ... = 0 + c        : by simp\n ... = c            : by simp\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nlemma aux : -a + (a + b) = b :=\nby finish\n\nexample\n  (h : a + b = a + c)\n  : b = c :=\ncalc b\n     = -a + (a + b) : aux.symm\n ... = -a + (a + c) : congr_arg (\u03bb x, -a + x) h\n ... = c            : aux\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : a + b = a + c)\n  : b = c :=\n-- by library_search\n(add_right_inj a).mp h\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : a + b = a + c)\n  : b = c :=\n-- by hint\nby finish\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\/Cancelativa_de_la_suma_por_la_izquierda.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li>J. Avigad, K. Buzzard, R.Y. Lewis 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 que si R es un anillo y a, b, c \u2208 R tales que a + b = a + c entonces b = c Para ello, completar la siguiente teor\u00eda de Lean: import algebra.ring import tactic variables {R : Type*} [ring R] variables {a b c : R} example (h : a + b = a + c) : b = 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],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/986"}],"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=986"}],"version-history":[{"count":5,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/986\/revisions"}],"predecessor-version":[{"id":1090,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/986\/revisions\/1090"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}