        {"id":2390,"date":"2024-04-15T18:28:04","date_gmt":"2024-04-15T16:28:04","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=2390"},"modified":"2024-04-15T19:43:28","modified_gmt":"2024-04-15T17:43:28","slug":"15-abr-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/15-abr-24\/","title":{"rendered":"Si f es inyectiva, entonces f[s] \u2229 f[t] \u2286 f[s \u2229 t]"},"content":{"rendered":"\n<p>Demostrar con Lean4 que si &#92;(f&#92;) es inyectiva, entonces<br \/>\n&#92;[ f[s] \u2229 f[t] \u2286 f[s \u2229 t] &#92;]<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Set.Function\n\nopen Set Function\n\nvariable {\u03b1 \u03b2 : Type _}\nvariable (f : \u03b1 \u2192 \u03b2)\nvariable (s t : Set \u03b1)\n\nexample\n  (h : Injective f)\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<h2>1. Demostraci\u00f3n en lenguaje natural<\/h2>\n<p>Sea &#92;(y \u2208 f[s] \u2229 f[t]&#92;). Entonces, existen &#92;(x\u2081&#92;) y &#92;(x\u2082&#92;) tales que<br \/>\n&#92;begin{align}<br \/>\n   &amp;x\u2081 \u2208 s      &#92;tag{1} &#92;&#92;<br \/>\n   &amp;f(x\u2081) = y   &#92;tag{2} &#92;&#92;<br \/>\n   &amp;x\u2082 \u2208 t      &#92;tag{3} &#92;&#92;<br \/>\n   &amp;f(x\u2082) = y   &#92;tag{4}<br \/>\n&#92;end{align}<br \/>\nDe (2) y (4) se tiene que<br \/>\n&#92;[ f(x\u2081) = f(x\u2082) &#92;]<br \/>\ny, por ser &#92;(f&#92;) inyectiva, se tiene que<br \/>\n&#92;[ x\u2081 = x\u2082 &#92;]<br \/>\ny, por (1), se tiene que<br \/>\n&#92;[ x\u2082 \u2208 t &#92;]<br \/>\ny, por (3), se tiene que<br \/>\n&#92;[ x\u2082 \u2208 s \u2229 t &#92;]<br \/>\nPor tanto,<br \/>\n&#92;[ f(x\u2082) \u2208 f[s \u2229 t] &#92;]<br \/>\ny, por (4),<br \/>\n&#92;[ y \u2208 f[s \u2229 t] &#92;]<\/p>\n<h2>2. Demostraciones con Lean4<\/h2>\n<pre lang=\"lean\">\nimport Mathlib.Data.Set.Function\n\nopen Set Function\n\nvariable {\u03b1 \u03b2 : Type _}\nvariable (f : \u03b1 \u2192 \u03b2)\nvariable (s t : Set \u03b1)\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : Injective f)\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\nby\n  intros y hy\n  -- y : \u03b2\n  -- hy : y \u2208 f '' s \u2229 f '' t\n  -- \u22a2 y \u2208 f '' (s \u2229 t)\n  rcases hy with \u27e8hy1, hy2\u27e9\n  -- hy1 : y \u2208 f '' s\n  -- hy2 : y \u2208 f '' t\n  rcases hy1 with \u27e8x1, hx1\u27e9\n  -- x1 : \u03b1\n  -- hx1 : x1 \u2208 s \u2227 f x1 = y\n  rcases hx1 with \u27e8x1s, fx1y\u27e9\n  -- x1s : x1 \u2208 s\n  -- fx1y : f x1 = y\n  rcases hy2 with \u27e8x2, hx2\u27e9\n  -- x2 : \u03b1\n  -- hx2 : x2 \u2208 t \u2227 f x2 = y\n  rcases hx2 with \u27e8x2t, fx2y\u27e9\n  -- x2t : x2 \u2208 t\n  -- fx2y : f x2 = y\n  have h1 : f x1 = f x2 := Eq.trans fx1y fx2y.symm\n  have h2 : x1 = x2 := h (congrArg f (h h1))\n  have h3 : x2 \u2208 s := by rwa [h2] at x1s\n  have h4 : x2 \u2208 s \u2229 t := by exact \u27e8h3, x2t\u27e9\n  have h5 : f x2 \u2208 f '' (s \u2229 t) := mem_image_of_mem f h4\n  show y \u2208 f '' (s \u2229 t)\n  rwa [fx2y] at h5\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : Injective f)\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\nby\n  intros y hy\n  -- y : \u03b2\n  -- hy : y \u2208 f '' s \u2229 f '' t\n  -- \u22a2 y \u2208 f '' (s \u2229 t)\n  rcases hy  with \u27e8hy1, hy2\u27e9\n  -- hy1 : y \u2208 f '' s\n  -- hy2 : y \u2208 f '' t\n  rcases hy1 with \u27e8x1, hx1\u27e9\n  -- x1 : \u03b1\n  -- hx1 : x1 \u2208 s \u2227 f x1 = y\n  rcases hx1 with \u27e8x1s, fx1y\u27e9\n  -- x1s : x1 \u2208 s\n  -- fx1y : f x1 = y\n  rcases hy2 with \u27e8x2, hx2\u27e9\n  -- x2 : \u03b1\n  -- hx2 : x2 \u2208 t \u2227 f x2 = y\n  rcases hx2 with \u27e8x2t, fx2y\u27e9\n  -- x2t : x2 \u2208 t\n  -- fx2y : f x2 = y\n  use x1\n  -- \u22a2 x1 \u2208 s \u2229 t \u2227 f x1 = y\n  constructor\n  . -- \u22a2 x1 \u2208 s \u2229 t\n    constructor\n    . -- \u22a2 x1 \u2208 s\n      exact x1s\n    . -- \u22a2 x1 \u2208 t\n      convert x2t\n      -- \u22a2 x1 = x2\n      apply h\n      -- \u22a2 f x1 = f x2\n      rw [\u2190 fx2y] at fx1y\n      -- fx1y : f x1 = f x2\n      exact fx1y\n  . -- \u22a2 f x1 = y\n    exact fx1y\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : Injective f)\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\nby\n  rintro y \u27e8\u27e8x1, x1s, fx1y\u27e9, \u27e8x2, x2t, fx2y\u27e9\u27e9\n  -- y : \u03b2\n  -- x1 : \u03b1\n  -- x1s : x1 \u2208 s\n  -- fx1y : f x1 = y\n  -- x2 : \u03b1\n  -- x2t : x2 \u2208 t\n  -- fx2y : f x2 = y\n  -- \u22a2 y \u2208 f '' (s \u2229 t)\n  use x1\n  -- \u22a2 x1 \u2208 s \u2229 t \u2227 f x1 = y\n  constructor\n  . -- \u22a2 x1 \u2208 s \u2229 t\n    constructor\n    . -- \u22a2 x1 \u2208 s\n      exact x1s\n    . -- \u22a2 x1 \u2208 t\n      convert x2t\n      -- \u22a2 x1 = x2\n      apply h\n      -- \u22a2 f x1 = f x2\n      rw [\u2190 fx2y] at fx1y\n      -- fx1y : f x1 = f x2\n      exact fx1y\n  . -- \u22a2 f x1 = y\n    exact fx1y\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_de_aplicaciones_inyectivas.lean\" rel=\"noopener noreferrer\" target=\"_blank\">Lean 4 Web<\/a>.<\/p>\n<h2>3. Demostraciones con Isabelle\/HOL<\/h2>\n<pre lang=\"isar\">\ntheory Imagen_de_la_interseccion_de_aplicaciones_inyectivas\nimports Main\nbegin\n\n(* 1\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"inj f\"\n  shows \"f ` s \u2229 f ` t \u2286 f ` (s \u2229 t)\"\nproof (rule subsetI)\n  fix y\n  assume \"y \u2208 f ` s \u2229 f ` t\"\n  then have \"y \u2208 f ` s\"\n    by (rule IntD1)\n  then show \"y \u2208 f ` (s \u2229 t)\"\n  proof (rule imageE)\n    fix x\n    assume \"y = f x\"\n    assume \"x \u2208 s\"\n    have \"x \u2208 t\"\n    proof -\n      have \"y \u2208 f ` t\"\n        using \u2039y \u2208 f ` s \u2229 f ` t\u203a by (rule IntD2)\n      then show \"x \u2208 t\"\n      proof (rule imageE)\n        fix z\n        assume \"y = f z\"\n        assume \"z \u2208 t\"\n        have \"f x = f z\"\n          using \u2039y = f x\u203a \u2039y = f z\u203a by (rule subst)\n        with \u2039inj f\u203a have \"x = z\"\n          by (simp only: inj_eq)\n        then show \"x \u2208 t\"\n          using \u2039z \u2208 t\u203a by (rule ssubst)\n      qed\n    qed\n    with \u2039x \u2208 s\u203a have \"x \u2208 s \u2229 t\"\n      by (rule IntI)\n    with \u2039y = f x\u203a show \"y \u2208 f ` (s \u2229 t)\"\n      by (rule image_eqI)\n  qed\nqed\n\n(* 2\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"inj f\"\n  shows \"f ` s \u2229 f ` t \u2286 f ` (s \u2229 t)\"\nproof\n  fix y\n  assume \"y \u2208 f ` s \u2229 f ` t\"\n  then have \"y \u2208 f ` s\" by simp\n  then show \"y \u2208 f ` (s \u2229 t)\"\n  proof\n    fix x\n    assume \"y = f x\"\n    assume \"x \u2208 s\"\n    have \"x \u2208 t\"\n    proof -\n      have \"y \u2208 f ` t\" using \u2039y \u2208 f ` s \u2229 f ` t\u203a by simp\n      then show \"x \u2208 t\"\n      proof\n        fix z\n        assume \"y = f z\"\n        assume \"z \u2208 t\"\n        have \"f x = f z\" using \u2039y = f x\u203a \u2039y = f z\u203a by simp\n        with \u2039inj f\u203a have \"x = z\" by (simp only: inj_eq)\n        then show \"x \u2208 t\" using \u2039z \u2208 t\u203a by simp\n      qed\n    qed\n    with \u2039x \u2208 s\u203a have \"x \u2208 s \u2229 t\" by simp\n    with \u2039y = f x\u203a show \"y \u2208 f ` (s \u2229 t)\" by simp\n  qed\nqed\n\n(* 3\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"inj f\"\n  shows \"f ` s \u2229 f ` t \u2286 f ` (s \u2229 t)\"\n  using assms\n  by (simp only: image_Int)\n\n(* 4\u00aa demostraci\u00f3n *)\n\nlemma\n  assumes \"inj f\"\n  shows \"f ` s \u2229 f ` t \u2286 f ` (s \u2229 t)\"\n  using assms\n  unfolding inj_def\n  by auto\n\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si &#92;(f&#92;) es inyectiva, entonces &#92;[ f[s] \u2229 f[t] \u2286 f[s \u2229 t] &#92;] Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Set.Function open Set Function variable {\u03b1 \u03b2 : Type _} variable (f : \u03b1 \u2192 \u03b2) variable (s t : Set \u03b1) example (h : Injective f) : f \u00bb s \u2229 f \u00bb t \u2286 f \u00bb (s \u2229 t) := 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\/2390"}],"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=2390"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2390\/revisions"}],"predecessor-version":[{"id":2392,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2390\/revisions\/2392"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=2390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=2390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=2390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}