Skip to content

Commit f09f967

Browse files
committed
feat: inequalities on complex exponentials (#20844)
Two inequalities on complex exponentials: ```lean abs (cexp x - ∑ m ∈ range n, x ^ m / m.factorial) ≤ Real.exp (abs x) - ∑ m ∈ range n, (abs x) ^ m / m.factorial abs (cexp x - ∑ m ∈ range n, x ^ m / m.factorial) ≤ abs x ^ n * Real.exp (abs x) ```
1 parent 68ea7d2 commit f09f967

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

Mathlib/Data/Complex/Exponential.lean

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,71 @@ theorem abs_exp_sub_one_sub_id_le {x : ℂ} (hx : abs x ≤ 1) : abs (exp x - 1
11751175
_ ≤ abs x ^ 2 * 1 := by gcongr; norm_num [Nat.factorial]
11761176
_ = abs x ^ 2 := by rw [mul_one]
11771177

1178+
lemma abs_exp_sub_sum_le_exp_abs_sub_sum (x : ℂ) (n : ℕ) :
1179+
abs (exp x - ∑ m ∈ range n, x ^ m / m.factorial)
1180+
≤ Real.exp (abs x) - ∑ m ∈ range n, (abs x) ^ m / m.factorial := by
1181+
rw [← CauSeq.lim_const (abv := Complex.abs) (∑ m ∈ range n, _), Complex.exp, sub_eq_add_neg,
1182+
← CauSeq.lim_neg, CauSeq.lim_add, ← lim_abs]
1183+
refine CauSeq.lim_le (CauSeq.le_of_exists ⟨n, fun j hj => ?_⟩)
1184+
simp_rw [← sub_eq_add_neg]
1185+
calc abs ((∑ m ∈ range j, x ^ m / m.factorial) - ∑ m ∈ range n, x ^ m / m.factorial)
1186+
_ ≤ (∑ m ∈ range j, abs x ^ m / m.factorial) - ∑ m ∈ range n, abs x ^ m / m.factorial := by
1187+
rw [sum_range_sub_sum_range hj, sum_range_sub_sum_range hj]
1188+
refine (IsAbsoluteValue.abv_sum Complex.abs ..).trans_eq ?_
1189+
congr with i
1190+
simp
1191+
_ ≤ Real.exp (abs x) - ∑ m ∈ range n, (abs x) ^ m / m.factorial := by
1192+
gcongr
1193+
exact Real.sum_le_exp_of_nonneg (by exact AbsoluteValue.nonneg abs x) _
1194+
1195+
lemma abs_exp_le_exp_abs (x : ℂ) : abs (exp x) ≤ Real.exp (abs x) := by
1196+
convert abs_exp_sub_sum_le_exp_abs_sub_sum x 0 using 1 <;> simp
1197+
1198+
lemma abs_exp_sub_sum_le_abs_mul_exp (x : ℂ) (n : ℕ) :
1199+
abs (exp x - ∑ m ∈ range n, x ^ m / m.factorial) ≤ abs x ^ n * Real.exp (abs x) := by
1200+
rw [← CauSeq.lim_const (abv := Complex.abs) (∑ m ∈ range n, _), Complex.exp, sub_eq_add_neg,
1201+
← CauSeq.lim_neg, CauSeq.lim_add, ← lim_abs]
1202+
refine CauSeq.lim_le (CauSeq.le_of_exists ⟨n, fun j hj => ?_⟩)
1203+
simp_rw [← sub_eq_add_neg]
1204+
show abs ((∑ m ∈ range j, x ^ m / m.factorial) - ∑ m ∈ range n, x ^ m / m.factorial) ≤ _
1205+
rw [sum_range_sub_sum_range hj]
1206+
calc
1207+
abs (∑ m ∈ range j with n ≤ m, (x ^ m / m.factorial : ℂ))
1208+
= abs (∑ m ∈ range j with n ≤ m, (x ^ n * (x ^ (m - n) / m.factorial) : ℂ)) := by
1209+
refine congr_arg abs (sum_congr rfl fun m hm => ?_)
1210+
rw [mem_filter, mem_range] at hm
1211+
rw [← mul_div_assoc, ← pow_add, add_tsub_cancel_of_le hm.2]
1212+
_ ≤ ∑ m ∈ range j with n ≤ m, abs (x ^ n * (x ^ (m - n) / m.factorial)) :=
1213+
IsAbsoluteValue.abv_sum Complex.abs ..
1214+
_ ≤ ∑ m ∈ range j with n ≤ m, abs x ^ n * (abs x ^ (m - n) / (m - n).factorial) := by
1215+
simp_rw [map_mul, map_pow, map_div₀, abs_natCast]
1216+
gcongr with i hi
1217+
· rw [IsAbsoluteValue.abv_pow abs]
1218+
· simp
1219+
_ = abs x ^ n * ∑ m ∈ range j with n ≤ m, (abs x ^ (m - n) / (m - n).factorial) := by
1220+
rw [← mul_sum]
1221+
_ = abs x ^ n * ∑ m ∈ range (j - n), (abs x ^ m / m.factorial) := by
1222+
congr 1
1223+
refine (sum_bij (fun m hm ↦ m + n) ?_ ?_ ?_ ?_).symm
1224+
· intro a ha
1225+
simp only [mem_filter, mem_range, le_add_iff_nonneg_left, zero_le, and_true]
1226+
simp only [mem_range] at ha
1227+
rwa [← lt_tsub_iff_right]
1228+
· intro a ha b hb hab
1229+
simpa using hab
1230+
· intro b hb
1231+
simp only [mem_range, exists_prop]
1232+
simp only [mem_filter, mem_range] at hb
1233+
refine ⟨b - n, ?_, ?_⟩
1234+
· rw [tsub_lt_tsub_iff_right hb.2]
1235+
exact hb.1
1236+
· rw [tsub_add_cancel_of_le hb.2]
1237+
· simp
1238+
_ ≤ abs x ^ n * Real.exp (abs x) := by
1239+
gcongr
1240+
refine Real.sum_le_exp_of_nonneg ?_ _
1241+
exact AbsoluteValue.nonneg abs x
1242+
11781243
end Complex
11791244

11801245
namespace Real

0 commit comments

Comments
 (0)