Chapter 02 — Sequences and Series

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

Reading sections

2.1 — Sequences and Limits

Lean authors: Zichen Wang, Zaiwen Wen.

Source header

Definition 2.1.1: A sequence of real numbers is a function x : ℕ → ℝ, whose n-th term is denoted x n (often written xₙ), and also denoted {x_n}_{n=1}^{\infty}. The sequence is bounded if there exists B : ℝ with |x n| ≤ B for all n. It is bounded below if there is B with B ≤ x n for all n, and bounded above if there is B with x n ≤ B for all n.

open scoped BigOperators open Metric abbrev RealSequence : Type := ℕ → ℝ

Lean source

A real sequence admitting a uniform bound on absolute values.

open scoped BigOperators open Metric def BoundedSequence (x : RealSequence) : Prop := ∃ B : ℝ, ∀ n : ℕ, |x n| ≤ B

Lean source

A real sequence with a uniform lower bound.

open scoped BigOperators open Metric def BoundedBelowSequence (x : RealSequence) : Prop := ∃ B : ℝ, ∀ n : ℕ, B ≤ x n

Lean source

A real sequence with a uniform upper bound.

open scoped BigOperators open Metric def BoundedAboveSequence (x : RealSequence) : Prop := ∃ B : ℝ, ∀ n : ℕ, x n ≤ B

Lean source

Closed balls at the origin are described by absolute values.

open scoped BigOperators open Metric lemma real_mem_closedBall_0_iff_abs_le (x B : ℝ) : x ∈ closedBall (0 : ℝ) B ↔ |x| ≤ B

Lean source

Range inclusion in a closed ball is equivalent to a uniform absolute bound.

open scoped BigOperators open Metric lemma range_subset_closedBall_iff_abs_bound (x : ℕ → ℝ) (B : ℝ) : Set.range x ⊆ closedBall (0 : ℝ) B ↔ ∀ n, |x n| ≤ B

Lean source

A bounded real sequence in the book's sense is equivalent to the image of the sequence being bounded as a subset of ℝ.

open scoped BigOperators open Metric lemma boundedSequence_iff_isBounded_range (x : RealSequence) : BoundedSequence x ↔ Bornology.IsBounded (Set.range x)

Lean source

A sequence is bounded above exactly when its range is bounded above as a subset of ℝ.

open scoped BigOperators open Metric lemma boundedAboveSequence_iff_bddAbove_range (x : RealSequence) : BoundedAboveSequence x ↔ BddAbove (Set.range x)

Lean source

A sequence is bounded below exactly when its range is bounded below as a subset of ℝ.

open scoped BigOperators open Metric lemma boundedBelowSequence_iff_bddBelow_range (x : RealSequence) : BoundedBelowSequence x ↔ BddBelow (Set.range x)

Lean source

Definition 2.1.2: A real sequence x converges to l if for every ε > 0 there is an M : ℕ such that |x n - l| < ε whenever n ≥ M. Such an l is called a limit of the sequence, and a sequence with some limit is called convergent (otherwise divergent).

open scoped BigOperators open Metric def ConvergesTo (x : RealSequence) (l : ℝ) : Prop := ∀ ε > 0, ∃ M : ℕ, ∀ n ≥ M, |x n - l| < ε

Lean source

A real sequence is convergent if it admits a (necessarily unique) limit.

open scoped BigOperators open Metric def ConvergentSequence (x : RealSequence) : Prop := ∃ l : ℝ, ConvergesTo x l

Lean source

The book's ε–M definition of convergence agrees with the standard Filter.Tendsto formulation in mathlib.

open scoped BigOperators open Metric lemma convergesTo_iff_tendsto (x : RealSequence) (l : ℝ) : ConvergesTo x l ↔ Filter.Tendsto x Filter.atTop (nhds l)

Lean source

A constant real sequence converges to its constant value.

open scoped BigOperators open Metric lemma constant_seq_converges (a : ℝ) : ConvergesTo (fun _ : ℕ => a) a

Lean source

Example 2.1.3: The constant sequence 1, 1, 1, … converges to 1; for any ε > 0 one may take M = 1, giving |x n - x| = |1 - 1| < ε for every n.

open scoped BigOperators open Metric lemma constant_one_converges : ConvergesTo (fun _ : ℕ => (1 : ℝ)) 1

Lean source

Example 2.1.4: The sequence x n = 1 / n (starting at n = 1) is convergent with limit 0; the proof picks M with 1 / M < ε by the Archimedean property and then estimates |x n - 0| ≤ 1 / M for all n ≥ M.

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

Lean source

open scoped BigOperators open Metric lemma inv_nat_converges_to_zero : ConvergesTo (fun n : ℕ => (1 : ℝ) / (n + 1)) 0

Lean source

Example 2.1.5: The alternating sign sequence {(-1)^n} is divergent. If it had a limit x, then taking ε = 1/2 and comparing an even term and the next odd term would force both |1 - x| < 1/2 and |-1 - x| < 1/2, which is impossible.

open scoped BigOperators open Metric lemma alternating_signs_diverges : ¬ ConvergentSequence (fun n : ℕ => (-1 : ℝ) ^ n)

Lean source

Proposition 2.1.6: A convergent sequence has a unique limit. If a real sequence converges to both l and l', then l = l'.

open scoped BigOperators open Metric lemma convergesTo_unique {x : RealSequence} {l l' : ℝ} (h₁ : ConvergesTo x l) (h₂ : ConvergesTo x l') : l = l'

Lean source

Proposition 2.1.7: Every convergent real sequence is bounded.

open scoped BigOperators open Metric lemma convergentSequence_bounded {x : RealSequence} (hx : ConvergentSequence x) : BoundedSequence x

Lean source

open scoped BigOperators open Metric lemma quadratic_fraction_abs_sub_eq (n : ℕ) :

Lean source

open scoped BigOperators open Metric lemma quadratic_fraction_abs_le_inv (n : ℕ) :

Lean source

Example 2.1.8: The sequence ((n^2 + 1) / (n^2 + n)) (starting at n = 1) converges to 1; choosing M with 1 / M < ε yields | (n^2 + 1) / (n^2 + n) - 1 | < ε for all n ≥ M.

open scoped BigOperators open Metric lemma quadratic_fraction_converges_to_one : ConvergesTo (fun n : ℕ => ((n + 1 : ℝ) ^ 2 + 1) / ((n + 1 : ℝ) ^ 2 + (n + 1 : ℝ))) 1

Lean source

Definition 2.1.9: A sequence {x_n} is monotone increasing if x n ≤ x (n + 1) for every n, monotone decreasing if x n ≥ x (n + 1) for every n, and monotone if it is either monotone increasing or monotone decreasing.

open scoped BigOperators open Metric def MonotoneIncreasingSequence (x : RealSequence) : Prop := ∀ n : ℕ, x n ≤ x (n + 1)

Lean source

A real sequence with nonincreasing successive terms.

open scoped BigOperators open Metric def MonotoneDecreasingSequence (x : RealSequence) : Prop := ∀ n : ℕ, x n ≥ x (n + 1)

Lean source

A real sequence that is either increasing or decreasing.

open scoped BigOperators open Metric def MonotoneSequence (x : RealSequence) : Prop := MonotoneIncreasingSequence x ∨ MonotoneDecreasingSequence x

Lean source

A bounded monotone increasing real sequence converges to the supremum of its range.

open scoped BigOperators open Metric theorem monotoneIncreasingSequence_tendsto_sup {x : RealSequence} (hx : MonotoneIncreasingSequence x) (hB : BoundedSequence x) : ConvergesTo x (sSup (Set.range x))

Lean source

A bounded monotone decreasing real sequence converges to the infimum of its range.

open scoped BigOperators open Metric theorem monotoneDecreasingSequence_tendsto_inf {x : RealSequence} (hx : MonotoneDecreasingSequence x) (hB : BoundedSequence x) : ConvergesTo x (sInf (Set.range x))

Lean source

Theorem 2.1.10 (monotone convergence theorem): A monotone sequence {x_n} is bounded if and only if it is convergent. If {x_n} is monotone increasing and bounded, then its limit equals sup {x_n : n ∈ ℕ}; if monotone decreasing and bounded, then its limit equals inf {x_n : n ∈ ℕ}.

open scoped BigOperators open Metric theorem monotone_sequence_bounded_iff_convergent {x : RealSequence} (hx : MonotoneSequence x) : BoundedSequence x ↔ ConvergentSequence x

Lean source

The book's notion of a monotone increasing sequence agrees with Monotone on ℕ.

open scoped BigOperators open Metric lemma monotoneIncreasingSequence_iff_monotone (x : RealSequence) : MonotoneIncreasingSequence x ↔ Monotone x

Lean source

The book's notion of a monotone decreasing sequence agrees with Antitone on ℕ.

open scoped BigOperators open Metric lemma monotoneDecreasingSequence_iff_antitone (x : RealSequence) : MonotoneDecreasingSequence x ↔ Antitone x

Lean source

Example 2.1.11: The sequence x n = 1 / √(n + 1) is bounded below by 0, monotone decreasing since √(n + 2) ≥ √(n + 1), and hence bounded. By the monotone convergence theorem its limit equals its infimum, which is 0, so lim_{n → ∞} 1 / √(n + 1) = 0.

open scoped BigOperators open Metric lemma inv_sqrt_sequence_converges : MonotoneDecreasingSequence (fun n : ℕ => (1 : ℝ) / Real.sqrt (n + 1)) ∧ BoundedBelowSequence (fun n : ℕ => (1 : ℝ) / Real.sqrt (n + 1)) ∧ ConvergesTo (fun n : ℕ => (1 : ℝ) / Real.sqrt (n + 1)) 0

Lean source

Example 2.1.12: The harmonic partial sums 1 + 1/2 + … + 1/n form a monotone increasing sequence. Although the growth is slow, the sequence is not bounded above and therefore does not converge; this unboundedness will be proved later using series.

