Recover and return a normalized real LP witness using the masked decider
OpenSmaleNinth.real_witness_search_of_masked_deciderFrom the live caller context for the chosen side of the LP alternative, run the native masked queries, solve on the final allowed coordinates and return the actual normalized witness, preserving the original LP and its output headers. Works over any ordered field and exposes the exact clock and address bound.
Preamble
import Definitions.Def_OAILP_Recovery_PrincipalWitnessReady import Definitions.Def_OAILP_Recovery_PrincipalRegisters import Definitions.Def_OAILP_Recovery_WitnessCallCode import Definitions.Def_OAILP_Recovery_SupportBundleContext import Definitions.Def_OAILP_Recovery_SupportContext import Definitions.Def_OAILP_RAM_CallableWindow open Matrix OAI.Optimization.LinearProgramming open OAI.Optimization.LinearProgramming.RAM OAI.Optimization.LinearProgramming.RAM.Callable open OAI.Optimization.LinearProgramming.Recovery Principal
Formal statement
theorem SmaleNinth.real_witness_search_of_masked_decider {K : Type} [Field K] [LinearOrder K]
[IsStrictOrderedRing K] {m d h : ℕ} (A : Matrix (Fin m) (Fin d) K) (b : Fin m → K)
(M : Matrix (Fin h) (Fin (m+1)) K) (check : Program) (steps raw src cap limit : ℕ)
(native caller : Memory K) (eqs : LinearMap.ker M.mulVecLin = (side A b (ref A b).primal).denote)
(rawHigh : 256 ≤ raw) (outside : raw+(m*d+m) ≤ src)
(two : 2 ≤ cap) (wordsFit : h*(m+1)+(m+1) ≤ cap)
(old : Footprint (cap-1) (native.atPC 0))
(ctx : SupportBundle.Context M (ref A b).primal src cap caller)
(origin : SlackRAM.InputAt caller raw A b)
(i24 : caller.index 24 = raw) (i28 : caller.index 28 = m) (i29 : caller.index 29 = d)
(addr : ∀ j, caller.index j ≤ limit)
(small : ∀ S, nativeWindow check [h,m+1] (MaskedInput.bundle M S)+steps ≤ cap-1)
(solverFits : WitnessCall.numericalFootprint h (m+1) ≤ cap-1)
(works : ∀ S, ∃ k ≤ steps, ∃ tr : Fin (k+1) → State K,
Trace check (start [h,m+1] (MaskedInput.bundle M S)) k tr ∧
(tr (Fin.last k)).output = some (restriction A b (ref A b).primal S).toNat) :
let call := Fragment.stage (.invoke check 2 (Odd.sink (.index 154)))
let scan := SupportRAM.markedSearch call
let scanSteps := 4*(5*(m+1)+7)+(m*(19*cap+225+(2*steps+2)+34)+1)
let scanLimit := nextLimit scan cap limit scanSteps
let worker := scan.seq (WitnessCall.invoke.seq WitnessCall.receive)
let work := scanSteps + (WitnessCall.numericalTime h (m+1) cap + WitnessCall.receiveTime scanLimit (m+1))
∃ next out, worker.Run (fun _ : K => True) (Odd.memory native caller) work (Odd.memory next out) ∧
Footprint (cap-1) (next.atPC 0) ∧ WitnessReady A b raw (src+h*(m+1)+(m+1)) cap out ∧
∀ j, out.index j ≤ nextLimit worker cap limit work := by sorrySource