Vector.get agrees with element access. The Lean standard library
states its Vector lemmas about getElem rather than about
Vector.get, so uses of the onto field rewrite with this equation
first.
Checked construction: accepts exactly the colour vectors using every colour.
Equations
Instances For
The constant zero colouring: the one-cell colouring of a nonempty vertex set.
Equations
- Hex.GraphIso.Coloring.trivial n h = { cells := Hex.Vector.ofFn' fun (x : Fin n) => 0, onto := ⋯ }
Instances For
The colouring i ↦ i % k, onto whenever k ≤ n.
Equations
- Hex.GraphIso.Coloring.mod n k hk hkn = { cells := Hex.Vector.ofFn' fun (i : Fin n) => ⟨↑i % k, ⋯⟩, onto := ⋯ }
Instances For
The number of vertices with each colour.
Equations
- c.cellSizes = Hex.Vector.ofFn' fun (j : Fin k) => (List.filter (fun (i : Fin n) => c.cells[i] == j) (List.finRange n)).length
Instances For
Relabel a coloured graph by a labelling l: new vertex i is old
vertex l[i], so (relabel G l).graph.adj i j = G.graph.adj l[i] l[j] and
(relabel G l).coloring.cells[i] = G.coloring.cells[l[i]].
Equations
Instances For
The one-cell coloured graph of a bare graph: every vertex takes the
single colour zero, so a coloured isomorphism is exactly a graph
isomorphism. n = 0 would force k = 0, so this is defined for
positive n.
Equations
- G.singleColor h = { graph := G, coloring := Hex.GraphIso.Coloring.trivial n h }
Instances For
Equations
Instances For
A coloured graph whose colour classes are contiguous in vertex order: the first cell occupies the least vertices, and so on. Every canonical form satisfies this.
Equations
Instances For
Executable check for ColorSorted, a plain Boolean fold so the kernel
replays it without unfolding quantifier instances.
Equations
Instances For
Equations
- Hex.GraphIso.instDecidableColorSorted K = if h : Hex.GraphIso.colorSortedCheck K = true then isTrue ⋯ else isFalse ⋯