{"id":7579,"date":"2021-01-23T19:36:03","date_gmt":"2021-01-23T18:36:03","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/?p=7579"},"modified":"2021-01-23T19:36:03","modified_gmt":"2021-01-23T18:36:03","slug":"negacion-del-universal-en-lean-caracterizacion-de-funciones-no-pares","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/negacion-del-universal-en-lean-caracterizacion-de-funciones-no-pares\/","title":{"rendered":"Negaci\u00f3n del universal en Lean: Caracterizaci\u00f3n de funciones no pares"},"content":{"rendered":"<p>He a\u00f1adido a la lista <a href=\"https:\/\/bit.ly\/2QwnT30\">DAO (Demostraci\u00f3n Asistida por Ordenador) con Lean<\/a> el <a href=\"https:\/\/youtu.be\/gSdNkGolAJ4\">v\u00eddeo<\/a> en el que se comentan 6 pruebas en Lean de la propiedad<\/p>\n<blockquote><p>\n  \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x\n<\/p><\/blockquote>\n<p>usando los estilos declarativo, aplicativo y autom\u00e1tico.<\/p>\n<p>A continuaci\u00f3n, se muestra el v\u00eddeo<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/gSdNkGolAJ4\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>y el <a href=\"https:\/\/bit.ly\/3iGvER3\">c\u00f3digo<\/a> de la teor\u00eda utilizada<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\n\nvariable (f : \u211d \u2192 \u211d)\n\n-- ----------------------------------------------------\n-- Ejercicio 1. Definir la funci\u00f3n\n--    par : (\u211d \u2192 \u211d) \u2192 Prop\n-- tal que (par f) expresa que f es par.\n-- ----------------------------------------------------\n\ndef par : (\u211d \u2192 \u211d) \u2192 Prop\n| f := \u2200 x, f (-x) = f x\n\n-- ----------------------------------------------------\n-- Ejercicio 2. Demostrar que\n--    \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x\n-- ----------------------------------------------------\n\n-- 1\u00aa demostraci\u00f3n\nexample : \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x :=\nbegin\n  split,\n  { contrapose,\n    intro h1,\n    rw not_not,\n    unfold par,\n    intro x,\n    by_contradiction h2,\n    apply h1,\n    use x, },\n  { intro h1,\n    intro h2,\n    unfold par at h2,\n    cases h1 with x hx,\n    apply hx,\n    exact h2 x, },\nend\n\n-- 2\u00aa demostraci\u00f3n\nexample : \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x :=\nbegin\n  split,\n  { contrapose,\n    intro h1,\n    rw not_not,\n    intro x,\n    by_contradiction h2,\n    apply h1,\n    use x, },\n  { rintros \u27e8x, hx\u27e9 h',\n    exact hx (h' x) },\nend\n\n-- 3\u00aa demostraci\u00f3n\nexample : \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x :=\nbegin\n  unfold par,\n  push_neg,\nend\n\n-- 4\u00aa demostraci\u00f3n\nexample : \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x :=\niff.intro\n  ( have h1 : \u00ac(\u2203 x, f (-x) \u2260 f x) \u2192 \u00ac\u00acpar f,\n      { assume h2 : \u00ac(\u2203 x, f (-x) \u2260 f x),\n        have h3 : par f,\n          { assume x,\n            have h4 : \u00ac(f (-x) \u2260 f x),\n              { assume h5 : f (-x) \u2260 f x,\n                have h6 : \u2203 x, f (-x) \u2260 f x,\n                  from exists.intro x h5,\n                show false,\n                  from h2 h6, },\n            show f (-x) = f x,\n              from not_not.mp h4},\n        show \u00ac\u00acpar f,\n          from not_not.mpr h3 },\n    show \u00acpar f \u2192 (\u2203 x, f (-x) \u2260 f x),\n      from not_imp_not.mp h1)\n  ( assume h1 : \u2203 x, f (-x) \u2260 f x,\n    show \u00acpar f,\n      { assume h2 : par f,\n        show false, from\n          exists.elim h1\n            ( assume x,\n              assume hx : f (-x) \u2260 f x,\n              have h3 : f (-x) = f x,\n                from h2 x,\n              show false,\n                from hx h3)})\n\n-- 5\u00aa demostraci\u00f3n\nexample : \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x :=\n-- by suggest\nnot_forall\n\n-- 6\u00aa demostraci\u00f3n\nexample : \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x :=\n-- by hint\nby simp [par]\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>He a\u00f1adido a la lista DAO (Demostraci\u00f3n Asistida por Ordenador) con Lean el v\u00eddeo en el que se comentan 6 pruebas en Lean de la propiedad \u00acpar f \u2194 \u2203 x, f (-x) \u2260 f x usando los estilos declarativo, aplicativo y autom\u00e1tico. A continuaci\u00f3n, se muestra el v\u00eddeo y el c\u00f3digo de la teor\u00eda&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","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,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[335],"tags":[336],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7579"}],"collection":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/comments?post=7579"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7579\/revisions"}],"predecessor-version":[{"id":7580,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7579\/revisions\/7580"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/media?parent=7579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/categories?post=7579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/tags?post=7579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}