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 / V04. Order and lattices

Mathlib.Order.Partition.Finpartition

134 declarations and 2 deprecated aliases. Mathlib docs · Source

Finite partitions

In this file, we define finite partitions. A finpartition of a : α is a finite set of pairwise disjoint parts parts : Finset α which does not contain ⊥ and whose supremum is a.

Finpartitions of a finset are at the heart of Szemerédi's regularity lemma. They are also studied purely order theoretically in Sperner theory.

Constructions

We provide many ways to build finpartitions:

  • Finpartition.ofErase: Builds a finpartition by erasing ⊥ for you.
  • Finpartition.ofSubset: Builds a finpartition from a subset of the parts of a previous finpartition.
  • Finpartition.empty: The empty finpartition of ⊥.
  • Finpartition.indiscrete: The indiscrete, aka trivial, aka pure, finpartition made of a single part.
  • Finpartition.discrete: The discrete finpartition of s : Finset α made of singletons.
  • Finpartition.toSubtype: Turns a finpartition of a type to one of a subtype.
  • Finpartition.bind: Puts together the finpartitions of the parts of a finpartition into a new finpartition.
  • Finpartition.extend: Extends a finpartition of a to a finpartition of a ⊔ b by adding b as a new part.
  • Finpartition.extendOfLE: Extends a finpartition of a to a finpartition of b when a ≤ b, by adding b \ a as a new part (if nonempty).
  • Finpartition.restrict: Restricts a finpartition of a to b where b ≤ a by intersecting each part with b.
  • Finpartition.ofPairwiseDisjoint: Builds a finpartition from a finset parts of pairwise disjoint elements.
  • Finpartition.combine: Combines a family of partitions of pairwise disjoint elements into a partition of their sup.
  • Finpartition.ofExistsUnique: Builds a finpartition from a collection of parts such that each element is in exactly one part.
  • Finpartition.ofSetoid: With Fintype α, constructs the finpartition of univ : Finset α induced by the equivalence classes of s : Setoid α.
  • Finpartition.atomise: Makes a finpartition of s : Finset α by breaking s along all finsets in F : Finset (Finset α). Two elements of s belong to the same part iff they belong to the same elements of F.

Finpartition.indiscrete and Finpartition.bind together form the monadic structure of Finpartition.

Implementation notes

Forbidding ⊥ as a part follows mathematical tradition and is a pragmatic choice concerning operations on Finpartition. Not caring about ⊥ being a part or not breaks extensionality (it's not because the parts of P and the parts of Q have the same elements that P = Q). Enforcing ⊥ to be a part makes Finpartition.bind uglier and doesn't rid us of the need of Finpartition.ofErase.

TODO

The order is the wrong way around to make Finpartition a a graded order. Is it bad to depart from the literature and turn the order around?

The specialisation to Finset α could be generalised to atomistic orders.

Refinement order

Finite partitions of finsets

theorem Finpartition.mk.injEq E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (parts : Finset α) (supIndep : parts.SupIndep id)
  (sup_parts : parts.sup id = a) (bot_notMem : ⊥ ∉ parts) (parts_1 : Finset α) (supIndep_1 : parts_1.SupIndep id)
  (sup_parts_1 : parts_1.sup id = a) (bot_notMem_1 : ⊥ ∉ parts_1),
  ({ parts := parts, supIndep := supIndep, sup_parts := sup_parts, bot_notMem := bot_notMem } =
      { parts := parts_1, supIndep := supIndep_1, sup_parts := sup_parts_1, bot_notMem := bot_notMem_1 }) =
    (parts = parts_1)

def Finpartition.ctorIdx E1 #

{α : Type u_1} → {inst : Lattice α} → {inst_1 : OrderBot α} → {a : α} → Finpartition a → ℕ

theorem Finpartition.copy.congr_simp E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a b : α} (P P_1 : Finpartition a),
  P = P_1 → ∀ (h : a = b), P.copy h = P_1.copy h

theorem Finpartition.ofSetSetoid.congr_simp E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s s_1 : Setoid α),
  s = s_1 →
    ∀ (x : Finset α) {inst_1 : DecidableRel ⇑s} [inst_2 : DecidableRel ⇑s_1],
      Finpartition.ofSetSetoid s x = Finpartition.ofSetSetoid s_1 x

theorem Finpartition.mk.inj E1 #

∀ {α : Type u_1} {inst : Lattice α} {inst_1 : OrderBot α} {a : α} {parts : Finset α} {supIndep : parts.SupIndep id}
  {sup_parts : parts.sup id = a} {bot_notMem : ⊥ ∉ parts} {parts_1 : Finset α} {supIndep_1 : parts_1.SupIndep id}
  {sup_parts_1 : parts_1.sup id = a} {bot_notMem_1 : ⊥ ∉ parts_1},
  { parts := parts, supIndep := supIndep, sup_parts := sup_parts, bot_notMem := bot_notMem } =
      { parts := parts_1, supIndep := supIndep_1, sup_parts := sup_parts_1, bot_notMem := bot_notMem_1 } →
    parts = parts_1

