Analysis II (Tao, 2022) -- Chapter 04 -- Section 07 -- Part 2

section Chap04section Section07

Helper for Theorem 4.7.9: division by firstPositiveSineZero : firstPositiveSineZero after the half-period shift simplifies to adding 1 / 2 : 1/2.

lemma helperForTheorem_4_7_9_shifted_division_formula (x : ) : (x + firstPositiveSineZero / 2) / firstPositiveSineZero = x / firstPositiveSineZero + (1 / 2 : ) := by have hne : firstPositiveSineZero 0 := helperForTheorem_4_7_8_firstPositiveSineZero_ne_zero have hhalf : (firstPositiveSineZero / 2) / firstPositiveSineZero = (1 / 2 : ) := by field_simp [hne] calc (x + firstPositiveSineZero / 2) / firstPositiveSineZero = x / firstPositiveSineZero + (firstPositiveSineZero / 2) / firstPositiveSineZero := by rw [add_div] _ = x / firstPositiveSineZero + (1 / 2 : ) := by rw [hhalf]

Helper for Theorem 4.7.9: integer-valuedness of the shifted quotient is equivalent to half-integer-valuedness of the original quotient.

lemma helperForTheorem_4_7_9_exists_integer_shifted_iff_half_integer (x : ) : ( n : , (x + firstPositiveSineZero / 2) / firstPositiveSineZero = (n : )) ( n : , x / firstPositiveSineZero = (n : ) + (1 / 2 : )) := by constructor · intro h rcases h with n, hn have hshift : x / firstPositiveSineZero + (1 / 2 : ) = (n : ) := by calc x / firstPositiveSineZero + (1 / 2 : ) = (x + firstPositiveSineZero / 2) / firstPositiveSineZero := by symm exact helperForTheorem_4_7_9_shifted_division_formula x _ = (n : ) := hn have hx : x / firstPositiveSineZero = (n : ) - (1 / 2 : ) := by linarith have hcast_sub : ((n - 1 : ) : ) = (n : ) - (1 : ) := by try 'simp' instead of 'simpa' Note: This linter can be disabled with `set_option linter.unnecessarySimpa false`simpa using (Int.cast_sub n 1 : ((n - 1 : ) : ) = (n : ) - (1 : )) refine n - 1, ?_ calc x / firstPositiveSineZero = (n : ) - (1 / 2 : ) := hx _ = ((n : ) - (1 : )) + (1 / 2 : ) := by ring _ = ((n - 1 : ) : ) + (1 / 2 : ) := by rw [ hcast_sub] · intro h rcases h with n, hn have hcast_add : ((n + 1 : ) : ) = (n : ) + (1 : ) := by try 'simp' instead of 'simpa' Note: This linter can be disabled with `set_option linter.unnecessarySimpa false`simpa using (Int.cast_add n 1 : ((n + 1 : ) : ) = (n : ) + (1 : )) refine n + 1, ?_ calc (x + firstPositiveSineZero / 2) / firstPositiveSineZero = x / firstPositiveSineZero + (1 / 2 : ) := helperForTheorem_4_7_9_shifted_division_formula x _ = ((n : ) + (1 / 2 : )) + (1 / 2 : ) := by rw [hn] _ = (n : ) + (1 : ) := by ring _ = ((n + 1 : ) : ) := by rw [ hcast_add]

Helper for Theorem 4.7.9: Real.cos sorry = 0 : PropReal.cos Unknown identifier `x`x = 0 is equivalent to vanishing of the shifted sine value.

lemma helperForTheorem_4_7_9_cos_zero_iff_shifted_sin_zero (x : ) : Real.cos x = 0 Real.sin (x + firstPositiveSineZero / 2) = 0 := by constructor · intro hcos rw [helperForTheorem_4_7_9_sin_shift_half_firstPositiveSineZero_eq_cos x] exact hcos · intro hsin rw [ helperForTheorem_4_7_9_sin_shift_half_firstPositiveSineZero_eq_cos x] exact hsin

Theorem 4.7.9: For every real number Unknown identifier `x`x (with Unknown identifier `π`π given by Definition 4.7.2), Real.cos sorry = 0 : PropReal.cos Unknown identifier `x`x = 0 if and only if Unknown identifier `x`sorry / sorry : ?m.5x / Unknown identifier `π`π is an integer plus 1 / 2 : (1/2).

theorem real_cos_eq_zero_iff_div_firstPositiveSineZero_half_integer (x : ) : Real.cos x = 0 n : , x / firstPositiveSineZero = (n : ) + (1 / 2 : ) := by constructor · intro hcos have hsin : Real.sin (x + firstPositiveSineZero / 2) = 0 := (helperForTheorem_4_7_9_cos_zero_iff_shifted_sin_zero x).mp hcos have hInt : n : , (x + firstPositiveSineZero / 2) / firstPositiveSineZero = (n : ) := (real_sine_eq_zero_iff_div_firstPositiveSineZero_integer (x + firstPositiveSineZero / 2)).mp hsin exact (helperForTheorem_4_7_9_exists_integer_shifted_iff_half_integer x).mp hInt · intro hHalf have hInt : n : , (x + firstPositiveSineZero / 2) / firstPositiveSineZero = (n : ) := (helperForTheorem_4_7_9_exists_integer_shifted_iff_half_integer x).mpr hHalf have hsin : Real.sin (x + firstPositiveSineZero / 2) = 0 := (real_sine_eq_zero_iff_div_firstPositiveSineZero_integer (x + firstPositiveSineZero / 2)).mpr hInt exact (helperForTheorem_4_7_9_cos_zero_iff_shifted_sin_zero x).mpr hsin

Helper for Proposition 4.7.11: the Leibniz series gives Unknown identifier `π`sorry / 4 : π / 4 for the conditional summation filter on : Type.