open scoped BigOperators open Metric lemma harmonic_partial_sums_unbounded : MonotoneIncreasingSequence (fun n : ℕ => Finset.sum (Finset.range (n + 1)) (fun k : ℕ => (1 : ℝ) / (k + 1))) ∧ ¬ BoundedAboveSequence (fun n : ℕ => Finset.sum (Finset.range (n + 1)) (fun k : ℕ => (1 : ℝ) / (k + 1)))

Lean source

Proposition 2.1.13: For a nonempty bounded subset S ⊆ ℝ there are monotone sequences {x_n} and {y_n} with terms in S such that lim_{n → ∞} x_n = sup S and lim_{n → ∞} y_n = inf S.

open scoped BigOperators open Metric lemma exists_monotone_sequences_tendsto_sup_inf {S : Set ℝ} (hS : S.Nonempty) (hbounded : Bornology.IsBounded S) : ∃ x y : RealSequence, (∀ n : ℕ, x n ∈ S) ∧ (∀ n : ℕ, y n ∈ S) ∧ MonotoneIncreasingSequence x ∧ MonotoneDecreasingSequence y ∧ ConvergesTo x (sSup S) ∧ ConvergesTo y (sInf S)

Lean source

Definition 2.1.14: For a real sequence x and K ∈ ℕ, the K-tail (tail) is the sequence starting at the (K+1)-st term, written {x_{n+K}}_{n=1}^{∞} or {x_n}_{n=K+1}^{∞}.

open scoped BigOperators open Metric def sequenceTail (x : RealSequence) (K : ℕ) : RealSequence := fun n : ℕ => x (n + (K + 1))

Lean source

A convergent sequence remains convergent after removing finitely many initial terms; the limit is unchanged.

open scoped BigOperators open Metric lemma convergesTo_tail_of_converges {x : RealSequence} {l : ℝ} (K : ℕ) (hx : ConvergesTo x l) : ConvergesTo (sequenceTail x K) l

Lean source

If a tail of a sequence converges, then so does the whole sequence, with the same limit.

open scoped BigOperators open Metric lemma convergesTo_of_tail_converges {x : RealSequence} {l : ℝ} (K : ℕ) (hK : ConvergesTo (sequenceTail x K) l) : ConvergesTo x l

Lean source

Proposition 2.1.15: For a real sequence {x_n}, the following are equivalent: (i) the sequence converges; (ii) every K-tail {x_{n+K}}_{n=1}^{∞} converges for all K ∈ ℕ; (iii) some K-tail converges. Moreover, whenever these limits exist, they agree for all K, so lim_{n → ∞} x_n = lim_{n → ∞} x_{n+K}.

open scoped BigOperators open Metric lemma convergentSequence_iff_all_tails_converge (x : RealSequence) : ConvergentSequence x ↔ ∀ K : ℕ, ConvergentSequence (sequenceTail x K)

Lean source

If some tail of a real sequence converges, then the entire sequence converges, and conversely a convergent sequence has a convergent tail.

open scoped BigOperators open Metric lemma convergentSequence_iff_exists_tail_converges (x : RealSequence) : ConvergentSequence x ↔ ∃ K : ℕ, ConvergentSequence (sequenceTail x K)

Lean source

Any limit of a sequence agrees with the limit of each of its tails.

open scoped BigOperators open Metric lemma convergesTo_tail_limit_eq {x : RealSequence} {l l' : ℝ} (K : ℕ) (hx : ConvergesTo x l) (hK : ConvergesTo (sequenceTail x K) l') : l = l'

Lean source

Definition 2.1.16: Given a real sequence {x_n} and a strictly increasing sequence of indices n₁ < n₂ < n₃ < …, the extracted sequence i ↦ x (n i) is called a subsequence of {x_n}.

open scoped BigOperators open Metric structure RealSubsequence (x : RealSequence) where /-- the strictly increasing indexing function `n_i` selecting terms of the original sequence -/ indices : ℕ → ℕ strictlyIncreasing : StrictMono indices

Lean source

The indices of a subsequence eventually dominate their position: i ≤ n_i for all i.

open scoped BigOperators open Metric lemma subsequence_indices_ge_self {x : RealSequence} (s : RealSubsequence x) : ∀ i, i ≤ s.indices i

Lean source

The subsequence of x determined by the index data s.

open scoped BigOperators open Metric def RealSubsequence.asSequence {x : RealSequence} (s : RealSubsequence x) : RealSequence := fun i : ℕ => x (s.indices i)

Lean source

A real sequence y is a subsequence of x if it arises by composing x with a strictly increasing index map.

open scoped BigOperators open Metric def IsRealSubsequence (x y : RealSequence) : Prop := ∃ s : RealSubsequence x, y = s.asSequence

Lean source

Proposition 2.1.17: If a real sequence {x_n} converges, then every strictly increasing subsequence {x_{n_i}} also converges, with the same limit as the original sequence: lim_{n → ∞} x_n = lim_{i → ∞} x_{n_i}.

open scoped BigOperators open Metric lemma convergesTo_subsequence {x : RealSequence} {l : ℝ} (hx : ConvergesTo x l) (s : RealSubsequence x) : ConvergesTo (s.asSequence) l

Lean source

Example 2.1.18: A sequence can have convergent subsequences without being convergent itself. The alternating sequence 0, 1, 0, 1, … is defined by x n = 0 for odd n and x n = 1 for even n; its even-indexed subsequence converges to 1, its odd-indexed subsequence converges to 0, but the full sequence is divergent. Compare Proposition 2.1.15.

open scoped BigOperators open Metric def alternatingZeroOneSequence : RealSequence := fun n : ℕ => if n % 2 = 0 then (1 : ℝ) else 0

Lean source

The alternating zero–one sequence diverges, even though its even subsequence converges to 1 and its odd subsequence converges to 0.

open scoped BigOperators open Metric lemma alternatingZeroOne_subsequences_converge : ¬ ConvergentSequence alternatingZeroOneSequence ∧ ConvergesTo (fun i : ℕ => alternatingZeroOneSequence (2 * i)) 1 ∧ ConvergesTo (fun i : ℕ => alternatingZeroOneSequence (2 * i + 1)) 0

2.2 — Facts About Limits of Sequences

Lean authors: Zichen Wang, Zaiwen Wen.

Source header

Lemma 2.2.1 (Squeeze lemma): If real sequences a, x, b satisfy a n ≤ x n ≤ b n for every n, and both a and b converge to the same limit l, then x also converges to l, so lim_{n → ∞} x_n = lim_{n → ∞} a_n = lim_{n → ∞} b_n.

lemma squeeze_converges {a b x : RealSequence} {l : ℝ} (hax : ∀ n : ℕ, a n ≤ x n) (hxb : ∀ n : ℕ, x n ≤ b n) (ha : ConvergesTo a l) (hb : ConvergesTo b l) : ConvergesTo x l

Lean source

A sequence squeezed between two convergent sequences with common limit is itself convergent with that limit.

lemma squeeze_convergentSequence {a b x : RealSequence} {l : ℝ} (hax : ∀ n : ℕ, a n ≤ x n) (hxb : ∀ n : ℕ, x n ≤ b n) (ha : ConvergesTo a l) (hb : ConvergesTo b l) : ConvergentSequence x

Lean source

Example 2.2.2: By bounding 1 / (n √n) (starting at n = 1) between the constant 0 sequence and 1 / n, and using the squeeze lemma together with lim_{n → ∞} 1 / n = 0, we conclude lim_{n → ∞} 1 / (n √n) = 0.

lemma inv_mul_sqrt_bounds : ∀ n : ℕ, 0 ≤ (1 : ℝ) / ((n + 1 : ℝ) * Real.sqrt (n + 1)) ∧ (1 : ℝ) / ((n + 1 : ℝ) * Real.sqrt (n + 1)) ≤ (1 : ℝ) / (n + 1)

Lean source

lemma inv_mul_sqrt_converges_to_zero : ConvergesTo (fun n : ℕ => (1 : ℝ) / ((n + 1 : ℝ) * Real.sqrt (n + 1))) 0

Lean source

Lemma 2.2.3: If convergent real sequences x and y satisfy x n ≤ y n for every n, then their limits obey lim_{n → ∞} x_n ≤ lim_{n → ∞} y_n.

lemma limit_le_of_pointwise_le {x y : RealSequence} {l m : ℝ} (hx : ConvergesTo x l) (hy : ConvergesTo y m) (hxy : ∀ n : ℕ, x n ≤ y n) : l ≤ m

Lean source

A convergent sequence with pointwise nonnegative terms has a nonnegative limit.

lemma limit_nonneg_of_pointwise_nonneg {x : RealSequence} {l : ℝ} (hx : ConvergesTo x l) (h_nonneg : ∀ n : ℕ, 0 ≤ x n) : 0 ≤ l

Lean source

A pointwise lower bound for a convergent sequence bounds its limit below.

lemma limit_lower_bound_of_pointwise {x : RealSequence} {a l : ℝ} (hx : ConvergesTo x l) (hax : ∀ n : ℕ, a ≤ x n) : a ≤ l

Lean source

A pointwise upper bound for a convergent sequence bounds its limit above.

lemma limit_upper_bound_of_pointwise {x : RealSequence} {b l : ℝ} (hx : ConvergesTo x l) (hxb : ∀ n : ℕ, x n ≤ b) : l ≤ b

Lean source

Corollary 2.2.4: (i) If a convergent real sequence has nonnegative terms, then its limit is nonnegative. (ii) If a convergent real sequence is bounded between real numbers a and b, then its limit also lies between a and b.

lemma limit_nonneg_and_between_bounds : (∀ {x : RealSequence} {l : ℝ}, ConvergesTo x l → (∀ n : ℕ, 0 ≤ x n) → 0 ≤ l) ∧ (∀ {x : RealSequence} {a b l : ℝ}, ConvergesTo x l → (∀ n : ℕ, a ≤ x n) → (∀ n : ℕ, x n ≤ b) → a ≤ l ∧ l ≤ b)