theorem Finpartition.toSubtype.congr_simp E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {s : α} (P P_1 : Finpartition s) (e_P : P = P_1)
  {Pr : α → Prop} (Prsup : ∀ ⦃s t : α⦄, Pr s → Pr t → Pr (s ⊔ t)) (Prinf : ∀ ⦃s t : α⦄, Pr s → Pr t → Pr (s ⊓ t))
  (Prbot : Pr ⊥) (hs : Pr s) (hP : ∀ p ∈ P.parts, Pr p),
  P.toSubtype Prsup Prinf Prbot hs hP = P_1.toSubtype Prsup Prinf Prbot hs ⋯

theorem Finpartition.restrict.congr_simp E1 #

∀ {α : Type u_1} [inst : DistribLattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a b : α}
  (P P_1 : Finpartition a), P = P_1 → ∀ (hb : b ≤ a), P.restrict hb = P_1.restrict hb

theorem Finpartition.ofSetoid.congr_simp E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] (s s_1 : Setoid α),
  s = s_1 →
    ∀ {inst_2 : DecidableRel ⇑s} [inst_3 : DecidableRel ⇑s_1], Finpartition.ofSetoid s = Finpartition.ofSetoid s_1

theorem Finpartition.mk.congr_simp E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (parts parts_1 : Finset α) (e_parts : parts = parts_1)
  (supIndep : parts.SupIndep id) (sup_parts : parts.sup id = a) (bot_notMem : ⊥ ∉ parts),
  { parts := parts, supIndep := supIndep, sup_parts := sup_parts, bot_notMem := bot_notMem } =
    { parts := parts_1, supIndep := ⋯, sup_parts := ⋯, bot_notMem := ⋯ }

theorem Finpartition.ofErase.congr_simp E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a : α} (parts parts_1 : Finset α)
  (e_parts : parts = parts_1) (sup_indep : parts.SupIndep id) (sup_parts : parts.sup id = a),
  Finpartition.ofErase parts sup_indep sup_parts = Finpartition.ofErase parts_1 ⋯ ⋯

theorem Finpartition.extend.congr_simp E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α]
  {a b b_1 : α} (e_b : b = b_1) {c : α} (P P_1 : Finpartition a),
  P = P_1 → ∀ (hb : b ≠ ⊥) (hab : Disjoint a b) (hc : a ⊔ b = c), P.extend hb hab hc = P_1.extend ⋯ ⋯ ⋯

theorem Finpartition.combine.congr_simp E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α]
  {ι : Type u_2} {I : Finset ι} {a : ι → α} (P P_1 : (i : ι) → Finpartition (a i)),
  P = P_1 → ∀ (ha : I.SupIndep a), Finpartition.combine P ha = Finpartition.combine P_1 ha

theorem Finpartition.indiscrete.congr_simp E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (ha : a ≠ ⊥),
  Finpartition.indiscrete ha = Finpartition.indiscrete ha

theorem Finpartition.extendOfLE.congr_simp E1 #

∀ {α : Type u_1} [inst : GeneralizedBooleanAlgebra α] [inst_1 : DecidableEq α] {a b : α} (P P_1 : Finpartition a),
  P = P_1 → ∀ (hab : a ≤ b), P.extendOfLE hab = P_1.extendOfLE hab

structure Finpartition E3 #

{α : Type u_1} → [inst : Lattice α] → [OrderBot α] → α → Type u_1

A finite partition of a : α is a pairwise disjoint finite set of elements whose supremum is a. We forbid ⊥ as a part.

theorem Finpartition.ext E1 #

∀ {α : Type u_1} {inst : Lattice α} {inst_1 : OrderBot α} {a : α} {x y : Finpartition a}, x.parts = y.parts → x = y

theorem Finpartition.ext_iff E0 #

∀ {α : Type u_1} {inst : Lattice α} {inst_1 : OrderBot α} {a : α} {x y : Finpartition a}, x = y ↔ x.parts = y.parts

ctor Finpartition.mk E0 #

{α : Type u_1} →
  [inst : Lattice α] →
    [inst_1 : OrderBot α] →
      {a : α} → (parts : Finset α) → parts.SupIndep id → parts.sup id = a → ⊥ ∉ parts → Finpartition a

abbrev Finpartition.parts E1 #

{α : Type u_1} → [inst : Lattice α] → [inst_1 : OrderBot α] → {a : α} → Finpartition a → Finset α

The elements of the finite partition of a

theorem Finpartition.supIndep E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (self : Finpartition a), self.parts.SupIndep id

