ForMatUS: Pruebas en Lean de P, ¬¬(Q ∧ R) ⊢ ¬¬P ∧ R
He añadido a la lista Lógica con Lean el vídeo en el que se comentan 8 pruebas en Lean de la propiedad en Lean de
1 |
P, ¬¬(Q ∧ R) ⊢ ¬¬P ∧ R |
usando 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 |
-- ---------------------------------------------------- -- Ej. 1. (p. 5) Demostrar -- P, ¬¬(Q ∧ R) ⊢ ¬¬P ∧ R -- ---------------------------------------------------- import tactic variables (P Q R : Prop) open_locale classical -- 1ª demostración example (h1 : P) (h2 : ¬¬(Q ∧ R)) : ¬¬P ∧ R := have h3 : ¬¬P, from not_not_intro h1, have h4 : Q ∧ R, from not_not.mp h2, have h5 : R, from and.elim_right h4, show ¬¬P ∧ R, from and.intro h3 h5 -- 2ª demostración example (h1 : P) (h2 : ¬¬(Q ∧ R)) : ¬¬P ∧ R := have h3 : ¬¬P, from not_not_intro h1, have h4 : Q ∧ R, from not_not.mp h2, have h5 : R, from and.elim_right h4, and.intro h3 h5 -- 3ª demostración example (h1 : P) (h2 : ¬¬(Q ∧ R)) : ¬¬P ∧ R := have h3 : ¬¬P, from not_not_intro h1, have h4 : Q ∧ R, from not_not.mp h2, have h5 : R, from h4.2, and.intro h3 h5 -- 5ª demostración example (h1 : P) (h2 : ¬¬(Q ∧ R)) : ¬¬P ∧ R := and.intro (not_not_intro h1) (not_not.mp h2).2 -- 6ª demostración example (h1 : P) (h2 : ¬¬(Q ∧ R)) : ¬¬P ∧ R := begin split, { exact not_not_intro h1, }, { push_neg at h2, exact h2.2, }, end -- 7ª demostración example (h1 : P) (h2 : ¬¬(Q ∧ R)) : ¬¬P ∧ R := -- by hint by tauto -- 8ª demostración lemma aux (h1 : P) (h2 : ¬¬(Q ∧ R)) : ¬¬P ∧ R := by finish -- #print axioms aux |