Chapter 04 — Power Series

Proofs omitted. Hover over highlighted terms to see their Lean types.

Reading sections

4.1 — Formal Power Series

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Definition 4.1.1: For a ∈ ℝ, a formal power series centered at a is given by a sequence of real coefficients (c_n)_{n≥0}, corresponding to the formal expression ∑_{n=0}^∞ c_n (x - a)^n in the indeterminate x; its nth coefficient is coeff n.

structure FormalPowerSeriesCenteredAt (a : ℝ) where coeff : ℕ → ℝ

Lean source

Definition 4.1.2 (Radius of convergence): for a formal power series ∑_{n=0}^∞ c_n (x-a)^n, let L = limsup_{n→∞} |c_n|^(1/n) (valued in [0, +∞]); the radius of convergence is R = 1 / L, with the conventions 1/0 = +∞ and 1/(+∞) = 0.

noncomputable def FormalPowerSeriesCenteredAt.radiusOfConvergence {a : ℝ} (f : FormalPowerSeriesCenteredAt a) : ENNReal := (FormalMultilinearSeries.ofScalars ℝ f.coeff).radius

Lean source

Definition 4.1.3: Define the function f : ℝ \ {1} → ℝ by f(x) = 1 / (1 - x).

noncomputable def reciprocalOneSub (x : {x : ℝ // x ≠ 1}) : ℝ := 1 / (1 - (x : ℝ))

Lean source

Points of (-1, 1) are distinct from 1.

lemma ne_one_of_mem_Ioo_neg_one_one {x : ℝ} (hx : x ∈ Set.Ioo (-1 : ℝ) 1) : x ≠ 1

Lean source

The total real extension of x ↦ 1 / (1 - x).

noncomputable def reciprocalOneSub_ext : ℝ → ℝ := fun y => 1 / (1 - y)

Lean source

The total extension agrees with reciprocalOneSub away from 1.

lemma reciprocalOneSub_ext_eq (x : ℝ) (hx : x ≠ 1) : reciprocalOneSub_ext x = reciprocalOneSub ⟨x, hx⟩

Lean source

Lemma 4.1.1: For every x ∈ (-1, 1), one has ∑' n, x^n = 1/(1-x) = f(x) (with f = reciprocalOneSub), and in particular f is real analytic at 0.

lemma geometric_series_eq_reciprocalOneSub_and_analyticAt_zero : (∀ x : ℝ, ∀ hx : x ∈ Set.Ioo (-1 : ℝ) 1, (∑' n : ℕ, x ^ n) = 1 / (1 - x) ∧ 1 / (1 - x) = reciprocalOneSub_ext x) ∧ AnalyticAt ℝ reciprocalOneSub_ext 0

Lean source

Points of (1, 3) are distinct from 1.

lemma ne_one_of_mem_Ioo_one_three {x : ℝ} (hx : x ∈ Set.Ioo (1 : ℝ) 3) : x ≠ 1

Lean source

Lemma 4.1.2: For every x ∈ (1, 3), one has ∑' n, (-1)^(n+1) (x-2)^n = 1/(1-x) = f(x) (with f = reciprocalOneSub); in particular, f is real analytic at 2.

lemma shifted_geometric_series_eq_reciprocalOneSub_and_analyticAt_two : (∀ x : ℝ, ∀ hx : x ∈ Set.Ioo (1 : ℝ) 3, (∑' n : ℕ, (-1 : ℝ) ^ (n + 1) * (x - 2) ^ n) = 1 / (1 - x) ∧ 1 / (1 - x) = reciprocalOneSub ⟨x, ne_one_of_mem_Ioo_one_three hx⟩) ∧ AnalyticAt ℝ reciprocalOneSub_ext 2

Lean source

Theorem 4.1.1: (Divergence outside the radius of convergence) for a power series with center a and coefficients c_n, if |x - a| > R where R is the radius of convergence, then ∑ n, c_n * (x - a)^n diverges at x.

theorem FormalPowerSeriesCenteredAt.diverges_outside_radius {a x : ℝ} (f : FormalPowerSeriesCenteredAt a) (hx : f.radiusOfConvergence < ENNReal.ofReal |x - a|) : ¬Summable (fun n : ℕ => f.coeff n * (x - a) ^ n)

Lean source

Theorem 4.1.2: If |x - a| < R for a power series ∑ n, c_n (x-a)^n with radius of convergence R, then ∑ n, c_n (x-a)^n converges absolutely at x.

theorem FormalPowerSeriesCenteredAt.converges_absolutely_inside_radius {a x : ℝ} (f : FormalPowerSeriesCenteredAt a) (hx : ENNReal.ofReal |x - a| < f.radiusOfConvergence) : Summable (fun n : ℕ => |f.coeff n * (x - a) ^ n|)

Lean source

Theorem 4.1.3: (Uniform convergence on compact subintervals) for a power series centered at a, if 0 < r < R (with R the radius of convergence), then the partial sums converge uniformly on [a-r, a+r] to the series sum; in particular, the sum function is continuous at every point where |x-a| < R.

theorem FormalPowerSeriesCenteredAt.uniformly_converges_on_compact_subintervals {a r : ℝ} (f : FormalPowerSeriesCenteredAt a) (hr0 : 0 < r) (hrR : ENNReal.ofReal r < f.radiusOfConvergence) : TendstoUniformlyOn (fun N x => (Finset.range N).sum (fun n => f.coeff n * (x - a) ^ n)) (fun x => ∑' n, f.coeff n * (x - a) ^ n) Filter.atTop (Set.Icc (a - r) (a + r)) ∧ ∀ x : ℝ, ENNReal.ofReal |x - a| < f.radiusOfConvergence → ContinuousAt (fun y => ∑' n, f.coeff n * (y - a) ^ n) x

Lean source

Theorem 4.1.4: (Term-by-term differentiation of a power series): if a power series centered at a has positive radius of convergence R, then its sum function is differentiable at every point x with |x - a| < R; moreover, for every r with 0 < r < R, the derived series converges uniformly to the derivative on [a - r, a + r].

theorem FormalPowerSeriesCenteredAt.term_by_term_differentiation_of_power_series {a : ℝ} (f : FormalPowerSeriesCenteredAt a) (hRpos : 0 < f.radiusOfConvergence) : DifferentiableOn ℝ (fun x => ∑' n, f.coeff n * (x - a) ^ n) {x : ℝ | ENNReal.ofReal |x - a| < f.radiusOfConvergence} ∧ ∀ r : ℝ, 0 < r → ENNReal.ofReal r < f.radiusOfConvergence → TendstoUniformlyOn (fun N x => (Finset.range N).sum (fun n => ((n + 1 : ℝ) * f.coeff (n + 1) * (x - a) ^ n)) ) (fun x => deriv (fun y => ∑' n, f.coeff n * (y - a) ^ n) x) Filter.atTop (Set.Icc (a - r) (a + r))

Lean source

Theorem 4.1.5: (Term-by-term integration of a power series) let f(x) = ∑' n, c_n (x-a)^n be a power series with positive radius of convergence; for any closed interval [y, z] contained in the convergence region, ∫ x in y..z, f x equals the term-by-term antiderivative series evaluated at z and y.

theorem FormalPowerSeriesCenteredAt.term_by_term_integration_of_power_series {a y z : ℝ} (f : FormalPowerSeriesCenteredAt a) (hRpos : 0 < f.radiusOfConvergence) (hsub : Set.uIcc y z ⊆ {x : ℝ | ENNReal.ofReal |x - a| < f.radiusOfConvergence}) : (∫ x in y..z, (∑' n : ℕ, f.coeff n * (x - a) ^ n)) = ∑' n : ℕ, f.coeff n * (((z - a) ^ (n + 1) - (y - a) ^ (n + 1)) / (n + 1 : ℝ))

Lean source

Helper for Theorem 4.1.1: radiusOfConvergence is the radius of the associated scalar formal multilinear series.

lemma FormalPowerSeriesCenteredAt.radiusOfConvergence_eq_ofScalarsRadius {a : ℝ} (f : FormalPowerSeriesCenteredAt a) : f.radiusOfConvergence = (FormalMultilinearSeries.ofScalars ℝ f.coeff).radius

Lean source

Helper for Lemma 4.1.2: for x ∈ (1,3), the shifted variable satisfies |x-2| < 1.

lemma helperForLemma_4_1_2_abs_shift_lt_one {x : ℝ} (hx : x ∈ Set.Ioo (1 : ℝ) 3) :

Lean source

Helper for Lemma 4.1.2: rewrite each shifted alternating term as a negated geometric term.

lemma helperForLemma_4_1_2_alternating_term_as_neg_geometric (x : ℝ) (n : ℕ) : (-1 : ℝ) ^ (n + 1) * (x - 2) ^ n = -((((-1 : ℝ) * (x - 2)) ^ n))

Lean source

Helper for Lemma 4.1.2: the shifted alternating geometric series sums to 1/(1-x) on (1,3).

lemma helperForLemma_4_1_2_tsum_identity {x : ℝ} (hx : x ∈ Set.Ioo (1 : ℝ) 3) : (∑' n : ℕ, (-1 : ℝ) ^ (n + 1) * (x - 2) ^ n) = 1 / (1 - x)

Lean source

Helper for Lemma 4.1.2: the extension reciprocalOneSub_ext is real-analytic at 2.

lemma helperForLemma_4_1_2_analyticAt_two : AnalyticAt ℝ reciprocalOneSub_ext 2

Lean source

Helper for Theorem 4.1.3: translate a scalar formal multilinear series to a ball expansion centered at a by composition with subtraction.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_3_shiftedHasFPowerSeriesOnBall {a : ℝ} (p : FormalMultilinearSeries ℝ ℝ ℝ) (hpos : 0 < p.radius) : HasFPowerSeriesOnBall (fun x : ℝ => p.sum (x - a)) p a p.radius

Lean source

Helper for Theorem 4.1.3: pick an intermediate NNReal radius strictly between r and the convergence radius.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_3_existsStrictIntermediateRadius {a r : ℝ} (f : FormalPowerSeriesCenteredAt a) (hrR : ENNReal.ofReal r < f.radiusOfConvergence) : ∃ ρ : NNReal, ENNReal.ofReal r < (ρ : ENNReal) ∧ (ρ : ENNReal) < f.radiusOfConvergence

Lean source

Helper for Theorem 4.1.3: if r < ρ, then [a-r, a+r] lies in the open ball Metric.ball a ρ.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_3_Icc_subset_ball {a r ρ : ℝ} (hrρ : r < ρ) : Set.Icc (a - r) (a + r) ⊆ Metric.ball a ρ

Lean source

Helper for Theorem 4.1.3: rewrite both partial sums and total sums in textbook coefficient form.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_3_rewriteSeriesForms {a : ℝ} (f : FormalPowerSeriesCenteredAt a) : ((fun N x => (FormalMultilinearSeries.ofScalars ℝ f.coeff).partialSum N (x - a)) = (fun N x => (Finset.range N).sum (fun n => f.coeff n * (x - a) ^ n))) ∧ ((fun x => (FormalMultilinearSeries.ofScalars ℝ f.coeff).sum (x - a)) = (fun x => ∑' n, f.coeff n * (x - a) ^ n))

Lean source

Helper for Theorem 4.1.3: inside the convergence radius, the scalar-series sum function is continuous.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_3_continuousAt_inside_radius {a x : ℝ} (f : FormalPowerSeriesCenteredAt a) (hx : ENNReal.ofReal |x - a| < f.radiusOfConvergence) : ContinuousAt (fun y => ∑' n, f.coeff n * (y - a) ^ n) x

Lean source

Helper for Theorem 4.1.1: identify the textbook radius with the formal multilinear-series radius.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_1_radius_eq_ofScalarsRadius {a : ℝ} (f : FormalPowerSeriesCenteredAt a) : f.radiusOfConvergence = (FormalMultilinearSeries.ofScalars ℝ f.coeff).radius

Lean source

Helper for Theorem 4.1.1: summability of scalar terms forces weighted norms to tend to 0.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_1_tendsto_weightedNorm_zero_of_summable {a x : ℝ} (f : FormalPowerSeriesCenteredAt a) (hs : Summable (fun n : ℕ => f.coeff n * (x - a) ^ n)) : Filter.Tendsto (fun n : ℕ => ‖f.coeff n‖ * ‖x - a‖ ^ n) Filter.atTop (nhds 0)

Lean source

Helper for Theorem 4.1.1: if the scalar series at x is summable, then |x-a| lies within the radius.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_1_ofRealAbs_le_radius_of_summable {a x : ℝ} (f : FormalPowerSeriesCenteredAt a) (hs : Summable (fun n : ℕ => f.coeff n * (x - a) ^ n)) : ENNReal.ofReal |x - a| ≤ f.radiusOfConvergence

Lean source

Helper for Theorem 4.1.4: identify the convergence-radius set with the corresponding emetric ball.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_4_ball_eq_insideRadiusSet {a : ℝ} (f : FormalPowerSeriesCenteredAt a) : Metric.eball a (FormalMultilinearSeries.ofScalars ℝ f.coeff).radius = {x : ℝ | ENNReal.ofReal |x - a| < f.radiusOfConvergence}

Lean source

Helper for Theorem 4.1.4: derivative power-series expansion on the convergence ball.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_4_derivHasFPowerSeriesOnBall {a : ℝ} (f : FormalPowerSeriesCenteredAt a) (hRpos : 0 < f.radiusOfConvergence) : HasFPowerSeriesOnBall (fun x => deriv (fun y => (FormalMultilinearSeries.ofScalars ℝ f.coeff).sum (y - a)) x) ((((ContinuousLinearMap.apply ℝ ℝ) (1 : ℝ)).compFormalMultilinearSeries ((FormalMultilinearSeries.ofScalars ℝ f.coeff).derivSeries))) a (FormalMultilinearSeries.ofScalars ℝ f.coeff).radius

Lean source

Helper for Theorem 4.1.4: rewrite derivative-series partial sums in textbook coefficient form.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_4_rewriteDerivedPartialSums {a : ℝ} (f : FormalPowerSeriesCenteredAt a) : (fun N x => ((((ContinuousLinearMap.apply ℝ ℝ) (1 : ℝ)).compFormalMultilinearSeries ((FormalMultilinearSeries.ofScalars ℝ f.coeff).derivSeries)).partialSum N (x - a))) = (fun N x => (Finset.range N).sum (fun n => ((n + 1 : ℝ) * f.coeff (n + 1) * (x - a) ^ n)) )

Lean source

Helper for Theorem 4.1.4: differentiability of the power-series sum on its open convergence interval.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_4_differentiableOn_insideRadius {a : ℝ} (f : FormalPowerSeriesCenteredAt a) (hRpos : 0 < f.radiusOfConvergence) : DifferentiableOn ℝ (fun x => ∑' n, f.coeff n * (x - a) ^ n) {x : ℝ | ENNReal.ofReal |x - a| < f.radiusOfConvergence}

Lean source

Helper for Theorem 4.1.5: endpoints of Set.uIcc y z satisfy the same radius bound inherited from the interval hypothesis.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_5_endpoint_radius_bounds {a y z : ℝ} (f : FormalPowerSeriesCenteredAt a) (hsub : Set.uIcc y z ⊆ {x : ℝ | ENNReal.ofReal |x - a| < f.radiusOfConvergence}) : ENNReal.ofReal |y - a| < f.radiusOfConvergence ∧ ENNReal.ofReal |z - a| < f.radiusOfConvergence

Lean source

Helper for Theorem 4.1.5: every point of Set.uIcc y z has distance to a bounded by the maximum endpoint distance.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_5_abs_sub_le_maxEndpoint {a y z x : ℝ} (hx : x ∈ Set.uIcc y z) :

Lean source

Helper for Theorem 4.1.5: each monomial term x ↦ c_n (x-a)^n is continuous.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_5_term_continuous {a : ℝ} (f : FormalPowerSeriesCenteredAt a) (n : ℕ) : Continuous (fun x : ℝ => f.coeff n * (x - a) ^ n)

Lean source

Helper for Theorem 4.1.5: package the nth term as a continuous map on ℝ.

noncomputable def FormalPowerSeriesCenteredAt.helperForTheorem_4_1_5_termContinuousMap {a : ℝ} (f : FormalPowerSeriesCenteredAt a) (n : ℕ) : C(ℝ, ℝ) := ⟨fun x => f.coeff n * (x - a) ^ n, FormalPowerSeriesCenteredAt.helperForTheorem_4_1_5_term_continuous (a := a) f n⟩

Lean source

Helper for Theorem 4.1.5: the supremum norms of restricted terms on Set.uIcc y z form a summable series.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_5_summable_restrictedTermNorms {a y z : ℝ} (f : FormalPowerSeriesCenteredAt a) (hsub : Set.uIcc y z ⊆ {x : ℝ | ENNReal.ofReal |x - a| < f.radiusOfConvergence}) : Summable (fun n : ℕ => ‖(FormalPowerSeriesCenteredAt.helperForTheorem_4_1_5_termContinuousMap (a := a) f n).restrict (⟨Set.uIcc y z, isCompact_uIcc⟩ : TopologicalSpace.Compacts ℝ)‖)

Lean source

Helper for Theorem 4.1.5: the interval integral of each term has the textbook antiderivative form.

lemma FormalPowerSeriesCenteredAt.helperForTheorem_4_1_5_intervalIntegral_term_formula {a y z : ℝ} (f : FormalPowerSeriesCenteredAt a) (n : ℕ) : (∫ x in y..z, f.coeff n * (x - a) ^ n) = f.coeff n * (((z - a) ^ (n + 1) - (y - a) ^ (n + 1)) / (n + 1 : ℝ))

4.2 — Real Analytic Functions — Part 1

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Definition 4.2.1 (Real analytic at a point): let E ⊆ ℝ, f : E → ℝ, and a ∈ E be an interior point of E. The function f is real analytic at a if there exist r > 0 and coefficients c : ℕ → ℝ such that (a-r, a+r) ⊆ E, the power series ∑ c n (x-a)^n converges for every x ∈ (a-r, a+r) (encoding radius of convergence at least r), and f x equals that series on (a-r, a+r).

open Classical def IsRealAnalyticAt (E : Set ℝ) (f : E → ℝ) (a : E) : Prop := (a : ℝ) ∈ interior E ∧ ∃ r : ℝ, 0 < r ∧ ∃ hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E, ∃ c : ℕ → ℝ, (∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) ∧ ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n

Lean source

A function on E is real analytic on E when E is open and the function is real analytic at each point of E.

open Classical def IsRealAnalyticOn (E : Set ℝ) (f : E → ℝ) : Prop := IsOpen E ∧ ∀ a : E, IsRealAnalyticAt E f a

Lean source

A set of real numbers has no isolated points if every x ∈ E is a limit point of E.

open Classical def HasNoIsolatedPoints (E : Set ℝ) : Prop := ∀ x ∈ E, x ∈ closure (E \ {x})

Lean source

Canonical extension of f : E → ℝ to ℝ, taking value 0 off E.

open Classical noncomputable def SubtypeExtension (E : Set ℝ) (f : E → ℝ) : ℝ → ℝ := fun x => if hx : x ∈ E then f ⟨x, hx⟩ else 0

Lean source

The first derivative f' : E → ℝ, defined by the within-set derivative on E.

open Classical noncomputable def FirstDerivativeSub (E : Set ℝ) (f : E → ℝ) : E → ℝ := fun x => derivWithin (SubtypeExtension E f) E x

Lean source

Iterated derivatives on E: f^(0)=f and f^(n+1) is the first derivative of f^(n).

open Classical noncomputable def IteratedDerivativeSub (E : Set ℝ) (f : E → ℝ) : ℕ → E → ℝ

Lean source

A function f : E → ℝ is once differentiable on E when it is differentiable within E at every point of E.

open Classical def IsOnceDifferentiableSub (E : Set ℝ) (f : E → ℝ) : Prop := ∀ x : E, DifferentiableWithinAt ℝ (SubtypeExtension E f) E (x : ℝ)

Lean source

Definition 4.2.2 (k-times differentiability on a set). (i) once differentiable means differentiable at every point of E; (ii) for k ≥ 2, k-times differentiable is defined recursively via the derivative; (iii) iterated derivatives are f^(0)=f, f^(1)=f', f^(k)=((f^(k-1))'); (iv) infinitely differentiable (smooth) means k-times differentiable for every k ≥ 0. The standing hypothesis that every point of E is a limit point of E is recorded by HasNoIsolatedPoints E as part of the definition.

open Classical def IsKTimesDifferentiableSub (E : Set ℝ) (f : E → ℝ) : ℕ → Prop := fun k => HasNoIsolatedPoints E ∧ Nat.rec (motive := fun _ => Prop) True (fun n ih => IsOnceDifferentiableSub E (IteratedDerivativeSub E f n) ∧ ih) k

Lean source

A function on E is smooth when it is k-times differentiable for every k : ℕ.

open Classical def IsSmoothSub (E : Set ℝ) (f : E → ℝ) : Prop := ∀ k : ℕ, IsKTimesDifferentiableSub E f k

Lean source

The function x ↦ |x|^3 on ℝ.

open Classical def absCube : ℝ → ℝ := fun x => |x| ^ (3 : ℕ)

Lean source

Proposition 4.2.1: for f(x) = |x|^3, one has f'(x) = 3x|x| and f''(x) = 6|x| for all x ∈ ℝ; hence f is twice differentiable on ℝ, while f'' is not differentiable at 0 (equivalently, f is not three times differentiable at 0).

open Classical theorem absCube_twiceDifferentiable_and_not_threeTimesDifferentiableAt_zero : Differentiable ℝ absCube ∧ Differentiable ℝ (deriv absCube) ∧ (∀ x : ℝ, deriv absCube x = 3 * x * |x|) ∧ (∀ x : ℝ, deriv (deriv absCube) x = 6 * |x|) ∧ ¬DifferentiableAt ℝ (deriv (deriv absCube)) 0

Lean source

Proposition 4.2.2 (Real analytic functions are k-times differentiable): if f : (a-r, a+r) → ℝ has a convergent power-series representation f(x) = ∑' n, c n * (x-a)^n on (a-r, a+r), then for every k : ℕ, f is k-times differentiable on (a-r, a+r), and the k-th iterated derivative has the termwise differentiated series ∑' n, c (n+k) * ((n+k)! / n!) * (x-a)^n (equivalently using (n+1)(n+2)...(n+k), with empty product 1 when k = 0).

open Classical theorem realAnalyticOnInterval_iteratedDerivative_eq_powerSeries {a r : ℝ} (hr : 0 < r) (f : Set.Ioo (a - r) (a + r) → ℝ) (hseries : ∃ c : ℕ → ℝ, ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (x - a) ^ n) ∧ f ⟨x, hx⟩ = ∑' n : ℕ, c n * (x - a) ^ n) : ∃ c : ℕ → ℝ, (∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (x - a) ^ n) ∧ f ⟨x, hx⟩ = ∑' n : ℕ, c n * (x - a) ^ n) ∧ ∀ k : ℕ, IsKTimesDifferentiableSub (Set.Ioo (a - r) (a + r)) f k ∧ ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c (n + k) * ((Nat.factorial (n + k) : ℝ) / (Nat.factorial n : ℝ)) * (x - a) ^ n) ∧ IteratedDerivativeSub (Set.Ioo (a - r) (a + r)) f k ⟨x, hx⟩ = ∑' n : ℕ, c (n + k) * ((Nat.factorial (n + k) : ℝ) / (Nat.factorial n : ℝ)) * (x - a) ^ n

Lean source

Helper for Proposition 4.2.1: rewrite absCube using real powers.

open Classical lemma helperForProposition_4_2_1_absCube_eq_absRpowThree : absCube = fun x : ℝ => |x| ^ (3 : ℝ)

Lean source

Helper for Proposition 4.2.1: derivative formula for x ↦ |x|^3.

open Classical lemma helperForProposition_4_2_1_hasDerivAt_absCube (x : ℝ) : HasDerivAt absCube (3 * x * |x|) x

Lean source

Helper for Proposition 4.2.1: derivative formula for x ↦ x|x|.

open Classical lemma helperForProposition_4_2_1_hasDerivAt_xMulAbs (x : ℝ) : HasDerivAt (fun y : ℝ => y * |y|) (2 * |x|) x

Lean source

Helper for Proposition 4.2.1: derivative formula for deriv absCube.

open Classical lemma helperForProposition_4_2_1_hasDerivAt_derivAbsCube (x : ℝ) : HasDerivAt (deriv absCube) (6 * |x|) x

Lean source

Helper for Proposition 4.2.1: the second derivative x ↦ 6|x| is not differentiable at 0.

open Classical lemma helperForProposition_4_2_1_notDifferentiableAt_zero_secondDeriv : ¬DifferentiableAt ℝ (fun x : ℝ => 6 * |x|) 0

Lean source

Helper for Proposition 4.2.2: open intervals in ℝ have no isolated points.

open Classical lemma helperForProposition_4_2_2_interval_hasNoIsolatedPoints (a r : ℝ) : HasNoIsolatedPoints (Set.Ioo (a - r) (a + r))

Lean source

Helper for Proposition 4.2.2: the k = 0 termwise coefficient factor is 1.

open Classical lemma helperForProposition_4_2_2_kZero_seriesTerm_eq (c : ℕ → ℝ) (a x : ℝ) : (fun n : ℕ => c (n + 0) * ((Nat.factorial (n + 0) : ℝ) / (Nat.factorial n : ℝ)) * (x - a) ^ n) = (fun n : ℕ => c n * (x - a) ^ n)

Lean source

Helper for Proposition 4.2.2: the target series identity for k = 0.

open Classical lemma helperForProposition_4_2_2_seriesFormula_kZero {a r : ℝ} (f : Set.Ioo (a - r) (a + r) → ℝ) (c : ℕ → ℝ) (hc : ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (x - a) ^ n) ∧ f ⟨x, hx⟩ = ∑' n : ℕ, c n * (x - a) ^ n) : ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c (n + 0) * ((Nat.factorial (n + 0) : ℝ) / (Nat.factorial n : ℝ)) * (x - a) ^ n) ∧ IteratedDerivativeSub (Set.Ioo (a - r) (a + r)) f 0 ⟨x, hx⟩ = ∑' n : ℕ, c (n + 0) * ((Nat.factorial (n + 0) : ℝ) / (Nat.factorial n : ℝ)) * (x - a) ^ n

Lean source

Helper for Proposition 4.2.2: IteratedDerivativeSub agrees pointwise with iteratedDerivWithin on the underlying set.

open Classical lemma helperForProposition_4_2_2_iteratedDerivativeSub_eq_iteratedDerivWithin (E : Set ℝ) (f : E → ℝ) : ∀ k x (hx : x ∈ E), IteratedDerivativeSub E f k ⟨x, hx⟩ = iteratedDerivWithin k (SubtypeExtension E f) E x

Lean source

Helper for Proposition 4.2.2: smoothness of the ambient extension implies that every iterated subtype derivative is once differentiable on the set.

open Classical lemma helperForProposition_4_2_2_isOnceDifferentiableSub_of_contDiffOn {E : Set ℝ} (f : E → ℝ) (hcont : ContDiffOn ℝ ⊤ (SubtypeExtension E f) E) (hunique : UniqueDiffOn ℝ E) : ∀ n : ℕ, IsOnceDifferentiableSub E (IteratedDerivativeSub E f n)

Lean source

Helper for Proposition 4.2.2: if all iterated derivatives are once differentiable, then the recursive notion of k-times differentiability holds for every k.

open Classical lemma helperForProposition_4_2_2_isKTimesDifferentiableSub_of_allOnceDifferentiable {E : Set ℝ} (f : E → ℝ) (hNoIso : HasNoIsolatedPoints E) (hOnce : ∀ n : ℕ, IsOnceDifferentiableSub E (IteratedDerivativeSub E f n)) : ∀ k : ℕ, IsKTimesDifferentiableSub E f k

Lean source

Helper for Proposition 4.2.2: the interval series data gives HasFPowerSeriesWithinOnBall for the canonical extension.

open Classical lemma helperForProposition_4_2_2_hasFPowerSeriesWithinOnBall_of_seriesData {a r : ℝ} (hr : 0 < r) (f : Set.Ioo (a - r) (a + r) → ℝ) (c : ℕ → ℝ) (hc : ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (x - a) ^ n) ∧ f ⟨x, hx⟩ = ∑' n : ℕ, c n * (x - a) ^ n) : HasFPowerSeriesWithinOnBall (SubtypeExtension (Set.Ioo (a - r) (a + r)) f) (FormalMultilinearSeries.ofScalars ℝ c) (Set.Ioo (a - r) (a + r)) a (ENNReal.ofReal r)

Lean source

Helper for Proposition 4.2.2: one-step coefficient recursion for iteratedFDerivSeries evaluated at all-ones.

open Classical lemma helperForProposition_4_2_2_iteratedFDerivSeriesCoeffOnes_step (c : ℕ → ℝ) (k n : ℕ) : (((FormalMultilinearSeries.ofScalars ℝ c).iteratedFDerivSeries (k + 1)).coeff n) (fun _ : Fin (k + 1) => (1 : ℝ)) = (n + 1 : ℝ) * (((FormalMultilinearSeries.ofScalars ℝ c).iteratedFDerivSeries k).coeff (n + 1)) (fun _ : Fin k => (1 : ℝ))

Lean source

Helper for Proposition 4.2.2: closed-form coefficients for iteratedFDerivSeries of ofScalars, evaluated at all-ones.

open Classical lemma helperForProposition_4_2_2_iteratedFDerivSeriesCoeffOnes_closedForm (c : ℕ → ℝ) (k n : ℕ) : (((FormalMultilinearSeries.ofScalars ℝ c).iteratedFDerivSeries k).coeff n) (fun _ : Fin k => (1 : ℝ)) = c (n + k) * ((Nat.factorial (n + k) : ℝ) / (Nat.factorial n : ℝ))

Lean source

Helper for Proposition 4.2.2: explicit term formula for iteratedFDerivSeries of ofScalars.

open Classical lemma helperForProposition_4_2_2_iteratedFDerivSeries_term_formula (c : ℕ → ℝ) (k n : ℕ) (y : ℝ) : (((FormalMultilinearSeries.ofScalars ℝ c).iteratedFDerivSeries k n) (fun _ : Fin n => y)) (fun _ : Fin k => (1 : ℝ)) = c (n + k) * ((Nat.factorial (n + k) : ℝ) / (Nat.factorial n : ℝ)) * y ^ n

Lean source

Helper for Proposition 4.2.2: series formula for iteratedDerivWithin on the interval.

open Classical lemma helperForProposition_4_2_2_iteratedDerivWithin_series_formula {a r : ℝ} (hr : 0 < r) (f : Set.Ioo (a - r) (a + r) → ℝ) (c : ℕ → ℝ) (hc : ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (x - a) ^ n) ∧ f ⟨x, hx⟩ = ∑' n : ℕ, c n * (x - a) ^ n) : ∀ k x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c (n + k) * ((Nat.factorial (n + k) : ℝ) / (Nat.factorial n : ℝ)) * (x - a) ^ n) ∧ iteratedDerivWithin k (SubtypeExtension (Set.Ioo (a - r) (a + r)) f) (Set.Ioo (a - r) (a + r)) x = ∑' n : ℕ, c (n + k) * ((Nat.factorial (n + k) : ℝ) / (Nat.factorial n : ℝ)) * (x - a) ^ n

Lean source

Helper for Proposition 4.2.2: the interval power-series representation implies that all iterated subtype derivatives are once differentiable.

open Classical lemma helperForProposition_4_2_2_onceDifferentiable_all_orders_of_analytic {a r : ℝ} (hr : 0 < r) (f : Set.Ioo (a - r) (a + r) → ℝ) (c : ℕ → ℝ) (hc : ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (x - a) ^ n) ∧ f ⟨x, hx⟩ = ∑' n : ℕ, c n * (x - a) ^ n) : ∀ n : ℕ, IsOnceDifferentiableSub (Set.Ioo (a - r) (a + r)) (IteratedDerivativeSub (Set.Ioo (a - r) (a + r)) f n)

4.2 — Real Analytic Functions — Part 2

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Proposition 4.2.3: for f(x) = |x|, the function is not differentiable at 0, hence not real analytic at 0; moreover, for every a ≠ 0, f is real analytic at a.

open Classical theorem abs_notDifferentiableAt_zero_notAnalyticAt_zero_analyticAt_nonzero : ¬DifferentiableAt ℝ (fun x : ℝ => |x|) 0 ∧ ¬AnalyticAt ℝ (fun x : ℝ => |x|) 0 ∧ ∀ a : ℝ, a ≠ 0 → AnalyticAt ℝ (fun x : ℝ => |x|) a

Lean source

Theorem 4.2.1: if f : E → ℝ is real analytic on E, then f is smooth on E. Moreover, for every integer k ≥ 0, the iterated derivative f^(k) exists at every point of E and is real analytic on E.

open Classical theorem realAnalyticOn_isSmooth_and_iteratedDerivative_realAnalytic {E : Set ℝ} (f : E → ℝ) (hf : IsRealAnalyticOn E f) : IsSmoothSub E f ∧ ∀ k : ℕ, IsOnceDifferentiableSub E (IteratedDerivativeSub E f k) ∧ IsRealAnalyticOn E (IteratedDerivativeSub E f k)

Lean source

Theorem 4.2.2 (Taylor's formula): let E ⊆ ℝ, let a : E be an interior point, and let f : E → ℝ be real analytic at a. If for some r > 0 and coefficients c : ℕ → ℝ one has f(x) = ∑' n, c n (x-a)^n for all x ∈ (a-r, a+r), then for every k ≥ 0, f^(k)(a) = k! * c_k; in particular, f(x) = ∑' n, (f^(n)(a) / n!) (x-a)^n on (a-r, a+r).

open Classical theorem taylorFormula_iteratedDerivativeSub_eq_factorial_mul_coeff {E : Set ℝ} (f : E → ℝ) (a : E) (hf : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (c : ℕ → ℝ) (hsummable : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hseries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) : (∀ k : ℕ, IteratedDerivativeSub E f k a = (Nat.factorial k : ℝ) * c k) ∧ ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, (IteratedDerivativeSub E f n a / (Nat.factorial n : ℝ)) * (x - (a : ℝ)) ^ n

Lean source

Theorem 4.2.3 (Uniqueness of power series): let E ⊆ ℝ, let a be an interior point of E, and let f : E → ℝ. If there are radii R_c, R_d > 0 and coefficient sequences c, d : ℕ → ℝ such that for every x ∈ E with |x-a| < R_c one has f(x) = ∑' n, c n * (x-a)^n with convergence, and for every x ∈ E with |x-a| < R_d one has f(x) = ∑' n, d n * (x-a)^n with convergence, then c n = d n for all n.

open Classical theorem powerSeries_coefficients_unique {E : Set ℝ} (f : E → ℝ) (a : E) (ha : (a : ℝ) ∈ interior E) (c d : ℕ → ℝ) {R_c R_d : ℝ} (hR_c : 0 < R_c) (hR_d : 0 < R_d) (hc : ∀ x : ℝ, ∀ hxE : x ∈ E, |x - (a : ℝ)| < R_c → Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n) ∧ f ⟨x, hxE⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) (hd : ∀ x : ℝ, ∀ hxE : x ∈ E, |x - (a : ℝ)| < R_d → Summable (fun n : ℕ => d n * (x - (a : ℝ)) ^ n) ∧ f ⟨x, hxE⟩ = ∑' n : ℕ, d n * (x - (a : ℝ)) ^ n) : ∀ n : ℕ, c n = d n

Lean source

Proposition 4.2.4: for every real number x with |x| < 1, the geometric series ∑' n : ℕ, x^n converges and equals 1 / (1 - x).

open Classical theorem geometricSeries_converges_and_tsum_eq_inv_one_sub (x : ℝ) (hx : |x| < 1) : Summable (fun n : ℕ => x ^ n) ∧ (∑' n : ℕ, x ^ n) = 1 / (1 - x)

Lean source

Proposition 4.2.5: if x : ℝ satisfies |x - 1/2| < 1/2, then the geometric series ∑' n : ℕ, 2^(n+1) * (x - 1/2)^n converges and equals 1 / (1 - x).

open Classical theorem centeredGeometricSeries_converges_and_tsum_eq_inv_one_sub (x : ℝ) (hx : |x - (1 / 2 : ℝ)| < (1 / 2 : ℝ)) : Summable (fun n : ℕ => (2 : ℝ) ^ (n + 1) * (x - (1 / 2 : ℝ)) ^ n) ∧ (∑' n : ℕ, (2 : ℝ) ^ (n + 1) * (x - (1 / 2 : ℝ)) ^ n) = 1 / (1 - x)

Lean source

Helper for Proposition 4.2.3: |x| is not real analytic at 0.

open Classical lemma helperForProposition_4_2_3_notAnalyticAt_zero_abs : ¬AnalyticAt ℝ (fun x : ℝ => |x|) 0

Lean source

Helper for Proposition 4.2.3: at positive points, |x| agrees locally with x.

open Classical lemma helperForProposition_4_2_3_eventuallyEq_abs_id_of_pos {a : ℝ} (ha : 0 < a) : (fun x : ℝ => |x|) =ᶠ[nhds a] (fun x : ℝ => x)

Lean source

Helper for Proposition 4.2.3: at negative points, |x| agrees locally with -x.

open Classical lemma helperForProposition_4_2_3_eventuallyEq_abs_negId_of_neg {a : ℝ} (ha : a < 0) : (fun x : ℝ => |x|) =ᶠ[nhds a] (fun x : ℝ => -x)

Lean source

Helper for Proposition 4.2.3: |x| is real analytic at every nonzero real point.

open Classical lemma helperForProposition_4_2_3_analyticAt_abs_of_ne_zero {a : ℝ} (ha : a ≠ 0) : AnalyticAt ℝ (fun x : ℝ => |x|) a

Lean source

Helper for Theorem 4.2.1: every open subset of ℝ has no isolated points.

open Classical lemma helperForTheorem_4_2_1_hasNoIsolatedPoints_of_isOpen {E : Set ℝ} (hE : IsOpen E) : HasNoIsolatedPoints E

Lean source

Helper for Theorem 4.2.1: local interval and ambient set are eventually equal at the center.

open Classical lemma helperForTheorem_4_2_1_intervalEventuallyEq_set_at_center {E : Set ℝ} {a r : ℝ} (hr : 0 < r) (hI : Set.Ioo (a - r) (a + r) ⊆ E) : Set.Ioo (a - r) (a + r) =ᶠ[nhds a] E

Lean source

Helper for Theorem 4.2.1: a pointwise real-analytic witness yields analytic-within-at for the canonical extension.

open Classical lemma helperForTheorem_4_2_1_analyticWithinAtSubtypeExtension_of_IsRealAnalyticAt {E : Set ℝ} (f : E → ℝ) (a : E) (ha : IsRealAnalyticAt E f a) : AnalyticWithinAt ℝ (SubtypeExtension E f) E (a : ℝ)

Lean source

Helper for Theorem 4.2.1: on open sets, analyticity of the canonical extension implies the custom pointwise real-analytic property.

open Classical lemma helperForTheorem_4_2_1_isRealAnalyticAt_of_analyticWithinAtSubtypeExtension_open {E : Set ℝ} (g : E → ℝ) (hE : IsOpen E) (a : E) (ha : AnalyticWithinAt ℝ (SubtypeExtension E g) E (a : ℝ)) : IsRealAnalyticAt E g a

Lean source

Helper for Theorem 4.2.1: convert the custom IsRealAnalyticOn notion to mathlib AnalyticOn for the canonical extension.

open Classical lemma helperForTheorem_4_2_1_analyticOnSubtypeExtension_of_IsRealAnalyticOn {E : Set ℝ} (f : E → ℝ) (hf : IsRealAnalyticOn E f) : AnalyticOn ℝ (SubtypeExtension E f) E

Lean source

Helper for Theorem 4.2.1: convert analyticity of the canonical extension on an open set back to the custom IsRealAnalyticOn predicate.

open Classical lemma helperForTheorem_4_2_1_isRealAnalyticOn_of_analyticOnSubtypeExtension {E : Set ℝ} (g : E → ℝ) (hE : IsOpen E) (hAnalytic : AnalyticOn ℝ (SubtypeExtension E g) E) : IsRealAnalyticOn E g

Lean source

Helper for Theorem 4.2.1: analyticity of an extension propagates to all iterated subtype derivatives.

open Classical lemma helperForTheorem_4_2_1_analyticOnSubtypeExtension_iteratedDerivativeSub {E : Set ℝ} (f : E → ℝ) (hE : IsOpen E) (hAnalytic : AnalyticOn ℝ (SubtypeExtension E f) E) : ∀ k : ℕ, AnalyticOn ℝ (SubtypeExtension E (IteratedDerivativeSub E f k)) E

Lean source

Helper for Theorem 4.2.1: real-analytic-on implies once differentiable on the set.

open Classical lemma helperForTheorem_4_2_1_isOnceDifferentiableSub_of_IsRealAnalyticOn {E : Set ℝ} (g : E → ℝ) (hg : IsRealAnalyticOn E g) : IsOnceDifferentiableSub E g

Lean source

Helper for Theorem 4.2.2: iterated derivatives within eventually equal sets agree at the center.

open Classical lemma helperForTheorem_4_2_2_iteratedDerivWithin_setChange_at_center {g : ℝ → ℝ} {a : ℝ} {s t : Set ℝ} (hst : s =ᶠ[nhds a] t) : ∀ k : ℕ, iteratedDerivWithin k g s a = iteratedDerivWithin k g t a

Lean source

Helper for Theorem 4.2.2: identify ambient and interval iterated subtype derivatives at the center.

open Classical lemma helperForTheorem_4_2_2_iteratedDerivativeSub_eq_intervalRestriction_at_center {E : Set ℝ} (f : E → ℝ) (a : E) {r : ℝ} (hr : 0 < r) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (haI : (a : ℝ) ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) : ∀ k : ℕ, IteratedDerivativeSub E f k a = IteratedDerivativeSub (Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) (fun x : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) => f ⟨x, hI x.property⟩) k ⟨(a : ℝ), haI⟩

Lean source

Helper for Theorem 4.2.2: the interval center value of the iterated derivative extracts factorial times the coefficient.

open Classical lemma helperForTheorem_4_2_2_interval_center_factorial_coeff {a r : ℝ} (hr : 0 < r) (f : Set.Ioo (a - r) (a + r) → ℝ) (c : ℕ → ℝ) (hseries : ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (x - a) ^ n) ∧ f ⟨x, hx⟩ = ∑' n : ℕ, c n * (x - a) ^ n) (haI : a ∈ Set.Ioo (a - r) (a + r)) : ∀ k : ℕ, IteratedDerivativeSub (Set.Ioo (a - r) (a + r)) f k ⟨a, haI⟩ = (Nat.factorial k : ℝ) * c k

Lean source

Helper for Theorem 4.2.2: divide the factorial identity to recover coefficients.

open Classical lemma helperForTheorem_4_2_2_coeff_rewrite_from_factorial_identity {E : Set ℝ} (f : E → ℝ) (a : E) (c : ℕ → ℝ) (hfac : ∀ n : ℕ, IteratedDerivativeSub E f n a = (Nat.factorial n : ℝ) * c n) : ∀ n : ℕ, IteratedDerivativeSub E f n a / (Nat.factorial n : ℝ) = c n

Lean source

Helper for Theorem 4.2.3: from interior membership and two positive radii, construct a common positive interval radius contained in E and bounded by both given radii.

open Classical lemma helperForTheorem_4_2_3_exists_commonIntervalRadius {E : Set ℝ} {a : ℝ} (ha : a ∈ interior E) {R_c R_d : ℝ} (hR_c : 0 < R_c) (hR_d : 0 < R_d) : ∃ r : ℝ, 0 < r ∧ r ≤ R_c ∧ r ≤ R_d ∧ Set.Ioo (a - r) (a + r) ⊆ E

Lean source

Helper for Theorem 4.2.3: transport power-series data from a radius condition |x-a| < R on E to data on a smaller symmetric interval around a.

open Classical lemma helperForTheorem_4_2_3_seriesData_on_commonInterval {E : Set ℝ} {f : E → ℝ} {a r R : ℝ} {u : ℕ → ℝ} (hI : Set.Ioo (a - r) (a + r) ⊆ E) (hrR : r ≤ R) (hu : ∀ x : ℝ, ∀ hxE : x ∈ E, |x - a| < R → Summable (fun n : ℕ => u n * (x - a) ^ n) ∧ f ⟨x, hxE⟩ = ∑' n : ℕ, u n * (x - a) ^ n) : ∀ x : ℝ, ∀ hx : x ∈ Set.Ioo (a - r) (a + r), Summable (fun n : ℕ => u n * (x - a) ^ n) ∧ f ⟨x, hI hx⟩ = ∑' n : ℕ, u n * (x - a) ^ n

Lean source

Helper for Theorem 4.2.3: interval power-series data gives real analyticity at the center.

open Classical lemma helperForTheorem_4_2_3_isRealAnalyticAt_of_intervalSeriesData {E : Set ℝ} (f : E → ℝ) (a : E) (ha : (a : ℝ) ∈ interior E) {r : ℝ} (hr : 0 < r) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (u : ℕ → ℝ) (hseriesData : ∀ x : ℝ, ∀ hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => u n * (x - (a : ℝ)) ^ n) ∧ f ⟨x, hI hx⟩ = ∑' n : ℕ, u n * (x - (a : ℝ)) ^ n) : IsRealAnalyticAt E f a

Lean source

Helper for Theorem 4.2.3: cancel a nonzero factorial factor in two identities for the same iterated derivative sequence.

open Classical lemma helperForTheorem_4_2_3_cancel_factorial {E : Set ℝ} {f : E → ℝ} {a : E} {c d : ℕ → ℝ} (hc : ∀ n : ℕ, IteratedDerivativeSub E f n a = (Nat.factorial n : ℝ) * c n) (hd : ∀ n : ℕ, IteratedDerivativeSub E f n a = (Nat.factorial n : ℝ) * d n) : ∀ n : ℕ, c n = d n

Lean source

Helper for Proposition 4.2.4: convert |x| < 1 into the norm inequality ‖x‖ < 1 used by geometric-series lemmas.

open Classical lemma helperForProposition_4_2_4_norm_lt_one_of_abs_lt_one {x : ℝ} (hx : |x| < 1) : ‖x‖ < 1

Lean source

Helper for Proposition 4.2.4: under ‖x‖ < 1, the geometric series has sum (1 - x)⁻¹.

open Classical lemma helperForProposition_4_2_4_hasSum_geometric {x : ℝ} (hx : ‖x‖ < 1) : HasSum (fun n : ℕ => x ^ n) ((1 - x)⁻¹)

Lean source

Helper for Proposition 4.2.4: rewrite the geometric-series sum in the form 1 / (1 - x).

open Classical lemma helperForProposition_4_2_4_tsum_eq_one_div_form {x : ℝ} (hx : ‖x‖ < 1) : (∑' n : ℕ, x ^ n) = 1 / (1 - x)

Lean source

Helper for Proposition 4.2.5: convert |x - 1/2| < 1/2 into the norm bound ‖2 * (x - 1/2)‖ < 1 used by geometric-series lemmas.

open Classical lemma helperForProposition_4_2_5_norm_lt_one_scaledShift {x : ℝ} (hx : |x - (1 / 2 : ℝ)| < (1 / 2 : ℝ)) : ‖(2 : ℝ) * (x - (1 / 2 : ℝ))‖ < 1

Lean source

Helper for Proposition 4.2.5: rewrite the centered-series term as a scaled geometric term in the ratio 2 * (x - 1/2).

open Classical lemma helperForProposition_4_2_5_term_rewrite_to_scaledGeometric (x : ℝ) (n : ℕ) : (2 : ℝ) ^ (n + 1) * (x - (1 / 2 : ℝ)) ^ n = 2 * ((2 : ℝ) * (x - (1 / 2 : ℝ))) ^ n

Lean source

Helper for Proposition 4.2.5: the centered geometric series has the closed-form sum 2 * (1 - 2*(x - 1/2))⁻¹.

open Classical lemma helperForProposition_4_2_5_hasSum_centeredSeries {x : ℝ} (hx : |x - (1 / 2 : ℝ)| < (1 / 2 : ℝ)) : HasSum (fun n : ℕ => (2 : ℝ) ^ (n + 1) * (x - (1 / 2 : ℝ)) ^ n) (2 * (1 - (2 : ℝ) * (x - (1 / 2 : ℝ)))⁻¹)

Lean source

Helper for Proposition 4.2.5: simplify the centered closed form to 1 / (1 - x).

open Classical lemma helperForProposition_4_2_5_sumValue_rewrite (x : ℝ) : 2 * (1 - (2 : ℝ) * (x - (1 / 2 : ℝ)))⁻¹ = 1 / (1 - x)

4.2 — Real Analytic Functions — Part 3

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Proposition 4.2.6: let n : ℕ and a c : ℝ, and define f(x) = c * (x - a)^n. Then f is infinitely differentiable on ℝ. Moreover, for every k with k ≤ n, iteratedDeriv k f x = c * (n! / (n-k)!) * (x-a)^(n-k) for all x : ℝ, and for every k > n, iteratedDeriv k f x = 0 for all x : ℝ.

open Classical theorem iteratedDeriv_monomial_shifted_const_mul (n : ℕ) (a c : ℝ) : ContDiff ℝ ⊤ (fun x : ℝ => c * (x - a) ^ n) ∧ (∀ k : ℕ, k ≤ n → ∀ x : ℝ, iteratedDeriv k (fun y : ℝ => c * (y - a) ^ n) x = c * ((Nat.factorial n : ℝ) / (Nat.factorial (n - k) : ℝ)) * (x - a) ^ (n - k)) ∧ (∀ k : ℕ, n < k → ∀ x : ℝ, iteratedDeriv k (fun y : ℝ => c * (y - a) ^ n) x = 0)

Lean source

Proposition 4.2.7: let a, b ∈ ℝ and n ≥ 0 be an integer. Then for every x ∈ ℝ, (x - a)^n = ∑_{m=0}^n (n! / (m!(n-m)!)) (b - a)^(n-m) (x - b)^m.

open Classical theorem shiftedPower_eq_sum_factorial_ratio_mul_shiftedPowers (a b : ℝ) (n : ℕ) (x : ℝ) : (x - a) ^ n = Finset.sum (Finset.range (n + 1)) (fun m => ((Nat.factorial n : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial (n - m) : ℝ))) * (b - a) ^ (n - m) * (x - b) ^ m)

Lean source

Proposition 4.2.8: if r > 0 and |x| < r, then r / (r - x) = ∑' n = 0..∞, x^n r^{-n}.

open Classical theorem scaledGeometricSeries_tsum_eq_r_div_r_sub (r x : ℝ) (hr : 0 < r) (hx : |x| < r) : r / (r - x) = ∑' n : ℕ, x ^ n * (r⁻¹) ^ n

Lean source

Proposition 4.2.9: if r > 0, m : ℕ, and |x| < r, then r / (r - x)^(m+1) equals the binomial-coefficient power series, written in the reindexed form ∑' n, ((n+m)!/(m!n!)) x^n r^{-(n+m)} (equivalent to summing from n = m); moreover this series converges absolutely for every such x.

open Classical theorem scaledGeometricSeries_higherDerivative_tsum_and_absConvergence (r x : ℝ) (m : ℕ) (hr : 0 < r) (hx : |x| < r) : r / (r - x) ^ (m + 1) = ∑' n : ℕ, ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * x ^ n * (r⁻¹) ^ (n + m) ∧ Summable (fun n : ℕ => |((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * x ^ n * (r⁻¹) ^ (n + m)|)

Lean source

Proposition 4.2.10: let E ⊆ ℝ, let a be an interior point of E, and let f : E → ℝ be real analytic at a with a power-series expansion f(x) = ∑' n, c n * (x-a)^n converging for all x ∈ (a-r, a+r) for some r > 0. If (b-s, b+s) with s > 0 is any open interval contained in (a-r, a+r), then |a-b| ≤ r-s; in particular |a-b| < r.

open Classical theorem center_distance_le_radius_subradius_of_interval_subset {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) :

Lean source

Proposition 4.2.11: under the same hypotheses and notation as the preceding power-series setup, for every ε with 0 < ε < r there exists C > 0 such that |c n| ≤ C * (r - ε)^{-n} for all integers n ≥ 0 (encoded with n : ℕ).

open Classical theorem powerSeries_coeff_norm_le_of_subradius {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) (ε : ℝ) (hε0 : 0 < ε) (hεr : ε < r) : ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, |c n| ≤ C * ((r - ε)⁻¹) ^ n

Lean source

Proposition 4.2.12: under the hypotheses and notation of the local power-series setup, if (b-s, b+s) ⊆ (a-r, a+r) with s > 0, then for every m : ℕ the shifted coefficient series ∑' n, ((n+m)!/(m!n!)) * (b-a)^n * c (n+m) (equivalently the original sum from n = m) is absolutely convergent; hence the corresponding d_m is well-defined.

open Classical theorem shifted_coeffSeries_absSummable_of_interval_subset {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) : ∀ m : ℕ, Summable (fun n : ℕ => |((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m)|)

Lean source

Helper for Proposition 4.2.6: smoothness of the shifted monomial with constant factor.

open Classical lemma helperForProposition_4_2_6_contDiff_shiftedMonomial_constMul (n : ℕ) (a c : ℝ) : ContDiff ℝ ⊤ (fun x : ℝ => c * (x - a) ^ n)

Lean source

Helper for Proposition 4.2.6: explicit iterated derivative formula for (x - a)^n with falling-product coefficient.

open Classical lemma helperForProposition_4_2_6_iteratedDeriv_shiftedMonomial_fallingProd (n k : ℕ) (a x : ℝ) : iteratedDeriv k (fun y : ℝ => (y - a) ^ n) x = Finset.prod (Finset.range k) (fun i => ((n : ℝ) - i)) * (x - a) ^ (n - k)

Lean source

Helper for Proposition 4.2.6: pull the constant factor c out of iterated derivatives of the shifted monomial.

open Classical lemma helperForProposition_4_2_6_iteratedDeriv_constMul_shiftedMonomial_fallingProd (n k : ℕ) (a c x : ℝ) : iteratedDeriv k (fun y : ℝ => c * (y - a) ^ n) x = c * (Finset.prod (Finset.range k) (fun i => ((n : ℝ) - i)) * (x - a) ^ (n - k))

Lean source

Helper for Proposition 4.2.6: convert the falling-product coefficient to the factorial-ratio coefficient when k ≤ n.

open Classical lemma helperForProposition_4_2_6_fallingProd_eq_factorialRatio (n : ℕ) {k : ℕ} (hk : k ≤ n) : Finset.prod (Finset.range k) (fun i => ((n : ℝ) - i)) = (Nat.factorial n : ℝ) / (Nat.factorial (n - k) : ℝ)

Lean source

Helper for Proposition 4.2.6: the falling-product coefficient vanishes when k > n.

open Classical lemma helperForProposition_4_2_6_fallingProd_eq_zero_of_lt (n : ℕ) {k : ℕ} (hnk : n < k) : Finset.prod (Finset.range k) (fun i => ((n : ℝ) - i)) = 0

Lean source

Helper for Proposition 4.2.8: convert |x| < r with r > 0 into the geometric-series ratio bound |x / r| < 1.

open Classical lemma helperForProposition_4_2_8_absRatio_lt_one (r x : ℝ) (hr : 0 < r) (hx : |x| < r) :

Lean source

Helper for Proposition 4.2.8: rewrite powers of x / r into x^n * (r⁻¹)^n.

open Classical lemma helperForProposition_4_2_8_geometricRatioPow_rewrite (r x : ℝ) : (fun n : ℕ => (x / r) ^ n) = (fun n : ℕ => x ^ n * (r⁻¹) ^ n)

Lean source

Helper for Proposition 4.2.8: identify the scaled rational expression with the closed form of the geometric series.

open Classical lemma helperForProposition_4_2_8_scaledFraction_eq_geometricClosedForm (r x : ℝ) (hr : 0 < r) (hx : |x| < r) : r / (r - x) = (1 - x / r)⁻¹

Lean source

Helper for Proposition 4.2.9: rewrite the factorial-ratio summand into a constant multiple of the standard choose-geometric term.

open Classical lemma helperForProposition_4_2_9_factorialRatioTerm_eq_scaledChooseGeometricTerm (r x : ℝ) (m n : ℕ) : ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * x ^ n * (r⁻¹) ^ (n + m) = (r⁻¹) ^ m * ((Nat.choose (n + m) m : ℝ) * (x / r) ^ n)

Lean source

Helper for Proposition 4.2.9: rewrite the left-hand side as the scaled closed form matching the choose-geometric generating function.

open Classical lemma helperForProposition_4_2_9_lhs_eq_scaledClosedForm (r x : ℝ) (m : ℕ) (hr : 0 < r) (hx : |x| < r) : r / (r - x) ^ (m + 1) = (r⁻¹) ^ m * (1 / (1 - x / r) ^ (m + 1))

Lean source

Helper for Proposition 4.2.9: evaluate the reindexed factorial-ratio series as the same scaled closed form.

open Classical lemma helperForProposition_4_2_9_tsum_targetTerm_eq_scaledClosedForm (r x : ℝ) (m : ℕ) (hr : 0 < r) (hx : |x| < r) : (∑' n : ℕ, ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * x ^ n * (r⁻¹) ^ (n + m)) = (r⁻¹) ^ m * (1 / (1 - x / r) ^ (m + 1))

Lean source

Helper for Proposition 4.2.9: absolute convergence of the reindexed factorial-ratio series for |x| < r.

open Classical lemma helperForProposition_4_2_9_summable_abs_targetTerm (r x : ℝ) (m : ℕ) (hr : 0 < r) (hx : |x| < r) : Summable (fun n : ℕ => |((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * x ^ n * (r⁻¹) ^ (n + m)|)

Lean source

Helper for Proposition 4.2.10: if s > 0 then (b - s, b + s) is nonempty.

open Classical lemma helperForProposition_4_2_10_interval_left_right_strict (b s : ℝ) (hs : 0 < s) : b - s < b + s

Lean source

Helper for Proposition 4.2.10: inclusion of open intervals yields endpoint bounds.

open Classical lemma helperForProposition_4_2_10_endpoint_bounds_of_Ioo_subset (a0 b r s : ℝ) (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo (a0 - r) (a0 + r)) : (a0 - r ≤ b - s) ∧ (b + s ≤ a0 + r)

Lean source

Helper for Proposition 4.2.10: endpoint bounds control center distance by r - s.

open Classical lemma helperForProposition_4_2_10_abs_le_radius_subradius (a0 b r s : ℝ) (hleft : a0 - r ≤ b - s) (hright : b + s ≤ a0 + r) :

Lean source

Helper for Proposition 4.2.10: a bound by r - s improves to a strict bound by r.

open Classical lemma helperForProposition_4_2_10_abs_lt_radius_of_subradius_bound (a0 b r s : ℝ) (habs : |a0 - b| ≤ r - s) (hs : 0 < s) :

Lean source

Helper for Proposition 4.2.11: the point a + (r - ε) lies in (a-r, a+r) whenever 0 < ε < r.

open Classical lemma helperForProposition_4_2_11_subradius_point_mem_interval (a r ε : ℝ) (hr : 0 < r) (hε0 : 0 < ε) (hεr : ε < r) : a + (r - ε) ∈ Set.Ioo (a - r) (a + r)

Lean source

Helper for Proposition 4.2.11: evaluating the interval summability hypothesis at x = a + (r - ε) yields summability of n ↦ c n * (r - ε)^n.

open Classical lemma helperForProposition_4_2_11_summable_scaled_terms_at_subradius {E : Set ℝ} (a : E) {r ε : ℝ} (c : ℕ → ℝ) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hr : 0 < r) (hε0 : 0 < ε) (hεr : ε < r) : Summable (fun n : ℕ => c n * (r - ε) ^ n)

Lean source

Helper for Proposition 4.2.11: every summable real sequence has a uniform absolute-value bound.

open Classical lemma helperForProposition_4_2_11_exists_abs_bound_of_summable (u : ℕ → ℝ) (hu : Summable u) : ∃ B : ℝ, ∀ n : ℕ, |u n| ≤ B

Lean source

Helper for Proposition 4.2.11: from a uniform bound on |c n * ρ^n|, recover a coefficient bound with inverse powers.

open Classical lemma helperForProposition_4_2_11_coeff_bound_from_scaled_bound (c : ℕ → ℝ) {ρ K : ℝ} (hρ : 0 < ρ) (hK : ∀ n : ℕ, |c n * ρ ^ n| ≤ K) : ∀ n : ℕ, |c n| ≤ K * (ρ⁻¹) ^ n

4.2 — Real Analytic Functions — Part 4

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Proposition 4.2.13: assume the hypotheses and notation of the shifted power-series setup centered at a, and let d m = ∑' n, ((n+m)!/(m!n!)) * (b-a)^n * c (n+m), with this defining series convergent for each m. Then for every ε with 0 < ε < s, there exists C > 0 such that |d m| ≤ C * (s - ε)^{-m} for all integers m ≥ 0 (encoded as m : ℕ).

open Classical theorem shifted_coefficients_norm_le_of_subradius {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) (d : ℕ → ℝ) (hdSummable : ∀ m : ℕ, Summable (fun n : ℕ => ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m))) (hd : ∀ m : ℕ, d m = ∑' n : ℕ, ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m)) (ε : ℝ) (hε0 : 0 < ε) (hεs : ε < s) : ∃ C : ℝ, 0 < C ∧ ∀ m : ℕ, |d m| ≤ C * ((s - ε)⁻¹) ^ m

Lean source

Proposition 4.2.14: assume the hypotheses and notation of the shifted power-series setup (with coefficients d). Then for every x ∈ (b-s, b+s), the power series ∑' m, d m * (x-b)^m is absolutely convergent, and one has f(x) = ∑' m, d m * (x-b)^m on that interval.

open Classical theorem shifted_powerSeries_absConvergent_and_eq_on_interval {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) (d : ℕ → ℝ) (hdSummable : ∀ m : ℕ, Summable (fun n : ℕ => ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m))) (hd : ∀ m : ℕ, d m = ∑' n : ℕ, ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m)) : ∀ x (hx : x ∈ Set.Ioo (b - s) (b + s)), Summable (fun m : ℕ => |d m * (x - b) ^ m|) ∧ f ⟨x, hI (hsub hx)⟩ = ∑' m : ℕ, d m * (x - b) ^ m

Lean source

Proposition 4.2.15: assume the hypotheses and notation of the local power-series setup centered at a. Then f is real analytic at every b ∈ (a-r, a+r).

open Classical theorem realAnalyticAt_every_point_of_localPowerSeriesInterval {E : Set ℝ} (a : E) (f : E → ℝ) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) : ∀ b (hb : b ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), IsRealAnalyticAt E f ⟨b, hI hb⟩

Lean source

Helper for Proposition 4.2.14: for a point in (b-s, b+s), one can choose ε with 0 < ε < s and still keep a strict gap |x-b| < s-ε.

open Classical lemma helperForProposition_4_2_14_exists_subradius_gap_at_point {b s x : ℝ} (hs : 0 < s) (hx : x ∈ Set.Ioo (b - s) (b + s)) : ∃ ε : ℝ, 0 < ε ∧ ε < s ∧ |x - b| < s - ε

Lean source

Helper for Proposition 4.2.14: the shifted series is absolutely summable at every point of (b-s, b+s).

open Classical lemma helperForProposition_4_2_14_absSummable_shifted_series_at_point {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) (d : ℕ → ℝ) (hdSummable : ∀ m : ℕ, Summable (fun n : ℕ => ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m))) (hd : ∀ m : ℕ, d m = ∑' n : ℕ, ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m)) : ∀ x (hx : x ∈ Set.Ioo (b - s) (b + s)), Summable (fun m : ℕ => |d m * (x - b) ^ m|)

Lean source

Helper for Proposition 4.2.14: expand the original power series around a at a point x ∈ (b-s, b+s) into a triangular finite sum in powers of (x - b).

open Classical lemma helperForProposition_4_2_14_expand_original_series_termwise {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) (x : ℝ) (hx : x ∈ Set.Ioo (b - s) (b + s)) : f ⟨x, hI (hsub hx)⟩ = ∑' n : ℕ, Finset.sum (Finset.range (n + 1)) (fun m => ((Nat.factorial n : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial (n - m) : ℝ))) * (b - (a : ℝ)) ^ (n - m) * c n * (x - b) ^ m)

Lean source

Helper for Proposition 4.2.14: each row sum in the triangular rearrangement is exactly d m * (x - b)^m.

open Classical lemma helperForProposition_4_2_14_row_tsum_eq_d_times_shiftedPower {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) (d : ℕ → ℝ) (hdSummable : ∀ m : ℕ, Summable (fun n : ℕ => ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m))) (hd : ∀ m : ℕ, d m = ∑' n : ℕ, ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m)) (x : ℝ) (m : ℕ) : (∑' n : ℕ, (((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m)) * (x - b) ^ m) = d m * (x - b) ^ m

Lean source

Helper for Proposition 4.2.14: if a kernel on ℕ × ℕ is summable, then the triangular range-indexed tsum can be rewritten as the corresponding product-indexed tsum via antidiagonal reindexing.

open Classical lemma helperForProposition_4_2_14_triangular_reindex_tsum_via_prod (K : ℕ → ℕ → ℝ) (hK : Summable (fun p : ℕ × ℕ => K p.1 p.2)) : (∑' n : ℕ, Finset.sum (Finset.range (n + 1)) (fun m => K m (n - m))) = ∑' p : ℕ × ℕ, K p.1 p.2

Lean source

Helper for Proposition 4.2.14: once a product-indexed kernel is summable, its tsum can be identified with the shifted-coefficient series by evaluating row tsums.

open Classical lemma helperForProposition_4_2_14_prod_rows_to_shifted_coeff_tsum (K : ℕ → ℕ → ℝ) (d : ℕ → ℝ) (x b : ℝ) (hK : Summable (fun p : ℕ × ℕ => K p.1 p.2)) (hRows : ∀ m : ℕ, (∑' n : ℕ, K m n) = d m * (x - b) ^ m) : (∑' p : ℕ × ℕ, K p.1 p.2) = ∑' m : ℕ, d m * (x - b) ^ m

Lean source

Helper for Proposition 4.2.14: for fixed x ∈ (b-s, b+s), the product kernel (m,k) ↦ ((m+k)!/(m!k!)) * (b-a)^k * c (m+k) * (x-b)^m is summable on ℕ × ℕ.

open Classical lemma helperForProposition_4_2_14_summable_prod_shifted_kernel_at_point {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) (x : ℝ) (hx : x ∈ Set.Ioo (b - s) (b + s)) : Summable (fun p : ℕ × ℕ => ((Nat.factorial (p.1 + p.2) : ℝ) / ((Nat.factorial p.1 : ℝ) * (Nat.factorial p.2 : ℝ))) * (b - (a : ℝ)) ^ p.2 * c (p.1 + p.2) * (x - b) ^ p.1)

Lean source

Helper for Proposition 4.2.14: the triangular expansion obtained from the original series can be reordered into the shifted coefficient series.

open Classical lemma helperForProposition_4_2_14_triangular_tsum_to_shifted_coeff_tsum {E : Set ℝ} (a : E) (f : E → ℝ) (hanalytic : IsRealAnalyticAt E f a) {r : ℝ} (hr : 0 < r) (c : ℕ → ℝ) (hI : Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r) ⊆ E) (hsummable : ∀ x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r), Summable (fun n : ℕ => c n * (x - (a : ℝ)) ^ n)) (hpowerSeries : ∀ x (hx : x ∈ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)), f ⟨x, hI hx⟩ = ∑' n : ℕ, c n * (x - (a : ℝ)) ^ n) {b s : ℝ} (hs : 0 < s) (hsub : Set.Ioo (b - s) (b + s) ⊆ Set.Ioo ((a : ℝ) - r) ((a : ℝ) + r)) (d : ℕ → ℝ) (hdSummable : ∀ m : ℕ, Summable (fun n : ℕ => ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m))) (hd : ∀ m : ℕ, d m = ∑' n : ℕ, ((Nat.factorial (n + m) : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial n : ℝ))) * (b - (a : ℝ)) ^ n * c (n + m)) (x : ℝ) (hx : x ∈ Set.Ioo (b - s) (b + s)) : (∑' n : ℕ, Finset.sum (Finset.range (n + 1)) (fun m => ((Nat.factorial n : ℝ) / ((Nat.factorial m : ℝ) * (Nat.factorial (n - m) : ℝ))) * (b - (a : ℝ)) ^ (n - m) * c n * (x - b) ^ m)) = ∑' m : ℕ, d m * (x - b) ^ m

4.3 — Abel's Theorem

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Lemma 4.3.1 (Summation by parts formula): Let a, b : ℕ → ℝ with Tendsto a atTop (𝓝 A) and Tendsto b atTop (𝓝 B). If the series ∑' n, (a (n + 1) - a n) * b n converges, then the ordered partial sums of ∑ a (n + 1) * (b (n + 1) - b n) converge to A * B - a 0 * b 0 - ∑' n, (a (n + 1) - a n) * b n.

open scoped BigOperators lemma summation_by_parts_formula (a b : ℕ → ℝ) (A B : ℝ) (ha : Filter.Tendsto a Filter.atTop (nhds A)) (hb : Filter.Tendsto b Filter.atTop (nhds B)) (hconv : Summable (fun n : ℕ => (a (n + 1) - a n) * b n)) : Filter.Tendsto (fun N : ℕ => ∑ n ∈ Finset.range N, a (n + 1) * (b (n + 1) - b n)) Filter.atTop (nhds (A * B - a 0 * b 0 - ∑' n : ℕ, (a (n + 1) - a n) * b n))

Lean source

Theorem 4.3.1 (Abel's theorem): let f(x) = ∑' n, c_n (x-a)^n be a real power series centered at a with radius of convergence R and 0 < R. (1) If ∑' n, c_n R^n converges, then x ↦ ∑' n, c_n (x-a)^n tends to ∑' n, c_n R^n as x → a + R within (a - R, a + R). (2) If ∑' n, c_n (-R)^n converges, then x ↦ ∑' n, c_n (x-a)^n tends to ∑' n, c_n (-R)^n as x → a - R within (a - R, a + R).

open scoped BigOperators theorem FormalPowerSeriesCenteredAt.abel_theorem {a R : ℝ} (f : FormalPowerSeriesCenteredAt a) (hRpos : 0 < R) (hRadius : f.radiusOfConvergence = ENNReal.ofReal R) : (Summable (fun n : ℕ => f.coeff n * R ^ n) → Filter.Tendsto (fun x : ℝ => ∑' n : ℕ, f.coeff n * (x - a) ^ n) (nhdsWithin (a + R) (Set.Ioo (a - R) (a + R))) (nhds (∑' n : ℕ, f.coeff n * R ^ n))) ∧ (Summable (fun n : ℕ => f.coeff n * (-R) ^ n) → Filter.Tendsto (fun x : ℝ => ∑' n : ℕ, f.coeff n * (x - a) ^ n) (nhdsWithin (a - R) (Set.Ioo (a - R) (a + R))) (nhds (∑' n : ℕ, f.coeff n * (-R) ^ n)))

Lean source

Lemma 4.3.2: For all z₁, z₂ ∈ ℂ, we have z₁ * z₂ = z₂ * z₁ (equation (4.230)).

open scoped BigOperators lemma complex_mul_comm (z₁ z₂ : ℂ) : z₁ * z₂ = z₂ * z₁

Lean source

Lemma 4.3.3: For all z₁, z₂, z₃ ∈ ℂ, we have (z₁ * z₂) * z₃ = z₁ * (z₂ * z₃) (equation (4.u230)).

open scoped BigOperators lemma complex_mul_assoc (z₁ z₂ z₃ : ℂ) : (z₁ * z₂) * z₃ = z₁ * (z₂ * z₃)

Lean source

Lemma 4.3.4: For all z ∈ ℂ, we have z * 1_ℂ = z and 1_ℂ * z = z (equation (4.u230)).

open scoped BigOperators lemma complex_mul_one_and_one_mul (z : ℂ) : z * (1 : ℂ) = z ∧ (1 : ℂ) * z = z

Lean source

Lemma 4.3.5: For all z₁, z₂, z₃ ∈ ℂ, we have z₁ * (z₂ + z₃) = z₁ * z₂ + z₁ * z₃ (equation (4.u230)).

open scoped BigOperators lemma complex_mul_add_left_distrib (z₁ z₂ z₃ : ℂ) : z₁ * (z₂ + z₃) = z₁ * z₂ + z₁ * z₃

Lean source

Lemma 4.3.6: For all z₁, z₂, z₃ ∈ ℂ, we have (z₂ + z₃) * z₁ = z₂ * z₁ + z₃ * z₁ (equation (4.u230)).

open scoped BigOperators lemma complex_add_mul_right_distrib (z₁ z₂ z₃ : ℂ) : (z₂ + z₃) * z₁ = z₂ * z₁ + z₃ * z₁

Lean source

Helper for Lemma 4.3.1: one-step algebraic summation-by-parts identity.

open scoped BigOperators lemma helperForLemma_4_3_1_stepIdentity (a b : ℕ → ℝ) (n : ℕ) : (a (n + 1) - a n) * b n + a (n + 1) * (b (n + 1) - b n) = a (n + 1) * b (n + 1) - a n * b n

Lean source

Helper for Lemma 4.3.1: telescoping finite sum of the two-by-parts terms.

open scoped BigOperators lemma helperForLemma_4_3_1_telescoping (a b : ℕ → ℝ) : ∀ N : ℕ, (∑ n ∈ Finset.range N, ((a (n + 1) - a n) * b n + a (n + 1) * (b (n + 1) - b n))) = a N * b N - a 0 * b 0

Lean source

Helper for Lemma 4.3.1: finite summation-by-parts identity over Finset.range N.

open scoped BigOperators lemma helperForLemma_4_3_1_finiteFormula (a b : ℕ → ℝ) (N : ℕ) : (∑ n ∈ Finset.range N, (a (n + 1) - a n) * b n) = a N * b N - a 0 * b 0 - ∑ n ∈ Finset.range N, a (n + 1) * (b (n + 1) - b n)

Lean source

Helper for Lemma 4.3.1: convergence of ordered partial sums of a (n+1) * (b (n+1) - b n) to the summation-by-parts limit value.

open scoped BigOperators lemma helperForLemma_4_3_1_tendsto_partialSums (a b : ℕ → ℝ) (A B : ℝ) (ha : Filter.Tendsto a Filter.atTop (nhds A)) (hb : Filter.Tendsto b Filter.atTop (nhds B)) (hconv : Summable (fun n : ℕ => (a (n + 1) - a n) * b n)) : Filter.Tendsto (fun N : ℕ => ∑ n ∈ Finset.range N, a (n + 1) * (b (n + 1) - b n)) Filter.atTop (nhds (A * B - a 0 * b 0 - ∑' n : ℕ, (a (n + 1) - a n) * b n))

Lean source

Helper for Lemma 4.3.1: if the forward-difference series has a prescribed sum S, the summation-by-parts identity holds with that same S.

open scoped BigOperators lemma helperForLemma_4_3_1_identity_of_hasSumForwardDifference (a b : ℕ → ℝ) (A B S : ℝ) (ha : Filter.Tendsto a Filter.atTop (nhds A)) (hb : Filter.Tendsto b Filter.atTop (nhds B)) (hconv : Summable (fun n : ℕ => (a (n + 1) - a n) * b n)) (hhasSumForward : HasSum (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) S) : (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - S

Lean source

Helper for Lemma 4.3.1: a HasSum hypothesis for the forward-difference series immediately yields summability and the corresponding summation-by-parts identity.

open scoped BigOperators lemma helperForLemma_4_3_1_formula_with_hasSumForwardDifference (a b : ℕ → ℝ) (A B S : ℝ) (ha : Filter.Tendsto a Filter.atTop (nhds A)) (hb : Filter.Tendsto b Filter.atTop (nhds B)) (hconv : Summable (fun n : ℕ => (a (n + 1) - a n) * b n)) (hhasSumForward : HasSum (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) S) : Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) ∧ (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - S

Lean source

Helper for Lemma 4.3.1: an explicit forward-difference HasSum hypothesis already yields the textbook identity written with tsum.

open scoped BigOperators lemma helperForLemma_4_3_1_tsumIdentity_of_hasSumForwardDifference (a b : ℕ → ℝ) (A B S : ℝ) (ha : Filter.Tendsto a Filter.atTop (nhds A)) (hb : Filter.Tendsto b Filter.atTop (nhds B)) (hconv : Summable (fun n : ℕ => (a (n + 1) - a n) * b n)) (hhasSumForward : HasSum (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) S) : (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n)

Lean source

Helper for Lemma 4.3.1: a corrected summation-by-parts statement with an explicit forward HasSum hypothesis gives both forward summability and the textbook tsum identity.

open scoped BigOperators lemma helperForLemma_4_3_1_formula_with_explicitForwardHasSum (a b : ℕ → ℝ) (A B S : ℝ) (ha : Filter.Tendsto a Filter.atTop (nhds A)) (hb : Filter.Tendsto b Filter.atTop (nhds B)) (hconv : Summable (fun n : ℕ => (a (n + 1) - a n) * b n)) (hhasSumForward : HasSum (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) S) : Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) ∧ (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n)

Lean source

Helper for Lemma 4.3.1: unconditional forward-difference summability supplies the canonical HasSum witness at its tsum.

open scoped BigOperators lemma helperForLemma_4_3_1_hasSumForwardDifference_of_summable (a b : ℕ → ℝ) (hsummableForward : Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n))) : HasSum (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) (∑' n : ℕ, a (n + 1) * (b (n + 1) - b n))

Lean source

Helper for Lemma 4.3.1: assuming unconditional summability of the forward-difference series, the target summation-by-parts identity follows from uniqueness of the partial-sum limit.

open scoped BigOperators lemma helperForLemma_4_3_1_identity_of_summableForwardDifference (a b : ℕ → ℝ) (A B : ℝ) (ha : Filter.Tendsto a Filter.atTop (nhds A)) (hb : Filter.Tendsto b Filter.atTop (nhds B)) (hconv : Summable (fun n : ℕ => (a (n + 1) - a n) * b n)) (hsummableForward : Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n))) : (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n)

Lean source

Helper for Lemma 4.3.1: if forward-difference summability is given explicitly, the full summation-by-parts conclusion follows.

open scoped BigOperators lemma helperForLemma_4_3_1_formula_with_forwardSummable (a b : ℕ → ℝ) (A B : ℝ) (ha : Filter.Tendsto a Filter.atTop (nhds A)) (hb : Filter.Tendsto b Filter.atTop (nhds B)) (hconv : Summable (fun n : ℕ => (a (n + 1) - a n) * b n)) (hsummableForward : Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n))) : Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) ∧ (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n)

Lean source

Helper for Lemma 4.3.1: the alternating harmonic sequence tends to 0.

open scoped BigOperators lemma helperForLemma_4_3_1_tendsto_alternatingHarmonic : Filter.Tendsto (fun n : ℕ => (-1 : ℝ) ^ n / (n + 1)) Filter.atTop (nhds 0)

Lean source

Helper for Lemma 4.3.1: the forward difference of the alternating harmonic sequence is not unconditionally summable in ℝ.

open scoped BigOperators lemma helperForLemma_4_3_1_notSummable_alternatingHarmonicForwardDifference : ¬ Summable (fun n : ℕ => ((-1 : ℝ) ^ (n + 1) / (n + 2) - (-1 : ℝ) ^ n / (n + 1)))

Lean source

Helper for Lemma 4.3.1: for b n = (-1)^n/(n+1), the forward-difference series ∑ (b (n+1) - b n) is not summable.

open scoped BigOperators lemma helperForLemma_4_3_1_notSummable_forwardDifference_of_explicitB : let b : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / (n + 1) ¬ Summable (fun n : ℕ => b (n + 1) - b n)

Lean source

Helper for Lemma 4.3.1: for the explicit constant-one and alternating-harmonic data, the weighted forward-difference series is not summable.

open scoped BigOperators lemma helperForLemma_4_3_1_notSummable_weightedForwardDifference_of_explicitData : let a : ℕ → ℝ := fun _ => 1 let b : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / (n + 1) ¬ Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n))

Lean source

Helper for Lemma 4.3.1: the explicit constant-one and alternating-harmonic data with concrete limits A = 1, B = 0 satisfy the hypotheses while the weighted forward-difference series is not summable.

open scoped BigOperators lemma helperForLemma_4_3_1_explicitDataWithConcreteLimits : let a : ℕ → ℝ := fun _ => 1 let b : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / (n + 1) Filter.Tendsto a Filter.atTop (nhds (1 : ℝ)) ∧ Filter.Tendsto b Filter.atTop (nhds (0 : ℝ)) ∧ Summable (fun n : ℕ => (a (n + 1) - a n) * b n) ∧ ¬ Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n))

Lean source

Helper for Lemma 4.3.1: for the explicit constant-one and alternating-harmonic data, the ordered partial sums of the weighted forward-difference series converge to -1.

open scoped BigOperators lemma helperForLemma_4_3_1_explicitWeightedForwardDifference_partialSums_tendsto : let a : ℕ → ℝ := fun _ => 1 let b : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / (n + 1) Filter.Tendsto (fun N : ℕ => ∑ n ∈ Finset.range N, a (n + 1) * (b (n + 1) - b n)) Filter.atTop (nhds (-1 : ℝ))

Lean source

Helper for Lemma 4.3.1: there exists an explicit sequence whose ordered partial sums converge, while the sequence is not Summable in Lean's finite-subset summability sense.

open scoped BigOperators lemma helperForLemma_4_3_1_existsOrderedPartialSumsLimitWithoutSummable : ∃ (f : ℕ → ℝ) (L : ℝ), Filter.Tendsto (fun N : ℕ => ∑ n ∈ Finset.range N, f n) Filter.atTop (nhds L) ∧ ¬ Summable f

Lean source

Helper for Lemma 4.3.1: explicit data satisfy the hypotheses while the forward-difference series fails to be unconditionally summable.

open scoped BigOperators lemma helperForLemma_4_3_1_existsForwardCounterexample : ∃ (a b : ℕ → ℝ) (A B : ℝ), Filter.Tendsto a Filter.atTop (nhds A) ∧ Filter.Tendsto b Filter.atTop (nhds B) ∧ Summable (fun n : ℕ => (a (n + 1) - a n) * b n) ∧ ¬ Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n))

Lean source

Helper for Lemma 4.3.1: the stated hypotheses do not force unconditional summability of the forward-difference series in Lean's Summable sense.

open scoped BigOperators lemma helperForLemma_4_3_1_universalForwardSummableFalse : ¬ (∀ (a b : ℕ → ℝ) (A B : ℝ), Filter.Tendsto a Filter.atTop (nhds A) → Filter.Tendsto b Filter.atTop (nhds B) → Summable (fun n : ℕ => (a (n + 1) - a n) * b n) → Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)))

Lean source

Helper for Lemma 4.3.1: for the explicit constant-one and alternating-harmonic data at concrete limits, even the forward-summability implication alone is false.

open scoped BigOperators lemma helperForLemma_4_3_1_explicitForwardImplicationFalseAtConcreteLimits : let a : ℕ → ℝ := fun _ => 1 let b : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / (n + 1) ¬ (Filter.Tendsto a Filter.atTop (nhds (1 : ℝ)) → Filter.Tendsto b Filter.atTop (nhds (0 : ℝ)) → Summable (fun n : ℕ => (a (n + 1) - a n) * b n) → Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)))

Lean source

Helper for Lemma 4.3.1: the full universal statement of the textbook conclusion would imply a universal forward-summability implication, which is false.

open scoped BigOperators lemma helperForLemma_4_3_1_universalConclusionFalse : ¬ (∀ (a b : ℕ → ℝ) (A B : ℝ), Filter.Tendsto a Filter.atTop (nhds A) → Filter.Tendsto b Filter.atTop (nhds B) → Summable (fun n : ℕ => (a (n + 1) - a n) * b n) → (Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) ∧ (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n)))