The partition is supremum-independent

theorem Finpartition.sup_parts E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (self : Finpartition a), self.parts.sup id = a

The supremum of the partition is a

theorem Finpartition.bot_notMem E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (self : Finpartition a), ⊥ ∉ self.parts

No element of the partition is bottom

instance instDecidableEqFinpartition E0 #

{α : Type u_2} → {inst : Lattice α} → {inst_1 : OrderBot α} → {a : α} → [DecidableEq α] → DecidableEq (Finpartition a)

def instDecidableEqFinpartition.decEq E1 #

{α : Type u_2} →
  {inst : Lattice α} →
    {inst_1 : OrderBot α} → {a : α} → [DecidableEq α] → (x x_1 : Finpartition a) → Decidable (x = x_1)

def Finpartition.ofErase E1 #

{α : Type u_1} →
  [inst : Lattice α] →
    [inst_1 : OrderBot α] →
      [DecidableEq α] → {a : α} → (parts : Finset α) → parts.SupIndep id → parts.sup id = a → Finpartition a

A Finpartition constructor which does not insist on ⊥ not being a part.

theorem Finpartition.ofErase_parts E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a : α} (parts : Finset α)
  (sup_indep : parts.SupIndep id) (sup_parts : parts.sup id = a),
  (Finpartition.ofErase parts sup_indep sup_parts).parts = parts.erase ⊥

def Finpartition.ofSubset E1 #

{α : Type u_1} →
  [inst : Lattice α] →
    [inst_1 : OrderBot α] →
      {a b : α} → (P : Finpartition a) → {parts : Finset α} → parts ⊆ P.parts → parts.sup id = b → Finpartition b

A Finpartition constructor from a bigger existing finpartition.

theorem Finpartition.ofSubset_parts E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a b : α} (P : Finpartition a) {parts : Finset α}
  (subset : parts ⊆ P.parts) (sup_parts : parts.sup id = b), (P.ofSubset subset sup_parts).parts = parts

theorem Finpartition.sum_ofSubset_eq_sum E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a b : α} (P : Finpartition a) {parts : Finset α}
  (subset : parts ⊆ P.parts) (sup_parts : parts.sup id = b) {X : Type u_2} [inst_2 : AddCommMonoid X] (f : α → X),
  (∀ p ∈ P.parts, p ∉ parts → f p = 0) → ∑ p ∈ (P.ofSubset subset sup_parts).parts, f p = ∑ p ∈ P.parts, f p

def Finpartition.copy E1 #

{α : Type u_1} → [inst : Lattice α] → [inst_1 : OrderBot α] → {a b : α} → Finpartition a → a = b → Finpartition b

Changes the type of a finpartition to an equal one.

theorem Finpartition.copy_parts E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a b : α} (P : Finpartition a) (h : a = b),
  (P.copy h).parts = P.parts

def Finpartition.map E1 #

{α : Type u_1} →
  [inst : Lattice α] →
    [inst_1 : OrderBot α] →
      {β : Type u_2} →
        [inst_2 : Lattice β] → [inst_3 : OrderBot β] → {a : α} → (e : α ≃o β) → Finpartition a → Finpartition (e a)

Transfer a finpartition over an order isomorphism.

theorem Finpartition.parts_map E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {β : Type u_2} [inst_2 : Lattice β] [inst_3 : OrderBot β]
  {a : α} {e : α ≃o β} {P : Finpartition a}, (Finpartition.map e P).parts = Finset.map (↑e).toEmbedding P.parts

def Finpartition.empty E1 #

(α : Type u_1) → [inst : Lattice α] → [inst_1 : OrderBot α] → Finpartition ⊥

The empty finpartition.

theorem Finpartition.empty_parts E0 #

∀ (α : Type u_1) [inst : Lattice α] [inst_1 : OrderBot α], (Finpartition.empty α).parts = ∅

instance Finpartition.instInhabitedBot E0 #

(α : Type u_1) → [inst : Lattice α] → [inst_1 : OrderBot α] → Inhabited (Finpartition ⊥)

theorem Finpartition.default_eq_empty E0 #

∀ (α : Type u_1) [inst : Lattice α] [inst_1 : OrderBot α], default = Finpartition.empty α

def Finpartition.indiscrete E1 #

{α : Type u_1} → [inst : Lattice α] → [inst_1 : OrderBot α] → {a : α} → a ≠ ⊥ → Finpartition a

The finpartition in one part, aka indiscrete finpartition.

theorem Finpartition.indiscrete_parts E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (ha : a ≠ ⊥), (Finpartition.indiscrete ha).parts = {a}

theorem Finpartition.le E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (P : Finpartition a) {b : α}, b ∈ P.parts → b ≤ a

theorem Finpartition.ne_bot E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (P : Finpartition a) {b : α}, b ∈ P.parts → b ≠ ⊥

