Non-Constant Binomial Terms Vanish for Chebyshev Angles
StatusFully Proven
TypeTheorem
ModuleChebyshevCircles.Proofs.ChebyshevOrthogonality
Statement
For $0 < j < N$, $0 \leq r \leq j$, and $(2r - j) \neq 0$, $\sum_{k=0}^{N-1} \cos\!\left(\frac{(2r-j)(2k+1)\pi}{2N}\right) = 0$. The proof splits by parity of $j$: when $j$ is odd, $(2r-j)$ is odd and the odd vanishing lemma applies; when $j$ is even, $(2r-j)$ is even and the even vanishing lemma applies.
theorem binomial_terms_vanish_chebyshev (N j r : ℕ) (hN : 0 < N) (hj' : j < N)
(hr : r ∈ range (j + 1)) (hr_neq : (2 * r - j : ℤ) ≠ 0) :
∑ k ∈ range N, Real.cos ((2 * r - j : ℤ) * (2 * k + 1 : ℝ) * π / (2 * N)) = 0 := by
Proof
Case split on the parity of $j$. In each case, verify the bound $|2r-j| < 2N$ (or $|2r-j| < N$ for the even case) and apply the corresponding vanishing lemma. The negative even case uses $\cos(-x) = \cos(x)$.
-- We need to show:
-- 1. (2r - j) is odd
-- 2. |2r - j| < 2N
-- Then apply sum_cos_chebyshev_angles_vanishes
-- First establish the bound: r ≤ j
have hr_le : r ≤ j := by
simp only [mem_range] at hr
omega
-- Split by parity of j
by_cases h_parity : Odd j
· -- Case 1: j is odd, so (2r - j) is odd
have h_odd : Odd (2 * r - j : ℤ) := by
obtain ⟨m, hm⟩ := h_parity
use (r : ℤ) - m - 1
have : (j : ℤ) = 2 * m + 1 := by exact_mod_cast hm
calc (2 * r - j : ℤ)
_ = 2 * (r : ℤ) - (2 * m + 1) := by rw [this]
_ = 2 * ((r : ℤ) - m - 1) + 1 := by ring
-- Prove |2r - j| < 2N
have h_bound : |(2 * r - j : ℤ)| < 2 * N := by
by_cases hr_case : 2 * r ≥ j
· rw [abs_of_nonneg (Int.sub_nonneg_of_le (by omega : (j : ℤ) ≤ (2 * r : ℤ)))]
calc (2 * r - j : ℤ)
_ ≤ (2 * j - j : ℤ) := by omega
_ = (j : ℤ) := by ring
_ < (N : ℤ) := by omega
_ < (2 * N : ℤ) := by omega
· push_neg at hr_case
rw [abs_of_neg (Int.sub_neg_of_lt (by omega : (2 * r : ℤ) < (j : ℤ)))]
calc -(2 * r - j : ℤ)
_ = (j - 2 * r : ℤ) := by ring
_ ≤ (j : ℤ) := by omega
_ < (N : ℤ) := by omega
_ < (2 * N : ℤ) := by omega
-- Apply odd vanishing lemma
convert sum_cos_chebyshev_angles_vanishes N (2 * r - j) hN hr_neq h_odd h_bound using 2
· -- Case 2: j is even, so (2r - j) is even
have j_even : Even j := Nat.not_odd_iff_even.mp h_parity
have h_even : Even (2 * r - j : ℤ) := by
obtain ⟨m, hm⟩ := j_even
use (r : ℤ) - m
have : (j : ℤ) = (m + m : ℕ) := by simp [hm]
calc (2 * r - j : ℤ)
_ = 2 * (r : ℤ) - ((m : ℤ) + (m : ℤ)) := by rw [this]; simp
_ = 2 * (r : ℤ) - 2 * (m : ℤ) := by ring
_ = ((r : ℤ) - (m : ℤ)) + ((r : ℤ) - (m : ℤ)) := by ring
-- Convert to natural number case
-- Need to handle both positive and negative cases of (2r - j)
by_cases h_sign : 2 * r ≥ j
· -- Positive case: 2r - j ≥ 0
have h_pos : 0 ≤ (2 * r - j : ℤ) := Int.sub_nonneg_of_le (by omega : (j : ℤ) ≤ (2 * r : ℤ))
obtain ⟨m_nat, hm_nat⟩ := Int.eq_ofNat_of_zero_le h_pos
-- Show m_nat is even and bounded
have hm_even : Even m_nat := by
have := h_even
rwa [hm_nat, Int.even_coe_nat] at this
have hm_pos : 0 < m_nat := by
by_contra h
push_neg at h
have : m_nat = 0 := by omega
rw [this] at hm_nat
simp at hm_nat
omega
have hm_bound : m_nat < N := by
have : (m_nat : ℤ) < N := by
calc (m_nat : ℤ)
_ = 2 * r - j := by rw [← hm_nat]
_ ≤ 2 * j - j := by omega
_ = j := by ring
_ < N := by omega
omega
-- Apply even vanishing lemma
calc ∑ k ∈ range N, Real.cos ((2 * r - j : ℤ) * (2 * k + 1 : ℝ) * π / (2 * N))
_ = ∑ k ∈ range N, Real.cos ((m_nat : ℝ) * (2 * k + 1 : ℝ) * π / (2 * N)) := by
congr 1; ext k; congr 1
rw [hm_nat]
norm_cast
_ = 0 := sum_cos_chebyshev_angles_even_vanishes N m_nat hN hm_pos hm_even hm_bound
· -- Negative case: 2r - j < 0, use cos(-x) = cos(x)
have h_neg : (2 * r - j : ℤ) < 0 := Int.sub_neg_of_lt (by omega : (2 * r : ℤ) < (j : ℤ))
have h_pos : 0 < -(2 * r - j : ℤ) := by omega
obtain ⟨m_nat, hm_nat⟩ := Int.eq_ofNat_of_zero_le (by omega : 0 ≤ -(2 * r - j : ℤ))
-- Show m_nat is even and bounded
have hm_even : Even m_nat := by
have : Even (-(2 * r - j : ℤ)) := by
obtain ⟨k, hk⟩ := h_even
use -k
calc -(2 * r - j : ℤ)
_ = -(k + k) := by rw [hk]
_ = -k + -k := by ring
rwa [hm_nat, Int.even_coe_nat] at this
have hm_pos : 0 < m_nat := by
have : (m_nat : ℤ) ≠ 0 := by
intro h
rw [h] at hm_nat
simp at hm_nat
omega
omega
have hm_bound : m_nat < N := by
have : (m_nat : ℤ) < N := by
calc (m_nat : ℤ)
_ = -(2 * r - j) := by rw [← hm_nat]
_ = j - 2 * r := by ring
_ ≤ j := by omega
_ < N := by omega
omega
-- Apply even vanishing lemma with cos(-x) = cos(x)
calc ∑ k ∈ range N, Real.cos ((2 * r - j : ℤ) * (2 * k + 1 : ℝ) * π / (2 * N))
_ = ∑ k ∈ range N, Real.cos ((-(m_nat : ℤ)) * (2 * k + 1 : ℝ) * π / (2 * N)) := by
congr 1; ext k; congr 1
have : (2 * r - j : ℤ) = -(m_nat : ℤ) := by rw [← hm_nat]; ring
rw [this]
norm_cast
_ = ∑ k ∈ range N, Real.cos ((m_nat : ℝ) * (2 * k + 1 : ℝ) * π / (2 * N)) := by
congr 1; ext k
have : ((-(m_nat : ℤ)) * (2 * k + 1 : ℝ) * π / (2 * N) : ℝ) =
-((m_nat : ℤ) * (2 * k + 1 : ℝ) * π / (2 * N)) := by
push_cast; ring
rw [this, Real.cos_neg]
norm_cast
_ = 0 := sum_cos_chebyshev_angles_even_vanishes N m_nat hN hm_pos hm_even hm_bound
Dependencies (uses)
Dependents (used by)
Neighborhood
Legend
Not Ready
Work in Progress
Sorry (theorems only)
Proven/Defined
Fully Proven (theorems only)
Axiom
Mathlib Ready
Theorems/Lemmas
Definitions
Axioms