        {"id":394,"date":"2021-06-08T06:00:26","date_gmt":"2021-06-08T04:00:26","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=394"},"modified":"2021-06-12T13:41:33","modified_gmt":"2021-06-12T11:41:33","slug":"subconjunto-de-la-imagen-inversa","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/subconjunto-de-la-imagen-inversa\/","title":{"rendered":"Subconjunto de la imagen inversa"},"content":{"rendered":"<p>Demostrar que<\/p>\n<pre lang=\"text\">\n   f[s] \u2286 u \u2194 s \u2286 f\u207b\u00b9[u]\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.set.basic\n\nopen set\n\nvariables {\u03b1 : Type*} {\u03b2 : Type*}\nvariable  f : \u03b1 \u2192 \u03b2\nvariable  s : set \u03b1\nvariable  u : set \u03b2\n\nexample : f '' s \u2286 u \u2194 s \u2286 f \u207b\u00b9' u :=\nsorry\n<\/pre>\n<p>[expand title=\u00bbSoluciones con Lean\u00bb]<\/p>\n<pre lang=\"lean\">\r\nimport data.set.basic\r\n\r\nopen set\r\n\r\nvariables {\u03b1 : Type*} {\u03b2 : Type*}\r\nvariable  f : \u03b1 \u2192 \u03b2\r\nvariable  s : set \u03b1\r\nvariable  u : set \u03b2\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample : f '' s \u2286 u \u2194 s \u2286 f \u207b\u00b9' u :=\r\nbegin\r\n  split,\r\n  { intros h x xs,\r\n    apply mem_preimage.mpr,\r\n    apply h,\r\n    apply mem_image_of_mem,\r\n    exact xs, },\r\n  { intros h y hy,\r\n    rcases hy with \u27e8x, xs, fxy\u27e9,\r\n    rw \u2190 fxy,\r\n    exact h xs, },\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample : f '' s \u2286 u \u2194 s \u2286 f \u207b\u00b9' u :=\r\nbegin\r\n  split,\r\n  { intros h x xs,\r\n    apply h,\r\n    apply mem_image_of_mem,\r\n    exact xs, },\r\n  { rintros h y \u27e8x, xs, rfl\u27e9,\r\n    exact h xs, },\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample : f '' s \u2286 u \u2194 s \u2286 f \u207b\u00b9' u :=\r\nimage_subset_iff\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample : f '' s \u2286 u \u2194 s \u2286 f \u207b\u00b9' u :=\r\nby simp\r\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/bit.ly\/3wZXj5l\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>,<br \/>\n[\/expand]<\/p>\n<p>[expand title=\u00bbSoluciones con Isabelle\/HOL\u00bb]<\/p>\n<pre lang=\"isar\">\r\ntheory Subconjunto_de_la_imagen_inversa\r\nimports Main\r\nbegin\r\n\r\nsection \u20391\u00aa demostraci\u00f3n\u203a\r\n\r\nlemma \"f ` s \u2286 u \u27f7 s \u2286 f -` u\"\r\nproof (rule iffI)\r\n  assume \"f ` s \u2286 u\"\r\n  show \"s \u2286 f -` u\"\r\n  proof (rule subsetI)\r\n    fix x\r\n    assume \"x \u2208 s\"\r\n    then have \"f x \u2208 f ` s\"\r\n      by (simp only: imageI)\r\n    then have \"f x \u2208 u\"\r\n      using \u2039f ` s \u2286 u\u203a by (rule set_rev_mp)\r\n    then show \"x \u2208 f -` u\"\r\n      by (simp only: vimageI)\r\n  qed\r\nnext\r\n  assume \"s \u2286 f -` u\"\r\n  show \"f ` s \u2286 u\"\r\n  proof (rule subsetI)\r\n    fix y\r\n    assume \"y \u2208 f ` s\"\r\n    then show \"y \u2208 u\"\r\n    proof\r\n      fix x\r\n      assume \"y = f x\"\r\n      assume \"x \u2208 s\"\r\n      then have \"x \u2208 f -` u\"\r\n        using \u2039s \u2286 f -` u\u203a by (rule set_rev_mp)\r\n      then have \"f x \u2208 u\"\r\n        by (rule vimageD)\r\n      with \u2039y = f x\u203a show \"y \u2208 u\"\r\n        by (rule ssubst)\r\n    qed\r\n  qed\r\nqed\r\n\r\nsection \u20392\u00aa demostraci\u00f3n\u203a\r\n\r\nlemma \"f ` s \u2286 u \u27f7 s \u2286 f -` u\"\r\nproof\r\n  assume \"f ` s \u2286 u\"\r\n  show \"s \u2286 f -` u\"\r\n  proof\r\n    fix x\r\n    assume \"x \u2208 s\"\r\n    then have \"f x \u2208 f ` s\"\r\n      by simp\r\n    then have \"f x \u2208 u\"\r\n      using \u2039f ` s \u2286 u\u203a by (simp add: set_rev_mp)\r\n    then show \"x \u2208 f -` u\"\r\n      by simp\r\n  qed\r\nnext\r\n  assume \"s \u2286 f -` u\"\r\n  show \"f ` s \u2286 u\"\r\n  proof\r\n    fix y\r\n    assume \"y \u2208 f ` s\"\r\n    then show \"y \u2208 u\"\r\n    proof\r\n      fix x\r\n      assume \"y = f x\"\r\n      assume \"x \u2208 s\"\r\n      then have \"x \u2208 f -` u\"\r\n        using \u2039s \u2286 f -` u\u203a by (simp only: set_rev_mp)\r\n      then have \"f x \u2208 u\"\r\n        by simp\r\n      with \u2039y = f x\u203a show \"y \u2208 u\"\r\n        by simp\r\n    qed\r\n  qed\r\nqed\r\n\r\nsection \u20393\u00aa demostraci\u00f3n\u203a\r\n\r\nlemma \"f ` s \u2286 u \u27f7 s \u2286 f -` u\"\r\n  by (simp only: image_subset_iff_subset_vimage)\r\n\r\nsection \u20394\u00aa demostraci\u00f3n\u203a\r\n\r\nlemma \"f ` s \u2286 u \u27f7 s \u2286 f -` u\"\r\n  by auto\r\n\r\nend\r\n<\/pre>\n<p>[\/expand]<\/p>\n<p>[expand title=\u00bbNuevas soluciones\u00bb]<\/p>\n<ul>\n<li>En los comentarios se pueden escribir nuevas soluciones.\n<li>El c\u00f3digo se debe escribir entre una l\u00ednea con &#60;pre lang=&quot;isar&quot;&#62; y otra con &#60;\/pre&#62;\n<\/ul>\n<p>[\/expand]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar que f[s] \u2286 u \u2194 s \u2286 f\u207b\u00b9[u] Para ello, completar la siguiente teor\u00eda de Lean: import data.set.basic open set variables {\u03b1 : Type*} {\u03b2 : Type*} variable f : \u03b1 \u2192 \u03b2 variable s : set \u03b1 variable u : set \u03b2 example : f \u00bb s \u2286 u \u2194 s \u2286 f \u207b\u00b9&#8217; u := sorry [expand title=\u00bbSoluciones con Lean\u00bb] import data.set.basic open set variables {\u03b1 : Type*} {\u03b2 : Type*} variable f : \u03b1 \u2192 \u03b2 variable s : set \u03b1 variable u : set \u03b2 &#8212; 1\u00aa demostraci\u00f3n &#8212; =============== example : f \u00bb s \u2286 u \u2194 s \u2286 f \u207b\u00b9&#8217; u := begin split, { intros h x xs, apply mem_preimage.mpr, apply h, apply mem_image_of_mem, exact xs, },&#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\/394"}],"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=394"}],"version-history":[{"count":17,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/394\/revisions"}],"predecessor-version":[{"id":472,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/394\/revisions\/472"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}