def
Hex.GraphIso.Mathlib.Sparse.encode
{V : Type u}
[Fintype V]
{n k : ℕ}
(e : V ≃ Fin n)
(G : Colored V k)
[DecidableRel G.graph.Adj]
:
Sparse.Colored n k
Encode a Mathlib graph directly into sorted sparse rows. A general adjacency oracle requires testing vertex pairs, but no dense matrix is allocated. Each ordered colour is retained without renumbering.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
Hex.GraphIso.Mathlib.Sparse.toDense_encode
{V : Type u}
[Fintype V]
{n k : ℕ}
(e : V ≃ Fin n)
(G : Colored V k)
[DecidableRel G.graph.Adj]
:
The two encodings have identical adjacency and ordered colours.
This theorem is a proof bridge; sparse execution does not use toDense.
def
Hex.GraphIso.Mathlib.Sparse.isoOfIsIso
{V : Type u}
{W : Type v}
[Fintype V]
[Fintype W]
{n k : ℕ}
{G : Colored V k}
{H : Colored W k}
[DecidableRel G.graph.Adj]
[DecidableRel H.graph.Adj]
(eV : V ≃ Fin n)
(eW : W ≃ Fin n)
{p : Perm n}
(h : Sparse.IsIso (encode eV G) (encode eW H) p)
:
G.Iso H
Decode a verified native sparse transporter as a Mathlib isomorphism.
Equations
- Hex.GraphIso.Mathlib.Sparse.isoOfIsIso eV eW h = Hex.GraphIso.Mathlib.isoOfIsIso eV eW ⋯
Instances For
theorem
Hex.GraphIso.Mathlib.Sparse.isIso_of_iso
{V : Type u}
{W : Type v}
[Fintype V]
[Fintype W]
{n k : ℕ}
{G : Colored V k}
{H : Colored W k}
[DecidableRel G.graph.Adj]
[DecidableRel H.graph.Adj]
(eV : V ≃ Fin n)
(eW : W ≃ Fin n)
(h : G.Iso H)
:
Sparse.IsIso (encode eV G) (encode eW H) (Perm.ofEquiv (eV.symm.trans (h.graphIso.trans eW)))