theorem
Hex.GraphIso.Nauty.Sparse.Target.MapPrefix.advance
{n first last value : Nat}
{lab cache raw out : Array Nat}
{keys : List Nat}
(h : MapPrefix n lab cache keys first raw)
(hscatter : Index.Scatter n lab raw out first (last + 1) value)
(horder : first ≤ last)
(hv : ∀ (i : Nat), first ≤ i → i ≤ last → encode keys n cache[lab[i]!]! = value)
:
Installing one nontrivial cell extends the map without changing earlier vertices; the source performs exactly this scatter with its compact index.
theorem
Hex.GraphIso.Nauty.Sparse.Target.MapPrefix.set
{n i value : Nat}
{lab cache raw : Array Nat}
{keys : List Nat}
(h : MapPrefix n lab cache keys i raw)
(hi : i < n)
(hbound : ∀ (j : Nat), j < n → lab[j]! < n)
(hinj : ∀ (a b : Nat), a < n → b < n → lab[a]! = lab[b]! → a = b)
(hv : value = encode keys n cache[lab[i]!]!)
:
One executed scatter assignment extends the installed positional prefix.
theorem
Hex.GraphIso.Nauty.Sparse.Target.MapPrefix.complete
{n : Nat}
{lab cache raw : Array Nat}
{keys : List Nat}
(h : MapPrefix n lab cache keys n raw)
(l : Label n)
(hl : Label.ofArray? n lab = some l)
(v : Fin n)
:
The completed scatter agrees with the compact encoding on every vertex, using the checked label's inverse to recover its unique position.