ForMatUS: Reglas de introducción de la disyunción en Lean
He añadido a la lista Lógica con Lean el vídeo en el que se comentan el uso en Lean de las reglas de introducción de la disyunción con ejemplos de pruebas en los estilos declarativos, aplicativos, funcional y automático.
A continuación, se muestra el vídeo
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 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
import tactic variables (P Q R : Prop) -- ---------------------------------------------------- -- Ej. 1. (p. 11) Demostrar -- P ⊢ P ∨ Q -- ---------------------------------------------------- -- 1ª demostración example (h : P) : P ∨ Q := or.intro_left Q h -- 2ª demostración example (h : P) : P ∨ Q := -- by library_search or.inl h -- 3ª demostración example (h : P) : P ∨ Q := -- by hint by tauto -- 4ª demostración example (h : P) : P ∨ Q := by finish -- ---------------------------------------------------- -- Ej. 2. Demostrar -- P ∧ Q ⊢ P ∨ R -- ---------------------------------------------------- -- 1ª demostración example (h1 : P ∧ Q) : P ∨ R := have h2 : P, from and.elim_left h1, show P ∨ R, from or.inl h2 -- 2ª demostración example (h1 : P ∧ Q) : P ∨ R := have h2 : P, from h1.1, show P ∨ R, from or.inl h2 -- 3ª demostración example (h1 : P ∧ Q) : P ∨ R := have h2 : P := h1.1, show P ∨ R, from or.inl h2 -- 4ª demostración example (h1 : P ∧ Q) : P ∨ R := show P ∨ R, from or.inl h1.1 -- 5ª demostración example (h1 : P ∧ Q) : P ∨ R := -- by suggest or.inl h1.1 -- 6ª demostración example (h1 : P ∧ Q) : P ∨ R := -- by hint by tauto -- 7ª demostración example (h1 : P ∧ Q) : P ∨ R := by finish -- ---------------------------------------------------- -- Ej. 3. Demostrar -- Q ⊢ P ∨ Q -- ---------------------------------------------------- -- 1ª demostración example (h : Q) : P ∨ Q := or.intro_right P h -- 2ª demostración example (h : Q) : P ∨ Q := -- by suggest or.inr h -- 3ª demostración example (h : Q) : P ∨ Q := -- by hint by tauto -- 4ª demostración example (h : Q) : P ∨ Q := by finish -- ---------------------------------------------------- -- Ej. 4. Demostrar -- P ∧ Q ⊢ R ∨ Q -- ---------------------------------------------------- -- 1ª demostración example (h1 : P ∧ Q) : R ∨ Q := have h2 : Q, from and.elim_right h1, show R ∨ Q, from or.inr h2 -- 2ª demostración example (h1 : P ∧ Q) : R ∨ Q := have h2 : Q, from h1.2, show R ∨ Q, from or.inr h2 -- 3ª demostración example (h1 : P ∧ Q) : R ∨ Q := have h2 : Q := h1.2, show R ∨ Q, from or.inr h2 -- 4ª demostración example (h1 : P ∧ Q) : R ∨ Q := show R ∨ Q, from or.inr h1.2 -- 5ª demostración example (h1 : P ∧ Q) : R ∨ Q := -- by suggest or.inr h1.2 -- 6ª demostración example (h1 : P ∧ Q) : R ∨ Q := -- by hint by tauto -- 7ª demostración example (h1 : P ∧ Q) : R ∨ Q := by finish |