Lean source

Helper for Lemma 4.3.1: there exists explicit data satisfying the hypotheses for which the full textbook conclusion fails in Lean's unconditional Summable sense.

open scoped BigOperators lemma helperForLemma_4_3_1_existsCounterexampleToConclusion : ∃ (a b : ℕ → ℝ) (A B : ℝ), Filter.Tendsto a Filter.atTop (nhds A) ∧ Filter.Tendsto b Filter.atTop (nhds B) ∧ Summable (fun n : ℕ => (a (n + 1) - a n) * b n) ∧ ¬ (Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) ∧ (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n))

Lean source

Helper for Lemma 4.3.1: the explicit constant-one and alternating-harmonic data at concrete limits A = 1, B = 0 refute the full textbook conclusion.

open scoped BigOperators lemma helperForLemma_4_3_1_explicitDataRefutesConclusionAtConcreteLimits : let a : ℕ → ℝ := fun _ => 1 let b : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / (n + 1) ¬ (Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) ∧ (∑' n : ℕ, (a (n + 1) - a n) * b n) = (1 : ℝ) * 0 - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n))

Lean source

Helper for Lemma 4.3.1: for the explicit constant-one and alternating-harmonic data, convergence of ∑ (a_{n+1} - a_n)b_n does not imply unconditional summability of ∑ a_{n+1}(b_{n+1} - b_n) in Lean.

open scoped BigOperators lemma helperForLemma_4_3_1_explicitForwardSummableImplicationFalse : let a : ℕ → ℝ := fun _ => 1 let b : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / (n + 1) ¬ (Summable (fun n : ℕ => (a (n + 1) - a n) * b n) → Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)))

