Documentation

CslibFrontier.Computability.Complexity.RealAlgebraic.ControlledCoordinateLift

Controlled variable renaming #

A polynomial-time transformation of evaluation points realizes a variable renaming at the original counting level. One such transformation gathers coordinates by binary address. Appending unused variables takes the original list as it is. Lifting a one-variable polynomial instead reads the addressed value into a singleton list. Both preserve the degree, coefficient norm and prime cutoff bounds.

Adapted from ControlledRenaming, ControlledAppendVariables and ControlledCoordinateLift in lean-canny at 970f28a5ecefc1327402ade16c068aa4b1b2c183.

noncomputable def Cslib.Complexity.RealAlgebraic.Controlled.rename {α : Type} {n m : α → ℕ} {enc : α ↪ List Bool} {a : ℕ} {P : (w : α) → MvPolynomial (Fin (n w)) ℤ} (C : Controlled P enc a) (hm : Turing.MultiTapeTM.ComputableInPolyTime m enc Turing.MultiTapeTM.encUnary) (f : (w : α) → Fin (n w) → Fin (m w)) (point : α × List ℕ → List ℕ) (hpoint : Turing.MultiTapeTM.ComputableInPolyTime point (Turing.MultiTapeTM.encPair enc (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (hlookup : ∀ (w : α) (z : List ℕ) (i : Fin (n w)), (point (w, z)).getD (↑i) 0 = z.getD (↑(f w i)) 0) :
Controlled (fun (w : α) => (MvPolynomial.rename (f w)) (P w)) enc a

Rename the variables using a polynomial-time map on zero-padded evaluation points. The realizing map must agree with the renaming on each original coordinate.

@[simp]
theorem Cslib.Complexity.RealAlgebraic.Controlled.cutoff_rename {α : Type} {n m : α → ℕ} {enc : α ↪ List Bool} {a : ℕ} {P : (w : α) → MvPolynomial (Fin (n w)) ℤ} (C : Controlled P enc a) (hm : Turing.MultiTapeTM.ComputableInPolyTime m enc Turing.MultiTapeTM.encUnary) (f : (w : α) → Fin (n w) → Fin (m w)) (point : α × List ℕ → List ℕ) (hpoint : Turing.MultiTapeTM.ComputableInPolyTime point (Turing.MultiTapeTM.encPair enc (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (hlookup : ∀ (w : α) (z : List ℕ) (i : Fin (n w)), (point (w, z)).getD (↑i) 0 = z.getD (↑(f w i)) 0) :
(C.rename hm f point hpoint hlookup).cutoff = C.cutoff

Reindexing the evaluation point preserves the source prime cutoff.

noncomputable def Cslib.Complexity.RealAlgebraic.Controlled.renameByAddress {α : Type} {n m : α → ℕ} {enc : α ↪ List Bool} {a : ℕ} {P : (w : α) → MvPolynomial (Fin (n w)) ℤ} (C : Controlled P enc a) (hm : Turing.MultiTapeTM.ComputableInPolyTime m enc Turing.MultiTapeTM.encUnary) (f : (w : α) → Fin (n w) → Fin (m w)) (address : α × ℕ → ℕ) (haddress : Turing.MultiTapeTM.ComputableInPolyTime address (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encUnary) Turing.MultiTapeTM.encNat) (hcoordinate : ∀ (w : α) (i : Fin (n w)), address (w, ↑i) = ↑(f w i)) :
Controlled (fun (w : α) => (MvPolynomial.rename (f w)) (P w)) enc a

Rename by gathering one binary-addressed entry per original variable, reading absent coordinates as zero. Only addresses at original coordinates must agree with the renaming.

noncomputable def Cslib.Complexity.RealAlgebraic.Controlled.appendVariables {α : Type} {n : α → ℕ} {enc : α ↪ List Bool} {a : ℕ} {P : (w : α) → MvPolynomial (Fin (n w)) ℤ} (C : Controlled P enc a) (k : α → ℕ) (hk : Turing.MultiTapeTM.ComputableInPolyTime k enc Turing.MultiTapeTM.encUnary) :
Controlled (fun (w : α) => (MvPolynomial.rename (Fin.castAdd (k w))) (P w)) enc a

Append a block of unused variables, preserving the controlled evaluator and its bounds. The block size is computed in unary, as is the original arity.

noncomputable def Cslib.Complexity.RealAlgebraic.Controlled.onCoordinate {α : Type} {n : α → ℕ} {enc : α ↪ List Bool} {a : ℕ} {P : α → MvPolynomial (Fin 1) ℤ} (C : Controlled P enc a) (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encUnary) (i : (w : α) → Fin (n w)) (hi : Turing.MultiTapeTM.ComputableInPolyTime (fun (w : α) => ↑(i w)) enc Turing.MultiTapeTM.encNat) :
Controlled (fun (w : α) => (MvPolynomial.rename fun (x : Fin 1) => i w) (P w)) enc a

Place a controlled one-variable polynomial at a binary-addressed coordinate without increasing its evaluation level or polynomial bounds.

@[simp]

Appending variables preserves the degree bound.

@[simp]

Appending variables preserves the coefficient norm exponent.

@[simp]
theorem Cslib.Complexity.RealAlgebraic.Controlled.cutoff_appendVariables {α : Type} {n : α → ℕ} {enc : α ↪ List Bool} {a : ℕ} {P : (w : α) → MvPolynomial (Fin (n w)) ℤ} (C : Controlled P enc a) (k : α → ℕ) (hk : Turing.MultiTapeTM.ComputableInPolyTime k enc Turing.MultiTapeTM.encUnary) :

Appending variables preserves the prime cutoff.

@[simp]

Lifting to one coordinate preserves the degree bound.

@[simp]

Lifting to one coordinate preserves the coefficient norm exponent.

@[simp]
theorem Cslib.Complexity.RealAlgebraic.Controlled.cutoff_onCoordinate {α : Type} {n : α → ℕ} {enc : α ↪ List Bool} {a : ℕ} {P : α → MvPolynomial (Fin 1) ℤ} (C : Controlled P enc a) (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encUnary) (i : (w : α) → Fin (n w)) (hi : Turing.MultiTapeTM.ComputableInPolyTime (fun (w : α) => ↑(i w)) enc Turing.MultiTapeTM.encNat) :
(C.onCoordinate hn i hi).cutoff = C.cutoff

Lifting to one coordinate preserves the prime cutoff.