lemma helperForProposition_4_7_11_hasSum_alternating_inv_odd_pi_div_four_conditional : HasSum (fun n : => (((-1 : ) ^ n) / (2 * n + 1 : ))) (Real.pi / 4) (SummationFilter.conditional ) := by rw [HasSum, SummationFilter.conditional_filter_eq_map_range, Filter.tendsto_map'_iff] simpa using Real.tendsto_sum_pi_div_four

Helper for Proposition 4.7.11: the conditionally summed Leibniz identity for firstPositiveSineZero : firstPositiveSineZero (hence for Unknown identifier `π`π).

lemma helperForProposition_4_7_11_firstPositiveSineZero_eq_four_mul_conditional_tsum : firstPositiveSineZero = 4 * ∑'[SummationFilter.conditional ] n : , (((-1 : ) ^ n) / (2 * n + 1 : )) := by have htsum : (∑'[SummationFilter.conditional ] n : , (((-1 : ) ^ n) / (2 * n + 1 : ))) = Real.pi / 4 := helperForProposition_4_7_11_hasSum_alternating_inv_odd_pi_div_four_conditional.tsum_eq calc firstPositiveSineZero = Real.pi := helperForTheorem_4_7_7_firstPositiveSineZero_eq_pi _ = 4 * (Real.pi / 4) := by ring _ = 4 * ∑'[SummationFilter.conditional ] n : , (((-1 : ) ^ n) / (2 * n + 1 : )) := by rw [htsum]

Helper for Proposition 4.7.11: the odd reciprocal series is not unconditionally summable.

lemma helperForProposition_4_7_11_not_summable_inv_odd : ¬ Summable (fun n : => (1 : ) / (2 * n + 1 : )) := by intro hodd have htwoodd : Summable (fun n : => (2 : ) * ((1 : ) / (2 * n + 1 : ))) := hodd.mul_left 2 have hharmShift : Summable (fun n : => (1 : ) / ((n + 1 : ) : )) := by refine Summable.of_nonneg_of_le ?_ ?_ htwoodd · intro n positivity · intro n have hleDen : (2 * n + 1 : ) 2 * ((n + 1 : ) : ) := by have hstep : (2 * n + 1 : ) 2 * n + 2 := by linarith calc (2 * n + 1 : ) 2 * n + 2 := hstep _ = 2 * ((n + 1 : ) : ) := by rw [Nat.cast_add, Nat.cast_one] ring have hA : (0 : ) < 2 * ((n + 1 : ) : ) := by positivity have hB : (0 : ) < (2 * n + 1 : ) := by positivity have hdiv : (1 : ) / (2 * ((n + 1 : ) : )) (1 : ) / (2 * n + 1 : ) := (one_div_le_one_div hA hB).2 hleDen have hmul : (2 : ) * ((1 : ) / (2 * ((n + 1 : ) : ))) (2 : ) * ((1 : ) / (2 * n + 1 : )) := by gcongr have hrewrite : (1 : ) / ((n + 1 : ) : ) = (2 : ) * ((1 : ) / (2 * ((n + 1 : ) : ))) := by have h1 : (((n + 1 : ) : )) 0 := by positivity field_simp [h1] calc (1 : ) / ((n + 1 : ) : ) = (2 : ) * ((1 : ) / (2 * ((n + 1 : ) : ))) := hrewrite _ (2 : ) * ((1 : ) / (2 * n + 1 : )) := hmul have hharm : Summable (fun n : => (1 : ) / (n : )) := (summable_nat_add_iff (f := fun n : => (1 : ) / (n : )) 1).1 hharmShift exact Real.not_summable_one_div_natCast hharm

Helper for Proposition 4.7.11: the alternating odd-reciprocal series is not unconditionally summable.

lemma helperForProposition_4_7_11_not_summable_alternating_inv_odd : ¬ Summable (fun n : => (((-1 : ) ^ n) / (2 * n + 1 : ))) := by intro hsum have habs : Summable (fun n : => |(((-1 : ) ^ n) / (2 * n + 1 : ))|) := hsum.abs have hodd : Summable (fun n : => (1 : ) / (2 * n + 1 : )) := by refine habs.congr ?_ intro n have hden : (0 : ) < (2 * n + 1 : ) := by positivity rw [abs_div, abs_pow, abs_neg, abs_one, one_pow, abs_of_pos hden] exact helperForProposition_4_7_11_not_summable_inv_odd hodd

Helper for Proposition 4.7.11: under Lean's default unconditional tsum.{u_4, u_5} {α : Type u_4} {β : Type u_5} [AddCommMonoid α] [TopologicalSpace α] (f : β α) (L : SummationFilter β := SummationFilter.unconditional β) : αtsum, the alternating odd-reciprocal series has value 0 : 0.