theorem Finpartition.disjoint E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (P : Finpartition a), (↑P.parts).PairwiseDisjoint id

theorem Finpartition.sup_parts_apply E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (P : Finpartition a) {β : Type u_2} {f : α → β}
  [inst_2 : SemilatticeSup β] [inst_3 : OrderBot β],
  (∀ (x y : α), f (x ⊔ y) = f x ⊔ f y) → f ⊥ = ⊥ → P.parts.sup f = f a

The sup of a sup-bot-preserving map f over the parts of a Finpartition equals f a.

theorem Finpartition.pairwiseDisjoint_apply E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (P : Finpartition a) {β : Type u_2} {f : α → β}
  [inst_2 : SemilatticeInf β] [inst_3 : OrderBot β],
  (∀ (x y : α), f (x ⊓ y) = f x ⊓ f y) → f ⊥ = ⊥ → (↑P.parts).PairwiseDisjoint f

Parts of a Finpartition are pairwise disjoint under an inf-bot-preserving map.

theorem Finpartition.parts_eq_empty_iff E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} {P : Finpartition a}, P.parts = ∅ ↔ a = ⊥

theorem Finpartition.parts_nonempty_iff E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} {P : Finpartition a}, P.parts.Nonempty ↔ a ≠ ⊥

theorem Finpartition.parts_nonempty E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} (P : Finpartition a), a ≠ ⊥ → P.parts.Nonempty

instance Finpartition.instUniqueBot E0 #

{α : Type u_1} → [inst : Lattice α] → [inst_1 : OrderBot α] → Unique (Finpartition ⊥)

instance Finpartition.instNonempty E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α}, Nonempty (Finpartition a)

abbrev IsAtom.uniqueFinpartition E1 #

{α : Type u_1} →
  [inst : Lattice α] → [inst_1 : OrderBot α] → {a : α} → {P : Finpartition a} → IsAtom a → Unique (Finpartition a)

There's a unique partition of an atom.

instance Finpartition.instFintypeOfDecidableEq E0 #

{α : Type u_1} →
  [inst : Lattice α] → [inst_1 : OrderBot α] → [Fintype α] → [DecidableEq α] → (a : α) → Fintype (Finpartition a)

instance Finpartition.instLE E0 #

{α : Type u_1} → [inst : Lattice α] → [inst_1 : OrderBot α] → {a : α} → LE (Finpartition a)

We say that P ≤ Q if P refines Q: each part of P is less than some part of Q.

instance Finpartition.instPartialOrder E0 #

{α : Type u_1} → [inst : Lattice α] → [inst_1 : OrderBot α] → {a : α} → PartialOrder (Finpartition a)

instance Finpartition.instOrderTopOfDecidableEqBot E0 #

{α : Type u_1} → [inst : Lattice α] → [inst_1 : OrderBot α] → {a : α} → [Decidable (a = ⊥)] → OrderTop (Finpartition a)

theorem Finpartition.parts_top_subset E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] (a : α) [inst_2 : Decidable (a = ⊥)], ⊤.parts ⊆ {a}

theorem Finpartition.parts_top_subsingleton E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] (a : α) [inst_2 : Decidable (a = ⊥)], (↑⊤.parts).Subsingleton

instance Finpartition.instFintypeFinset E0 #

{α : Type u_1} → [inst : DecidableEq α] → {s : Finset α} → Fintype (Finpartition s)

theorem Finpartition.exists_le_of_le E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a b : α} {P Q : Finpartition a},
  P ≤ Q → b ∈ Q.parts → ∃ c ∈ P.parts, c ≤ b

theorem Finpartition.card_mono E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {a : α} {P Q : Finpartition a},
  P ≤ Q → Q.parts.card ≤ P.parts.card

def Finpartition.toSubtype E1 #

{α : Type u_1} →
  [inst : Lattice α] →
    [inst_1 : OrderBot α] →
      {s : α} →
        (P : Finpartition s) →
          {Pr : α → Prop} →
            (Prsup : ∀ ⦃s t : α⦄, Pr s → Pr t → Pr (s ⊔ t)) →
              (Prinf : ∀ ⦃s t : α⦄, Pr s → Pr t → Pr (s ⊓ t)) →
                (Prbot : Pr ⊥) → (hs : Pr s) → (∀ p ∈ P.parts, Pr p) → Finpartition ⟨s, hs⟩

A Finpartition constructor in Subtype Pr for Pr : Set X → Prop such that Pr is closed under intersection and union and Pr ⊥ holds from a P : Finpartition s with explicit assumptions that Pr s and Pr p for each part p.

