The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Algebra.BigOperators.Ring.List

10 declarations. Mathlib docs · Source

theorem Commute.list_sum_right E1 #

∀ {R : Type u_5} [inst : NonUnitalNonAssocSemiring R] (a : R) (l : List R), (∀ b ∈ l, Commute a b) → Commute a l.sum

theorem Commute.list_sum_left E1 #

∀ {R : Type u_5} [inst : NonUnitalNonAssocSemiring R] (b : R) (l : List R), (∀ a ∈ l, Commute a b) → Commute l.sum b

theorem List.prod_map_neg E0 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : HasDistribNeg M] (l : List M),
  (List.map Neg.neg l).prod = (-1) ^ l.length * l.prod

theorem List.prod_eq_zero E1 #

∀ {M₀ : Type u_4} [inst : MonoidWithZero M₀] {l : List M₀}, 0 ∈ l → l.prod = 0

If zero is an element of a list l, then List.prod l = 0. If the domain is a nontrivial monoid with zero with no zero divisors, then this implication becomes an iff, see List.prod_eq_zero_iff.

theorem List.prod_eq_zero_iff E0 #

∀ {M₀ : Type u_4} [inst : MonoidWithZero M₀] [Nontrivial M₀] [NoZeroDivisors M₀] {l : List M₀}, l.prod = 0 ↔ 0 ∈ l

Product of elements of a list l equals zero if and only if 0 ∈ l. See also List.prod_eq_zero for an implication that needs weaker typeclass assumptions.

theorem List.prod_ne_zero E1 #

∀ {M₀ : Type u_4} [inst : MonoidWithZero M₀] {l : List M₀} [Nontrivial M₀] [NoZeroDivisors M₀], 0 ∉ l → l.prod ≠ 0

theorem List.sum_map_mul_left E1 #

∀ {ι : Type u_1} {R : Type u_5} [inst : NonUnitalNonAssocSemiring R] (l : List ι) (f : ι → R) (r : R),
  (List.map (fun b ↦ r * f b) l).sum = r * (List.map f l).sum

theorem List.sum_map_mul_right E1 #

∀ {ι : Type u_1} {R : Type u_5} [inst : NonUnitalNonAssocSemiring R] (l : List ι) (f : ι → R) (r : R),
  (List.map (fun b ↦ f b * r) l).sum = (List.map f l).sum * r

theorem List.dvd_sum E1 #

∀ {R : Type u_5} [inst : NonUnitalSemiring R] {a : R} {l : List R}, (∀ x ∈ l, a ∣ x) → a ∣ l.sum

theorem List.sum_zipWith_distrib_left E0 #

∀ {ι : Type u_1} {κ : Type u_2} {R : Type u_5} [inst : NonUnitalNonAssocSemiring R] (f : ι → κ → R) (a : R)
  (l₁ : List ι) (l₂ : List κ), (List.zipWith (fun i j ↦ a * f i j) l₁ l₂).sum = a * (List.zipWith f l₁ l₂).sum