Recover real LP witnesses with a finite RAM output contract
OpenSmaleNinth.real_lp_finite_witness_fragmentConstruct a fixed relocatable fragment with a dimension-polynomial clock starting on the ordinary real LP input. The primal branch exposes a feasible point in the public output cells. The dual branch exposes a normalized sparse Farkas certificate in a strided buffer located by two address registers. The existing orientation test distinguishes the branches. The contract requires the values of the designated registers and cells only.
Preamble
import Definitions.Def_OAILP_Recovery_FinalDual import Mathlib.Data.Real.Basic open Matrix OAI.Optimization.LinearProgramming open OAI.Optimization.LinearProgramming.RAM OAI.Optimization.LinearProgramming.RAM.Callable
Formal statement
theorem SmaleNinth.real_lp_finite_witness_fragment :
∃ (f : Fragment) (C E : ℕ),
∀ (m d : ℕ) (A : Matrix (Fin m) (Fin d) ℝ) (b : Fin m → ℝ), 0 < m → 0 < d →
∃ z, f.Run (fun _ : ℝ => True) (start [m, d] (lpInput A b)).memory
(polyBound C E (m + d)) z ∧
(((Odd.cond (.addrLT 159 156)).test z = true ∧
∃ x : Fin d → ℝ, Feasible A b x ∧
(∀ i : Fin d, z.data i.val = x i) ∧ z.index 16 = 0 ∧ z.index 17 = 0) ∨
((Odd.cond (.addrLT 159 156)).test z = false ∧
∃ (src : ℕ) (y : Fin m → ℝ), m ≤ src ∧ z.index 14 = src ∧ z.index 15 = m ∧
(∀ i : Fin m, z.data (src + 2 * i.val) = y i) ∧
Certificate A b y ∧ b ⬝ᵥ y = -1)) := by sorrySource