theorem Finpartition.mem_toSubtype_iff E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {s : α} (P : Finpartition s) {Pr : α → Prop}
  (Prsup : ∀ ⦃s t : α⦄, Pr s → Pr t → Pr (s ⊔ t)) (Prinf : ∀ ⦃s t : α⦄, Pr s → Pr t → Pr (s ⊓ t)) (Prbot : Pr ⊥)
  (hs : Pr s) (hP : ∀ p ∈ P.parts, Pr p) (p : Subtype Pr),
  p ∈ (P.toSubtype Prsup Prinf Prbot hs hP).parts ↔ ↑p ∈ P.parts

theorem Finpartition.sum_eq_sum_finpartition_subtype E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] {s : α} (P : Finpartition s) {Pr : α → Prop}
  (Prsup : ∀ ⦃s t : α⦄, Pr s → Pr t → Pr (s ⊔ t)) (Prinf : ∀ ⦃s t : α⦄, Pr s → Pr t → Pr (s ⊓ t)) (Prbot : Pr ⊥)
  (hs : Pr s) (hP : ∀ p ∈ P.parts, Pr p) {X : Type u_2} [inst_2 : AddCommMonoid X] (f : α → X),
  ∑ p ∈ P.parts, f p = ∑ p ∈ (P.toSubtype Prsup Prinf Prbot hs hP).parts, f ↑p

instance Finpartition.instMin E0 #

{α : Type u_1} → [inst : DistribLattice α] → [inst_1 : OrderBot α] → [DecidableEq α] → {a : α} → Min (Finpartition a)

theorem Finpartition.parts_inf E0 #

∀ {α : Type u_1} [inst : DistribLattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a : α}
  (P Q : Finpartition a), (P ⊓ Q).parts = (Finset.image (fun bc ↦ bc.1 ⊓ bc.2) (P.parts ×ˢ Q.parts)).erase ⊥

instance Finpartition.instSemilatticeInf E0 #

{α : Type u_1} →
  [inst : DistribLattice α] → [inst_1 : OrderBot α] → [DecidableEq α] → {a : α} → SemilatticeInf (Finpartition a)

def Finpartition.restrict E1 #

{α : Type u_1} →
  [inst : DistribLattice α] →
    [inst_1 : OrderBot α] → [DecidableEq α] → {a b : α} → Finpartition a → b ≤ a → Finpartition b

Restrict a partition of a to b where b ≤ a by intersecting each part with b.

theorem Finpartition.parts_restrict E0 #

∀ {α : Type u_1} [inst : DistribLattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a b : α} (P : Finpartition a)
  (hb : b ≤ a), (P.restrict hb).parts = (Finset.image (fun x ↦ x ⊓ b) P.parts).erase ⊥

theorem Finpartition.restrict_mono E1 #

∀ {α : Type u_1} [inst : DistribLattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a b : α}
  {P Q : Finpartition a} (hb : b ≤ a), P ≤ Q → P.restrict hb ≤ Q.restrict hb

theorem Finpartition.restrict_top E0 #

∀ {α : Type u_1} [inst : DistribLattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a b : α} (hb : b ≤ a),
  ⊤.restrict hb = ⊤

theorem Finpartition.restrict_inf E1 #

∀ {α : Type u_1} [inst : DistribLattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a b : α}
  (P Q : Finpartition a) (hb : b ≤ a), (P ⊓ Q).restrict hb = P.restrict hb ⊓ Q.restrict hb

theorem Finpartition.sum_restrict E1 #

∀ {α : Type u_1} [inst : DistribLattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] {a b : α} (P : Finpartition a)
  (hb : b ≤ a) {M : Type u_2} [inst_3 : AddCommMonoid M] (f : α → M),
  f ⊥ = 0 → ∑ p ∈ (P.restrict hb).parts, f p = ∑ q ∈ P.parts, f (q ⊓ b)

The sum of a set-valued function over restricted partition parts equals the sum over original parts with f (· ⊓ b), provided f ⊥ = 0 (so bottom terms don't contribute).

theorem Finpartition.ofPairwiseDisjoint_parts E0 #

∀ {α : Type u_1} [inst : DistribLattice α] [inst_1 : OrderBot α] [inst_2 : DecidableEq α] (parts : Finset α)
  (hdisjoint : (↑parts).PairwiseDisjoint id), (Finpartition.ofPairwiseDisjoint parts hdisjoint).parts = parts.erase ⊥

def Finpartition.combine E1 #

{α : Type u_1} →
  [inst : Lattice α] →
    [inst_1 : OrderBot α] →
      [IsModularLattice α] →
        [DecidableEq α] →
          {ι : Type u_2} →
            {I : Finset ι} → {a : ι → α} → ((i : ι) → Finpartition (a i)) → I.SupIndep a → Finpartition (I.sup a)

Combine a family of partitions of pairwise disjoint elements into a partition of their sup.

theorem Finpartition.combine_parts E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α]
  {ι : Type u_2} {I : Finset ι} {a : ι → α} (P : (i : ι) → Finpartition (a i)) (ha : I.SupIndep a),
  (Finpartition.combine P ha).parts = I.biUnion fun i ↦ (P i).parts