lemma helperForProposition_4_7_11_tsum_alternating_inv_odd_eq_zero : (∑' n : , (((-1 : ) ^ n) / (2 * n + 1 : ))) = 0 := by exact tsum_eq_zero_of_not_summable helperForProposition_4_7_11_not_summable_alternating_inv_odd

Helper for Proposition 4.7.11: consequently, is 0 : 0 under unconditional tsum.{u_4, u_5} {α : Type u_4} {β : Type u_5} [AddCommMonoid α] [TopologicalSpace α] (f : β α) (L : SummationFilter β := SummationFilter.unconditional β) : αtsum.

lemma helperForProposition_4_7_11_four_mul_tsum_alternating_inv_odd_eq_zero : 4 * ∑' n : , (((-1 : ) ^ n) / (2 * n + 1 : )) = 0 := by rw [helperForProposition_4_7_11_tsum_alternating_inv_odd_eq_zero] ring

Helper for Proposition 4.7.11: the unconditional-series equality would force firstPositiveSineZero = 0 : PropfirstPositiveSineZero = 0.

lemma helperForProposition_4_7_11_eq_four_mul_tsum_implies_firstPositiveSineZero_eq_zero (hmain : firstPositiveSineZero = 4 * ∑' n : , (((-1 : ) ^ n) / (2 * n + 1 : ))) : firstPositiveSineZero = 0 := by calc firstPositiveSineZero = 4 * ∑' n : , (((-1 : ) ^ n) / (2 * n + 1 : )) := hmain _ = 0 := helperForProposition_4_7_11_four_mul_tsum_alternating_inv_odd_eq_zero

Helper for Proposition 4.7.11: lower bound 4 - 4 / 3 < firstPositiveSineZero : Prop4 - 4/3 < firstPositiveSineZero.

lemma helperForProposition_4_7_11_lower_bound : 4 - 4 / 3 < firstPositiveSineZero := by have hleft : (4 - 4 / 3 : ) < 3 := by norm_num have hright : (3 : ) < firstPositiveSineZero := by calc (3 : ) < Real.pi := Real.pi_gt_three _ = firstPositiveSineZero := by symm exact helperForTheorem_4_7_7_firstPositiveSineZero_eq_pi exact lt_trans hleft hright

Helper for Proposition 4.7.11: package the two stated numerical bounds into a single conjunction.

lemma helperForProposition_4_7_11_bounds_conjunction : 4 - 4 / 3 < firstPositiveSineZero firstPositiveSineZero < 4 := by exact helperForProposition_4_7_11_lower_bound, helperForProposition_4_7_11_upper_bound

Helper for Proposition 4.7.11: under unconditional tsum.{u_4, u_5} {α : Type u_4} {β : Type u_5} [AddCommMonoid α] [TopologicalSpace α] (f : β α) (L : SummationFilter β := SummationFilter.unconditional β) : αtsum, the asserted Leibniz equality would force firstPositiveSineZero = 0 : PropfirstPositiveSineZero = 0, contradicting firstPositiveSineZero = Real.pi : PropfirstPositiveSineZero = Real.pi.

lemma helperForProposition_4_7_11_not_firstPositiveSineZero_eq_four_mul_tsum_alternating_inv_odd : ¬ firstPositiveSineZero = 4 * ∑' n : , (((-1 : ) ^ n) / (2 * n + 1 : )) := by intro hmain have hzero : firstPositiveSineZero = 0 := helperForProposition_4_7_11_eq_four_mul_tsum_implies_firstPositiveSineZero_eq_zero hmain have hpi : firstPositiveSineZero = Real.pi := helperForTheorem_4_7_7_firstPositiveSineZero_eq_pi have hpi_zero : Real.pi = 0 := by calc Real.pi = firstPositiveSineZero := by symm; exact hpi _ = 0 := hzero exact Real.pi_ne_zero hpi_zero

Helper for Proposition 4.7.11: the full conjunction in the target statement is inconsistent with unconditional tsum.{u_4, u_5} {α : Type u_4} {β : Type u_5} [AddCommMonoid α] [TopologicalSpace α] (f : β α) (L : SummationFilter β := SummationFilter.unconditional β) : αtsum for this series.

lemma helperForProposition_4_7_11_not_target_conjunction : ¬ (firstPositiveSineZero = 4 * ∑' n : , (((-1 : ) ^ n) / (2 * n + 1 : )) 4 - 4 / 3 < firstPositiveSineZero firstPositiveSineZero < 4) := by intro h exact helperForProposition_4_7_11_not_firstPositiveSineZero_eq_four_mul_tsum_alternating_inv_odd h.1

Helper for Proposition 4.7.11: combining any witness of the main Leibniz equality with the proven numerical bounds yields a contradiction under unconditional tsum.{u_4, u_5} {α : Type u_4} {β : Type u_5} [AddCommMonoid α] [TopologicalSpace α] (f : β α) (L : SummationFilter β := SummationFilter.unconditional β) : αtsum.

lemma helperForProposition_4_7_11_false_of_main_conjunct_and_bounds (hmain : firstPositiveSineZero = 4 * ∑' n : , (((-1 : ) ^ n) / (2 * n + 1 : ))) (hbounds : 4 - 4 / 3 < firstPositiveSineZero firstPositiveSineZero < 4) : False := by have htarget : firstPositiveSineZero = 4 * ∑' n : , (((-1 : ) ^ n) / (2 * n + 1 : )) 4 - 4 / 3 < firstPositiveSineZero firstPositiveSineZero < 4 := hmain, hbounds exact helperForProposition_4_7_11_not_target_conjunction htarget

Proposition 4.7.11: the Leibniz series identity Unknown identifier `π`sorry = 4 * (1 - 1 / 3 + 1 / 5 - 1 / 7 + ?m.19) : Propπ = 4 * (1 - 1/3 + 1/5 - 1/7 + The '⋯' token is used by the pretty printer to indicate omitted terms, and it should not be used directly. It logs this warning and then elaborates like '_'. The presence of '⋯' in pretty printing output is controlled by the 'pp.maxSteps', 'pp.deepTerms' and 'pp.proofs' options. These options can be further adjusted using 'pp.deepTerms.threshold' and 'pp.proofs.threshold'. If this '⋯' was copied from the Infoview, the hover there for the original '⋯' explains which of these options led to the omission.) holds in Lean via the conditional summation filter on : Type; in particular, .

theorem firstPositiveSineZero_eq_four_mul_tsum_alternating_inv_odd_and_bounds : firstPositiveSineZero = 4 * ∑'[SummationFilter.conditional ] n : , (((-1 : ) ^ n) / (2 * n + 1 : )) 4 - 4 / 3 < firstPositiveSineZero firstPositiveSineZero < 4 := by exact helperForProposition_4_7_11_firstPositiveSineZero_eq_four_mul_conditional_tsum, helperForProposition_4_7_11_bounds_conjunction

Helper for Proposition 4.7.12: each summand in the scaled cosine series is continuous.

lemma helperForProposition_4_7_12_termContinuous (n : ) : Continuous (fun x : => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x)) := by have hmulx : Continuous (fun x : => ((32 : ) ^ (n + 1)) * firstPositiveSineZero * x) := by exact continuous_const.mul continuous_id exact continuous_const.mul (Real.continuous_cos.comp hmulx)

Helper for Proposition 4.7.12: the geometric majorant 4 ^ {-(sorry + 1)} : 4^failed to synthesize Singleton Hint: Additional diagnostic information may be available using the `set_option diagnostics true` command.{-(Unknown identifier `n`n+1)} is summable.

lemma helperForProposition_4_7_12_majorantSummable : Summable (fun n : => 1 / (4 : ) ^ (n + 1)) := by have hgeomShift : Summable (fun n : => (1 / 4 : ) ^ (n + 1)) := by exact (summable_nat_add_iff (f := fun n : => (1 / 4 : ) ^ n) 1).2 (summable_geometric_of_lt_one (by positivity) (by norm_num)) simpa [one_div_pow] using hgeomShift

Helper for Proposition 4.7.12: each summand is bounded in norm by 4 ^ {-(sorry + 1)} : 4^failed to synthesize Singleton Hint: Additional diagnostic information may be available using the `set_option diagnostics true` command.{-(Unknown identifier `n`n+1)}.

lemma helperForProposition_4_7_12_termNormBound (n : ) (x : ) : (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x) 1 / (4 : ) ^ (n + 1) := by have hcoeff_nonneg : 0 (1 / (4 : ) ^ (n + 1)) := by positivity have hcos : Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x) (1 : ) := by simpa [Real.norm_eq_abs] using (Real.abs_cos_le_one (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x)) calc (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x) = 1 / (4 : ) ^ (n + 1) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x) := by rw [norm_mul] _ 1 / (4 : ) ^ (n + 1) * 1 := by gcongr _ = (1 / (4 : ) ^ (n + 1)) * 1 := by rw [Real.norm_eq_abs, abs_of_nonneg hcoeff_nonneg] _ = 1 / (4 : ) ^ (n + 1) := by ring

Helper for Proposition 4.7.12: partial sums converge uniformly to the infinite series.

lemma helperForProposition_4_7_12_uniformLimit_raw : TendstoUniformly (fun N => fun x => Finset.sum (Finset.range N) (fun n => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x))) scaledCosineSeriesFunction Filter.atTop := by change TendstoUniformly (fun N => fun x => Finset.sum (Finset.range N) (fun n => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x))) (fun x => ∑' n : , (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x)) Filter.atTop refine tendstoUniformly_tsum_nat helperForProposition_4_7_12_majorantSummable ?_ intro n x exact helperForProposition_4_7_12_termNormBound n x

Helper for Proposition 4.7.12: each partial sum in the scaled cosine series is continuous.

lemma helperForProposition_4_7_12_partialSumsContinuous (N : ) : Continuous (fun x : => Finset.sum (Finset.range N) (fun n => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x))) := by exact continuous_finset_sum (Finset.range N) (fun n _ => helperForProposition_4_7_12_termContinuous n)