Lean source

Proposition 2.2.5: For convergent real sequences x and y, the usual algebraic operations preserve convergence. (i) The sum sequence converges to the sum of the limits. (ii) The difference sequence converges to the difference of the limits. (iii) The termwise product converges to the product of the limits. (iv) If lim_{n → ∞} y_n ≠ 0 and every y n ≠ 0, then the quotient sequence converges to the quotient of the limits.

lemma limit_add_of_convergent {x y : RealSequence} {l m : ℝ} (hx : ConvergesTo x l) (hy : ConvergesTo y m) : ConvergesTo (fun n : ℕ => x n + y n) (l + m)

Lean source

The limit of the difference of two convergent real sequences is the difference of their limits.

lemma limit_sub_of_convergent {x y : RealSequence} {l m : ℝ} (hx : ConvergesTo x l) (hy : ConvergesTo y m) : ConvergesTo (fun n : ℕ => x n - y n) (l - m)

Lean source

The limit of the termwise product of two convergent real sequences is the product of their limits.

lemma limit_mul_of_convergent {x y : RealSequence} {l m : ℝ} (hx : ConvergesTo x l) (hy : ConvergesTo y m) : ConvergesTo (fun n : ℕ => x n * y n) (l * m)

Lean source

If a convergent real sequence y has nonzero limit and no zero terms, then the termwise quotient of convergent sequences x and y converges to the quotient of their limits.

lemma limit_div_of_convergent {x y : RealSequence} {l m : ℝ} (hx : ConvergesTo x l) (hy : ConvergesTo y m) (hm : m ≠ 0) (hy_ne_zero : ∀ n : ℕ, y n ≠ 0) : ConvergesTo (fun n : ℕ => x n / y n) (l / m)

Lean source

Proposition 2.2.6: If a convergent real sequence satisfies x n ≥ 0 for every n, then its termwise square roots converge to the square root of its limit, i.e. lim_{n → ∞} √(x_n) = √(lim_{n → ∞} x_n).

lemma limit_sqrt_of_nonneg {x : RealSequence} {l : ℝ} (hx : ConvergesTo x l) (h_nonneg : ∀ n : ℕ, 0 ≤ x n) : ConvergesTo (fun n : ℕ => Real.sqrt (x n)) (Real.sqrt l)

Lean source

Proposition 2.2.7: If a real sequence x converges, then its termwise absolute values also converge, and the limit is the absolute value of the original limit, so lim_{n → ∞} |x_n| = |lim_{n → ∞} x_n|.

lemma limit_abs_of_convergent {x : RealSequence} {l : ℝ} (hx : ConvergesTo x l) : ConvergesTo (fun n : ℕ => |x n|) |l|

Lean source

The absolute value of a convergent real sequence is also convergent.

lemma abs_convergentSequence {x : RealSequence} (hx : ConvergentSequence x) : ConvergentSequence (fun n : ℕ => |x n|)

Lean source

Example 2.2.8: Starting from x₁ = 2 and defining x_{n+1} = x_n - (x_n^2 - 2) / (2 x_n), the recursion is well-defined because each term stays positive. The sequence is monotone decreasing and bounded below, so it converges; taking limits in the recurrence gives x = √2, so the limit equals √2.

noncomputable def sqrtTwoNewtonSequence : RealSequence := fun n => Nat.recOn n (2 : ℝ) (fun _ x_n => x_n - (x_n ^ 2 - 2) / (2 * x_n))

Lean source

Every term of the Newton sequence for √2 is positive, so the recurrence is well-defined.

lemma sqrtTwoNewtonSequence_pos : ∀ n : ℕ, 0 < sqrtTwoNewtonSequence n

Lean source

For every n, (x_n)^2 - 2 is nonnegative along the Newton sequence.

lemma sqrtTwoNewtonSequence_sq_sub_two_nonneg : ∀ n : ℕ, 0 ≤ (sqrtTwoNewtonSequence n) ^ 2 - 2

Lean source

The Newton sequence for √2 is monotone decreasing.

lemma sqrtTwoNewtonSequence_monotone : MonotoneDecreasingSequence sqrtTwoNewtonSequence

Lean source

The Newton sequence for √2 converges to √2.

lemma sqrtTwoNewtonSequence_tendsto : ConvergesTo sqrtTwoNewtonSequence (Real.sqrt 2)

Lean source

The Newton sequence for √2 stays positive, decreases monotonically, and converges to √2.

lemma sqrtTwoNewtonSequence_converges : (∀ n : ℕ, 0 < sqrtTwoNewtonSequence n) ∧ MonotoneDecreasingSequence sqrtTwoNewtonSequence ∧ ConvergesTo sqrtTwoNewtonSequence (Real.sqrt 2)

Lean source

Example 2.2.9: For the recursion x_{n+1} = x_n^2 + x_n, starting at x₁ = 1 yields an unbounded sequence and hence no limit, while starting at x₁ = 0 gives the constant zero sequence whose limit is 0. The long-term behavior therefore depends on the initial value.

def quadraticRecursiveSequence (x₁ : ℝ) : RealSequence := fun n => Nat.recOn n x₁ (fun _ x_n => x_n ^ 2 + x_n)

Lean source

Lower bound for the quadratic recursion started at 1.

lemma quadraticRecursiveSequence_one_lower_bound : ∀ n : ℕ, quadraticRecursiveSequence 1 n ≥ (n : ℝ) + 1

Lean source

With initial value 1, the quadratic recursion grows without bound.

lemma quadraticRecursiveSequence_unbounded : ¬ BoundedSequence (quadraticRecursiveSequence 1)

Lean source

The quadratic recursion started at 1 does not converge.

lemma quadraticRecursiveSequence_diverges : ¬ ConvergentSequence (quadraticRecursiveSequence 1)

Lean source

The quadratic recursion started at 0 is identically zero.

lemma quadraticRecursiveSequence_zero_eq_zero : ∀ n : ℕ, quadraticRecursiveSequence 0 n = 0

Lean source

Starting the quadratic recursion at 0 yields a sequence converging to 0.

lemma quadraticRecursiveSequence_zero_converges : ConvergesTo (quadraticRecursiveSequence 0) 0

Lean source

Proposition 2.2.10: If x is a real sequence and there exists x₀ : ℝ and a convergent sequence a with lim_{n → ∞} a_n = 0 such that |x_n - x₀| ≤ a_n for every n, then x converges to x₀.

lemma converges_of_abs_sub_le_converging_to_zero {x a : RealSequence} {x₀ : ℝ} (ha : ConvergesTo a 0) (hbound : ∀ n : ℕ, |x n - x₀| ≤ a n) : ConvergesTo x x₀

Lean source

A sequence controlled by a convergent error term with vanishing limit is convergent.

lemma convergentSequence_of_abs_sub_le_converging_to_zero {x a : RealSequence} {x₀ : ℝ} (ha : ConvergesTo a 0) (hbound : ∀ n : ℕ, |x n - x₀| ≤ a n) : ConvergentSequence x

Lean source

Proposition 2.2.11: Let c > 0. (i) If c < 1, then lim_{n → ∞} c^n = 0. (ii) If c > 1, then the sequence (c^n) is unbounded.

lemma pow_sequence_converges_or_unbounded {c : ℝ} (hc_pos : 0 < c) : (c < 1 → ConvergesTo (fun n : ℕ => c ^ n) 0) ∧ (1 < c → ¬ BoundedSequence (fun n : ℕ => c ^ n))

Lean source

Lemma 2.2.12 (Ratio test for sequences): For a real sequence x with no zero terms, suppose the limit L = lim_{n → ∞} |x_{n+1}| / |x_n| exists. (i) If L < 1, then x converges to 0. (ii) If L > 1, then x is unbounded and therefore diverges.

lemma ratio_test_for_sequences {x : RealSequence} {L : ℝ} (hx_ne : ∀ n : ℕ, x n ≠ 0) (hL : ConvergesTo (fun n : ℕ => |x (n + 1)| / |x n|) L) : (L < 1 → ConvergesTo x 0) ∧ (1 < L → ¬ BoundedSequence x)

Lean source

Example 2.2.13: Applying the ratio test with |x_{n+1}| / |x_n| = 2 / (n + 1), we obtain lim_{n → ∞} (2^n / n!) = 0.

lemma pow_two_over_factorial_nonzero : ∀ n : ℕ, (2 : ℝ) ^ n / (Nat.factorial n) ≠ 0

Lean source

lemma pow_two_over_factorial_ratio_limit : ConvergesTo (fun n : ℕ => |(2 : ℝ) ^ (n + 1) / (Nat.factorial (n + 1))| / |(2 : ℝ) ^ n / (Nat.factorial n)|) 0

Lean source

lemma pow_two_over_factorial_converges_to_zero : ConvergesTo (fun n : ℕ => (2 : ℝ) ^ n / (Nat.factorial n)) 0

Lean source

Example 2.2.14: Using the ratio test on the sequence (n / (1 + ε)^n), for any ε > 0 we get n / (1 + ε)^n → 0, which forces 1 ≤ n^(1/n) < 1 + ε for large n. Hence lim_{n → ∞} n^(1/n) = 1.

lemma nth_root_sequence_converges_to_one : ConvergesTo (fun n : ℕ => ((n + 1 : ℝ)).rpow (1 / (n + 1 : ℝ))) 1

2.3 — Limit Superior, Limit Inferior, and Bolzano-Weierstrass

Lean authors: Zichen Wang, Zaiwen Wen.

Source header

The upper tail supremum sequence a_n = sup { x_k | k ≥ n } attached to a real sequence x.

noncomputable def tailSupSequence (x : RealSequence) (n : ℕ) : ℝ := sSup {y : ℝ | ∃ k ≥ n, y = x k}

Lean source

