Indexed list access built for cheap kernel reduction: one bare match
per step, no bounds proofs, no Array wrapper.
Equations
- Hex.GraphIso.atD [] x✝¹ x✝ = x✝
- Hex.GraphIso.atD (a :: tail) 0 x✝ = a
- Hex.GraphIso.atD (head :: as) i.succ x✝ = Hex.GraphIso.atD as i x✝
Instances For
The flat matrix list cut into r rows of m entries.
Equations
- Hex.GraphIso.chunkRows 0 x✝¹ x✝ = []
- Hex.GraphIso.chunkRows r.succ x✝¹ x✝ = List.take x✝¹ x✝ :: Hex.GraphIso.chunkRows r x✝¹ (List.drop x✝¹ x✝)
Instances For
def
Hex.GraphIso.Kernel.checkIso
(n : Nat)
(flatA flatB : List Bool)
(cellsA cellsB pl : List Nat)
:
Validate a forward transporter on literal data: flatA/flatB
are the flat adjacency lists, cellsA/cellsB the colour values,
and pl the transporter images, each identified with the graph it
comes from by a hypothesis of Kernel.isIso_of_checkIso.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Hex.GraphIso.Kernel.isIso_of_checkIso
{n k : Nat}
{G H : Colored n k}
{p : Perm n}
{LA LB : List Bool}
{CA CB PL : List Nat}
(hA : G.graph.adjMatrix.data.toList = LA)
(hB : H.graph.adjMatrix.data.toList = LB)
(hcA : List.map Fin.val G.coloring.cells.toList = CA)
(hcB : List.map Fin.val H.coloring.cells.toList = CB)
(hp : List.map Fin.val p.vec.toList = PL)
(hchk : checkIso n LA LB CA CB PL = true)
:
IsIso G H p
Equalities identifying the graph data with the literals, plus a literal transporter check, prove that the permutation transports. The kernel evaluates each graph once, into its literal, and the rest of the check runs on literals.
theorem
Hex.GraphIso.Kernel.isomorphic_of_checkIso
{n k : Nat}
{G H : Colored n k}
{p : Perm n}
{LA LB : List Bool}
{CA CB PL : List Nat}
(hA : G.graph.adjMatrix.data.toList = LA)
(hB : H.graph.adjMatrix.data.toList = LB)
(hcA : List.map Fin.val G.coloring.cells.toList = CA)
(hcB : List.map Fin.val H.coloring.cells.toList = CB)
(hp : List.map Fin.val p.vec.toList = PL)
(hchk : checkIso n LA LB CA CB PL = true)
:
Isomorphic G H
Equalities identifying the graph data with the literals, plus a literal transporter check, prove isomorphism.