theorem
Hex.GraphIso.Nauty.Sparse.CountSort.firstRun_spec
(lab hits : Array Nat)
(first last : Nat)
(hf : first < last)
:
The initial scan records a constant prefix and stops at its first unequal count, or exhausts the cell.
theorem
Hex.GraphIso.Nauty.Sparse.CountSort.minima_window
(lab hits : Array Nat)
(cap first last begin : Nat)
(hf : first < begin)
(he : begin ≤ last)
(hb : last ≤ lab.size)
:
Three-way insertion permutes only the selected cell and leaves ordered, bounded fragment cuts. It does not require bounds on the count values.
theorem
Hex.GraphIso.Nauty.Sparse.CountSort.minima_spec
(lab hits : Array Nat)
(cap first last begin : Nat)
(hf : first < begin)
(he : begin ≤ last)
(hb : last ≤ lab.size)
(hk : hits[lab[first]!]! < cap)
(hu : ∀ (q : Nat), first ≤ q → q < begin → hits[lab[q]!]! = hits[lab[first]!]!)
:
Three-way insertion leaves the two minimum-count runs followed by strictly larger counts. The sentinel need only exceed the initial count.