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.ofExistsUnique: Builds a finpartition from a collection of parts such that each element is in exactly one part.Finpartition.ofSetoid: WithFintype α, constructs the finpartition ofuniv : Finset αinduced by the equivalence classes ofs : Setoid α.Finpartition.atomise: Makes a finpartition ofs : Finset αby breakingsalong all finsets inF : Finset (Finset α). Two elements ofsbelong 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 #
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.
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 The partition is supremum-independent
The supremum of the partition is
aNo element of the partition is bottom
Instances For
Alias of Finpartition.bot_notMem.
No element of the partition is bottom
A Finpartition constructor which does not insist on ⊥ not being a part.
Equations
Instances For
A Finpartition constructor from a bigger existing finpartition.
Equations
Instances For
Changes the type of a finpartition to an equal one.
Instances For
Transfer a finpartition over an order isomorphism.
Equations
- Finpartition.map e P = { parts := Finset.map (↑e).toEmbedding P.parts, supIndep := ⋯, sup_parts := ⋯, bot_notMem := ⋯ }
Instances For
The empty finpartition.
Equations
- Finpartition.empty α = { parts := ∅, supIndep := ⋯, sup_parts := ⋯, bot_notMem := ⋯ }
Instances For
Equations
- Finpartition.instInhabitedBot α = { default := Finpartition.empty α }
Equations
- Finpartition.instUniqueBot = { toInhabited := inferInstance, uniq := ⋯ }
There's a unique partition of an atom.
Equations
- ha.uniqueFinpartition = { default := Finpartition.indiscrete ⋯, uniq := ⋯ }
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.instLE = { le := fun (P Q : Finpartition a) => ∀ ⦃b : α⦄, b ∈ P.parts → ∃ c ∈ Q.parts, b ≤ c }
Equations
- Finpartition.instPartialOrder = { toLE := inferInstance, lt := fun (a_1 b : Finpartition a) => a_1 ≤ b ∧ ¬b ≤ a_1, le_refl := ⋯, le_trans := ⋯, lt_iff_le_not_ge := ⋯, le_antisymm := ⋯ }
Equations
- Finpartition.instOrderTopOfDecidableEqBot = { top := if ha : a = ⊥ then (Finpartition.empty α).copy ⋯ else Finpartition.indiscrete ha, le_top := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Finpartition.instMin = { min := fun (P Q : Finpartition a) => Finpartition.ofErase (Finset.image (fun (bc : α × α) => bc.1 ⊓ bc.2) (P.parts ×ˢ Q.parts)) ⋯ ⋯ }
Equations
- Finpartition.instSemilatticeInf = { toPartialOrder := Finpartition.instPartialOrder, inf := min, inf_le_left := ⋯, inf_le_right := ⋯, le_inf := ⋯ }
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
Instances For
Adds b to a finpartition of a to make a finpartition of a ⊔ b.
Equations
Instances For
Restricts a finpartition to avoid a given element.
Equations
- P.avoid b = Finpartition.ofErase (Finset.image (fun (x : α) => x \ b) P.parts) ⋯ ⋯
Instances For
Finite partitions of finsets #
Alias of Finpartition.empty_notMem_parts.
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.
Equations
- Finpartition.ofExistsUnique parts h h' h'' = { parts := parts, supIndep := ⋯, sup_parts := ⋯, bot_notMem := h'' }
Instances For
The part of the finpartition that a lies in.
Equations
Instances For
Alias of the reverse direction of Finpartition.mem_part_self.
Equivalence between a finpartition's parts as a dependent sum and the partitioned set.
Equations
- One or more equations did not get rendered due to their size.
Instances For
⊥ is the partition in singletons, aka discrete partition.
Equations
- Finpartition.instBotFinset s = { bot := { parts := Finset.map { toFun := singleton, inj' := ⋯ } s, supIndep := ⋯, sup_parts := ⋯, bot_notMem := ⋯ } }
Equations
- Finpartition.instOrderBotFinset s = { toBot := inferInstance, bot_le := ⋯ }
A setoid over a finite type induces a finpartition of the type's elements, where the parts are the setoid's equivalence classes.
Equations
- Finpartition.ofSetSetoid s x = { parts := Finset.image (fun (a : α) => {b ∈ x | s a b}) x, supIndep := ⋯, sup_parts := ⋯, bot_notMem := ⋯ }
Instances For
A setoid over a finite type induces a finpartition of the type's elements, where the parts are the setoid's equivalence classes.
Equations
Instances For
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
- Finpartition.atomise s F = Finpartition.ofErase (Finset.image (fun (Q : Finset (Finset α)) => {i ∈ s | ∀ t ∈ F, t ∈ Q ↔ i ∈ t}) F.powerset) ⋯ ⋯