ForMatUS: Pruebas en Lean de ¬Q → ¬P ⊢ P → ¬¬Q
He añadido a la lista Lógica con Lean el vídeo en el que se comentan 15 pruebas en Lean de
¬Q → ¬P ⊢ P → ¬¬Q
usando los estilos declarativos, aplicativos, funcional y automático.
A continuación, se muestra el vídeo
y el código de la teoría utilizada
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
-- Pruebas de ¬Q → ¬P ⊢ P → ¬¬Q -- ============================ -- Ej. 1. Demostrar -- ¬Q → ¬P ⊢ P → ¬¬Q import tactic variables (P Q : Prop) -- 1ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := assume h2 : P, have h3 : ¬¬P, from not_not_intro h2, show ¬¬Q, from mt h1 h3 -- 2ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := assume h2 : P, have h3 : ¬¬P := not_not_intro h2, show ¬¬Q, from mt h1 h3 -- 3ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := assume h2 : P, show ¬¬Q, from mt h1 (not_not_intro h2) -- 4ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := assume h2 : P, mt h1 (not_not_intro h2) -- 5ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := λ h2, mt h1 (not_not_intro h2) -- 6ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := imp_not_comm.mp h1 -- 7ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := begin intro h2, apply mt h1, apply not_not_intro, exact h2, end -- 8ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := begin intro h2, apply mt h1, exact not_not_intro h2, end -- 9ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := begin intro h2, exact mt h1 (not_not_intro h2), end -- 10ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := λ h2, mt h1 (not_not_intro h2) -- 11ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := begin intro h2, intro h3, have h4 : ¬P := h1 h3, exact h4 h2, end -- 12ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := begin intros h2 h3, exact (h1 h3) h2, end -- 13ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := λ h2 h3, (h1 h3) h2 -- 14ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := by tauto -- 15ª demostración example (h1 : ¬Q → ¬P) : P → ¬¬Q := by finish |