The discrete partition, including the empty partition in degree zero.
Equations
- Hex.PermGroup.Partition.discrete n = { labels := Hex.Vector.ofFn' id, least := ⋯, idem := ⋯ }
Instances For
The single-block partition; in degree zero there are no blocks.
Equations
- Hex.PermGroup.Partition.indiscrete n = { labels := Hex.Vector.ofFn' fun (x : Fin n) => ⟨0, ⋯⟩, least := ⋯, idem := ⋯ }
Instances For
@[simp]
def
Hex.PermGroup.Partition.mergeRoots
{n : Nat}
(p : Partition n)
(a b : Fin n)
(ha : p.labels[↑a] = a)
(_hb : p.labels[↑b] = b)
(hab : a ≤ b)
:
Quick-find union: redirect one root and all its points to a smaller root. The direct label array keeps each find constant-time and each union linear.
Equations
Instances For
Merge the two blocks, preserving canonical least-point labels.
Equations
Instances For
theorem
Hex.PermGroup.Partition.merge_least
{n : Nat}
(p : Partition n)
(x y : Fin n)
{R : Fin n → Fin n → Prop}
(hR : Equivalence R)
(hp : p.Refines R)
(h : R x y)
:
Union introduces exactly the equivalences forced by the old blocks and the requested pair, for any target equivalence relation.