        {"id":1730,"date":"2023-10-26T06:00:17","date_gmt":"2023-10-26T04:00:17","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1730"},"modified":"2023-10-19T12:19:48","modified_gmt":"2023-10-19T10:19:48","slug":"26-oct-23","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/26-oct-23\/","title":{"rendered":"La composici\u00f3n de funciones inyectivas es inyectiva"},"content":{"rendered":"<p>Demostrar con Lean4 que la composici\u00f3n de funciones inyectivas es inyectiva.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Tactic\n\nopen Function\n\nvariable {\u03b1 : Type _} {\u03b2 : Type _} {\u03b3 : Type _}\nvariable {f : \u03b1 \u2192 \u03b2} {g : \u03b2 \u2192 \u03b3}\n\nexample\n  (hg : Injective g)\n  (hf : Injective f) :\n  Injective (g \u2218 f) :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraciones en lenguaje natural (LN)<\/b><\/p>\n<p><br \/>\n<b>1\u00aa demostraci\u00f3n en LN<\/b><\/p>\n<p>Tenemos que demostrar que<br \/>\n&#92;[ (\u2200 x, y) [(g \u2218 f)(x) = (g \u2218 f)(y) \u2192 x = y] &#92;]<br \/>\nSean &#92;(x, y&#92;) tales que<br \/>\n&#92;[ (g \u2218 f)(x) = (g \u2218 f)(y) &#92;]<br \/>\nEntonces, por la definici\u00f3n de la composici\u00f3n,<br \/>\n&#92;[ g(f(x)) = g(f(y)) &#92;]<br \/>\ny, ser &#92;(g&#92;) inyectiva,<br \/>\n&#92;[ f(x) = f(y) &#92;]<br \/>\ny, ser &#92;(f&#92;) inyectiva,<br \/>\n&#92;[ x = y &#92;]<\/p>\n<p><b>2\u00aa demostraci\u00f3n en LN<\/b><\/p>\n<p>Tenemos que demostrar que<br \/>\n&#92;[ (\u2200 x, y) [(g \u2218 f)(x) = (g \u2218 f)(y) \u2192 x = y] &#92;]<br \/>\nSean &#92;(x, y&#92;) tales que<br \/>\n&#92;[ (g \u2218 f)(x) = (g \u2218 f)(y) &#92;tag{1} &#92;]<br \/>\ny tenemos que demostrar que<br \/>\n&#92;[ x = y &#92;tag{2} &#92;]<br \/>\nEl objetivo (2), usando que &#92;(f&#92;) es inyectiva, se reduce a<br \/>\n&#92;[ f(x) = f(y) &#92;]<br \/>\nque, usando que &#92;(g&#92;) es inyectiva, se reduce a<br \/>\n&#92;[ g(f(x)) = g(f(y)) &#92;]<br \/>\nque, por la definici\u00f3n de la composici\u00f3n, coincide con (1).<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\nimport Mathlib.Tactic\n\nopen Function\n\nvariable {\u03b1 : Type _} {\u03b2 : Type _} {\u03b3 : Type _}\nvariable {f : \u03b1 \u2192 \u03b2} {g : \u03b2 \u2192 \u03b3}\n\n-- 1\u00aa demostraci\u00f3n (basada en la 1\u00aa en LN)\nexample\n  (hg : Injective g)\n  (hf : Injective f) :\n  Injective (g \u2218 f) :=\nby\n  intro (x : \u03b1) (y : \u03b1) (h1: (g \u2218 f) x = (g \u2218 f) y)\n  have h2: g (f x) = g (f y) := h1\n  have h3: f x = f y := hg h2\n  show x = y\n  exact hf h3\n\n-- 2\u00aa demostraci\u00f3n\nexample\n  (hg : Injective g)\n  (hf : Injective f) :\n  Injective (g \u2218 f) :=\nby\n  intro (x : \u03b1) (y : \u03b1) (h1: (g \u2218 f) x = (g \u2218 f) y)\n  have h2: f x = f y := hg h1\n  show x = y\n  exact hf h2\n\n-- 3\u00aa demostraci\u00f3n\nexample\n  (hg : Injective g)\n  (hf : Injective f) :\n  Injective (g \u2218 f) :=\nby\n  intro x y h\n  exact hf (hg h)\n\n-- 4\u00aa demostraci\u00f3n\nexample\n  (hg : Injective g)\n  (hf : Injective f) :\n  Injective (g \u2218 f) :=\nfun _ _ h \u21a6 hf (hg h)\n\n-- 5\u00aa demostraci\u00f3n (basada en la 2\u00aa en LN)\nexample\n  (hg : Injective g)\n  (hf : Injective f) :\n  Injective (g \u2218 f) :=\nby\n  intros x y h\n  -- x y : \u03b1\n  -- h : (g \u2218 f) x = (g \u2218 f) y\n  apply hf\n  -- \u22a2 f x = f y\n  apply hg\n  -- \u22a2 g (f x) = g (f y)\n  apply h\n\n-- 6\u00aa demostraci\u00f3n\nexample\n  (hg : Injective g)\n  (hf : Injective f) :\n  Injective (g \u2218 f) :=\n-- by exact?\nInjective.comp hg hf\n\n-- 7\u00aa demostraci\u00f3n\nexample\n  (hg : Injective g)\n  (hf : Injective f) :\n  Injective (g \u2218 f) :=\nby tauto\n\n-- Lemas usados\n-- ============\n\n-- #check (Injective.comp : Injective g \u2192 Injective f \u2192 Injective (g \u2218 f))\n<\/pre>\n<p><b>Demostraciones interactivas<\/b><\/p>\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\/Composicion_de_funciones_inyectivas.lean\" rel=\"noopener noreferrer\" target=\"_blank\">Lean 4 Web<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li> J. Avigad y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 28.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que la composici\u00f3n de funciones inyectivas es inyectiva. Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Tactic open Function variable {\u03b1 : Type _} {\u03b2 : Type _} {\u03b3 : Type _} variable {f : \u03b1 \u2192 \u03b2} {g : \u03b2 \u2192 \u03b3} example (hg : Injective g) (hf : Injective f) : Injective (g \u2218 f) := 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":"","_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":[1],"tags":[303,297],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1730"}],"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=1730"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1730\/revisions"}],"predecessor-version":[{"id":1731,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1730\/revisions\/1731"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}