Lean source

Helper for Lemma 4.3.1: any universal proof of the textbook conclusion contradicts the explicit counterexample already established above.

open scoped BigOperators lemma helperForLemma_4_3_1_universalProofLeadsToFalse (hUniversal : ∀ (a b : ℕ → ℝ) (A B : ℝ), Filter.Tendsto a Filter.atTop (nhds A) → Filter.Tendsto b Filter.atTop (nhds B) → Summable (fun n : ℕ => (a (n + 1) - a n) * b n) → (Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) ∧ (∑' n : ℕ, (a (n + 1) - a n) * b n) = A * B - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n))) : False

Lean source

Helper for Lemma 4.3.1: for the explicit constant-one and alternating-harmonic data at concrete limits, the implication from the stated hypotheses to the full textbook conclusion is false.

open scoped BigOperators lemma helperForLemma_4_3_1_explicitImplicationFalseAtConcreteLimits : let a : ℕ → ℝ := fun _ => 1 let b : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / (n + 1) ¬ (Filter.Tendsto a Filter.atTop (nhds (1 : ℝ)) → Filter.Tendsto b Filter.atTop (nhds (0 : ℝ)) → Summable (fun n : ℕ => (a (n + 1) - a n) * b n) → (Summable (fun n : ℕ => a (n + 1) * (b (n + 1) - b n)) ∧ (∑' n : ℕ, (a (n + 1) - a n) * b n) = (1 : ℝ) * 0 - a 0 * b 0 - ∑' n : ℕ, a (n + 1) * (b (n + 1) - b n)))

Lean source

Helper for Theorem 4.3.1: the right-endpoint affine normalization x ↦ (x-a)/R tends to 1 from below when x → a+R inside (a-R,a+R).

open scoped BigOperators lemma helperForTheorem_4_3_1_tendsto_affineToUnit_right {a R : ℝ} (hRpos : 0 < R) : Filter.Tendsto (fun x : ℝ => (x - a) / R) (nhdsWithin (a + R) (Set.Ioo (a - R) (a + R))) (nhdsWithin 1 (Set.Iio 1))

Lean source

Helper for Theorem 4.3.1: the left-endpoint affine normalization x ↦ (a-x)/R tends to 1 from below when x → a-R inside (a-R,a+R).

open scoped BigOperators lemma helperForTheorem_4_3_1_tendsto_affineToUnit_left {a R : ℝ} (hRpos : 0 < R) : Filter.Tendsto (fun x : ℝ => (a - x) / R) (nhdsWithin (a - R) (Set.Ioo (a - R) (a + R))) (nhdsWithin 1 (Set.Iio 1))

Lean source

Helper for Theorem 4.3.1: right-endpoint term normalization identity.

open scoped BigOperators lemma helperForTheorem_4_3_1_termRewrite_right {a R : ℝ} (hRpos : 0 < R) (f : FormalPowerSeriesCenteredAt a) (x : ℝ) (n : ℕ) : f.coeff n * R ^ n * (((x - a) / R) ^ n) = f.coeff n * (x - a) ^ n

Lean source

Helper for Theorem 4.3.1: left-endpoint term normalization identity.

open scoped BigOperators lemma helperForTheorem_4_3_1_termRewrite_left {a R : ℝ} (hRpos : 0 < R) (f : FormalPowerSeriesCenteredAt a) (x : ℝ) (n : ℕ) : f.coeff n * (-R) ^ n * (((a - x) / R) ^ n) = f.coeff n * (x - a) ^ n

4.4 — Multiplication of Power Series

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

The Cauchy-product coefficient sequence attached to c, d : ℕ → ℝ.

def cauchyProductCoeff (c d : ℕ → ℝ) (n : ℕ) : ℝ := ∑ m ∈ Finset.range (n + 1), c m * d (n - m)

Lean source

Theorem 4.4.1: if f, g : (a-r, a+r) → ℝ are analytic and have power-series expansions around a with coefficients c_n and d_n on (a-r, a+r), then fg is analytic on (a-r, a+r), and for every x in that interval, f(x)g(x) = ∑' n, e_n (x-a)^n where e_n = ∑_{m=0}^n c_m d_{n-m}.

theorem realAnalyticOnInterval_mul_eq_cauchyProduct {a r : ℝ} (hr : 0 < r) (f g : Set.Ioo (a - r) (a + r) → ℝ) (hf_analytic : IsRealAnalyticOn (Set.Ioo (a - r) (a + r)) f) (hg_analytic : IsRealAnalyticOn (Set.Ioo (a - r) (a + r)) g) (c d : ℕ → ℝ) (hf_series : ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (x - a) ^ n) ∧ f ⟨x, hx⟩ = ∑' n : ℕ, c n * (x - a) ^ n) (hg_series : ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => d n * (x - a) ^ n) ∧ g ⟨x, hx⟩ = ∑' n : ℕ, d n * (x - a) ^ n) : IsRealAnalyticOn (Set.Ioo (a - r) (a + r)) (fun x => f x * g x) ∧ ∀ x (hx : x ∈ Set.Ioo (a - r) (a + r)), f ⟨x, hx⟩ * g ⟨x, hx⟩ = ∑' n : ℕ, cauchyProductCoeff c d n * (x - a) ^ n

Lean source

Helper for Theorem 4.4.1: at any point of (a-r, a+r), the corresponding power-series terms are absolutely summable.

lemma helperForTheorem_4_4_1_absSummable_seriesTerm_at_point {a r x : ℝ} (c : ℕ → ℝ) (hc : ∀ y (hy : y ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (y - a) ^ n)) (hx : x ∈ Set.Ioo (a - r) (a + r)) : Summable (fun n : ℕ => |c n * (x - a) ^ n|)

Lean source

Helper for Theorem 4.4.1: rewrite the inner Cauchy-product finite sum into cauchyProductCoeff c d n * t^n.

lemma helperForTheorem_4_4_1_cauchyInnerSum_rewrite (c d : ℕ → ℝ) (t : ℝ) (n : ℕ) : (∑ k ∈ Finset.range (n + 1), (c k * t ^ k) * (d (n - k) * t ^ (n - k))) = cauchyProductCoeff c d n * t ^ n

Lean source

Helper for Theorem 4.4.1: at each point in (a-r,a+r), the pointwise product equals the Cauchy-product power-series sum.

lemma helperForTheorem_4_4_1_pointwise_product_eq_tsum {a r x : ℝ} (hr : 0 < r) (f g : Set.Ioo (a - r) (a + r) → ℝ) (c d : ℕ → ℝ) (hf_series : ∀ y (hy : y ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => c n * (y - a) ^ n) ∧ f ⟨y, hy⟩ = ∑' n : ℕ, c n * (y - a) ^ n) (hg_series : ∀ y (hy : y ∈ Set.Ioo (a - r) (a + r)), Summable (fun n : ℕ => d n * (y - a) ^ n) ∧ g ⟨y, hy⟩ = ∑' n : ℕ, d n * (y - a) ^ n) (hx : x ∈ Set.Ioo (a - r) (a + r)) : f ⟨x, hx⟩ * g ⟨x, hx⟩ = ∑' n : ℕ, cauchyProductCoeff c d n * (x - a) ^ n

4.5 — The Exponential and Logarithm Functions — Part 1

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Definition 4.5.1 (Exponential function): for every real number x, the exponential function is given by the power series exp(x) := ∑' n : ℕ, x^n / n!.

open scoped Topology noncomputable def realExpSeries (x : ℝ) : ℝ := ∑' n : ℕ, x ^ n / (n.factorial : ℝ)

Lean source

Definition 4.5.2 (Euler's number): Euler's number e is the real number defined by e := exp(1), with series expansion e = ∑' n : ℕ, 1 / n!.

open scoped Topology noncomputable def realEulerNumber : ℝ := Real.exp 1

Lean source

Definition 4.5.3 (Natural logarithm): the natural logarithm is the function log : (0, ∞) → ℝ, also denoted ln, defined as the inverse of exp : ℝ → (0, ∞).

open scoped Topology noncomputable def naturalLog : Set.Ioi (0 : ℝ) → ℝ := fun x => Real.log x

Lean source

The restricted natural logarithm and exponential satisfy exp (naturalLog x) = x for x > 0 and naturalLog (exp y) = y.

open scoped Topology theorem naturalLog_inverse_exp : (∀ x : Set.Ioi (0 : ℝ), Real.exp (naturalLog x) = x.1) ∧ (∀ y : ℝ, naturalLog ⟨Real.exp y, Real.exp_pos y⟩ = y)

Lean source

The defining series ∑ n, 1 / n! for Euler's number is summable in ℝ.

open scoped Topology lemma summable_one_div_factorial : Summable (fun n : ℕ => (1 : ℝ) / (n.factorial : ℝ))

Lean source

Series characterization of Euler's number via the exponential series at x = 1.

open scoped Topology lemma realEulerNumber_eq_tsum : realEulerNumber = ∑' n : ℕ, (1 : ℝ) / (n.factorial : ℝ)

Lean source

Proposition 4.5.1: for every real number x, the exponential function satisfies Real.exp x = realEulerNumber ^ x (that is, exp(x) = e^x).

open scoped Topology theorem real_exp_eq_eulerNumber_rpow : ∀ x : ℝ, Real.exp x = realEulerNumber ^ x

Lean source

Theorem 4.5.1 (Basic properties of exp, part (a)): for every real number x, the series ∑' n : ℕ, x^n / n! is absolutely convergent. In particular, Real.exp x = ∑' n : ℕ, x^n / n! for all x, the associated power series has infinite radius of convergence, and Real.exp is real analytic on ℝ.

open scoped Topology theorem exp_basic_properties_part_a : (∀ x : ℝ, Summable (fun n : ℕ => |x ^ n / (n.factorial : ℝ)|)) ∧ (∀ x : ℝ, Real.exp x = ∑' n : ℕ, x ^ n / (n.factorial : ℝ)) ∧ (NormedSpace.expSeries ℝ ℝ).radius = ⊤ ∧ AnalyticOn ℝ Real.exp Set.univ

Lean source

Theorem 4.5.2 (Basic properties of exp, part (b)): the function exp : ℝ → ℝ is differentiable on ℝ, and for every x : ℝ, we have exp'(x) = exp(x).

open scoped Topology theorem exp_basic_properties_part_b : Differentiable ℝ Real.exp ∧ ∀ x : ℝ, deriv Real.exp x = Real.exp x

Lean source

Theorem 4.5.3 (Basic properties of exp, part (c)): the function exp is continuous on ℝ. Moreover, for every a, b : ℝ, ∫ x in a..b, exp x = exp b - exp a.

open scoped Topology theorem exp_basic_properties_part_c : Continuous Real.exp ∧ ∀ a b : ℝ, (∫ x in a..b, Real.exp x) = Real.exp b - Real.exp a

Lean source

Theorem 4.5.4 (Basic properties of exp, part (d)): for all x, y : ℝ, exp (x + y) = exp x * exp y.

open scoped Topology theorem exp_basic_properties_part_d : ∀ x y : ℝ, Real.exp (x + y) = Real.exp x * Real.exp y

Lean source

Theorem 4.5.5 (Basic properties of exp, part (e)): exp 0 = 1. Moreover, for every x : ℝ, we have exp x > 0 and exp (-x) = 1 / exp x.

open scoped Topology theorem exp_basic_properties_part_e : Real.exp 0 = 1 ∧ ∀ x : ℝ, Real.exp x > 0 ∧ Real.exp (-x) = 1 / Real.exp x

Lean source

Theorem 4.5.6 (Basic properties of exp, part (f)): the function exp is strictly increasing on ℝ. Equivalently, for all x, y : ℝ, y > x ↔ Real.exp y > Real.exp x.

open scoped Topology theorem exp_basic_properties_part_f : StrictMono Real.exp ∧ ∀ x y : ℝ, y > x ↔ Real.exp y > Real.exp x

Lean source

Theorem 4.5.7 (Logarithm properties, part (a)): for every x > 0, the derivative of ln is ln'(x) = 1 / x. In particular, for any 0 < a < b, ∫ x in a..b, (1 / x) = ln(b) - ln(a).

open scoped Topology theorem logarithm_properties_part_a : (∀ x : ℝ, 0 < x → deriv Real.log x = 1 / x) ∧ (∀ a b : ℝ, 0 < a → a < b → (∫ x in a..b, (1 / x)) = Real.log b - Real.log a)

Lean source

Theorem 4.5.8 (Logarithm properties, part (b)): for all x, y > 0, ln (xy) = ln x + ln y.

open scoped Topology theorem logarithm_properties_part_b : ∀ x y : ℝ, 0 < x → 0 < y → Real.log (x * y) = Real.log x + Real.log y

Lean source

Theorem 4.5.9 (Logarithm properties, part (c)): ln(1) = 0. Moreover, for every x > 0, ln(1 / x) = -ln(x).

open scoped Topology theorem logarithm_properties_part_c : Real.log 1 = 0 ∧ ∀ x : ℝ, 0 < x → Real.log (1 / x) = -Real.log x

Lean source

Theorem 4.5.10 (Logarithm properties, part (d)): for any x > 0 and y : ℝ, one has ln (x^y) = y ln x, where x^y is defined by x^y = exp (y ln x).

open scoped Topology theorem logarithm_properties_part_d : ∀ x y : ℝ, 0 < x → Real.log (x ^ y) = y * Real.log x

Lean source

open scoped Topology theorem logarithm_properties_part_e : (∀ x : ℝ, x ∈ Set.Ioo (-1 : ℝ) 1 → Real.log (1 - x) = -∑' n : ℕ, x ^ (n + 1) / ((n + 1 : ℕ) : ℝ)) ∧ AnalyticAt ℝ Real.log 1 ∧ (∀ x : ℝ, x ∈ Set.Ioo (0 : ℝ) 2 → Real.log x = ∑' n : ℕ, ((-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) * (x - 1) ^ (n + 1)) ∧ (∀ x : ℝ, |x - 1| < 1 → Summable (fun n : ℕ => ((-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) * (x - 1) ^ (n + 1))) ∧ (∀ x : ℝ, 1 < |x - 1| → ¬Summable (fun n : ℕ => ((-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) * (x - 1) ^ (n + 1)))

Lean source

Proposition 4.5.2: the alternating harmonic series converges to ln(2), encoded in Lean as convergence of ordered partial sums: ∑_{n=1}^∞ (-1)^{n+1}/n = ln(2) becomes Tendsto (fun N => ∑ n < N, (-1)^n/(n+1)) atTop (𝓝 (log 2)).

open scoped Topology theorem alternating_harmonic_summable_and_tsum_eq_log_two : Filter.Tendsto (fun N : ℕ => ∑ n ∈ Finset.range N, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) Filter.atTop (nhds (Real.log 2))

Lean source

Helper for Proposition 4.5.1: rewrite Real.exp x as (Real.exp 1) ^ x.

open scoped Topology lemma helperForProposition_4_5_1_exp_eq_expOne_rpow (x : ℝ) : Real.exp x = (Real.exp 1) ^ x

Lean source

Helper for Proposition 4.5.1: rewrite (Real.exp 1) ^ x using realEulerNumber.

open scoped Topology lemma helperForProposition_4_5_1_realEulerNumber_rpow_rewrite (x : ℝ) : (Real.exp 1) ^ x = realEulerNumber ^ x

Lean source

Helper for Theorem 4.5.7: derivative of Real.log at positive inputs.

open scoped Topology lemma helperForTheorem_4_5_7_deriv_log_of_pos (x : ℝ) (_hx : 0 < x) : deriv Real.log x = 1 / x

Lean source

Helper for Theorem 4.5.7: positivity of the right endpoint from 0 < a < b.

open scoped Topology lemma helperForTheorem_4_5_7_rightEndpoint_pos (a b : ℝ) (ha : 0 < a) (hab : a < b) : 0 < b

Lean source

Helper for Theorem 4.5.7: integral of 1 / x on a positive interval.

open scoped Topology lemma helperForTheorem_4_5_7_integral_one_div_eq_log_div (a b : ℝ) (ha : 0 < a) (hab : a < b) : (∫ x in a..b, (1 / x)) = Real.log (b / a)

Lean source

Helper for Theorem 4.5.7: convert log (b / a) into log b - log a.

open scoped Topology lemma helperForTheorem_4_5_7_log_div_eq_sub (a b : ℝ) (ha : 0 < a) (hab : a < b) : Real.log (b / a) = Real.log b - Real.log a

Lean source

Helper for Theorem 4.5.9: the logarithm of 1 is 0.

open scoped Topology lemma helperForTheorem_4_5_9_log_one : Real.log 1 = 0

Lean source

Helper for Theorem 4.5.9: reciprocal inside log gives negation.

open scoped Topology lemma helperForTheorem_4_5_9_log_one_div_eq_neg_log (x : ℝ) : Real.log (1 / x) = -Real.log x

Lean source

Helper for Theorem 4.5.9: the reciprocal-log identity in the x > 0 form.

open scoped Topology lemma helperForTheorem_4_5_9_log_one_div_eq_neg_log_of_pos (x : ℝ) (_hx : 0 < x) : Real.log (1 / x) = -Real.log x

Lean source

Helper for Theorem 4.5.10: rewrite x ^ y with the exp (y * log x) definition when x > 0.

open scoped Topology lemma helperForTheorem_4_5_10_rpow_def_of_pos {x y : ℝ} (hx : 0 < x) : x ^ y = Real.exp (y * Real.log x)

Lean source

Helper for Theorem 4.5.10: the logarithm of a real power for positive base.

open scoped Topology lemma helperForTheorem_4_5_10_log_rpow_of_pos {x y : ℝ} (hx : 0 < x) : Real.log (x ^ y) = y * Real.log x

Lean source

Helper for Theorem 4.5.11: the logarithm series identity on (-1, 1).

open scoped Topology lemma helperForTheorem_4_5_11_log_one_sub_eq_neg_tsum_of_mem_Ioo_neg_one_one {x : ℝ} (hx : x ∈ Set.Ioo (-1 : ℝ) 1) : Real.log (1 - x) = -∑' n : ℕ, x ^ (n + 1) / ((n + 1 : ℕ) : ℝ)

Lean source

Helper for Theorem 4.5.11: rewrite the centered logarithm-series term.

open scoped Topology lemma helperForTheorem_4_5_11_term_rewrite_center_one (x : ℝ) (n : ℕ) : ((-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) * (x - 1) ^ (n + 1) = -((1 - x) ^ (n + 1) / ((n + 1 : ℕ) : ℝ))

Lean source

Helper for Theorem 4.5.11: on (0, 2), log equals its centered power series at 1, and that series is summable.

open scoped Topology lemma helperForTheorem_4_5_11_log_eq_and_summable_inside_radius {x : ℝ} (hx : x ∈ Set.Ioo (0 : ℝ) 2) : (Real.log x = ∑' n : ℕ, ((-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) * (x - 1) ^ (n + 1)) ∧ Summable (fun n : ℕ => ((-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) * (x - 1) ^ (n + 1))

Lean source

Helper for Theorem 4.5.11: outside radius 1 about 1, the centered logarithm series is not summable.

open scoped Topology lemma helperForTheorem_4_5_11_not_summable_outside_radius {x : ℝ} (hx : 1 < |x - 1|) : ¬Summable (fun n : ℕ => ((-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) * (x - 1) ^ (n + 1))

Lean source

Helper for Proposition 4.5.2: each alternating-harmonic term has absolute value 1 / (n + 1).

open scoped Topology lemma helperForProposition_4_5_2_abs_alternating_harmonic_term (n : ℕ) :

Lean source

Helper for Proposition 4.5.2: unconditional summability of the alternating harmonic series implies summability of the harmonic series.

open scoped Topology lemma helperForProposition_4_5_2_summable_alternating_implies_summable_harmonic : Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) → Summable (fun n : ℕ => (1 : ℝ) / (n : ℝ))

Lean source

Helper for Proposition 4.5.2: under Lean's default (unconditional) Summable, the alternating harmonic series is not summable.

open scoped Topology lemma helperForProposition_4_5_2_not_summable_unconditional_alternating_harmonic : ¬ Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ))

Lean source

Helper for Proposition 4.5.2: any putative witness of the target conjunction would force a Summable claim that is already refuted under Lean's unconditional Summable semantics on ℕ.

open scoped Topology lemma helperForProposition_4_5_2_target_conjunction_implies_not_summable : (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2) → ¬ Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ))

Lean source

Helper for Proposition 4.5.2: Real.log 2 is nonzero.

open scoped Topology lemma helperForProposition_4_5_2_log_two_ne_zero : Real.log 2 ≠ (0 : ℝ)

Lean source

Helper for Proposition 4.5.2: under Lean's default unconditional Summable semantics on ℕ, the alternating-harmonic tsum is forced to be 0.

open scoped Topology lemma helperForProposition_4_5_2_tsum_eq_zero_unconditional : (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = 0

Lean source

Helper for Proposition 4.5.2: under Lean's default unconditional Summable semantics on ℕ, the asserted tsum = log 2 identity cannot hold.

open scoped Topology lemma helperForProposition_4_5_2_not_tsum_eq_log_two_unconditional : ¬ ((∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2)

Lean source

Helper for Proposition 4.5.2: any proof of the target conjunction forces Real.log 2 = 0 under unconditional tsum semantics.

open scoped Topology lemma helperForProposition_4_5_2_target_conjunction_implies_log_two_eq_zero : (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2) → Real.log 2 = 0

Lean source

Helper for Proposition 4.5.2: any proof of the target conjunction directly contradicts Real.log 2 ≠ 0.

open scoped Topology lemma helperForProposition_4_5_2_target_conjunction_implies_false_via_log_two : (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2) → False

Lean source

Helper for Proposition 4.5.2: the target conjunction is inconsistent under Lean's default (unconditional) Summable on ℕ.

open scoped Topology lemma helperForProposition_4_5_2_not_target_conjunction_unconditional : ¬ (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2)

Lean source

Helper for Proposition 4.5.2: any proof of the target conjunction would force summability of the (unshifted) harmonic series.

open scoped Topology lemma helperForProposition_4_5_2_target_conjunction_implies_summable_harmonic : (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2) → Summable (fun n : ℕ => (1 : ℝ) / (n : ℝ))

Lean source

Helper for Proposition 4.5.2: the target conjunction yields a contradiction with Real.not_summable_one_div_natCast.

open scoped Topology lemma helperForProposition_4_5_2_target_conjunction_implies_false_via_harmonic : (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2) → False

Lean source

Helper for Proposition 4.5.2: contradiction with harmonic divergence yields direct negation of the target conjunction.

open scoped Topology lemma helperForProposition_4_5_2_not_target_conjunction_via_harmonic_divergence : ¬ (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2)

Lean source

Helper for Proposition 4.5.2: under Lean's default unconditional Summable semantics on ℕ, the target conjunction is equivalent to False.

open scoped Topology lemma helperForProposition_4_5_2_target_conjunction_iff_false : (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2) ↔ False

Lean source

Helper for Proposition 4.5.2: under Lean's default unconditional Summable semantics on ℕ, both asserted claims in the target conjunction are blocked.

open scoped Topology lemma helperForProposition_4_5_2_unconditional_obstructions : (¬ Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ))) ∧ ¬ ((∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2)

Lean source

Helper for Proposition 4.5.2: the alternating harmonic partial sums converge conditionally (as a limit of finite sums), even though unconditional Summable on ℕ fails for this series in Lean.

open scoped Topology lemma helperForProposition_4_5_2_partial_sums_tendsto_some_limit : ∃ l : ℝ, Filter.Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, (-1 : ℝ) ^ i / ((i + 1 : ℕ) : ℝ)) Filter.atTop (nhds l)

Lean source

Helper for Proposition 4.5.2: if the target conjunction held, then the ordered partial sums would converge to Real.log 2.

open scoped Topology lemma helperForProposition_4_5_2_target_conjunction_implies_partial_sums_tendsto_log_two : (Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2) → Filter.Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, (-1 : ℝ) ^ i / ((i + 1 : ℕ) : ℝ)) Filter.atTop (nhds (Real.log 2))

Lean source

Helper for Proposition 4.5.2: the limit of alternating-harmonic partial sums, when it exists, is unique.

open scoped Topology lemma helperForProposition_4_5_2_partial_sums_limit_unique {l₁ l₂ : ℝ} (h₁ : Filter.Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, (-1 : ℝ) ^ i / ((i + 1 : ℕ) : ℝ)) Filter.atTop (nhds l₁)) (h₂ : Filter.Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, (-1 : ℝ) ^ i / ((i + 1 : ℕ) : ℝ)) Filter.atTop (nhds l₂)) : l₁ = l₂

Lean source

Helper for Proposition 4.5.2: under the target conjunction, any candidate limit of alternating-harmonic partial sums must equal Real.log 2.

open scoped Topology lemma helperForProposition_4_5_2_target_conjunction_forces_unique_limit_log_two (h : Summable (fun n : ℕ => (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) ∧ (∑' n : ℕ, (-1 : ℝ) ^ n / ((n + 1 : ℕ) : ℝ)) = Real.log 2) {l : ℝ} (hl : Filter.Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, (-1 : ℝ) ^ i / ((i + 1 : ℕ) : ℝ)) Filter.atTop (nhds l)) : l = Real.log 2

4.5 — The Exponential and Logarithm Functions — Part 2

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Proposition 4.5.3: for every integer n ≥ 3, the factorial tail sum satisfies 0 < ∑' k : ℕ, 1 / (n + (k + 1))! < 1 / n!.

open scoped Topology theorem factorial_tail_sum_pos_and_lt_inv_factorial (n : ℕ) (hn : 3 ≤ n) : 0 < ∑' k : ℕ, (1 : ℝ) / ((n + (k + 1)).factorial : ℝ) ∧ (∑' k : ℕ, (1 : ℝ) / ((n + (k + 1)).factorial : ℝ)) < (1 : ℝ) / (n.factorial : ℝ)

Lean source

Proposition 4.5.4: for every integer n ≥ 3, the real number n! * e is not an integer.

open scoped Topology theorem factorial_mul_e_not_integer (n : ℕ) (hn : 3 ≤ n) : ¬ ∃ m : ℤ, (n.factorial : ℝ) * realEulerNumber = (m : ℝ)

Lean source

Proposition 4.5.5: define f : ℝ → ℝ by f x = exp (-1 / x) for x > 0 and f x = 0 for x ≤ 0. Then f is smooth on ℝ, all derivatives vanish at 0 (equivalently, for every integer k ≥ 0, f^(k)(0) = 0), and f is not real analytic at 0.

open scoped Topology theorem flat_exp_cutoff_smooth_all_derivs_zero_not_analytic_at_zero : let f : ℝ → ℝ := fun x => if 0 < x then Real.exp (-1 / x) else 0 ContDiff ℝ (↑(⊤ : ℕ∞)) f ∧ (∀ k : ℕ, iteratedDeriv k f 0 = 0) ∧ ¬ AnalyticAt ℝ f 0

Lean source

Proposition 4.5.6: if f : ℝ → (0, ∞) is real analytic and satisfies f'(x) = f(x) for all x ∈ ℝ, then there exists a constant C > 0 such that f(x) = C e^x for all x ∈ ℝ.

open scoped Topology theorem analytic_deriv_eq_self_exists_pos_const_mul_exp {f : ℝ → ℝ} (hf_pos : ∀ x : ℝ, 0 < f x) (hf_analytic : AnalyticOn ℝ f Set.univ) (hf_deriv : ∀ x : ℝ, deriv f x = f x) : ∃ C : ℝ, 0 < C ∧ ∀ x : ℝ, f x = C * Real.exp x

Lean source

Proposition 4.5.7: for every natural number m ≥ 1, lim_{x→+∞} (exp x / x^m) = +∞.

open scoped Topology theorem exp_div_pow_tendsto_atTop (m : ℕ) (hm : 1 ≤ m) : Filter.Tendsto (fun x : ℝ => Real.exp x / x ^ m) Filter.atTop Filter.atTop

Lean source

Proposition 4.5.8: if P is a real polynomial and c > 0, then there exists N : ℝ such that for all real x > N, one has exp (c x) > |P(x)|.

open scoped Topology theorem exp_mul_gt_abs_polynomial_eventually (P : Polynomial ℝ) {c : ℝ} (hc : 0 < c) : ∃ N : ℝ, ∀ x : ℝ, x > N → Real.exp (c * x) > |P.eval x|

Lean source

Proposition 4.5.9: define f : (0,+∞) × ℝ → ℝ by f(x,y) = x^y, where x^y = exp (y ln x) for x > 0 and y ∈ ℝ; then f is continuous on (0,+∞) × ℝ.

open scoped Topology theorem positive_rpow_map_continuous_on_Ioi_prod : Continuous (fun p : Set.Ioi (0 : ℝ) × ℝ => ((p.1 : ℝ) ^ p.2))

Lean source

Theorem 4.5.12: The number e is irrational.

open scoped Topology theorem realEulerNumber_irrational : Irrational (Real.exp 1)

Lean source

Theorem 4.5.13: The natural logarithm function ln : (0,+∞) → ℝ is real analytic on (0,+∞).

open scoped Topology theorem logarithm_real_analytic_on_Ioi : AnalyticOn ℝ Real.log (Set.Ioi (0 : ℝ))

Lean source

Helper for Proposition 4.5.3: factorial tail denominator dominates a geometric factor.

open scoped Topology lemma helperForProposition_4_5_3_factorial_lower_bound_nat (n k : ℕ) : (n + 1).factorial * 2 ^ k ≤ (n + (k + 1)).factorial

Lean source

Helper for Proposition 4.5.3: each factorial-tail term is bounded by a geometric term.

open scoped Topology lemma helperForProposition_4_5_3_term_le_geometric (n k : ℕ) : (1 : ℝ) / ((n + (k + 1)).factorial : ℝ) ≤ ((1 : ℝ) / ((n + 1).factorial : ℝ)) * ((1 / 2 : ℝ) ^ k)

Lean source

Helper for Proposition 4.5.3: the shifted factorial reciprocal tail is summable.

open scoped Topology lemma helperForProposition_4_5_3_summable_tail (n : ℕ) : Summable (fun k : ℕ => (1 : ℝ) / ((n + (k + 1)).factorial : ℝ))

Lean source

Helper for Proposition 4.5.3: the shifted factorial reciprocal tail is bounded by a geometric sum equal to 2 / (n+1)!.

open scoped Topology lemma helperForProposition_4_5_3_tsum_le_two_div_factorial_succ (n : ℕ) : (∑' k : ℕ, (1 : ℝ) / ((n + (k + 1)).factorial : ℝ)) ≤ (2 : ℝ) / ((n + 1).factorial : ℝ)

Lean source

Helper for Proposition 4.5.3: the geometric upper bound is strictly below 1 / n! when n ≥ 3.

open scoped Topology lemma helperForProposition_4_5_3_two_div_factorial_succ_lt_inv_factorial (n : ℕ) (hn : 3 ≤ n) : (2 : ℝ) / ((n + 1).factorial : ℝ) < (1 : ℝ) / (n.factorial : ℝ)

Lean source

Helper for Proposition 4.5.4: split the reciprocal-factorial series at index n+1.

open scoped Topology lemma helperForProposition_4_5_4_tsum_split_at_factorial_index (n : ℕ) : (∑' j : ℕ, (1 : ℝ) / (j.factorial : ℝ)) = (∑ j ∈ Finset.range (n + 1), (1 : ℝ) / (j.factorial : ℝ)) + ∑' k : ℕ, (1 : ℝ) / ((n + (k + 1)).factorial : ℝ)

Lean source

Helper for Proposition 4.5.4: after scaling the finite prefix by n!, one gets a natural-number cast.

open scoped Topology lemma helperForProposition_4_5_4_factorialScaledFinitePart_isNatCast (n : ℕ) : ∃ A : ℕ, (n.factorial : ℝ) * (∑ i ∈ Finset.range (n + 1), (1 : ℝ) / (i.factorial : ℝ)) = (A : ℝ)

Lean source

Helper for Proposition 4.5.4: scaling the factorial tail by n! yields a remainder in (0,1).

open scoped Topology lemma helperForProposition_4_5_4_factorialScaledTail_between_zero_one (n : ℕ) (hn : 3 ≤ n) : 0 < (n.factorial : ℝ) * (∑' k : ℕ, (1 : ℝ) / ((n + (k + 1)).factorial : ℝ)) ∧ (n.factorial : ℝ) * (∑' k : ℕ, (1 : ℝ) / ((n + (k + 1)).factorial : ℝ)) < 1

Lean source

Helper for Proposition 4.5.4: no integer cast lies strictly between two consecutive integer casts.

open scoped Topology lemma helperForProposition_4_5_4_noInt_between_consecutiveIntCasts (z m : ℤ) : ¬ ((z : ℝ) < (m : ℝ) ∧ (m : ℝ) < ((z + 1 : ℤ) : ℝ))

Lean source

Helper for Proposition 4.5.5: the cutoff definition coincides with expNegInvGlue.

open scoped Topology lemma helperForProposition_4_5_5_cutoff_eq_expNegInvGlue : (fun x : ℝ => if 0 < x then Real.exp (-1 / x) else 0) = expNegInvGlue

Lean source

Helper for Proposition 4.5.5: ContDiff ℝ ⊤ implies analyticity at 0.

open scoped Topology lemma helperForProposition_4_5_5_contDiffTop_implies_analyticAt_zero {f : ℝ → ℝ} (hcont : ContDiff ℝ ⊤ f) : AnalyticAt ℝ f 0

Lean source

Helper for Proposition 4.5.5: as currently encoded, the target conjunction is inconsistent.

open scoped Topology lemma helperForProposition_4_5_5_target_conjunction_inconsistent : ¬ (let f : ℝ → ℝ := fun x => if 0 < x then Real.exp (-1 / x) else 0 ContDiff ℝ ⊤ f ∧ (∀ k : ℕ, iteratedDeriv k f 0 = 0) ∧ ¬ AnalyticAt ℝ f 0)

Lean source

Helper for Proposition 4.5.5: all iterated derivatives of the cutoff vanish on the negative half-line.

open scoped Topology lemma helperForProposition_4_5_5_iteratedDeriv_zero_on_Iio : ∀ k : ℕ, Set.EqOn (iteratedDeriv k (fun x : ℝ => if 0 < x then Real.exp (-1 / x) else 0)) (fun _ => (0 : ℝ)) (Set.Iio (0 : ℝ))

Lean source

Helper for Proposition 4.5.5: smoothness forces every iterated derivative of the cutoff to vanish at 0.

open scoped Topology lemma helperForProposition_4_5_5_iteratedDeriv_zero_at_zero (hcont : ContDiff ℝ (↑(⊤ : ℕ∞)) (fun x : ℝ => if 0 < x then Real.exp (-1 / x) else 0)) : ∀ k : ℕ, iteratedDeriv k (fun x : ℝ => if 0 < x then Real.exp (-1 / x) else 0) 0 = 0

Lean source

Helper for Proposition 4.5.5: the cutoff is not analytic at 0.

open scoped Topology lemma helperForProposition_4_5_5_not_analytic_at_zero : ¬ AnalyticAt ℝ (fun x : ℝ => if 0 < x then Real.exp (-1 / x) else 0) 0

Lean source

Helper for Proposition 4.5.6: analyticity on all of ℝ implies global differentiability.

open scoped Topology lemma helperForProposition_4_5_6_differentiable_of_analyticOn_univ {f : ℝ → ℝ} (hf_analytic : AnalyticOn ℝ f Set.univ) : Differentiable ℝ f

Lean source

Helper for Proposition 4.5.6: the derivative of log ∘ f is constantly 1.

open scoped Topology lemma helperForProposition_4_5_6_deriv_log_eq_one {f : ℝ → ℝ} (hf_pos : ∀ x : ℝ, 0 < f x) (hf_diff : Differentiable ℝ f) (hf_deriv : ∀ x : ℝ, deriv f x = f x) : ∀ x : ℝ, deriv (fun y : ℝ => Real.log (f y)) x = 1

Lean source

Helper for Proposition 4.5.6: x ↦ log (f x) - x is constant on ℝ.

open scoped Topology lemma helperForProposition_4_5_6_log_sub_id_constant {f : ℝ → ℝ} (hf_pos : ∀ x : ℝ, 0 < f x) (hf_diff : Differentiable ℝ f) (hf_deriv : ∀ x : ℝ, deriv f x = f x) : ∀ x : ℝ, Real.log (f x) - x = Real.log (f 0)

Lean source

Helper for Proposition 4.5.6: the solution has the form f x = f 0 * exp x.

open scoped Topology lemma helperForProposition_4_5_6_exp_form {f : ℝ → ℝ} (hf_pos : ∀ x : ℝ, 0 < f x) (hlog_const : ∀ x : ℝ, Real.log (f x) - x = Real.log (f 0)) : ∀ x : ℝ, f x = f 0 * Real.exp x

Lean source

Helper for Proposition 4.5.8: rewriting the composed polynomial at a scaled input.

open scoped Topology lemma helperForProposition_4_5_8_scaledEval_rewrite (P : Polynomial ℝ) {c : ℝ} (hc : 0 < c) (x : ℝ) : let Q : Polynomial ℝ := P.comp (Polynomial.C (1 / c) * Polynomial.X) Q.eval (c * x) = P.eval x

Lean source

Helper for Proposition 4.5.8: the ratio P(x) / exp(c x) tends to 0 at +∞.

open scoped Topology lemma helperForProposition_4_5_8_tendsto_div_exp_mul_atTop (P : Polynomial ℝ) {c : ℝ} (hc : 0 < c) : Filter.Tendsto (fun x : ℝ => P.eval x / Real.exp (c * x)) Filter.atTop (nhds 0)

Lean source

Helper for Proposition 4.5.8: eventually, |P(x)| is strictly below exp(c x).

open scoped Topology lemma helperForProposition_4_5_8_eventually_abs_lt_exp_mul (P : Polynomial ℝ) {c : ℝ} (hc : 0 < c) : ∀ᶠ x : ℝ in Filter.atTop, |P.eval x| < Real.exp (c * x)

Lean source

Helper for Proposition 4.5.8: convert an eventual atTop property into a threshold statement.

open scoped Topology lemma helperForProposition_4_5_8_eventually_atTop_to_threshold {R : ℝ → Prop} (hR : ∀ᶠ x : ℝ in Filter.atTop, R x) : ∃ N : ℝ, ∀ x : ℝ, x > N → R x

Lean source

Helper for Proposition 4.5.9: continuity of the positive-base coordinate map.

open scoped Topology lemma helperForProposition_4_5_9_continuous_baseCoordinate : Continuous (fun p : Set.Ioi (0 : ℝ) × ℝ => ((p.1 : Set.Ioi (0 : ℝ)) : ℝ))

Lean source

Helper for Proposition 4.5.9: the base in (0,+∞) is always nonzero.

open scoped Topology lemma helperForProposition_4_5_9_rpow_sideCondition : ∀ p : Set.Ioi (0 : ℝ) × ℝ, ((p.1 : ℝ) ≠ 0 ∨ 0 < p.2)

Lean source

Helper for Theorem 4.5.12: the denominator of a rational divides (max 3 q.den)!.

open scoped Topology lemma helperForTheorem_4_5_12_factorialDenominator_dvd_factorialMax (q : ℚ) : q.den ∣ Nat.factorial (max 3 q.den)

Lean source

Helper for Theorem 4.5.12: multiplying a rational by a suitable factorial gives an integer cast in ℝ.

open scoped Topology lemma helperForTheorem_4_5_12_factorialScaledRat_isIntCast (q : ℚ) : ∃ m : ℤ, (((max 3 q.den).factorial : ℝ) * (q : ℝ)) = (m : ℝ)

Lean source

Helper for Theorem 4.5.12: exp 1 is not equal to any rational cast.

open scoped Topology lemma helperForTheorem_4_5_12_exp_one_ne_ratCast (q : ℚ) : Real.exp 1 ≠ (q : ℝ)

4.6 — A Digression on Complex Numbers

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Definition 4.6.1 (Complex numbers): the set of complex numbers is {a + b i | a, b ∈ ℝ}, where i is a symbol satisfying i^2 = -1. In Lean, this is identified with the existing type ℂ.

abbrev complexNumbers : Type := ℂ

Lean source

Every complex number can be written in the form a + b i with a b : ℝ.

theorem complexNumbers_exists_real_imag (z : ℂ) : ∃ a b : ℝ, z = (a : ℂ) + (b : ℂ) * Complex.I

Lean source

Lemma 4.6.2: every z : ℂ has a unique decomposition z = a + b i with a, b : ℝ; moreover i^2 = -1 and -z = (-1)z for all z : ℂ.

theorem complex_unique_decomposition_i_sq_and_neg_mul : (∀ z : ℂ, ∃! p : ℝ × ℝ, z = (p.1 : ℂ) + (p.2 : ℂ) * Complex.I) ∧ Complex.I ^ 2 = (-1 : ℂ) ∧ (∀ z : ℂ, -z = ((-1 : ℂ) * z))

Lean source

Definition 4.6.2 (Complex numbers): (i) a complex number is an ordered pair (a, b) with a, b ∈ ℝ; (ii) equality is componentwise, i.e. (a, b) = (c, d) iff a = c and b = d; (iii) the set of all such complex numbers is ℝ × ℝ.

abbrev complexNumbersAsPairs : Type := ℝ × ℝ

Lean source

Componentwise addition on ordered pairs of real numbers.

abbrev complexPairAdd (z w : complexNumbersAsPairs) : complexNumbersAsPairs := (z.1 + w.1, z.2 + w.2)

Lean source

Componentwise negation on ordered pairs of real numbers.

abbrev complexPairNeg (z : complexNumbersAsPairs) : complexNumbersAsPairs := (-z.1, -z.2)

Lean source

The zero ordered pair (0, 0) in ℝ × ℝ.

abbrev complexPairZero : complexNumbersAsPairs := (0, 0)

Lean source

Definition 4.6.3 (Complex addition, negation, and zero): let ℂ be the set of ordered pairs of real numbers. For z = (a, b) and w = (c, d), define z + w := (a + c, b + d), -z := (-a, -b), and 0_C := (0, 0).

def complexPairAddNegZeroData : (complexNumbersAsPairs → complexNumbersAsPairs → complexNumbersAsPairs) × (complexNumbersAsPairs → complexNumbersAsPairs) × complexNumbersAsPairs := (complexPairAdd, complexPairNeg, complexPairZero)

Lean source

Lemma 4.6.1 (Addition on ℂ satisfies the abelian group axioms): for all z₁ z₂ z₃ : ℂ, (i) z₁ + z₂ = z₂ + z₁, (ii) (z₁ + z₂) + z₃ = z₁ + (z₂ + z₃), (iii) z₁ + 0 = 0 + z₁ = z₁, and (iv) z₁ + (-z₁) = (-z₁) + z₁ = 0. In particular, (ℂ, +) is an abelian group with identity element 0.

theorem complex_addition_abelian_group_axioms : (∀ z₁ z₂ : ℂ, z₁ + z₂ = z₂ + z₁) ∧ (∀ z₁ z₂ z₃ : ℂ, (z₁ + z₂) + z₃ = z₁ + (z₂ + z₃)) ∧ (∀ z₁ : ℂ, z₁ + 0 = z₁ ∧ 0 + z₁ = z₁) ∧ (∀ z₁ : ℂ, z₁ + (-z₁) = 0 ∧ (-z₁) + z₁ = 0)

Lean source

Definition 4.6.4 (Complex multiplication): for complex numbers viewed as ordered pairs z = (a, b) and w = (c, d), their product is zw = (ac - bd, ad + bc), and the complex multiplicative identity is 1_C = (1, 0).

def complexPairMulOneData : (complexNumbersAsPairs → complexNumbersAsPairs → complexNumbersAsPairs) × complexNumbersAsPairs := (fun z w => (z.1 * w.1 - z.2 * w.2, z.1 * w.2 + z.2 * w.1), (1, 0))

Lean source

Definition 4.6.5 (Embedding of real numbers into complex numbers): define ι : ℝ → ℂ by identifying x : ℝ with (x, 0) in ℂ.

def realToComplexEmbedding : ℝ → ℂ := fun x => (x : ℂ)

Lean source

The embedding of real numbers into complex numbers preserves equality, addition, negation, and multiplication.

theorem realToComplexEmbedding_respects_operations : (∀ x y : ℝ, x = y ↔ realToComplexEmbedding x = realToComplexEmbedding y) ∧ (∀ x₁ x₂ : ℝ, realToComplexEmbedding (x₁ + x₂) = realToComplexEmbedding x₁ + realToComplexEmbedding x₂) ∧ (∀ x : ℝ, realToComplexEmbedding (-x) = -realToComplexEmbedding x) ∧ (∀ x₁ x₂ : ℝ, realToComplexEmbedding (x₁ * x₂) = realToComplexEmbedding x₁ * realToComplexEmbedding x₂)

Lean source

Definition 4.6.6 (Imaginary unit): the imaginary unit is the complex number i ∈ ℂ defined by i := (0, 1).

def imaginaryUnit : ℂ := ⟨0, 1⟩

Lean source

A complex number is real when its imaginary part vanishes.

def IsRealComplex (z : ℂ) : Prop := z.im = 0

Lean source

A complex number is purely imaginary when its real part vanishes.

def IsPurelyImaginaryComplex (z : ℂ) : Prop := z.re = 0

Lean source

Definition 4.6.7 (Real and imaginary parts; complex conjugate): for z : ℂ, z = Re(z) + i Im(z), a number is real iff Im(z) = 0, a number is purely imaginary iff Re(z) = 0, and the complex conjugate is conj z = Re(z) - i Im(z).

theorem complex_real_imaginary_parts_and_conjugate (z : ℂ) : z = (z.re : ℂ) + Complex.I * (z.im : ℂ) ∧ (IsRealComplex z ↔ z.im = 0) ∧ (IsPurelyImaginaryComplex z ↔ z.re = 0) ∧ star z = (z.re : ℂ) - Complex.I * (z.im : ℂ)

Lean source

Proposition 4.6.2: for every complex number z ∈ ℂ, Re(z) = (z + \overline{z}) / 2 and Im(z) = (z - \overline{z}) / (2i).

theorem complex_re_and_im_eq_conjugate_formulas (z : ℂ) : ((z.re : ℂ) = (z + star z) / (2 : ℂ)) ∧ ((z.im : ℂ) = (z - star z) / ((2 : ℂ) * Complex.I))

Lean source

Lemma 4.6.3 (Complex conjugation is an involution): for z w : ℂ, complex conjugation satisfies ` \overline{z + w} = \bar z + \bar w, \overline{-z} = -\bar z, \overline{z w} = \bar z \, \bar w, \overline{\bar z} = z, ` and moreover \bar z = \bar w iff z = w, while \bar z = z iff z is real.

theorem complex_conjugation_involution (z w : ℂ) : star (z + w) = star z + star w ∧ star (-z) = -star z ∧ star (z * w) = star z * star w ∧ star (star z) = z ∧ (star z = star w ↔ z = w) ∧ (star z = z ↔ IsRealComplex z)

Lean source

Definition 4.6.8 (Complex absolute value): for z = a + bi with a b : ℝ, the complex absolute value is the nonnegative real number |z| = sqrt (a^2 + b^2) = (a^2 + b^2)^(1/2). In Lean this is represented by the complex norm ‖z‖.

noncomputable abbrev complexAbsoluteValue (z : ℂ) : ℝ := ‖z‖

Lean source

Lemma 4.6.4: for every z ∈ ℂ, the complex absolute value |z| is a non-negative real number.

theorem complexAbsoluteValue_nonnegative (z : ℂ) : 0 ≤ complexAbsoluteValue z

Lean source

Lemma 4.6.5: for every z ∈ ℂ, we have |z| = 0 if and only if z = 0.

theorem complexAbsoluteValue_eq_zero_iff (z : ℂ) : complexAbsoluteValue z = 0 ↔ z = 0

Lean source

Lemma 4.6.6: for every z ∈ ℂ, we have z * \overline{z} = |z|^2. In particular, |z| = sqrt (z * \overline{z}), interpreted in Lean as |z| = sqrt ((z * \overline{z}).re).

theorem complex_mul_conj_eq_abs_sq_and_abs_eq_sqrt (z : ℂ) : z * star z = ((complexAbsoluteValue z) ^ 2 : ℂ) ∧ complexAbsoluteValue z = Real.sqrt ((z * star z).re)

Lean source

Lemma 4.6.7: for all z, w ∈ ℂ, the complex absolute value is multiplicative: |zw| = |z| |w|.

lemma complexAbsoluteValue_mul (z w : ℂ) : complexAbsoluteValue (z * w) = complexAbsoluteValue z * complexAbsoluteValue w

Lean source

Lemma 4.6.8: for every z ∈ ℂ, the complex absolute value is invariant under complex conjugation: |\overline{z}| = |z|.

lemma complexAbsoluteValue_conj (z : ℂ) : complexAbsoluteValue (star z) = complexAbsoluteValue z

Lean source

Proposition 4.6.3: if z, w ∈ ℂ and w ≠ 0, then |z / w| = |z| / |w|.

theorem complexAbsoluteValue_div_of_ne_zero (z w : ℂ) : w ≠ 0 → complexAbsoluteValue (z / w) = complexAbsoluteValue z / complexAbsoluteValue w

Lean source

Definition 4.6.9 (Complex reciprocal and quotient): for z : ℂ, the reciprocal is undefined at 0 and is |z|^{-2} \overline{z} otherwise; for z w : ℂ, the quotient z / w is defined when w ≠ 0 by z * w^{-1}.

noncomputable def complexReciprocalQuotientPartialData : (ℂ → Option ℂ) × (ℂ → ℂ → Option ℂ) := let reciprocal : ℂ → Option ℂ := fun z => if z = 0 then none else some (((((complexAbsoluteValue z) ^ (2 : ℕ))⁻¹ : ℝ) : ℂ) * star z) (reciprocal, fun z w => (reciprocal w).map (fun wInv => z * wInv))

Lean source

Partial complex reciprocal: undefined at 0, and otherwise given by |z|^{-2} \overline{z}.

noncomputable def complexReciprocalPartial (z : ℂ) : Option ℂ := complexReciprocalQuotientPartialData.1 z

Lean source

Partial complex quotient: for z w : ℂ, this is defined by mapping w to its partial reciprocal and multiplying by z.

noncomputable def complexQuotientPartial (z w : ℂ) : Option ℂ := complexReciprocalQuotientPartialData.2 z w

Lean source

Definition 4.6.10 (Complex exponential): for each z ∈ ℂ, the complex exponential is defined by the power series exp(z) = ∑' n : ℕ, z^n / n!.

noncomputable def complexExponential (z : ℂ) : ℂ := ∑' n : ℕ, z ^ n / (Nat.factorial n : ℂ)

Lean source

Theorem 4.6.1: for all z, w ∈ ℂ, one has exp(z + w) = exp(z) exp(w).

theorem complex_exp_add (z w : ℂ) : Complex.exp (z + w) = Complex.exp z * Complex.exp w

Lean source

Proposition 4.6.1: for every z ∈ ℂ, the complex exponential commutes with complex conjugation, i.e. exp(conj z) = conj (exp z).

theorem complex_exp_conj (z : ℂ) : Complex.exp (star z) = star (Complex.exp z)

Lean source

Lemma 4.6.9: for every complex number z, its real part is bounded by its complex absolute value: -|z| ≤ Re(z) ≤ |z|.

theorem realPart_le_complexAbsoluteValue (z : ℂ) : -complexAbsoluteValue z ≤ z.re ∧ z.re ≤ complexAbsoluteValue z

Lean source

Lemma 4.6.10: for every z ∈ ℂ, the imaginary part is bounded by the complex absolute value: -|z| ≤ Im(z) ≤ |z|.

lemma imagPart_le_complexAbsoluteValue (z : ℂ) : -complexAbsoluteValue z ≤ z.im ∧ z.im ≤ complexAbsoluteValue z

Lean source

Lemma 4.6.11: for every z ∈ ℂ, the complex absolute value is bounded by the sum of the absolute values of its real and imaginary parts: |z| ≤ |Re(z)| + |Im(z)|.

lemma complexAbsoluteValue_le_abs_re_add_abs_im (z : ℂ) : complexAbsoluteValue z ≤ |z.re| + |z.im|

Lean source

Lemma 4.6.12: for all z, w ∈ ℂ, the complex absolute value satisfies the triangle inequality |z + w| ≤ |z| + |w|.

lemma complexAbsoluteValue_add_le (z w : ℂ) : complexAbsoluteValue (z + w) ≤ complexAbsoluteValue z + complexAbsoluteValue w

Lean source

Proposition 4.6.4: for nonzero complex numbers z and w, |z + w| = |z| + |w| if and only if there exists a real number c > 0 such that z = c w.

theorem complexAbsoluteValue_add_eq_add_iff_exists_pos_real_mul (z w : ℂ) (hz : z ≠ 0) (hw : w ≠ 0) : complexAbsoluteValue (z + w) = complexAbsoluteValue z + complexAbsoluteValue w ↔ ∃ c : ℝ, 0 < c ∧ z = (c : ℂ) * w

Lean source

Proposition 4.6.5: there does not exist a partition of ℂ into positive, negative, and zero classes such that for every z, w : ℂ: (i) exactly one of Pos z, Neg z, or z = 0 holds, (ii) positivity/negativity are exchanged by negation, (iii) positive numbers are closed under addition, and (iv) positive numbers are closed under multiplication.

theorem no_complex_positive_negative_zero_partition : ¬ ∃ Pos Neg : ℂ → Prop, (∀ z : ℂ, (Pos z ∨ Neg z ∨ z = 0) ∧ ¬ (Pos z ∧ Neg z) ∧ ¬ (Pos z ∧ z = 0) ∧ ¬ (Neg z ∧ z = 0)) ∧ (∀ z : ℂ, Pos z → Neg (-z)) ∧ (∀ z : ℂ, Neg z → Pos (-z)) ∧ (∀ z w : ℂ, Pos z → Pos w → Pos (z + w)) ∧ (∀ z w : ℂ, Pos z → Pos w → Pos (z * w))

Lean source

Lemma 4.6.13: with d(z,w) = |z - w| on ℂ, this gives the usual metric on ℂ; moreover, a sequence z_n converges to z in this metric iff both real and imaginary parts converge, i.e. Re(z_n) → Re(z) and Im(z_n) → Im(z).

lemma complex_tendsto_iff_re_im_tendsto (zSeq : ℕ → ℂ) (z : ℂ) : let d : ℂ → ℂ → ℝ := fun z₁ z₂ => ‖z₁ - z₂‖; ((∀ z₁ z₂ : ℂ, 0 ≤ d z₁ z₂) ∧ (∀ z₁ z₂ : ℂ, d z₁ z₂ = 0 ↔ z₁ = z₂) ∧ (∀ z₁ z₂ : ℂ, d z₁ z₂ = d z₂ z₁) ∧ (∀ z₁ z₂ z₃ : ℂ, d z₁ z₃ ≤ d z₁ z₂ + d z₂ z₃)) ∧ ((∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, d (zSeq n) z < ε) ↔ Filter.Tendsto (fun n => (zSeq n).re) Filter.atTop (nhds z.re) ∧ Filter.Tendsto (fun n => (zSeq n).im) Filter.atTop (nhds z.im))

Lean source

Lemma 4.6.14 (Complex limit laws): if zₙ → z and wₙ → w in ℂ, then zₙ + wₙ → z + w, zₙ - wₙ → z - w, c zₙ → c z, zₙ wₙ → z w, and conj zₙ → conj z; moreover, if wₙ ≠ 0 for all n and w ≠ 0, then zₙ / wₙ → z / w.

lemma complex_limit_laws (zSeq wSeq : ℕ → ℂ) (z w c : ℂ) (hz : Filter.Tendsto zSeq Filter.atTop (nhds z)) (hw : Filter.Tendsto wSeq Filter.atTop (nhds w)) : Filter.Tendsto (fun n => zSeq n + wSeq n) Filter.atTop (nhds (z + w)) ∧ Filter.Tendsto (fun n => zSeq n - wSeq n) Filter.atTop (nhds (z - w)) ∧ Filter.Tendsto (fun n => c * zSeq n) Filter.atTop (nhds (c * z)) ∧ Filter.Tendsto (fun n => zSeq n * wSeq n) Filter.atTop (nhds (z * w)) ∧ Filter.Tendsto (fun n => star (zSeq n)) Filter.atTop (nhds (star z)) ∧ ((∀ n : ℕ, wSeq n ≠ 0) → w ≠ 0 → Filter.Tendsto (fun n => zSeq n / wSeq n) Filter.atTop (nhds (z / w)))

Lean source

Helper for Lemma 4.6.2: every complex number admits a real-imaginary pair representation z = a + bi.

lemma helperForLemma_4_6_2_canonicalDecompositionExists (z : ℂ) : ∃ p : ℝ × ℝ, z = (p.1 : ℂ) + (p.2 : ℂ) * Complex.I

Lean source

Helper for Lemma 4.6.2: any representation z = a + bi must use a = Re(z) and b = Im(z).

lemma helperForLemma_4_6_2_coordinatesFromRepresentation {z : ℂ} {p : ℝ × ℝ} (h : z = (p.1 : ℂ) + (p.2 : ℂ) * Complex.I) : p.1 = z.re ∧ p.2 = z.im

Lean source

Helper for Lemma 4.6.2: the pair (Re z, Im z) is the unique coefficient pair in a decomposition z = a + bi.

lemma helperForLemma_4_6_2_uniqueDecompositionPair (z : ℂ) (p : ℝ × ℝ) (h : z = (p.1 : ℂ) + (p.2 : ℂ) * Complex.I) : p = (z.re, z.im)

Lean source

Helper for Lemma 4.6.2: the imaginary unit squares to -1.

lemma helperForLemma_4_6_2_iSquared : Complex.I ^ 2 = (-1 : ℂ)

Lean source

Helper for Lemma 4.6.2: negation agrees with multiplication by -1.

lemma helperForLemma_4_6_2_negEqualsNegOneMul (z : ℂ) : -z = ((-1 : ℂ) * z)

Lean source

Helper for Proposition 4.6.2: Re(z) equals (z + \bar z)/2 written with star.

lemma helperForProposition_4_6_2_re_eq_add_star (z : ℂ) : (z.re : ℂ) = (z + star z) / (2 : ℂ)

Lean source

Helper for Proposition 4.6.2: Im(z) equals (z - \bar z)/(2i) written with star.

lemma helperForProposition_4_6_2_im_eq_sub_star (z : ℂ) : (z.im : ℂ) = (z - star z) / ((2 : ℂ) * Complex.I)

Lean source

Helper for Lemma 4.6.3: complex conjugation preserves addition, negation, and multiplication.

lemma helperForLemma_4_6_3_conj_add_neg_mul (z w : ℂ) : star (z + w) = star z + star w ∧ star (-z) = -star z ∧ star (z * w) = star z * star w

Lean source

Helper for Lemma 4.6.3: complex conjugation is involutive.

lemma helperForLemma_4_6_3_conj_involutive (z : ℂ) : star (star z) = z

Lean source

Helper for Lemma 4.6.3: complex conjugation is injective.

lemma helperForLemma_4_6_3_conj_eq_iff_eq (z w : ℂ) : star z = star w ↔ z = w

Lean source

Helper for Lemma 4.6.3: fixed points of conjugation are exactly the real complex numbers.

lemma helperForLemma_4_6_3_conj_fixed_iff_isReal (z : ℂ) : star z = z ↔ IsRealComplex z

Lean source

Helper for Lemma 4.6.6: z * conjugate(z) is the real scalar Complex.normSq z, viewed in ℂ.

lemma helperForLemma_4_6_6_mulConj_eq_normSqCast (z : ℂ) : z * star z = (Complex.normSq z : ℂ)

Lean source

Helper for Lemma 4.6.6: the real part of z * conjugate(z) is Complex.normSq z.

lemma helperForLemma_4_6_6_mulConj_re_eq_normSq (z : ℂ) : (z * star z).re = Complex.normSq z

Lean source

Helper for Lemma 4.6.6: (z * conjugate(z)).re equals |z|^2.

lemma helperForLemma_4_6_6_mulConj_re_eq_absSq (z : ℂ) : (z * star z).re = (complexAbsoluteValue z) ^ 2

Lean source

Helper for Lemma 4.6.6: √(|z|^2) = |z|.

lemma helperForLemma_4_6_6_sqrt_absSq_eq_absValue (z : ℂ) : Real.sqrt ((complexAbsoluteValue z) ^ 2) = complexAbsoluteValue z

Lean source

Helper for Lemma 4.6.9: the absolute value of the real part is bounded by the complex absolute value.

lemma helperForLemma_4_6_9_absRe_le_complexAbs (z : ℂ) :

Lean source

Helper for Lemma 4.6.9: the real part is bounded below by the negated complex absolute value.

lemma helperForLemma_4_6_9_negComplexAbs_le_re (z : ℂ) : -complexAbsoluteValue z ≤ z.re

Lean source

Helper for Lemma 4.6.9: the real part is bounded above by the complex absolute value.

lemma helperForLemma_4_6_9_re_le_complexAbs (z : ℂ) : z.re ≤ complexAbsoluteValue z

Lean source

Helper for Lemma 4.6.10: the absolute value of the imaginary part is bounded by the complex absolute value.

lemma helperForLemma_4_6_10_absIm_le_complexAbs (z : ℂ) :

Lean source

Helper for Lemma 4.6.10: the imaginary part is bounded below by the negated complex absolute value.

lemma helperForLemma_4_6_10_negComplexAbs_le_im (z : ℂ) : -complexAbsoluteValue z ≤ z.im

Lean source

Helper for Lemma 4.6.10: the imaginary part is bounded above by the complex absolute value.

lemma helperForLemma_4_6_10_im_le_complexAbs (z : ℂ) : z.im ≤ complexAbsoluteValue z

Lean source

Helper for Proposition 4.6.4: equality in the triangle inequality for complex norm is equivalent to the two numbers lying on the same real ray.

lemma helperForProposition_4_6_4_normEq_iff_sameRay (z w : ℂ) : complexAbsoluteValue (z + w) = complexAbsoluteValue z + complexAbsoluteValue w ↔ SameRay ℝ z w

Lean source

Helper for Proposition 4.6.4: two nonzero complex numbers on the same real ray differ by multiplication by a positive real scalar.

lemma helperForProposition_4_6_4_sameRay_to_existsPosMul (z w : ℂ) (hz : z ≠ 0) (hw : w ≠ 0) (hzw : SameRay ℝ z w) : ∃ c : ℝ, 0 < c ∧ z = (c : ℂ) * w

Lean source

Helper for Proposition 4.6.4: if one complex number is a positive real multiple of another, then equality holds in the triangle inequality.

lemma helperForProposition_4_6_4_existsPosMul_to_normEq (z w : ℂ) : (∃ c : ℝ, 0 < c ∧ z = (c : ℂ) * w) → complexAbsoluteValue (z + w) = complexAbsoluteValue z + complexAbsoluteValue w

Lean source

Helper for Proposition 4.6.5: if i is positive and positivity is closed under multiplication, then -1 is positive.

lemma helperForProposition_4_6_5_posNegOne_from_posI (Pos : ℂ → Prop) (hMulPos : ∀ z w : ℂ, Pos z → Pos w → Pos (z * w)) (hPosI : Pos Complex.I) : Pos (-(1 : ℂ))

Lean source

Helper for Proposition 4.6.5: if i is negative, negation sends negatives to positives, and positivity is multiplicatively closed, then -1 is positive.

lemma helperForProposition_4_6_5_posNegOne_from_negI (Pos Neg : ℂ → Prop) (hNegToPos : ∀ z : ℂ, Neg z → Pos (-z)) (hMulPos : ∀ z w : ℂ, Pos z → Pos w → Pos (z * w)) (hNegI : Neg Complex.I) : Pos (-(1 : ℂ))

Lean source

Helper for Proposition 4.6.5: trichotomy at i, together with the negation rule Neg z → Pos (-z) and multiplicative closure of positivity, forces -1 to be positive.

lemma helperForProposition_4_6_5_posNegOne (Pos Neg : ℂ → Prop) (hTrichotomy : ∀ z : ℂ, Pos z ∨ Neg z ∨ z = 0) (hNegToPos : ∀ z : ℂ, Neg z → Pos (-z)) (hMulPos : ∀ z w : ℂ, Pos z → Pos w → Pos (z * w)) : Pos (-(1 : ℂ))

Lean source

Helper for Proposition 4.6.5: if -1 is positive, positivity is closed under multiplication, and positives negate to negatives, then exclusivity of positive/negative classes yields a contradiction.

lemma helperForProposition_4_6_5_contradiction_from_posNegOne (Pos Neg : ℂ → Prop) (hPosNegExclusive : ∀ z : ℂ, ¬ (Pos z ∧ Neg z)) (hPosToNeg : ∀ z : ℂ, Pos z → Neg (-z)) (hMulPos : ∀ z w : ℂ, Pos z → Pos w → Pos (z * w)) (hPosNegOne : Pos (-(1 : ℂ))) : False

Lean source

Helper for Lemma 4.6.14: bundled arithmetic limit laws in ℂ for sum, difference, scalar multiplication, and product.

lemma helperForLemma_4_6_14_arith_tendsto_bundle (zSeq wSeq : ℕ → ℂ) (z w c : ℂ) (hz : Filter.Tendsto zSeq Filter.atTop (nhds z)) (hw : Filter.Tendsto wSeq Filter.atTop (nhds w)) : Filter.Tendsto (fun n => zSeq n + wSeq n) Filter.atTop (nhds (z + w)) ∧ Filter.Tendsto (fun n => zSeq n - wSeq n) Filter.atTop (nhds (z - w)) ∧ Filter.Tendsto (fun n => c * zSeq n) Filter.atTop (nhds (c * z)) ∧ Filter.Tendsto (fun n => zSeq n * wSeq n) Filter.atTop (nhds (z * w))

Lean source

Helper for Lemma 4.6.14: conjugation preserves sequence limits in ℂ.

lemma helperForLemma_4_6_14_star_tendsto (zSeq : ℕ → ℂ) (z : ℂ) (hz : Filter.Tendsto zSeq Filter.atTop (nhds z)) : Filter.Tendsto (fun n => star (zSeq n)) Filter.atTop (nhds (star z))

Lean source

Helper for Lemma 4.6.14: quotient limit law in ℂ under nonzero limit.

lemma helperForLemma_4_6_14_div_tendsto (zSeq wSeq : ℕ → ℂ) (z w : ℂ) (hz : Filter.Tendsto zSeq Filter.atTop (nhds z)) (hw : Filter.Tendsto wSeq Filter.atTop (nhds w)) : (∀ n : ℕ, wSeq n ≠ 0) → w ≠ 0 → Filter.Tendsto (fun n => zSeq n / wSeq n) Filter.atTop (nhds (z / w))

4.7 — Trigonometric Functions — Part 1

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Definition 4.7.1 (Trigonometric functions): for each z : ℂ, cos z = (exp (i z) + exp (-i z)) / 2 and sin z = (exp (i z) - exp (-i z)) / (2i).

theorem complex_trigonometric_function_definitions (z : ℂ) : Complex.cos z = (Complex.exp (Complex.I * z) + Complex.exp (-(Complex.I * z))) / (2 : ℂ) ∧ Complex.sin z = (Complex.exp (Complex.I * z) - Complex.exp (-(Complex.I * z))) / ((2 : ℂ) * Complex.I)

Lean source

Proposition 4.7.1 (Reality and absolute convergence on ℝ): for every x : ℝ, the series ∑' n, (-1)^n * x^(2n) / (2n)! and ∑' n, (-1)^n * x^(2n+1) / (2n+1)! converge absolutely. Consequently, defining cos(x) and sin(x) by these series gives real-valued quantities for each real input.

theorem real_trigonometric_series_absolutely_convergent (x : ℝ) : let a : ℕ → ℝ := fun n => (((-1 : ℝ) ^ n) * x ^ (2 * n)) / (Nat.factorial (2 * n) : ℝ) let b : ℕ → ℝ := fun n => (((-1 : ℝ) ^ n) * x ^ (2 * n + 1)) / (Nat.factorial (2 * n + 1) : ℝ) Summable (fun n : ℕ => |a n|) ∧ Summable (fun n : ℕ => |b n|) ∧ Summable a ∧ Summable b

Lean source

Proposition 4.7.2: If f : ℝ → ℝ is differentiable at x₀, with f x₀ = 0 and f' x₀ ≠ 0, then there exists c > 0 such that for every y : ℝ, 0 < |y - x₀| < c implies f y ≠ 0.

theorem isolated_zero_of_differentiableAt_deriv_ne_zero (f : ℝ → ℝ) (x₀ : ℝ) (hf_diff : DifferentiableAt ℝ f x₀) (hf_zero : f x₀ = 0) (hf_deriv_ne_zero : deriv f x₀ ≠ 0) : ∃ c > 0, ∀ y : ℝ, 0 < |y - x₀| ∧ |y - x₀| < c → f y ≠ 0

Lean source

Proposition 4.7.3: There exists a real number c > 0 such that for every real x with 0 < x < c, one has sin x ≠ 0.

theorem exists_pos_radius_sine_ne_zero_right_of_zero : ∃ c > 0, ∀ x : ℝ, 0 < x ∧ x < c → Real.sin x ≠ 0

Lean source

Theorem 4.7.1: For every real number x, one has sin(x)^2 + cos(x)^2 = 1; in particular sin(x), cos(x) ∈ [-1, 1].

theorem real_sine_cosine_pythagorean_identity_and_bounds (x : ℝ) : Real.sin x ^ 2 + Real.cos x ^ 2 = 1 ∧ Real.sin x ∈ Set.Icc (-1) 1 ∧ Real.cos x ∈ Set.Icc (-1) 1

Lean source

Theorem 4.7.2: For every real number x, (Real.sin)'(x) = Real.cos x and (Real.cos)'(x) = -Real.sin x.

theorem real_sine_cosine_derivative_formulas (x : ℝ) : deriv Real.sin x = Real.cos x ∧ deriv Real.cos x = -Real.sin x

Lean source

Theorem 4.7.3: For every real number x, sin(-x) = -sin(x) and cos(-x) = cos(x).

theorem real_sine_odd_and_cosine_even (x : ℝ) : Real.sin (-x) = -Real.sin x ∧ Real.cos (-x) = Real.cos x

Lean source

Theorem 4.7.4: For all real numbers x, y, cos(x + y) = cos(x)cos(y) - sin(x)sin(y) and sin(x + y) = sin(x)cos(y) + cos(x)sin(y).

theorem real_sine_cosine_addition_formulas (x y : ℝ) : Real.cos (x + y) = Real.cos x * Real.cos y - Real.sin x * Real.sin y ∧ Real.sin (x + y) = Real.sin x * Real.cos y + Real.cos x * Real.sin y

Lean source

Theorem 4.7.5: We have sin(0) = 0 and cos(0) = 1.

theorem real_sine_and_cosine_at_zero : Real.sin 0 = 0 ∧ Real.cos 0 = 1

Lean source

Lemma 4.7.1: There exists a real number x > 0 such that sin x = 0.

lemma exists_positive_real_with_sine_zero : ∃ x : ℝ, 0 < x ∧ Real.sin x = 0

Lean source

Definition 4.7.2: Define π to be inf {x ∈ (0, ∞) : Real.sin x = 0}.

noncomputable def firstPositiveSineZero : ℝ := sInf {x : ℝ | x ∈ Set.Ioi (0 : ℝ) ∧ Real.sin x = 0}

Lean source

Definition 4.7.3: The tangent function is the map tan : (-π/2, π/2) → ℝ defined by tan(x) = sin x / cos x.

noncomputable def tangentFunction : Set.Ioo (-(firstPositiveSineZero / 2)) (firstPositiveSineZero / 2) → ℝ := fun x => Real.sin x / Real.cos x

Lean source

Definition 4.7.4: Define f : ℝ → ℝ by f(x) = ∑' n = 1..∞, 4^{-n} * cos(32^n * π * x). Equivalently (reindexing by n : ℕ), f(x) = ∑' n, (1 / 4^(n+1)) * cos(32^(n+1) * π * x).

noncomputable def scaledCosineSeriesFunction : ℝ → ℝ := fun x => ∑' n : ℕ, (1 / (4 : ℝ) ^ (n + 1)) * Real.cos (((32 : ℝ) ^ (n + 1)) * firstPositiveSineZero * x)

Lean source

Proposition 4.7.8: Define tan : (-π/2, π/2) → ℝ by tan(x) = sin x / cos x. Then tan is differentiable on (-π/2, π/2) and (d/dx) tan(x) = 1 + tan(x)^2 for x ∈ (-π/2, π/2). In particular, tan is strictly increasing on (-π/2, π/2), lim_{x→(π/2)^-} tan(x) = +∞, lim_{x→(-π/2)^+} tan(x) = -∞, and hence tan is a bijection from (-π/2, π/2) onto ℝ.

theorem tangent_differentiableOn_deriv_strictMono_limits_and_bijective : DifferentiableOn ℝ (fun x : ℝ => Real.sin x / Real.cos x) (Set.Ioo (-(firstPositiveSineZero / 2)) (firstPositiveSineZero / 2)) ∧ (∀ x ∈ Set.Ioo (-(firstPositiveSineZero / 2)) (firstPositiveSineZero / 2), deriv (fun y : ℝ => Real.sin y / Real.cos y) x = 1 + (Real.sin x / Real.cos x) ^ 2) ∧ StrictMonoOn (fun x : ℝ => Real.sin x / Real.cos x) (Set.Ioo (-(firstPositiveSineZero / 2)) (firstPositiveSineZero / 2)) ∧ Filter.Tendsto (fun x : ℝ => Real.sin x / Real.cos x) (nhdsWithin (firstPositiveSineZero / 2) (Set.Iio (firstPositiveSineZero / 2))) Filter.atTop ∧ Filter.Tendsto (fun x : ℝ => Real.sin x / Real.cos x) (nhdsWithin (-(firstPositiveSineZero / 2)) (Set.Ioi (-(firstPositiveSineZero / 2)))) Filter.atBot ∧ Function.Bijective (fun x : Set.Ioo (-(firstPositiveSineZero / 2)) (firstPositiveSineZero / 2) => Real.sin x.1 / Real.cos x.1)

Lean source

Proposition 4.7.9: Let tan⁻¹ : ℝ → (-π/2, π/2) be the inverse of tan : (-π/2, π/2) → ℝ. Then Real.arctan is differentiable on ℝ and for every x : ℝ, (d/dx) arctan(x) = 1 / (1 + x^2).

theorem arctan_differentiable_and_deriv : Differentiable ℝ Real.arctan ∧ ∀ x : ℝ, deriv Real.arctan x = 1 / (1 + x ^ 2)

Lean source

Proposition 4.7.10: For every real number x with |x| < 1, the arctangent function has the power series expansion arctan x = ∑' n, (-1)^n * x^(2n+1) / (2n+1).

theorem arctan_eq_tsum_powerSeries_of_abs_lt_one {x : ℝ} (hx : |x| < 1) : Real.arctan x = ∑' n : ℕ, (((-1 : ℝ) ^ n) * x ^ (2 * n + 1)) / (2 * n + 1 : ℝ)

Lean source

Proposition 4.7.4: If x, y : ℝ satisfy x^2 + y^2 = 1, then there exists a unique θ ∈ (-π, π] such that sin θ = x and cos θ = y.

theorem existsUnique_angle_in_Ioc_neg_pi_pi_of_sq_add_sq_eq_one (x y : ℝ) (hxy : x ^ 2 + y ^ 2 = 1) : ∃! θ : ℝ, θ ∈ Set.Ioc (-firstPositiveSineZero) firstPositiveSineZero ∧ Real.sin θ = x ∧ Real.cos θ = y

Lean source

Proposition 4.7.5: if r, s > 0 and θ, α : ℝ satisfy (r : ℂ) * exp(iθ) = (s : ℂ) * exp(iα), then r = s and θ = α + 2πk for some k : ℤ.

theorem complex_polar_exp_eq_iff (r s θ α : ℝ) (hr : 0 < r) (hs : 0 < s) (hEq : (r : ℂ) * Complex.exp (Complex.I * (θ : ℂ)) = (s : ℂ) * Complex.exp (Complex.I * (α : ℂ))) : r = s ∧ ∃ k : ℤ, θ = α + 2 * Real.pi * (k : ℝ)

Lean source

Proposition 4.7.6: for every nonzero complex number z, there exists a unique pair (r, θ) with r > 0 and θ ∈ (-π, π] (where π is firstPositiveSineZero) such that z = r * exp(iθ).

theorem complex_existsUnique_polar_coordinates_Ioc (z : ℂ) (hz : z ≠ 0) : ∃! p : ℝ × ℝ, 0 < p.1 ∧ p.2 ∈ Set.Ioc (-firstPositiveSineZero) firstPositiveSineZero ∧ z = (p.1 : ℂ) * Complex.exp (Complex.I * (p.2 : ℂ))

Lean source

Theorem 4.7.6: for every real number x, exp(ix) = cos(x) + i sin(x) and exp(-ix) = cos(x) - i sin(x). In particular, cos(x) = Re(exp(ix)) and sin(x) = Im(exp(ix)).

theorem real_euler_formula_and_real_imag_parts (x : ℝ) : Complex.exp (Complex.I * (x : ℂ)) = (Real.cos x : ℂ) + Complex.I * (Real.sin x : ℂ) ∧ Complex.exp (-Complex.I * (x : ℂ)) = (Real.cos x : ℂ) - Complex.I * (Real.sin x : ℂ) ∧ Real.cos x = Complex.re (Complex.exp (Complex.I * (x : ℂ))) ∧ Real.sin x = Complex.im (Complex.exp (Complex.I * (x : ℂ)))

Lean source

Proposition 4.7.7 (de Moivre identities): for every θ : ℝ and n : ℤ, cos(nθ) and sin(nθ) are the real and imaginary parts of (cos θ + i sin θ)^n; equivalently, (cos θ + i sin θ)^n = cos(nθ) + i sin(nθ).

theorem de_moivre_identities_integer_powers (θ : ℝ) (n : ℤ) : Real.cos ((n : ℝ) * θ) = Complex.re (((Real.cos θ : ℂ) + Complex.I * (Real.sin θ : ℂ)) ^ n) ∧ Real.sin ((n : ℝ) * θ) = Complex.im (((Real.cos θ : ℂ) + Complex.I * (Real.sin θ : ℂ)) ^ n) ∧ (((Real.cos θ : ℂ) + Complex.I * (Real.sin θ : ℂ)) ^ n) = (Real.cos ((n : ℝ) * θ) : ℂ) + Complex.I * (Real.sin ((n : ℝ) * θ) : ℂ)

Lean source

Theorem 4.7.7: For every real number x (with π from Definition 4.7.2), cos (x + π) = -cos x and sin (x + π) = -sin x. In particular, cos (x + 2π) = cos x and sin (x + 2π) = sin x, so sin and cos are periodic with period 2π.

theorem real_sine_cosine_pi_antiperiodicity_and_two_pi_periodicity : (∀ x : ℝ, Real.cos (x + firstPositiveSineZero) = -Real.cos x ∧ Real.sin (x + firstPositiveSineZero) = -Real.sin x) ∧ (∀ x : ℝ, Real.cos (x + 2 * firstPositiveSineZero) = Real.cos x ∧ Real.sin (x + 2 * firstPositiveSineZero) = Real.sin x) ∧ Function.Periodic Real.cos (2 * firstPositiveSineZero) ∧ Function.Periodic Real.sin (2 * firstPositiveSineZero)

Lean source

Theorem 4.7.8: For every real number x (with π given by Definition 4.7.2), Real.sin x = 0 if and only if x / π is an integer.

theorem real_sine_eq_zero_iff_div_firstPositiveSineZero_integer (x : ℝ) : Real.sin x = 0 ↔ ∃ n : ℤ, x / firstPositiveSineZero = (n : ℝ)

Lean source

Helper for Proposition 4.7.1: the absolute-value even cosine-series coefficients are summable over ℝ.

lemma helperForProposition_4_7_1_abs_even_series_summable (x : ℝ) : Summable (fun n : ℕ => |(((-1 : ℝ) ^ n * x ^ (2 * n)) / (Nat.factorial (2 * n) : ℝ))|)

Lean source

Helper for Proposition 4.7.1: the absolute-value odd sine-series coefficients are summable over ℝ.

lemma helperForProposition_4_7_1_abs_odd_series_summable (x : ℝ) : Summable (fun n : ℕ => |(((-1 : ℝ) ^ n * x ^ (2 * n + 1)) / (Nat.factorial (2 * n + 1) : ℝ))|)

Lean source

Helper for Proposition 4.7.1: the signed cosine and sine coefficient series are summable over ℝ.

lemma helperForProposition_4_7_1_signed_series_summable (x : ℝ) : Summable (fun n : ℕ => (((-1 : ℝ) ^ n) * x ^ (2 * n)) / (Nat.factorial (2 * n) : ℝ)) ∧ Summable (fun n : ℕ => (((-1 : ℝ) ^ n) * x ^ (2 * n + 1)) / (Nat.factorial (2 * n + 1) : ℝ))

Lean source

Helper for Proposition 4.7.1: assemble the final conjunction for the let-bound series definitions.

lemma helperForProposition_4_7_1_assemble_let_bound_goal (x : ℝ) : let a : ℕ → ℝ := fun n => (((-1 : ℝ) ^ n) * x ^ (2 * n)) / (Nat.factorial (2 * n) : ℝ) let b : ℕ → ℝ := fun n => (((-1 : ℝ) ^ n) * x ^ (2 * n + 1)) / (Nat.factorial (2 * n + 1) : ℝ) Summable (fun n : ℕ => |a n|) ∧ Summable (fun n : ℕ => |b n|) ∧ Summable a ∧ Summable b

Lean source

Helper for Proposition 4.7.2: a nonzero derivative at x₀ forces nearby punctured points to have function value different from f x₀.

lemma helperForProposition_4_7_2_eventually_ne_value_at_x0 (f : ℝ → ℝ) (x₀ : ℝ) (hf_diff : DifferentiableAt ℝ f x₀) (hf_deriv_ne_zero : deriv f x₀ ≠ 0) : ∀ᶠ y in nhdsWithin x₀ (({x₀} : Set ℝ)ᶜ), f y ≠ f x₀

Lean source

Helper for Proposition 4.7.2: rewriting local inequality against f x₀ as local inequality against 0 when f x₀ = 0.

lemma helperForProposition_4_7_2_eventually_ne_zero (f : ℝ → ℝ) (x₀ : ℝ) (hf_zero : f x₀ = 0) (h_ne_value_at_x0 : ∀ᶠ y in nhdsWithin x₀ (({x₀} : Set ℝ)ᶜ), f y ≠ f x₀) : ∀ᶠ y in nhdsWithin x₀ (({x₀} : Set ℝ)ᶜ), f y ≠ 0

Lean source

Helper for Proposition 4.7.2: an eventual punctured-neighborhood property yields a positive radius with the textbook 0 < |y - x₀| < c form.

lemma helperForProposition_4_7_2_radius_from_eventually_punctured (x₀ : ℝ) {P : ℝ → Prop} (hP : ∀ᶠ y in nhdsWithin x₀ (({x₀} : Set ℝ)ᶜ), P y) : ∃ c > 0, ∀ y : ℝ, 0 < |y - x₀| ∧ |y - x₀| < c → P y

Lean source

Helper for Theorem 4.7.1: every real sine value lies in [-1, 1].

lemma helperForTheorem_4_7_1_sine_mem_Icc (x : ℝ) : Real.sin x ∈ Set.Icc (-1) 1

Lean source

Helper for Theorem 4.7.1: every real cosine value lies in [-1, 1].

lemma helperForTheorem_4_7_1_cosine_mem_Icc (x : ℝ) : Real.cos x ∈ Set.Icc (-1) 1

Lean source

Helper for Theorem 4.7.2: pointwise derivative formula for Real.sin.

lemma helperForTheorem_4_7_2_sin_deriv_pointwise (x : ℝ) : deriv Real.sin x = Real.cos x

Lean source

Helper for Theorem 4.7.2: pointwise derivative formula for Real.cos.

lemma helperForTheorem_4_7_2_cos_deriv_pointwise (x : ℝ) : deriv Real.cos x = -Real.sin x

Lean source

Helper for Proposition 4.7.8: every positive real zero of Real.sin is at least π.

lemma helperForProposition_4_7_8_pi_le_of_positive_sine_zero (t : ℝ) (ht_pos : 0 < t) (ht_sin : Real.sin t = 0) : Real.pi ≤ t

Lean source

Helper for Proposition 4.7.8: the infimum defining firstPositiveSineZero equals π.

lemma helperForProposition_4_7_8_firstPositiveSineZero_eq_pi : firstPositiveSineZero = Real.pi

Lean source

Helper for Proposition 4.7.8: Real.tan is differentiable on (-π/2, π/2).

lemma helperForProposition_4_7_8_differentiableOn_tan_Ioo : DifferentiableOn ℝ Real.tan (Set.Ioo (-(Real.pi / 2)) (Real.pi / 2))

Lean source

Helper for Proposition 4.7.8: the derivative formula tan' = 1 + tan^2 on (-π/2, π/2).

lemma helperForProposition_4_7_8_deriv_tan_eq_one_add_tan_sq_on_Ioo : ∀ x ∈ Set.Ioo (-(Real.pi / 2)) (Real.pi / 2), deriv Real.tan x = 1 + Real.tan x ^ 2

Lean source

Helper for Proposition 4.7.8: Real.tan is bijective from (-π/2, π/2) to ℝ.

lemma helperForProposition_4_7_8_bijective_tan_subtype : Function.Bijective (fun x : Set.Ioo (-(Real.pi / 2)) (Real.pi / 2) => Real.tan x.1)

Lean source

Helper for Proposition 4.7.9: Real.arctan is differentiable on all real numbers.

lemma helperForProposition_4_7_9_differentiable_arctan_global : Differentiable ℝ Real.arctan

Lean source

Helper for Proposition 4.7.9: pointwise derivative formula for Real.arctan.

lemma helperForProposition_4_7_9_deriv_arctan_pointwise (x : ℝ) : deriv Real.arctan x = 1 / (1 + x ^ 2)

Lean source

Helper for Proposition 4.7.9: alternate pointwise derivative formula from Real.deriv_arctan.

lemma helperForProposition_4_7_9_deriv_arctan_pointwise_alt (x : ℝ) : deriv Real.arctan x = 1 / (1 + x ^ 2)

Lean source

Helper for Proposition 4.7.4: the positive-zero set used in the definition of firstPositiveSineZero is nonempty and bounded below.

lemma helperForProposition_4_7_4_positiveSineZeroSet_nonempty_bddBelow : Set.Nonempty {t : ℝ | t ∈ Set.Ioi (0 : ℝ) ∧ Real.sin t = 0} ∧ BddBelow {t : ℝ | t ∈ Set.Ioi (0 : ℝ) ∧ Real.sin t = 0}

Lean source

Helper for Proposition 4.7.4: every positive real zero of Real.sin is at least π.

lemma helperForProposition_4_7_4_pi_le_of_positive_sine_zero (t : ℝ) (ht_pos : 0 < t) (ht_sin : Real.sin t = 0) : Real.pi ≤ t

Lean source

Helper for Proposition 4.7.4: the definition of firstPositiveSineZero agrees with the standard constant Real.pi.

lemma helperForProposition_4_7_4_firstPositiveSineZero_eq_pi : firstPositiveSineZero = Real.pi

Lean source

Helper for Proposition 4.7.4: existence of an angle in (-π, π] with prescribed sin and cos coordinates on the unit circle.

lemma helperForProposition_4_7_4_exists_angle_in_Ioc_neg_pi_pi (x y : ℝ) (hxy : x ^ 2 + y ^ 2 = 1) : ∃ θ : ℝ, θ ∈ Set.Ioc (-Real.pi) Real.pi ∧ Real.sin θ = x ∧ Real.cos θ = y

Lean source

Helper for Proposition 4.7.4: uniqueness of the angle in (-π, π] with fixed sin and cos values.

lemma helperForProposition_4_7_4_angle_unique_in_Ioc_neg_pi_pi (x y θ₁ θ₂ : ℝ) (hθ₁ : θ₁ ∈ Set.Ioc (-Real.pi) Real.pi) (hθ₂ : θ₂ ∈ Set.Ioc (-Real.pi) Real.pi) (hsin₁ : Real.sin θ₁ = x) (hcos₁ : Real.cos θ₁ = y) (hsin₂ : Real.sin θ₂ = x) (hcos₂ : Real.cos θ₂ = y) : θ₁ = θ₂

Lean source

Helper for Proposition 4.7.5: the norm of exp(i x) is 1 for real x.

lemma helperForProposition_4_7_5_norm_exp_I_mul_real (x : ℝ) : ‖Complex.exp (Complex.I * (x : ℂ))‖ = 1

Lean source

Helper for Proposition 4.7.5: equality of scaled polar exponentials with positive radii forces equality of radii.

lemma helperForProposition_4_7_5_radius_eq_of_scaled_exp_eq (r s θ α : ℝ) (hr : 0 < r) (hs : 0 < s) (hEq : (r : ℂ) * Complex.exp (Complex.I * (θ : ℂ)) = (s : ℂ) * Complex.exp (Complex.I * (α : ℂ))) : r = s

Lean source

Helper for Proposition 4.7.5: after identifying radii, one can cancel the nonzero real scalar and deduce equality of the exponential factors.

lemma helperForProposition_4_7_5_exp_eq_of_radius_eq (r s θ α : ℝ) (hr : 0 < r) (hrs : r = s) (hEq : (r : ℂ) * Complex.exp (Complex.I * (θ : ℂ)) = (s : ℂ) * Complex.exp (Complex.I * (α : ℂ))) : Complex.exp (Complex.I * (θ : ℂ)) = Complex.exp (Complex.I * (α : ℂ))

Lean source

Helper for Proposition 4.7.5: equality of exp(iθ) and exp(iα) forces an integer 2π angle shift between θ and α.

lemma helperForProposition_4_7_5_angle_shift_of_exp_I_eq (θ α : ℝ) (hExpEq : Complex.exp (Complex.I * (θ : ℂ)) = Complex.exp (Complex.I * (α : ℂ))) : ∃ k : ℤ, θ = α + 2 * Real.pi * (k : ℝ)

Lean source

Helper for Proposition 4.7.6: the canonical witness (‖z‖, arg z) satisfies the required positivity, interval, and reconstruction properties.

lemma helperForProposition_4_7_6_exists_polar_witness (z : ℂ) (hz : z ≠ 0) : ∃ p : ℝ × ℝ, 0 < p.1 ∧ p.2 ∈ Set.Ioc (-firstPositiveSineZero) firstPositiveSineZero ∧ z = (p.1 : ℂ) * Complex.exp (Complex.I * (p.2 : ℂ))

Lean source

Helper for Proposition 4.7.6: if two angles lie in (-π, π] and differ by an integer multiple of 2π, then the integer shift is zero.

lemma helperForProposition_4_7_6_int_shift_zero_of_interval_bounds {θ α : ℝ} {k : ℤ} (hθ : θ ∈ Set.Ioc (-firstPositiveSineZero) firstPositiveSineZero) (hα : α ∈ Set.Ioc (-firstPositiveSineZero) firstPositiveSineZero) (hEq : θ = α + 2 * Real.pi * (k : ℝ)) : k = 0

Lean source

Helper for Proposition 4.7.6: two admissible polar representations of the same nonzero complex number have identical radius and angle.

lemma helperForProposition_4_7_6_radius_angle_unique {z : ℂ} {r s θ α : ℝ} (hr : 0 < r) (hs : 0 < s) (hθ : θ ∈ Set.Ioc (-firstPositiveSineZero) firstPositiveSineZero) (hα : α ∈ Set.Ioc (-firstPositiveSineZero) firstPositiveSineZero) (hEqR : z = (r : ℂ) * Complex.exp (Complex.I * (θ : ℂ))) (hEqS : z = (s : ℂ) * Complex.exp (Complex.I * (α : ℂ))) : r = s ∧ θ = α

Lean source

Helper for Theorem 4.7.6: Euler's formula in the exp(i x) direction for real x.

lemma helperForTheorem_4_7_6_exp_I_mul_ofReal (x : ℝ) : Complex.exp (Complex.I * (x : ℂ)) = (Real.cos x : ℂ) + Complex.I * (Real.sin x : ℂ)

Lean source

Helper for Theorem 4.7.6: Euler's formula in the exp(-i x) direction for real x.

lemma helperForTheorem_4_7_6_exp_neg_I_mul_ofReal (x : ℝ) : Complex.exp (-Complex.I * (x : ℂ)) = (Real.cos x : ℂ) - Complex.I * (Real.sin x : ℂ)

Lean source

Helper for Theorem 4.7.6: real and imaginary parts of exp(i x) for real x.

lemma helperForTheorem_4_7_6_re_im_of_exp_I_mul (x : ℝ) : Real.cos x = Complex.re (Complex.exp (Complex.I * (x : ℂ))) ∧ Real.sin x = Complex.im (Complex.exp (Complex.I * (x : ℂ)))

Lean source

Helper for Proposition 4.7.7: rewrite cos θ + i sin θ as exp(iθ).

lemma helperForProposition_4_7_7_base_as_exp (θ : ℝ) : ((Real.cos θ : ℂ) + Complex.I * (Real.sin θ : ℂ)) = Complex.exp (Complex.I * (θ : ℂ))

Lean source

Helper for Proposition 4.7.7: normalize the scaled exponential argument for integer powers.

lemma helperForProposition_4_7_7_exp_int_argument_rewrite (θ : ℝ) (n : ℤ) : (n : ℂ) * (Complex.I * (θ : ℂ)) = Complex.I * (((n : ℝ) * θ : ℝ) : ℂ)

Lean source

Helper for Proposition 4.7.7: convert (cos θ + i sin θ)^n to one exponential at argument (n : ℝ) * θ.

lemma helperForProposition_4_7_7_power_as_exp_scaled (θ : ℝ) (n : ℤ) : (((Real.cos θ : ℂ) + Complex.I * (Real.sin θ : ℂ)) ^ n) = Complex.exp (Complex.I * (((n : ℝ) * θ : ℝ) : ℂ))

Lean source

Helper for Proposition 4.7.7: identify cos(nθ) and sin(nθ) as the real and imaginary parts of (cos θ + i sin θ)^n.

lemma helperForProposition_4_7_7_re_im_from_power (θ : ℝ) (n : ℤ) : Real.cos ((n : ℝ) * θ) = Complex.re (((Real.cos θ : ℂ) + Complex.I * (Real.sin θ : ℂ)) ^ n) ∧ Real.sin ((n : ℝ) * θ) = Complex.im (((Real.cos θ : ℂ) + Complex.I * (Real.sin θ : ℂ)) ^ n)

Lean source

Helper for Theorem 4.7.7: the positive sine-zero set is nonempty and bounded below.

lemma helperForTheorem_4_7_7_positiveSineZeroSet_nonempty_bddBelow : Set.Nonempty {x : ℝ | x ∈ Set.Ioi (0 : ℝ) ∧ Real.sin x = 0} ∧ BddBelow {x : ℝ | x ∈ Set.Ioi (0 : ℝ) ∧ Real.sin x = 0}

Lean source

Helper for Theorem 4.7.7: every positive real zero of sine is at least π.

lemma helperForTheorem_4_7_7_pi_is_lower_bound_of_positive_sine_zeros (y : ℝ) (hy_pos : 0 < y) (hy_sin : Real.sin y = 0) : Real.pi ≤ y

Lean source

Helper for Theorem 4.7.7: the definition of firstPositiveSineZero agrees with Real.pi.

lemma helperForTheorem_4_7_7_firstPositiveSineZero_eq_pi : firstPositiveSineZero = Real.pi

Lean source

Helper for Theorem 4.7.7: transport π-identities to firstPositiveSineZero.

lemma helperForTheorem_4_7_7_transport_antiperiodic_periodic (hpi : firstPositiveSineZero = Real.pi) : (∀ x : ℝ, Real.cos (x + firstPositiveSineZero) = -Real.cos x ∧ Real.sin (x + firstPositiveSineZero) = -Real.sin x) ∧ (∀ x : ℝ, Real.cos (x + 2 * firstPositiveSineZero) = Real.cos x ∧ Real.sin (x + 2 * firstPositiveSineZero) = Real.sin x) ∧ Function.Periodic Real.cos (2 * firstPositiveSineZero) ∧ Function.Periodic Real.sin (2 * firstPositiveSineZero)

Lean source

Helper for Theorem 4.7.8: firstPositiveSineZero is nonzero.

lemma helperForTheorem_4_7_8_firstPositiveSineZero_ne_zero : firstPositiveSineZero ≠ 0

Lean source

Helper for Theorem 4.7.8: divide-by-firstPositiveSineZero form equals integer-multiple-of-π form.

lemma helperForTheorem_4_7_8_div_eq_int_iff_mul_eq_int_pi (x : ℝ) (n : ℤ) : x / firstPositiveSineZero = (n : ℝ) ↔ x = (n : ℝ) * Real.pi

Lean source

Helper for Theorem 4.7.8: the integer-existence formulations using division by firstPositiveSineZero and multiplication by π are equivalent.

lemma helperForTheorem_4_7_8_exists_div_eq_int_iff_exists_mul_eq_int_pi (x : ℝ) : (∃ n : ℤ, x / firstPositiveSineZero = (n : ℝ)) ↔ (∃ n : ℤ, x = (n : ℝ) * Real.pi)

4.7 — Trigonometric Functions — Part 2

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

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

theorem real_cos_eq_zero_iff_div_firstPositiveSineZero_half_integer (x : ℝ) : Real.cos x = 0 ↔ ∃ n : ℤ, x / firstPositiveSineZero = (n : ℝ) + (1 / 2 : ℝ)

Lean source

Proposition 4.7.11: the Leibniz series identity π = 4 * (1 - 1/3 + 1/5 - 1/7 + ⋯) holds in Lean via the conditional summation filter on ℕ; in particular, 4 - 4/3 < π < 4.

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

Lean source

Proposition 4.7.12: for f(x) = ∑_{n=1}^∞ 4^{-n} cos(32^n π x) (with π = firstPositiveSineZero from Definition 4.7.2), the series converges uniformly on ℝ; in particular, f is continuous on ℝ.

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

Lean source

Proposition 4.7.13: for every j : ℤ and every integer m ≥ 1, for f(x) = ∑_{n=1}^∞ 4^{-n} cos(32^n π x) (with π = firstPositiveSineZero), the increment across consecutive points of mesh size 32^{-m} satisfies |f((j+1)/32^m) - f(j/32^m)| ≥ 4^{-m}.

theorem scaledCosineSeries_increment_lower_bound (j : ℤ) (m : ℕ) (hm : 1 ≤ m) :

Lean source

Helper for Theorem 4.7.9: shifting by firstPositiveSineZero / 2 converts Real.sin to Real.cos.

lemma helperForTheorem_4_7_9_sin_shift_half_firstPositiveSineZero_eq_cos (x : ℝ) : Real.sin (x + firstPositiveSineZero / 2) = Real.cos x

Lean source

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

lemma helperForTheorem_4_7_9_shifted_division_formula (x : ℝ) : (x + firstPositiveSineZero / 2) / firstPositiveSineZero = x / firstPositiveSineZero + (1 / 2 : ℝ)

Lean source

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 : ℝ))

Lean source

Helper for Theorem 4.7.9: Real.cos 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

Lean source

Helper for Proposition 4.7.11: the Leibniz series gives π / 4 for the conditional summation filter on ℕ.

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 ℕ)

Lean source

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

lemma helperForProposition_4_7_11_firstPositiveSineZero_eq_four_mul_conditional_tsum : firstPositiveSineZero = 4 * ∑'[SummationFilter.conditional ℕ] n : ℕ, (((-1 : ℝ) ^ n) / (2 * n + 1 : ℝ))

Lean source

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 : ℝ))

Lean source

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 : ℝ)))

