Download data/lean/OAI/Probability/FreeIsing/Estimates/ExponentialTaylor.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.09 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Estimates/ExponentialTaylor.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/FreeIsing/Estimates/ExponentialTaylor.lean
-
curl -L -o ExponentialTaylor.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Estimates/ExponentialTaylor.lean
4.09 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace Problem367.ExponentialTaylor | |
| theorem norm_exp_I_taylor_two_le (x : β) : | |
| βComplex.exp ((x : β) * Complex.I) - 1 - (x : β) * Complex.I + | |
| (x : β) ^ 2 / 2β β€ 4 * |x| ^ 3 := by | |
| have hnorm : β(x : β) * Complex.Iβ = |x| := by simp | |
| by_cases hx : |x| β€ 1 | |
| Β· have h := Complex.exp_bound (x := (x : β) * Complex.I) | |
| (by simpa only [hnorm] using hx) (n := 3) (by norm_num) | |
| have heq : (β m β Finset.range 3, | |
| ((x : β) * Complex.I) ^ m / (m.factorial : β)) = | |
| 1 + (x : β) * Complex.I - (x : β) ^ 2 / 2 := by | |
| norm_num [Finset.sum_range_succ, mul_pow, Complex.I_sq] | |
| ring | |
| rw [heq, hnorm] at h | |
| norm_num at h | |
| have heq' : Complex.exp ((x : β) * Complex.I) - 1 - (x : β) * Complex.I + | |
| (x : β) ^ 2 / 2 = | |
| Complex.exp ((x : β) * Complex.I) - | |
| (1 + (x : β) * Complex.I - (x : β) ^ 2 / 2) := by ring | |
| rw [heq'] | |
| exact h.trans (by nlinarith [abs_nonneg x, pow_nonneg (abs_nonneg x) 3]) | |
| Β· have hx1 : 1 β€ |x| := (lt_of_not_ge hx).le | |
| have hsq : |x| β€ |x| ^ 2 := by nlinarith [abs_nonneg x] | |
| have hcube : |x| ^ 2 β€ |x| ^ 3 := by nlinarith [sq_nonneg (|x| - 1)] | |
| calc | |
| _ β€ βComplex.exp ((x : β) * Complex.I) - 1 - (x : β) * Complex.Iβ + | |
| β(x : β) ^ 2 / 2β := norm_add_le _ _ | |
| _ β€ (βComplex.exp ((x : β) * Complex.I) - 1β + | |
| β(x : β) * Complex.Iβ) + β(x : β) ^ 2 / 2β := by | |
| gcongr | |
| exact norm_sub_le _ _ | |
| _ β€ ((βComplex.exp ((x : β) * Complex.I)β + β(1 : β)β) + | |
| β(x : β) * Complex.Iβ) + β(x : β) ^ 2 / 2β := by | |
| gcongr | |
| exact norm_sub_le _ _ | |
| _ = 2 + |x| + |x| ^ 2 / 2 := by norm_num | |
| _ β€ 4 * |x| ^ 3 := by nlinarith | |
| theorem norm_exp_I_mul_taylor_two_le (a x : β) : | |
| βComplex.exp (((a * x : β) : β) * Complex.I) - 1 - | |
| ((a * x : β) : β) * Complex.I + (((a * x : β) : β) ^ 2) / 2β β€ | |
| 4 * |a| ^ 3 * |x| ^ 3 := by | |
| simpa only [abs_mul, mul_pow, mul_assoc] using norm_exp_I_taylor_two_le (a * x) | |
| theorem norm_exp_neg_sub_one_add_le_sq {x : β} (hx : 0 β€ x) : | |
| βComplex.exp ((-x : β) : β) - 1 + (x : β)β β€ x ^ 2 := by | |
| have heq : Complex.exp ((-x : β) : β) - 1 + (x : β) = | |
| ((Real.exp (-x) - 1 + x : β) : β) := by simp | |
| rw [heq, Complex.norm_real, Real.norm_eq_abs] | |
| by_cases hsmall : x β€ 1 | |
| Β· have h := Real.norm_exp_sub_one_sub_id_le (x := -x) (by simpa [abs_of_nonneg hx] using hsmall) | |
| simpa only [Real.norm_eq_abs, sub_neg_eq_add, sq_abs, neg_sq] using h | |
| Β· have hlarge : 1 β€ x := (lt_of_not_ge hsmall).le | |
| have hnonneg : 0 β€ Real.exp (-x) - 1 + x := by | |
| linarith [Real.add_one_le_exp (-x)] | |
| rw [abs_of_nonneg hnonneg] | |
| have hbound : Real.exp (-x) β€ 1 := Real.exp_le_one_iff.mpr (neg_nonpos.mpr hx) | |
| nlinarith | |
| theorem norm_recurrence_error_le_sum | |
| (z a : β β β) (e : β β β) (n : β) | |
| (ha : β k < n, βa kβ β€ 1) | |
| (he : β k < n, βz (k + 1) - a k * z kβ β€ e k) : | |
| βz n - (β k β Finset.range n, a k) * z 0β β€ | |
| β k β Finset.range n, e k := by | |
| induction n with | |
| | zero => simp | |
| | succ n ih => | |
| have hprev := ih (fun k hk => ha k (Nat.lt_succ_of_lt hk)) | |
| (fun k hk => he k (Nat.lt_succ_of_lt hk)) | |
| rw [Finset.prod_range_succ, Finset.sum_range_succ] | |
| have heq : z (n + 1) - ((β k β Finset.range n, a k) * a n) * z 0 = | |
| (z (n + 1) - a n * z n) + | |
| a n * (z n - (β k β Finset.range n, a k) * z 0) := by ring | |
| rw [heq] | |
| calc | |
| _ β€ βz (n + 1) - a n * z nβ + | |
| βa n * (z n - (β k β Finset.range n, a k) * z 0)β := norm_add_le _ _ | |
| _ β€ e n + 1 * (β k β Finset.range n, e k) := by | |
| apply add_le_add (he n (by omega)) | |
| rw [norm_mul] | |
| exact mul_le_mul (ha n (by omega)) hprev (norm_nonneg _) (by norm_num) | |
| _ = _ := by ring | |
| end Problem367.ExponentialTaylor | |
| end | |
| end OAI | |