        {"id":367,"date":"2021-06-03T06:00:45","date_gmt":"2021-06-03T04:00:45","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=367"},"modified":"2021-08-21T12:53:09","modified_gmt":"2021-08-21T10:53:09","slug":"interseccion-de-intersecciones","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/interseccion-de-intersecciones\/","title":{"rendered":"Intersecci\u00f3n de intersecciones"},"content":{"rendered":"<p>Demostrar que<\/p>\n<pre lang=\"lean\">\n(\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i)\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.set.basic\nimport tactic\n\nopen set\n\nvariable  {\u03b1 : Type}\nvariables A B : \u2115 \u2192 set \u03b1\n\nexample : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) :=\nsorry\n<\/pre>\n<h4>Soluciones<\/h4>\n<p><!--more--><\/p>\n<p><strong>Soluciones con Lean<\/strong><\/p>\n<pre lang=\"lean\">\nimport data.set.basic\nimport tactic\n\nopen set\n\nvariable  {\u03b1 : Type}\nvariables A B : \u2115 \u2192 set \u03b1\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) :=\nbegin\n  ext x,\n  simp only [mem_inter_eq, mem_Inter],\n  split,\n  { intro h,\n    split,\n    { intro i,\n      exact (h i).1 },\n    { intro i,\n      exact (h i).2 }},\n  { intros h i,\n    cases h with h1 h2,\n    split,\n    { exact h1 i },\n    { exact h2 i }},\nend\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) :=\nbegin\n  ext x,\n  simp only [mem_inter_eq, mem_Inter],\n  exact \u27e8\u03bb h, \u27e8\u03bb i, (h i).1, \u03bb i, (h i).2\u27e9,\n         \u03bb \u27e8h1, h2\u27e9 i, \u27e8h1 i, h2 i\u27e9\u27e9,\nend\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) :=\nbegin\n  ext,\n  simp only [mem_inter_eq, mem_Inter],\n  finish,\nend\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) :=\nbegin\n  ext,\n  finish [mem_inter_eq, mem_Inter],\nend\n\n-- 5\u00aa demostraci\u00f3n\n-- ===============\n\nexample : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) :=\nby finish [mem_inter_eq, mem_Inter, ext_iff]\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/bit.ly\/3uJjKub\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p><strong>Soluciones con Isabelle\/HOL<\/strong><\/p>\n<pre lang=\"isar\">\ntheory Interseccion_de_intersecciones\nimports Main\nbegin\n\nsection \u20391\u00aa demostraci\u00f3n\u203a\n\nlemma \"(\u22c2 i \u2208 I. A i \u2229 B i) = (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\nproof (rule equalityI)\n  show \"(\u22c2 i \u2208 I. A i \u2229 B i) \u2286 (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\n  proof (rule subsetI)\n    fix x\n    assume h1 : \"x \u2208 (\u22c2 i \u2208 I. A i \u2229 B i)\"\n    have \"x \u2208 (\u22c2 i \u2208 I. A i)\"\n    proof (rule INT_I)\n      fix i\n      assume \"i \u2208 I\"\n      with h1 have \"x \u2208 A i \u2229 B i\"\n        by (rule INT_D)\n      then show \"x \u2208 A i\"\n        by (rule IntD1)\n    qed\n    moreover\n    have \"x \u2208 (\u22c2 i \u2208 I. B i)\"\n    proof (rule INT_I)\n      fix i\n      assume \"i \u2208 I\"\n      with h1 have \"x \u2208 A i \u2229 B i\"\n        by (rule INT_D)\n      then show \"x \u2208 B i\"\n        by (rule IntD2)\n    qed\n    ultimately show \"x \u2208 (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\n      by (rule IntI)\n  qed\nnext\n  show \"(\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i) \u2286 (\u22c2 i \u2208 I. A i \u2229 B i)\"\n  proof (rule subsetI)\n    fix x\n    assume h2 : \"x \u2208 (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\n    show \"x \u2208 (\u22c2 i \u2208 I. A i \u2229 B i)\"\n    proof (rule INT_I)\n      fix i\n      assume \"i \u2208 I\"\n      have \"x \u2208 A i\"\n      proof -\n        have \"x \u2208 (\u22c2 i \u2208 I. A i)\"\n          using h2 by (rule IntD1)\n        then show \"x \u2208 A i\"\n          using \u2039i \u2208 I\u203a by (rule INT_D)\n      qed\n      moreover\n      have \"x \u2208 B i\"\n      proof -\n        have \"x \u2208 (\u22c2 i \u2208 I. B i)\"\n          using h2 by (rule IntD2)\n        then show \"x \u2208 B i\"\n          using \u2039i \u2208 I\u203a by (rule INT_D)\n      qed\n      ultimately show \"x \u2208 A i \u2229 B i\"\n        by (rule IntI)\n    qed\n  qed\nqed\n\nsection \u20392\u00aa demostraci\u00f3n\u203a\n\nlemma \"(\u22c2 i \u2208 I. A i \u2229 B i) = (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\nproof\n  show \"(\u22c2 i \u2208 I. A i \u2229 B i) \u2286 (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\n  proof\n    fix x\n    assume h1 : \"x \u2208 (\u22c2 i \u2208 I. A i \u2229 B i)\"\n    have \"x \u2208 (\u22c2 i \u2208 I. A i)\"\n    proof\n      fix i\n      assume \"i \u2208 I\"\n      then show \"x \u2208 A i\"\n        using h1 by simp\n    qed\n    moreover\n    have \"x \u2208 (\u22c2 i \u2208 I. B i)\"\n    proof\n      fix i\n      assume \"i \u2208 I\"\n      then show \"x \u2208 B i\"\n        using h1 by simp\n    qed\n    ultimately show \"x \u2208 (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\n      by simp\n  qed\nnext\n  show \"(\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i) \u2286 (\u22c2 i \u2208 I. A i \u2229 B i)\"\n  proof\n    fix x\n    assume h2 : \"x \u2208 (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\n    show \"x \u2208 (\u22c2 i \u2208 I. A i \u2229 B i)\"\n    proof\n      fix i\n      assume \"i \u2208 I\"\n      then have \"x \u2208 A i\"\n        using h2 by simp\n      moreover\n      have \"x \u2208 B i\"\n        using \u2039i \u2208 I\u203a h2 by simp\n      ultimately show \"x \u2208 A i \u2229 B i\"\n        by simp\n    qed\nqed\nqed\n\nsection \u20393\u00aa demostraci\u00f3n\u203a\n\nlemma \"(\u22c2 i \u2208 I. A i \u2229 B i) = (\u22c2 i \u2208 I. A i) \u2229 (\u22c2 i \u2208 I. B i)\"\n  by auto\n\nend\n<\/pre>\n<p><strong>Nuevas soluciones<\/strong><\/p>\n<ul>\n<li>En los comentarios se pueden escribir nuevas soluciones.\n<li>El c\u00f3digo se debe escribir entre una l\u00ednea con &#60;pre lang=&quot;isar&quot;&#62; y otra con &#60;\/pre&#62;\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar que (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) Para ello, completar la siguiente teor\u00eda de Lean: import data.set.basic import tactic open set variable {\u03b1 : Type} variables A B : \u2115 \u2192 set \u03b1 example : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) := sorry Soluciones<\/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":[7],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/367"}],"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=367"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/367\/revisions"}],"predecessor-version":[{"id":368,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/367\/revisions\/368"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}