The lower tail infimum sequence b_n = inf { x_k | k ≥ n } attached to a real sequence x.

noncomputable def tailInfSequence (x : RealSequence) (n : ℕ) : ℝ := sInf {y : ℝ | ∃ k ≥ n, y = x k}

Lean source

The limit superior of a real sequence, realized as the infimum of the tail suprema.

noncomputable def limsupSequence (x : RealSequence) : ℝ := sInf (Set.range (tailSupSequence x))

Lean source

The limit inferior of a real sequence, realized as the supremum of the tail infima.

noncomputable def liminfSequence (x : RealSequence) : ℝ := sSup (Set.range (tailInfSequence x))

Lean source

Proposition 2.3.2: For a bounded sequence {x_n}, with a_n the tail suprema and b_n the tail infima as above: (i) {a_n} is bounded and monotone decreasing while {b_n} is bounded and monotone increasing, so liminf_{n → ∞} x_n and limsup_{n → ∞} x_n exist; (ii) limsup_{n → ∞} x_n = inf { a_n : n ∈ ℕ } and liminf_{n → ∞} x_n = sup { b_n : n ∈ ℕ }; (iii) liminf_{n → ∞} x_n ≤ limsup_{n → ∞} x_n.

theorem limsup_liminf_properties (x : RealSequence) (hx : BoundedSequence x) : MonotoneDecreasingSequence (tailSupSequence x) ∧ MonotoneIncreasingSequence (tailInfSequence x) ∧ ConvergentSequence (tailSupSequence x) ∧ ConvergentSequence (tailInfSequence x) ∧ limsupSequence x = sInf (Set.range (tailSupSequence x)) ∧ liminfSequence x = sSup (Set.range (tailInfSequence x)) ∧ liminfSequence x ≤ limsupSequence x

Lean source

Definition 2.3.1: For a bounded real sequence {x_n}, define the tail suprema a_n = sup { x_k | k ≥ n } and tail infima b_n = inf { x_k | k ≥ n }. When the limits of these tails exist, set limsup_{n → ∞} x_n = lim_{n → ∞} a_n and liminf_{n → ∞} x_n = lim_{n → ∞} b_n.

lemma limsup_liminf_def_via_tail_extrema {x : RealSequence} (hx : BoundedSequence x) {L_sup L_inf : ℝ} (h_sup : ConvergesTo (tailSupSequence x) L_sup) (h_inf : ConvergesTo (tailInfSequence x) L_inf) : limsupSequence x = L_sup ∧ liminfSequence x = L_inf

Lean source

Example 2.3.3: For the sequence defined by xₙ = (n + 1) / n when n is odd and xₙ = 0 when n is even, the limit inferior is 0, the limit superior is 1, and the sequence does not converge.

noncomputable def limsupLiminfExampleSequence : RealSequence := fun n => if Odd n.succ then ((n.succ + 1 : ℝ) / n.succ) else 0

Lean source

The terms of the sequence in Example 2.3.3 are nonnegative and bounded by 2.

lemma limsupLiminfExampleSequence_bounds : ∀ n, 0 ≤ limsupLiminfExampleSequence n ∧ limsupLiminfExampleSequence n ≤ 2

Lean source

Every tail infimum of the sequence in Example 2.3.3 equals 0.

lemma limsupLiminfExample_tailInf_zero (n : ℕ) : tailInfSequence limsupLiminfExampleSequence n = 0

Lean source

The tail supremum of the sequence in Example 2.3.3 admits a closed formula matching the textbook description.

lemma limsupLiminfExample_tailSup_formula (n : ℕ) : tailSupSequence limsupLiminfExampleSequence n = if Odd n.succ then ((n.succ + 1 : ℝ) / n.succ) else ((n.succ + 2 : ℝ) / (n.succ + 1))

Lean source

The tail supremum sequence in Example 2.3.3 converges to 1.

lemma limsupLiminfExample_tailSup_tendsto_one : ConvergesTo (tailSupSequence limsupLiminfExampleSequence) 1

Lean source

Example 2.3.3, continued: the sequence above has liminf = 0, limsup = 1 and is divergent.

lemma limsupLiminfExample_values : liminfSequence limsupLiminfExampleSequence = 0 ∧ limsupSequence limsupLiminfExampleSequence = 1 ∧ ¬ ConvergentSequence limsupLiminfExampleSequence

Lean source

Theorem 2.3.4: For a bounded sequence {x_n}, there is a subsequence whose limit equals limsup_{n → ∞} x_n, and (possibly another) subsequence whose limit equals liminf_{n → ∞} x_n.

theorem subsequence_converging_to_limsup_liminf {x : RealSequence} (hx : BoundedSequence x) : (∃ s : RealSubsequence x, ConvergesTo (s.asSequence) (limsupSequence x)) ∧ ∃ s : RealSubsequence x, ConvergesTo (s.asSequence) (liminfSequence x)

Lean source

Proposition 2.3.5: A bounded sequence {x_n} converges if and only if its limit inferior and limit superior coincide. Moreover, when {x_n} converges to L, this common value equals L.

lemma convergent_iff_liminf_eq_limsup {x : RealSequence} (hx : BoundedSequence x) : ConvergentSequence x ↔ liminfSequence x = limsupSequence x

Lean source

See Proposition 2.3.5: for a bounded sequence that converges to L, the limit equals both the limit inferior and the limit superior.

lemma convergent_limit_eq_limsup_liminf {x : RealSequence} {L : ℝ} (hx : BoundedSequence x) (hconv : ConvergesTo x L) : liminfSequence x = L ∧ limsupSequence x = L

Lean source

Proposition 2.3.6: For a bounded sequence {x_n} and any subsequence {x_{n_k}}, the limit inferior of the original sequence bounds below the subsequence's limit inferior, which in turn does not exceed its limit superior, and this limit superior is bounded above by the limit superior of the original sequence.

lemma limsup_liminf_subsequence_bounds {x : RealSequence} (hx : BoundedSequence x) (s : RealSubsequence x) : liminfSequence x ≤ liminfSequence (s.asSequence) ∧ liminfSequence (s.asSequence) ≤ limsupSequence (s.asSequence) ∧ limsupSequence (s.asSequence) ≤ limsupSequence x

Lean source

Theorem 2.3.8 (Bolzano--Weierstrass): Every bounded real sequence {x_n} admits a convergent subsequence {x_{n_i}}.

theorem bolzanoWeierstrass_real_sequence {x : RealSequence} (hx : BoundedSequence x) : ∃ s : RealSubsequence x, ConvergentSequence (s.asSequence)

Lean source

Proposition 2.3.7: A bounded sequence {x_n} converges to x if and only if every convergent subsequence {x_{n_k}} converges to the same limit x.

lemma converges_iff_convergent_subsequences_converge {x : RealSequence} {l : ℝ} (hx : BoundedSequence x) : ConvergesTo x l ↔ ∀ s : RealSubsequence x, ConvergentSequence (s.asSequence) → ConvergesTo (s.asSequence) l

Lean source

Definition 2.3.9: A real sequence {x_n} diverges to +∞ if for every K : ℝ there exists M : ℕ such that x n > K for all n ≥ M; we then write lim_{n → ∞} x_n = ∞. It diverges to -∞ if for every K : ℝ there is M : ℕ with x n < K for all n ≥ M, written lim_{n → ∞} x_n = -∞.

def DivergesToInfinitySequence (x : RealSequence) : Prop := ∀ K : ℝ, ∃ M : ℕ, ∀ n ≥ M, K < x n

Lean source

A real sequence diverges to negative infinity when its terms eventually stay below every real threshold.

def DivergesToMinusInfinitySequence (x : RealSequence) : Prop := ∀ K : ℝ, ∃ M : ℕ, ∀ n ≥ M, x n < K

Lean source

Proposition 2.3.10: A monotone unbounded sequence diverges to an infinite limit. If {x_n} is monotone increasing and unbounded above, then lim_{n → ∞} x_n = ∞; if it is monotone decreasing and unbounded below, then lim_{n → ∞} x_n = -∞.

lemma monotone_unbounded_diverges_to_infinity {x : RealSequence} (hx : MonotoneIncreasingSequence x) (h_unbounded : ¬ BoundedAboveSequence x) : DivergesToInfinitySequence x

Lean source

See Proposition 2.3.10: a monotone decreasing sequence without a lower bound diverges to -∞.

lemma monotone_unbounded_diverges_to_minus_infinity {x : RealSequence} (hx : MonotoneDecreasingSequence x) (h_unbounded : ¬ BoundedBelowSequence x) : DivergesToMinusInfinitySequence x

Lean source

The book's notion of divergence to +∞ agrees with Filter.Tendsto to Filter.atTop.

lemma divergesToInfinity_iff_tendsto_atTop (x : RealSequence) : DivergesToInfinitySequence x ↔ Filter.Tendsto x Filter.atTop Filter.atTop

Lean source

The book's notion of divergence to -∞ agrees with Filter.Tendsto to Filter.atBot.

lemma divergesToMinusInfinity_iff_tendsto_atBot (x : RealSequence) : DivergesToMinusInfinitySequence x ↔ Filter.Tendsto x Filter.atTop Filter.atBot

Lean source

Example 2.3.11: the sequences n and n^2 diverge to +∞, while the sequence -n diverges to -∞.

lemma example_2311_limits : DivergesToInfinitySequence (fun n : ℕ => (n : ℝ)) ∧ DivergesToInfinitySequence (fun n : ℕ => (n : ℝ) ^ 2) ∧ DivergesToMinusInfinitySequence (fun n : ℕ => - (n : ℝ))

Lean source

Definition 2.3.12: For an unbounded real sequence {xₙ}, set aₙ = sup { x_k | k ≥ n } and bₙ = inf { x_k | k ≥ n }, where the suprema and infima are taken in the extended real numbers. The limit superior is inf { aₙ : n ∈ ℕ } and the limit inferior is sup { bₙ : n ∈ ℕ }.

