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.Order.BigOperators.Group.List

49 declarations and 11 deprecated aliases. Mathlib docs · Source

theorem List.Forall₂.prod_le_prod E1 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulRightMono M] [MulLeftMono M] {l₁ l₂ : List M},
  List.Forall₂ (fun x1 x2 ↦ x1 ≤ x2) l₁ l₂ → l₁.prod ≤ l₂.prod

theorem List.Forall₂.sum_le_sum E1 #

∀ {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddRightMono M] [AddLeftMono M] {l₁ l₂ : List M},
  List.Forall₂ (fun x1 x2 ↦ x1 ≤ x2) l₁ l₂ → l₁.sum ≤ l₂.sum

theorem List.Sublist.prod_le_prod E1 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulRightMono M] [MulLeftMono M] {l₁ l₂ : List M},
  l₁.Sublist l₂ → (∀ a ∈ l₂, 1 ≤ a) → l₁.prod ≤ l₂.prod

If l₁ is a sublist of l₂ and all elements of l₂ are greater than or equal to one, then l₁.prod ≤ l₂.prod. One can prove a stronger version assuming ∀ a ∈ l₂.diff l₁, 1 ≤ a instead of ∀ a ∈ l₂, 1 ≤ a but this lemma is not yet in mathlib.

theorem List.Sublist.sum_le_sum E1 #

∀ {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddRightMono M] [AddLeftMono M] {l₁ l₂ : List M},
  l₁.Sublist l₂ → (∀ a ∈ l₂, 0 ≤ a) → l₁.sum ≤ l₂.sum

If l₁ is a sublist of l₂ and all elements of l₂ are nonnegative, then l₁.sum ≤ l₂.sum. One can prove a stronger version assuming ∀ a ∈ l₂.diff l₁, 0 ≤ a instead of ∀ a ∈ l₂, 0 ≤ a but this lemma is not yet in mathlib.

theorem List.SublistForall₂.sum_le_sum E1 #

∀ {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddRightMono M] [AddLeftMono M] {l₁ l₂ : List M},
  List.SublistForall₂ (fun x1 x2 ↦ x1 ≤ x2) l₁ l₂ → (∀ a ∈ l₂, 0 ≤ a) → l₁.sum ≤ l₂.sum

theorem List.SublistForall₂.prod_le_prod E1 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulRightMono M] [MulLeftMono M] {l₁ l₂ : List M},
  List.SublistForall₂ (fun x1 x2 ↦ x1 ≤ x2) l₁ l₂ → (∀ a ∈ l₂, 1 ≤ a) → l₁.prod ≤ l₂.prod

theorem List.sum_le_sum E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddRightMono M] [AddLeftMono M] {l : List ι}
  {f g : ι → M}, (∀ i ∈ l, f i ≤ g i) → (List.map f l).sum ≤ (List.map g l).sum

theorem List.prod_le_prod E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulRightMono M] [MulLeftMono M] {l : List ι}
  {f g : ι → M}, (∀ i ∈ l, f i ≤ g i) → (List.map f l).prod ≤ (List.map g l).prod

theorem List.sum_lt_sum E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddLeftStrictMono M] [AddLeftMono M]
  [AddRightStrictMono M] [AddRightMono M] {l : List ι} (f g : ι → M),
  (∀ i ∈ l, f i ≤ g i) → (∃ i ∈ l, f i < g i) → (List.map f l).sum < (List.map g l).sum

theorem List.prod_lt_prod E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulLeftStrictMono M] [MulLeftMono M]
  [MulRightStrictMono M] [MulRightMono M] {l : List ι} (f g : ι → M),
  (∀ i ∈ l, f i ≤ g i) → (∃ i ∈ l, f i < g i) → (List.map f l).prod < (List.map g l).prod

theorem List.prod_lt_prod_of_ne_nil E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulLeftStrictMono M] [MulLeftMono M]
  [MulRightStrictMono M] [MulRightMono M] {l : List ι},
  l ≠ [] → ∀ (f g : ι → M), (∀ i ∈ l, f i < g i) → (List.map f l).prod < (List.map g l).prod

theorem List.sum_lt_sum_of_ne_nil E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddLeftStrictMono M] [AddLeftMono M]
  [AddRightStrictMono M] [AddRightMono M] {l : List ι},
  l ≠ [] → ∀ (f g : ι → M), (∀ i ∈ l, f i < g i) → (List.map f l).sum < (List.map g l).sum