Proposition 4.7.12: for (with Unknown identifier `π`sorry = firstPositiveSineZero : Propπ = firstPositiveSineZero from Definition 4.7.2), the series converges uniformly on : Type; in particular, Unknown identifier `f`f is continuous on : Type.

theorem scaledCosineSeries_uniformly_convergent_and_continuous : TendstoUniformly (fun N => fun x => Finset.sum (Finset.range N) (fun n => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x))) scaledCosineSeriesFunction Filter.atTop Continuous scaledCosineSeriesFunction := by refine helperForProposition_4_7_12_uniformLimit_raw, ?_ refine helperForProposition_4_7_12_uniformLimit_raw.continuous ?_ exact Filter.Frequently.of_forall helperForProposition_4_7_12_partialSumsContinuous

Helper for Proposition 4.7.13: the Unknown identifier `n`n-th increment term of scaledCosineSeriesFunction : scaledCosineSeriesFunction across mesh size 32 ^ {-sorry} : 32^failed to synthesize Singleton Hint: Additional diagnostic information may be available using the `set_option diagnostics true` command.{-Unknown identifier `m`m}.

noncomputable def helperForProposition_4_7_13_diffTerm (j : ) (m n : ) : := ((1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * (((j + 1 : ) : ) / ((32 : ) ^ m)))) - ((1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * ((j : ) / ((32 : ) ^ m))) )

Helper for Proposition 4.7.13: pointwise summability of the cosine series.

lemma helperForProposition_4_7_13_seriesSummableAtPoint (x : ) : Summable (fun n : => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x)) := by refine Summable.of_norm_bounded helperForProposition_4_7_12_majorantSummable ?_ intro n simpa using helperForProposition_4_7_12_termNormBound n x

Helper for Proposition 4.7.13: for Unknown identifier `n`sorry sorry : Propn Unknown identifier `m`m, the phase shift 32 ^ (sorry + 1 - sorry) * sorry : 32^(Unknown identifier `n`n+1-Unknown identifier `m`m) * Unknown identifier `π`π is an integer multiple of .

