\n
0
\n","line":359,"end_line":408,"proof_status":"formalized"}
{"id":"lem:discrete_orthogonality","label":"discrete_orthogonality","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":[],"nlp_text":"For any integer \\(m\\), \\begin{equation} \\sum _{k=0}^{N-1} \\mathrm{e}^{2\\pi i m k/N} = \\begin{cases} N & \\text{if } N \\mid m, \\\\ 0 & \\text{otherwise.} \\end{cases} \\end{equation}","doc_url":"../../docs/find/#doc/sum_primitive_root_pow_mul","latex_link":"sect0007.html#lem:discrete_orthogonality","lean_link":"../../docs/find/#doc/sum_primitive_root_pow_mul","lean_decl_name":"sum_primitive_root_pow_mul","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/PowerSums.lean","lean4_code":"lemma sum_primitive_root_pow_mul (N m : ℕ) (hN : 0 < N) (hm : 0 < m) (hm' : m < N) :\n let ω := Complex.exp (2 * π * Complex.I / N)\n ∑ k ∈ Finset.range N, ω ^ (k * m) = 0 := by\n intro ω\n have hN' : N ≠ 0 := Nat.pos_iff_ne_zero.mp hN\n have hω : IsPrimitiveRoot ω N := Complex.isPrimitiveRoot_exp N hN'\n conv_lhs => arg 2; ext k; rw [mul_comm k m, pow_mul]\n have h_ne_one : ω ^ m ≠ 1 := by\n intro h_eq\n have h_div : N ∣ m := (hω.pow_eq_one_iff_dvd m).mp h_eq\n have : N ≤ m := Nat.le_of_dvd hm h_div\n omega\n have h_pow_N : (ω ^ m) ^ N = 1 := by\n calc (ω ^ m) ^ N = ω ^ (m * N) := by rw [← pow_mul]\n _ = ω ^ (N * m) := by rw [mul_comm]\n _ = (ω ^ N) ^ m := by rw [← pow_mul]\n _ = 1 ^ m := by rw [hω.pow_eq_one]\n _ = 1 := one_pow m\n have h_geom : (ω ^ m - 1) * ∑ k ∈ Finset.range N, (ω ^ m) ^ k = (ω ^ m) ^ N - 1 :=\n mul_geom_sum (ω ^ m) N\n rw [h_pow_N] at h_geom\n have h_eq_zero : (ω ^ m - 1) * ∑ k ∈ Finset.range N, (ω ^ m) ^ k = 0 := by\n rw [h_geom]; ring\n exact eq_zero_of_ne_zero_of_mul_left_eq_zero (sub_ne_zero_of_ne h_ne_one) h_eq_zero\n\n/-- Sum of cosines at integer multiples of angles vanishes for non-zero integers with |m| < N. -/\n","line":193,"end_line":218,"proof_status":"formalized"}
{"id":"lem:sum_cos_m_phi_vanishes","label":"sum_cos_m_phi_vanishes","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:discrete_orthogonality"],"nlp_text":"For any integers \\(N \\geq 1\\), \\(m\\) with \\(0 {\\lt} m {\\lt} N\\), and any \\(\\theta \\in \\mathbb {R}\\), \\begin{equation} \\sum _{k=0}^{N-1} \\cos \\left(m\\left(\\theta + \\frac{2\\pi k}{N}\\right)\\right) = 0. \\end{equation}","doc_url":"../../docs/find/#doc/sum_cos_multiple_rotated_roots","latex_link":"sect0010.html#lem:sum_cos_m_phi_vanishes","lean_link":"../../docs/find/#doc/sum_cos_multiple_rotated_roots","lean_decl_name":"sum_cos_multiple_rotated_roots","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/TrigonometricIdentities.lean","lean4_code":"lemma sum_cos_multiple_rotated_roots (N : ℕ) (m : ℕ) (θ : ℝ)\n (hN : 0 < N) (hm : 0 < m) (hm' : m < N) :\n ∑ k ∈ Finset.range N, Real.cos (m * (θ + 2 * π * k / N)) = 0 := by\n conv_lhs =>\n arg 2\n ext k\n rw [← Complex.exp_ofReal_mul_I_re (m * (θ + 2 * π * k / N))]\n rw [← Complex.re_sum]\n simp only [Complex.ofReal_mul, Complex.ofReal_add, Complex.ofReal_div, Complex.ofReal_natCast]\n have hN' : N ≠ 0 := Nat.pos_iff_ne_zero.mp hN\n let ζ := Complex.exp (2 * π * I / N)\n have hζ : IsPrimitiveRoot ζ N := Complex.isPrimitiveRoot_exp N hN'\n suffices h_sum_zero : ∑ k ∈ Finset.range N, cexp (↑m * (↑2 * ↑π * ↑k / ↑N) * I) = 0 by\n simp only [mul_add, add_mul]\n conv_lhs =>\n arg 1\n arg 2\n ext x\n rw [Complex.exp_add]\n rw [← Finset.mul_sum]\n have : ∑ i ∈ Finset.range N, cexp (↑m * (↑2 * ↑π * ↑i / ↑N) * I) = 0 := h_sum_zero\n simp [this]\n calc ∑ k ∈ Finset.range N, cexp (↑m * (↑2 * ↑π * ↑k / ↑N) * I)\n = ∑ k ∈ Finset.range N, ζ ^ (m * k) := by\n congr 1 with k\n simp only [ζ]\n rw [← Complex.exp_nat_mul]\n congr 1\n field_simp\n norm_cast\n _ = ∑ k ∈ Finset.range N, (ζ ^ m) ^ k := by\n congr 1 with k\n rw [← pow_mul]\n _ = 0 := by\n have h_ne_one : ζ ^ m ≠ 1 := by\n intro h_eq\n have h_div : N ∣ m := by\n have := hζ.pow_eq_one_iff_dvd m\n exact this.mp h_eq\n have : N ≤ m := Nat.le_of_dvd (by omega) h_div\n omega\n have h_pow_N : (ζ ^ m) ^ N = 1 := by\n rw [← pow_mul, mul_comm m N, pow_mul]\n simp [hζ.pow_eq_one]\n have h_geom : (ζ ^ m - 1) * ∑ k ∈ Finset.range N, (ζ ^ m) ^ k = (ζ ^ m) ^ N - 1 :=\n mul_geom_sum (ζ ^ m) N\n rw [h_pow_N] at h_geom\n have : (ζ ^ m - 1) * ∑ k ∈ Finset.range N, (ζ ^ m) ^ k = 0 := by\n rw [h_geom]; ring\n exact eq_zero_of_ne_zero_of_mul_left_eq_zero (sub_ne_zero_of_ne h_ne_one) this\n","line":81,"end_line":130,"proof_status":"formalized"}
{"id":"lem:sum_cos_phi_vanishes","label":"sum_cos_phi_vanishes","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:discrete_orthogonality"],"nlp_text":"For any \\(N \\geq 2\\) and any \\(\\theta \\in \\mathbb {R}\\), \\begin{equation} \\sum _{k=0}^{N-1} \\cos \\left(\\theta + \\frac{2\\pi k}{N}\\right) = 0. \\end{equation}","doc_url":"../../docs/find/#doc/realProjectionsList_sum","latex_link":"sect0010.html#lem:sum_cos_phi_vanishes","lean_link":"../../docs/find/#doc/realProjectionsList_sum","lean_decl_name":"realProjectionsList_sum","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/RootsOfUnity.lean","lean4_code":"theorem realProjectionsList_sum (N : ℕ) (θ : ℝ) :\n (realProjectionsList N θ).sum = ∑ k ∈ Finset.range N, Real.cos (θ + 2 * π * k / N) := by\n rw [realProjectionsList]\n convert list_range_map_sum_eq_finset_sum N (fun k => Real.cos (θ + 2 * π * ↑k / ↑N)) using 2\n\n/-- The power sum of realProjectionsList equals the Finset power sum. -/\n","line":71,"end_line":76,"proof_status":"formalized"}
{"id":"lem:chebyshev_angle_sum_odd","label":"chebyshev_angle_sum_odd","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:discrete_orthogonality"],"nlp_text":"For odd \\(m\\) with \\(0 {\\lt} m {\\lt} N\\), \\begin{equation} \\sum _{k=0}^{N-1} \\cos \\left(m \\cdot \\frac{(2k + 1)\\pi }{2N}\\right) = 0. \\end{equation}","doc_url":"../../docs/find/#doc/ChebyshevCircles.sum_cos_chebyshev_angles_vanishes","latex_link":"sect0012.html#lem:chebyshev_angle_sum_odd","lean_link":"../../docs/find/#doc/ChebyshevCircles.sum_cos_chebyshev_angles_vanishes","lean_decl_name":"ChebyshevCircles.sum_cos_chebyshev_angles_vanishes","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/ChebyshevOrthogonality.lean","lean4_code":"lemma sum_cos_chebyshev_angles_vanishes (N : ℕ) (m : ℤ) (hN : 0 < N)\n (hm : m ≠ 0) (hm_odd : Odd m) (hm_bound : |m| < 2 * N) :\n ∑ k ∈ range N, Real.cos (m * (2 * k + 1 : ℝ) * π / (2 * N)) = 0 := by\n -- Define the term we're summing\n let f : ℕ → ℝ := fun k ↦ Real.cos (m * (2 * k + 1 : ℝ) * π / (2 * N))\n\n -- We'll show the sum vanishes by pairing terms using symmetry\n -- Key observation: θ_k + θ_{N-1-k} = (2k+1)π/(2N) + (2(N-1-k)+1)π/(2N) = π\n\n -- First, prove the pairing lemma: f(k) + f(N-1-k) = 0\n have pair_sum_zero : ∀ k ∈ range N, f k + f (N - 1 - k) = 0 := by\n intro k hk\n simp only [f]\n rw [mem_range] at hk\n have hk_le : k ≤ N - 1 := Nat.le_pred_of_lt hk\n\n -- First establish the cast identity for (N - 1 - k)\n have cast_eq : ((N - 1 - k) : ℝ) = N - 1 - k := by\n rfl\n\n -- The key insight: (2*(N-1-k)+1)*π/(2N) + (2*k+1)*π/(2N) = π\n -- So cos(m * first_angle) = cos(m*(π - second_angle)) = (-1)^m * cos(m*second_angle)\n\n -- Simplify the angle for N-1-k\n have angle_identity : (2 * (N - 1 - k : ℝ) + 1) * π /\n (2 * N) + (2 * k + 1) * π / (2 * N) = π := by\n have h2N_ne : (2 * N : ℝ) ≠ 0 := by\n have : (0 : ℝ) < N := Nat.cast_pos.mpr hN\n linarith\n rw [← add_div, ← add_mul]\n -- Show the sum of coefficients equals 2N\n have coeff_sum : 2 * (N - 1 - k : ℝ) + 1 + (2 * k + 1) = 2 * N := by\n have : (2 * (N - 1 - k) + 1 : ℕ) + (2 * k + 1) = 2 * N := by omega\n linarith\n rw [coeff_sum]\n field_simp\n\n -- Rewrite second angle as π minus first angle\n have second_angle : (2 * (N - 1 - k : ℝ) + 1) * π / (2 * N) =\n π - (2 * k + 1) * π / (2 * N) := by\n linarith [angle_identity]\n\n -- Substitute and use cosine identity\n -- Need to show the second cosine argument can be rewritten\n have key : m * (2 * ((N - 1 - k) : ℝ) + 1) * π / (2 * N) =\n m * (π - (2 * k + 1) * π / (2 * N)) := by\n calc m * (2 * (N - 1 - k : ℝ) + 1) * π / (2 * N)\n = m * ((2 * (N - 1 - k : ℝ) + 1) * π / (2 * N)) := by ring\n _ = m * (π - (2 * k + 1) * π / (2 * N)) := by rw [second_angle]\n\n","line":57,"end_line":106,"proof_status":"formalized"}
{"id":"lem:chebyshev_angle_sum_even","label":"chebyshev_angle_sum_even","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:discrete_orthogonality"],"nlp_text":"For even \\(m\\) with \\(0 {\\lt} m {\\lt} N\\), \\begin{equation} \\sum _{k=0}^{N-1} \\cos \\left(m \\cdot \\frac{(2k + 1)\\pi }{2N}\\right) = 0. \\end{equation}","doc_url":"../../docs/find/#doc/ChebyshevCircles.binomial_terms_vanish_chebyshev","latex_link":"sect0012.html#lem:chebyshev_angle_sum_even","lean_link":"../../docs/find/#doc/ChebyshevCircles.binomial_terms_vanish_chebyshev","lean_decl_name":"ChebyshevCircles.binomial_terms_vanish_chebyshev","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/ChebyshevOrthogonality.lean","lean4_code":"lemma binomial_terms_vanish_chebyshev (N j r : ℕ) (hN : 0 < N) (hj' : j < N)\n (hr : r ∈ range (j + 1)) (hr_neq : (2 * r - j : ℤ) ≠ 0) :\n ∑ k ∈ range N, Real.cos ((2 * r - j : ℤ) * (2 * k + 1 : ℝ) * π / (2 * N)) = 0 := by\n -- We need to show:\n -- 1. (2r - j) is odd\n -- 2. |2r - j| < 2N\n -- Then apply sum_cos_chebyshev_angles_vanishes\n\n -- First establish the bound: r ≤ j\n have hr_le : r ≤ j := by\n simp only [mem_range] at hr\n omega\n\n -- Split by parity of j\n by_cases h_parity : Odd j\n · -- Case 1: j is odd, so (2r - j) is odd\n have h_odd : Odd (2 * r - j : ℤ) := by\n obtain ⟨m, hm⟩ := h_parity\n use (r : ℤ) - m - 1\n have : (j : ℤ) = 2 * m + 1 := by exact_mod_cast hm\n calc (2 * r - j : ℤ)\n _ = 2 * (r : ℤ) - (2 * m + 1) := by rw [this]\n _ = 2 * ((r : ℤ) - m - 1) + 1 := by ring\n\n -- Prove |2r - j| < 2N\n have h_bound : |(2 * r - j : ℤ)| < 2 * N := by\n by_cases hr_case : 2 * r ≥ j\n · rw [abs_of_nonneg (Int.sub_nonneg_of_le (by omega : (j : ℤ) ≤ (2 * r : ℤ)))]\n calc (2 * r - j : ℤ)\n _ ≤ (2 * j - j : ℤ) := by omega\n _ = (j : ℤ) := by ring\n _ < (N : ℤ) := by omega\n _ < (2 * N : ℤ) := by omega\n · push_neg at hr_case\n rw [abs_of_neg (Int.sub_neg_of_lt (by omega : (2 * r : ℤ) < (j : ℤ)))]\n calc -(2 * r - j : ℤ)\n _ = (j - 2 * r : ℤ) := by ring\n _ ≤ (j : ℤ) := by omega\n _ < (N : ℤ) := by omega\n _ < (2 * N : ℤ) := by omega\n\n -- Apply odd vanishing lemma\n convert sum_cos_chebyshev_angles_vanishes N (2 * r - j) hN hr_neq h_odd h_bound using 2\n\n · -- Case 2: j is even, so (2r - j) is even\n have j_even : Even j := Nat.not_odd_iff_even.mp h_parity\n have h_even : Even (2 * r - j : ℤ) := by\n obtain ⟨m, hm⟩ := j_even\n use (r : ℤ) - m\n have : (j : ℤ) = (m + m : ℕ) := by simp [hm]\n","line":410,"end_line":459,"proof_status":"formalized"}
{"id":"thm:newton_identities","label":"newton_identities","background_color":"white","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:discrete_orthogonality"],"nlp_text":"The power sums and elementary symmetric polynomials are related by: \\begin{equation} k \\cdot e_k = \\sum _{i=1}^k (-1)^{i-1} e_{k-i} p_i, \\quad k = 1, 2, \\ldots , N, \\end{equation}","doc_url":"../../docs/find/#doc/esymm_eq_of_psum_eq","latex_link":"sect0008.html#thm:newton_identities","lean_link":"../../docs/find/#doc/esymm_eq_of_psum_eq","lean_decl_name":"esymm_eq_of_psum_eq","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/NewtonIdentities.lean","lean4_code":"lemma esymm_eq_of_psum_eq (s t : Multiset ℝ) (h_card : s.card = t.card)\n (h_psum : ∀ j, 0 < j → j < s.card → (s.map (· ^ j)).sum = (t.map (· ^ j)).sum) :\n ∀ m, m < s.card → s.esymm m = t.esymm m := by\n intro m hm\n -- We prove by strong induction on m\n induction m using Nat.strong_induction_on with\n | h m IH =>\n by_cases hm_zero : m = 0\n · -- Base case: esymm 0 = 1 for any multiset\n rw [hm_zero]\n simp [Multiset.esymm]\n · -- Inductive case: m > 0, use Newton's identity\n have hm_pos : 0 < m := Nat.pos_of_ne_zero hm_zero\n -- Apply Newton's identity to both s and t\n have h_newton_s := multiset_newton_identity s m hm_pos\n have h_newton_t := multiset_newton_identity t m hm_pos\n -- The RHS of Newton's identity should be equal for s and t\n have h_rhs_eq : (Finset.antidiagonal m).sum (fun a =>\n if a.1 < m then (-1)^a.1 * s.esymm a.1 * (s.map (fun x => x ^ a.2)).sum\n else 0) =\n (Finset.antidiagonal m).sum (fun a =>\n if a.1 < m then (-1)^a.1 * t.esymm a.1 * (t.map (fun x => x ^ a.2)).sum\n else 0) := by\n apply Finset.sum_congr rfl\n intro a ha\n -- a ∈ antidiagonal m means a.1 + a.2 = m\n have h_sum : a.1 + a.2 = m := Finset.mem_antidiagonal.mp ha\n split_ifs with ha_lt\n · -- When a.1 < m, show the terms are equal\n congr 1\n · congr 1 -- esymm a.1 equal by IH\n have ha1_bound : a.1 < s.card := by omega\n exact IH a.1 ha_lt ha1_bound\n · -- Power sums equal by hypothesis\n by_cases ha2_zero : a.2 = 0\n · -- When a.2 = 0, both power sums are cardinalities\n simp only [ha2_zero, pow_zero]\n -- Simplify x^0 = 1, then sum of 1s equals card\n convert_to (s.card : ℝ) = (t.card : ℝ) using 1 <;>\n simp\n exact_mod_cast h_card\n · have ha2_pos : 0 < a.2 := Nat.pos_of_ne_zero ha2_zero\n have ha2_bound : a.2 < s.card := by omega\n exact h_psum a.2 ha2_pos ha2_bound\n · rfl\n -- Now use Newton's identity to extract esymm m\n have h_eq : (m : ℝ) * s.esymm m = (m : ℝ) * t.esymm m := by\n rw [h_newton_s, h_newton_t, h_rhs_eq]\n -- Cancel the factor of m\n have hm_ne_zero : (m : ℝ) ≠ 0 := by\n","line":132,"end_line":181,"proof_status":"formalized"}
{"id":"lem:power_sum_invariance","label":"power_sum_invariance","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:sum_cos_m_phi_vanishes"],"nlp_text":"For any integers \\(N \\geq 1\\), \\(j\\) with \\(1 \\leq j {\\lt} N\\), and any \\(\\theta \\in \\mathbb {R}\\), \\begin{equation} \\sum _{k=0}^{N-1} \\cos ^j\\left(\\theta + \\frac{2\\pi k}{N}\\right) \\end{equation}","doc_url":"../../docs/find/#doc/cos_cube_formula","latex_link":"sect0020.html#lem:power_sum_invariance","lean_link":"../../docs/find/#doc/cos_cube_formula","lean_decl_name":"cos_cube_formula","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/TrigonometricIdentities.lean","lean4_code":"lemma cos_cube_formula (x : ℝ) :\n Real.cos x ^ 3 = (Real.cos (3 * x) + 3 * Real.cos x) / 4 := by\n linarith [Real.cos_three_mul x]\n\n","line":133,"end_line":136,"proof_status":"formalized"}
{"id":"lem:chebyshev_roots","label":"chebyshev_roots","background_color":"#9CEC8B","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:chebyshev_angle_sum_odd","lem:chebyshev_angle_sum_even","lem:chebyshev_roots_characterization"],"nlp_text":"Let \\(\\xi _k = \\cos ((2k + 1)\\pi /(2N))\\) for \\(k = 0, \\ldots , N-1\\) denote the roots of \\(T_N(x)\\). Then for any \\(1 \\leq j {\\lt} N\\), \\begin{equation} \\sum _{k=0}^{N-1} \\xi _k^j = \\begin{cases} \\frac{N}{2^j} \\binom {j}{j/2} & \\text{if } j \\text{ is even}, \\\\ 0 & \\text{if } j \\text{ is odd.} \\end{cases} \\end{equation}","doc_url":"../../docs/find/#doc/ChebyshevCircles.sum_cos_pow_chebyshev_binomial","latex_link":"sect0027.html#lem:chebyshev_roots","lean_link":"../../docs/find/#doc/ChebyshevCircles.sum_cos_pow_chebyshev_binomial","lean_decl_name":"ChebyshevCircles.sum_cos_pow_chebyshev_binomial","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/ChebyshevOrthogonality.lean","lean4_code":"lemma sum_cos_pow_chebyshev_binomial (N j : ℕ) (_hN : 0 < N) (_hj : 0 < j) (_hj' : j < 2 * N) :\n ∑ k ∈ range N, (Real.cos ((2 * k + 1 : ℝ) * π / (2 * N))) ^ j =\n (2 : ℝ) ^ (-(j : ℤ)) * ∑ r ∈ range (j + 1), (j.choose r : ℝ) *\n ∑ k ∈ range N, Real.cos ((2 * r - j : ℤ) * (2 * k + 1 : ℝ) * π / (2 * N)) := by\n -- Follows sum_cos_pow_eq_sum_binomial from PowerSums.lean\n simp only [cos_as_exp_chebyshev]\n\n -- Pull power inside re: (z.re)^j = (z^j).re when z is real\n have h_re_pow : ∀ k, ((Complex.exp (↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I) +\n Complex.exp (-(↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I))) / 2).re ^ j =\n (((Complex.exp (↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I) +\n Complex.exp (-(↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I))) / 2) ^ j).re := by\n intro k\n set z := (Complex.exp (↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I) +\n Complex.exp (-(↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I))) / 2 with z_def\n have h_real : z.im = 0 := by\n rw [z_def]\n have h1 : (Complex.exp (↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I) +\n Complex.exp (-(↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I))).im = 0 := by\n rw [Complex.add_im, Complex.exp_ofReal_mul_I_im]\n have : (Complex.exp (-(↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I))).im =\n Real.sin (-((2 * k + 1 : ℝ) * π / (2 * N))) := by\n rw [show -(↑((2 * k + 1 : ℝ) * π / (2 * N)) * Complex.I) =\n (↑(-((2 * k + 1 : ℝ) * π / (2 * N))) : ℂ) * Complex.I by\n apply Complex.ext <;> simp]\n exact Complex.exp_ofReal_mul_I_im _\n rw [this, Real.sin_neg]\n ring\n rw [Complex.div_im, h1]\n simp\n have h_eq : z = (z.re : ℂ) := Complex.ext rfl h_real\n calc z.re ^ j\n _ = (z.re : ℂ).re ^ j := by simp\n _ = ((z.re : ℂ) ^ j).re := by simp [← Complex.ofReal_pow]\n _ = (z ^ j).re := by rw [← h_eq]\n\n conv_lhs =>\n arg 2\n ext k\n rw [h_re_pow k]\n rw [← Complex.re_sum]\n\n simp only [div_pow]\n\n rw [show ∑ x ∈ range N, (Complex.exp (↑((2 * ↑x + 1) * π / (2 * ↑N)) * Complex.I) +\n Complex.exp (-(↑((2 * ↑x + 1) * π / (2 * ↑N)) * Complex.I))) ^ j / (2 : ℂ) ^ j =\n ∑ x ∈ range N, (∑ r ∈ range (j + 1), (j.choose r : ℂ) *\n Complex.exp ((2 * r - j : ℤ) * ↑((2 * ↑x + 1) * π / (2 * ↑N)) * Complex.I)) / (2 : ℂ) ^ j by\n apply Finset.sum_congr rfl\n intro i _\n","line":194,"end_line":243,"proof_status":"formalized"}
{"id":"lem:esymm_invariant","label":"esymm_invariant","background_color":"#9CEC8B","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["thm:newton_identities","lem:power_sum_invariance"],"nlp_text":"Let \\(r_k(\\theta ) = \\cos (\\theta + 2\\pi k/N)\\) for \\(k = 0, \\ldots , N-1\\). Then for any \\(m\\) with \\(1 \\leq m \\leq N\\), the elementary symmetric polynomial \\begin{equation} e_m(r_0(\\theta ), \\ldots , r_{N-1}(\\theta )) \\end{equation}","doc_url":"../../docs/find/#doc/esymm_rotated_roots_invariant","latex_link":"sect0022.html#lem:esymm_invariant","lean_link":"../../docs/find/#doc/esymm_rotated_roots_invariant","lean_decl_name":"esymm_rotated_roots_invariant","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/NewtonIdentities.lean","lean4_code":"lemma esymm_rotated_roots_invariant (N : ℕ) (m : ℕ) (θ₁ θ₂ : ℝ)\n (hN : 0 < N) (hm : 0 < m) (hm' : m < N) :\n let l1 := (realProjectionsList N θ₁ : Multiset ℝ)\n let l2 := (realProjectionsList N θ₂ : Multiset ℝ)\n l1.esymm m = l2.esymm m := by\n intro l1 l2\n induction m using Nat.strong_induction_on with\n | h k IH =>\n cases k with\n | zero => omega\n | succ k' =>\n cases k' with\n | zero =>\n -- N ≥ 2, so sum of cosines at N equally spaced angles = 0\n -- esymm 1 is the sum, and both sums equal 0\n rw [multiset_esymm_one_eq_sum, multiset_esymm_one_eq_sum]\n simp only [l1, l2]\n have hN2 : 2 ≤ N := by omega\n rw [multiset_coe_realProjectionsList_sum, multiset_coe_realProjectionsList_sum]\n rw [sum_cos_roots_of_unity N θ₁ hN2, sum_cos_roots_of_unity N θ₂ hN2]\n | succ k'' =>\n -- Use Newton's identity to express esymm (k''+2) in terms of smaller esymm and power sums\n have h_newton_l1 := multiset_newton_identity l1 (k'' + 2) (by omega)\n have h_newton_l2 := multiset_newton_identity l2 (k'' + 2) (by omega)\n\n -- The RHS of Newton's identity is the same for l1 and l2\n have h_rhs_eq : (Finset.antidiagonal (k'' + 2)).sum (fun a =>\n if a.1 < k'' + 2 then (-1)^a.1 * l1.esymm a.1 * (l1.map (fun x => x ^ a.2)).sum\n else 0) =\n (Finset.antidiagonal (k'' + 2)).sum (fun a =>\n if a.1 < k'' + 2 then (-1)^a.1 * l2.esymm a.1 * (l2.map (fun x => x ^ a.2)).sum\n else 0) := by\n -- Each term in the sum is equal\n apply Finset.sum_congr rfl\n intro a ha_mem\n -- a ∈ antidiagonal (k'' + 2), so a.1 + a.2 = k'' + 2\n have h_sum : a.1 + a.2 = k'' + 2 := Finset.mem_antidiagonal.mp ha_mem\n split_ifs with ha\n · -- When a.1 < k'' + 2, we need to show the terms are equal\n congr 1\n · -- esymm a.1 is invariant by IH\n by_cases ha0 : a.1 = 0\n · simp only [ha0, pow_zero, one_mul]\n -- esymm 0 = 1 for any multiset\n simp only [Multiset.esymm, Multiset.powersetCard_zero_left]\n · have ha_pos : 0 < a.1 := Nat.pos_of_ne_zero ha0\n -- Need to show a.1 < N\n have ha_N : a.1 < N := by\n calc a.1\n _ < k'' + 2 := ha\n","line":238,"end_line":287,"proof_status":"formalized"}
{"id":"cor:power_sums_determine_coefficients","label":"power_sums_determine_coefficients","background_color":"#9CEC8B","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["thm:newton_identities"],"nlp_text":"Let \\(\\alpha _1, \\ldots , \\alpha _N\\) and \\(\\beta _1, \\ldots , \\beta _N\\) be two collections of numbers. If \\begin{equation} \\sum _{i=1}^N \\alpha _i^j = \\sum _{i=1}^N \\beta _i^j \\quad \\text{for all } j = 1, 2, \\ldots , N, \\end{equation}","doc_url":"../../docs/find/#doc/Multiset.prod_X_sub_C_coeff","latex_link":"sect0008.html#cor:power_sums_determine_coefficients","lean_link":"../../docs/find/#doc/Multiset.prod_X_sub_C_coeff","lean_decl_name":"Multiset.prod_X_sub_C_coeff","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":null,"lean4_code":null,"line":30,"end_line":30,"proof_status":"formalized"}
{"id":"thm:power_sum_equality","label":"power_sum_equality","background_color":"#9CEC8B","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:power_sum_invariance","lem:chebyshev_roots"],"nlp_text":"For \\(1 \\leq j {\\lt} N\\), \\begin{equation} \\sum _{k=0}^{N-1} \\cos ^j\\left(\\theta + \\frac{2\\pi k}{N}\\right) = \\sum _{k=0}^{N-1} \\cos ^j\\left(\\frac{(2k + 1)\\pi }{2N}\\right). \\end{equation}","doc_url":"../../docs/find/#doc/general_powersum_equality","latex_link":"sect0027.html#thm:power_sum_equality","lean_link":"../../docs/find/#doc/general_powersum_equality","lean_decl_name":"general_powersum_equality","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/PowerSumEquality.lean","lean4_code":"theorem general_powersum_equality (N j : ℕ) (hN : 0 < N) (hj : 0 < j) (hj' : j < N) :\n ∑ k ∈ Finset.range N, (Real.cos (2 * π * k / N)) ^ j =\n ∑ k ∈ Finset.range N, (Real.cos ((2 * k + 1 : ℝ) * π / (2 * N))) ^ j := by\n -- Both sums equal the same closed-form expression\n rw [rotated_roots_powersum_value N j hN hj hj']\n rw [chebyshev_roots_powersum_value N j hN hj hj']\n\nend PowerSumEquality\n\n","line":264,"end_line":272,"proof_status":"formalized"}
{"id":"thm:coefficients_independent","label":"coefficients_independent","background_color":"#9CEC8B","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["lem:esymm_invariant","cor:power_sums_determine_coefficients"],"nlp_text":"For any \\(N \\geq 1\\) and any \\(k\\) with \\(1 \\leq k \\leq N\\), the coefficient of \\(x^k\\) in \\(S_N(x; \\theta )\\) is independent of \\(\\theta \\). (See Theorem 5.1 in ../paper/chebyshev_circles.pdfthe paper)","doc_url":"../../docs/find/#doc/constant_term_only_varies","latex_link":"sect0022.html#thm:coefficients_independent","lean_link":"../../docs/find/#doc/constant_term_only_varies","lean_decl_name":"constant_term_only_varies","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/PolynomialProperties.lean","lean4_code":"theorem constant_term_only_varies (N : ℕ) (θ₁ θ₂ : ℝ) (k : ℕ) (hN : 0 < N)\n (hk : 0 < k) : (scaledPolynomial N θ₁).coeff k = (scaledPolynomial N θ₂).coeff k := by\n unfold scaledPolynomial unscaledPolynomial polynomialFromRealRoots\n simp only [coeff_C_mul]\n congr 1\n -- Convert to multiset form\n rw [list_foldr_eq_multiset_prod, list_foldr_eq_multiset_prod]\n -- Factor out the card lemma\n have h_card (θ : ℝ) : ((realProjectionsList N θ : Multiset ℝ)).card = N := by\n rw [Multiset.coe_card, card_realProjectionsList]\n -- Split cases\n by_cases hk_le : k ≤ N\n · -- k ≤ N: use Vieta's formula\n rw [Multiset.prod_X_sub_C_coeff (realProjectionsList N θ₁ : Multiset ℝ) (by rwa [h_card]),\n Multiset.prod_X_sub_C_coeff (realProjectionsList N θ₂ : Multiset ℝ) (by rwa [h_card])]\n congr 1\n · rw [h_card, h_card]\n · by_cases hk_eq : k = N\n · rw [hk_eq, h_card, h_card]; norm_num [Multiset.esymm, Multiset.powersetCard_zero_left]\n · rw [h_card, h_card]\n exact esymm_rotated_roots_invariant N (N - k) θ₁ θ₂ hN (by omega) (by omega)\n · -- k > N: both coefficients are 0\n have deg (θ : ℝ) : (Multiset.map (fun r => X - C r)\n (realProjectionsList N θ : Multiset ℝ)).prod.natDegree = N := by\n rw [Polynomial.natDegree_multiset_prod_X_sub_C_eq_card, h_card]\n rw [Polynomial.coeff_eq_zero_of_natDegree_lt, Polynomial.coeff_eq_zero_of_natDegree_lt]\n · rw [deg]; omega\n · rw [deg]; omega\n\n/-- The Chebyshev polynomial T_N has degree N for N ≥ 1. -/\n","line":39,"end_line":68,"proof_status":"formalized"}
{"id":"prop:chebyshev_properties","label":"chebyshev_properties","background_color":"white","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":[],"nlp_text":"The Chebyshev polynomials satisfy the following properties: Recurrence: \\(T_{n+1}(x) = 2xT_n(x) - T_{n-1}(x)\\) for \\(n \\geq 1\\). Leading coefficient: The leading coefficient of \\(T_N(x)\\) is \\(2^{N-1}\\) for \\(N \\geq 1\\). Roots: The roots of \\(T_N(x)\\) are \"> \\begin{equation} \\label{eq:chebyshev_roots} x_k = \\cos \\left(\\frac{(2k + 1)\\pi }{2N}\\right), \\quad k = 0, 1, \\ldots , N-1. \\end{equation}","doc_url":"../../docs/find/#doc/Polynomial.Chebyshev.T","latex_link":"sect0006.html#prop:chebyshev_properties","lean_link":"../../docs/find/#doc/Polynomial.Chebyshev.T","lean_decl_name":"Polynomial.Chebyshev.T","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":null,"lean4_code":null,"line":31,"end_line":31,"proof_status":"formalized"}
{"id":"lem:chebyshev_roots_characterization","label":"chebyshev_roots_characterization","background_color":"#9CEC8B","border_color":"green","kind":"ellipse","dep_graph_url":"https://e-vergo.github.io/ChebyshevCircles/blueprint/dep_graph_document.html","dependencies":["prop:chebyshev_properties"],"nlp_text":"The roots of the Chebyshev polynomial \\(T_N(x)\\) are \\begin{equation} \\xi _k = \\cos \\left(\\frac{(2k + 1)\\pi }{2N}\\right), \\quad k = 0, 1, \\ldots , N-1. \\end{equation}","doc_url":"../../docs/find/#doc/chebyshevRoot_in_Icc","latex_link":"sect0025.html#lem:chebyshev_roots_characterization","lean_link":"../../docs/find/#doc/chebyshevRoot_in_Icc","lean_decl_name":"chebyshevRoot_in_Icc","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"ChebyshevCircles","source_path":"./ChebyshevCircles/Proofs/ChebyshevRoots.lean","lean4_code":"lemma chebyshevRoot_in_Icc (N k : ℕ) : chebyshevRoot N k ∈ Set.Icc (-1) 1 := by\n unfold chebyshevRoot\n exact Real.cos_mem_Icc _\n\n/-- Backward direction: T_N(cos((2k+1)π/(2N))) = 0 -/\n","line":37,"end_line":41,"proof_status":"formalized"}