theorem List.prod_le_pow_length E1 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulRightMono M] [MulLeftMono M] (l : List M) (n : M),
  (∀ x ∈ l, x ≤ n) → l.prod ≤ n ^ l.length

theorem List.sum_le_length_nsmul E1 #

∀ {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddRightMono M] [AddLeftMono M] (l : List M) (n : M),
  (∀ x ∈ l, x ≤ n) → l.sum ≤ l.length • n

theorem List.pow_length_le_prod E1 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulRightMono M] [MulLeftMono M] (l : List M) (n : M),
  (∀ x ∈ l, n ≤ x) → n ^ l.length ≤ l.prod

theorem List.length_nsmul_le_sum E1 #

∀ {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddRightMono M] [AddLeftMono M] (l : List M) (n : M),
  (∀ x ∈ l, n ≤ x) → l.length • n ≤ l.sum

theorem List.exists_lt_of_prod_lt E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : Monoid M] [inst_1 : LinearOrder M] [MulRightMono M] [MulLeftMono M] {l : List ι}
  (f g : ι → M), (List.map f l).prod < (List.map g l).prod → ∃ i ∈ l, f i < g i

theorem List.exists_lt_of_sum_lt E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : AddMonoid M] [inst_1 : LinearOrder M] [AddRightMono M] [AddLeftMono M]
  {l : List ι} (f g : ι → M), (List.map f l).sum < (List.map g l).sum → ∃ i ∈ l, f i < g i

theorem List.exists_le_of_sum_le E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : AddMonoid M] [inst_1 : LinearOrder M] [AddLeftStrictMono M] [AddLeftMono M]
  [AddRightStrictMono M] [AddRightMono M] {l : List ι},
  l ≠ [] → ∀ (f g : ι → M), (List.map f l).sum ≤ (List.map g l).sum → ∃ x ∈ l, f x ≤ g x

theorem List.exists_le_of_prod_le E1 #

∀ {ι : Type u_1} {M : Type u_3} [inst : Monoid M] [inst_1 : LinearOrder M] [MulLeftStrictMono M] [MulLeftMono M]
  [MulRightStrictMono M] [MulRightMono M] {l : List ι},
  l ≠ [] → ∀ (f g : ι → M), (List.map f l).prod ≤ (List.map g l).prod → ∃ x ∈ l, f x ≤ g x

theorem List.one_le_prod_of_one_le E1 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [MulLeftMono M] {l : List M}, (∀ x ∈ l, 1 ≤ x) → 1 ≤ l.prod

theorem List.sum_nonneg E1 #