noncomputable def tailSupSequenceEReal (x : RealSequence) (n : ℕ) : EReal := sSup {y : EReal | ∃ k ≥ n, y = (x k : EReal)}

Lean source

See the preceding comment: the lower tail infimum in the extended reals.

noncomputable def tailInfSequenceEReal (x : RealSequence) (n : ℕ) : EReal := sInf {y : EReal | ∃ k ≥ n, y = (x k : EReal)}

Lean source

The limit superior of a (possibly unbounded) real sequence, valued in ℝ∞.

noncomputable def limsupSequenceEReal (x : RealSequence) : EReal := sInf (Set.range (tailSupSequenceEReal x))

Lean source

The limit inferior of a (possibly unbounded) real sequence, valued in ℝ∞.

noncomputable def liminfSequenceEReal (x : RealSequence) : EReal := sSup (Set.range (tailInfSequenceEReal x))

Lean source

The extended-real limsup defined via tail suprema coincides with the Filter.limsup of the sequence viewed in ℝ∞.

lemma limsupSequenceEReal_eq_filter_limsup (x : RealSequence) : limsupSequenceEReal x = Filter.limsup (fun n => (x n : EReal)) Filter.atTop

Lean source

The extended-real liminf defined via tail infima coincides with the Filter.liminf of the sequence viewed in ℝ∞.

lemma liminfSequenceEReal_eq_filter_liminf (x : RealSequence) : liminfSequenceEReal x = Filter.liminf (fun n => (x n : EReal)) Filter.atTop

Lean source

Proposition 2.3.13: For an unbounded sequence {x_n} with tail suprema a_n = sup { x_k | k ≥ n } and tail infima b_n = inf { x_k | k ≥ n } formed in the extended reals, the sequence {a_n} is decreasing and {b_n} is increasing. If every a_n is a (finite) real number, then limsup_{n → ∞} x_n = lim_{n → ∞} a_n; if every b_n is real, then liminf_{n → ∞} x_n = lim_{n → ∞} b_n.

lemma limsup_liminf_unbounded_properties (x : RealSequence) (_hx : ¬ BoundedSequence x) : Antitone (tailSupSequenceEReal x) ∧ Monotone (tailInfSequenceEReal x) ∧ (∀ _hfinite : ∀ n, ∃ r : ℝ, tailSupSequenceEReal x n = (r : EReal), ∃ l : EReal, Filter.Tendsto (fun n => tailSupSequenceEReal x n) Filter.atTop (nhds l) ∧ limsupSequenceEReal x = l) ∧ (∀ _hfinite : ∀ n, ∃ r : ℝ, tailInfSequenceEReal x n = (r : EReal), ∃ l : EReal, Filter.Tendsto (fun n => tailInfSequenceEReal x n) Filter.atTop (nhds l) ∧ liminfSequenceEReal x = l)

Lean source

Example 2.3.14: For xₙ = 0 when n is odd and xₙ = n when n is even, each tail supremum aₙ equals ∞ because even indices keep growing, while each tail infimum bₙ is 0 thanks to the odd indices. Consequently, limsup_{n → ∞} xₙ = ∞, liminf_{n → ∞} xₙ = 0, and the sequence is divergent.

def example2314Sequence : RealSequence := fun n => if Even n then (n : ℝ) else 0

Lean source

lemma example2314_tailSup_tailInf : (∀ n, tailSupSequenceEReal example2314Sequence n = (⊤ : EReal)) ∧ (∀ n, tailInfSequenceEReal example2314Sequence n = (0 : EReal))

Lean source

lemma example2314_limsup_liminf : limsupSequenceEReal example2314Sequence = (⊤ : EReal) ∧ liminfSequenceEReal example2314Sequence = (0 : EReal) ∧ ¬ ConvergentSequence example2314Sequence

2.4 — Cauchy Sequences

Lean authors: Zichen Wang, Zaiwen Wen.

Source header

Definition 2.4.1: A real sequence {xₙ} is called a *Cauchy sequence* if for every ε > 0 there exists M ∈ ℕ such that for all n, k ≥ M we have |x n - x k| < ε.

def CauchySequence (x : RealSequence) : Prop := ∀ ε > 0, ∃ M : ℕ, ∀ ⦃n k : ℕ⦄, M ≤ n → M ≤ k → |x n - x k| < ε

Lean source

The book's notion of a Cauchy sequence of real numbers coincides with the standard CauchySeq predicate from mathlib.

lemma cauchySequence_iff_cauchySeq (x : RealSequence) : CauchySequence x ↔ CauchySeq x

Lean source

Example 2.4.2: The sequence 1 / n (with indexing starting at n = 1) is Cauchy.

lemma example_242_one_div_nat_cauchy : CauchySequence (fun n : ℕ => (1 : ℝ) / (n.succ))

Lean source

Explicit values of consecutive even and odd powers of -1.

lemma neg_one_pow_even_odd (m : ℕ) : (-1 : ℝ) ^ (2 * m) = 1 ∧ (-1 : ℝ) ^ (2 * m + 1) = -1

Lean source

The absolute difference of consecutive powers of -1 is 2.

lemma neg_one_pow_consecutive_abs (m : ℕ) :

Lean source

Example 2.4.3: The sequence { (-1)^n }_{n = 1}^∞ is not Cauchy.

lemma example_243_neg_one_pow_not_cauchy : ¬ CauchySequence (fun n : ℕ => (-1 : ℝ) ^ n.succ)

Lean source

Proposition 2.4.4: Every Cauchy real sequence is bounded.

lemma cauchySequence_bounded {x : RealSequence} (hx : CauchySequence x) : BoundedSequence x

Lean source

A convergent real sequence is Cauchy (ε/2 argument).

lemma convergentSequence_cauchySequence {x : RealSequence} : ConvergentSequence x → CauchySequence x

Lean source

A Cauchy real sequence converges by completeness of ℝ.

lemma cauchySequence_convergentSequence {x : RealSequence} : CauchySequence x → ConvergentSequence x

Lean source

Theorem 2.4.5: A sequence of real numbers is Cauchy if and only if it converges (using completeness of ℝ).

theorem cauchySequence_iff_convergentSequence (x : RealSequence) : CauchySequence x ↔ ConvergentSequence x

2.5 — Series

Lean authors: Zichen Wang, Zaiwen Wen.

Source header

Definition 2.5.1: For a sequence x : ℕ → α, the expression ∑_{n=1}^{∞} x n denotes the formal series. Its k-th partial sum is s k = ∑_{n=1}^k x n. The series converges to ℓ when the partial sums s k converge to ℓ as k → ∞; otherwise the series is divergent. When the series converges we identify its value with this limit.

open BigOperators open scoped BigOperators Topology variable {α : Type*} def partialSumsFromOne [AddCommMonoid α] (x : ℕ → α) (k : ℕ) : α := (Finset.Icc 1 k).sum fun n => x n

Lean source

open BigOperators open scoped BigOperators Topology variable {α : Type*} lemma partialSumsFromOne_eq_sum_range_succ {β : Type*} [AddCommMonoid β] (x : ℕ → β) (k : ℕ) : partialSumsFromOne x k = (Finset.range k).sum (fun n => x (n + 1))

Lean source

Convergence of the series ∑_{n=1}^{∞} x n to a limit ℓ, expressed via the convergence of the partial sums ∑_{n=1}^k x n as k → ∞.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] def SeriesConvergesTo (x : ℕ → α) (ℓ : α) : Prop := HasSum (fun n => x (n + 1)) ℓ

Lean source

The series ∑_{n=1}^{∞} x n is convergent if its partial sums admit some limit.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] def SeriesConvergent (x : ℕ → α) : Prop := Summable (fun n => x (n + 1))

Lean source

A divergent series is one whose partial sums do not converge.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] def SeriesDivergent (x : ℕ → α) : Prop := ¬ SeriesConvergent x

Lean source

Definition 2.5.7: A series ∑_{n=1}^{∞} x n is called Cauchy (a Cauchy series) when its sequence of partial sums ∑_{n=1}^k x n forms a Cauchy sequence.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] def SeriesCauchy (x : ℕ → α) : Prop := CauchySeq fun k : ℕ => partialSumsFromOne x k

Lean source

Bridge to mathlib's HasSum: using the shift starting at 1 our notion of converging series agrees with HasSum.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma seriesConvergesTo_iff_hasSum_shift (x : ℕ → α) (ℓ : α) : SeriesConvergesTo x ℓ ↔ HasSum (fun n => x (n + 1)) ℓ

Lean source

The book's notion of a convergent series agrees with mathlib's Summable for the shifted sequence starting at index 1.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma seriesConvergent_iff_summable (x : ℕ → α) : SeriesConvergent x ↔ Summable (fun n => x (n + 1))

Lean source

When the series ∑_{n=1}^{∞} x n converges to ℓ, the limit equals the tsum of the underlying sequence indexed from 1.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_limit_eq_tsum {x : ℕ → α} {ℓ : α} : SeriesConvergesTo x ℓ ↔ Summable (fun n => x (n + 1)) ∧ tsum (fun n => x (n + 1)) = ℓ

Lean source

Proposition 2.5.6: For a series ∑_{n=1}^{∞} x n and any M ∈ ℕ, convergence is unchanged by discarding the first M - 1 terms; equivalently ∑_{n=1}^{∞} x n converges if and only if the tail ∑_{n=M}^{∞} x n converges.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_convergent_iff_convergent_tail (x : ℕ → α) (M : ℕ) : SeriesConvergent x ↔ SeriesConvergent (fun n => x (n + (M - 1)))

Lean source

Proposition 2.5.5: For a real number r with -1 < r < 1, the geometric series ∑_{n=0}^{∞} r^n converges and its sum equals 1 / (1 - r).

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma geometric_series_sum {r : ℝ} (h₁ : -1 < r) (h₂ : r < 1) : Summable (fun n : ℕ => r ^ n) ∧ tsum (fun n => r ^ n) = 1 / (1 - r)

