math / data /lean /OAI /Probability /FreeIsing /Spectral /ChebyshevRecurrence.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
7.72 kB
import Mathlib
namespace OAI
open Polynomial
namespace Problem367
section Algebra
variable {A : Type*} [Ring A]
theorem power_recurrence_of_quadratic {B Z : A}
(h : Z ^ 2 = 2 * B * Z - 1) (n : β„•) :
Z ^ (n + 2) = 2 * B * Z ^ (n + 1) - Z ^ n := by
calc
Z ^ (n + 2) = Z ^ 2 * Z ^ n := by rw [← pow_add]; congr 1; omega
_ = (2 * B * Z - 1) * Z ^ n := by rw [h]
_ = 2 * B * Z ^ (n + 1) - Z ^ n := by
rw [sub_mul, one_mul, mul_assoc, ← pow_succ']
variable [Algebra ℝ A]
theorem pow_eq_chebyshev_of_quadratic {B Z : A}
(h : Z ^ 2 = 2 * B * Z - 1) (n : β„•) :
Z ^ (n + 1) =
aeval B (Polynomial.Chebyshev.U ℝ (n : β„€)) * Z -
aeval B (Polynomial.Chebyshev.U ℝ ((n : β„€) - 1)) := by
induction n using Nat.twoStepInduction with
| zero => simp
| one => simpa [map_ofNat] using h
| more n ih0 ih1 =>
rw [show n + 2 + 1 = (n + 1) + 2 by omega,
power_recurrence_of_quadratic h, ih1, ih0]
simp only [Nat.cast_add, Nat.cast_one, Nat.cast_ofNat, add_sub_cancel_right]
rw [Polynomial.Chebyshev.U_add_two]
have hind : (n : β„€) + 2 - 1 = (n : β„€) + 1 := by omega
rw [hind]
simp only [Polynomial.Chebyshev.U_add_one]
simp only [map_sub, map_mul, map_ofNat, aeval_X]
noncomm_ring
end Algebra
theorem abs_sin_nat_mul_le (n : β„•) (x : ℝ) :
|Real.sin ((n : ℝ) * x)| ≀ (n : ℝ) * |Real.sin x| := by
induction n with
| zero => simp
| succ n ih =>
rw [Nat.cast_succ, add_mul, one_mul, Real.sin_add]
calc
|Real.sin ((n : ℝ) * x) * Real.cos x +
Real.cos ((n : ℝ) * x) * Real.sin x|
≀ |Real.sin ((n : ℝ) * x) * Real.cos x| +
|Real.cos ((n : ℝ) * x) * Real.sin x| := abs_add_le _ _
_ = |Real.sin ((n : ℝ) * x)| * |Real.cos x| +
|Real.cos ((n : ℝ) * x)| * |Real.sin x| := by rw [abs_mul, abs_mul]
_ ≀ ((n : ℝ) * |Real.sin x|) * 1 + 1 * |Real.sin x| := by
apply add_le_add
Β· exact mul_le_mul ih (Real.abs_cos_le_one x) (abs_nonneg _) (by positivity)
Β· exact mul_le_mul_of_nonneg_right (Real.abs_cos_le_one _) (abs_nonneg _)
_ = ((n : ℝ) + 1) * |Real.sin x| := by ring
theorem chebyshev_U_abs_le (n : β„•) {x : ℝ} (hx : x ∈ Set.Icc (-1) 1) :
|(Polynomial.Chebyshev.U ℝ (n : β„€)).eval x| ≀ (n : ℝ) + 1 := by
have hn : 0 ≀ (n : ℝ) + 1 := by positivity
rcases eq_or_lt_of_le hx.1 with hleft | hleft
Β· subst x
simp [abs_mul, abs_pow, abs_of_nonneg hn]
rcases eq_or_lt_of_le hx.2 with hright | hright
Β· subst x
simp [abs_of_nonneg hn]
have hsin : 0 < Real.sin (Real.arccos x) :=
Real.sin_pos_of_pos_of_lt_pi (Real.arccos_pos.mpr hright) (Real.arccos_lt_pi.mpr hleft)
have htrig := Polynomial.Chebyshev.U_real_cos (Real.arccos x) (n : β„€)
rw [Real.cos_arccos hx.1 hx.2] at htrig
have hbound := abs_sin_nat_mul_le (n + 1) (Real.arccos x)
have habs := congrArg abs htrig
simp only [abs_mul, abs_of_pos hsin, Int.cast_natCast] at habs
apply (mul_le_mul_iff_leftβ‚€ hsin).mp
rw [habs]
simpa [Nat.cast_add, Nat.cast_one, abs_of_pos hsin] using hbound
theorem chebyshev_T_abs_le (n : β„•) {x : ℝ} (hx : x ∈ Set.Icc (-1) 1) :
|(Polynomial.Chebyshev.T ℝ (n : β„€)).eval x| ≀ 1 := by
have htrig := Polynomial.Chebyshev.T_real_cos (Real.arccos x) (n : β„€)
rw [Real.cos_arccos hx.1 hx.2] at htrig
rw [htrig]
exact Real.abs_cos_le_one _
section NormedRecurrence
variable {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
theorem norm_pow_le_of_chebyshev_bound {B Z : A}
(h : Z ^ 2 = 2 * B * Z - 1)
(hU : βˆ€ n : β„•, β€–aeval B (Polynomial.Chebyshev.U ℝ (n : β„€))β€– ≀ (n : ℝ) + 1)
(n : β„•) : β€–Z ^ (n + 1)β€– ≀ ((n : ℝ) + 1) * β€–Zβ€– + n := by
have hprev : β€–aeval B (Polynomial.Chebyshev.U ℝ ((n : β„€) - 1))β€– ≀ (n : ℝ) := by
cases n with
| zero => simp
| succ n => simpa using hU n
rw [pow_eq_chebyshev_of_quadratic h]
calc
β€–aeval B (Polynomial.Chebyshev.U ℝ (n : β„€)) * Z -
aeval B (Polynomial.Chebyshev.U ℝ ((n : β„€) - 1))β€–
≀ β€–aeval B (Polynomial.Chebyshev.U ℝ (n : β„€)) * Zβ€– +
β€–aeval B (Polynomial.Chebyshev.U ℝ ((n : β„€) - 1))β€– := norm_sub_le _ _
_ ≀ (β€–aeval B (Polynomial.Chebyshev.U ℝ (n : β„€))β€– * β€–Zβ€–) + n :=
add_le_add (norm_mul_le _ _) hprev
_ ≀ ((n : ℝ) + 1) * β€–Zβ€– + n :=
add_le_add (mul_le_mul_of_nonneg_right (hU n) (norm_nonneg Z)) le_rfl
end NormedRecurrence
section NormedAlgebra
variable {A : Type*} [NormedRing A] [StarRing A] [NormedAlgebra ℝ A]
[CompleteSpace A] [NormOneClass A]
[IsometricContinuousFunctionalCalculus ℝ A IsSelfAdjoint]
theorem norm_aeval_chebyshev_U_le (n : β„•) {B : A}
(hB : IsSelfAdjoint B) (hBnorm : β€–Bβ€– ≀ 1) :
β€–aeval B (Polynomial.Chebyshev.U ℝ (n : β„€))β€– ≀ (n : ℝ) + 1 := by
rw [← cfc_polynomial _ B hB]
apply norm_cfc_le (by positivity)
intro x hx
have hxnorm : |x| ≀ 1 := by
simpa only [Real.norm_eq_abs] using (spectrum.norm_le_norm_of_mem hx).trans hBnorm
simpa only [Real.norm_eq_abs] using chebyshev_U_abs_le n (abs_le.mp hxnorm)
theorem norm_aeval_chebyshev_T_le (n : β„•) {B : A}
(hB : IsSelfAdjoint B) (hBnorm : β€–Bβ€– ≀ 1) :
β€–aeval B (Polynomial.Chebyshev.T ℝ (n : β„€))β€– ≀ 1 := by
rw [← cfc_polynomial _ B hB]
apply norm_cfc_le zero_le_one
intro x hx
have hxnorm : |x| ≀ 1 := by
simpa only [Real.norm_eq_abs] using (spectrum.norm_le_norm_of_mem hx).trans hBnorm
simpa only [Real.norm_eq_abs] using chebyshev_T_abs_le n (abs_le.mp hxnorm)
theorem norm_pow_le_of_selfAdjoint_quadratic {B Z : A}
(hB : IsSelfAdjoint B) (hBnorm : β€–Bβ€– ≀ 1)
(h : Z ^ 2 = 2 * B * Z - 1) (n : β„•) :
β€–Z ^ (n + 1)β€– ≀ ((n : ℝ) + 1) * β€–Zβ€– + n := by
exact norm_pow_le_of_chebyshev_bound h
(fun n => norm_aeval_chebyshev_U_le n hB hBnorm) n
theorem norm_pow_le_linear_of_selfAdjoint_quadratic {B Z : A}
(hB : IsSelfAdjoint B) (hBnorm : β€–Bβ€– ≀ 1)
(h : Z ^ 2 = 2 * B * Z - 1) (n : β„•) :
β€–Z ^ nβ€– ≀ (β€–Zβ€– + 1) * ((n : ℝ) + 1) := by
cases n with
| zero => simp
| succ n =>
have hn := norm_pow_le_of_selfAdjoint_quadratic hB hBnorm h n
simp only [Nat.cast_succ]
nlinarith [norm_nonneg Z]
theorem norm_scaled_pow_le_of_selfAdjoint_quadratic {B Z : A} {q : ℝ}
(hB : IsSelfAdjoint B) (hBnorm : β€–Bβ€– ≀ 1)
(h : Z ^ 2 = 2 * B * Z - 1) (hq : 0 ≀ q) (n : β„•) :
β€–(q β€’ Z) ^ nβ€– ≀ (β€–Zβ€– + 1) * ((n : ℝ) + 1) * q ^ n := by
rw [_root_.smul_pow, norm_smul, Real.norm_eq_abs, abs_pow, abs_of_nonneg hq]
calc
q ^ n * β€–Z ^ nβ€– ≀ q ^ n * ((β€–Zβ€– + 1) * ((n : ℝ) + 1)) :=
mul_le_mul_of_nonneg_left (norm_pow_le_linear_of_selfAdjoint_quadratic hB hBnorm h n)
(pow_nonneg hq n)
_ = (β€–Zβ€– + 1) * ((n : ℝ) + 1) * q ^ n := by ring
theorem summable_norm_scaled_pow_of_selfAdjoint_quadratic {B Z : A} {q : ℝ}
(hB : IsSelfAdjoint B) (hBnorm : β€–Bβ€– ≀ 1)
(h : Z ^ 2 = 2 * B * Z - 1) (hq : 0 ≀ q) (hq1 : q < 1) :
Summable (fun n : β„• => β€–(q β€’ Z) ^ nβ€–) := by
have hqnorm : β€–qβ€– < 1 := by simpa [Real.norm_eq_abs, abs_of_nonneg hq] using hq1
have hs : Summable (fun n : β„• => ((n : ℝ) + 1) * q ^ n) := by
simpa only [pow_one, add_mul, one_mul] using
(summable_pow_mul_geometric_of_norm_lt_one 1 hqnorm).add
(summable_geometric_of_norm_lt_one hqnorm)
apply Summable.of_nonneg_of_le (fun n => norm_nonneg _) (fun n =>
norm_scaled_pow_le_of_selfAdjoint_quadratic hB hBnorm h hq n)
simpa only [mul_assoc] using hs.mul_left (β€–Zβ€– + 1)
end NormedAlgebra
end Problem367
end OAI