        {"id":1769,"date":"2023-11-14T06:00:31","date_gmt":"2023-11-14T04:00:31","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1769"},"modified":"2023-11-03T14:21:33","modified_gmt":"2023-11-03T12:21:33","slug":"14-nov-23","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/14-nov-23\/","title":{"rendered":"La composici\u00f3n de funciones suprayectivas es suprayectiva"},"content":{"rendered":"<p>Demostrar con Lean4 que la composici\u00f3n de funciones suprayectivas es suprayectiva.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Tactic\nopen Function\nvariable {\u03b1 : Type _} {\u03b2 : Type _} {\u03b3 : Type _}\nvariable {f : \u03b1 \u2192 \u03b2} {g : \u03b2 \u2192 \u03b3}\n\nexample\n  (hg : Surjective g)\n  (hf : Surjective f)\n  : Surjective (g \u2218 f) :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraci\u00f3n en lenguaje natural<\/b><\/p>\n<p><br \/>\nSupongamos que &#92;(f : A \u2192 B&#92;) y &#92;(g : B \u2192 C&#92;) son suprayectivas. Tenemosque demostrar que<br \/>\n&#92;[ (\u2200z \u2208 C)(\u2203x \u2208 A)[g(f(x)) = z] &#92;]<br \/>\nSea &#92;(z \u2208 C&#92;). Por ser &#92;(g&#92;) suprayectiva, existe un &#92;(y \u2208 B&#92;) tal que<br \/>\n&#92;[ g(y) = z &#92;tag{1} &#92;]<br \/>\nPor ser &#92;(f&#92;) suprayectiva, existe un &#92;(x \u2208 A&#92;) tal que<br \/>\n&#92;[ f(x) = y &#92;tag{2} &#92;]<br \/>\nPor tanto,<br \/>\n&#92;begin{align}<br \/>\n    g(f(x)) &amp;= g(y)   &amp;&amp;&#92;text{[por (2)]} &#92;&#92;<br \/>\n            &amp;= z      &amp;&amp;&#92;text{[por (1)]}<br \/>\n&#92;end{align}<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\nimport Mathlib.Tactic\nopen Function\nvariable {\u03b1 : Type _} {\u03b2 : Type _} {\u03b3 : Type _}\nvariable {f : \u03b1 \u2192 \u03b2} {g : \u03b2 \u2192 \u03b3}\n\n-- 1\u00aa demostraci\u00f3n\nexample\n  (hg : Surjective g)\n  (hf : Surjective f)\n  : Surjective (g \u2218 f) :=\nby\n  intro z\n  -- z : \u03b3\n  -- \u22a2 \u2203 a, (g \u2218 f) a = z\n  cases' hg z with y hy\n  -- y : \u03b2\n  -- hy : g y = z\n  cases' hf y with x hx\n  -- x : \u03b1\n  -- hx : f x = y\n  use x\n  -- \u22a2 (g \u2218 f) x = z\n  dsimp\n  -- \u22a2 g (f x) = z\n  rw [hx]\n  -- \u22a2 g y = z\n  exact hy\n\n-- 2\u00aa demostraci\u00f3n\nexample\n  (hg : Surjective g)\n  (hf : Surjective f)\n  : Surjective (g \u2218 f) :=\nby\n  intro z\n  -- z : \u03b3\n  -- \u22a2 \u2203 a, (g \u2218 f) a = z\n  cases' hg z with y hy\n  -- y : \u03b2\n  -- hy : g y = z\n  cases' hf y with x hx\n  -- x : \u03b1\n  -- hx : f x = y\n  use x\n  -- \u22a2 (g \u2218 f) x = z\n  dsimp\n  -- \u22a2 g (f x) = z\n  rw [hx, hy]\n\n-- 3\u00aa demostraci\u00f3n\nexample\n  (hg : Surjective g)\n  (hf : Surjective f)\n  : Surjective (g \u2218 f) :=\nby\n  intro z\n  -- z : \u03b3\n  -- \u22a2 \u2203 a, (g \u2218 f) a = z\n  cases' hg z with y hy\n  -- y : \u03b2\n  -- hy : g y = z\n  cases' hf y with x hx\n  -- x : \u03b1\n  -- hx : f x = y\n  exact \u27e8x, by dsimp ; rw [hx, hy]\u27e9\n\n-- 4\u00aa demostraci\u00f3n\nexample\n  (hg : Surjective g)\n  (hf : Surjective f)\n  : Surjective (g \u2218 f) :=\nby\n  intro z\n  -- z : \u03b3\n  -- \u22a2 \u2203 a, (g \u2218 f) a = z\n  rcases hg z with \u27e8y, hy : g y = z\u27e9\n  rcases hf y with \u27e8x, hx : f x = y\u27e9\n  exact \u27e8x, by dsimp ; rw [hx, hy]\u27e9\n\n-- 5\u00aa demostraci\u00f3n\nexample\n  (hg : Surjective g)\n  (hf : Surjective f)\n  : Surjective (g \u2218 f) :=\nSurjective.comp hg hf\n\n-- Lemas usados\n-- ============\n\n-- #check (Surjective.comp : Surjective g \u2192 Surjective f \u2192 Surjective (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_suprayectivas.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. 31.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que la composici\u00f3n de funciones suprayectivas es suprayectiva. 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 : Surjective g) (hf : Surjective f) : Surjective (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":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1769"}],"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=1769"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1769\/revisions"}],"predecessor-version":[{"id":1770,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1769\/revisions\/1770"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}