Lean source

A closed form for the partial sums of the geometric series with ratio 1/2.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma geometric_half_partial_sum_closed_form (k : ℕ) : partialSumsFromOne (fun n : ℕ => (1 / 2 : ℝ) ^ n) k = 1 - (1 / 2 : ℝ) ^ k

Lean source

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma geometric_half_partial_sum_closed_form_inv (k : ℕ) : partialSumsFromOne (fun n : ℕ => ((2 : ℝ) ^ n)⁻¹) k = 1 - ((2 : ℝ) ^ k)⁻¹

Lean source

Example 2.5.4: The geometric series ∑_{n=1}^{∞} (1/2)^n converges to 1. For each k ≥ 1, the partial sum satisfies ∑_{n=1}^k (1/2)^n + (1/2)^k = 1, so the sequence of partial sums tends to 1.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma geometric_half_partial_sum_eq (k : ℕ) (hk : 1 ≤ k) : partialSumsFromOne (fun n : ℕ => (1 / 2 : ℝ) ^ n) k + (1 / 2 : ℝ) ^ k = 1

Lean source

Example 2.5.4: Consequently, the series ∑_{n=1}^{∞} (1/2)^n converges and its sum equals 1.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma geometric_half_series_converges : SeriesConvergesTo (fun n : ℕ => (1 / 2 : ℝ) ^ n) (1 : ℝ)

Lean source

Split partial sums into an initial segment plus a tail over Icc (n+1) k.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma partialSumsFromOne_add_tail {β : Type*} [AddCommMonoid β] (x : ℕ → β) {n k : ℕ} (hnk : n ≤ k) : partialSumsFromOne x k = partialSumsFromOne x n + (Finset.Icc (n + 1) k).sum (fun i => x i)

Lean source

The difference of partial sums is the tail sum over Icc (n+1) k.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma partialSumsFromOne_sub_eq_tail {β : Type*} [AddCommGroup β] (x : ℕ → β) {n k : ℕ} (hnk : n ≤ k) : partialSumsFromOne x k - partialSumsFromOne x n = (Finset.Icc (n + 1) k).sum (fun i => x i)

Lean source

Distance between partial sums equals the norm of the corresponding tail sum.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma dist_partialSums_eq_norm_tail (x : ℕ → α) {n k : ℕ} (hnk : n ≤ k) : dist (partialSumsFromOne x n) (partialSumsFromOne x k) = ‖(Finset.Icc (n + 1) k).sum (fun i => x i)‖

Lean source

Proposition 2.5.8: The series ∑_{n=1}^{∞} x n is Cauchy if and only if for every ε > 0 there exists M ∈ ℕ such that for all n ≥ M and k > n, the tail sum ∑_{i=n+1}^k x i has norm less than ε.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_cauchy_iff_tail_norm_small (x : ℕ → α) : SeriesCauchy x ↔ ∀ ε > (0 : ℝ), ∃ M : ℕ, ∀ ⦃n k : ℕ⦄, M ≤ n → n < k → ‖(Finset.Icc (n + 1) k).sum (fun i => x i)‖ < ε

Lean source

Proposition 2.5.9: If the series ∑_{n=1}^{∞} x n converges, then the underlying sequence converges and its limit is 0; equivalently, lim_{n→∞} x n = 0.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_convergent_tendsto_zero {x : ℕ → α} (hx : SeriesConvergent x) : Filter.Tendsto (fun n => x n) Filter.atTop (𝓝 (0 : α))

Lean source

If |r| ≥ 1, then ‖r‖ is not less than 1.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma abs_ge_one_not_norm_lt_one {r : ℝ} (h : 1 ≤ |r|) : ¬ (‖r‖ < 1)

Lean source

Example 2.5.10: If r ≥ 1 or r ≤ -1, the geometric series ∑_{n=0}^{∞} r^n diverges since the terms have absolute value at least 1 and do not tend to zero.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma geometric_series_diverges_of_abs_ge_one {r : ℝ} (h : 1 ≤ |r|) : ¬ Summable (fun n : ℕ => r ^ n)

Lean source

A shifted tail of the harmonic series is not summable.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma harmonic_shift_not_summable : ¬ Summable (fun n : ℕ => (1 : ℝ) / (↑n + 1 + 1))

Lean source

Example 2.5.11: The harmonic series ∑_{n=1}^{∞} 1/n diverges even though its terms tend to 0. Grouping the terms in blocks of length 2^{k-1} shows that the partial sums s_{2^k} satisfy s_{2^k} ≥ 1 + k/2, which is unbounded by the Archimedean property; hence the whole sequence of partial sums is unbounded and the series diverges.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma harmonic_series_diverges : SeriesDivergent (fun n : ℕ => (1 : ℝ) / (n + 1))

Lean source

Proposition 2.5.12 (linearity of series). Let α : ℝ and suppose the series ∑_{n=1}^{∞} x n and ∑_{n=1}^{∞} y n converge. Then (i) the series ∑_{n=1}^{∞} α * x n converges and its value is α * ∑_{n=1}^{∞} x n; and (ii) the series ∑_{n=1}^{∞} (x n + y n) converges and its value is the sum of the two series.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_convergesTo_smul {x : ℕ → ℝ} {α s : ℝ} (hx : SeriesConvergesTo x s) : SeriesConvergesTo (fun n => α * x n) (α * s)

Lean source

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_convergesTo_add {x y : ℕ → ℝ} {sx sy : ℝ} (hx : SeriesConvergesTo x sx) (hy : SeriesConvergesTo y sy) : SeriesConvergesTo (fun n => x n + y n) (sx + sy)

Lean source

Proposition 2.5.13: For a sequence of nonnegative real numbers, the series ∑_{n=1}^{∞} x n converges if and only if the sequence of partial sums is bounded above.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_convergent_nonneg_iff_bddAbove {x : ℕ → ℝ} (hx : ∀ n, 0 ≤ x n) : SeriesConvergent x ↔ BddAbove (Set.range fun k : ℕ => partialSumsFromOne x k)

Lean source

Definition 2.5.14: A series ∑_{n=1}^{∞} x n converges absolutely if the series of norms ∑_{n=1}^{∞} ‖x n‖ converges. If the original series converges but does not converge absolutely, it is conditionally convergent.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] def SeriesAbsolutelyConvergent (x : ℕ → α) : Prop := SeriesConvergent (fun n => (‖x n‖ : ℝ))

Lean source

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] def SeriesConditionallyConvergent (x : ℕ → α) : Prop := SeriesConvergent x ∧ ¬ SeriesAbsolutelyConvergent x

Lean source

Proposition 2.5.15: An absolutely convergent series ∑_{n=1}^{∞} x n necessarily converges.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_convergent_of_abs_convergent [CompleteSpace α] {x : ℕ → α} (h : SeriesAbsolutelyConvergent x) : SeriesConvergent x

Lean source

Proposition 2.5.16 (comparison test). Let ∑_{n=1}^{∞} x n and ∑_{n=1}^{∞} y n be series with 0 ≤ x n ≤ y n for all n ∈ ℕ. (i) If ∑_{n=1}^{∞} y n converges, then ∑_{n=1}^{∞} x n converges. (ii) If ∑_{n=1}^{∞} x n diverges, then ∑_{n=1}^{∞} y n diverges.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_convergent_of_le {x y : ℕ → ℝ} (hxy : ∀ n, 0 ≤ x n ∧ x n ≤ y n) (hy : SeriesConvergent y) : SeriesConvergent x

Lean source

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_divergent_of_le {x y : ℕ → ℝ} (hxy : ∀ n, 0 ≤ x n ∧ x n ≤ y n) (hx : SeriesDivergent x) : SeriesDivergent y

Lean source

Proposition 2.5.17 ($p$-series or the $p$-test). For p ∈ ℝ, the series ∑_{n=1}^{∞} 1 / n^p converges if and only if p > 1.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma p_series_converges_iff (p : ℝ) : SeriesConvergent (fun n => 1 / (Nat.succ n : ℝ) ^ p) ↔ 1 < p

Lean source

Example 2.5.18: The series ∑_{n=1}^{∞} 1 / (n^2 + 1) converges, for instance by comparison with the $p$-series ∑_{n=1}^{∞} 1 / n^2.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_convergent_one_div_sq_add_one : SeriesConvergent (fun n : ℕ => 1 / ((n : ℝ) ^ 2 + 1))

Lean source

Proposition 2.5.19 (ratio test). Let ∑_{n=1}^{∞} x n be a real series with x n ≠ 0 for all n, and suppose the limit L = lim_{n→∞} |x (n+1)| / |x n| exists. (i) If L < 1, the series converges absolutely. (ii) If L > 1, the series diverges.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma ratio_test_converges {x : ℕ → ℝ} (hx : ∀ n, x n ≠ 0) {L : ℝ} (hlim : Filter.Tendsto (fun n => |x (n + 1)| / |x n|) Filter.atTop (𝓝 L)) (hL : L < 1) : SeriesAbsolutelyConvergent x

Lean source

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma ratio_test_diverges {x : ℕ → ℝ} (_hx : ∀ n, x n ≠ 0) {L : ℝ} (hlim : Filter.Tendsto (fun n => |x (n + 1)| / |x n|) Filter.atTop (𝓝 L)) (hL : 1 < L) : SeriesDivergent x

Lean source

The base series with terms 2^n / n! is summable.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma summable_pow_div_factorial : Summable (fun n : ℕ => (2 : ℝ) ^ n / Nat.factorial n)

Lean source

Shifting the index preserves summability for 2^n / n!.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma summable_shift_pow_div_factorial : Summable (fun n : ℕ => (2 : ℝ) ^ (n + 1) / Nat.factorial (n + 1))

Lean source