lemma helperForProposition_4_7_13_phaseShift_asTwoPiMultiple (m n : ) (hmn : m n) : k : , ((32 : ) ^ (n + 1 - m)) * firstPositiveSineZero = (k : ) * (2 * Real.pi) := by refine 16 * 32 ^ (n - m), ?_ have hpi : firstPositiveSineZero = Real.pi := helperForTheorem_4_7_7_firstPositiveSineZero_eq_pi have hsub : n + 1 - m = (n - m) + 1 := by omega calc ((32 : ) ^ (n + 1 - m)) * firstPositiveSineZero = ((32 : ) ^ ((n - m) + 1)) * Real.pi := by rw [hsub, hpi] _ = ((32 : ) * (32 : ) ^ (n - m)) * Real.pi := by rw [pow_succ'] _ = ((16 : ) * (32 : ) ^ (n - m)) * (2 * Real.pi) := by ring _ = (((16 * 32 ^ (n - m) : ) : ) * (2 * Real.pi)) := by norm_num [Nat.cast_mul, Nat.cast_pow, mul_assoc, mul_left_comm, mul_comm]

Helper for Proposition 4.7.13: all modes Unknown identifier `n`sorry sorry : Propn Unknown identifier `m`m vanish in the increment.

lemma helperForProposition_4_7_13_highModesVanish (j : ) (m n : ) (hnm : m n) : helperForProposition_4_7_13_diffTerm j m n = 0 := by have hd_ne : ((32 : ) ^ m) 0 := by positivity have hpow : ((32 : ) ^ (n + 1)) = ((32 : ) ^ m) * ((32 : ) ^ (n + 1 - m)) := by have hsplit : n + 1 = m + (n + 1 - m) := by omega have hpow' := congrArg (fun t : => ((32 : ) ^ t)) hsplit simpa [pow_add, mul_comm, mul_left_comm, mul_assoc] using hpow' rcases helperForProposition_4_7_13_phaseShift_asTwoPiMultiple m n hnm with k, hk let d : := ((32 : ) ^ m) let c : := ((32 : ) ^ (n + 1)) * firstPositiveSineZero let a1 : := c * (((j + 1 : ) : ) / d) let a0 : := c * ((j : ) / d) have hfrac : (((j + 1 : ) : ) / d) = (j : ) / d + 1 / d := by dsimp [d] field_simp [hd_ne] norm_num have hc_div : c * (1 / d) = ((32 : ) ^ (n + 1 - m)) * firstPositiveSineZero := by dsimp [c, d] rw [hpow] field_simp [hd_ne] have ha1 : a1 = a0 + ((32 : ) ^ (n + 1 - m)) * firstPositiveSineZero := by dsimp [a1, a0] rw [hfrac, mul_add, hc_div] have hcos : Real.cos a1 = Real.cos a0 := by rw [ha1, hk] simpa [add_assoc, add_left_comm, add_comm, mul_assoc, mul_left_comm, mul_comm] using (Real.cos_add_nat_mul_two_pi a0 k) unfold helperForProposition_4_7_13_diffTerm dsimp [a1, a0, c, d] at hcos rw [hcos] ring

Helper for Proposition 4.7.13: the increment equals a finite sum over modes .

lemma helperForProposition_4_7_13_increment_asFiniteSum (j : ) (m : ) : scaledCosineSeriesFunction (((j + 1 : ) : ) / ((32 : ) ^ m)) - scaledCosineSeriesFunction ((j : ) / ((32 : ) ^ m)) = n Finset.range m, helperForProposition_4_7_13_diffTerm j m n := by let x1 : := (((j + 1 : ) : ) / ((32 : ) ^ m)) let x0 : := ((j : ) / ((32 : ) ^ m)) let f1 : := fun n => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x1) let f0 : := fun n => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x0) have hs1 : Summable (fun n : => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x1)) := helperForProposition_4_7_13_seriesSummableAtPoint x1 have hs0 : Summable (fun n : => (1 / (4 : ) ^ (n + 1)) * Real.cos (((32 : ) ^ (n + 1)) * firstPositiveSineZero * x0)) := helperForProposition_4_7_13_seriesSummableAtPoint x0 have hs1' : Summable f1 := by simpa [f1] using hs1 have hs0' : Summable f0 := by simpa [f0] using hs0 have htailZero : n Finset.range m, helperForProposition_4_7_13_diffTerm j m n = 0 := by intro n hn have hmn : m n := by simpa [Finset.mem_range] using hn exact helperForProposition_4_7_13_highModesVanish j m n hmn have htsumSub : (∑' n : , f1 n) - (∑' n : , f0 n) = ∑' n : , (f1 n - f0 n) := by exact (Summable.tsum_sub hs1' hs0').symm have hdiffTerm : n : , (f1 n - f0 n) = helperForProposition_4_7_13_diffTerm j m n := by intro n simp [f1, f0, helperForProposition_4_7_13_diffTerm, x1, x0] calc scaledCosineSeriesFunction x1 - scaledCosineSeriesFunction x0 = (∑' n : , f1 n) - (∑' n : , f0 n) := by simp [scaledCosineSeriesFunction, f1, f0] _ = ∑' n : , (f1 n - f0 n) := htsumSub _ = ∑' n : , helperForProposition_4_7_13_diffTerm j m n := by simp [hdiffTerm] _ = n Finset.range m, helperForProposition_4_7_13_diffTerm j m n := by exact tsum_eq_sum htailZero

Helper for Proposition 4.7.13: the main mode Unknown identifier `n`sorry = sorry - 1 : Propn = Unknown identifier `m`m-1 contributes exactly 2 / 4 ^ sorry : 2 / 4^Unknown identifier `m`m in absolute value.

lemma helperForProposition_4_7_13_mainMode_exact (j : ) (m : ) (hm : 1 m) : |helperForProposition_4_7_13_diffTerm j m (m - 1)| = 2 / (4 : ) ^ m := by have hpi : firstPositiveSineZero = Real.pi := helperForTheorem_4_7_7_firstPositiveSineZero_eq_pi have h32m_ne : ((32 : ) ^ m) 0 := by positivity have hm_sub : m - 1 + 1 = m := Nat.sub_add_cancel hm have harg1 : ((32 : ) ^ m) * firstPositiveSineZero * (((j + 1 : ) : ) / ((32 : ) ^ m)) = (((j + 1 : ) : ) * Real.pi) := by calc ((32 : ) ^ m) * firstPositiveSineZero * (((j + 1 : ) : ) / ((32 : ) ^ m)) = (((j + 1 : ) : ) * firstPositiveSineZero) := by field_simp [h32m_ne] _ = (((j + 1 : ) : ) * Real.pi) := by rw [hpi] have harg0 : ((32 : ) ^ m) * firstPositiveSineZero * ((j : ) / ((32 : ) ^ m)) = (j : ) * Real.pi := by calc ((32 : ) ^ m) * firstPositiveSineZero * ((j : ) / ((32 : ) ^ m)) = (j : ) * firstPositiveSineZero := by field_simp [h32m_ne] _ = (j : ) * Real.pi := by rw [hpi] unfold helperForProposition_4_7_13_diffTerm rw [hm_sub, harg1, harg0] have hcos_shift : Real.cos ((((j + 1 : ) : ) * Real.pi)) = -Real.cos ((j : ) * Real.pi) := by have hcast : (((j + 1 : ) : ) * Real.pi) = (j : ) * Real.pi + Real.pi := by calc (((j + 1 : ) : ) * Real.pi) = (((j : ) : ) + 1) * Real.pi := by norm_num _ = (j : ) * Real.pi + Real.pi := by ring rw [hcast, Real.cos_add_pi] rw [hcos_shift] have habsInt : |Real.cos ((j : ) * Real.pi)| = 1 := by simpa [mul_comm] using (Real.abs_cos_int_mul_pi j) calc |(1 / (4 : ) ^ m) * (-Real.cos ((j : ) * Real.pi)) - (1 / (4 : ) ^ m) * Real.cos ((j : ) * Real.pi)| = |(1 / (4 : ) ^ m) * (-2 * Real.cos ((j : ) * Real.pi))| := by ring_nf _ = |1 / (4 : ) ^ m| * |-2 * Real.cos ((j : ) * Real.pi)| := by rw [abs_mul] _ = (1 / (4 : ) ^ m) * (|(-2 : )| * |Real.cos ((j : ) * Real.pi)|) := by rw [abs_of_nonneg (by positivity), abs_mul] _ = (1 / (4 : ) ^ m) * 2 := by rw [habsInt] norm_num _ = 2 / (4 : ) ^ m := by ring

Helper for Proposition 4.7.13: finite geometric bound for .

lemma helperForProposition_4_7_13_sumPowEight_bound (m : ) (hm : 1 m) : ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) ((8 : ) ^ m) / 7 := by let S : := n Finset.range (m - 1), (8 : ) ^ n have hgeom : S * ((8 : ) - 1) = (8 : ) ^ (m - 1) - 1 := by simpa [S] using (geom_sum_mul (8 : ) (m - 1)) have hgeom7 : S * 7 = (8 : ) ^ (m - 1) - 1 := by nlinarith [hgeom] have hshift : ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) = (8 : ) * S := by simp [S, pow_succ', Finset.mul_sum] have hmul : ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) * 7 = (8 : ) ^ m - 8 := by calc ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) * 7 = ((8 : ) * S) * 7 := by rw [hshift] _ = (8 : ) * (S * 7) := by ring _ = (8 : ) * ((8 : ) ^ (m - 1) - 1) := by rw [hgeom7] _ = (8 : ) ^ m - 8 := by have hpow : (8 : ) * (8 : ) ^ (m - 1) = (8 : ) ^ m := by rw [ pow_succ'] simp [Nat.sub_add_cancel hm] linarith have hle_mul : ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) * 7 (8 : ) ^ m := by calc ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) * 7 = (8 : ) ^ m - 8 := hmul _ (8 : ) ^ m := by nlinarith nlinarith [hle_mul]

