The 4-Feasibility problem and the powerfree representation (§5)
DefinitionBSSFeasibilityThe 4-Feasibility problem and the powerfree representation of §5 (p. 26).
A polynomial of degree at most is powerfreely represented in as the header followed by blocks of five entries, with natural numbers satisfying , the blocks listed in increasing lexicographic order of . The block stands for the monomial , with to allow terms of degree less than , and is the sum of these monomials.
is the set of such codes and the set of codes whose polynomial has a real zero. The zero is quantified over assignments , which is equivalent to quantifying over since only occur.
import Definitions.Def_BSSComplexity
/-!
# The 4-Feasibility problem over the reals (Blum–Shub–Smale, §5)
Formalization of the decision problem `(F, F_yes)` of
L. Blum, M. Shub, S. Smale, *On a theory of computation and complexity over the
real numbers: NP-completeness, recursive functions and universal machines*,
Bull. Amer. Math. Soc. **21** (1989), no. 1, 1–46, §5, p. 26,
together with the powerfree representation of degree `≤ 4` polynomials in `ℝ^∞`
described there.
A polynomial `f : ℝⁿ → ℝ` of degree `≤ 4` is powerfreely represented in `ℝ^∞` as
`(4, n)` followed by a sequence of blocks `(α, a_α)`, where `α = (α₁, α₂, α₃, α₄)`
with `αᵢ ∈ {0, …, n}` and `αᵢ ≤ αᵢ₊₁`, and `a_α ∈ ℝ`. The block `(α, a_α)` stands
for the monomial `a_α x_{α₁} x_{α₂} x_{α₃} x_{α₄}`, with the convention `x₀ = 1`,
and the blocks are ordered by the lexicographic order on `α`.
-/
namespace BSS
/-- The number of monomial blocks of a powerfree code `w`: the entries of `w`
after the two header entries, grouped five at a time. -/
noncomputable def numBlocks (w : Rinf ℝ) : ℕ := (lengthInf w - 2) / 5
/-- The `t`-th exponent index of the `t`-th block of a powerfree code. -/
noncomputable def blockExp (w : Rinf ℝ) (b t : ℕ) : ℕ := ⌊w (2 + 5 * b + t)⌋₊
/-- The coefficient `a_α` of block `b` of a powerfree code. -/
noncomputable def blockCoeff (w : Rinf ℝ) (b : ℕ) : ℝ := w (2 + 5 * b + 4)
/-- The exponent multi-index of block `b`, as a list of four indices. -/
noncomputable def blockIndex (w : Rinf ℝ) (b : ℕ) : List ℕ :=
List.ofFn (fun t : Fin 4 => blockExp w b t)
/-- `w ∈ ℝ^∞` is a powerfree representation of a polynomial `ℝⁿ → ℝ` of degree
`≤ 4`, for some `n` (BSS §5, p. 26). -/
def IsPowerfreeCode (w : Rinf ℝ) : Prop :=
∃ n : ℕ,
w 0 = 4 ∧ w 1 = (n : ℝ) ∧
lengthInf w = 2 + 5 * numBlocks w ∧
(∀ b < numBlocks w, ∀ t < 4,
w (2 + 5 * b + t) = ((blockExp w b t : ℕ) : ℝ) ∧ blockExp w b t ≤ n) ∧
(∀ b < numBlocks w, ∀ t < 3, blockExp w b t ≤ blockExp w b (t + 1)) ∧
(∀ b : ℕ, b + 1 < numBlocks w →
List.Lex (· < ·) (blockIndex w b) (blockIndex w (b + 1)))
/-- The value at the point `x` of the polynomial powerfreely represented by `w`,
with the convention `x₀ = 1` that allows terms of degree less than `4`. -/
noncomputable def feasValue (w : Rinf ℝ) (x : ℕ → ℝ) : ℝ :=
∑ b ∈ Finset.range (numBlocks w),
blockCoeff w b *
∏ t ∈ Finset.range 4, (if blockExp w b t = 0 then (1 : ℝ) else x (blockExp w b t))
/-- The instance space `F` of the 4-Feasibility problem: the powerfree
representations of polynomials of degree `≤ 4` (BSS §5, p. 26). -/
def Feas4 : Set (Rinf ℝ) := {w : Rinf ℝ | IsPowerfreeCode w}
/-- The yes-instances `F_yes` of the 4-Feasibility problem: those `f ∈ F` having a
real zero (BSS §5, p. 26). -/
def Feas4Yes : Set (Rinf ℝ) :=
{w : Rinf ℝ | IsPowerfreeCode w ∧ ∃ x : ℕ → ℝ, feasValue w x = 0}
end BSS
Read-back
What the Lean code literally says, in plain math · NON-BLIND: written by the drafting agent (Aristotle, Harmonic), not an independent auditor
⚠️ NON-BLIND READ-BACK — NOT INDEPENDENT TESTIMONY. This read-back was not written by an independent blind auditor. It was written by the same agent that drafted this item's Lean statement, at the explicit instruction of the proposal owner. The author therefore already knew what the statement was intended to say, which is exactly the bias a read-back exists to exclude. Treat this text as the author's own rendering of their own code, not as corroborating evidence, and obtain a genuinely independent audit before relying on it.
This file describes a way of writing a polynomial as a point of , and the two sets of points it distinguishes.
Blocks. Let and let be for and for . The number of blocks of is
computed with truncated natural-number subtraction and division, so whenever . For put
where is the natural-number floor, which is on every negative real. The index list of block is .
The predicate. is a powerfree code when there exists a natural number with all of:
- and ;
- ;
- for every and every : the entry equals the natural number (so that entry is a nonnegative integer) and ;
- for every and every : , i.e. the four indices of a block are nondecreasing;
- for every with : the index list of block is strictly smaller than the index list of block in the lexicographic order on lists of naturals. Strictness forbids two blocks with the same index list.
No condition is placed on the coefficients ; in particular a coefficient may be . No condition ties to : for instance with is a valid code for any , and is not required to be the largest index actually occurring.
The value. For and an assignment ,
so index contributes the constant and the value of at is never consulted. An empty sum is , so whenever .
The two sets. is the set of powerfree codes. is the set of powerfree codes for which there exists an assignment , ranging over all of rather than over , with . Hence , and every code with no blocks lies in .