Model sanity: one-variable LP feasibility in linear BSS time
DisprovedSmaleNinth.bss_decides_one_variable_lpA statement asserting that no machine of a given kind can do something is worthless if the machines cannot do anything; a statement asserting that one exists is worthless if the model is so permissive that existence is automatic. This theorem calibrates the model of the mission's goal by exhibiting a genuine algorithm in it, in the smallest nontrivial case.
The assertion. There exist a single program over the real numbers and a single constant such that for every and every one-variable system given by and , the program started on the standard tape encoding halts within
with the verdict true if and only if is nonempty.
Reading the quantifiers. As in the goal statement, the program and the constant are fixed once and serve every instance: the algorithm is uniform, and its cost is linear in the number of constraints with a constant independent of the data. The verdict and the exact halting time may depend on the instance. When there are no constraints, the system is vacuously satisfiable, and the program must accept within steps.
What it is for. Mathematically the content is elementary — one-variable feasibility is decided by comparing the largest lower bound imposed by the constraints against the smallest upper bound, with the degenerate constraints treated separately — and no claim is made about . The purpose is to certify the machine model itself: that its instruction set, its tape-shift addressing, its input convention and its unit-cost accounting together support an actual uniform algorithm with a proven running-time bound. Without such a statement, the mission's goal could be satisfied or refuted for reasons having nothing to do with linear programming.
Retired — disproved, false as stated. Do not use as a dependency. The linear budget is not attainable in the fixed-address tape model of Def_SmaleNinth_BSSMachine: under encodeLP each coefficient sits cells away from its right-hand side , and a machine-checked crossing-sequence lower bound, SmaleNinth.bss_one_variable_lp_no_linear_program (Proved), shows that no program decides every one-variable instance within steps. This is a defect in the budget I wrote into the milestone, not in the formalization. The model-sanity purpose is served by SmaleNinth.bss_decides_one_variable_lp_quadratic (Proved) — the same statement with budget — to which milestone 5 is now linked. The disproof is also available as the positive theorem bss_one_variable_lp_no_linear_program, and SmaleNinth.smale_ninth_no_linear_time (Proved) transfers it to the mission goal: the exponent is excluded.
import Definitions.Def_Polyhedron import Definitions.Def_SmaleNinth_BSSMachine /-! Sanity of the machine model: one-variable LP feasibility is BSS-decidable in linear time. Source: model-validation exercise for the Blum–Shub–Smale machine of `Definitions.Def_SmaleNinth_BSSMachine` (Blum–Shub–Smale, Bull. AMS 21(1): 1–46, 1989). A one-variable system `aᵢx ≥ bᵢ (i = 1,…,m)` is feasible iff the largest lower bound among the constraints with `aᵢ > 0` is at most the smallest upper bound among those with `aᵢ < 0`, and no constraint with `aᵢ = 0` has `bᵢ > 0` — one linear scan through the input. The point of this milestone is not the mathematics but the model: it exhibits a single uniform program that reads the encoded instance (using the tape shifts to walk the input), maintains running bounds, and halts with the correct verdict in `O(m)` steps — certifying that the machine model of the mission's goal statement is expressive and its cost semantics behave as intended. -/ open Matrix LinearOptimization /-- **Model sanity: one-variable LP in linear time.** There is a uniform BSS program deciding, for every `m` and every one-variable system `aᵢx ≥ bᵢ`, its feasibility within `C·(m+1)` steps on the standard input encoding. -/
theorem SmaleNinth.bss_decides_one_variable_lp :
∃ (P : BSSProgram) (C : ℕ),
∀ (m : ℕ) (A : Matrix (Fin m) (Fin 1) ℝ) (b : Fin m → ℝ),
∃ result : Bool,
BSSDecidesInTime P (encodeLP A b) (C * (m + 1)) result ∧
(result = true ↔ (polyhedron A b).Nonempty) := by sorryRead-back
What the Lean code literally says, in plain math · claude-fable-5
Read-back: SmaleNinth.bss_decides_one_variable_lp
The statement asserts the existence of one fixed program and one fixed natural-number constant , chosen before anything else, that work uniformly for every instance. Precisely, the quantifier order is:
run on the encoded instance halts with output within steps, and if and only if the set is nonempty. The boolean is existentially quantified inside the instance quantifiers, so it may depend on the instance; the "iff" conjunct pins it to the truth value of feasibility. Here ranges over all naturals, including .
The machine model. A program is a finite list of instructions for a register machine whose configuration is a program counter together with a bi-infinite tape of real registers. The instructions are: load a constant ( for an arbitrary real hard-coded in the instruction), the four field operations on fixed integer addresses (with division totalized so that ), a left shift (new old ) and a right shift (new old ) of the entire tape, a conditional jump ("if set , else "), and two halting instructions, accept and reject. Every non-jump, non-halt instruction advances the program counter by one. A configuration whose program counter points at accept or reject, or points outside the program list entirely, is a fixed point of the step function (the step leaves it unchanged).
What "decides in time " means. Writing for the configuration reached after exactly applications of the step function starting from program counter and initial tape , the predicate asserted here is:
with . Note this requires the program counter to sit on an accept/reject instruction of at some time : a run whose counter merely falls off the end of the program never counts as halting with an output. Each executed instruction — arithmetic operation, shift, jump, or comparison — costs one step; the bound counts steps, so the running time is at most , i.e. linear in with the same multiplicative constant for every instance. (Nothing constrains beyond being some natural number; the bound at is .)
The input encoding ( case of encodeLP). The initial tape is: cell holds the real number ; cell holds the real number (the value of ); cells hold the column entries (the row-major listing of the matrix, entry in cell for ); cells hold ; every other cell of the bi-infinite tape is , including all cells with negative index. When the matrix and vector blocks are empty, so the tape is everywhere except cell , which holds .
The decided set. polyhedron is the set , where is the matrix–vector product and is componentwise; for this is, identifying with a single real,
Nonemptiness of this set is exactly one-variable LP feasibility: satisfying all inequalities. In the edge case there are no inequalities, the condition is vacuously true, the set is all of and hence nonempty — so on the ()-instance's near-blank tape the program is required to reach accept within steps.
In summary: the theorem claims a single BSS-style program over (with unit-cost exact real arithmetic and arbitrary real machine constants) and a single constant such that, for every number of constraints and every real one-variable system () presented in the tape encoding above, the program halts on accept or reject within steps, halting on accept precisely when the system has a real solution.
Confirmed by the mission captain (proposal self-audit).