∀ {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [AddLeftMono M] {l : List M}, (∀ x ∈ l, 0 ≤ x) → 0 ≤ l.sum

theorem List.max_prod_le E1 #

∀ {α : Type u_2} {M : Type u_3} [inst : Monoid M] (l : List α) (f g : α → M) [inst_1 : LinearOrder M] [MulLeftMono M]
  [MulRightMono M], max (List.map f l).prod (List.map g l).prod ≤ (List.map (fun i ↦ max (f i) (g i)) l).prod

theorem List.max_sum_le E1 #

∀ {α : Type u_2} {M : Type u_3} [inst : AddMonoid M] (l : List α) (f g : α → M) [inst_1 : LinearOrder M] [AddLeftMono M]
  [AddRightMono M], max (List.map f l).sum (List.map g l).sum ≤ (List.map (fun i ↦ max (f i) (g i)) l).sum

theorem List.sum_min_le E1 #

∀ {α : Type u_2} {M : Type u_3} [inst : AddMonoid M] [inst_1 : LinearOrder M] [AddLeftMono M] [AddRightMono M]
  (l : List α) (f g : α → M), (List.map (fun i ↦ min (f i) (g i)) l).sum ≤ min (List.map f l).sum (List.map g l).sum

theorem List.prod_min_le E1 #

∀ {α : Type u_2} {M : Type u_3} [inst : Monoid M] [inst_1 : LinearOrder M] [MulLeftMono M] [MulRightMono M] (l : List α)
  (f g : α → M), (List.map (fun i ↦ min (f i) (g i)) l).prod ≤ min (List.map f l).prod (List.map g l).prod

theorem List.monotone_sum_take E1 #

∀ {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [CanonicallyOrderedAdd M] (L : List M),
  Monotone fun i ↦ (List.take i L).sum

theorem List.monotone_prod_take E1 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [CanonicallyOrderedMul M] (L : List M),
  Monotone fun i ↦ (List.take i L).prod

theorem List.le_prod_of_mem E1 #

∀ {M : Type u_3} [inst : Monoid M] [inst_1 : Preorder M] [CanonicallyOrderedMul M] {xs : List M} {x : M},
  x ∈ xs → x ≤ xs.prod

See also List.single_le_prod.

theorem List.le_sum_of_mem E1 #

∀ {M : Type u_3} [inst : AddMonoid M] [inst_1 : Preorder M] [CanonicallyOrderedAdd M] {xs : List M} {x : M},
  x ∈ xs → x ≤ xs.sum

See also List.single_le_sum.

theorem List.le_sum_of_subadditive_on_pred E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : AddMonoid α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedAddMonoid β] (f : α → β) (p : α → Prop),
  f 0 ≤ 0 →
    p 0 →
      (∀ (a b : α), p a → p b → f (a + b) ≤ f a + f b) →
        (∀ (a b : α), p a → p b → p (a + b)) → ∀ (l : List α), (∀ a ∈ l, p a) → f l.sum ≤ (List.map f l).sum

theorem List.le_prod_of_submultiplicative_on_pred E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : Monoid α] [inst_1 : CommMonoid β] [inst_2 : Preorder β] [IsOrderedMonoid β]
  (f : α → β) (p : α → Prop),
  f 1 ≤ 1 →
    p 1 →
      (∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b) →
        (∀ (a b : α), p a → p b → p (a * b)) → ∀ (l : List α), (∀ a ∈ l, p a) → f l.prod ≤ (List.map f l).prod

theorem List.le_prod_of_submultiplicative E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : Monoid α] [inst_1 : CommMonoid β] [inst_2 : Preorder β] [IsOrderedMonoid β]
  (f : α → β), f 1 ≤ 1 → (∀ (a b : α), f (a * b) ≤ f a * f b) → ∀ (l : List α), f l.prod ≤ (List.map f l).prod

theorem List.le_sum_of_subadditive E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : AddMonoid α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedAddMonoid β] (f : α → β),
  f 0 ≤ 0 → (∀ (a b : α), f (a + b) ≤ f a + f b) → ∀ (l : List α), f l.sum ≤ (List.map f l).sum

theorem List.le_sum_nonempty_of_subadditive_on_pred E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : AddMonoid α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedAddMonoid β] (f : α → β) (p : α → Prop),
  (∀ (a b : α), p a → p b → f (a + b) ≤ f a + f b) →
    (∀ (a b : α), p a → p b → p (a + b)) → ∀ (l : List α), l ≠ [] → (∀ a ∈ l, p a) → f l.sum ≤ (List.map f l).sum

theorem List.le_prod_nonempty_of_submultiplicative_on_pred E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : Monoid α] [inst_1 : CommMonoid β] [inst_2 : Preorder β] [IsOrderedMonoid β]
  (f : α → β) (p : α → Prop),
  (∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b) →
    (∀ (a b : α), p a → p b → p (a * b)) → ∀ (l : List α), l ≠ [] → (∀ a ∈ l, p a) → f l.prod ≤ (List.map f l).prod

theorem List.le_prod_nonempty_of_submultiplicative E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : Monoid α] [inst_1 : CommMonoid β] [inst_2 : Preorder β] [IsOrderedMonoid β]
  (f : α → β), (∀ (a b : α), f (a * b) ≤ f a * f b) → ∀ (l : List α), l ≠ ∅ → f l.prod ≤ (List.map f l).prod

theorem List.le_sum_nonempty_of_subadditive E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : AddMonoid α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedAddMonoid β] (f : α → β),
  (∀ (a b : α), f (a + b) ≤ f a + f b) → ∀ (l : List α), l ≠ ∅ → f l.sum ≤ (List.map f l).sum

theorem List.sum_le_foldr_max E1 #

∀ {M : Type u_3} {N : Type u_4} [inst : AddZeroClass M] [inst_1 : Zero N] [inst_2 : LinearOrder N] (f : M → N),
  f 0 ≤ 0 → (∀ (x y : M), f (x + y) ≤ max (f x) (f y)) → ∀ (l : List M), f l.sum ≤ List.foldr max 0 (List.map f l)

