Even Chebyshev Angle Sum Vanishes

StatusFully Proven
TypeTheorem
ModuleChebyshevCircles.Proofs.ChebyshevOrthogonality

Statement

Theorem 3.2.2

For even $m$ with $0 < m < N$, $\sum_{k=0}^{N-1} \cos\!\left(m \cdot \frac{(2k+1)\pi}{2N}\right) = 0$.

theorem sum_cos_chebyshev_angles_even_vanishes (N m : )
    (hN : 0 < N) (hm : 0 < m) (hm_even : Even m) (hm_bound : m < N) :
     k  range N, Real.cos (m * (2 * k + 1 : ) * π / (2 * N)) = 0 := by
Proof

Write $m = 2s$, convert to complex exponentials, factor out the common phase $e^{is\pi/N}$, and recognize the remaining sum as $\sum_{k=0}^{N-1} \omega^{sk}$ where $\omega = e^{2\pi i/N}$ is a primitive $N$-th root. Since $0 < s < N$, the geometric sum vanishes by discrete orthogonality.


  -- Extract s from m = 2s
  obtain s, hs := hm_even
  rw [hs]

  -- Bound on s
  have hs_pos : 0 < s := by omega
  have hs_bound : s < N := by omega

  -- First convert s + s to 2 * s
  conv_lhs => arg 2; ext k; arg 1; rw [show (s + s : ) = 2 * s by omega]

  -- Push down the cast and simplify
  conv_lhs => arg 2; ext k; arg 1; rw [show ((2 * s : ) : ) = 2 * (s : ) by norm_cast]

  -- Simplify 2s * (2k+1) * π / (2N) = s * (2k+1) * π / N
  conv_lhs => arg 2; ext k; arg 1; rw [show (2 * (s : )) * (2 * k + 1 : ) * π / (2 * N) =
      (s : ) * (2 * k + 1 : ) * π / N by field_simp]

  -- Now prove: ∑ k, cos(s*(2k+1)*π/N) = 0 using complex exponentials
  -- First prove the complex exponential sum is zero
  have geom_sum_zero :  k  range N, Complex.exp ((s * k : ) * (2 * π * Complex.I / N)) = 0 := by
    -- Let ω = exp(2πi/N), primitive N-th root
    let ω := Complex.exp (2 * π * Complex.I / N)
    have ω_prim : IsPrimitiveRoot ω N := Complex.isPrimitiveRoot_exp N (by omega)

    -- Rewrite as sum of powers of ω^s
    have h_rewrite :  k  range N, Complex.exp ((s * k : ) * (2 * π * Complex.I / N)) =
         k  range N, ω ^ (s * k) := by
      refine Finset.sum_congr rfl fun k _ => ?_
      rw [ Complex.exp_nat_mul]
    rw [h_rewrite]

    conv_lhs =>
      arg 2
      ext k
      rw [pow_mul]

    -- Show ω^s ≠ 1
    have ωs_ne_one : ω ^ s  1 := by
      intro h_eq
      have h_div : N  s := (ω_prim.pow_eq_one_iff_dvd s).mp h_eq
      have : N  s := Nat.le_of_dvd hs_pos h_div
      omega

    -- Show (ω^s)^N = 1
    have ωs_pow_N : (ω ^ s) ^ N = 1 := by
      rw [ pow_mul, mul_comm, pow_mul, ω_prim.pow_eq_one, one_pow]

    -- Geometric sum
    have h_geom : (ω ^ s - 1) *  k  range N, (ω ^ s) ^ k = (ω ^ s) ^ N - 1 :=
      mul_geom_sum (ω ^ s) N
    rw [ωs_pow_N] at h_geom
    have : (ω ^ s - 1) *  k  range N, (ω ^ s) ^ k = 0 := by
      rw [h_geom]; ring
    exact eq_zero_of_ne_zero_of_mul_left_eq_zero (sub_ne_zero_of_ne ωs_ne_one) this

  have complex_sum :
       k  range N, Complex.exp (Complex.I * ((s : ) * (2 * k + 1) * π / N)) = 0 := by
    -- Factor: s*(2k+1)*π/N = s*π/N + s*2k*π/N
    calc  k  range N, Complex.exp (Complex.I * ((s : ) * (2 * k + 1) * π / N))
        =  k  range N, Complex.exp (Complex.I * (s : ) * π / N) *
            Complex.exp (Complex.I * ((s : ) * (2 * k) * π / N)) := by
          refine Finset.sum_congr rfl fun k _ => ?_
          rw [ Complex.exp_add]
          congr 1
          push_cast
          ring
      _ = Complex.exp (Complex.I * (s : ) * π / N) *
             k  range N, Complex.exp (Complex.I * ((s : ) * (2 * k) * π / N)) := by
          rw [Finset.mul_sum]
      _ = Complex.exp (Complex.I * (s : ) * π / N) *
             k  range N, Complex.exp ((s * k : ) * (2 * π * Complex.I / N)) := by
          congr 2
          funext k
          congr 1
          push_cast
          ring
      _ = Complex.exp (Complex.I * (s : ) * π / N) * 0 := by rw [geom_sum_zero]
      _ = 0 := by simp

  -- Convert cosine to exponential and use complex_sum
  have cos_eq :  k : , Real.cos ((s : ) * (2 * k + 1) * π / N) =
      (Complex.exp (Complex.I * ((s : ) * (2 * k + 1) * π / N))).re := by
    intro k
    have h1 : (Complex.I * (((s : ) * (2 * k + 1) * π / N) : )) =
        ((((s : ) * (2 * k + 1) * π / N) : ) : ) * Complex.I := by
      push_cast
      ring
    rw [show (Complex.I * ((s : ) * (2 * k + 1) * π / N) : ) =
        Complex.I * (((s : ) * (2 * k + 1) * π / N) : ) by push_cast; rfl]
    rw [h1]
    exact (Complex.exp_ofReal_mul_I_re _).symm

  simp_rw [cos_eq]
  rw [ Complex.re_sum, complex_sum]
  simp

Dependencies (uses)

None

Neighborhood

Legend
Not Ready
Work in Progress
Sorry (theorems only)
Proven/Defined
Fully Proven (theorems only)
Axiom
Mathlib Ready
Theorems/Lemmas
Definitions
Axioms