The areas / V03. Sets, finite structures and big operators
Mathlib.Algebra.BigOperators.Group.List.Lemmas
28 declarations. Mathlib docs · Source
theorem List.prod_isUnit E1 #
∀ {M : Type u_3} [inst : Monoid M] {L : List M}, (∀ m ∈ L, IsUnit m) → IsUnit L.prod
theorem List.sum_isAddUnit E1 #
∀ {M : Type u_3} [inst : AddMonoid M] {L : List M}, (∀ m ∈ L, IsAddUnit m) → IsAddUnit L.sum
theorem List.prod_isUnit_iff E0 #
∀ {M : Type u_6} [inst : CommMonoid M] {L : List M}, IsUnit L.prod ↔ ∀ m ∈ L, IsUnit m
theorem List.sum_isAddUnit_iff E0 #
∀ {M : Type u_6} [inst : AddCommMonoid M] {L : List M}, IsAddUnit L.sum ↔ ∀ m ∈ L, IsAddUnit m
theorem List.Perm.prod_eq' E1 #
∀ {M : Type u_3} [inst : Monoid M] {l₁ l₂ : List M}, l₁.Perm l₂ → List.Pairwise Commute l₁ → l₁.prod = l₂.prod
If elements of a list commute with each other, then their product does not depend on the order of elements.
theorem List.Perm.sum_eq' E1 #
∀ {M : Type u_3} [inst : AddMonoid M] {l₁ l₂ : List M}, l₁.Perm l₂ → List.Pairwise AddCommute l₁ → l₁.sum = l₂.sum
If elements of a list additively commute with each other, then their sum does not depend on the order of elements.
theorem List.prod_rotate E0 #
∀ {M : Type u_6} [inst : CommMonoid M] (l : List M) (n : ℕ), (l.rotate n).prod = l.prod
theorem List.sum_rotate E0 #
∀ {M : Type u_6} [inst : AddCommMonoid M] (l : List M) (n : ℕ), (l.rotate n).sum = l.sum
theorem List.prod_rotate_of_pairwise_commute E1 #
∀ {M : Type u_3} [inst : Monoid M] {l : List M} (n : ℕ), List.Pairwise Commute l → (l.rotate n).prod = l.prod
theorem List.sum_rotate_of_pairwise_addCommute E1 #
∀ {M : Type u_3} [inst : AddMonoid M] {l : List M} (n : ℕ), List.Pairwise AddCommute l → (l.rotate n).sum = l.sum
theorem List.prod_rotate_eq_one_of_prod_eq_one E1 #
∀ {G : Type u_5} [inst : Group G] {l : List G}, l.prod = 1 → ∀ (n : ℕ), (l.rotate n).prod = 1
theorem List.sum_map_count_dedup_filter_eq_countP E1 #
∀ {α : Type u_1} [inst : DecidableEq α] (p : α → Bool) (l : List α),
(List.map (fun x ↦ List.count x l) (List.filter p l.dedup)).sum = List.countP p l
Summing the count of x over a list filtered by some p is just countP applied to p
theorem List.sum_map_count_dedup_eq_length E1 #
∀ {α : Type u_1} [inst : DecidableEq α] (l : List α), (List.map (fun x ↦ List.count x l) l.dedup).sum = l.length
theorem List.length_sigma E1 #
∀ {α : Type u_1} {σ : α → Type u_6} (l₁ : List α) (l₂ : (a : α) → List (σ a)),
(l₁.sigma l₂).length = (List.map (fun a ↦ (l₂ a).length) l₁).sum
theorem List.ranges_flatten E1 #
∀ (l : List ℕ), l.ranges.flatten = List.range l.sum
theorem List.ranges_nodup E1 #
∀ {l s : List ℕ}, s ∈ l.ranges → s.Nodup
The members of l.ranges have no duplicates
theorem List.mem_mem_ranges_iff_lt_sum E0 #
∀ (l : List ℕ) {n : ℕ}, (∃ s ∈ l.ranges, n ∈ s) ↔ n < l.sum
Any entry of any member of l.ranges is strictly smaller than l.sum.
theorem List.drop_take_succ_flatten_eq_getElem E1 #
∀ {α : Type u_1} (L : List (List α)) (i : ℕ) (h : i < L.length),
List.drop (List.take i (List.map List.length L)).sum
(List.take (List.take (i + 1) (List.map List.length L)).sum L.flatten) =
L[i]
In a flatten of sublists, taking the slice between the indices A and B - 1 gives back the
original sublist of index i if A is the sum of the lengths of sublists of index < i, and
B is the sum of the lengths of sublists of index ≤ i.
theorem List.neg_one_mem_of_prod_eq_neg_one E1 #
∀ {l : List ℤ}, l.prod = -1 → -1 ∈ l
If a product of integers is -1, then at least one factor must be -1.
theorem List.dvd_prod E1 #
∀ {M : Type u_3} [inst : CommMonoid M] {a : M} {l : List M}, a ∈ l → a ∣ l.prod
theorem List.Sublist.prod_dvd_prod E1 #
∀ {M : Type u_3} [inst : CommMonoid M] {l₁ l₂ : List M}, l₁.Sublist l₂ → l₁.prod ∣ l₂.prod
theorem List.alternatingSum_append E1 #
∀ {G : Type u_5} [inst : AddCommGroup G] (l₁ l₂ : List G),
(l₁ ++ l₂).alternatingSum = l₁.alternatingSum + (-1) ^ l₁.length • l₂.alternatingSum
theorem List.alternatingProd_append E1 #
∀ {G : Type u_5} [inst : CommGroup G] (l₁ l₂ : List G),
(l₁ ++ l₂).alternatingProd = l₁.alternatingProd * l₂.alternatingProd ^ (-1) ^ l₁.length
theorem List.alternatingSum_reverse E1 #
∀ {G : Type u_5} [inst : AddCommGroup G] (l : List G),
l.reverse.alternatingSum = (-1) ^ (l.length + 1) • l.alternatingSum
theorem List.alternatingProd_reverse E1 #
∀ {G : Type u_5} [inst : CommGroup G] (l : List G),
l.reverse.alternatingProd = l.alternatingProd ^ (-1) ^ (l.length + 1)
theorem MulOpposite.op_list_prod E1 #
∀ {M : Type u_3} [inst : Monoid M] (l : List M), MulOpposite.op l.prod = (List.map MulOpposite.op l).reverse.prod
theorem MulOpposite.unop_list_prod E1 #
∀ {M : Type u_3} [inst : Monoid M] (l : List Mᵐᵒᵖ), MulOpposite.unop l.prod = (List.map MulOpposite.unop l).reverse.prod
theorem unop_map_list_prod E1 #
∀ {M : Type u_3} {N : Type u_4} [inst : Monoid M] [inst_1 : Monoid N] {F : Type u_6} [inst_2 : FunLike F M Nᵐᵒᵖ]
[MonoidHomClass F M Nᵐᵒᵖ] (f : F) (l : List M),
MulOpposite.unop (f l.prod) = (List.map (MulOpposite.unop ∘ ⇑f) l).reverse.prod
A morphism into the opposite monoid acts on the product by acting on the reversed elements.