La suma de una cota superior de f y una cota superior de g es una cota superior de f+g
Demostrar que la suma de una cota superior de f y una cota superior de g es una cota superior de f+g.
Para ello, completar la siguiente teoría de Lean:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import data.real.basic -- (cota_superior f a) se verifica si a es una cota superior de f. def cota_superior (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, f x ≤ a variables (f g : ℝ → ℝ) variables (a b : ℝ) example (hfa : cota_superior f a) (hgb : cota_superior g b) : cota_superior (λ x, f x + g x) (a + b) := sorry |
Soluciones con Lean
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 |
import data.real.basic -- (cota_superior f a) se verifica si a es una cota superior de f. def cota_superior (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, f x ≤ a variables (f g : ℝ → ℝ) variables (a b : ℝ) -- 1ª demostración -- =============== example (hfa : cota_superior f a) (hgb : cota_superior g b) : cota_superior (λ x, f x + g x) (a + b) := begin have h1 : ∀ x, f x + g x ≤ a + b, { intro x, have h1a : f x ≤ a := hfa x, have h1b : g x ≤ b := hgb x, show f x + g x ≤ a + b, by exact add_le_add (hfa x) (hgb x), }, show cota_superior (λ x, f x + g x) (a + b), by exact h1, end -- 2ª demostración -- =============== example (hfa : cota_superior f a) (hgb : cota_superior g b) : cota_superior (λ x, f x + g x) (a + b) := begin intro x, dsimp, change f x + g x ≤ a + b, apply add_le_add, apply hfa, apply hgb end -- 3ª demostración -- =============== example (hfa : cota_superior f a) (hgb : cota_superior g b) : cota_superior (λ x, f x + g x) (a + b) := λ x, add_le_add (hfa x) (hgb x) |
Se puede interactuar con la prueba anterior en esta sesión con Lean.
Referencias
- J. Avigad, K. Buzzard, R.Y. Lewis y P. Massot. Mathematics in Lean, p. 27.