Setup stage 2 of Lemma 1
ProvedDirKECC1549.Asm.stage2_specFrom the state after stage 1, stage 2 copies the labels, clears the visited flags and flipped counts, groups the vertices by their labels and stores the number of groups (St2), within ticks.
Context. This lemma belongs to the machine-checked word-RAM implementation of Lemma 1 (p.11): Algorithm 1 refining by small -out sets, with the deterministic local search of [GKK+26, Proposition 6] (FindOutPaths and recursive path reversals). The program is written in the structured language Stmt compiled to the published word-RAM; Run E s mem Q states that the statement s, started on mem, reaches its end in a state satisfying Q t mem' within t ticks. The input cells double as registers; they are saved at SV and read through the image ImgAt. All definitions are in the Definitions.Def_DirKECC1549_Impl_* modules.
import Definitions.Def_DirKECC1549_Impl_L1Set3
set_option autoImplicit false
open WordRAM Classical Finset
open DirKECC1549 DirKECC1549.Asm
variable {w : Width}theorem DirKECC1549.Asm.stage2_spec (E : Env) (orig q : Memory w) (n m k Δ : ℕ) (h : St1 orig q n m k Δ) (hn : 1 ≤ n) (hk2 : 2 ≤ k)
(hw : 2 * (8 * (n + 2 * m + 3) + 128 + 13 * n + 2 * m + 8 + (k - 1 + 2) * (8 + (2 * (k - 1) + 1) * (n + 1))) +
8 * (n + 2 * m + 3) + n + 400 < 2 ^ w.bits) :
Run E stage2 q (fun t q' => t ≤ 80 * n + 30 ∧ St2 orig q' n m k Δ) := by sorry