-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStephanie.lean
152 lines (130 loc) · 3.82 KB
/
Stephanie.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
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
import analysis.normed_space.basic
import topology.instances.ennreal
import analysis.normed_space.basic
import topology.instances.ennreal
import algebra.archimedean algebra.geom_sum
import data.nat.choose data.complex.basic
import tactic.linarith
import analysis.calculus.deriv
import data.complex.exponential
open finset
open cau_seq
namespace complex
noncomputable theory
lemma is_cau_abs_cos (z : ℂ) : is_cau_seq _root_.abs
(λ n, (range n).sum (λ m, abs (
((-1) ^ m) * z ^ (2 * m ) / nat.fact (2 * m )))) :=
begin
sorry,
end
lemma is_cau_abs_sin (z : ℂ) : is_cau_seq _root_.abs
(λ n, (range n).sum (λ m, abs (
((-1) ^ m) * z ^ (2 * m + 1) / nat.fact (2 * m + 1)))) :=
begin
sorry,
/-
let ⟨n, hn⟩ := exists_nat_gt (abs z) in
have hn0 : (0 : ℝ) < n, from lt_of_le_of_lt (abs_nonneg _) hn,
series_ratio_test n (complex.abs z / n)
(div_nonneg_of_nonneg_of_pos (complex.abs_nonneg _) hn0)
(by rwa [div_lt_iff hn0, one_mul])
(λ m hm,
by rw [abs_abs, abs_abs, nat.fact_succ, pow_succ,
mul_comm m.succ, nat.cast_mul, ← div_div_eq_div_mul, mul_div_assoc,
mul_div_right_comm, abs_mul, abs_div, abs_cast_nat];
exact mul_le_mul_of_nonneg_right
(div_le_div_of_le_left (abs_nonneg _) hn0
(nat.cast_le.2 (le_trans hm (nat.le_succ _)))) (abs_nonneg _))
-/
end
lemma is_cau_sin (z : ℂ) :
is_cau_seq abs (λ n, (range n).sum (λ m,
((-1) ^ m) * z ^ (2 * m + 1) / nat.fact (2 * m + 1)))
:=
begin
exact is_cau_series_of_abv_cau (is_cau_abs_sin z),
end
lemma is_cau_cos (z : ℂ) :
is_cau_seq abs (λ n, (range n).sum (λ m,
((-1) ^ m) * z ^ (2 * m ) / nat.fact (2 * m)))
:=
begin
exact is_cau_series_of_abv_cau (is_cau_abs_cos z),
end
def sin' (z : ℂ) : cau_seq ℂ complex.abs :=
⟨λ n, (range n).sum
(λ m, ((-1) ^ m) * z ^ (2 * m + 1) / nat.fact (2 * m + 1)),
is_cau_sin z⟩
def sin1 (z : ℂ) : ℂ := lim (sin' z)
def cos' (z : ℂ) : cau_seq ℂ complex.abs :=
⟨λ n, (range n).sum
(λ m, (-1) ^ m * z ^ (2 * m) / nat.fact (2 * m)),
is_cau_cos z⟩
def cos1 (z : ℂ) : ℂ := lim (cos' z)
/-
lemma series_arith : --maybe take the first few terms and conjecture that the rest of the series follows?
(λ n)(λ m)
-/
theorem euler : ∀ x, exp (x * I) = cos1 x + sin1 x * I
:=
begin
intros,
-- figure out the right way to do indices here...
have partials: ∀ n:ℕ , (exp' (x*I)).1 (2*n+1) =
(cos' x).1 n + ((sin' x).1 n) * I,
{
intros,
rw exp',
simp,
rw cos',
simp,
rw sin',
simp,
induction n with n0 hn,
{ -- case n0=0
sorry,
-- simp,
},
{ -- induction on n0
rw sum_range_succ _ _,
rw sum_range_succ _ _,
rw sum_range_succ _ _,
rw hn,
simp,
ring,
/-
have l1:
sum (range (nat.succ n0)) (λ (m : ℕ),
(x * I) ^ m / ↑(nat.fact m)) =
(x * I) ^ n0 / ↑(nat.fact n0) +
sum (range ( n0)) (λ (m : ℕ),
(x * I) ^ m / ↑(nat.fact m)),
{
exact sum_range_succ _ _,
},
have l2:
sum (range (nat.succ n0)) (λ (m : ℕ),
(-1) ^ m * x ^ (2 * m) / ↑(nat.fact (2 * m))) =
(-1) ^ n0 * x ^ (2 * n0) / ↑(nat.fact (2 * n0))
+ sum (range ( n0)) (λ (m : ℕ),
(-1) ^ m * x ^ (2 * m) / ↑(nat.fact (2 * m))),
{
exact sum_range_succ _ _,
},
rw l1,
rw l2,
-/
},
/-
have sum2 : ∀ f g, (range n).sum f + (range n).sum g =
(range n).sum (f+g),
{
intros,
sorry,
},
rw sum2 ((cos' x).1) (λ k, ((sin' x).1 k) * I),
-/
}
--rw → linarith
end
end complex