Partitions #
A Partition of an element a in a complete lattice is an independent family of nontrivial
elements whose supremum is a.
An important special case is where s : Set α, where a Partition s corresponds to a partition
of the elements of s into a family of nonempty sets.
This is equivalent to a transitive and symmetric binary relation r : α → α → Prop
where s is the set of all x for which r x x.
Partitions are ordered by refinement: P ≤ Q if every part of P is less than or equal to a part
of Q.
Main declarations #
Partition s: For[CompleteLattice α]ands : α, aPartition sis an independent collection of nontrivial elements whose supremum iss.Partition.removeBot: A constructor forPartition sthat removes⊥from a set of parts.Partition.instOrderTop:Partition shas a top element, consisting of justsifs ≠ ⊥or nothing otherwise.Partition.instSemilatticeInf:Partition shas finite meetsP ⊓ Qwhenαis a frame, given by the collection of all non-bottom infimap ⊓ qof parts of the two partitions.Partition.Rel: The partial equivalence relation induced by a partition of a set.Partition.IsRepFun: A predicate characterizing a representative function for a partition.
Representative functions (IsRepFun) #
IsRepFun P f means that f sends each element of the support to a representative in its
Partition.Rel-class, agrees on related elements, and is the identity outside the support.
This is useful whenever a construction must pick one distinguished element per part of a partition. For example, in graph theory one may partition edges into parallel classes or vertices into connected components; a representative function can specify which edge remains when simplifying parallel edges, or how supervertices are labeled after contraction. Similar uses arise in matroid theory and in the definition of minors.
Tempting alternatives are to use Classical.choice or fix a global well-order and take minimal
representatives. However, these lead to issues with inconsistencies: independent choices need not
respect relations between different instances (e.g. monotonicity of simplifications with respect
to subgraph order), a global order can clash with structure already carried by the type, and maps
between different types need not intertwine two separate canonical choices. Stating hypotheses with
IsRepFun keeps the chosen representatives explicit; existence under suitable conditions can be
proved separately.
TODO #
- Link this to
Finpartition. - Show that when
αis a framePartition αalso has finite joins, i.e. that it is a lattice.
A Partition of an element s of a CompleteLattice is a collection of
independent nontrivial elements whose supremum is s.
- parts : Set α
The collection of parts
- sSupIndep' : _root_.sSupIndep self.parts
The parts are
sSupIndep. The bottom element is not a part.
The supremum of all parts is
s.
Instances For
Equations
- Partition.instSetLike = { coe := Partition.parts, coe_injective' := ⋯ }
The natural equivalence between the subtype of parts and the subtype of parts of a copy.
Equations
- P.partscopyEquiv hst = Equiv.setCongr ⋯
Instances For
A constructor for Partition s that removes ⊥ from the set of parts.
Equations
Instances For
There is a unique partition of ⊥.
Equations
- Partition.instUniqueBot = { default := Partition.removeBot ∅ ⋯ ⋯, uniq := ⋯ }
Partitions on s are ordered by refinement: P ≤ Q if every part of P is contained in a part
of Q.
The top partition of s is the partition with the single part s, or no parts if s is the
bottom element.
Equations
- Partition.instOrderTop = { top := Partition.removeBot {s} ⋯ ⋯, le_top := ⋯ }
When α is a frame, the meet P ⊓ Q of two partitions is the partition consisting of all
non-bottom meets p ⊓ q for p ∈ P and q ∈ Q.
Note that while finite meets of partitions can be constructed in this way, arbitrary meets generally
do not exist: for example when α is the frame of open subsets of the Cantor space, Partition α
has no bottom element.
Equations
- One or more equations did not get rendered due to their size.
Induced relation #
Every partition of s : Set α induces a transitive, symmetric binary relation on α
whose equivalence classes are the parts of P. The relation is irreflexive outside s.
Instances For
Representative functions #
See the module docstring for motivation (graph simplification, minors, and why we use an explicit
IsRepFun hypothesis rather than a global choice of representatives).
A predicate characterizing when a function f : α → α is a representative function for a
partition P. A representative function maps each element to a canonical representative in its
equivalence class, is the identity outside the support, and maps related elements to the same
representative.
- apply_of_notMem ⦃a : α⦄ : a ∉ u → f a = a
The function is the identity outside the support.
The function maps each element in the support to a related element.
The function maps related elements to the same representative.
Instances For
Any partially defined representative function extends to a complete one.