        {"id":1201,"date":"2022-11-17T18:49:16","date_gmt":"2022-11-17T16:49:16","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1201"},"modified":"2022-11-17T18:49:51","modified_gmt":"2022-11-17T16:49:51","slug":"17-nov-22","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/17-nov-22\/","title":{"rendered":"Si f es par y g es impar, entonces f \u2218 g es par"},"content":{"rendered":"<p>La funci\u00f3n f de \u211d en \u211d es par si, para todo x, f(-x) = f(x) y es impar si, para todo x, f(-x) -f(x).<\/p>\n<p>Demostrar que si f es par y g es impar, entonces f \u2218 g es par.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\nvariables (f g : \u211d \u2192 \u211d)\n\ndef par (f : \u211d \u2192 \u211d) : Prop    := \u2200 x, f x = f (-x)\ndef impar  (f : \u211d \u2192 \u211d) : Prop := \u2200 x, f x = -f (-x)\n\nexample\n  (hf : par f)\n  (hg : impar g)\n  : par (f \u2218 g) :=\nsorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Soluciones con Lean<\/b><\/p>\n<pre lang=\"lean\">\nimport data.real.basic\nvariables (f g : \u211d \u2192 \u211d)\n\ndef par (f : \u211d \u2192 \u211d) : Prop    := \u2200 x, f x = f (-x)\ndef impar  (f : \u211d \u2192 \u211d) : Prop := \u2200 x, f x = -f (-x)\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (hf : par f)\n  (hg : impar g)\n  : par (f \u2218 g) :=\nbegin\n  intro x,\n  have h1 : f x = f (-x) := hf x,\n  have h2 : g x = -g (-x) := hg x,\n  calc (f \u2218 g) x\n       = f (g x)      : rfl\n   ... = f (-g (-x))  : congr_arg f (hg x)\n   ... = f (g (-x))   : eq.symm (hf (g (-x)))\n   ... = (f \u2218 g) (-x) : rfl\nend\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (hf : par f)\n  (hg : impar g)\n  : par (f \u2218 g) :=\nbegin\n  intro x,\n  calc (f \u2218 g) x\n       = f (g x)      : rfl\n   ... = f (-g (-x))  : by rw hg\n   ... = f (g (-x))   : by rw \u2190hf\n   ... = (f \u2218 g) (-x) : rfl\nend\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/leanprover-community.github.io\/lean-web-editor\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus\/main\/src\/Composicion_par_impar.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li>J. Avigad, K. Buzzard, R.Y. Lewis y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 29.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>La funci\u00f3n f de \u211d en \u211d es par si, para todo x, f(-x) = f(x) y es impar si, para todo x, f(-x) -f(x). Demostrar que si f es par y g es impar, entonces f \u2218 g es par. Para ello, completar la siguiente teor\u00eda de Lean: import data.real.basic variables (f g : \u211d \u2192 \u211d) def par (f : \u211d \u2192 \u211d) : Prop := \u2200 x, f x = f (-x) def impar (f : \u211d \u2192 \u211d) : Prop := \u2200 x, f x = -f (-x) example (hf : par f) (hg : impar g) : par (f \u2218 g) := 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\/1201"}],"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=1201"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1201\/revisions"}],"predecessor-version":[{"id":1203,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1201\/revisions\/1203"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}