theorem Finpartition.sum_combine E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α]
  {ι : Type u_2} {I : Finset ι} {s : ι → α} (P : (i : ι) → Finpartition (s i)) (ha : I.SupIndep s) {M : Type u_3}
  [inst_4 : AddCommMonoid M] (f : α → M), ∑ p ∈ (Finpartition.combine P ha).parts, f p = ∑ i ∈ I, ∑ p ∈ (P i).parts, f p

The sum of a set-valued function over a combined partition equals the sum of sums over component partitions.

def Finpartition.bind E1 #

{α : Type u_1} →
  [inst : Lattice α] →
    [inst_1 : OrderBot α] →
      [IsModularLattice α] →
        [DecidableEq α] → {a : α} → (P : Finpartition a) → ((i : α) → i ∈ P.parts → Finpartition i) → Finpartition a

Given a finpartition P of a and finpartitions of each part of P, this yields the finpartition of a obtained by juxtaposing all the subpartitions.

theorem Finpartition.bind_parts E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α] {a : α}
  (P : Finpartition a) (Q : (i : α) → i ∈ P.parts → Finpartition i),
  (P.bind Q).parts = P.parts.attach.biUnion fun i ↦ (Q ↑i ⋯).parts

theorem Finpartition.mem_bind E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α]
  {a b : α} {P : Finpartition a} {Q : (i : α) → i ∈ P.parts → Finpartition i},
  b ∈ (P.bind Q).parts ↔ ∃ A, ∃ (hA : A ∈ P.parts), b ∈ (Q A hA).parts

theorem Finpartition.card_bind E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α] {a : α}
  {P : Finpartition a} (Q : (i : α) → i ∈ P.parts → Finpartition i),
  (P.bind Q).parts.card = ∑ A ∈ P.parts.attach, (Q ↑A ⋯).parts.card

def Finpartition.extend E1 #

{α : Type u_1} →
  [inst : Lattice α] →
    [inst_1 : OrderBot α] →
      [IsModularLattice α] →
        [DecidableEq α] → {a b c : α} → Finpartition a → b ≠ ⊥ → Disjoint a b → a ⊔ b = c → Finpartition c

Adds b to a finpartition of a to make a finpartition of a ⊔ b.

theorem Finpartition.extend_parts E0 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α]
  {a b c : α} (P : Finpartition a) (hb : b ≠ ⊥) (hab : Disjoint a b) (hc : a ⊔ b = c),
  (P.extend hb hab hc).parts = insert b P.parts

theorem Finpartition.card_extend E1 #

∀ {α : Type u_1} [inst : Lattice α] [inst_1 : OrderBot α] [inst_2 : IsModularLattice α] [inst_3 : DecidableEq α] {a : α}
  (P : Finpartition a) (b c : α) {hb : b ≠ ⊥} {hab : Disjoint a b} {hc : a ⊔ b = c},
  (P.extend hb hab hc).parts.card = P.parts.card + 1

def Finpartition.avoid E1 #

{α : Type u_1} →
  [inst : GeneralizedBooleanAlgebra α] → [DecidableEq α] → {a : α} → Finpartition a → (b : α) → Finpartition (a \ b)

Restricts a finpartition to avoid a given element.

theorem Finpartition.avoid_parts_val E0 #

∀ {α : Type u_1} [inst : GeneralizedBooleanAlgebra α] [inst_1 : DecidableEq α] {a : α} (P : Finpartition a) (b : α),
  (P.avoid b).parts.val = (Multiset.map (fun x ↦ x \ b) P.parts.val).dedup.erase ⊥

theorem Finpartition.mem_avoid E0 #

∀ {α : Type u_1} [inst : GeneralizedBooleanAlgebra α] [inst_1 : DecidableEq α] {a b c : α} (P : Finpartition a),
  c ∈ (P.avoid b).parts ↔ ∃ d ∈ P.parts, ¬d ≤ b ∧ d \ b = c

def Finpartition.extendOfLE E1 #

{α : Type u_1} →
  [inst : GeneralizedBooleanAlgebra α] → [DecidableEq α] → {a b : α} → Finpartition a → a ≤ b → Finpartition b

Extend a partition of a to a partition of b when a ≤ b, by adding b \ a as a part.

theorem Finpartition.parts_extendOfLE_of_eq E0 #

∀ {α : Type u_1} [inst : GeneralizedBooleanAlgebra α] [inst_1 : DecidableEq α] {a b : α} (P : Finpartition a)
  (hab : a = b), (P.extendOfLE ⋯).parts = P.parts

theorem Finpartition.parts_extendOfLE_of_lt E1 #