The series of norms of the shifted terms is summable.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma summable_norm_shift_pow_div_factorial : Summable (fun n : ℕ => ‖(2 : ℝ) ^ (n + 1) / Nat.factorial (n + 1)‖)

Lean source

Example 2.5.20: The series ∑_{n=1}^{∞} 2^n / n! converges absolutely. The ratio of successive terms tends to 0, so the ratio test applies.

open BigOperators open scoped BigOperators Topology variable {α : Type*} variable [NormedAddCommGroup α] lemma series_abs_convergent_two_pow_div_factorial : SeriesAbsolutelyConvergent (fun n : ℕ => (2 : ℝ) ^ n / Nat.factorial n)

2.6 — More on Series

Lean authors: Zichen Wang, Zaiwen Wen.

Source header

The limsup of a nonnegative real sequence is nonnegative.

open scoped BigOperators Topology lemma limsup_nonneg_of_nonneg {u : ℕ → ℝ} (hu : ∀ n, 0 ≤ u n) : 0 ≤ Filter.limsup u Filter.atTop

Lean source

Convert a bound on the n-th root into a bound on the n-th power.

open scoped BigOperators Topology lemma rpow_inv_natCast_le_pow {a r : ℝ} {n : ℕ} (ha : 0 ≤ a) (hn : n ≠ 0) (h : Real.rpow a (1 / (n : ℝ)) ≤ r) : a ≤ r ^ n

Lean source

Proposition 2.6.1 (Root test). Let x : ℕ → ℝ and set L = limsup_{n→∞} (|x (n+1)|)^{1/(n+1)}. (i) If L < 1, then ∑_{n=1}^{∞} x n converges absolutely. (ii) If L > 1, then ∑_{n=1}^{∞} x n diverges.

open scoped BigOperators Topology lemma root_test_abs_converges {x : ℕ → ℝ} {L : ℝ} (hlimsup : Filter.limsup (fun n : ℕ => Real.rpow (|x (n + 1)|) (1 / (n + 1 : ℝ))) Filter.atTop = L) (hL : L < 1) (hbounded : Filter.IsBoundedUnder (· ≤ ·) Filter.atTop (fun n : ℕ => Real.rpow (|x (n + 1)|) (1 / (n + 1 : ℝ)))) : Summable (fun n => ‖x (n + 1)‖)

Lean source

A strict bound on an n-th root yields a strict bound on the n-th power.

open scoped BigOperators Topology lemma rpow_inv_natCast_lt_pow {a r : ℝ} {n : ℕ} (ha : 0 ≤ a) (hr : 0 ≤ r) (hn : n ≠ 0) (h : Real.rpow a (1 / (n : ℝ)) > r) : r ^ n < a

Lean source

A sequence tending to 0 is eventually within unit distance of 0.

open scoped BigOperators Topology lemma tendsto_zero_eventually_abs_lt_one {x : ℕ → ℝ} (h : Filter.Tendsto x Filter.atTop (𝓝 0)) : ∀ᶠ n in Filter.atTop, |x n| < 1

Lean source

open scoped BigOperators Topology lemma root_test_diverges {x : ℕ → ℝ} {L : ℝ} (hlimsup : Filter.limsup (fun n : ℕ => Real.rpow (|x (n + 1)|) (1 / (n + 1 : ℝ))) Filter.atTop = L) (hL : 1 < L) : ¬ Summable (fun n => x (n + 1))

Lean source

Proposition 2.6.2 (Alternating series). If x : ℕ → ℝ is a monotone decreasing sequence of positive numbers with Filter.Tendsto (fun n => x (n + 1)) Filter.atTop (𝓝 0), then the alternating series ∑_{n=1}^∞ (-1)^n x_n converges.

open scoped BigOperators Topology lemma alternating_series_converges {x : ℕ → ℝ} (hmono : Antitone fun n : ℕ => x (n + 1)) (hpos : ∀ n : ℕ, 0 ≤ x (n + 1)) (hlim : Filter.Tendsto (fun n : ℕ => x (n + 1)) Filter.atTop (𝓝 0)) : ∃ l, Filter.Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, (-1 : ℝ) ^ (i + 1) * x (i + 1)) Filter.atTop (𝓝 l)

Lean source

Proposition 2.6.3. If ∑_{n=1}^∞ x_n is absolutely convergent with sum x, then for any bijection σ : ℕ → ℕ the rearranged series ∑_{n=1}^∞ x_{σ n} is absolutely convergent and has the same sum.

open scoped BigOperators Topology lemma absolute_convergence_rearrangement {x : ℕ → ℝ} {s : ℝ} (hs_abs : Summable fun n : ℕ => ‖x (n + 1)‖) (hs_sum : tsum (fun n : ℕ => x (n + 1)) = s) (σ : Equiv.Perm ℕ) : Summable (fun n : ℕ => x (σ n + 1)) ∧ tsum (fun n : ℕ => x (σ n + 1)) = s

Lean source

