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.Data.Finsupp.Order

60 declarations and 1 deprecated aliases. Mathlib docs · Source

Pointwise order on finitely supported functions

This file lifts order structures on α to ι →₀ α.

Main declarations

  • Finsupp.orderEmbeddingToFun: The order embedding from finitely supported functions to functions.

Order structures

Algebraic order structures

Some lemmas about ℕ

theorem Finsupp.support_mapDomain_of_nonneg E0 #

∀ {α : Type u_3} {β : Type u_4} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : PartialOrder M] [IsOrderedAddMonoid M]
  [inst_3 : DecidableEq β] {x : α →₀ M},
  0 ≤ x → ∀ (f : α → β), (Finsupp.mapDomain f x).support = Finset.image f x.support

theorem Finsupp.sum_le_sum E1 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedAddMonoid β] {f : ι →₀ α} {h₁ h₂ : ι → α → β},
  (∀ i ∈ f.support, h₁ i (f i) ≤ h₂ i (f i)) → f.sum h₁ ≤ f.sum h₂

theorem Finsupp.sum_nonneg E1 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedAddMonoid β] {f : ι →₀ α} {h₁ : ι → α → β}, (∀ i ∈ f.support, 0 ≤ h₁ i (f i)) → 0 ≤ f.sum h₁

theorem Finsupp.sum_nonneg' E1 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedAddMonoid β] {f : ι →₀ α} {h₁ : ι → α → β}, (∀ (i : ι), 0 ≤ h₁ i (f i)) → 0 ≤ f.sum h₁

theorem Finsupp.sum_nonpos E1 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedAddMonoid β] {f : ι →₀ α} {h₁ : ι → α → β}, (∀ i ∈ f.support, h₁ i (f i) ≤ 0) → f.sum h₁ ≤ 0

theorem Finsupp.sum_pos E1 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedCancelAddMonoid β] [AddLeftStrictMono β] {f : ι →₀ α} {g : ι → α → β},
  (∀ i ∈ f.support, 0 < g i (f i)) → f ≠ 0 → 0 < f.sum g

theorem Finsupp.sum_pos' E1 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : AddCommMonoid β] [inst_2 : Preorder β]
  [IsOrderedCancelAddMonoid β] [AddLeftStrictMono β] {f : ι →₀ α} {g : ι → α → β},
  (∀ i ∈ f.support, 0 ≤ g i (f i)) → (∃ i ∈ f.support, 0 < g i (f i)) → 0 < f.sum g

theorem Finsupp.single_le_single E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : Zero α] [inst_1 : Preorder α] {i : ι} {a b : α},
  ((fun₀ | i => a) ≤ fun₀ | i => b) ↔ a ≤ b

theorem Finsupp.single_mono E1 #

∀ {ι : Type u_1} {α : Type u_3} [inst : Zero α] [inst_1 : Preorder α] {i : ι}, Monotone (Finsupp.single i)

theorem Finsupp.single_nonneg E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : Zero α] [inst_1 : Preorder α] {i : ι} {a : α}, (0 ≤ fun₀ | i => a) ↔ 0 ≤ a

theorem Finsupp.single_nonpos E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : Zero α] [inst_1 : Preorder α] {i : ι} {a : α}, (fun₀ | i => a) ≤ 0 ↔ a ≤ 0

theorem Finsupp.sum_le_sum_index E1 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : Preorder α] [inst_2 : AddCommMonoid β]
  [inst_3 : Preorder β] [IsOrderedAddMonoid β] [inst_5 : DecidableEq ι] {f₁ f₂ : ι →₀ α} {h : ι → α → β},
  f₁ ≤ f₂ →
    (∀ i ∈ f₁.support ∪ f₂.support, Monotone (h i)) → (∀ i ∈ f₁.support ∪ f₂.support, h i 0 = 0) → f₁.sum h ≤ f₂.sum h

theorem Finsupp.embDomain_le_embDomain_iff_le E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : Zero α] [inst_1 : LE α] [Std.Refl fun x1 x2 ↦ x1 ≤ x2]
  (f : ι ↪ κ) (g₁ g₂ : ι →₀ α), Finsupp.embDomain f g₁ ≤ Finsupp.embDomain f g₂ ↔ g₁ ≤ g₂

