        {"id":2322,"date":"2024-03-08T06:00:16","date_gmt":"2024-03-08T04:00:16","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=2322"},"modified":"2024-03-07T17:12:23","modified_gmt":"2024-03-07T15:12:23","slug":"08-mar-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/08-mar-24\/","title":{"rendered":"\u22c2\u1d62 (A\u1d62 \u2229 B\u1d62) = (\u22c2\u1d62 A\u1d62) \u2229 (\u22c2\u1d62 B\u1d62)"},"content":{"rendered":"\n<p>Demostrar con Lean4 que<br \/>\n&#92;[ \u22c2_i (A_i \u2229 B_i) = (\u22c2_i A_i) \u2229 (\u22c2_i B_i) &#92;]<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Set.Basic\nimport Mathlib.Tactic\n\nopen Set\n\nvariable {\u03b1 : Type}\nvariable (A B : \u2115 \u2192 Set \u03b1)\n\nexample : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<h2>1. Demostraci\u00f3n en lenguaje natural<\/h2>\n<p>Tenemos que demostrar que para &#92;(x&#92;) se verifica<br \/>\n&#92;[ x \u2208 \u22c2_i (A_i \u2229 B_i) \u2194 x \u2208 (\u22c2_i A_i) \u2229 (\u22c2_i B_i) &#92;]<br \/>\nLo demostramos mediante la siguiente cadena de equivalencias<br \/>\n&#92;begin{align}<br \/>\n   x \u2208 \u22c2_i (A_i \u2229 B_i) &amp;\u2194 (\u2200 i)[x \u2208 A_i \u2229 B_i] &#92;&#92;<br \/>\n                       &amp;\u2194 (\u2200 i)[x \u2208 A_i \u2227 x \u2208 B_i] &#92;&#92;<br \/>\n                       &amp;\u2194 (\u2200 i)[x \u2208 A_i] \u2227 (\u2200 i)[x \u2208 B_i] &#92;&#92;<br \/>\n                       &amp;\u2194 x \u2208 (\u22c2_i A_i) \u2227 x \u2208 (\u22c2_i B_i) &#92;&#92;<br \/>\n                       &amp;\u2194 x \u2208 (\u22c2_i A_i) \u2229 (\u22c2_i B_i)<br \/>\n&#92;end{align}<\/p>\n<h2>2. Demostraciones con Lean4<\/h2>\n<pre lang=\"lean\">\nimport Mathlib.Data.Set.Basic\nimport Mathlib.Tactic\n\nopen Set\n\nvariable {\u03b1 : Type}\nvariable (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) :=\nby\n  ext x\n  -- x : \u03b1\n  -- \u22a2 x \u2208 \u22c2 (i : \u2115), A i \u2229 B i \u2194 x \u2208 (\u22c2 (i : \u2115), A i) \u2229 \u22c2 (i : \u2115), B i\n  calc x \u2208 \u22c2 i, A i \u2229 B i\n     \u2194 \u2200 i, x \u2208 A i \u2229 B i :=\n         by exact mem_iInter\n   _ \u2194 \u2200 i, x \u2208 A i \u2227 x \u2208 B i :=\n         by simp only [mem_inter_iff]\n   _ \u2194 (\u2200 i, x \u2208 A i) \u2227 (\u2200 i, x \u2208 B i) :=\n         by exact forall_and\n   _ \u2194 x \u2208 (\u22c2 i, A i) \u2227 x \u2208 (\u22c2 i, B i) :=\n         by simp only [mem_iInter]\n   _ \u2194 x \u2208 (\u22c2 i, A i) \u2229 \u22c2 i, B i :=\n         by simp only [mem_inter_iff]\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) :=\nby\n  ext x\n  -- x : \u03b1\n  -- \u22a2 x \u2208 \u22c2 (i : \u2115), A i \u2229 B i \u2194 x \u2208 (\u22c2 (i : \u2115), A i) \u2229 \u22c2 (i : \u2115), B i\n  simp only [mem_inter_iff, mem_iInter]\n  -- \u22a2 (\u2200 (i : \u2115), x \u2208 A i \u2227 x \u2208 B i) \u2194 (\u2200 (i : \u2115), x \u2208 A i) \u2227 \u2200 (i : \u2115), x \u2208 B i\n  constructor\n  . -- \u22a2 (\u2200 (i : \u2115), x \u2208 A i \u2227 x \u2208 B i) \u2192 (\u2200 (i : \u2115), x \u2208 A i) \u2227 \u2200 (i : \u2115), x \u2208 B i\n    intro h\n    -- h : \u2200 (i : \u2115), x \u2208 A i \u2227 x \u2208 B i\n    -- \u22a2 (\u2200 (i : \u2115), x \u2208 A i) \u2227 \u2200 (i : \u2115), x \u2208 B i\n    constructor\n    . -- \u22a2 \u2200 (i : \u2115), x \u2208 A i\n      intro i\n      -- i : \u2115\n      -- \u22a2 x \u2208 A i\n      exact (h i).1\n    . -- \u22a2 \u2200 (i : \u2115), x \u2208 B i\n      intro i\n      -- i : \u2115\n      -- \u22a2 x \u2208 B i\n      exact (h i).2\n  . -- \u22a2 ((\u2200 (i : \u2115), x \u2208 A i) \u2227 \u2200 (i : \u2115), x \u2208 B i) \u2192 \u2200 (i : \u2115), x \u2208 A i \u2227 x \u2208 B i\n    intros h i\n    -- h : (\u2200 (i : \u2115), x \u2208 A i) \u2227 \u2200 (i : \u2115), x \u2208 B i\n    -- i : \u2115\n    -- \u22a2 x \u2208 A i \u2227 x \u2208 B i\n    rcases h with \u27e8h1, h2\u27e9\n    -- h1 : \u2200 (i : \u2115), x \u2208 A i\n    -- h2 : \u2200 (i : \u2115), x \u2208 B i\n    constructor\n    . -- \u22a2 x \u2208 A i\n      exact h1 i\n    . -- \u22a2 x \u2208 B i\n      exact h2 i\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) :=\nby\n  ext x\n  -- x : \u03b1\n  -- \u22a2 x \u2208 \u22c2 (i : \u2115), A i \u2229 B i \u2194 x \u2208 (\u22c2 (i : \u2115), A i) \u2229 \u22c2 (i : \u2115), B i\n  simp only [mem_inter_iff, mem_iInter]\n  -- \u22a2 (\u2200 (i : \u2115), x \u2208 A i \u2227 x \u2208 B i) \u2194 (\u2200 (i : \u2115), x \u2208 A i) \u2227 \u2200 (i : \u2115), x \u2208 B i\n  exact \u27e8fun h \u21a6 \u27e8fun i \u21a6 (h i).1, fun i \u21a6 (h i).2\u27e9,\n         fun \u27e8h1, h2\u27e9 i \u21a6 \u27e8h1 i, h2 i\u27e9\u27e9\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) :=\nby\n  ext\n  -- x : \u03b1\n  -- \u22a2 x \u2208 \u22c2 (i : \u2115), A i \u2229 B i \u2194 x \u2208 (\u22c2 (i : \u2115), A i) \u2229 \u22c2 (i : \u2115), B i\n  simp only [mem_inter_iff, mem_iInter]\n  -- \u22a2 (\u2200 (i : \u2115), x \u2208 A i \u2227 x \u2208 B i) \u2194 (\u2200 (i : \u2115), x \u2208 A i) \u2227 \u2200 (i : \u2115), x \u2208 B i\n  aesop\n\n-- Lemas usados\n-- ============\n\n-- variable (x : \u03b1)\n-- variable (a b : Set \u03b1)\n-- variable (\u03b9 : Sort v)\n-- variable (s : \u03b9 \u2192 Set \u03b1)\n-- variable (p q : \u03b1 \u2192 Prop)\n-- #check (forall_and : (\u2200 (x : \u03b1), p x \u2227 q x) \u2194 (\u2200 (x : \u03b1), p x) \u2227 \u2200 (x : \u03b1), q x)\n-- #check (mem_iInter : x \u2208 \u22c2 (i : \u03b9), s i \u2194 \u2200 (i : \u03b9), x \u2208 s i)\n-- #check (mem_inter_iff x a b : x \u2208 a \u2229 b \u2194 x \u2208 a \u2227 x \u2208 b)\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\/Interseccion_de_intersecciones.lean\" rel=\"noopener noreferrer\" target=\"_blank\">Lean 4 Web<\/a>.<\/p>\n<h2>3. Demostraciones con Isabelle\/HOL<\/h2>\n<pre lang=\"isar\">\ntheory Interseccion_de_intersecciones\nimports Main\nbegin\n\n(* 1\u00aa demostraci\u00f3n *)\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\n(* 2\u00aa demostraci\u00f3n *)\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\n(* 3\u00aa demostraci\u00f3n *)\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","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que &#92;[ \u22c2_i (A_i \u2229 B_i) = (\u22c2_i A_i) \u2229 (\u22c2_i B_i) &#92;] Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Set.Basic import Mathlib.Tactic open Set variable {\u03b1 : Type} variable (A B : \u2115 \u2192 Set \u03b1) example : (\u22c2 i, A i \u2229 B i) = (\u22c2 i, A i) \u2229 (\u22c2 i, B i) := by 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":[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\/2322"}],"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=2322"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2322\/revisions"}],"predecessor-version":[{"id":2324,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2322\/revisions\/2324"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=2322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=2322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=2322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}