Documentation

CslibFrontier.Algorithms.WordRAM.Arborescence.Internal.ExpandSpec

Specification for expandLevelProg (internal) #

Proves admissibility, O(n) memory cost, and exact table correspondence with expandParentsTable.

theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.expandLevelProg_spec {w n ws k : ℕ} (x0 : Fin n) (f q : Lean.Arborescence.ParentTable n) (inCycle : Vector Bool n) (bEntry bExit : Vector (Option (Fin n)) n) (s₀ : DataStructure.Memory.State) (hk : k < n) (hws : WsFits w ws n) (hf : ws + wsSize n ≤ s₀.frontier) (hrep : s₀.mem (frameRepAddr ws n k) = ↑x0) (hcur : ∀ (v : Fin n), s₀.mem (curParentBase ws n + ↑v) = ↑q[↑v]) (hfp : ∀ (v : Fin n), s₀.mem (frameParentBase ws n k + ↑v) = ↑f[↑v]) (hm : ∀ (v : Fin n), s₀.mem (frameMaskBase ws n k + ↑v) = if inCycle[↑v] = true then 1 else 0) (hbe : ∀ (v : Fin n), s₀.mem (frameBEntryBase ws n k + ↑v) = optFinIdx bEntry[↑v]) (hbx : ∀ (v : Fin n), s₀.mem (frameBExitBase ws n k + ↑v) = optFinIdx bExit[↑v]) :
have la := { n := n, ws := ws, k := k }; have s' := (DataStructure.Memory.spec 0).clientState s₀ (expandLevelProg la); have p' := Lean.Arborescence.expandParentTable f inCycle bEntry bExit x0 q; ExpandLevelSafe w la s₀ ∧ (DataStructure.Memory.spec w).ValidHistory s₀ ((DataStructure.Memory.spec w).clientHistory s₀ (expandLevelProg la)) ∧ WordRAM.Realization.memoryCost (expandLevelProg la) s₀ ≤ 7 * n + 3 ∧ s'.frontier = s₀.frontier ∧ (∀ (addr : ℕ), ¬(curParentBase ws n ≤ addr ∧ addr < nextParentBase ws n + n) → s'.mem addr = s₀.mem addr) ∧ ∀ (v : Fin n), s'.mem (curParentBase ws n + ↑v) = ↑p'[↑v]