-
Notifications
You must be signed in to change notification settings - Fork 0
/
Producto_de_sucesiones_convergentes_a_cero.lean
103 lines (92 loc) · 2.74 KB
/
Producto_de_sucesiones_convergentes_a_cero.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
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
-- Producto_de_sucesiones_convergentes_a_cero.lean
-- Producto de sucesiones convergentes a cero
-- José A. Alonso Jiménez
-- Sevilla, 17 de julio de 2021
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- En Lean, una sucesión u₀, u₁, u₂, ... se puede representar mediante
-- una función (u : ℕ → ℝ) de forma que u(n) es uₙ.
--
-- Se define que a es el límite de la sucesión u, por
-- def limite : (ℕ → ℝ) → ℝ → Prop :=
-- λ u a, ∀ ε > 0, ∃ N, ∀ n ≥ N, |u n - a| < ε
-- donde se usa la notación |x| para el valor absoluto de x
-- notation `|`x`|` := abs x
--
-- Demostrar que si las sucesiones u(n) y v(n) convergen a cero,
-- entonces u(n)·v(n) también converge a cero.
-- ---------------------------------------------------------------------
import data.real.basic
import tactic
variables {u v : ℕ → ℝ}
variables {: ℝ}
notation `|`x`|` := abs x
def limite : (ℕ → ℝ) → ℝ → Prop :=
λ u c, ∀ ε > 0, ∃ N, ∀ n ≥ N, |u n - c| < ε
-- 1ª demostración
-- ===============
example
(hu : limite u 0)
(hv : limite v 0)
: limite (u * v) 0 :=
begin
intros ε hε,
cases hu ε hε with U hU,
cases hv 1 zero_lt_one with V hV,
set N := max U V with hN,
use N,
intros n hn,
specialize hU n (le_of_max_le_left hn),
specialize hV n (le_of_max_le_right hn),
rw sub_zero at *,
calc |(u * v) n|
= |u n * v n| : rfl
... = |u n| * |v n| : abs_mul (u n) (v n)
... < ε * 1 : mul_lt_mul'' hU hV (abs_nonneg (u n)) (abs_nonneg (v n))
... = ε : mul_one ε,
end
-- 2ª demostración
-- ===============
example
(hu : limite u 0)
(hv : limite v 0)
: limite (u * v) 0 :=
begin
intros ε hε,
cases hu ε hε with U hU,
cases hv 1 (by linarith) with V hV,
set N := max U V with hN,
use N,
intros n hn,
specialize hU n (le_of_max_le_left hn),
specialize hV n (le_of_max_le_right hn),
rw sub_zero at *,
calc |(u * v) n|
= |u n * v n| : rfl
... = |u n| * |v n| : abs_mul (u n) (v n)
... < ε * 1 : by { apply mul_lt_mul'' hU hV ; simp [abs_nonneg] }
... = ε : mul_one ε,
end
-- 3ª demostración
-- ===============
example
(hu : limite u 0)
(hv : limite v 0)
: limite (u * v) 0 :=
begin
intros ε hε,
cases hu ε hε with U hU,
cases hv 1 (by linarith) with V hV,
set N := max U V with hN,
use N,
intros n hn,
have hUN : U ≤ N := le_max_left U V,
have hVN : V ≤ N := le_max_right U V,
specialize hU n (by linarith),
specialize hV n (by linarith),
rw sub_zero at ⊢ hU hV,
rw pi.mul_apply,
rw abs_mul,
convert mul_lt_mul'' hU hV _ _, simp,
all_goals {apply abs_nonneg},
end