Helper for Proposition 4.7.13: each increment mode is bounded by a Lipschitz estimate for cosine.

lemma helperForProposition_4_7_13_singleLowMode_absBound (j : ) (m n : ) : |helperForProposition_4_7_13_diffTerm j m n| (Real.pi / (32 : ) ^ m) * (8 : ) ^ (n + 1) := by let a : := 1 / (4 : ) ^ (n + 1) let u : := ((32 : ) ^ (n + 1)) * firstPositiveSineZero * (((j + 1 : ) : ) / ((32 : ) ^ m)) let v : := ((32 : ) ^ (n + 1)) * firstPositiveSineZero * ((j : ) / ((32 : ) ^ m) ) have ha_nonneg : 0 a := by dsimp [a] positivity have hcos : |Real.cos u - Real.cos v| |u - v| := Real.abs_cos_sub_cos_le u v have hmul : a * |Real.cos u - Real.cos v| a * |u - v| := mul_le_mul_of_nonneg_left hcos ha_nonneg have hleft : |a * Real.cos u - a * Real.cos v| = a * |Real.cos u - Real.cos v| := by calc |a * Real.cos u - a * Real.cos v| = |a * (Real.cos u - Real.cos v)| := by ring_nf _ = |a| * |Real.cos u - Real.cos v| := by rw [abs_mul] _ = a * |Real.cos u - Real.cos v| := by rw [abs_of_nonneg ha_nonneg] have h32m_ne : ((32 : ) ^ m) 0 := by positivity have hgap : (((j + 1 : ) : ) / ((32 : ) ^ m)) - ((j : ) / ((32 : ) ^ m)) = 1 / ((32 : ) ^ m) := by have hcast : (((j + 1 : ) : ) - (j : )) = 1 := by norm_num calc (((j + 1 : ) : ) / ((32 : ) ^ m)) - ((j : ) / ((32 : ) ^ m)) = ((((j + 1 : ) : ) - (j : )) / ((32 : ) ^ m)) := by ring _ = 1 / ((32 : ) ^ m) := by rw [hcast] have huv : u - v = (((32 : ) ^ (n + 1)) * firstPositiveSineZero) * (1 / ((32 : ) ^ m)) := by calc u - v = (((32 : ) ^ (n + 1)) * firstPositiveSineZero) * ((((j + 1 : ) : ) / ((32 : ) ^ m)) - ((j : ) / ((32 : ) ^ m))) := by dsimp [u, v] ring _ = (((32 : ) ^ (n + 1)) * firstPositiveSineZero) * (1 / ((32 : ) ^ m)) := by rw [hgap] have huv_abs : |u - v| = (((32 : ) ^ (n + 1)) * Real.pi) * (1 / ((32 : ) ^ m)) := by rw [huv, helperForTheorem_4_7_7_firstPositiveSineZero_eq_pi] have hnonnegA : 0 ((32 : ) ^ (n + 1)) * Real.pi := by positivity have hnonnegB : 0 1 / ((32 : ) ^ m) := by positivity rw [abs_of_nonneg (mul_nonneg hnonnegA hnonnegB)] have hpow_cancel : ((32 : ) ^ (n + 1)) * (1 / (4 : ) ^ (n + 1)) = (8 : ) ^ (n + 1) := by have hdecomp : (32 : ) ^ (n + 1) = (4 : ) ^ (n + 1) * (8 : ) ^ (n + 1) := by calc (32 : ) ^ (n + 1) = ((4 : ) * 8) ^ (n + 1) := by norm_num _ = (4 : ) ^ (n + 1) * (8 : ) ^ (n + 1) := by rw [mul_pow] have h4pow_ne : (4 : ) ^ (n + 1) 0 := by positivity calc ((32 : ) ^ (n + 1)) * (1 / (4 : ) ^ (n + 1)) = ((4 : ) ^ (n + 1) * (8 : ) ^ (n + 1)) * (1 / (4 : ) ^ (n + 1)) := by rw [hdecomp] _ = (8 : ) ^ (n + 1) * ((4 : ) ^ (n + 1) * (1 / (4 : ) ^ (n + 1))) := by ring _ = (8 : ) ^ (n + 1) * 1 := by congr 1 field_simp [h4pow_ne] _ = (8 : ) ^ (n + 1) := by ring have hbound : |a * Real.cos u - a * Real.cos v| (Real.pi / (32 : ) ^ m) * (8 : ) ^ (n + 1) := by calc |a * Real.cos u - a * Real.cos v| = a * |Real.cos u - Real.cos v| := hleft _ a * |u - v| := hmul _ = (1 / (4 : ) ^ (n + 1)) * ((((32 : ) ^ (n + 1)) * Real.pi) * (1 / ((32 : ) ^ m)) ) := by rw [huv_abs] _ = (Real.pi / (32 : ) ^ m) * (((32 : ) ^ (n + 1)) * (1 / (4 : ) ^ (n + 1))) := by ring _ = (Real.pi / (32 : ) ^ m) * (8 : ) ^ (n + 1) := by rw [hpow_cancel] simpa [helperForProposition_4_7_13_diffTerm, a, u, v] using hbound

