        {"id":2418,"date":"2024-04-26T13:25:58","date_gmt":"2024-04-26T11:25:58","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=2418"},"modified":"2024-04-26T13:42:25","modified_gmt":"2024-04-26T11:42:25","slug":"26-abr-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/26-abr-24\/","title":{"rendered":"Imagen de la intersecci\u00f3n general"},"content":{"rendered":"\n<p>Demostrar con Lean4 que<br \/>\n&#92;[ f&#92;left[&#92;bigcap_{i \u2208 I} A_i&#92;right] \u2286 &#92;bigcap_{i \u2208 I} f[A_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 \u03b2 I : Type _}\nvariable (f : \u03b1 \u2192 \u03b2)\nvariable (A : I \u2192 Set \u03b1)\n\nexample : f '' (\u22c2 i, A i) \u2286 \u22c2 i, f '' A i :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<h2>1. Demostraci\u00f3n en lenguaje natural<\/h2>\n<p>Sea &#92;(y&#92;) tal que<br \/>\n&#92;[ y \u2208 f&#92;left[&#92;bigcap_{i \u2208 I} A\u1d62&#92;right] &#92;tag{1}  &#92;]<br \/>\nTenemos que demostrar que<br \/>\n&#92;[ y \u2208 &#92;bigcap_{i \u2208 I} f[A\u1d62] &#92;]<br \/>\nPara ello, sea &#92;(i \u2208 I&#92;), tenemos que demostrar que &#92;(y \u2208 f[A\u1d62]&#92;).<\/p>\n<p>Por (1), existe un &#92;(x&#92;) tal que<br \/>\n&#92;begin{align}<br \/>\n   &amp;x \u2208 &#92;bigcap_{i \u2208 I} A\u1d62 &#92;tag{2} &#92;&#92;<br \/>\n   &amp;f(x) = y  &#92;tag{3}<br \/>\n&#92;end{align}<br \/>\nPor (2),<br \/>\n&#92;[ x \u2208 A\u1d62 &#92;]<br \/>\ny, por tanto,<br \/>\n&#92;[ f(x) \u2208 f[A\u1d62] &#92;]<br \/>\nque, junto con (3), da que<br \/>\n&#92;[ y \u2208 f[A\u1d62] &#92;]<\/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 \u03b2 I : Type _}\nvariable (f : \u03b1 \u2192 \u03b2)\nvariable (A : I \u2192 Set \u03b1)\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample : f '' (\u22c2 i, A i) \u2286 \u22c2 i, f '' A i :=\nby\n  intros y h\n  -- y : \u03b2\n  -- h : y \u2208 f '' \u22c2 (i : I), A i\n  -- \u22a2 y \u2208 \u22c2 (i : I), f '' A i\n  have h1 : \u2203 x, x \u2208 \u22c2 i, A i \u2227 f x = y := (mem_image f (\u22c2 i, A i) y).mp h\n  obtain \u27e8x, hx : x \u2208 \u22c2 i, A i \u2227 f x = y\u27e9 := h1\n  have h2 : x \u2208 \u22c2 i, A i := hx.1\n  have h3 : f x = y := hx.2\n  have h4 : \u2200 i, y \u2208 f '' A i := by\n    intro i\n    have h4a : x \u2208 A i := mem_iInter.mp h2 i\n    have h4b : f x \u2208 f '' A i := mem_image_of_mem f h4a\n    show y \u2208 f '' A i\n    rwa [h3] at h4b\n  show y \u2208 \u22c2 i, f '' A i\n  exact mem_iInter.mpr h4\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample : f '' (\u22c2 i, A i) \u2286 \u22c2 i, f '' A i :=\nby\n  intros y h\n  -- y : \u03b2\n  -- h : y \u2208 f '' \u22c2 (i : I), A i\n  -- \u22a2 y \u2208 \u22c2 (i : I), f '' A i\n  apply mem_iInter_of_mem\n  -- \u22a2 \u2200 (i : I), y \u2208 f '' A i\n  intro i\n  -- i : I\n  -- \u22a2 y \u2208 f '' A i\n  cases' h with x hx\n  -- x : \u03b1\n  -- hx : x \u2208 \u22c2 (i : I), A i \u2227 f x = y\n  cases' hx with xIA fxy\n  -- xIA : x \u2208 \u22c2 (i : I), A i\n  -- fxy : f x = y\n  rw [\u2190fxy]\n  -- \u22a2 f x \u2208 f '' A i\n  apply mem_image_of_mem\n  -- \u22a2 x \u2208 A i\n  exact mem_iInter.mp xIA i\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample : f '' (\u22c2 i, A i) \u2286 \u22c2 i, f '' A i :=\nby\n  intros y h\n  -- y : \u03b2\n  -- h : y \u2208 f '' \u22c2 (i : I), A i\n  -- \u22a2 y \u2208 \u22c2 (i : I), f '' A i\n  apply mem_iInter_of_mem\n  -- \u22a2 \u2200 (i : I), y \u2208 f '' A i\n  intro i\n  -- i : I\n  -- \u22a2 y \u2208 f '' A i\n  rcases h with \u27e8x, xIA, rfl\u27e9\n  -- x : \u03b1\n  -- xIA : x \u2208 \u22c2 (i : I), A i\n  -- \u22a2 f x \u2208 f '' A i\n  exact mem_image_of_mem f (mem_iInter.mp xIA i)\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample : f '' (\u22c2 i, A i) \u2286 \u22c2 i, f '' A i :=\nby\n  intro y\n  -- y : \u03b2\n  -- \u22a2 y \u2208 f '' \u22c2 (i : I), A i \u2192 y \u2208 \u22c2 (i : I), f '' A i\n  simp\n  -- \u22a2 \u2200 (x : \u03b1), (\u2200 (i : I), x \u2208 A i) \u2192 f x = y \u2192 \u2200 (i : I), \u2203 x, x \u2208 A i \u2227 f x = y\n  intros x xIA fxy i\n  -- x : \u03b1\n  -- xIA : \u2200 (i : I), x \u2208 A i\n  -- fxy : f x = y\n  -- i : I\n  -- \u22a2 \u2203 x, x \u2208 A i \u2227 f x = y\n  use x, xIA i\n  -- \u22a2 f x = y\n  exact fxy\n\n-- 4\u00aa demostraci\u00f3n\n-- ===============\n\nexample : f '' (\u22c2 i, A i) \u2286 \u22c2 i, f '' A i :=\nimage_iInter_subset A f\n\n-- Lemas usados\n-- ============\n\n-- variable (x : \u03b1)\n-- variable (s : Set \u03b1)\n-- #check (image_iInter_subset A f : f '' \u22c2 i, A i \u2286 \u22c2 i, f '' A i)\n-- #check (mem_iInter : x \u2208 \u22c2 i, A i \u2194 \u2200 i, x \u2208 A i)\n-- #check (mem_iInter_of_mem : (\u2200 i, x \u2208 A i) \u2192 x \u2208 \u22c2 i, A i)\n-- #check (mem_image_of_mem f : x \u2208 s \u2192 f x \u2208 f '' s)\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\/Imagen_de_la_interseccion_general.lean\">Lean 4 Web<\/a>.<\/p>\n<h2>3. Demostraciones con Isabelle\/HOL<\/h2>\n<pre lang=\"isar\">\ntheory Imagen_de_la_interseccion_general\nimports Main\nbegin\n\n(* 1\u00aa demostraci\u00f3n *)\n\nlemma \"f ` (\u22c2 i \u2208 I. A i) \u2286 (\u22c2 i \u2208 I. f ` A i)\"\nproof (rule subsetI)\n  fix y\n  assume \"y \u2208 f ` (\u22c2 i \u2208 I. A i)\"\n  then show \"y \u2208 (\u22c2 i \u2208 I. f ` A i)\"\n  proof (rule imageE)\n    fix x\n    assume \"y = f x\"\n    assume xIA : \"x \u2208 (\u22c2 i \u2208 I. A i)\"\n    have \"f x \u2208 (\u22c2 i \u2208 I. f ` A i)\"\n    proof (rule INT_I)\n      fix i\n      assume \"i \u2208 I\"\n      with xIA have \"x \u2208 A i\"\n        by (rule INT_D)\n      then show \"f x \u2208 f ` A i\"\n        by (rule imageI)\n    qed\n    with \u2039y = f x\u203a show \"y \u2208 (\u22c2 i \u2208 I. f ` A i)\"\n      by (rule ssubst)\n  qed\nqed\n\n(* 2\u00aa demostraci\u00f3n *)\n\nlemma \"f ` (\u22c2 i \u2208 I. A i) \u2286 (\u22c2 i \u2208 I. f ` A i)\"\nproof\n  fix y\n  assume \"y \u2208 f ` (\u22c2 i \u2208 I. A i)\"\n  then show \"y \u2208 (\u22c2 i \u2208 I. f ` A i)\"\n  proof\n    fix x\n    assume \"y = f x\"\n    assume xIA : \"x \u2208 (\u22c2 i \u2208 I. A i)\"\n    have \"f x \u2208 (\u22c2 i \u2208 I. f ` A i)\"\n    proof\n      fix i\n      assume \"i \u2208 I\"\n      with xIA have \"x \u2208 A i\" by simp\n      then show \"f x \u2208 f ` A i\" by simp\n    qed\n    with \u2039y = f x\u203a show \"y \u2208 (\u22c2 i \u2208 I. f ` A i)\" by simp\n  qed\nqed\n\n(* 3\u00aa demostraci\u00f3n *)\n\nlemma \"f ` (\u22c2 i \u2208 I. A i) \u2286 (\u22c2 i \u2208 I. f ` A i)\"\n  by blast\n\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que &#92;[ f&#92;left[&#92;bigcap_{i \u2208 I} A_i&#92;right] \u2286 &#92;bigcap_{i \u2208 I} f[A_i] &#92;] Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Set.Basic import Mathlib.Tactic open Set variable {\u03b1 \u03b2 I : Type _} variable (f : \u03b1 \u2192 \u03b2) variable (A : I \u2192 Set \u03b1) example : f \u00bb (\u22c2 i, A i) \u2286 \u22c2 i, f \u00bb A 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":[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\/2418"}],"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=2418"}],"version-history":[{"count":12,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2418\/revisions"}],"predecessor-version":[{"id":2430,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2418\/revisions\/2430"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=2418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=2418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=2418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}