Lean source

Helper for Proposition 4.7.11: under Lean's default unconditional tsum, the alternating odd-reciprocal series has value 0.

lemma helperForProposition_4_7_11_tsum_alternating_inv_odd_eq_zero : (∑' n : ℕ, (((-1 : ℝ) ^ n) / (2 * n + 1 : ℝ))) = 0

Lean source

Helper for Proposition 4.7.11: consequently, 4 * ∑' n, (-1)^n / (2n+1) is 0 under unconditional tsum.

lemma helperForProposition_4_7_11_four_mul_tsum_alternating_inv_odd_eq_zero : 4 * ∑' n : ℕ, (((-1 : ℝ) ^ n) / (2 * n + 1 : ℝ)) = 0

Lean source

Helper for Proposition 4.7.11: the unconditional-series equality would force firstPositiveSineZero = 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

Lean source

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

lemma helperForProposition_4_7_11_lower_bound : 4 - 4 / 3 < firstPositiveSineZero

Lean source

Helper for Proposition 4.7.11: upper bound firstPositiveSineZero < 4.

lemma helperForProposition_4_7_11_upper_bound : firstPositiveSineZero < 4

Lean source

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

Lean source

Helper for Proposition 4.7.11: under unconditional tsum, the asserted Leibniz equality would force firstPositiveSineZero = 0, contradicting firstPositiveSineZero = Real.pi.

lemma helperForProposition_4_7_11_not_firstPositiveSineZero_eq_four_mul_tsum_alternating_inv_odd : ¬ firstPositiveSineZero = 4 * ∑' n : ℕ, (((-1 : ℝ) ^ n) / (2 * n + 1 : ℝ))

Lean source

Helper for Proposition 4.7.11: the full conjunction in the target statement is inconsistent with 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)