Helper for Proposition 4.7.13: the finite sum of absolute low-mode terms is bounded by the corresponding geometric series.

lemma helperForProposition_4_7_13_lowMode_sumAbs_bound (j : ) (m : ) : ( n Finset.range (m - 1), |helperForProposition_4_7_13_diffTerm j m n|) (Real.pi / (32 : ) ^ m) * ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) := by calc ( n Finset.range (m - 1), |helperForProposition_4_7_13_diffTerm j m n|) n Finset.range (m - 1), ((Real.pi / (32 : ) ^ m) * (8 : ) ^ (n + 1)) := by refine Finset.sum_le_sum ?_ intro n hn exact helperForProposition_4_7_13_singleLowMode_absBound j m n _ = (Real.pi / (32 : ) ^ m) * ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) := by rw [Finset.mul_sum]

Helper for Proposition 4.7.13: the geometric-factor estimate implies the final 1 / 4 ^ sorry : 1 / 4^Unknown identifier `m`m bound.

lemma helperForProposition_4_7_13_lowMode_series_to_quarterPow (m : ) (unused variable `hm` Note: This linter can be disabled with `set_option linter.unusedVariables false`hm : 1 m) : (Real.pi / (32 : ) ^ m) * (((8 : ) ^ m) / 7) 1 / (4 : ) ^ m := by have hratio : ((8 : ) ^ m) / ((32 : ) ^ m) = 1 / (4 : ) ^ m := by have hdecomp : (32 : ) ^ m = (8 : ) ^ m * (4 : ) ^ m := by calc (32 : ) ^ m = ((8 : ) * 4) ^ m := by norm_num _ = (8 : ) ^ m * (4 : ) ^ m := by rw [mul_pow] have h8pow_ne : (8 : ) ^ m 0 := by positivity have h4pow_ne : (4 : ) ^ m 0 := by positivity rw [hdecomp] field_simp [h8pow_ne, h4pow_ne] have hpi_div7_le_one : Real.pi / 7 (1 : ) := by have hpi_div7_le_four_div7 : Real.pi / 7 (4 : ) / 7 := by nlinarith [Real.pi_lt_four] have hfour_div7_le_one : (4 : ) / 7 (1 : ) := by norm_num exact le_trans hpi_div7_le_four_div7 hfour_div7_le_one have hpow_nonneg : 0 1 / (4 : ) ^ m := by positivity have hmul : (Real.pi / 7) * (1 / (4 : ) ^ m) (1 : ) * (1 / (4 : ) ^ m) := mul_le_mul_of_nonneg_right hpi_div7_le_one hpow_nonneg calc (Real.pi / (32 : ) ^ m) * (((8 : ) ^ m) / 7) = (Real.pi / 7) * (((8 : ) ^ m) / ((32 : ) ^ m)) := by ring _ = (Real.pi / 7) * (1 / (4 : ) ^ m) := by rw [hratio] _ (1 : ) * (1 / (4 : ) ^ m) := hmul _ = 1 / (4 : ) ^ m := by ring

Helper for Proposition 4.7.13: the sum of low modes Unknown identifier `n`sorry < sorry - 1 : Propn < Unknown identifier `m`m-1 is bounded by 1 / 4 ^ sorry : 1 / 4^Unknown identifier `m`m in absolute value.

