Skip to content

Commit f6f4dd5

Browse files
committed
feat(Analysis/Complex/ExponentialBounds): round e = 3 (leanprover-community#33440)
Also adds `2 < e < 3` and `e⁻¹ < 1/2` that might be more easily applicable than the stronger approximations.
1 parent 8160e37 commit f6f4dd5

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

Mathlib/Analysis/Complex/ExponentialBounds.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ theorem exp_one_gt_d9 : 2.7182818283 < exp 1 :=
3737
theorem exp_one_lt_d9 : exp 1 < 2.7182818286 :=
3838
lt_of_le_of_lt (sub_le_iff_le_add.1 (abs_sub_le_iff.1 exp_one_near_10).1) (by norm_num)
3939

40+
theorem exp_one_gt_two : 2 < exp 1 :=
41+
lt_trans (by norm_num) exp_one_gt_d9
42+
43+
theorem exp_one_lt_three : exp 1 < 3 :=
44+
lt_trans exp_one_lt_d9 (by norm_num)
45+
46+
theorem floor_exp_one_eq_two : ⌊exp 1⌋ = 2 :=
47+
Int.floor_eq_iff.mpr ⟨exp_one_gt_two.le, by exact_mod_cast exp_one_lt_three⟩
48+
49+
theorem ceil_exp_one_eq_three : ⌈exp 1⌉ = 3 :=
50+
Int.ceil_eq_iff.mpr ⟨by exact_mod_cast exp_one_gt_two, exp_one_lt_three.le⟩
51+
52+
theorem round_exp_one_eq_three : round (exp 1) = 3 := by
53+
refine round_eq _ |>.trans <| Int.floor_eq_iff.mpr ⟨?_, by grind [exp_one_lt_three]⟩
54+
grw [← exp_one_gt_d9]
55+
norm_num
56+
4057
theorem exp_neg_one_gt_d9 : 0.36787944116 < exp (-1) := by
4158
rw [exp_neg, lt_inv_comm₀ _ (exp_pos _)]
4259
· refine lt_of_le_of_lt (sub_le_iff_le_add.1 (abs_sub_le_iff.1 exp_one_near_10).1) ?_
@@ -47,6 +64,9 @@ theorem exp_neg_one_lt_d9 : exp (-1) < 0.3678794412 := by
4764
rw [exp_neg, inv_lt_comm₀ (exp_pos _) (by norm_num)]
4865
exact lt_of_lt_of_le (by norm_num) (sub_le_comm.1 (abs_sub_le_iff.1 exp_one_near_10).2)
4966

67+
theorem exp_neg_one_lt_half : exp (-1) < 1 / 2 :=
68+
lt_trans exp_neg_one_lt_d9 (by norm_num)
69+
5070
theorem log_two_near_10 : |log 2 - 287209 / 414355| ≤ 1 / 10 ^ 10 := by
5171
suffices |log 2 - 287209 / 414355| ≤ 1 / 17179869184 + (1 / 10 ^ 10 - 1 / 2 ^ 34) by
5272
norm_num1 at *

Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ theorem le_sqrt_log (hN : 4096 ≤ N) : log (2 / (1 - 2 / exp 1)) * (69 / 50)
293293
_ ≤ log (2 ^ 3) * (69 / 50) := by
294294
gcongr
295295
· field_simp
296-
simp (disch := positivity) [show 2 < Real.exp 1 from lt_trans (by norm_num1) exp_one_gt_d9]
296+
simp (disch := positivity) [exp_one_gt_two]
297297
· norm_num1
298298
exact two_div_one_sub_two_div_e_le_eight
299299
_ ≤ √(log (2 ^ 12)) := by
@@ -319,7 +319,7 @@ theorem div_lt_floor {x : ℝ} (hx : 2 / (1 - 2 / exp 1) ≤ x) : x / exp 1 < (
319319
apply lt_of_le_of_lt _ (sub_one_lt_floor _)
320320
have : 0 < 1 - 2 / exp 1 := by
321321
rw [sub_pos, div_lt_one (exp_pos _)]
322-
exact lt_of_le_of_lt (by norm_num) exp_one_gt_d9
322+
exact exp_one_gt_two
323323
rwa [le_sub_comm, div_eq_mul_one_div x, div_eq_mul_one_div x, ← mul_sub, div_sub', ←
324324
div_eq_mul_one_div, mul_div_assoc', one_le_div, ← div_le_iff₀ this]
325325
· exact zero_lt_two
@@ -414,7 +414,7 @@ theorem bound (hN : 4096 ≤ N) : (N : ℝ) ^ (nValue N : ℝ)⁻¹ / exp 1 < dV
414414
exact hN.trans_lt' (by norm_num1)
415415
· refine div_pos zero_lt_two ?_
416416
rw [sub_pos, div_lt_one (exp_pos _)]
417-
exact lt_of_le_of_lt (by norm_num1) exp_one_gt_d9
417+
exact exp_one_gt_two
418418
positivity
419419

420420
theorem roth_lower_bound_explicit (hN : 4096 ≤ N) :

0 commit comments

Comments
 (0)