Lean source

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.

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

Lean source

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))

Lean source

Helper for Proposition 4.7.12: the geometric majorant 4^{-(n+1)} is summable.

lemma helperForProposition_4_7_12_majorantSummable : Summable (fun n : ℕ => 1 / (4 : ℝ) ^ (n + 1))

Lean source

Helper for Proposition 4.7.12: each summand is bounded in norm by 4^{-(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)

Lean source

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

Lean source

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)))

Lean source

Helper for Proposition 4.7.13: the n-th increment term of scaledCosineSeriesFunction across mesh size 32^{-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))) )

Lean source

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))

Lean source

Helper for Proposition 4.7.13: for n ≥ m, the phase shift 32^(n+1-m) * π is an integer multiple of 2π.

lemma helperForProposition_4_7_13_phaseShift_asTwoPiMultiple (m n : ℕ) (hmn : m ≤ n) : ∃ k : ℕ, ((32 : ℝ) ^ (n + 1 - m)) * firstPositiveSineZero = (k : ℝ) * (2 * Real.pi)

Lean source

Helper for Proposition 4.7.13: all modes n ≥ 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

Lean source

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

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

Lean source

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

lemma helperForProposition_4_7_13_mainMode_exact (j : ℤ) (m : ℕ) (hm : 1 ≤ m) :