theorem Finsupp.embDomain_mono E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : Zero α] [inst_1 : Preorder α] (f : ι ↪ κ),
  Monotone (Finsupp.embDomain f)

theorem Finsupp.embDomain_lt_embDomain_iff_lt E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : Zero α] [inst_1 : Preorder α] (f : ι ↪ κ) (g₁ g₂ : ι →₀ α),
  Finsupp.embDomain f g₁ < Finsupp.embDomain f g₂ ↔ g₁ < g₂

theorem Finsupp.mapDomain_le_mapDomain_iff_le E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : LE α] [Std.Refl fun x1 x2 ↦ x1 ≤ x2]
  {f : ι → κ}, Function.Injective f → ∀ (g₁ g₂ : ι →₀ α), Finsupp.mapDomain f g₁ ≤ Finsupp.mapDomain f g₂ ↔ g₁ ≤ g₂

theorem Finsupp.mapDomain_lt_mapDomain_iff_lt E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : Preorder α] {f : ι → κ},
  Function.Injective f → ∀ (g₁ g₂ : ι →₀ α), Finsupp.mapDomain f g₁ < Finsupp.mapDomain f g₂ ↔ g₁ < g₂

instance Finsupp.isOrderedAddMonoid E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : Preorder α] [IsOrderedAddMonoid α],
  IsOrderedAddMonoid (ι →₀ α)

theorem Finsupp.mapDomain_mono E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : Preorder α] [IsOrderedAddMonoid α]
  {f : ι → κ}, Monotone (Finsupp.mapDomain f)

theorem Finsupp.mapDomain_nonneg E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : Preorder α] [IsOrderedAddMonoid α]
  {f : ι → κ} {g : ι →₀ α}, 0 ≤ g → 0 ≤ Finsupp.mapDomain f g

theorem Finsupp.mapDomain_nonpos E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : Preorder α] [IsOrderedAddMonoid α]
  {f : ι → κ} {g : ι →₀ α}, g ≤ 0 → Finsupp.mapDomain f g ≤ 0

theorem Finsupp.single_le_sum E1 #

∀ {α : Type u_6} {M : Type u_7} {N : Type u_8} [inst : Zero M] [inst_1 : AddCommMonoid N] [inst_2 : PartialOrder N]
  [IsOrderedAddMonoid N] (f : α →₀ M) {g : α → M → N},
  (0 ≤ fun x1 x2 ↦ g x1 x2) → ∀ (a : α), (fun₀ | a => f a).sum g ≤ f.sum g

theorem Finsupp.single_eval_le_sum E1 #

∀ {α : Type u_6} {M : Type u_7} {N : Type u_8} [inst : Zero M] [inst_1 : AddCommMonoid N] [inst_2 : PartialOrder N]
  [IsOrderedAddMonoid N] (f : α →₀ M) {g : M → N},
  g 0 = 0 → (0 ≤ fun x ↦ g x) → ∀ (a : α), g (f a) ≤ f.sum fun x m ↦ g m

instance Finsupp.isOrderedCancelAddMonoid E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : Preorder α] [IsOrderedCancelAddMonoid α],
  IsOrderedCancelAddMonoid (ι →₀ α)

instance Finsupp.addLeftReflectLE E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : Preorder α] [AddLeftReflectLE α],
  AddLeftReflectLE (ι →₀ α)

instance Finsupp.instPosSMulMono E0 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : Preorder α] [inst_2 : Zero β]
  [inst_3 : Preorder β] [inst_4 : SMulZeroClass α β] [PosSMulMono α β], PosSMulMono α (ι →₀ β)

instance Finsupp.instSMulPosMono E0 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Preorder α] [inst_1 : Zero β] [inst_2 : Preorder β]
  [inst_3 : SMulZeroClass α β] [SMulPosMono α β], SMulPosMono α (ι →₀ β)

instance Finsupp.instPosSMulReflectLE E0 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : Preorder α] [inst_2 : Zero β]
  [inst_3 : Preorder β] [inst_4 : SMulZeroClass α β] [PosSMulReflectLE α β], PosSMulReflectLE α (ι →₀ β)

instance Finsupp.instSMulPosReflectLE E0 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Preorder α] [inst_1 : Zero β] [inst_2 : Preorder β]
  [inst_3 : SMulZeroClass α β] [SMulPosReflectLE α β], SMulPosReflectLE α (ι →₀ β)

