Recover and publish the primal LP solution over ordered fields
ProvedSmaleNinth.primal_readout_ordered_fieldStarting with the retained LP input, a stored slack witness, and valid caller headers, the published final-primal RAM fragment prepares the augmented system, performs the final ordered-field elimination, and exposes the precise feasible point and primal tags. The same instruction clock as in the original implementation applies. The result covers arbitrary real LP coefficients.
Preamble
import Definitions.Def_OAILP_Recovery_FinalPrimalCode import Definitions.Def_OAILP_Recovery_SlackRAM open Matrix OAI.Optimization.LinearProgramming open OAI.Optimization.LinearProgramming.RAM OAI.Optimization.LinearProgramming.RAM.Callable open OAI.Optimization.LinearProgramming.Recovery
Formal statement
theorem SmaleNinth.primal_readout_ordered_field {K : Type} [Field K] [LinearOrder K]
[IsStrictOrderedRing K] {m d : ℕ} (A : Matrix (Fin m) (Fin d) K) (b : Fin m → K)
(w : Fin (m+1) → K) (native caller : Memory K) (raw atW cap limit : ℕ)
(hp : 0 < m) (hd : 0 < d) (foot : Footprint (cap-1) (native.atPC 0))
(two : 2 ≤ cap) (space : (d+1)*m ≤ cap)
(stored : SlackRAM.InputAt caller raw A b) (values : ∀ j : Fin (m+1), caller.data (atW+j.val) = w j)
(high : 7 ≤ raw) (sep : raw+(m*d+m) ≤ atW) (bound : ∀ j, caller.index j ≤ limit)
(a : caller.index 24 = raw) (r : caller.index 28 = m) (c : caller.index 29 = d)
(hcap : caller.index 60 = cap) (v : caller.index 212 = atW)
(x : Fin d → K) (answer : Elimination.solve A (b-Fin.tail w) = some x) :
∃ z, PrimalOutput.program.Run (fun _ : K => True) (Odd.memory native caller)
(PrimalOutput.programTime m d cap limit) z ∧
(∀ j : Fin d, z.data j.val = x j) ∧ z.index 16 = 0 ∧ z.index 17 = 0 := by sorrySource