Lean source

Helper for Proposition 4.7.13: finite geometric bound for ∑_{n < m-1} 8^{n+1}.

lemma helperForProposition_4_7_13_sumPowEight_bound (m : ℕ) (hm : 1 ≤ m) : (∑ n ∈ Finset.range (m - 1), (8 : ℝ) ^ (n + 1)) ≤ ((8 : ℝ) ^ m) / 7

Lean source

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 : ℕ) :

Lean source

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))

Lean source

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

lemma helperForProposition_4_7_13_lowMode_series_to_quarterPow (m : ℕ) (hm : 1 ≤ m) : (Real.pi / (32 : ℝ) ^ m) * (((8 : ℝ) ^ m) / 7) ≤ 1 / (4 : ℝ) ^ m

Lean source

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

lemma helperForProposition_4_7_13_lowModes_bound (j : ℤ) (m : ℕ) (hm : 1 ≤ m) :

Lean source

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

lemma helperForProposition_4_7_13_absLowerBound_from_main_plus_error (m : ℕ) {main error : ℝ} (hmain : |main| = 2 / (4 : ℝ) ^ m) (herror : |error| ≤ 1 / (4 : ℝ) ^ m) :

4.7 — Trigonometric Functions — Part 3

Lean authors: Zichen Wang, Wanli Ma, Zaiwen Wen.