lemma helperForProposition_4_7_13_lowModes_bound (j : ) (m : ) (hm : 1 m) : | n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n| 1 / (4 : ) ^ m := by have hsumAbs : ( n Finset.range (m - 1), |helperForProposition_4_7_13_diffTerm j m n|) (Real.pi / (32 : ) ^ m) * ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) := helperForProposition_4_7_13_lowMode_sumAbs_bound j m have hgeom : ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) ((8 : ) ^ m) / 7 := helperForProposition_4_7_13_sumPowEight_bound m hm have hcoeff_nonneg : 0 Real.pi / (32 : ) ^ m := by positivity have hscaled : (Real.pi / (32 : ) ^ m) * ( n Finset.range (m - 1), (8 : ) ^ (n + 1)) (Real.pi / (32 : ) ^ m) * (((8 : ) ^ m) / 7) := mul_le_mul_of_nonneg_left hgeom hcoeff_nonneg have hquarter : (Real.pi / (32 : ) ^ m) * (((8 : ) ^ m) / 7) 1 / (4 : ) ^ m := helperForProposition_4_7_13_lowMode_series_to_quarterPow m hm have habs : | n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n| n Finset.range (m - 1), |helperForProposition_4_7_13_diffTerm j m n| := by simpa using (Finset.abs_sum_le_sum_abs (f := fun n => helperForProposition_4_7_13_diffTerm j m n) (s := Finset.range (m - 1))) exact le_trans habs (le_trans hsumAbs (le_trans hscaled hquarter))

Helper for Proposition 4.7.13: if the main term has size 2 / 4 ^ sorry : 2/4^Unknown identifier `m`m and the error is bounded by 1 / 4 ^ sorry : 1/4^Unknown identifier `m`m, then the total has size at least 1 / 4 ^ sorry : 1/4^Unknown identifier `m`m.

lemma helperForProposition_4_7_13_absLowerBound_from_main_plus_error (m : ) {main error : } (hmain : |main| = 2 / (4 : ) ^ m) (herror : |error| 1 / (4 : ) ^ m) : |main + error| 1 / (4 : ) ^ m := by have htri : |main| |main + error| + |error| := by simpa [sub_eq_add_neg, add_assoc, add_left_comm, add_comm] using abs_add_le (main + error) (-error) have hmainLe : 2 / (4 : ) ^ m |main + error| + 1 / (4 : ) ^ m := by linarith [hmain, herror, htri] have hsub : 2 / (4 : ) ^ m - 1 / (4 : ) ^ m |main + error| := by linarith [hmainLe] have hleft : 2 / (4 : ) ^ m - 1 / (4 : ) ^ m = 1 / (4 : ) ^ m := by ring linarith [hsub, hleft]

Proposition 4.7.13: for every and every integer Unknown identifier `m`sorry 1 : Propm 1, for (with Unknown identifier `π`sorry = firstPositiveSineZero : Propπ = firstPositiveSineZero), the increment across consecutive points of mesh size 32 ^ {-sorry} : 32^failed to synthesize Singleton Hint: Additional diagnostic information may be available using the `set_option diagnostics true` command.{-Unknown identifier `m`m} satisfies .

theorem scaledCosineSeries_increment_lower_bound (j : ) (m : ) (hm : 1 m) : |scaledCosineSeriesFunction (((j + 1 : ) : ) / ((32 : ) ^ m)) - scaledCosineSeriesFunction ((j : ) / ((32 : ) ^ m))| (1 / ((4 : ) ^ m)) := by have hfinite : scaledCosineSeriesFunction (((j + 1 : ) : ) / ((32 : ) ^ m)) - scaledCosineSeriesFunction ((j : ) / ((32 : ) ^ m)) = n Finset.range m, helperForProposition_4_7_13_diffTerm j m n := helperForProposition_4_7_13_increment_asFiniteSum j m have hsplit : ( n Finset.range m, helperForProposition_4_7_13_diffTerm j m n) = ( n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n) + helperForProposition_4_7_13_diffTerm j m (m - 1) := by calc ( n Finset.range m, helperForProposition_4_7_13_diffTerm j m n) = ( n Finset.range ((m - 1) + 1), helperForProposition_4_7_13_diffTerm j m n) := by rw [Nat.sub_add_cancel hm] _ = ( n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n) + helperForProposition_4_7_13_diffTerm j m (m - 1) := Finset.sum_range_succ (fun n => helperForProposition_4_7_13_diffTerm j m n) (m - 1) have hmain : |helperForProposition_4_7_13_diffTerm j m (m - 1)| = 2 / (4 : ) ^ m := helperForProposition_4_7_13_mainMode_exact j m hm have hlow : | n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n| 1 / (4 : ) ^ m := helperForProposition_4_7_13_lowModes_bound j m hm have habs : |( n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n) + helperForProposition_4_7_13_diffTerm j m (m - 1)| 1 / (4 : ) ^ m := by have habs' : |helperForProposition_4_7_13_diffTerm j m (m - 1) + ( n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n)| 1 / (4 : ) ^ m := helperForProposition_4_7_13_absLowerBound_from_main_plus_error (m := m) (main := helperForProposition_4_7_13_diffTerm j m (m - 1)) (error := n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n) hmain hlow simpa [add_comm] using habs' calc |scaledCosineSeriesFunction (((j + 1 : ) : ) / ((32 : ) ^ m)) - scaledCosineSeriesFunction ((j : ) / ((32 : ) ^ m))| = | n Finset.range m, helperForProposition_4_7_13_diffTerm j m n| := by rw [hfinite] _ = |( n Finset.range (m - 1), helperForProposition_4_7_13_diffTerm j m n) + helperForProposition_4_7_13_diffTerm j m (m - 1)| := by rw [hsplit] _ 1 / (4 : ) ^ m := habs
end Section07end Chap04