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 ofs : Finset α
made of singletons.Finpartition.bind
: Puts together the finpartitions of the parts of a finpartition into a new finpartition.Finpartition.atomise
: Makes a finpartition ofs : Finset α
by breakings
along all finsets inF : Finset (Finset α)
. Two elements ofs
belong to the same part iff they belong to the same elements ofF
.
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 #
Link Finpartition
and Setoid.isPartition
.
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?
A finite partition of a : α
is a pairwise disjoint finite set of elements whose supremum is
a
. We forbid ⊥
as a part.
- parts : Finset α
The elements of the finite partition of
a
- supIndep : Finset.SupIndep self.parts id
The partition is supremum-independent
- sup_parts : Finset.sup self.parts id = a
The supremum of the partition is
a
- not_bot_mem : ⊥ ∉ self.parts
No element of the partition is bottom
Instances For
Equations
- instDecidableEqFinpartition = decEqFinpartition✝
A Finpartition
constructor which does not insist on ⊥
not being a part.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A Finpartition
constructor from a bigger existing finpartition.
Equations
- Finpartition.ofSubset P subset sup_parts = { parts := parts, supIndep := (_ : Finset.SupIndep parts id), sup_parts := sup_parts, not_bot_mem := (_ : ⊥ ∈ parts → False) }
Instances For
Changes the type of a finpartition to an equal one.
Equations
- Finpartition.copy P h = { parts := P.parts, supIndep := (_ : Finset.SupIndep P.parts id), sup_parts := (_ : Finset.sup P.parts id = b), not_bot_mem := (_ : ⊥ ∉ P.parts) }
Instances For
The empty finpartition.
Equations
- Finpartition.empty α = { parts := ∅, supIndep := (_ : Finset.SupIndep ∅ id), sup_parts := (_ : Finset.sup ∅ id = ⊥), not_bot_mem := (_ : ⊥ ∉ ∅) }
Instances For
Equations
The finpartition in one part, aka indiscrete finpartition.
Equations
- Finpartition.indiscrete ha = { parts := {a}, supIndep := (_ : Finset.SupIndep {a} id), sup_parts := (_ : Finset.sup {a} id = id a), not_bot_mem := (_ : ⊥ ∈ {a} → False) }
Instances For
Equations
- Finpartition.instUniqueFinpartitionBotToBotToLEToPreorderToPartialOrderToSemilatticeInf = let src := inferInstance; { toInhabited := src, uniq := (_ : ∀ (P : Finpartition ⊥), P = default) }
There's a unique partition of an atom.
Equations
- IsAtom.uniqueFinpartition ha = { toInhabited := { default := Finpartition.indiscrete (_ : a ≠ ⊥) }, uniq := (_ : ∀ (P : Finpartition a), P = default) }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Refinement order #
We say that P ≤ Q
if P
refines Q
: each part of P
is less than some part of Q
.
Equations
- Finpartition.instLEFinpartition = { le := fun (P Q : Finpartition a) => ∀ ⦃b : α⦄, b ∈ P.parts → ∃ c ∈ Q.parts, b ≤ c }
Equations
- Finpartition.instPartialOrderFinpartition = let src := inferInstance; PartialOrder.mk (_ : ∀ (P Q : Finpartition a), P ≤ Q → Q ≤ P → P = Q)
Equations
- Finpartition.instOrderTopFinpartitionInstLEFinpartition = OrderTop.mk (_ : ∀ (P : Finpartition a), P ≤ ⊤)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds b
to a finpartition of a
to make a finpartition of a ⊔ b
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Restricts a finpartition to avoid a given element.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Finite partitions of finsets #
⊥
is the partition in singletons, aka discrete partition.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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
.
Equations
- One or more equations did not get rendered due to their size.