{"id":7575,"date":"2021-01-21T12:55:05","date_gmt":"2021-01-21T11:55:05","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/?p=7575"},"modified":"2021-01-21T12:55:05","modified_gmt":"2021-01-21T11:55:05","slug":"pruebas-en-lean-de-la-ley-de-de-morgan-%c2%acp-%e2%88%a7-q-%e2%86%94-%c2%acp-%e2%88%a8-%c2%acq","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/pruebas-en-lean-de-la-ley-de-de-morgan-%c2%acp-%e2%88%a7-q-%e2%86%94-%c2%acp-%e2%88%a8-%c2%acq\/","title":{"rendered":"Pruebas en Lean de la ley de De Morgan: \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ"},"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\/-sKXvSN0yiw\">v\u00eddeo<\/a> en el que se comentan 12 pruebas en Lean de la ley de De Morgan:<\/p>\n<blockquote><p>\n  \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ\n<\/p><\/blockquote>\n<p>usando los estilos declarativo, aplicativo y funcional.<\/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\/-sKXvSN0yiw\" 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\/39TosNs\">c\u00f3digo<\/a> de la teor\u00eda utilizada<\/p>\n<pre lang=\"lean\">\nimport tactic\nvariables (P Q : Prop)\n\n-- ----------------------------------------------------\n-- Ejercicio. Demostrar que\n--    \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ\n-- ----------------------------------------------------\n\n-- 1\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\nbegin\n  split,\n  { intro h,\n    by_cases hP : P,\n    { right,\n      intro hQ,\n      apply h,\n      split,\n      { exact hP, },\n      { exact hQ, }},\n    { left,\n      exact hP, }},\n  { intros h h',\n    cases h' with hP hQ,\n    cases h with hnP hnQ,\n    { exact hnP hP, },\n    { exact hnQ hQ, }},\nend\n\n-- 2\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\nbegin\n  split,\n  { intro h,\n    by_cases hP : P,\n    { right,\n      intro hQ,\n      exact h \u27e8hP, hQ\u27e9, },\n    { left,\n      exact hP, }},\n  { rintros (hnP | hnQ) \u27e8hP, hQ\u27e9,\n    { exact hnP hP, },\n    { exact hnQ hQ, }},\nend\n\n-- 3\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\niff.intro\n  ( assume h : \u00ac(P \u2227 Q),\n    show \u00acP \u2228 \u00acQ, from\n      or.elim (classical.em P)\n        ( assume hP : P,\n          have hnQ : \u00acQ,\n            { assume hQ : Q,\n              have hPQ: P \u2227 Q,\n                from and.intro hP hQ,\n              show false,\n                from h hPQ },\n          show \u00acP \u2228 \u00acQ,\n            from or.inr hnQ)\n        ( assume hnP : \u00acP,\n          show \u00acP \u2228 \u00acQ,\n            from or.inl hnP))\n  ( assume h: \u00acP \u2228 \u00acQ,\n    show \u00ac(P \u2227 Q), from\n      assume hPQ : P \u2227 Q,\n      show false, from\n        or.elim h\n          ( assume hnP: \u00acP,\n            show false,\n              from hnP (and.left hPQ))\n          ( assume hnQ: \u00acQ,\n            show false,\n              from hnQ (and.right hPQ)))\n\n-- 4\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\niff.intro\n  ( assume h : \u00ac(P \u2227 Q),\n    show \u00acP \u2228 \u00acQ, from\n      or.elim (classical.em P)\n        ( assume hP : P,\n          have hnQ : \u00acQ,\n            { assume hQ : Q,\n              have hPQ: P \u2227 Q,\n                from and.intro hP hQ,\n              show false,\n                from h hPQ },\n          show \u00acP \u2228 \u00acQ,\n            from or.inr hnQ)\n        or.inl)\n  ( assume h: \u00acP \u2228 \u00acQ,\n    show \u00ac(P \u2227 Q), from\n      assume hPQ : P \u2227 Q,\n      show false, from\n        or.elim h\n          ( assume hnP: \u00acP,\n            show false,\n              from hnP (and.left hPQ))\n          (\u03bb hnQ, hnQ (and.right hPQ)))\n\n-- 5\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\niff.intro\n  ( assume h : \u00ac(P \u2227 Q),\n    show \u00acP \u2228 \u00acQ, from\n      or.elim (classical.em P)\n        ( assume hP : P,\n          have hnQ : \u00acQ,\n            { assume hQ : Q,\n              have hPQ: P \u2227 Q,\n                from and.intro hP hQ,\n              show false,\n                from h hPQ },\n          or.inr hnQ)\n        or.inl)\n  ( assume h: \u00acP \u2228 \u00acQ,\n    show \u00ac(P \u2227 Q), from\n      assume hPQ : P \u2227 Q,\n      show false, from\n        or.elim h\n          (\u03bb hnP, hnP (and.left hPQ))\n          (\u03bb hnQ, hnQ (and.right hPQ)))\n\n-- 6\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\niff.intro\n  ( assume h : \u00ac(P \u2227 Q),\n    show \u00acP \u2228 \u00acQ, from\n      or.elim (classical.em P)\n        ( assume hP : P,\n          have hnQ : \u00acQ,\n            { assume hQ : Q,\n              show false,\n                from h (and.intro hP hQ) },\n          or.inr hnQ)\n        or.inl)\n  ( assume h: \u00acP \u2228 \u00acQ,\n    show \u00ac(P \u2227 Q), from\n      \u03bb hPQ, or.elim h (\u03bb hnP, hnP (and.left hPQ))\n                       (\u03bb hnQ, hnQ (and.right hPQ)))\n\n-- 7\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\niff.intro\n  ( assume h : \u00ac(P \u2227 Q),\n    show \u00acP \u2228 \u00acQ, from\n      or.elim (classical.em P)\n        ( assume hP : P,\n          or.inr (\u03bb hQ, h (and.intro hP hQ)))\n        or.inl)\n  ( \u03bb h hPQ, or.elim h (\u03bb hnP, hnP (and.left hPQ))\n                       (\u03bb hnQ, hnQ (and.right hPQ)))\n\n-- 8\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\niff.intro\n  ( assume h : \u00ac(P \u2227 Q),\n    show \u00acP \u2228 \u00acQ, from\n      or.elim (classical.em P)\n        (\u03bb hP, or.inr (\u03bb hQ, h (and.intro hP hQ)))\n        or.inl)\n  ( \u03bb h hPQ, or.elim h (\u03bb hnP, hnP (and.left hPQ))\n                       (\u03bb hnQ, hnQ (and.right hPQ)))\n\n-- 9\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\niff.intro\n  (\u03bb h, or.elim (classical.em P)\n          (\u03bb hP, or.inr (\u03bb hQ, h (and.intro hP hQ)))\n          or.inl)\n  (\u03bb h hPQ, or.elim h\n              (\u03bb hnP, hnP (and.left hPQ))\n              (\u03bb hnQ, hnQ (and.right hPQ)))\n\n-- 10\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\n\u27e8\u03bb h, or.elim (classical.em P) (\u03bb hP, or.inr (\u03bb hQ, h \u27e8hP, hQ\u27e9)) or.inl,\n \u03bb h hPQ, or.elim h (\u03bb hnP, hnP hPQ.1) (\u03bb hnQ, hnQ hPQ.2)\u27e9\n\n-- 11\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\n-- by library_search\nnot_and_distrib\n\n-- 12\u00aa demostraci\u00f3n\nexample : \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ :=\n-- by hint\nby finish\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 12 pruebas en Lean de la ley de De Morgan: \u00ac(P \u2227 Q) \u2194 \u00acP \u2228 \u00acQ usando los estilos declarativo, aplicativo y funcional. 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\/7575"}],"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=7575"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7575\/revisions"}],"predecessor-version":[{"id":7576,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7575\/revisions\/7576"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/media?parent=7575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/categories?post=7575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/tags?post=7575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}