theorem List.sum_pos E1 #

∀ {M : Type u_3} [inst : AddCommMonoid M] [inst_1 : Preorder M] [IsOrderedAddMonoid M] (l : List M),
  (∀ x ∈ l, 0 < x) → l ≠ [] → 0 < l.sum

theorem List.one_lt_prod_of_one_lt E1 #

∀ {M : Type u_3} [inst : CommMonoid M] [inst_1 : Preorder M] [IsOrderedMonoid M] (l : List M),
  (∀ x ∈ l, 1 < x) → l ≠ [] → 1 < l.prod

theorem List.single_le_prod E1 #

∀ {M : Type u_3} [inst : CommMonoid M] [inst_1 : Preorder M] [IsOrderedMonoid M] {l : List M},
  (∀ x ∈ l, 1 ≤ x) → ∀ x ∈ l, x ≤ l.prod

See also List.le_prod_of_mem.

theorem List.single_le_sum E1 #

∀ {M : Type u_3} [inst : AddCommMonoid M] [inst_1 : Preorder M] [IsOrderedAddMonoid M] {l : List M},
  (∀ x ∈ l, 0 ≤ x) → ∀ x ∈ l, x ≤ l.sum

See also List.le_sum_of_mem.

theorem List.all_zero_of_le_zero_le_of_sum_eq_zero E1 #

∀ {M : Type u_3} [inst : AddCommMonoid M] [inst_1 : PartialOrder M] [IsOrderedAddMonoid M] {l : List M},
  (∀ x ∈ l, 0 ≤ x) → l.sum = 0 → ∀ {x : M}, x ∈ l → x = 0

theorem List.all_one_of_le_one_le_of_prod_eq_one E1 #

∀ {M : Type u_3} [inst : CommMonoid M] [inst_1 : PartialOrder M] [IsOrderedMonoid M] {l : List M},
  (∀ x ∈ l, 1 ≤ x) → l.prod = 1 → ∀ {x : M}, x ∈ l → x = 1

theorem List.sum_eq_zero_iff E0 #

∀ {M : Type u_3} [inst : AddCommMonoid M] [inst_1 : PartialOrder M] [IsOrderedAddMonoid M] [CanonicallyOrderedAdd M]
  {l : List M}, l.sum = 0 ↔ ∀ x ∈ l, x = 0

theorem List.prod_eq_one_iff E0 #

∀ {M : Type u_3} [inst : CommMonoid M] [inst_1 : PartialOrder M] [IsOrderedMonoid M] [CanonicallyOrderedMul M]
  {l : List M}, l.prod = 1 ↔ ∀ x ∈ l, x = 1

theorem List.apply_prod_le_sum_map E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : Monoid α] [inst_1 : AddMonoid β] [inst_2 : Preorder β] [AddLeftMono β]
  (l : List α) (f : α → β), f 1 ≤ 0 → (∀ (a b : α), f (a * b) ≤ f a + f b) → f l.prod ≤ (List.map f l).sum

theorem List.sum_map_le_apply_prod E1 #

∀ {α : Type u_5} {β : Type u_6} [inst : Monoid α] [inst_1 : AddMonoid β] [inst_2 : Preorder β] [AddLeftMono β]
  (l : List α) (f : α → β), 0 ≤ f 1 → (∀ (a b : α), f a + f b ≤ f (a * b)) → (List.map f l).sum ≤ f l.prod

Deprecated aliases

NameNew nameSince
List.Forall₂.prod_le_prod'List.Forall₂.prod_le_prod2026-09-01
List.Sublist.prod_le_prod'List.Sublist.prod_le_prod2026-09-01
List.SublistForall₂.prod_le_prod'List.SublistForall₂.prod_le_prod2026-09-01
List.card_nsmul_le_sumList.length_nsmul_le_sum2026-08-26
List.exists_le_of_prod_le'List.exists_le_of_prod_le2026-09-01
List.exists_lt_of_prod_lt'List.exists_lt_of_prod_lt2026-09-01
List.pow_card_le_prodList.pow_length_le_prod2026-08-26
List.prod_le_pow_cardList.prod_le_pow_length2026-08-26
List.prod_le_prod'List.prod_le_prod2026-09-01
List.prod_lt_prod'List.prod_lt_prod2026-09-01
List.sum_le_card_nsmulList.sum_le_length_nsmul2026-08-26