        {"id":652,"date":"2021-08-13T06:00:00","date_gmt":"2021-08-13T04:00:00","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=652"},"modified":"2021-08-05T17:10:17","modified_gmt":"2021-08-05T15:10:17","slug":"la-equipotencia-es-una-relacion-simetrica","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/la-equipotencia-es-una-relacion-simetrica\/","title":{"rendered":"La equipotencia es una relaci\u00f3n sim\u00e9trica"},"content":{"rendered":"<p>Dos conjuntos A y B son equipotentes (y se denota por A \u2243 B) si existe una aplicaci\u00f3n biyectiva entre ellos. La equipotencia se puede definir en Lean por<\/p>\n<pre lang=\"text\">\n   def es_equipotente (A B : Type*) :=\n     \u2203 g : A \u2192 B, bijective g\n\n   infix ` \u22cd `: 50 := es_equipotente\n<\/pre>\n<p>Demostrar que la relaci\u00f3n de equipotencia es sim\u00e9trica.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport tactic\nopen function\n\ndef es_equipotente (A B : Type*) :=\n  \u2203 g : A \u2192 B, bijective g\n\ninfix ` \u22cd `: 50 := es_equipotente\n\nvariables {X Y : Type*}\nvariable  {f : X \u2192 Y}\nvariable  {g : Y \u2192 X}\n\nexample : symmetric (\u22cd) :=\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\ndef es_equipotente (A B : Type*) :=\r\n  \u2203 g : A \u2192 B, bijective g\r\n\r\ninfix ` \u22cd `: 50 := es_equipotente\r\n\r\nvariables {X Y : Type*}\r\nvariable  {f : X \u2192 Y}\r\nvariable  {g : Y \u2192 X}\r\n\r\ndef inversa (f : X \u2192 Y) (g : Y \u2192 X) :=\r\n  (\u2200 x, (g \u2218 f) x = x) \u2227 (\u2200 y, (f \u2218 g) y = y)\r\n\r\ndef tiene_inversa (f : X \u2192 Y) :=\r\n  \u2203 g, inversa g f\r\n\r\nlemma aux1\r\n  (hf : bijective f)\r\n  : tiene_inversa f :=\r\nbegin\r\n  cases (bijective_iff_has_inverse.mp hf) with g hg,\r\n  by tidy,\r\nend\r\n\r\nlemma aux2\r\n  (hf : bijective f)\r\n  (hg : inversa g f)\r\n  : bijective g :=\r\nbijective_iff_has_inverse.mpr (by use [f, hg])\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\nexample : symmetric (\u22cd) :=\r\nbegin\r\n  unfold symmetric,\r\n  intros x y hxy,\r\n  unfold es_equipotente at *,\r\n  cases hxy with f hf,\r\n  have h1 : tiene_inversa f := aux1 hf,\r\n  cases h1 with g hg,\r\n  use g,\r\n  exact aux2 hf hg,\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\nexample : symmetric (\u22cd) :=\r\nbegin\r\n  intros x y hxy,\r\n  cases hxy with f hf,\r\n  cases (aux1 hf) with g hg,\r\n  use [g, aux2 hf hg],\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\nexample : symmetric (\u22cd) :=\r\nbegin\r\n  rintros x y \u27e8f, hf\u27e9,\r\n  cases (aux1 hf) with g hg,\r\n  use [g, aux2 hf hg],\r\nend\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_equipotencia_es_una_relacion_simetrica.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_equipotencia_es_una_relacion_simetrica\r\nimports Main \"HOL-Library.Equipollence\"\r\nbegin\r\n\r\n(* 1\u00aa demostraci\u00f3n *)\r\nlemma \"symp (\u2248)\"\r\nproof (rule sympI)\r\n  fix x y :: \"'a set\"\r\n  assume \"x \u2248 y\"\r\n  then obtain f where \"bij_betw f x y\"\r\n    using eqpoll_def by blast\r\n  then have \"bij_betw (the_inv_into x f) y x\"\r\n    by (rule bij_betw_the_inv_into)\r\n  then have \"\u2203g. bij_betw g y x\"\r\n    by auto\r\n  then show \"y \u2248 x\"\r\n    by (simp only: eqpoll_def)\r\nqed\r\n\r\n(* 2\u00aa demostraci\u00f3n *)\r\nlemma \"symp (\u2248)\"\r\n  unfolding eqpoll_def symp_def\r\n  using bij_betw_the_inv_into by auto\r\n\r\n(* 3\u00aa demostraci\u00f3n *)\r\nlemma \"symp (\u2248)\"\r\n  by (simp add: eqpoll_sym sympI)\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>Dos conjuntos A y B son equipotentes (y se denota por A \u2243 B) si existe una aplicaci\u00f3n biyectiva entre ellos. La equipotencia se puede definir en Lean por def es_equipotente (A B : Type*) := \u2203 g : A \u2192 B, bijective g infix ` \u22cd `: 50 := es_equipotente Demostrar que la relaci\u00f3n de equipotencia es sim\u00e9trica. Para ello, completar la siguiente teor\u00eda de Lean: import tactic open function def es_equipotente (A B : Type*) := \u2203 g : A \u2192 B, bijective g infix ` \u22cd `: 50 := es_equipotente variables {X Y : Type*} variable {f : X \u2192 Y} variable {g : Y \u2192 X} example : symmetric (\u22cd) := sorry [expand title=\u00bbSoluciones con Lean\u00bb] import tactic open function def&#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":[29],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/652"}],"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=652"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/652\/revisions"}],"predecessor-version":[{"id":653,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/652\/revisions\/653"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}