instance Finsupp.instPosSMulStrictMono E0 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : PartialOrder α] [inst_2 : Zero β]
  [inst_3 : PartialOrder β] [inst_4 : SMulWithZero α β] [PosSMulStrictMono α β], PosSMulStrictMono α (ι →₀ β)

instance Finsupp.instSMulPosStrictMono E0 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : PartialOrder α] [inst_2 : Zero β]
  [inst_3 : PartialOrder β] [inst_4 : SMulWithZero α β] [SMulPosStrictMono α β], SMulPosStrictMono α (ι →₀ β)

instance Finsupp.instSMulPosReflectLT E0 #

∀ {ι : Type u_1} {α : Type u_3} {β : Type u_4} [inst : Zero α] [inst_1 : PartialOrder α] [inst_2 : Zero β]
  [inst_3 : PartialOrder β] [inst_4 : SMulWithZero α β] [SMulPosReflectLT α β], SMulPosReflectLT α (ι →₀ β)

instance Finsupp.orderBot E0 #

{ι : Type u_1} →
  {α : Type u_3} → [inst : AddCommMonoid α] → [inst_1 : PartialOrder α] → [IsBotZeroClass α] → OrderBot (ι →₀ α)

instance Finsupp.instIsBotZeroClass E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [IsBotZeroClass α],
  IsBotZeroClass (ι →₀ α)

theorem Finsupp.add_eq_zero_iff E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [CanonicallyOrderedAdd α]
  (f g : ι →₀ α), f + g = 0 ↔ f = 0 ∧ g = 0

theorem Finsupp.le_iff' E1 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [CanonicallyOrderedAdd α]
  (f g : ι →₀ α) {s : Finset ι}, f.support ⊆ s → (f ≤ g ↔ ∀ i ∈ s, f i ≤ g i)

theorem Finsupp.le_iff E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [CanonicallyOrderedAdd α]
  (f g : ι →₀ α), f ≤ g ↔ ∀ i ∈ f.support, f i ≤ g i

theorem Finsupp.support_monotone E1 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [CanonicallyOrderedAdd α],
  Monotone Finsupp.support

theorem Finsupp.support_mono E1 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] {f g : ι →₀ α}
  [CanonicallyOrderedAdd α], f ≤ g → f.support ⊆ g.support

instance Finsupp.decidableLE E0 #

{ι : Type u_1} →
  {α : Type u_3} →
    [inst : AddCommMonoid α] →
      [inst_1 : PartialOrder α] → [CanonicallyOrderedAdd α] → [DecidableLE α] → DecidableLE (ι →₀ α)

instance Finsupp.decidableLT E0 #

{ι : Type u_1} →
  {α : Type u_3} →
    [inst : AddCommMonoid α] →
      [inst_1 : PartialOrder α] → [CanonicallyOrderedAdd α] → [DecidableLE α] → DecidableLT (ι →₀ α)

theorem Finsupp.single_le_iff E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [CanonicallyOrderedAdd α] {i : ι}
  {x : α} {f : ι →₀ α}, (fun₀ | i => x) ≤ f ↔ x ≤ f i

instance Finsupp.tsub E0 #

{ι : Type u_1} →
  {α : Type u_3} →
    [inst : AddCommMonoid α] →
      [inst_1 : PartialOrder α] → [CanonicallyOrderedAdd α] → [inst_3 : Sub α] → [OrderedSub α] → Sub (ι →₀ α)

This is called tsub for truncated subtraction, to distinguish it with subtraction in an additive group.

instance Finsupp.orderedSub E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [inst_2 : CanonicallyOrderedAdd α]
  [inst_3 : Sub α] [inst_4 : OrderedSub α], OrderedSub (ι →₀ α)

instance Finsupp.instCanonicallyOrderedAddOfAddLeftMono E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [CanonicallyOrderedAdd α]
  [inst_3 : Sub α] [OrderedSub α] [AddLeftMono α], CanonicallyOrderedAdd (ι →₀ α)

theorem Finsupp.coe_tsub E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [inst_2 : CanonicallyOrderedAdd α]
  [inst_3 : Sub α] [inst_4 : OrderedSub α] (f g : ι →₀ α), ⇑(f - g) = ⇑f - ⇑g

