{"id":7406,"date":"2020-09-22T12:42:47","date_gmt":"2020-09-22T10:42:47","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/?p=7406"},"modified":"2020-12-20T12:43:29","modified_gmt":"2020-12-20T11:43:29","slug":"formatus-pruebas-en-lean-de-%c2%acp-%e2%88%a8-q-%e2%8a%a2-p-%e2%86%92-q","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/formatus-pruebas-en-lean-de-%c2%acp-%e2%88%a8-q-%e2%8a%a2-p-%e2%86%92-q\/","title":{"rendered":"ForMatUS: Pruebas en Lean de \u00acP \u2228 Q \u22a2 P \u2192 Q"},"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\/HdZbvRLqTW4\">v\u00eddeo<\/a> en el que se comentan 13 pruebas en Lean de<\/p>\n<pre lang=\"lean\">\u00acP \u2228 Q \u22a2 P \u2192 Q\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\/HdZbvRLqTW4\" 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\/1_Proposicional\/Prueba_de_%C2%ACP%E2%88%A8Q%E2%8A%A2P%E2%86%92Q.lean\">c\u00f3digo<\/a> de la teor\u00eda utilizada<\/p>\n<pre lang=\"lean\">-- Prueba de \u00acP \u2228 Q \u22a2 P \u2192 Q\n-- ========================\n\n-- ----------------------------------------------------\n-- Ej. 1. (p. 15) Demostrar\n--    \u00acP \u2228 Q \u22a2 P \u2192 Q\n-- ----------------------------------------------------\n\nimport tactic\n\nvariables (P Q : Prop)\n\n-- 1\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nassume h2 : P,\nor.elim h1\n  ( assume h3 : \u00acP,\n    have h4 : false,\n      from h3 h2,\n    show Q,\n      from false.elim h4)\n  ( assume h5 : Q,\n    show Q, from h5)\n\n-- 2\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nassume h2 : P,\nor.elim h1\n  ( assume h3 : \u00acP,\n    have h4 : false,\n      from h3 h2,\n    show Q,\n      from false.elim h4)\n  ( assume h5 : Q, h5)\n\n-- 3\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nassume h2 : P,\nor.elim h1\n  ( assume h3 : \u00acP,\n    have h4 : false,\n      from h3 h2,\n    show Q,\n      from false.elim h4)\n  ( \u03bb h5, h5)\n\n-- 4\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nassume h2 : P,\nor.elim h1\n  ( assume h3 : \u00acP,\n    have h4 : false,\n      from h3 h2,\n    show Q,\n      from false.elim h4)\n  id\n\n-- 5\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nassume h2 : P,\nor.elim h1\n  ( assume h3 : \u00acP,\n    show Q,\n      from false.elim (h3 h2))\n  id\n\n-- 6\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nassume h2 : P,\nor.elim h1\n  ( assume h3 : \u00acP, false.elim (h3 h2))\n  id\n\n-- 7\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nassume h2 : P,\nor.elim h1\n  ( \u03bb h3, false.elim (h3 h2))\n  id\n\n-- 8\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\n\u03bb h2, or.elim h1 (\u03bb h3, false.elim (h3 h2)) id\n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\n\u03bb h2, h1.elim (\u03bb h3, false.elim (h3 h2)) id\n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\n\u03bb h2, h1.elim (\u03bb h3, (h3 h2).elim) id\n\n-- 9\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\n-- by library_search\nimp_iff_not_or.mpr h1\n\n-- 10\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nbegin\n  intro h2,\n  cases h1 with h3 h4,\n  { apply false.rec,\n    exact h3 h2, },\n  { exact h4, },\nend\n\n-- 11\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nbegin\n  intro h2,\n  cases h1 with h3 h4,\n  { exact false.elim (h3 h2), },\n  { exact h4, },\nend\n\n-- 12\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nbegin\n  intro h2,\n  cases h1 with h3 h4,\n  { exfalso,\n    exact h3 h2, },\n  { exact h4, },\nend\n\n-- 13\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\n-- by hint\nby tauto\n\n-- 14\u00aa demostraci\u00f3n\nexample\n  (h1 : \u00acP \u2228 Q)\n  : P \u2192 Q :=\nby finish\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 13 pruebas en Lean de \u00acP \u2228 Q \u22a2 P \u2192 Q 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 &#8212; Prueba de \u00acP \u2228 Q \u22a2&#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":[],"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\/7406"}],"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=7406"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7406\/revisions"}],"predecessor-version":[{"id":7407,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7406\/revisions\/7407"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/media?parent=7406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/categories?post=7406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/tags?post=7406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}