        {"id":2432,"date":"2024-04-29T11:46:22","date_gmt":"2024-04-29T09:46:22","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=2432"},"modified":"2024-04-30T11:51:11","modified_gmt":"2024-04-30T09:51:11","slug":"29-abr-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/29-abr-24\/","title":{"rendered":"Imagen de la interseccion general mediante aplicaciones inyectivas"},"content":{"rendered":"\n<p>Demostrar con Lean4 que si &#92;(f&#92;) es inyectiva, entonces<br \/>\n&#92;[\u22c2\u1d62f[A\u1d62] \u2286 f\\left[\u22c2\u1d62A\u1d62\\right] &#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 Function\n\nvariable {\u03b1 \u03b2 I : Type _}\nvariable (f : \u03b1 \u2192 \u03b2)\nvariable (A : I \u2192 Set \u03b1)\n\nexample\n  (i : I)\n  (injf : Injective f)\n  : (\u22c2 i, f '' A i) \u2286 f '' (\u22c2 i, A i) :=\nby\nsorry\n<\/pre>\n<p><!--more--><\/p>\n<h2>1. Demostraci\u00f3n en lenguaje natural<\/h2>\n<p>Sea &#92;(y \u2208 \u22c2\u1d62f[A\u1d62]&#92;). Entonces,<br \/>\n&#92;begin{align}<br \/>\n   &amp; (\u2200i \u2208 I)y \u2208 f[A\u1d62]  &#92;tag{1} &#92;&#92;<br \/>\n   &amp; y \u2208 f[A\u1d62]<br \/>\n&#92;end{align}<br \/>\nPor tanto, existe un &#92;(x \u2208 A\u1d62&#92;) tal que<br \/>\n&#92;[ f(x) = y &#92;tag{2} &#92;]<\/p>\n<p>Veamos que &#92;(x \u2208 \u22c2\u1d62A\u1d62&#92;). Para ello, sea &#92;(j \u2208 I&#92;). Por (1),<br \/>\n&#92;[ y \u2208 f[A\u2c7c] &#92;]<br \/>\nLuego, existe un &#92;(z&#92;) tal que<br \/>\n&#92;begin{align}<br \/>\n   &amp;z \u2208 A\u2c7c    &#92;tag{3} &#92;&#92;<br \/>\n   &amp;f(z) = y<br \/>\n&#92;end{align}<br \/>\nPot (2),<br \/>\n&#92;[ f(x) = f(z) &#92;]<br \/>\ny, por ser &#92;(f&#92;) inyectiva,<br \/>\n&#92;[ x = z &#92;]<br \/>\ny, por (3),<br \/>\n&#92;[ x \u2208 A\u2c7c &#92;]<\/p>\n<p>Puesto que &#92;(x \u2208 \u22c2\u1d62A\u1d62&#92;) se tiene que &#92;(f(x) \u2208 f\\left[\u22c2\u1d62A\u1d62\\right]&#92;) y, por (2), &#92;(y \u2208 f\\left[\u22c2\u1d62A\u1d62\\right]&#92;).<\/p>\n<h2>2. Demostraciones con Lean4<\/h2>\n<pre lang=\"lean\">\nimport Mathlib.Data.Set.Basic\nimport Mathlib.Tactic\n\nopen Set Function\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\n  (i : I)\n  (injf : Injective f)\n  : (\u22c2 i, f '' A i) \u2286 f '' (\u22c2 i, A i) :=\nby\n  intros y hy\n  -- y : \u03b2\n  -- hy : y \u2208 \u22c2 (i : I), f '' A i\n  -- \u22a2 y \u2208 f '' \u22c2 (i : I), A i\n  have h1 : \u2200 (i : I), y \u2208 f '' A i := mem_iInter.mp hy\n  have h2 : y \u2208 f '' A i := h1 i\n  obtain \u27e8x : \u03b1, h3 : x \u2208 A i \u2227 f x = y\u27e9 := h2\n  have h4 : f x = y := h3.2\n  have h5 : \u2200 i : I, x \u2208 A i := by\n    intro j\n    have h5a : y \u2208 f '' A j := h1 j\n    obtain \u27e8z : \u03b1, h5b : z \u2208 A j \u2227 f z = y\u27e9 := h5a\n    have h5c : z \u2208 A j := h5b.1\n    have h5d : f z = y := h5b.2\n    have h5e : f z = f x := by rwa [\u2190h4] at h5d\n    have h5f : z = x := injf h5e\n    show x \u2208 A j\n    rwa [h5f] at h5c\n  have h6 : x \u2208 \u22c2 i, A i := mem_iInter.mpr h5\n  have h7 : f x \u2208 f '' (\u22c2 i, A i) := mem_image_of_mem f h6\n  show y \u2208 f '' (\u22c2 i, A i)\n  rwa [h4] at h7\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (i : I)\n  (injf : Injective f)\n  : (\u22c2 i, f '' A i) \u2286 f '' (\u22c2 i, A i) :=\nby\n  intros y hy\n  -- y : \u03b2\n  -- hy : y \u2208 \u22c2 (i : I), f '' A i\n  -- \u22a2 y \u2208 f '' \u22c2 (i : I), A i\n  rw [mem_iInter] at hy\n  -- hy : \u2200 (i : I), y \u2208 f '' A i\n  rcases hy i with \u27e8x, -, fxy\u27e9\n  -- x : \u03b1\n  -- fxy : f x = y\n  use x\n  -- \u22a2 x \u2208 \u22c2 (i : I), A i \u2227 f x = y\n  constructor\n  . -- \u22a2 x \u2208 \u22c2 (i : I), A i\n    apply mem_iInter_of_mem\n    -- \u22a2 \u2200 (i : I), x \u2208 A i\n    intro j\n    -- j : I\n    -- \u22a2 x \u2208 A j\n    rcases hy j with \u27e8z, zAj, fzy\u27e9\n    -- z : \u03b1\n    -- zAj : z \u2208 A j\n    -- fzy : f z = y\n    convert zAj\n    -- \u22a2 x = z\n    apply injf\n    -- \u22a2 f x = f z\n    rw [fxy]\n    -- \u22a2 y = f z\n    rw [\u2190fzy]\n  . -- \u22a2 f x = y\n    exact fxy\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (i : I)\n  (injf : Injective f)\n  : (\u22c2 i, f '' A i) \u2286 f '' (\u22c2 i, A i) :=\nby\n  intro y\n  -- y : \u03b2\n  -- \u22a2 y \u2208 \u22c2 (i : I), f '' A i \u2192 y \u2208 f '' \u22c2 (i : I), A i\n  simp\n  -- \u22a2 (\u2200 (i : I), \u2203 x, x \u2208 A i \u2227 f x = y) \u2192 \u2203 x, (\u2200 (i : I), x \u2208 A i) \u2227 f x = y\n  intro h\n  -- h : \u2200 (i : I), \u2203 x, x \u2208 A i \u2227 f x = y\n  -- \u22a2 \u2203 x, (\u2200 (i : I), x \u2208 A i) \u2227 f x = y\n  rcases h i with \u27e8x, -, fxy\u27e9\n  -- x : \u03b1\n  -- fxy : f x = y\n  use x\n  -- \u22a2 (\u2200 (i : I), x \u2208 A i) \u2227 f x = y\n  constructor\n  . -- \u22a2 \u2200 (i : I), x \u2208 A i\n    intro j\n    -- j : I\n    -- \u22a2 x \u2208 A j\n    rcases h j with \u27e8z, zAi, fzy\u27e9\n    -- z : \u03b1\n    -- zAi : z \u2208 A j\n    -- fzy : f z = y\n    have : f x = f z := by rw [fxy, fzy]\n    -- this : f x = f z\n    have : x = z := injf this\n    -- this : x = z\n    rw [this]\n    -- \u22a2 z \u2208 A j\n    exact zAi\n  . -- \u22a2 f x = y\n    exact fxy\n\n-- Lemas usados\n-- ============\n\n-- variable (x : \u03b1)\n-- variable (s : Set \u03b1)\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_mediante_inyectiva.lean\">Lean 4 Web<\/a>.<\/p>\n<h2>3. Demostraciones con Isabelle\/HOL<\/h2>\n<pre lang=\"isar\">\ntheory Imagen_de_la_interseccion_general_mediante_inyectiva\nimports Main\nbegin\n\n(* 1\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"i \u2208 I\"\n          \"inj f\"\n  shows \"(\u22c2 i \u2208 I. f ` A i) \u2286 f ` (\u22c2 i \u2208 I. A i)\"\nproof (rule subsetI)\n  fix y\n  assume \"y \u2208 (\u22c2 i \u2208 I. f ` A i)\"\n  then have \"y \u2208 f ` A i\"\n    using \u2039i \u2208 I\u203a by (rule INT_D)\n  then show \"y \u2208 f ` (\u22c2 i \u2208 I. A i)\"\n  proof (rule imageE)\n    fix x\n    assume \"y = f x\"\n    assume \"x \u2208 A i\"\n    have \"x \u2208 (\u22c2 i \u2208 I. A i)\"\n    proof (rule INT_I)\n      fix j\n      assume \"j \u2208 I\"\n      show \"x \u2208 A j\"\n      proof -\n        have \"y \u2208 f ` A j\"\n          using \u2039y \u2208 (\u22c2i\u2208I. f ` A i)\u203a \u2039j \u2208 I\u203a by (rule INT_D)\n        then show \"x \u2208 A j\"\n        proof (rule imageE)\n          fix z\n          assume \"y = f z\"\n          assume \"z \u2208 A j\"\n          have \"f z = f x\"\n            using \u2039y = f z\u203a \u2039y = f x\u203a by (rule subst)\n          with \u2039inj f\u203a have \"z = x\"\n            by (rule injD)\n          then show \"x \u2208 A j\"\n            using \u2039z \u2208 A j\u203a by (rule subst)\n        qed\n      qed\n    qed\n    then have \"f x \u2208 f ` (\u22c2 i \u2208 I. A i)\"\n      by (rule imageI)\n    with \u2039y = f x\u203a show \"y \u2208 f ` (\u22c2 i \u2208 I. A i)\"\n      by (rule ssubst)\n  qed\nqed\n\n(* 2\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"i \u2208 I\"\n          \"inj f\"\n  shows \"(\u22c2 i \u2208 I. f ` A i) \u2286 f ` (\u22c2 i \u2208 I. A i)\"\nproof\n  fix y\n  assume \"y \u2208 (\u22c2 i \u2208 I. f ` A i)\"\n  then have \"y \u2208 f ` A i\" using \u2039i \u2208 I\u203a by simp\n  then show \"y \u2208 f ` (\u22c2 i \u2208 I. A i)\"\n  proof\n    fix x\n    assume \"y = f x\"\n    assume \"x \u2208 A i\"\n    have \"x \u2208 (\u22c2 i \u2208 I. A i)\"\n    proof\n      fix j\n      assume \"j \u2208 I\"\n      show \"x \u2208 A j\"\n      proof -\n        have \"y \u2208 f ` A j\"\n          using \u2039y \u2208 (\u22c2i\u2208I. f ` A i)\u203a \u2039j \u2208 I\u203a by simp\n        then show \"x \u2208 A j\"\n        proof\n          fix z\n          assume \"y = f z\"\n          assume \"z \u2208 A j\"\n          have \"f z = f x\" using \u2039y = f z\u203a \u2039y = f x\u203a by simp\n          with \u2039inj f\u203a have \"z = x\" by (rule injD)\n          then show \"x \u2208 A j\" using \u2039z \u2208 A j\u203a by simp\n        qed\n      qed\n    qed\n    then have \"f x \u2208 f ` (\u22c2 i \u2208 I. A i)\" by simp\n    with \u2039y = f x\u203a show \"y \u2208 f ` (\u22c2 i \u2208 I. A i)\" by simp\n  qed\nqed\n\n(* 3\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"i \u2208 I\"\n          \"inj f\"\n  shows \"(\u22c2 i \u2208 I. f ` A i) \u2286 f ` (\u22c2 i \u2208 I. A i)\"\n  using assms\n  by (simp add: image_INT)\n\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si &#92;(f&#92;) es inyectiva, entonces &#92;[\u22c2\u1d62f[A\u1d62] \u2286 f\\left[\u22c2\u1d62A\u1d62\\right] &#92;] Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Set.Basic import Mathlib.Tactic open Set Function variable {\u03b1 \u03b2 I : Type _} variable (f : \u03b1 \u2192 \u03b2) variable (A : I \u2192 Set \u03b1) example (i : I) (injf : Injective f) : (\u22c2 i, f \u00bb A i) \u2286 f \u00bb (\u22c2 i, 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\/2432"}],"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=2432"}],"version-history":[{"count":4,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2432\/revisions"}],"predecessor-version":[{"id":2436,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2432\/revisions\/2436"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=2432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=2432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=2432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}