theorem Finsupp.tsub_apply E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [inst_2 : CanonicallyOrderedAdd α]
  [inst_3 : Sub α] [inst_4 : OrderedSub α] (f g : ι →₀ α) (a : ι), (f - g) a = f a - g a

theorem Finsupp.single_tsub E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [inst_2 : CanonicallyOrderedAdd α]
  [inst_3 : Sub α] [inst_4 : OrderedSub α] {i : ι} {a b : α}, (fun₀ | i => a - b) = (fun₀ | i => a) - fun₀ | i => b

theorem Finsupp.support_tsub E1 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [inst_2 : CanonicallyOrderedAdd α]
  [inst_3 : Sub α] [inst_4 : OrderedSub α] {f1 f2 : ι →₀ α}, (f1 - f2).support ⊆ f1.support

theorem Finsupp.subset_support_tsub E1 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [inst_2 : CanonicallyOrderedAdd α]
  [inst_3 : Sub α] [inst_4 : OrderedSub α] [inst_5 : DecidableEq ι] {f1 f2 : ι →₀ α},
  f1.support \ f2.support ⊆ (f1 - f2).support

theorem Finsupp.mapDomain_tsub E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α]
  [inst_2 : CanonicallyOrderedAdd α] [inst_3 : Sub α] [inst_4 : OrderedSub α] {f : ι → κ},
  Function.Injective f →
    ∀ (f1 f2 : ι →₀ α), Finsupp.mapDomain f (f1 - f2) = Finsupp.mapDomain f f1 - Finsupp.mapDomain f f2

theorem Finsupp.embDomain_tsub E1 #

∀ {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α]
  [inst_2 : CanonicallyOrderedAdd α] [inst_3 : Sub α] [inst_4 : OrderedSub α] (f : ι ↪ κ) (f1 f2 : ι →₀ α),
  Finsupp.embDomain f (f1 - f2) = Finsupp.embDomain f f1 - Finsupp.embDomain f f2

theorem Finsupp.support_add_eq_union E1 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : PartialOrder α] [CanonicallyOrderedAdd α]
  [inst_3 : Sub α] [OrderedSub α] {f1 f2 : ι →₀ α} [inst_5 : DecidableEq ι], (f1 + f2).support = f1.support ∪ f2.support

The support of a sum is the union of the supports, when the coefficients satisfy CanonicallyOrderedAdd.

In the case where the supports are disjoint, there is also Finsupp.support_add_eq, which holds in any AddZeroClass.

theorem Finsupp.support_inf E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : LinearOrder α] [IsBotZeroClass α]
  [inst_3 : DecidableEq ι] (f g : ι →₀ α), (f ⊓ g).support = f.support ∩ g.support

theorem Finsupp.support_sup E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : LinearOrder α] [IsBotZeroClass α]
  [inst_3 : DecidableEq ι] (f g : ι →₀ α), (f ⊔ g).support = f.support ∪ g.support

theorem Finsupp.disjoint_iff E0 #

∀ {ι : Type u_1} {α : Type u_3} [inst : AddCommMonoid α] [inst_1 : LinearOrder α] [inst_2 : IsBotZeroClass α]
  {f g : ι →₀ α}, Disjoint f g ↔ Disjoint f.support g.support

theorem Finsupp.sub_single_one_add E1 #

∀ {ι : Type u_1} {a : ι} {u u' : ι →₀ ℕ}, u a ≠ 0 → (u - fun₀ | a => 1) + u' = u + u' - fun₀ | a => 1

theorem Finsupp.add_sub_single_one E1 #

∀ {ι : Type u_1} {a : ι} {u u' : ι →₀ ℕ}, u' a ≠ 0 → u + (u' - fun₀ | a => 1) = u + u' - fun₀ | a => 1

theorem Finsupp.sub_add_single_one_cancel E1 #

∀ {ι : Type u_1} {u : ι →₀ ℕ} {i : ι}, u i ≠ 0 → ((u - fun₀ | i => 1) + fun₀ | i => 1) = u

theorem Finsupp.isLowerSet_range_embDomain E1 #

∀ {α : Type u_3} {β : Type u_4} (f : α ↪ β), IsLowerSet (Set.range (Finsupp.embDomain f))

Deprecated aliases

NameNew nameSince
Finsupp.bot_eq_zerobot_eq_zero2026-05-07