Source header

Proposition 4.7.14: for f(x) = ∑_{n=1}^∞ 4^{-n} cos(32^n π x) (encoded here as scaledCosineSeriesFunction from Definition 4.7.4), f is nowhere differentiable on ℝ; i.e., for every x₀ : ℝ, f is not differentiable at x₀.

theorem scaledCosineSeries_nowhere_differentiable (x₀ : ℝ) : ¬ DifferentiableAt ℝ scaledCosineSeriesFunction x₀

Lean source

Helper for Proposition 4.7.14: floor-bracketing x₀ between consecutive 32^{-m}-mesh points.

lemma helperForProposition_4_7_14_gridBracket_by_floor (x₀ : ℝ) (m : ℕ) : let j : ℤ := Int.floor (x₀ * (32 : ℝ) ^ m) let a : ℝ := (j : ℝ) / ((32 : ℝ) ^ m) let b : ℝ := ((j + 1 : ℤ) : ℝ) / ((32 : ℝ) ^ m) a ≤ x₀ ∧ x₀ < b ∧ b - a = 1 / ((32 : ℝ) ^ m)

Lean source

Helper for Proposition 4.7.14: ratio identity (8^m)/(32^m) = 1/(4^m).

lemma helperForProposition_4_7_14_powRatio_eight_div_thirtyTwo (m : ℕ) : ((8 : ℝ) ^ m) / ((32 : ℝ) ^ m) = 1 / ((4 : ℝ) ^ m)