∀ {α : Type u_1} [inst : GeneralizedBooleanAlgebra α] [inst_1 : DecidableEq α] {a b : α} (P : Finpartition a)
  (hab : a < b), (P.extendOfLE ⋯).parts = insert (b \ a) P.parts

theorem Finpartition.parts_subset_extendOfLE E1 #

∀ {α : Type u_1} [inst : GeneralizedBooleanAlgebra α] [inst_1 : DecidableEq α] {a b : α} (P : Finpartition a)
  (hab : a ≤ b), P.parts ⊆ (P.extendOfLE hab).parts

theorem Finpartition.mem_parts_or_eq_sdiff_of_mem_extendOfLE E0 #

∀ {α : Type u_1} [inst : GeneralizedBooleanAlgebra α] [inst_1 : DecidableEq α] {a b : α} (P : Finpartition a)
  (hab : a ≤ b) {p : α}, p ∈ (P.extendOfLE hab).parts → p ∈ P.parts ∨ p = b \ a

theorem Finpartition.subset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : Finset α}, a ∈ P.parts → a ⊆ s

theorem Finpartition.nonempty_of_mem_parts E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : Finset α}, a ∈ P.parts → a.Nonempty

theorem Finpartition.empty_notMem_parts E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s), ∅ ∉ P.parts

theorem Finpartition.ne_empty E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α} (P : Finpartition s), t ∈ P.parts → t ≠ ∅

theorem Finpartition.exists_mem E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : α}, a ∈ s → ∃ t ∈ P.parts, a ∈ t

theorem Finpartition.biUnion_parts E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s), P.parts.biUnion id = s

theorem Finpartition.existsUnique_mem E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : α}, a ∈ s → ∃! t, t ∈ P.parts ∧ a ∈ t

def Finpartition.ofExistsUnique E1 #

{α : Type u_1} →
  [inst : DecidableEq α] →
    {s : Finset α} →
      (parts : Finset (Finset α)) →
        (∀ p ∈ parts, p ⊆ s) → (∀ a ∈ s, ∃! t, t ∈ parts ∧ a ∈ t) → ∅ ∉ parts → Finpartition s

Construct a Finpartition s from a finset of finsets parts such that each element of s is in exactly one member of parts. This provides a converse to Finpartition.subset, Finpartition.not_empty_mem_parts and Finpartition.existsUnique_mem.

theorem Finpartition.ofExistsUnique_parts E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (parts : Finset (Finset α)) (h : ∀ p ∈ parts, p ⊆ s)
  (h' : ∀ a ∈ s, ∃! t, t ∈ parts ∧ a ∈ t) (h'' : ∅ ∉ parts), (Finpartition.ofExistsUnique parts h h' h'').parts = parts

def Finpartition.part E1 #

{α : Type u_1} → [inst : DecidableEq α] → {s : Finset α} → Finpartition s → α → Finset α

The part of the finpartition that a lies in.

theorem Finpartition.part_mem E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : α}, P.part a ∈ P.parts ↔ a ∈ s

theorem Finpartition.part_eq_empty E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : α}, P.part a = ∅ ↔ a ∉ s

theorem Finpartition.part_nonempty E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : α}, (P.part a).Nonempty ↔ a ∈ s

theorem Finpartition.part_subset E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) (a : α), P.part a ⊆ s

theorem Finpartition.mem_part_self E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : α}, a ∈ P.part a ↔ a ∈ s

theorem Finpartition.mem_part E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a : α}, a ∈ s → a ∈ P.part a

Alias of the reverse direction of Finpartition.mem_part_self.

theorem Finpartition.part_eq_iff_mem E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α} (P : Finpartition s) {a : α},
  t ∈ P.parts → (P.part a = t ↔ a ∈ t)

theorem Finpartition.part_eq_of_mem E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α} (P : Finpartition s) {a : α},
  t ∈ P.parts → a ∈ t → P.part a = t

theorem Finpartition.mem_part_iff_part_eq_part E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a b : α},
  a ∈ s → b ∈ s → (a ∈ P.part b ↔ P.part a = P.part b)

theorem Finpartition.part_surjOn E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s), Set.SurjOn P.part ↑s ↑P.parts

theorem Finpartition.exists_subset_part_bijOn E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s), ∃ r ⊆ s, Set.BijOn P.part ↑r ↑P.parts

theorem Finpartition.mem_part_iff_exists E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s) {a b : α},
  a ∈ P.part b ↔ ∃ p ∈ P.parts, a ∈ p ∧ b ∈ p

def Finpartition.equivSigmaParts E1 #

{α : Type u_1} → [inst : DecidableEq α] → {s : Finset α} → (P : Finpartition s) → ↥s ≃ (t : ↥P.parts) × ↥↑t

Equivalence between a finpartition's parts as a dependent sum and the partitioned set.

