        {"id":430,"date":"2021-06-16T06:00:55","date_gmt":"2021-06-16T04:00:55","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=430"},"modified":"2021-06-12T13:55:28","modified_gmt":"2021-06-12T11:55:28","slug":"imagen-de-la-interseccion-mediante-aplicaciones-inyectivas","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/imagen-de-la-interseccion-mediante-aplicaciones-inyectivas\/","title":{"rendered":"Imagen de la intersecci\u00f3n mediante aplicaciones inyectivas"},"content":{"rendered":"<p>Demostrar que si f es inyectiva, entonces<\/p>\n<pre lang=\"text\">\n   f[s] \u2229 f[t] \u2286 f[s \u2229 t]\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 function\n\nvariables {\u03b1 : Type*} {\u03b2 : Type*}\nvariable  f : \u03b1 \u2192 \u03b2\nvariables s t : set \u03b1\n\nexample\n  (h : injective f)\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\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 function\r\n\r\nvariables {\u03b1 : Type*} {\u03b2 : Type*}\r\nvariable  f : \u03b1 \u2192 \u03b2\r\nvariables s t : set \u03b1\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h : injective f)\r\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\r\nbegin\r\n  intros y hy,\r\n  cases hy  with hy1 hy2,\r\n  cases hy1 with x1 hx1,\r\n  cases hx1 with x1s fx1y,\r\n  cases hy2 with x2 hx2,\r\n  cases hx2 with x2t fx2y,\r\n  use x1,\r\n  split,\r\n  { split,\r\n    { exact x1s, },\r\n    { convert x2t,\r\n      apply h,\r\n      rw \u2190 fx2y at fx1y,\r\n      exact fx1y, }},\r\n  { exact fx1y, },\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h : injective f)\r\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\r\nbegin\r\n  rintros y \u27e8\u27e8x1, x1s, fx1y\u27e9, \u27e8x2, x2t, fx2y\u27e9\u27e9,\r\n  use x1,\r\n  split,\r\n  { split,\r\n    { exact x1s, },\r\n    { convert x2t,\r\n      apply h,\r\n      rw \u2190 fx2y at fx1y,\r\n      exact fx1y, }},\r\n  { exact fx1y, },\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h : injective f)\r\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\r\nbegin\r\n  rintros y \u27e8\u27e8x1, x1s, fx1y\u27e9, \u27e8x2, x2t, fx2y\u27e9\u27e9,\r\n  unfold injective at h,\r\n  finish,\r\nend\r\n\r\n-- 4\u00aa demostraci\u00f3n\r\n-- ===============\r\n\r\nexample\r\n  (h : injective f)\r\n  : f '' s \u2229 f '' t \u2286 f '' (s \u2229 t) :=\r\nby intro ; unfold injective at *  ; finish\r\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/bit.ly\/3x9eUYK\" 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 Imagen_de_la_interseccion_de_aplicaciones_inyectivas\r\nimports Main\r\nbegin\r\n\r\n(* 1\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"inj f\"\r\n  shows \"f ` s \u2229 f ` t \u2286 f ` (s \u2229 t)\"\r\nproof (rule subsetI)\r\n  fix y\r\n  assume \"y \u2208 f ` s \u2229 f ` t\"\r\n  then have \"y \u2208 f ` s\"\r\n    by (rule IntD1)\r\n  then show \"y \u2208 f ` (s \u2229 t)\"\r\n  proof (rule imageE)\r\n    fix x\r\n    assume \"y = f x\"\r\n    assume \"x \u2208 s\"\r\n    have \"x \u2208 t\"\r\n    proof -\r\n      have \"y \u2208 f ` t\"\r\n        using \u2039y \u2208 f ` s \u2229 f ` t\u203a by (rule IntD2)\r\n      then show \"x \u2208 t\"\r\n      proof (rule imageE)\r\n        fix z\r\n        assume \"y = f z\"\r\n        assume \"z \u2208 t\"\r\n        have \"f x = f z\"\r\n          using \u2039y = f x\u203a \u2039y = f z\u203a by (rule subst)\r\n        with \u2039inj f\u203a have \"x = z\"\r\n          by (simp only: inj_eq)\r\n        then show \"x \u2208 t\"\r\n          using \u2039z \u2208 t\u203a by (rule ssubst)\r\n      qed\r\n    qed\r\n    with \u2039x \u2208 s\u203a have \"x \u2208 s \u2229 t\"\r\n      by (rule IntI)\r\n    with \u2039y = f x\u203a show \"y \u2208 f ` (s \u2229 t)\"\r\n      by (rule image_eqI)\r\n  qed\r\nqed\r\n\r\n(* 2\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"inj f\"\r\n  shows \"f ` s \u2229 f ` t \u2286 f ` (s \u2229 t)\"\r\nproof\r\n  fix y\r\n  assume \"y \u2208 f ` s \u2229 f ` t\"\r\n  then have \"y \u2208 f ` s\" by simp\r\n  then show \"y \u2208 f ` (s \u2229 t)\"\r\n  proof\r\n    fix x\r\n    assume \"y = f x\"\r\n    assume \"x \u2208 s\"\r\n    have \"x \u2208 t\"\r\n    proof -\r\n      have \"y \u2208 f ` t\" using \u2039y \u2208 f ` s \u2229 f ` t\u203a by simp\r\n      then show \"x \u2208 t\"\r\n      proof\r\n        fix z\r\n        assume \"y = f z\"\r\n        assume \"z \u2208 t\"\r\n        have \"f x = f z\" using \u2039y = f x\u203a \u2039y = f z\u203a by simp\r\n        with \u2039inj f\u203a have \"x = z\" by (simp only: inj_eq)\r\n        then show \"x \u2208 t\" using \u2039z \u2208 t\u203a by simp\r\n      qed\r\n    qed\r\n    with \u2039x \u2208 s\u203a have \"x \u2208 s \u2229 t\" by simp\r\n    with \u2039y = f x\u203a show \"y \u2208 f ` (s \u2229 t)\" by simp\r\n  qed\r\nqed\r\n\r\n(* 3\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"inj f\"\r\n  shows \"f ` s \u2229 f ` t \u2286 f ` (s \u2229 t)\"\r\n  using assms\r\n  by (simp only: image_Int)\r\n\r\n(* 4\u00aa demostraci\u00f3n *)\r\n\r\nlemma\r\n  assumes \"inj f\"\r\n  shows \"f ` s \u2229 f ` t \u2286 f ` (s \u2229 t)\"\r\n  using assms\r\n  unfolding inj_def\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;lean&quot;&#62; (o &#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 si f es inyectiva, entonces f[s] \u2229 f[t] \u2286 f[s \u2229 t] Para ello, completar la siguiente teor\u00eda de Lean: import data.set.basic open set function variables {\u03b1 : Type*} {\u03b2 : Type*} variable f : \u03b1 \u2192 \u03b2 variables s t : set \u03b1 example (h : injective f) : f \u00bb s \u2229 f \u00bb t \u2286 f \u00bb (s \u2229 t) := sorry [expand title=\u00bbSoluciones con Lean\u00bb] import data.set.basic open set function variables {\u03b1 : Type*} {\u03b2 : Type*} variable f : \u03b1 \u2192 \u03b2 variables s t : set \u03b1 &#8212; 1\u00aa demostraci\u00f3n &#8212; =============== example (h : injective f) : f \u00bb s \u2229 f \u00bb t \u2286 f \u00bb (s \u2229 t) := begin intros y hy, cases&#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\/430"}],"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=430"}],"version-history":[{"count":3,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/430\/revisions"}],"predecessor-version":[{"id":478,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/430\/revisions\/478"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}