Documentation

HexGraphIso.Nauty.Invariant.Singleton

theorem Hex.GraphIso.Nauty.breakout_at_target {n : Nat} {lab ptn : Array Nat} {level tc o : Nat} (hinj : LabInj lab lab.size) (hto : tc + o < lab.size) :
(breakout n lab ptn (level + 1) tc lab[tc + o]!).fst[tc]! = lab[tc + o]!

Individualizing offset o puts that offset's vertex at the target position.

theorem Hex.GraphIso.Nauty.isCell_breakout_target {n : Nat} {lab ptn : Array Nat} {level tc tv : Nat} (hlt : tc < ptn.size) (hstart : tc = 0 ∨ ptn[tc - 1]! ≤ level) :
IsCell (breakout n lab ptn (level + 1) tc tv).snd.fst (level + 1) tc 1

Individualizing closes the target position, so it becomes a singleton cell one level down. This is what makes the transport below apply from the child onwards.

theorem Hex.GraphIso.Nauty.refine_fixes_singleton {n : Nat} {ctx : Ctx n} {level : Nat} {lab ptn : Array Nat} {active : VSet n} {numcells a : Nat} (hnn : n ≤ ptn.size) (hs : lab.size = ptn.size) (hend : ptn[ptn.size - 1]! ≤ level) (hc : IsCell ptn level a 1) :
(refine ctx level lab ptn active numcells).lab[a]! = lab[a]!

refine leaves a singleton cell's position exactly where it was: it permutes cell contents, and a singleton cell has only one.

theorem Hex.GraphIso.Nauty.singleton_outside_cell {ptn : Array Nat} {level a tc len o : Nat} (hca : IsCell ptn level a 1) (hct : IsCell ptn level tc len) (hne : a ≠ tc) (ho : o < len) :
a < tc ∨ tc + o < a

A singleton cell lies outside any other cell, so outside the window a breakout at that other cell rotates.

theorem Hex.GraphIso.Nauty.breakout_misses_singleton {n : Nat} {lab ptn : Array Nat} {level a tc o : Nat} (hinj : LabInj lab lab.size) (hto : tc + o < lab.size) (hout : a < tc ∨ tc + o < a) :
(breakout n lab ptn (level + 1) tc lab[tc + o]!).fst[a]! = lab[a]!

A breakout at a different cell leaves a singleton cell's position alone. Together with refine_fixes_singleton this is the whole content of the descent's position bookkeeping, one operation at a time.

theorem Hex.GraphIso.Nauty.isCell_refine_one {n : Nat} {ctx : Ctx n} {level : Nat} {active : VSet n} {numcells a : Nat} {lab ptn : Array Nat} (hnn : n = ptn.size) (hls : lab.size = ptn.size) (hend : ptn[ptn.size - 1]! ≤ level) (hc : IsCell ptn level a 1) :
IsCell (refine ctx level lab ptn active numcells).ptn level a 1

Refinement preserves an existing singleton cell.

theorem Hex.GraphIso.Nauty.isCell_set_miss {ptn : Array Nat} {level a tc len : Nat} (ha : IsCell ptn level a 1) (ht : IsCell ptn level tc len) (hlen : 2 ≤ len) :
IsCell (ptn.set! tc (level + 1)) (level + 1) a 1

Splitting a different non-singleton cell preserves a singleton.