Documentation

CslibFrontier.Computability.Complexity.RealAlgebraic.ControlledIndexedFeasibility

One controlled polynomial for indexed real feasibility #

A system with binary-addressed equations and strict inequalities has a single sum-of-squares equation. One auxiliary variable per strict inequality realizes its positivity test. When the row families have common polynomial-time bounds, the resulting modular evaluator costs one additional counting level.

Adapted from lean-canny's IndexedEquationPositivity and ControlledIndexedSystem at 970f28a5ecefc1327402ade16c068aa4b1b2c183.

Sum the squared equations and the squared auxiliary equations for strict inequalities. The first n variables are original. The final k variables serve the strict inequalities.

noncomputable def Cslib.Complexity.RealAlgebraic.Controlled.indexedFeasibility {α : Type} {n : α → ℕ} {enc : α ↪ List Bool} {a : ℕ} {P Q : (q : α × ℕ) → MvPolynomial (Fin (n q.1)) ℤ} (CP : Controlled P (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encNat) a) (CQ : Controlled Q (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encNat) a) (E : Turing.MultiTapeTM.Decoder enc) (e k D b cutoff : α → ℕ) (he : Turing.MultiTapeTM.ComputableInPolyTime e enc Turing.MultiTapeTM.encNat) (hk : Turing.MultiTapeTM.ComputableInPolyTime k enc Turing.MultiTapeTM.encUnary) (hD : Turing.MultiTapeTM.ComputableInPolyTime D enc Turing.MultiTapeTM.encNat) (hb : Turing.MultiTapeTM.ComputableInPolyTime b enc Turing.MultiTapeTM.encNat) (hcut : Turing.MultiTapeTM.ComputableInPolyTime cutoff enc Turing.MultiTapeTM.encNat) (hPdeg : ∀ (w : α), ∀ j < e w, (P (w, j)).totalDegree ≤ D w) (hQdeg : ∀ (w : α), ∀ j < k w, (Q (w, j)).totalDegree ≤ D w) (hPmass : ∀ (w : α), ∀ j < e w, (P (w, j)).coeffNorm1 ≤ 2 ^ b w) (hQmass : ∀ (w : α), ∀ j < k w, (Q (w, j)).coeffNorm1 ≤ 2 ^ b w) (hPcut : ∀ (w : α), ∀ j < e w, CP.cutoff (w, j) ≤ cutoff w) (hQcut : ∀ (w : α), ∀ j < k w, CQ.cutoff (w, j) ≤ cutoff w) :
Controlled (fun (w : α) => indexedFeasibilityPolynomial (fun (j : ℕ) => P (w, j)) (fun (j : ℕ) => Q (w, j)) (e w) (k w)) enc (a + 1)

Assemble a controlled feasibility polynomial at one extra counting level. The equation count is binary. The inequality count is unary because it determines the size of the auxiliary variable block. The common bounds need only hold for rows in range.

theorem Cslib.Complexity.RealAlgebraic.eval₂_indexedFeasibilityPolynomial {n : ℕ} {R : Type u_1} [CommRing R] (f : ℤ →+* R) (P Q : ℕ → MvPolynomial (Fin n) ℤ) (e k : ℕ) (z : Fin (n + k) → R) :
MvPolynomial.eval₂ f z (indexedFeasibilityPolynomial P Q e k) = ∑ j ∈ Finset.range e, MvPolynomial.eval₂ f (fun (i : Fin n) => z (Fin.castAdd k i)) (P j) ^ 2 + ∑ i : Fin k, (MvPolynomial.eval₂ f (fun (j : Fin n) => z (Fin.castAdd k j)) (Q ↑i) * z (Fin.natAdd n i) ^ 2 - 1) ^ 2

Evaluate the squared equation rows on the original coordinates and the squared positivity rows using their respective auxiliary coordinates.

The combined polynomial has a real zero exactly when the original equations and strict inequalities are feasible. The auxiliary coordinates can be chosen independently.