        {"id":2477,"date":"2024-05-16T06:00:16","date_gmt":"2024-05-16T04:00:16","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=2477"},"modified":"2024-05-12T19:03:17","modified_gmt":"2024-05-12T17:03:17","slug":"16-may-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/16-may-24\/","title":{"rendered":"Si G es un grupo y a, b, c \u2208 G tales que a\u00b7b = a\u00b7c, entonces b = c"},"content":{"rendered":"\n<p>Demostrar con Lean4 que si &#92;(G&#92;) es un grupo y &#92;(a, b, c \u2208 G&#92;) tales que &#92;(a\u00b7b = a\u00b7c&#92;), entonces &#92;(b = c&#92;).<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Algebra.Group.Basic\n\nvariable {G : Type} [Group G]\nvariable {a b c : G}\n\nexample\n  (h: a * b = a  * c)\n  : b = c :=\nsorry\n<\/pre>\n<p><!--more--><\/p>\n<h2>1. Demostraci\u00f3n en lenguaje natural<\/h2>\n<p>Por la siguiente cadena de igualdades<br \/>\n&#92;begin{align}<br \/>\n   b &amp;= 1\u00b7b          &amp;&amp;&#92;text{[porque &#92;(1&#92;) es neutro]} &#92;&#92;<br \/>\n     &amp;= (a\u207b\u00b9\u00b7a)\u00b7b    &amp;&amp;&#92;text{[porque &#92;(a\u207b\u00b9&#92;) es el inverso de &#92;(a&#92;)]} &#92;&#92;<br \/>\n     &amp;= a\u207b\u00b9\u00b7(a\u00b7b)    &amp;&amp;&#92;text{[por la asociativa]} &#92;&#92;<br \/>\n     &amp;= a\u207b\u00b9\u00b7(a\u00b7c)    &amp;&amp;&#92;text{[por la hip\u00f3tesis]} &#92;&#92;<br \/>\n     &amp;= (a\u207b\u00b9\u00b7a)\u00b7c    &amp;&amp;&#92;text{[por la asociativa]} &#92;&#92;<br \/>\n     &amp;= 1\u00b7c          &amp;&amp;&#92;text{[porque &#92;(a\u207b\u00b9&#92;) es el inverso de &#92;(a&#92;)]} &#92;&#92;<br \/>\n     &amp;= c            &amp;&amp;&#92;text{[porque 1 es neutro]}<br \/>\n&#92;end{align}<\/p>\n<h2>2. Demostraciones con Lean4<\/h2>\n<pre lang=\"lean\">\nimport Mathlib.Algebra.Group.Basic\n\nvariable {G : Type} [Group G]\nvariable {a b c : G}\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h: a * b = a  * c)\n  : b = c :=\ncalc b = 1 * b         := (one_mul b).symm\n     _ = (a\u207b\u00b9 * a) * b := congrArg (. * b) (inv_mul_self a).symm\n     _ = a\u207b\u00b9 * (a * b) := mul_assoc a\u207b\u00b9 a b\n     _ = a\u207b\u00b9 * (a * c) := congrArg (a\u207b\u00b9 * .) h\n     _ = (a\u207b\u00b9 * a) * c := (mul_assoc a\u207b\u00b9 a c).symm\n     _ = 1 * c         := congrArg (. * c) (inv_mul_self a)\n     _ = c             := one_mul c\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h: a * b = a  * c)\n  : b = c :=\ncalc b = 1 * b         := by rw [one_mul]\n     _ = (a\u207b\u00b9 * a) * b := by rw [inv_mul_self]\n     _ = a\u207b\u00b9 * (a * b) := by rw [mul_assoc]\n     _ = a\u207b\u00b9 * (a * c) := by rw [h]\n     _ = (a\u207b\u00b9 * a) * c := by rw [mul_assoc]\n     _ = 1 * c         := by rw [inv_mul_self]\n     _ = c             := by rw [one_mul]\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h: a * b = a  * c)\n  : b = c :=\ncalc b = 1 * b         := by simp\n     _ = (a\u207b\u00b9 * a) * b := by simp\n     _ = a\u207b\u00b9 * (a * b) := by simp\n     _ = a\u207b\u00b9 * (a * c) := by simp [h]\n     _ = (a\u207b\u00b9 * a) * c := by simp\n     _ = 1 * c         := by simp\n     _ = c             := by simp\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h: a * b = a  * c)\n  : b = c :=\ncalc b = a\u207b\u00b9 * (a * b) := by simp\n     _ = a\u207b\u00b9 * (a * c) := by simp [h]\n     _ = c             := by simp\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h: a * b = a  * c)\n  : b = c :=\nmul_left_cancel h\n\n-- 5\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h: a * b = a  * c)\n  : b = c :=\nby aesop\n\n-- Lemas usados\n-- ============\n\n-- #check (inv_mul_self a : a\u207b\u00b9 * a = 1)\n-- #check (mul_assoc a b c : (a * b) * c = a * (b * c))\n-- #check (mul_left_cancel : a * b = a * c \u2192 b = c)\n-- #check (one_mul a : 1 * a = a)\n<\/pre>\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\/Propiedad_cancelativa_en_grupos.lean\">Lean 4 Web<\/a>.<\/p>\n<h2>3. Demostraciones con Isabelle\/HOL<\/h2>\n<pre lang=\"isar\">\ntheory Propiedad_cancelativa_en_grupos\nimports Main\nbegin\n\ncontext group\nbegin\n\n(* 1\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"a * b = a * c\"\n  shows   \"b = c\"\nproof -\n  have \"b = 1 * b\"                    by (simp only: left_neutral)\n  also have \"\u2026 = (inverse a * a) * b\" by (simp only: left_inverse)\n  also have \"\u2026 = inverse a * (a * b)\" by (simp only: assoc)\n  also have \"\u2026 = inverse a * (a * c)\" by (simp only: \u2039a * b = a * c\u203a)\n  also have \"\u2026 = (inverse a * a) * c\" by (simp only: assoc)\n  also have \"\u2026 = 1 * c\"               by (simp only: left_inverse)\n  also have \"\u2026 = c\"                   by (simp only: left_neutral)\n  finally show \"b = c\"                by this\nqed\n\n(* 2\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"a * b = a * c\"\n  shows   \"b = c\"\nproof -\n  have \"b = 1 * b\"                    by simp\n  also have \"\u2026 = (inverse a * a) * b\" by simp\n  also have \"\u2026 = inverse a * (a * b)\" by (simp only: assoc)\n  also have \"\u2026 = inverse a * (a * c)\" using \u2039a * b = a * c\u203a by simp\n  also have \"\u2026 = (inverse a * a) * c\" by (simp only: assoc)\n  also have \"\u2026 = 1 * c\"               by simp\n  finally show \"b = c\"                by simp\nqed\n\n(* 3\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"a * b = a * c\"\n  shows   \"b = c\"\nproof -\n  have \"b = (inverse a * a) * b\"      by simp\n  also have \"\u2026 = inverse a * (a * b)\" by (simp only: assoc)\n  also have \"\u2026 = inverse a * (a * c)\" using \u2039a * b = a * c\u203a by simp\n  also have \"\u2026 = (inverse a * a) * c\" by (simp only: assoc)\n  finally show \"b = c\"                by simp\nqed\n\n(* 4\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"a * b = a * c\"\n  shows   \"b = c\"\nproof -\n  have \"inverse a * (a * b) = inverse a * (a * c)\"\n    by (simp only: \u2039a * b = a * c\u203a)\n  then have \"(inverse a * a) * b = (inverse a * a) * c\"\n    by (simp only: assoc)\n  then have \"1 * b = 1 * c\"\n    by (simp only: left_inverse)\n  then show \"b = c\"\n    by (simp only: left_neutral)\nqed\n\n(* 5\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"a * b = a * c\"\n  shows   \"b = c\"\nproof -\n  have \"inverse a * (a * b) = inverse a * (a * c)\"\n    by (simp only: \u2039a * b = a * c\u203a)\n  then have \"(inverse a * a) * b = (inverse a * a) * c\"\n    by (simp only: assoc)\n  then have \"1 * b = 1 * c\"\n    by (simp only: left_inverse)\n  then show \"b = c\"\n    by (simp only: left_neutral)\nqed\n\n(* 6\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"a * b = a * c\"\n  shows   \"b = c\"\nproof -\n  have \"inverse a * (a * b) = inverse a * (a * c)\"\n    using \u2039a * b = a * c\u203a by simp\n  then have \"(inverse a * a) * b = (inverse a * a) * c\"\n    by (simp only: assoc)\n  then have \"1 * b = 1 * c\"\n    by simp\n  then show \"b = c\"\n    by simp\nqed\n\n(* 7\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"a * b = a * c\"\n  shows   \"b = c\"\n  using assms\n  by (simp only: left_cancel)\n\nend\n\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si &#92;(G&#92;) es un grupo y &#92;(a, b, c \u2208 G&#92;) tales que &#92;(a\u00b7b = a\u00b7c&#92;), entonces &#92;(b = c&#92;). Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Algebra.Group.Basic variable {G : Type} [Group G] variable {a b c : G} 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":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_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\/2477"}],"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=2477"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2477\/revisions"}],"predecessor-version":[{"id":2478,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2477\/revisions\/2478"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=2477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=2477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=2477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}