        {"id":658,"date":"2021-08-16T06:00:24","date_gmt":"2021-08-16T04:00:24","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=658"},"modified":"2021-08-06T16:48:51","modified_gmt":"2021-08-06T14:48:51","slug":"la-composicion-de-funciones-biyectivas-es-biyectiva","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/la-composicion-de-funciones-biyectivas-es-biyectiva\/","title":{"rendered":"La composici\u00f3n de funciones biyectivas es biyectiva"},"content":{"rendered":"<p>Demostrar que la composici\u00f3n de dos funciones biyectivas es una funci\u00f3n biyectiva.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport tactic\nopen function\n\nvariables {X Y Z : Type}\nvariable  {f : X \u2192 Y}\nvariable  {g : Y \u2192 Z}\n\nexample\n  (Hf : bijective f)\n  (Hg : bijective g)\n  : bijective (g \u2218 f) :=\nsorry\n<\/pre>\n<p>[expand title=\u00bbSoluciones con Lean\u00bb]<\/p>\n<pre lang=\"lean\">\r\nimport tactic\r\nopen function\r\n\r\nvariables {X Y Z : Type}\r\nvariable  {f : X \u2192 Y}\r\nvariable  {g : Y \u2192 Z}\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\nexample\r\n  (Hf : bijective f)\r\n  (Hg : bijective g)\r\n  : bijective (g \u2218 f) :=\r\nbegin\r\n  cases Hf with Hfi Hfs,\r\n  cases Hg with Hgi Hgs,\r\n  split,\r\n  { apply injective.comp,\r\n    { exact Hgi, },\r\n    { exact Hfi, }},\r\n  { apply surjective.comp,\r\n    { exact Hgs, },\r\n    { exact Hfs, }},\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\nexample\r\n  (Hf : bijective f)\r\n  (Hg : bijective g)\r\n  : bijective (g \u2218 f) :=\r\nbegin\r\n  cases Hf with Hfi Hfs,\r\n  cases Hg with Hgi Hgs,\r\n  split,\r\n  { exact injective.comp Hgi Hfi, },\r\n  { exact surjective.comp Hgs Hfs, },\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\nexample\r\n  (Hf : bijective f)\r\n  (Hg : bijective g)\r\n  : bijective (g \u2218 f) :=\r\nbegin\r\n  cases Hf with Hfi Hfs,\r\n  cases Hg with Hgi Hgs,\r\n  exact \u27e8injective.comp Hgi Hfi,\r\n         surjective.comp Hgs Hfs\u27e9,\r\nend\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\nexample :\r\n  bijective f \u2192 bijective g \u2192 bijective (g \u2218 f) :=\r\nbegin\r\n  rintros \u27e8Hfi, Hfs\u27e9 \u27e8Hgi, Hgs\u27e9,\r\n  exact \u27e8injective.comp Hgi Hfi,\r\n         surjective.comp Hgs Hfs\u27e9,\r\nend\r\n\r\n-- 5\u00aa demostraci\u00f3n\r\nexample :\r\n  bijective f \u2192 bijective g \u2192 bijective (g \u2218 f) :=\r\n\u03bb \u27e8Hfi, Hfs\u27e9 \u27e8Hgi, Hgs\u27e9, \u27e8injective.comp Hgi Hfi,\r\n                          surjective.comp Hgs Hfs\u27e9\r\n\r\n-- 6\u00aa demostraci\u00f3n\r\nexample\r\n  (Hf : bijective f)\r\n  (Hg : bijective g)\r\n  : bijective (g \u2218 f) :=\r\n-- by library_search\r\nbijective.comp Hg Hf\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\/La_composicion_de_funciones_biyectivas_es_biyectiva.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 La_composicion_de_funciones_biyectivas_es_biyectiva\r\nimports Main\r\nbegin\r\n\r\n(* 1\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"bij f\"\r\n          \"bij g\"\r\n  shows   \"bij (g \u2218 f)\"\r\nproof (rule bijI)\r\n  show \"inj (g \u2218 f)\"\r\n  proof (rule inj_compose)\r\n    show \"inj g\"\r\n      using \u2039bij g\u203a by (rule bij_is_inj)\r\n  next\r\n    show \"inj f\"\r\n      using \u2039bij f\u203a by (rule bij_is_inj)\r\n  qed\r\nnext\r\n  show \"surj (g \u2218 f)\"\r\n  proof (rule comp_surj)\r\n    show \"surj f\"\r\n      using \u2039bij f\u203a by (rule bij_is_surj)\r\n  next\r\n    show \"surj g\"\r\n      using \u2039bij g\u203a by (rule bij_is_surj)\r\n  qed\r\nqed\r\n\r\n(* 2\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"bij f\"\r\n          \"bij g\"\r\n  shows   \"bij (g \u2218 f)\"\r\nproof (rule bijI)\r\n  show \"inj (g \u2218 f)\"\r\n  proof (rule inj_compose)\r\n    show \"inj g\"\r\n      by (rule bij_is_inj [OF \u2039bij g\u203a])\r\n  next\r\n    show \"inj f\"\r\n      by (rule bij_is_inj [OF \u2039bij f\u203a])\r\n  qed\r\nnext\r\n  show \"surj (g \u2218 f)\"\r\n  proof (rule comp_surj)\r\n    show \"surj f\"\r\n      by (rule bij_is_surj [OF \u2039bij f\u203a])\r\n  next\r\n    show \"surj g\"\r\n      by (rule bij_is_surj [OF \u2039bij g\u203a])\r\n  qed\r\nqed\r\n\r\n(* 3\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"bij f\"\r\n          \"bij g\"\r\n  shows   \"bij (g \u2218 f)\"\r\nproof (rule bijI)\r\n  show \"inj (g \u2218 f)\"\r\n    by (rule inj_compose [OF bij_is_inj [OF \u2039bij g\u203a]\r\n                             bij_is_inj [OF \u2039bij f\u203a]])\r\nnext\r\n  show \"surj (g \u2218 f)\"\r\n    by (rule comp_surj [OF bij_is_surj [OF \u2039bij f\u203a]\r\n                           bij_is_surj [OF \u2039bij g\u203a]])\r\nqed\r\n\r\n(* 4\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"bij f\"\r\n          \"bij g\"\r\n  shows   \"bij (g \u2218 f)\"\r\nby (rule bijI [OF inj_compose [OF bij_is_inj  [OF \u2039bij g\u203a]\r\n                                  bij_is_inj  [OF \u2039bij f\u203a]]\r\n                  comp_surj   [OF bij_is_surj [OF \u2039bij f\u203a]\r\n                                  bij_is_surj [OF \u2039bij g\u203a]]])\r\n\r\n(* 5\u00aa demostraci\u00f3n *)\r\nlemma\r\n  assumes \"bij f\"\r\n          \"bij g\"\r\n  shows   \"bij (g \u2218 f)\"\r\nusing assms\r\nby (rule bij_comp)\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>Demostrar que la composici\u00f3n de dos funciones biyectivas es una funci\u00f3n biyectiva. Para ello, completar la siguiente teor\u00eda de Lean: import tactic open function variables {X Y Z : Type} variable {f : X \u2192 Y} variable {g : Y \u2192 Z} example (Hf : bijective f) (Hg : bijective g) : bijective (g \u2218 f) := sorry [expand title=\u00bbSoluciones con Lean\u00bb] import tactic open function variables {X Y Z : Type} variable {f : X \u2192 Y} variable {g : Y \u2192 Z} &#8212; 1\u00aa demostraci\u00f3n example (Hf : bijective f) (Hg : bijective g) : bijective (g \u2218 f) := begin cases Hf with Hfi Hfs, cases Hg with Hgi Hgs, split, { apply injective.comp, { exact Hgi, }, { exact Hfi, }},&#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":[17],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/658"}],"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=658"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/658\/revisions"}],"predecessor-version":[{"id":659,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/658\/revisions\/659"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}