{"id":7451,"date":"2020-10-08T17:39:25","date_gmt":"2020-10-08T15:39:25","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/?p=7451"},"modified":"2020-12-20T17:40:26","modified_gmt":"2020-12-20T16:40:26","slug":"formatus-pruebas-en-lean-de-%e2%88%83x%e2%88%83y-pxy-%e2%86%94-%e2%88%83y%e2%88%83x-pxy","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/formatus-pruebas-en-lean-de-%e2%88%83x%e2%88%83y-pxy-%e2%86%94-%e2%88%83y%e2%88%83x-pxy\/","title":{"rendered":"ForMatUS: Pruebas en Lean de \u2203x\u2203y P(x,y) \u2194 \u2203y\u2203x P(x,y)"},"content":{"rendered":"<p>He a\u00f1adido a la lista <a href=\"https:\/\/bit.ly\/2FcUrwQ\">L\u00f3gica con Lean<\/a> el <a href=\"https:\/\/youtu.be\/N8u54DEyb0o\">v\u00eddeo<\/a> en el que se comentan pruebas en Lean de la propiedad<\/p>\n<pre lang=\"lean\">\u2203x\u2203y P(x,y) \u2194 \u2203y\u2203x P(x,y)\n<\/pre>\n<p>usando los estilos declarativos, aplicativos, funcional y autom\u00e1tico.<\/p>\n<p>A continuaci\u00f3n, se muestra el v\u00eddeo<\/p>\n<p><center><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/N8u54DEyb0o\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/p>\n<p><\/center>y el <a href=\"https:\/\/github.com\/jaalonso\/Logica_con_Lean\/blob\/master\/src\/2_LPO\/Pruebas_de_%E2%88%83x%E2%88%83yP(x,y)%E2%86%94%E2%88%83y%E2%88%83xP(x,y).lean\">c\u00f3digo<\/a> de la teor\u00eda utilizada<\/p>\n<pre lang=\"lean\">import tactic\n\nsection\n\nvariable {U : Type}\nvariable {P : U -&gt; U -&gt; Prop}\n\n-- ------------------------------------------------------\n-- Ej. 1. Demostrar que\n--    \u2203x\u2203yP(x,y) \u2192 \u2203y\u2203xP(x,y)\n-- ------------------------------------------------------\n\n-- 1\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nassume h1 : \u2203 x, \u2203 y, P x y,\nexists.elim h1\n  ( assume x\u2080 (h2 : \u2203 y, P x\u2080 y),\n    exists.elim h2\n      ( assume y\u2080 (h3 : P x\u2080 y\u2080),\n        have h4 : \u2203 x, P x y\u2080, from exists.intro x\u2080 h3,\n        show \u2203 y, \u2203 x, P x y,  from exists.intro y\u2080 h4))\n\n-- 2\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nassume \u27e8x\u2080, y\u2080, (h1 : P x\u2080 y\u2080)\u27e9,\nhave h2 : \u2203 x, P x y\u2080, from \u27e8x\u2080, h1\u27e9,\nshow (\u2203 y, \u2203 x, P x y), from \u27e8y\u2080, h2\u27e9\n\n-- 3\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nassume \u27e8x\u2080, y\u2080, (h1 : P x\u2080 y\u2080)\u27e9,\nshow (\u2203 y, \u2203 x, P x y), from \u27e8y\u2080, \u27e8x\u2080, h1\u27e9\u27e9\n\n-- 4\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nassume \u27e8x\u2080, y\u2080, (h1 : P x\u2080 y\u2080)\u27e9,\nshow (\u2203 y, \u2203 x, P x y), from \u27e8y\u2080, x\u2080, h1\u27e9\n\n-- 5\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nassume \u27e8x\u2080, y\u2080, (h1 : P x\u2080 y\u2080)\u27e9,\n\u27e8y\u2080, x\u2080, h1\u27e9\n\n-- 6\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\n\u03bb \u27e8x\u2080, y\u2080, h1\u27e9, \u27e8y\u2080, x\u2080, h1\u27e9\n\n-- 7\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x y, P x y) \u2192 (\u2203 y x, P x y) :=\n-- by library_search\nexists_comm.mp\n\n-- 8\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nbegin\n  intro h1,\n  cases h1 with x\u2080 h2,\n  cases h2 with y\u2080 h3,\n  use y\u2080,\n  use x\u2080,\n  exact h3,\nend\n\n-- 9\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nbegin\n  intro h1,\n  cases h1 with x\u2080 h2,\n  cases h2 with y\u2080 h3,\n  use [y\u2080, x\u2080],\n  exact h3,\nend\n\n-- 10\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nbegin\n  intro h1,\n  rcases h1 with \u27e8x\u2080, y\u2080, h2\u27e9,\n  use [y\u2080, x\u2080],\n  exact h2,\nend\n\n-- 11\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nbegin\n  intro h1,\n  rcases h1 with \u27e8x\u2080, y\u2080, h2\u27e9,\n  exact \u27e8y\u2080, x\u2080, h2\u27e9,\nend\n\n-- 12\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nbegin\n  rintro \u27e8x\u2080, y\u2080, h2\u27e9,\n  exact \u27e8y\u2080, x\u2080, h2\u27e9,\nend\n\n-- 13\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\n-- by hint\nby tauto\n\n-- 14\u00aa demostraci\u00f3n\nlemma aux :\n  (\u2203 x, \u2203 y, P x y) \u2192 (\u2203 y, \u2203 x, P x y) :=\nby finish\n\n-- ------------------------------------------------------\n-- Ej. 2. Demostrar que\n--    \u2203x\u2203yP(x,y) \u2194 \u2203y\u2203xP(x,y)\n-- ------------------------------------------------------\n\n-- 1\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x y, P x y) \u2194 (\u2203 y x, P x y) :=\niff.intro aux aux\n\n-- 2\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x y, P x y) \u2194 (\u2203 y x, P x y) :=\n\u27e8aux, aux\u27e9\n\n-- 3\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x y, P x y) \u2194 (\u2203 y x, P x y) :=\n-- by library_search\nexists_comm\n\n-- 4\u00aa demostraci\u00f3n\nexample :\n  (\u2203 x y, P x y) \u2194 (\u2203 y x, P x y) :=\n-- by hint\nby tauto\n\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>He a\u00f1adido a la lista L\u00f3gica con Lean el v\u00eddeo en el que se comentan pruebas en Lean de la propiedad \u2203x\u2203y P(x,y) \u2194 \u2203y\u2203x P(x,y) usando los estilos declarativos, aplicativos, funcional y autom\u00e1tico. A continuaci\u00f3n, se muestra el v\u00eddeo y el c\u00f3digo de la teor\u00eda utilizada import tactic section variable {U : Type} variable&#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\/7451"}],"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=7451"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7451\/revisions"}],"predecessor-version":[{"id":7452,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7451\/revisions\/7452"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/media?parent=7451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/categories?post=7451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/tags?post=7451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}