The areas / V06. Rings, fields and ordered algebra
Mathlib.Algebra.Ring.GeomSum
54 declarations. Mathlib docs · Source
Partial sums of geometric series in a ring
This file determines the values of the geometric series $\sum_{i=0}^{n-1} x^i$ and $\sum_{i=0}^{n-1} x^i y^{n-1-i}$ and variants thereof.
Several variants are recorded, generalising in particular to the case of a noncommutative ring in
which x and y commute. Even versions not using division or subtraction, valid in each semiring,
are recorded.
theorem geom_sum_succ E1 #
∀ {R : Type u_1} [inst : Semiring R] {x : R} {n : ℕ},
∑ i ∈ Finset.range (n + 1), x ^ i = x * ∑ i ∈ Finset.range n, x ^ i + 1
theorem geom_sum_succ' E1 #
∀ {R : Type u_1} [inst : Semiring R] {x : R} {n : ℕ},
∑ i ∈ Finset.range (n + 1), x ^ i = x ^ n + ∑ i ∈ Finset.range n, x ^ i
theorem geom_sum_zero E1 #
∀ {R : Type u_1} [inst : Semiring R] (x : R), ∑ i ∈ Finset.range 0, x ^ i = 0
theorem geom_sum_one E1 #
∀ {R : Type u_1} [inst : Semiring R] (x : R), ∑ i ∈ Finset.range 1, x ^ i = 1
theorem geom_sum_two E0 #
∀ {R : Type u_1} [inst : Semiring R] {x : R}, ∑ i ∈ Finset.range 2, x ^ i = x + 1
theorem zero_geom_sum E0 #
∀ {R : Type u_1} [inst : Semiring R] {n : ℕ}, ∑ i ∈ Finset.range n, 0 ^ i = if n = 0 then 0 else 1
theorem one_geom_sum E1 #
∀ {R : Type u_1} [inst : Semiring R] (n : ℕ), ∑ i ∈ Finset.range n, 1 ^ i = ↑n
theorem op_geom_sum E1 #
∀ {R : Type u_1} [inst : Semiring R] (x : R) (n : ℕ),
MulOpposite.op (∑ i ∈ Finset.range n, x ^ i) = ∑ i ∈ Finset.range n, MulOpposite.op x ^ i
theorem op_geom_sum₂ E0 #
∀ {R : Type u_1} [inst : Semiring R] (x y : R) (n : ℕ),
∑ i ∈ Finset.range n, MulOpposite.op y ^ (n - 1 - i) * MulOpposite.op x ^ i =
∑ i ∈ Finset.range n, MulOpposite.op y ^ i * MulOpposite.op x ^ (n - 1 - i)
theorem geom_sum₂_with_one E1 #
∀ {R : Type u_1} [inst : Semiring R] (x : R) (n : ℕ),
∑ i ∈ Finset.range n, x ^ i * 1 ^ (n - 1 - i) = ∑ i ∈ Finset.range n, x ^ i
theorem Commute.geom_sum₂_mul_add E1 #
∀ {R : Type u_1} [inst : Semiring R] {x y : R},
Commute x y → ∀ (n : ℕ), (∑ i ∈ Finset.range n, (x + y) ^ i * y ^ (n - 1 - i)) * x + y ^ n = (x + y) ^ n
$x^n-y^n = (x-y) \sum x^ky^{n-1-k}$ reformulated without - signs.
theorem geom_sum₂_self E1 #
∀ {R : Type u_1} [inst : Semiring R] (x : R) (n : ℕ), ∑ i ∈ Finset.range n, x ^ i * x ^ (n - 1 - i) = ↑n * x ^ (n - 1)
theorem geom_sum_mul_add E1 #
∀ {R : Type u_1} [inst : Semiring R] (x : R) (n : ℕ), (∑ i ∈ Finset.range n, (x + 1) ^ i) * x + 1 = (x + 1) ^ n
theorem Commute.geom_sum₂_comm E1 #
∀ {R : Type u_1} [inst : Semiring R] {x y : R} (n : ℕ),
Commute x y → ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i) = ∑ i ∈ Finset.range n, y ^ i * x ^ (n - 1 - i)
theorem RingHom.map_geom_sum E0 #
∀ {R : Type u_1} {S : Type u_2} [inst : Semiring R] [inst_1 : Semiring S] (x : R) (n : ℕ) (f : R →+* S),
f (∑ i ∈ Finset.range n, x ^ i) = ∑ i ∈ Finset.range n, f x ^ i
theorem RingHom.map_geom_sum₂ E0 #
∀ {R : Type u_1} {S : Type u_2} [inst : Semiring R] [inst_1 : Semiring S] (x y : R) (n : ℕ) (f : R →+* S),
f (∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)) = ∑ i ∈ Finset.range n, f x ^ i * f y ^ (n - 1 - i)
theorem geom_sum₂_mul_add E1 #
∀ {R : Type u_1} [inst : CommSemiring R] (x y : R) (n : ℕ),
(∑ i ∈ Finset.range n, (x + y) ^ i * y ^ (n - 1 - i)) * x + y ^ n = (x + y) ^ n
$x^n-y^n = (x-y) \sum x^ky^{n-1-k}$ reformulated without - signs.
theorem geom_sum₂_comm E1 #
∀ {R : Type u_1} [inst : CommSemiring R] (x y : R) (n : ℕ),
∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i) = ∑ i ∈ Finset.range n, y ^ i * x ^ (n - 1 - i)
theorem geom_sum₂_mul_of_ge E1 #
∀ {R : Type u_1} [inst : CommSemiring R] [inst_1 : PartialOrder R] [AddLeftReflectLE R] [AddLeftMono R]
[ExistsAddOfLE R] [inst_5 : Sub R] [OrderedSub R] {x y : R},
y ≤ x → ∀ (n : ℕ), (∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)) * (x - y) = x ^ n - y ^ n
theorem geom_sum₂_mul_of_le E1 #
∀ {R : Type u_1} [inst : CommSemiring R] [inst_1 : PartialOrder R] [AddLeftReflectLE R] [AddLeftMono R]
[ExistsAddOfLE R] [inst_5 : Sub R] [OrderedSub R] {x y : R},
x ≤ y → ∀ (n : ℕ), (∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)) * (y - x) = y ^ n - x ^ n
theorem geom_sum_mul_of_one_le E1 #
∀ {R : Type u_1} [inst : CommSemiring R] [inst_1 : PartialOrder R] [AddLeftReflectLE R] [AddLeftMono R]
[ExistsAddOfLE R] [inst_5 : Sub R] [OrderedSub R] {x : R},
1 ≤ x → ∀ (n : ℕ), (∑ i ∈ Finset.range n, x ^ i) * (x - 1) = x ^ n - 1
theorem geom_sum_mul_of_le_one E1 #
∀ {R : Type u_1} [inst : CommSemiring R] [inst_1 : PartialOrder R] [AddLeftReflectLE R] [AddLeftMono R]
[ExistsAddOfLE R] [inst_5 : Sub R] [OrderedSub R] {x : R},
x ≤ 1 → ∀ (n : ℕ), (∑ i ∈ Finset.range n, x ^ i) * (1 - x) = 1 - x ^ n
theorem neg_one_geom_sum E0 #
∀ {R : Type u_1} [inst : Ring R] {n : ℕ}, ∑ i ∈ Finset.range n, (-1) ^ i = if Even n then 0 else 1
theorem Commute.geom_sum₂_mul E1 #
∀ {R : Type u_1} [inst : Ring R] {x y : R},
Commute x y → ∀ (n : ℕ), (∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)) * (x - y) = x ^ n - y ^ n
theorem Commute.mul_neg_geom_sum₂ E1 #
∀ {R : Type u_1} [inst : Ring R] {x y : R},
Commute x y → ∀ (n : ℕ), (y - x) * ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i) = y ^ n - x ^ n
theorem Commute.mul_geom_sum₂ E1 #
∀ {R : Type u_1} [inst : Ring R] {x y : R},
Commute x y → ∀ (n : ℕ), (x - y) * ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i) = x ^ n - y ^ n
theorem Commute.sub_dvd_pow_sub_pow E1 #
∀ {R : Type u_1} [inst : Ring R] {x y : R}, Commute x y → ∀ (n : ℕ), x - y ∣ x ^ n - y ^ n
theorem one_sub_dvd_one_sub_pow E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) (n : ℕ), 1 - x ∣ 1 - x ^ n
theorem sub_one_dvd_pow_sub_one E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) (n : ℕ), x - 1 ∣ x ^ n - 1
theorem pow_one_sub_dvd_pow_mul_sub_one E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) (m n : ℕ), x ^ m - 1 ∣ x ^ (m * n) - 1
theorem dvd_pow_sub_one_of_dvd E1 #
∀ {R : Type u_1} [inst : Ring R] {r : R} {a b : ℕ}, a ∣ b → r ^ a - 1 ∣ r ^ b - 1
theorem dvd_pow_pow_sub_self_of_dvd E1 #
∀ {R : Type u_1} [inst : Ring R] {r : R} {p a b : ℕ}, a ∣ b → r ^ p ^ a - r ∣ r ^ p ^ b - r
theorem geom_sum_mul E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) (n : ℕ), (∑ i ∈ Finset.range n, x ^ i) * (x - 1) = x ^ n - 1
theorem mul_geom_sum E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) (n : ℕ), (x - 1) * ∑ i ∈ Finset.range n, x ^ i = x ^ n - 1
theorem geom_sum_mul_neg E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) (n : ℕ), (∑ i ∈ Finset.range n, x ^ i) * (1 - x) = 1 - x ^ n
theorem mul_neg_geom_sum E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) (n : ℕ), (1 - x) * ∑ i ∈ Finset.range n, x ^ i = 1 - x ^ n
theorem Commute.mul_geom_sum₂_Ico E1 #
∀ {R : Type u_1} [inst : Ring R] {x y : R},
Commute x y →
∀ {m n : ℕ}, m ≤ n → (x - y) * ∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i) = x ^ n - x ^ m * y ^ (n - m)
theorem Commute.geom_sum₂_succ_eq E0 #
∀ {R : Type u_1} [inst : Ring R] {x y : R},
Commute x y →
∀ {n : ℕ},
∑ i ∈ Finset.range (n + 1), x ^ i * y ^ (n - i) = x ^ n + y * ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)
theorem Commute.geom_sum₂_Ico_mul E1 #
∀ {R : Type u_1} [inst : Ring R] {x y : R},
Commute x y →
∀ {m n : ℕ}, m ≤ n → (∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i)) * (x - y) = x ^ n - y ^ (n - m) * x ^ m
theorem geom_sum_Ico_mul E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) {m n : ℕ}, m ≤ n → (∑ i ∈ Finset.Ico m n, x ^ i) * (x - 1) = x ^ n - x ^ m
theorem geom_sum_Ico_mul_neg E1 #
∀ {R : Type u_1} [inst : Ring R] (x : R) {m n : ℕ}, m ≤ n → (∑ i ∈ Finset.Ico m n, x ^ i) * (1 - x) = x ^ m - x ^ n
theorem pow_sub_one_mul_geom_sum_eq_pow_sub_one_mul_geom_sum E1 #
∀ {R : Type u_1} [inst : CommRing R] {x : R} {m n : ℕ},
(x ^ m - 1) * ∑ k ∈ Finset.range n, x ^ k = (x ^ n - 1) * ∑ k ∈ Finset.range m, x ^ k
theorem geom_sum₂_mul E1 #
∀ {R : Type u_1} [inst : CommRing R] (x y : R) (n : ℕ),
(∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)) * (x - y) = x ^ n - y ^ n
theorem sub_dvd_pow_sub_pow E1 #
∀ {R : Type u_1} [inst : CommRing R] (x y : R) (n : ℕ), x - y ∣ x ^ n - y ^ n
theorem Odd.add_dvd_pow_add_pow E1 #
∀ {R : Type u_1} [inst : CommRing R] (x y : R) {n : ℕ}, Odd n → x + y ∣ x ^ n + y ^ n
theorem geom_sum₂_succ_eq E0 #
∀ {R : Type u_1} [inst : CommRing R] (x y : R) {n : ℕ},
∑ i ∈ Finset.range (n + 1), x ^ i * y ^ (n - i) = x ^ n + y * ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)
theorem mul_geom_sum₂_Ico E1 #
∀ {R : Type u_1} [inst : CommRing R] (x y : R) {m n : ℕ},
m ≤ n → (x - y) * ∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i) = x ^ n - x ^ m * y ^ (n - m)
theorem sum_range_mul_geometric_add E1 #
∀ {R : Type u_1} [inst : CommRing R] (x : R) (m : ℕ),
∑ k ∈ Finset.range m, ↑k * (x ^ k * (1 - x)) + ↑m * x ^ m = ∑ k ∈ Finset.Icc 1 m, x ^ k
Summing k against the weights x ^ k * (1 - x) for k < m, plus m against the
boundary weight x ^ m, gives the geometric sum ∑ k ∈ Icc 1 m, x ^ k. This is the identity
behind the mean of a censored geometric distribution: x ^ k * (1 - x) is the mass at k and
x ^ m the mass collected at m.
theorem Nat.sub_dvd_pow_sub_pow E1 #
∀ (x y n : ℕ), x - y ∣ x ^ n - y ^ n
theorem Nat.sub_one_dvd_pow_sub_one E1 #
∀ (x n : ℕ), x - 1 ∣ x ^ n - 1
theorem Nat.pow_sub_pow_dvd_pow_sub_pow E1 #
∀ {m k : ℕ} (x y : ℕ), m ∣ k → x ^ m - y ^ m ∣ x ^ k - y ^ k
theorem Nat.pow_sub_one_dvd_pow_sub_one E1 #
∀ {m k : ℕ} (x : ℕ), m ∣ k → x ^ m - 1 ∣ x ^ k - 1
theorem Odd.nat_add_dvd_pow_add_pow E1 #
∀ (x y : ℕ) {n : ℕ}, Odd n → x + y ∣ x ^ n + y ^ n
theorem Nat.geomSum_eq E0 #
∀ {m : ℕ}, 2 ≤ m → ∀ (n : ℕ), ∑ k ∈ Finset.range n, m ^ k = (m ^ n - 1) / (m - 1)
Value of a geometric sum over the naturals. Note: see geom_sum_mul_add for a formulation
that avoids division and subtraction.