        {"id":539,"date":"2021-07-08T06:00:22","date_gmt":"2021-07-08T04:00:22","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=539"},"modified":"2021-07-04T17:06:14","modified_gmt":"2021-07-04T15:06:14","slug":"propiedad-cancelativa-en-grupos","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/propiedad-cancelativa-en-grupos\/","title":{"rendered":"Propiedad cancelativa en grupos"},"content":{"rendered":"<p>Sea G un grupo y a,b,c \u2208 G. Demostrar que si a * b = a* c, entonces b = c.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport algebra.group.basic\n\nuniverse  u\nvariables {G : Type u} [group G]\nvariables {a b c : G}\n\nexample\n  (h: a * b = a  * c)\n  : b = c :=\nsorry\n<\/pre>\n<p>[expand title=\u00bbSoluciones con Lean\u00bb]<\/p>\n<pre lang=\"lean\">\r\nimport algebra.group.basic\r\n\r\nuniverse  u\r\nvariables {G : Type u} [group G]\r\nvariables {a b c : G}\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\ncalc b = 1 * b         : (one_mul b).symm\r\n   ... = (a\u207b\u00b9 * a) * b : congr_arg (* b) (inv_mul_self a).symm\r\n   ... = a\u207b\u00b9 * (a * b) : mul_assoc a\u207b\u00b9 a b\r\n   ... = a\u207b\u00b9 * (a * c) : congr_arg ((*) a\u207b\u00b9) h\r\n   ... = (a\u207b\u00b9 * a) * c : (mul_assoc a\u207b\u00b9 a c).symm\r\n   ... = 1 * c         : congr_arg (* c) (inv_mul_self a)\r\n   ... = c             : one_mul c\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\ncalc b = 1 * b         : by rw one_mul\r\n   ... = (a\u207b\u00b9 * a) * b : by rw inv_mul_self\r\n   ... = a\u207b\u00b9 * (a * b) : by rw mul_assoc\r\n   ... = a\u207b\u00b9 * (a * c) : by rw h\r\n   ... = (a\u207b\u00b9 * a) * c : by rw mul_assoc\r\n   ... = 1 * c         : by rw inv_mul_self\r\n   ... = c             : by rw one_mul\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\ncalc b = 1 * b         : by simp\r\n   ... = (a\u207b\u00b9 * a) * b : by simp\r\n   ... = a\u207b\u00b9 * (a * b) : by simp\r\n   ... = a\u207b\u00b9 * (a * c) : by simp [h]\r\n   ... = (a\u207b\u00b9 * a) * c : by simp\r\n   ... = 1 * c         : by simp\r\n   ... = c             : by simp\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\ncalc b = a\u207b\u00b9 * (a * b) : by simp\r\n   ... = a\u207b\u00b9 * (a * c) : by simp [h]\r\n   ... = c             : by simp\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\nbegin\r\n  have h1 : a\u207b\u00b9 * (a * b) = a\u207b\u00b9 * (a  * c),\r\n    { by finish [h] },\r\n  have h2 : (a\u207b\u00b9 * a) * b = (a\u207b\u00b9 * a)  * c,\r\n    { by finish },\r\n  have h3 : 1 * b = 1  * c,\r\n    { by finish },\r\n  have h3 : b = c,\r\n    { by finish },\r\n  exact h3,\r\nend\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\nbegin\r\n  have : a\u207b\u00b9 * (a * b) = a\u207b\u00b9 * (a  * c),\r\n    { by finish [h] },\r\n  have h2 : (a\u207b\u00b9 * a) * b = (a\u207b\u00b9 * a)  * c,\r\n    { by finish },\r\n  have h3 : 1 * b = 1  * c,\r\n    { by finish },\r\n  have h3 : b = c,\r\n    { by finish },\r\n  exact h3,\r\nend\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\nbegin\r\n  have h1 : a\u207b\u00b9 * (a * b) = a\u207b\u00b9 * (a  * c),\r\n    { congr, exact h, },\r\n  have h2 : (a\u207b\u00b9 * a) * b = (a\u207b\u00b9 * a)  * c,\r\n    { simp only [h1, mul_assoc], },\r\n  have h3 : 1 * b = 1  * c,\r\n    { simp only [h2, (inv_mul_self a).symm], },\r\n  rw one_mul at h3,\r\n  rw one_mul at h3,\r\n  exact h3,\r\nend\r\n\r\n-- 5\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\nmul_left_cancel h\r\n\r\n-- 6\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h: a * b = a  * c)\r\n  : b = c :=\r\nby finish\r\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\/Propiedad_cancelativa_en_grupos.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p>En los comentarios se pueden escribir otras soluciones, escribiendo el c\u00f3digo entre una l\u00ednea con &#60;pre lang=&quot;lean&quot;&#62; y otra con &#60;\/pre&#62;<br \/>\n[\/expand]<\/p>\n<p>[expand title=\u00bbSoluciones con Isabelle\/HOL\u00bb]<\/p>\n<pre lang=\"isar\">\r\ntheory Propiedad_cancelativa_en_grupos\r\nimports Main\r\nbegin\r\n\r\ncontext group\r\nbegin\r\n\r\n(* 1\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"a * b = a * c\"\r\n  shows   \"b = c\"\r\nproof -\r\n  have \"b = 1 * b\"                    by (simp only: left_neutral)\r\n  also have \"\u2026 = (inverse a * a) * b\" by (simp only: left_inverse)\r\n  also have \"\u2026 = inverse a * (a * b)\" by (simp only: assoc)\r\n  also have \"\u2026 = inverse a * (a * c)\" by (simp only: \u2039a * b = a * c\u203a)\r\n  also have \"\u2026 = (inverse a * a) * c\" by (simp only: assoc)\r\n  also have \"\u2026 = 1 * c\"               by (simp only: left_inverse)\r\n  also have \"\u2026 = c\"                   by (simp only: left_neutral)\r\n  finally show \"b = c\"                by this\r\nqed\r\n\r\n(* 2\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"a * b = a * c\"\r\n  shows   \"b = c\"\r\nproof -\r\n  have \"b = 1 * b\"                    by simp\r\n  also have \"\u2026 = (inverse a * a) * b\" by simp\r\n  also have \"\u2026 = inverse a * (a * b)\" by (simp only: assoc)\r\n  also have \"\u2026 = inverse a * (a * c)\" using \u2039a * b = a * c\u203a by simp\r\n  also have \"\u2026 = (inverse a * a) * c\" by (simp only: assoc)\r\n  also have \"\u2026 = 1 * c\"               by simp\r\n  finally show \"b = c\"                by simp\r\nqed\r\n\r\n(* 3\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"a * b = a * c\"\r\n  shows   \"b = c\"\r\nproof -\r\n  have \"b = (inverse a * a) * b\"      by simp\r\n  also have \"\u2026 = inverse a * (a * b)\" by (simp only: assoc)\r\n  also have \"\u2026 = inverse a * (a * c)\" using \u2039a * b = a * c\u203a by simp\r\n  also have \"\u2026 = (inverse a * a) * c\" by (simp only: assoc)\r\n  finally show \"b = c\"                by simp\r\nqed\r\n\r\n(* 4\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"a * b = a * c\"\r\n  shows   \"b = c\"\r\nproof -\r\n  have \"inverse a * (a * b) = inverse a * (a * c)\"\r\n    by (simp only: \u2039a * b = a * c\u203a)\r\n  then have \"(inverse a * a) * b = (inverse a * a) * c\"\r\n    by (simp only: assoc)\r\n  then have \"1 * b = 1 * c\"\r\n    by (simp only: left_inverse)\r\n  then show \"b = c\"\r\n    by (simp only: left_neutral)\r\nqed\r\n\r\n(* 5\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"a * b = a * c\"\r\n  shows   \"b = c\"\r\nproof -\r\n  have \"inverse a * (a * b) = inverse a * (a * c)\"\r\n    by (simp only: \u2039a * b = a * c\u203a)\r\n  then have \"(inverse a * a) * b = (inverse a * a) * c\"\r\n    by (simp only: assoc)\r\n  then have \"1 * b = 1 * c\"\r\n    by (simp only: left_inverse)\r\n  then show \"b = c\"\r\n    by (simp only: left_neutral)\r\nqed\r\n\r\n(* 6\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"a * b = a * c\"\r\n  shows   \"b = c\"\r\nproof -\r\n  have \"inverse a * (a * b) = inverse a * (a * c)\"\r\n    using \u2039a * b = a * c\u203a by simp\r\n  then have \"(inverse a * a) * b = (inverse a * a) * c\"\r\n    by (simp only: assoc)\r\n  then have \"1 * b = 1 * c\"\r\n    by simp\r\n  then show \"b = c\"\r\n    by simp\r\nqed\r\n\r\n(* 7\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"a * b = a * c\"\r\n  shows   \"b = c\"\r\n  using assms\r\n  by (simp only: left_cancel)\r\n\r\nend\r\n\r\nend\r\n<\/pre>\n<p>En los comentarios se pueden escribir otras soluciones, escribiendo el c\u00f3digo entre una l\u00ednea con &#60;pre lang=&quot;isar&quot;&#62; y otra con &#60;\/pre&#62;<br \/>\n[\/expand]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sea G un grupo y a,b,c \u2208 G. Demostrar que si a * b = a* c, entonces b = c. Para ello, completar la siguiente teor\u00eda de Lean: import algebra.group.basic universe u variables {G : Type u} [group G] variables {a b c : G} example (h: a * b = a * c) : b = c := sorry [expand title=\u00bbSoluciones con Lean\u00bb] import algebra.group.basic universe u variables {G : Type u} [group G] variables {a b c : G} &#8212; 1\u00aa demostraci\u00f3n &#8212; =============== example (h: a * b = a * c) : b = c := calc b = 1 * b : (one_mul b).symm &#8230; = (a\u207b\u00b9 * a) * b : congr_arg (* b) (inv_mul_self a).symm &#8230; =&#8230;<\/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":[11],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/539"}],"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=539"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/539\/revisions"}],"predecessor-version":[{"id":559,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/539\/revisions\/559"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}