theorem Finpartition.exists_enumeration E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s),
  ∃ f, ∀ (a b : ↥s), P.part ↑a = P.part ↑b ↔ (f a).fst = (f b).fst

theorem Finpartition.sum_card_parts E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s), ∑ i ∈ P.parts, i.card = s.card

instance Finpartition.instBotFinset E0 #

{α : Type u_1} → [inst : DecidableEq α] → (s : Finset α) → Bot (Finpartition s)

⊥ is the partition in singletons, aka discrete partition.

theorem Finpartition.parts_bot E0 #

∀ {α : Type u_1} [inst : DecidableEq α] (s : Finset α), ⊥.parts = Finset.map { toFun := singleton, inj' := ⋯ } s

theorem Finpartition.card_bot E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s : Finset α), ⊥.parts.card = s.card

theorem Finpartition.mem_bot_iff E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α}, t ∈ ⊥.parts ↔ ∃ a ∈ s, {a} = t

instance Finpartition.instOrderBotFinset E0 #

{α : Type u_1} → [inst : DecidableEq α] → (s : Finset α) → OrderBot (Finpartition s)

theorem Finpartition.card_parts_le_card E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s), P.parts.card ≤ s.card

theorem Finpartition.card_mod_card_parts_le E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} (P : Finpartition s), s.card % P.parts.card ≤ P.parts.card

def Finpartition.ofSetSetoid E1 #

{α : Type u_1} → [inst : DecidableEq α] → (s : Setoid α) → (x : Finset α) → [DecidableRel ⇑s] → Finpartition x

A setoid over a finite type induces a finpartition of the type's elements, where the parts are the setoid's equivalence classes.

theorem Finpartition.ofSetSetoid_parts E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s : Setoid α) (x : Finset α) [inst_1 : DecidableRel ⇑s],
  (Finpartition.ofSetSetoid s x).parts = Finset.image (fun a ↦ {b ∈ x | s a b}) x

theorem Finpartition.mem_part_ofSetSetoid_iff_rel E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {a : α} {s : Setoid α} (x : Finset α) [inst_1 : DecidableRel ⇑s] {b : α},
  b ∈ (Finpartition.ofSetSetoid s x).part a ↔ a ∈ x ∧ b ∈ x ∧ s a b

def Finpartition.ofSetoid E1 #

{α : Type u_1} →
  [inst : DecidableEq α] → [inst_1 : Fintype α] → (s : Setoid α) → [DecidableRel ⇑s] → Finpartition Finset.univ

A setoid over a finite type induces a finpartition of the type's elements, where the parts are the setoid's equivalence classes.

theorem Finpartition.ofSetoid_parts_val E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] (s : Setoid α) [inst_2 : DecidableRel ⇑s],
  (Finpartition.ofSetoid s).parts.val = (Multiset.map (fun a ↦ {b | s a b}) Finset.univ.val).dedup

theorem Finpartition.mem_part_ofSetoid_iff_rel E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {a : α} [inst_1 : Fintype α] {s : Setoid α} [inst_2 : DecidableRel ⇑s] {b : α},
  b ∈ (Finpartition.ofSetoid s).part a ↔ s a b

def Finpartition.atomise E1 #

{α : Type u_1} → [inst : DecidableEq α] → (s : Finset α) → Finset (Finset α) → Finpartition s

Cuts s along the finsets in F: Two elements of s will be in the same part if they are in the same finsets of F.

theorem Finpartition.mem_atomise E0 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α} {F : Finset (Finset α)},
  t ∈ (Finpartition.atomise s F).parts ↔ t.Nonempty ∧ ∃ Q ⊆ F, {i ∈ s | ∀ u ∈ F, u ∈ Q ↔ i ∈ u} = t

theorem Finpartition.atomise_empty E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α}, s.Nonempty → (Finpartition.atomise s ∅).parts = {s}

theorem Finpartition.card_atomise_le E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α} {F : Finset (Finset α)},
  (Finpartition.atomise s F).parts.card ≤ 2 ^ F.card

theorem Finpartition.biUnion_filter_atomise E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α} {F : Finset (Finset α)},
  t ∈ F → t ⊆ s → {u ∈ (Finpartition.atomise s F).parts | u ⊆ t ∧ u.Nonempty}.biUnion id = t

theorem Finpartition.card_filter_atomise_le_two_pow E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α} {F : Finset (Finset α)},
  t ∈ F → {u ∈ (Finpartition.atomise s F).parts | u ⊆ t ∧ u.Nonempty}.card ≤ 2 ^ (F.card - 1)

Deprecated aliases

NameNew nameSince
Finpartition.ofPairwiseDisjointFinpartition.ofErase2026-10-01
Finpartition.sum_ofPairwiseDisjoint_eq_sumFinset.sum_erase2026-10-01