FindOutPaths in word-RAM code
ProvedDirKECC1549.Asm.fopP_specFrom a valid context with zero visited flags, the seed , excluded vertex , block size and block count in the global cells, fopP runs FindOutPaths on flipEdges B F: it stores up to candidate trails from (simple, of length at most ) satisfying the guarantee FopOut, restores zero visited flags, keeps the cells KeepFo, and takes at most ticks, where every vertex has at most flipped out-entries.
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_L1Fop5
set_option autoImplicit false
open WordRAM Classical Finset
open DirKECC1549.Main DirKECC1549.Main.CostAux
open DirKECC1549 DirKECC1549.Asm
variable {w : Width} {n m : ℕ}theorem DirKECC1549.Asm.fopP_spec (E : Env) (mm orig : Memory w) (hm : 0 < m) (P : LP) (B : Fin m → Fin n × Fin n)
(perm : Equiv.Perm (Fin m)) (F : Finset (Fin m)) (v s : Fin n) (pe0 : Fin n → Fin m) (D nb j SA : ℕ)
(hC : LsC P orig mm B perm F) (hZ : VisZero n P mm)
(hA : AdjOK (flipEdges B F) (adjOf B perm F (inL hm (fun x => its B x) P.CF P.IN mm))) (hsv : s ≠ v)
(h29 : (mm (P.SV + 29)).toNat = v) (h30 : (mm (P.SV + 30)).toNat = s) (h35 : (mm (P.SV + 35)).toNat = D)
(h36 : (mm (P.SV + 36)).toNat = nb) (h37 : (mm (P.SV + 37)).toNat = n + 1) (h39 : (mm (P.SV + 39)).toNat = SA)
(hDpos : 1 ≤ D) (hnb : 1 ≤ nb) (hSA : P.IP + m ≤ SA)
(hw : 2 * SA + nb * (n + 1) + nb * D + n + 100 < 2 ^ w.bits) (c0 : ℕ) (hF0 : ∀ x, cntF B perm F x 0 ≤ c0) :
Run E fopP mm (fun t mm' => LsC P orig mm' B perm F ∧ VisZero n P mm' ∧
(∀ a, KeepFo P m SA (nb * (n + 1)) a → mm' a = mm a) ∧
FopOut P (flipEdges B F) v s D nb j SA mm' ∧
t ≤ 50 * (c0 * (nb * D + 1)) + nb * (9 * (nb * D) + 129) + 500 * (nb * D) + 300) := by sorry