ForMatUS: Regla de eliminación de la igualdad en Lean
He añadido a la lista Lógica con Lean el vídeo en el que se comentan 5 pruebas en Lean de un ejemplo que ilustra la regla de eliminación de la igualdad.
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 |
import tactic -- #check @eq.subst -- ---------------------------------------------------- -- Ej. 1. Demostrar que -- x + 1 = 1 + x -- x + 1 > 1 → x + 1 > 0 -- ⊢ 1 + x > 1 → 1 + x > 0 -- ---------------------------------------------------- variable (U : Type) variable (x : U) variable [has_add U] variable [has_one U] variable [has_lt U] variable [has_zero U] -- 1ª demostración example (h1 : x + 1 = 1 + x) (h2 : x + 1 > 1 → x + 1 > 0) : 1 + x > 1 → 1 + x > 0 := eq.subst h1 h2 -- 2ª demostración example (h1 : x + 1 = 1 + x) (h2 : x + 1 > 1 → x + 1 > 0) : 1 + x > 1 → 1 + x > 0 := h1 ▸ h2 -- 3ª demostración example (h1 : x + 1 = 1 + x) (h2 : x + 1 > 1 → x + 1 > 0) : 1 + x > 1 → 1 + x > 0 := begin rw h1 at h2, exact h2, end -- 4ª demostración example (h1 : x + 1 = 1 + x) (h2 : x + 1 > 1 → x + 1 > 0) : 1 + x > 1 → 1 + x > 0 := begin rw ←h1, exact h2, end -- 5ª demostración example (h1 : x + 1 = 1 + x) (h2 : x + 1 > 1 → x + 1 > 0) : 1 + x > 1 → 1 + x > 0 := -- by hint by finish |