Lean source

Helper for Proposition 4.7.14: a lower bound on numerator and an upper bound on distance imply a large secant quotient.

lemma helperForProposition_4_7_14_secantLower_from_numerator_and_distance (x₀ y : ℝ) (m : ℕ) (hnum : 1 / (2 * (4 : ℝ) ^ m) ≤ |scaledCosineSeriesFunction y - scaledCosineSeriesFunction x₀|) (hdist_pos : 0 < |y - x₀|) (hdist_le : |y - x₀| ≤ 1 / ((32 : ℝ) ^ m)) : (8 : ℝ) ^ m / 2 ≤

Lean source

Helper for Proposition 4.7.14: for every mesh scale, one can find a nearby point with secant slope at least (8^m)/2.

lemma helperForProposition_4_7_14_exists_large_local_secant (x₀ : ℝ) (m : ℕ) (hm : 1 ≤ m) : ∃ y : ℝ, 0 < |y - x₀| ∧

Lean source

Helper for Proposition 4.7.14: differentiability at x₀ forces eventual boundedness of punctured-neighborhood secant quotients.

lemma helperForProposition_4_7_14_eventual_secant_bound_of_differentiableAt (x₀ : ℝ) (hf : DifferentiableAt ℝ scaledCosineSeriesFunction x₀) : ∀ᶠ y in nhdsWithin x₀ (({x₀} : Set ℝ)ᶜ),

Lean source

Helper for Proposition 4.7.14: choose a scale m making 32^{-m} tiny and (8^m)/2 larger than a prescribed bound.

lemma helperForProposition_4_7_14_choose_m_against_delta_and_C (δ : ℝ) (hδ : 0 < δ) (C : ℝ) : ∃ m : ℕ, 1 ≤ m ∧ 1 / ((32 : ℝ) ^ m) < δ ∧ C < (8 : ℝ) ^ m / 2