Documentation

CslibFrontier.Algorithms.WordRAM.Auction.BidStep

Single Gauss–Seidel bid step for Word-RAM auction #

Implements and verifies bidStepProg, executing one bid iteration of Bertsekas's auction algorithm (bidStep) in at most 4 * n + 6 memory operations: popping an unassigned person from stack, calling findBestProg and findSecondProg from Auction.RowScan, updating price and owner, and pushing an evicted previous owner back onto stack.

Main definitions #

Main results #

Perform one Gauss–Seidel auction bid on top of the unassigned-person stack stack[0..sp).

Every execution of bidStepProg performs at least one memory read (popping curI from stack), absorbing the outer boundedWhile control overhead via Realizes.while₀.

theorem Cslib.Algorithms.WordRAM.Auction.bidStepProg_spec {w W : ℕ} (ws : AuctionWS) {C : Fin ws.n × Fin ws.n → ℕ} {st : Lean.Assignment.AuctionState ws.n} {i₀ : Fin ws.n} {rest : List (Fin ws.n)} (hs_free : st.free = i₀ :: rest) (hε : 0 < ws.eps) (hinv : Lean.Assignment.AuctionInv (fun (e : Fin ws.n × Fin ws.n) => ↑(C e)) (↑ws.eps) st) (hp_nn : ∀ (j : Fin ws.n), 0 ≤ st.price j) (hC_le : ∀ (i j : Fin ws.n), C (i, j) ≤ W) (s₀ : DataStructure.Memory.State) (hws : ValidWS ws s₀) (ham : AuctionMem ws C st s₀) (hfit1 : WordRAM.Fits w 1) (hfit_ws : WordRAM.Fits w (ws.outBase + ws.n + 1)) (hfit_p : WordRAM.Fits w (2 * W + 2 * ws.eps)) :
have sp := st.free.length; have st' := Lean.Assignment.bidStep (fun (e : Fin ws.n × Fin ws.n) => ↑(C e)) (↑ws.eps) st; have s' := (DataStructure.Memory.spec 0).clientState s₀ (bidStepProg (ws, sp)); BidStepSafe w (ws, sp) s₀ ∧ (DataStructure.Memory.spec w).ValidHistory s₀ ((DataStructure.Memory.spec w).clientHistory s₀ (bidStepProg (ws, sp))) ∧ WordRAM.Realization.memoryCost (bidStepProg (ws, sp)) s₀ ≤ 4 * ws.n + 6 ∧ s'.frontier = s₀.frontier ∧ (DataStructure.Memory.spec 0).clientResult s₀ (bidStepProg (ws, sp)) = st'.free.length ∧ AuctionMem ws C st' s'

Single-step simulation of bidStepProg against bidStep: maintains AuctionMem, keeps frontier unchanged, returns st'.free.length, and uses at most 4 * ws.n + 6 memory ops.