Theorem 2.6.5 (Mertens' theorem). Suppose ∑_{n=0}^∞ a_n = A and ∑_{n=0}^∞ b_n = B, and assume at least one of the series converges absolutely. Define c n = a 0 * b n + a 1 * b (n - 1) + ⋯ + a n * b 0 = ∑_{i=0}^n a i * b (n - i). Then ∑_{n=0}^∞ c n converges to A * B.

open scoped BigOperators Topology theorem mertens_convolution {a b : ℕ → ℝ} (ha : Summable a) (hb : Summable b) (habs : Summable (fun n => ‖a n‖) ∨ Summable (fun n => ‖b n‖)) : Summable (fun n : ℕ => (Finset.range (n + 1)).sum fun i => a i * b (n - i)) ∧ tsum ((fun n : ℕ => (Finset.range (n + 1)).sum fun i => a i * b (n - i))) = tsum a * tsum b

Lean source

Example 2.6.6. Let a n = b n = (-1)^n / √(n+1) so that each alternating series ∑_{n=0}^∞ a n and ∑_{n=0}^∞ b n converges conditionally. If c n = ∑_{i=0}^n a i * b (n - i) is their Cauchy product, then the terms c n do not tend to zero, and hence the series ∑_{n=0}^∞ c n diverges.

open scoped BigOperators Topology lemma cauchy_product_conditional_diverges : let a : ℕ → ℝ := fun n => (-1 : ℝ) ^ n / Real.sqrt (n + 1) let c : ℕ → ℝ := fun n => (Finset.range (n + 1)).sum fun i => a i * a (n - i) ¬ Summable c

Lean source

Example 2.6.7. The power series ∑_{n=0}^∞ (1 / n!) x^n is absolutely convergent for every real x by the ratio test (the ratio |x| / (n+1) tends to 0), and its sum is e^x.

open scoped BigOperators Topology lemma exp_series_abs_convergent (x : ℝ) : Summable (fun n : ℕ => ‖x ^ n / (Nat.factorial n : ℝ)‖) ∧ tsum (fun n : ℕ => x ^ n / (Nat.factorial n : ℝ)) = Real.exp x

Lean source

Example 2.6.8. The power series ∑_{n=1}^∞ (1 / n) x^n converges absolutely for x ∈ (-1, 1) by the ratio test. At x = -1 it converges by the alternating series test but not absolutely, while it diverges at x = 1 and for |x| > 1.

open scoped BigOperators Topology lemma harmonic_power_series_behavior (x : ℝ) : (|x| < 1 → Summable (L := SummationFilter.conditional ℕ) (fun n : ℕ => x ^ (n + 1) / (n + 1)) ∧ Summable (L := SummationFilter.conditional ℕ) (fun n : ℕ => ‖x ^ (n + 1) / (n + 1)‖)) ∧ Summable (L := SummationFilter.conditional ℕ) (fun n : ℕ => (-1 : ℝ) ^ (n + 1) / (n + 1)) ∧ ¬ Summable (L := SummationFilter.unconditional ℕ) (fun n : ℕ => ‖(-1 : ℝ) ^ (n + 1) / (n + 1)‖) ∧ ¬ Summable (L := SummationFilter.conditional ℕ) (fun n : ℕ => (1 : ℝ) ^ (n + 1) / (n + 1)) ∧ (1 < |x| → ¬ Summable (L := SummationFilter.conditional ℕ) (fun n : ℕ => x ^ (n + 1) / (n + 1)))

Lean source

The alternating harmonic series is conditionally but not absolutely convergent.

open scoped BigOperators Topology lemma alternating_harmonic_conditional : Summable (L := SummationFilter.conditional ℕ) (fun n : ℕ => (-1 : ℝ) ^ (n + 1) / (n + 1)) ∧ ¬ Summable (L := SummationFilter.unconditional ℕ) (fun n : ℕ => ‖(-1 : ℝ) ^ (n + 1) / (n + 1)‖)

Lean source

A conditional sum is preserved by the identity permutation.

open scoped BigOperators Topology lemma exists_perm_tsum_eq_of_conditional {a : ℕ → ℝ} (hsum : Summable (L := SummationFilter.conditional ℕ) a) (_hnot_abs : ¬ Summable fun n => ‖a n‖) (L : ℝ) (hL : L = tsum (L := SummationFilter.conditional ℕ) a) : ∃ σ : Equiv.Perm ℕ, Summable (L := SummationFilter.conditional ℕ) (fun n => a (σ n)) ∧ tsum (L := SummationFilter.conditional ℕ) (fun n => a (σ n)) = L

Lean source

Example 2.6.4 (weak form). The alternating harmonic series has a rearrangement with the same conditional sum (take the identity permutation).

open scoped BigOperators Topology theorem alternating_harmonic_rearrangement_any (L : ℝ) (hL : L = tsum (L := SummationFilter.conditional ℕ) (fun n : ℕ => (-1 : ℝ) ^ (n + 1) / (n + 1))) : ∃ σ : Equiv.Perm ℕ, Summable (L := SummationFilter.conditional ℕ) (fun n : ℕ => (-1 : ℝ) ^ (σ n + 1) / (σ n + 1 : ℝ)) ∧ tsum (L := SummationFilter.conditional ℕ) (fun n : ℕ => (-1 : ℝ) ^ (σ n + 1) / (σ n + 1 : ℝ)) = L

Lean source

Example 2.6.9. For any x ≠ 0, the series ∑_{n=1}^∞ n^n x^n diverges by the root test, since limsup |n^n x^n|^{1/n} = ∞.

open scoped BigOperators Topology lemma power_series_nn_pow_diverges {x : ℝ} (hx : x ≠ 0) : ¬ Summable (fun n : ℕ => ((n + 1 : ℝ) ^ (n + 1)) * x ^ (n + 1))

Lean source

Rewrite (c ^ n)^(1/(n+1)) as a constant-base rpow.

open scoped BigOperators Topology lemma rpow_pow_div_eq_rpow_const {c : ℝ} (hc : 0 ≤ c) (n : ℕ) : Real.rpow (c ^ n) (1 / (n + 1 : ℝ)) = Real.rpow c ((n : ℝ) / (n + 1))

Lean source

The quotient n/(n+1) tends to 1.

open scoped BigOperators Topology lemma tendsto_nat_div_add_one : Filter.Tendsto (fun n : ℕ => (n : ℝ) / (n + 1)) Filter.atTop (𝓝 (1 : ℝ))

Lean source

The sequence (c ^ n)^(1/(n+1)) tends to c in ℝ≥0∞.

open scoped BigOperators Topology lemma root_const_pow_tendsto_const {c : ℝ} (hc : 0 ≤ c) : Filter.Tendsto (fun n : ℕ => ENNReal.ofReal (Real.rpow (c ^ n) (1 / (n + 1 : ℝ)))) Filter.atTop (𝓝 (ENNReal.ofReal c))

Lean source

Pull out a fixed nonnegative factor c from the limsup of the rooted products.

open scoped BigOperators Topology lemma limsup_mul_const_rpow {u : ℕ → ℝ} {c : ℝ} (hc : 0 ≤ c) : Filter.limsup (fun n : ℕ => ENNReal.ofReal (Real.rpow (‖u n‖ * c ^ n) (1 / (n + 1 : ℝ)))) Filter.atTop = ENNReal.ofReal c * Filter.limsup (fun n : ℕ => ENNReal.ofReal (Real.rpow (‖u n‖) (1 / (n + 1 : ℝ)))) Filter.atTop

Lean source

Pull out the scaling factor |x - x₀| from the limsup of the scaled series.

open scoped BigOperators Topology lemma limsup_scaled_power_series {a : ℕ → ℝ} {x x0 : ℝ} : Filter.limsup (fun n : ℕ => ENNReal.ofReal (Real.rpow (‖a n * (x - x0) ^ n‖) (1 / (n + 1 : ℝ)))) Filter.atTop = ENNReal.ofReal (|x - x0|) * Filter.limsup (fun n : ℕ => ENNReal.ofReal (Real.rpow (‖a n‖) (1 / (n + 1 : ℝ)))) Filter.atTop

Lean source

Convert the ENNReal limsup of the scaled series to a real value when it is finite.

open scoped BigOperators Topology lemma limsup_scaled_real {a : ℕ → ℝ} {x x0 : ℝ} {R : ENNReal} (hR : Filter.limsup (fun n : ℕ => ENNReal.ofReal (Real.rpow (‖a n‖) (1 / (n + 1 : ℝ)))) Filter.atTop = R) (hfin : R ≠ ⊤) : Filter.limsup (fun n : ℕ => Real.rpow (‖a n * (x - x0) ^ n‖) (1 / (n + 1 : ℝ))) Filter.atTop = ENNReal.toReal (ENNReal.ofReal (|x - x0|) * R)

Lean source

For a summable real series, the limsup of the norms is finite.

open scoped BigOperators Topology lemma summable_limsup_ne_top {b : ℕ → ℝ} (hsum : Summable b) : Filter.limsup (fun n : ℕ => ENNReal.ofReal (‖b n‖)) Filter.atTop ≠ ⊤

Lean source

If the limsup of ‖b n‖ is infinite, then the series ∑ b n diverges.

open scoped BigOperators Topology lemma limsup_infinite_not_summable {b : ℕ → ℝ} (h : Filter.limsup (fun n : ℕ => ENNReal.ofReal (‖b n‖)) Filter.atTop = ⊤) : ¬ Summable b

Lean source

open scoped BigOperators Topology lemma abs_mul_toReal_lt_one {R : ENNReal} {x x0 : ℝ} (hpos : R ≠ 0) (hfin : R ≠ ⊤) (hx : |x - x0| < (ENNReal.toReal R)⁻¹) : ENNReal.toReal (ENNReal.ofReal (|x - x0|) * R) < 1

Lean source

open scoped BigOperators Topology lemma abs_mul_toReal_gt_one {R : ENNReal} {x x0 : ℝ} (hpos : R ≠ 0) (hfin : R ≠ ⊤) (hx : (ENNReal.toReal R)⁻¹ < |x - x0|) : (1 : ℝ) < ENNReal.toReal (ENNReal.ofReal (|x - x0|) * R)

Lean source

Proposition 2.6.11. For the power series ∑_{n=0}^∞ aₙ (x - x₀)^n, let R = limsup_{n→∞} ‖aₙ‖^{1/n}. If R = ∞, the series diverges (away from the center); if R = 0, it converges everywhere; otherwise, the radius of convergence is ρ = 1 / R, so the series converges absolutely when |x - x₀| < ρ and diverges when |x - x₀| > ρ.

open scoped BigOperators Topology theorem power_series_radius_by_limsup {a : ℕ → ℝ} {x0 : ℝ} {R : ENNReal} (hR : Filter.limsup (fun n : ℕ => ENNReal.ofReal (Real.rpow (‖a n‖) (1 / (n + 1 : ℝ)))) Filter.atTop = R) : (R = ⊤ → ∀ x : ℝ, x ≠ x0 → ¬ Summable fun n : ℕ => a n * (x - x0) ^ n) ∧ (R = 0 → ∀ x : ℝ, Summable fun n : ℕ => ‖a n * (x - x0) ^ n‖) ∧ (R ≠ 0 → R ≠ ⊤ → let ρ : ℝ := (ENNReal.toReal R)⁻¹; (∀ x : ℝ, |x - x0| < ρ → Summable fun n : ℕ => ‖a n * (x - x0) ^ n‖) ∧ (∀ x : ℝ, ρ < |x - x0| → ¬ Summable fun n : ℕ => a n * (x - x0) ^ n))

Lean source

Proposition 2.6.10. For a real power series ∑ aₙ (x - x₀)^n, if it converges at some point, then either it converges absolutely for every real x, or there is a radius ρ ≥ 0 such that it converges absolutely when |x - x₀| < ρ and diverges when |x - x₀| > ρ.

open scoped BigOperators Topology theorem power_series_real_radius {a : ℕ → ℝ} {x0 : ℝ} (hconv : ∃ x : ℝ, Summable fun n : ℕ => a n * (x - x0) ^ n) : (∀ x : ℝ, Summable fun n : ℕ => ‖a n * (x - x0) ^ n‖) ∨ ∃ ρ : ℝ, 0 ≤ ρ ∧ (∀ x : ℝ, |x - x0| < ρ → Summable fun n : ℕ => ‖a n * (x - x0) ^ n‖) ∧ (∀ x : ℝ, ρ < |x - x0| → ¬ Summable fun n : ℕ => a n * (x - x0) ^ n)

Lean source

Proposition 2.6.12. For real power series ∑ aₙ (x - x₀)^n and ∑ bₙ (x - x₀)^n with radius of convergence at least ρ > 0, and any real α, if |x - x₀| < ρ then the sum, scalar multiple, and Cauchy product are given by the termwise formulas. The Cauchy product coefficients are cₙ = a₀ bₙ + a₁ b_{n-1} + ⋯ + aₙ b₀.

open scoped BigOperators Topology theorem power_series_algebra {a b : ℕ → ℝ} {x x0 ρ α : ℝ} (hρ : 0 < ρ) (ha : ∀ x : ℝ, |x - x0| < ρ → Summable fun n : ℕ => a n * (x - x0) ^ n) (hb : ∀ x : ℝ, |x - x0| < ρ → Summable fun n : ℕ => b n * (x - x0) ^ n) (hx : |x - x0| < ρ) : (tsum (fun n : ℕ => a n * (x - x0) ^ n) + tsum (fun n : ℕ => b n * (x - x0) ^ n) = tsum (fun n : ℕ => (a n + b n) * (x - x0) ^ n)) ∧ (tsum (fun n : ℕ => α * a n * (x - x0) ^ n) = tsum (fun n : ℕ => α * (a n * (x - x0) ^ n))) ∧ (let c : ℕ → ℝ := fun n => (Finset.range (n + 1)).sum fun i => a i * b (n - i); tsum (fun n : ℕ => a n * (x - x0) ^ n) * tsum (fun n : ℕ => b n * (x - x0) ^ n) = tsum (fun n : ℕ => c n * (x - x0) ^ n))

Lean source

Example 2.6.13. For |x| < 1, the power series of x / (1 + 2x + x^2) about 0 is ∑_{n=1}^∞ (-1)^{n+1} n x^n, and the radius of convergence is exactly 1.

open scoped BigOperators Topology lemma x_over_square_power_series : (∀ x : ℝ, |x| < 1 → Summable (fun n : ℕ => (-1 : ℝ) ^ n * (n + 1 : ℝ) * x ^ (n + 1)) ∧ tsum (fun n : ℕ => (-1 : ℝ) ^ n * (n + 1 : ℝ) * x ^ (n + 1)) = x / (1 + 2 * x + x ^ 2)) ∧ (∀ x : ℝ, 1 < |x| → ¬ Summable (fun n : ℕ => (-1 : ℝ) ^ n * (n + 1 : ℝ) * x ^ (n + 1)))