        {"id":503,"date":"2021-06-27T06:00:28","date_gmt":"2021-06-27T04:00:28","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=503"},"modified":"2021-06-18T11:48:16","modified_gmt":"2021-06-18T09:48:16","slug":"imagen-inversa-de-la-interseccion-general","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/imagen-inversa-de-la-interseccion-general\/","title":{"rendered":"Imagen inversa de la intersecci\u00f3n general"},"content":{"rendered":"<p>Demostrar que<\/p>\n<pre lang=\"text\">\n   f\u207b\u00b9[\u22c2 i, B(i)] = \u22c2 i, f\u207b\u00b9[B(i)]\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.set.basic\nimport tactic\n\nopen set\n\nvariables {\u03b1 : Type*} {\u03b2 : Type*} {I : Type*}\nvariable  f : \u03b1 \u2192 \u03b2\nvariables B : I \u2192 set \u03b2\n\nexample : f \u207b\u00b9' (\u22c2 i, B i) = \u22c2 i, f \u207b\u00b9' (B i) :=\nsorry\n<\/pre>\n<p>[expand title=\u00bbSoluciones con Lean\u00bb]<\/p>\n<pre lang=\"lean\">\r\nimport data.set.basic\r\nimport tactic\r\n\r\nopen set\r\n\r\nvariables {\u03b1 : Type*} {\u03b2 : Type*} {I : Type*}\r\nvariable  f : \u03b1 \u2192 \u03b2\r\nvariables B : I \u2192 set \u03b2\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample : f \u207b\u00b9' (\u22c2 i, B i) = \u22c2 i, f \u207b\u00b9' (B i) :=\r\nbegin\r\n  ext x,\r\n  split,\r\n  { intro hx,\r\n    apply mem_Inter_of_mem,\r\n    intro i,\r\n    rw mem_preimage,\r\n    rw mem_preimage at hx,\r\n    rw mem_Inter at hx,\r\n    exact hx i, },\r\n  { intro hx,\r\n    rw mem_preimage,\r\n    rw mem_Inter,\r\n    intro i,\r\n    rw \u2190 mem_preimage,\r\n    rw mem_Inter at hx,\r\n    exact hx i, },\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample : f \u207b\u00b9' (\u22c2 i, B i) = \u22c2 i, f \u207b\u00b9' (B i) :=\r\nbegin\r\n  ext x,\r\n  calc  (x \u2208 f \u207b\u00b9' \u22c2 (i : I), B i)\r\n      \u2194 f x \u2208 \u22c2 (i : I), B i       : mem_preimage\r\n  ... \u2194 (\u2200 i : I, f x \u2208 B i)       : mem_Inter\r\n  ... \u2194 (\u2200 i : I, x \u2208 f \u207b\u00b9' B i)   : iff_of_eq rfl\r\n  ... \u2194 x \u2208 \u22c2 (i : I), f \u207b\u00b9' B i   : mem_Inter.symm,\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample : f \u207b\u00b9' (\u22c2 i, B i) = \u22c2 i, f \u207b\u00b9' (B i) :=\r\nbegin\r\n  ext x,\r\n  simp,\r\nend\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample : f \u207b\u00b9' (\u22c2 i, B i) = \u22c2 i, f \u207b\u00b9' (B i) :=\r\nby { ext, simp }\r\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/www.cs.us.es\/~jalonso\/lean-web-editor\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus\/main\/src\/Imagen_inversa_de_la_interseccion_general.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>,<\/p>\n<p>En los comentarios se pueden escribir otras soluciones, escribiendo el c\u00f3digo entre una l\u00ednea con &#60;pre lang=&quot;isar&quot;&#62; y otra con &#60;\/pre&#62;<br \/>\n[\/expand]<\/p>\n<p>[expand title=\u00bbSoluciones con Isabelle\/HOL\u00bb]<\/p>\n<pre lang=\"isar\">\r\ntheory Imagen_inversa_de_la_interseccion_general\r\nimports Main\r\nbegin\r\n\r\n(* 1\u00aa demostraci\u00f3n *)\r\n\r\nlemma \"f -` (\u22c2 i \u2208 I. B i) = (\u22c2 i \u2208 I. f -` B i)\"\r\nproof (rule equalityI)\r\n  show \"f -` (\u22c2 i \u2208 I. B i) \u2286 (\u22c2 i \u2208 I. f -` B i)\"\r\n  proof (rule subsetI)\r\n    fix x\r\n    assume \"x \u2208 f -` (\u22c2 i \u2208 I. B i)\"\r\n    show \"x \u2208 (\u22c2 i \u2208 I. f -` B i)\"\r\n    proof (rule INT_I)\r\n      fix i\r\n      assume \"i \u2208 I\"\r\n      have \"f x \u2208 (\u22c2 i \u2208 I. B i)\"\r\n        using \u2039x \u2208 f -` (\u22c2 i \u2208 I. B i)\u203a by (rule vimageD)\r\n      then have \"f x \u2208 B i\"\r\n        using \u2039i \u2208 I\u203a by (rule INT_D)\r\n      then show \"x \u2208 f -` B i\"\r\n        by (rule vimageI2)\r\n    qed\r\n  qed\r\nnext\r\n  show \"(\u22c2 i \u2208 I. f -` B i) \u2286 f -` (\u22c2 i \u2208 I. B i)\"\r\n  proof (rule subsetI)\r\n    fix x\r\n    assume \"x \u2208 (\u22c2 i \u2208 I. f -` B i)\"\r\n    have \"f x \u2208 (\u22c2 i \u2208 I. B i)\"\r\n    proof (rule INT_I)\r\n      fix i\r\n      assume \"i \u2208 I\"\r\n      with \u2039x \u2208 (\u22c2 i \u2208 I. f -` B i)\u203a have \"x \u2208 f -` B i\"\r\n        by (rule INT_D)\r\n      then show \"f x \u2208 B i\"\r\n        by (rule vimageD)\r\n    qed\r\n    then show \"x \u2208 f -` (\u22c2 i \u2208 I. B i)\"\r\n      by (rule vimageI2)\r\n  qed\r\nqed\r\n\r\n(* 2\u00aa demostraci\u00f3n *)\r\n\r\nlemma \"f -` (\u22c2 i \u2208 I. B i) = (\u22c2 i \u2208 I. f -` B i)\"\r\nproof\r\n  show \"f -` (\u22c2 i \u2208 I. B i) \u2286 (\u22c2 i \u2208 I. f -` B i)\"\r\n  proof (rule subsetI)\r\n    fix x\r\n    assume hx : \"x \u2208 f -` (\u22c2 i \u2208 I. B i)\"\r\n    show \"x \u2208 (\u22c2 i \u2208 I. f -` B i)\"\r\n    proof\r\n      fix i\r\n      assume \"i \u2208 I\"\r\n      have \"f x \u2208 (\u22c2 i \u2208 I. B i)\" using hx by simp\r\n      then have \"f x \u2208 B i\" using \u2039i \u2208 I\u203a by simp\r\n      then show \"x \u2208 f -` B i\" by simp\r\n    qed\r\n  qed\r\nnext\r\n  show \"(\u22c2 i \u2208 I. f -` B i) \u2286 f -` (\u22c2 i \u2208 I. B i)\"\r\n  proof\r\n    fix x\r\n    assume \"x \u2208 (\u22c2 i \u2208 I. f -` B i)\"\r\n    have \"f x \u2208 (\u22c2 i \u2208 I. B i)\"\r\n    proof\r\n      fix i\r\n      assume \"i \u2208 I\"\r\n      with \u2039x \u2208 (\u22c2 i \u2208 I. f -` B i)\u203a have \"x \u2208 f -` B i\" by simp\r\n      then show \"f x \u2208 B i\" by simp\r\n    qed\r\n    then show \"x \u2208 f -` (\u22c2 i \u2208 I. B i)\" by simp\r\n  qed\r\nqed\r\n\r\n(* 3 demostraci\u00f3n *)\r\n\r\nlemma \"f -` (\u22c2 i \u2208 I. B i) = (\u22c2 i \u2208 I. f -` B i)\"\r\n  by (simp only: vimage_INT)\r\n\r\n(* 4\u00aa demostraci\u00f3n *)\r\n\r\nlemma \"f -` (\u22c2 i \u2208 I. B i) = (\u22c2 i \u2208 I. f -` B i)\"\r\n  by auto\r\n\r\nend\r\n<\/pre>\n<p>En los comentarios se pueden escribir otras soluciones, escribiendo el c\u00f3digo entre una l\u00ednea con &#60;pre lang=&quot;isar&quot;&#62; y otra con &#60;\/pre&#62;<br \/>\n[\/expand]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar que f\u207b\u00b9[\u22c2 i, B(i)] = \u22c2 i, f\u207b\u00b9[B(i)] Para ello, completar la siguiente teor\u00eda de Lean: import data.set.basic import tactic open set variables {\u03b1 : Type*} {\u03b2 : Type*} {I : Type*} variable f : \u03b1 \u2192 \u03b2 variables B : I \u2192 set \u03b2 example : f \u207b\u00b9&#8217; (\u22c2 i, B i) = \u22c2 i, f \u207b\u00b9&#8217; (B i) := sorry [expand title=\u00bbSoluciones con Lean\u00bb] import data.set.basic import tactic open set variables {\u03b1 : Type*} {\u03b2 : Type*} {I : Type*} variable f : \u03b1 \u2192 \u03b2 variables B : I \u2192 set \u03b2 &#8212; 1\u00aa demostraci\u00f3n &#8212; =============== example : f \u207b\u00b9&#8217; (\u22c2 i, B i) = \u22c2 i, f \u207b\u00b9&#8217; (B i) := begin ext x, split, { intro hx, apply&#8230;<\/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":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_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\/503"}],"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=503"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/503\/revisions"}],"predecessor-version":[{"id":504,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/503\/revisions\/504"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}