        {"id":2437,"date":"2024-04-30T19:41:49","date_gmt":"2024-04-30T17:41:49","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=2437"},"modified":"2024-04-30T19:42:39","modified_gmt":"2024-04-30T17:42:39","slug":"30-abr-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/30-abr-24\/","title":{"rendered":"Imagen inversa de la uni\u00f3n general"},"content":{"rendered":"\n<p>Demostrar con Lean4 que<br \/>\n&#92;[ f\u207b\u00b9&#92;left[\u22c3\u1d62 B\u1d62&#92;right] = \u22c3\u1d62 f\u207b\u00b9[B\u1d62] &#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 (B : I \u2192 Set \u03b2)\n\nexample : f \u207b\u00b9' (\u22c3 i, B i) = \u22c3 i, f \u207b\u00b9' (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 todo &#92;(x&#92;),<br \/>\n&#92;[ x \u2208 f\u207b\u00b9&#92;left[\u22c3\u1d62 B\u1d62&#92;right] \u2194 x \u2208 \u22c3\u1d62 f\u207b\u00b9[B\u1d62] &#92;]<br \/>\ny lo haremos demostrando las dos implicaciones.<\/p>\n<p>(\u27f9) Supongamos que &#92;(x \u2208 f\u207b\u00b9&#92;left[\u22c3\u1d62 B\u1d62&#92;right]&#92;). Entonces, por la definici\u00f3n de la imagen inversa,<br \/>\n&#92;[ f(x) \u2208 \u22c3\u1d62 B\u1d62 &#92;]<br \/>\ny, por la definici\u00f3n de la uni\u00f3n, existe un &#92;(i&#92;) tal que<br \/>\n&#92;[ f(x) \u2208 B\u1d62 &#92;]<br \/>\ny, por la definici\u00f3n de la imagen inversa,<br \/>\n&#92;[ x \u2208 f\u207b\u00b9[B\u1d62] &#92;]<br \/>\ny, por la definici\u00f3n de la uni\u00f3n,<br \/>\n&#92;[ x \u2208 \u22c3\u1d62 f\u207b\u00b9[B\u1d62] &#92;]<\/p>\n<p>(\u27f8) Supongamos que &#92;(x \u2208 \u22c3\u1d62 f\u207b\u00b9[B\u1d62]&#92;). Entonces, por la definici\u00f3n de la uni\u00f3n, existe un &#92;(i&#92;) tal que<br \/>\n&#92;[ x \u2208 f\u207b\u00b9[B\u1d62] &#92;]<br \/>\ny, por la definici\u00f3n de la imagen inversa,<br \/>\n&#92;[ f(x) \u2208 B\u1d62 &#92;]<br \/>\ny, por la definici\u00f3n de la uni\u00f3n,<br \/>\n&#92;[ f(x) \u2208 \u22c3\u1d62 B\u1d62 &#92;]<br \/>\ny, por la definici\u00f3n de la imagen inversa,<br \/>\n&#92;[ x \u2208 f\u207b\u00b9&#92;left[\u22c3\u1d62 B\u1d62&#92;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\n\nvariable {\u03b1 \u03b2 I : Type _}\nvariable (f : \u03b1 \u2192 \u03b2)\nvariable (B : I \u2192 Set \u03b2)\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample : f \u207b\u00b9' (\u22c3 i, B i) = \u22c3 i, f \u207b\u00b9' (B i) :=\nby\n  ext x\n  -- x : \u03b1\n  -- \u22a2 x \u2208 f \u207b\u00b9' \u22c3 (i : I), B i \u2194 x \u2208 \u22c3 (i : I), f \u207b\u00b9' B i\n  constructor\n  . -- \u22a2 x \u2208 f \u207b\u00b9' \u22c3 (i : I), B i \u2192 x \u2208 \u22c3 (i : I), f \u207b\u00b9' B i\n    intro hx\n    -- hx : x \u2208 f \u207b\u00b9' \u22c3 (i : I), B i\n    -- \u22a2 x \u2208 \u22c3 (i : I), f \u207b\u00b9' B i\n    rw [mem_preimage] at hx\n    -- hx : f x \u2208 \u22c3 (i : I), B i\n    rw [mem_iUnion] at hx\n    -- hx : \u2203 i, f x \u2208 B i\n    cases' hx with i fxBi\n    -- i : I\n    -- fxBi : f x \u2208 B i\n    rw [mem_iUnion]\n    -- \u22a2 \u2203 i, x \u2208 f \u207b\u00b9' B i\n    use i\n    -- \u22a2 x \u2208 f \u207b\u00b9' B i\n    apply mem_preimage.mpr\n    -- \u22a2 f x \u2208 B i\n    exact fxBi\n  . -- \u22a2 x \u2208 \u22c3 (i : I), f \u207b\u00b9' B i \u2192 x \u2208 f \u207b\u00b9' \u22c3 (i : I), B i\n    intro hx\n    -- hx : x \u2208 \u22c3 (i : I), f \u207b\u00b9' B i\n    -- \u22a2 x \u2208 f \u207b\u00b9' \u22c3 (i : I), B i\n    rw [mem_preimage]\n    -- \u22a2 f x \u2208 \u22c3 (i : I), B i\n    rw [mem_iUnion]\n    -- \u22a2 \u2203 i, f x \u2208 B i\n    rw [mem_iUnion] at hx\n    -- hx : \u2203 i, x \u2208 f \u207b\u00b9' B i\n    cases' hx with i xBi\n    -- i : I\n    -- xBi : x \u2208 f \u207b\u00b9' B i\n    use i\n    -- \u22a2 f x \u2208 B i\n    rw [mem_preimage] at xBi\n    -- xBi : f x \u2208 B i\n    exact xBi\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample : f \u207b\u00b9' (\u22c3 i, B i) = \u22c3 i, f \u207b\u00b9' (B i) :=\npreimage_iUnion\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample : f \u207b\u00b9' (\u22c3 i, B i) = \u22c3 i, f \u207b\u00b9' (B i) :=\nby  simp\n\n-- Lemas usados\n-- ============\n\n-- variable (x : \u03b1)\n-- variable (s : Set \u03b2)\n-- variable (A : I \u2192 Set \u03b1)\n-- #check (mem_iUnion : x \u2208 \u22c3 i, A i \u2194 \u2203 i, x \u2208 A i)\n-- #check (mem_preimage : x \u2208 f \u207b\u00b9' s \u2194 f x \u2208 s)\n-- #check (preimage_iUnion : f \u207b\u00b9' (\u22c3 i, B i) = \u22c3 i, f \u207b\u00b9' (B i))\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_inversa_de_la_union_general.lean\">Lean 4 Web<\/a>.<\/p>\n<h2>3. Demostraciones con Isabelle\/HOL<\/h2>\n<pre lang=\"isar\">\ntheory Imagen_inversa_de_la_union_general\nimports Main\nbegin\n\n(* 1\u00aa demostraci\u00f3n *)\n\nlemma \"f -` (\u22c3 i \u2208 I. B i) = (\u22c3 i \u2208 I. f -` B i)\"\nproof (rule equalityI)\n  show \"f -` (\u22c3 i \u2208 I. B i) \u2286 (\u22c3 i \u2208 I. f -` B i)\"\n  proof (rule subsetI)\n    fix x\n    assume \"x \u2208 f -` (\u22c3 i \u2208 I. B i)\"\n    then have \"f x \u2208 (\u22c3 i \u2208 I. B i)\"\n      by (rule vimageD)\n    then show \"x \u2208 (\u22c3 i \u2208 I. f -` B i)\"\n    proof (rule UN_E)\n      fix i\n      assume \"i \u2208 I\"\n      assume \"f x \u2208 B i\"\n      then have \"x \u2208 f -` B i\"\n        by (rule vimageI2)\n      with \u2039i \u2208 I\u203a show \"x \u2208 (\u22c3 i \u2208 I. f -` B i)\"\n        by (rule UN_I)\n    qed\n  qed\nnext\n  show \"(\u22c3 i \u2208 I. f -` B i) \u2286 f -` (\u22c3 i \u2208 I. B i)\"\n  proof (rule subsetI)\n    fix x\n    assume \"x \u2208 (\u22c3 i \u2208 I. f -` B i)\"\n    then show \"x \u2208 f -` (\u22c3 i \u2208 I. B i)\"\n    proof (rule UN_E)\n      fix i\n      assume \"i \u2208 I\"\n      assume \"x \u2208 f -` B i\"\n      then have \"f x \u2208 B i\"\n        by (rule vimageD)\n      with \u2039i \u2208 I\u203a have \"f x \u2208 (\u22c3 i \u2208 I. B i)\"\n        by (rule UN_I)\n      then show \"x \u2208 f -` (\u22c3 i \u2208 I. B i)\"\n        by (rule vimageI2)\n    qed\n  qed\nqed\n\n(* 2\u00aa demostraci\u00f3n *)\n\nlemma \"f -` (\u22c3 i \u2208 I. B i) = (\u22c3 i \u2208 I. f -` B i)\"\nproof\n  show \"f -` (\u22c3 i \u2208 I. B i) \u2286 (\u22c3 i \u2208 I. f -` B i)\"\n  proof\n    fix x\n    assume \"x \u2208 f -` (\u22c3 i \u2208 I. B i)\"\n    then have \"f x \u2208 (\u22c3 i \u2208 I. B i)\" by simp\n    then show \"x \u2208 (\u22c3 i \u2208 I. f -` B i)\"\n    proof\n      fix i\n      assume \"i \u2208 I\"\n      assume \"f x \u2208 B i\"\n      then have \"x \u2208 f -` B i\" by simp\n      with \u2039i \u2208 I\u203a show \"x \u2208 (\u22c3 i \u2208 I. f -` B i)\" by (rule UN_I)\n    qed\n  qed\nnext\n  show \"(\u22c3 i \u2208 I. f -` B i) \u2286 f -` (\u22c3 i \u2208 I. B i)\"\n  proof\n    fix x\n    assume \"x \u2208 (\u22c3 i \u2208 I. f -` B i)\"\n    then show \"x \u2208 f -` (\u22c3 i \u2208 I. B i)\"\n    proof\n      fix i\n      assume \"i \u2208 I\"\n      assume \"x \u2208 f -` B i\"\n      then have \"f x \u2208 B i\" by simp\n      with \u2039i \u2208 I\u203a have \"f x \u2208 (\u22c3 i \u2208 I. B i)\" by (rule UN_I)\n      then show \"x \u2208 f -` (\u22c3 i \u2208 I. B i)\" by simp\n    qed\n  qed\nqed\n\n(* 3\u00aa demostraci\u00f3n *)\n\nlemma \"f -` (\u22c3 i \u2208 I. B i) = (\u22c3 i \u2208 I. f -` B i)\"\n  by (simp only: vimage_UN)\n\n(* 4\u00aa demostraci\u00f3n *)\n\nlemma \"f -` (\u22c3 i \u2208 I. B i) = (\u22c3 i \u2208 I. f -` B i)\"\n  by auto\n\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que &#92;[ f\u207b\u00b9&#92;left[\u22c3\u1d62 B\u1d62&#92;right] = \u22c3\u1d62 f\u207b\u00b9[B\u1d62] &#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 (B : I \u2192 Set \u03b2) example : f \u207b\u00b9&#8217; (\u22c3 i, B i) = \u22c3 i, f \u207b\u00b9&#8217; (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":[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\/2437"}],"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=2437"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2437\/revisions"}],"predecessor-version":[{"id":2439,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2437\/revisions\/2439"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=2437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=2437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=2437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}