Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Tape.LetterSubst

Naming the letters of a code by other letters #

A polynomial on the codes of words over Γ has a variable (p, y) for every place p and every letter or end mark y : Option Γ. Along a map e : Δ → Γ, the substitution Tape.letterSubst K e N sends the variables of the letters outside the range of e to 0 (Tape.letterSubst_of_notMem_range) and, for an injective e, the variable (p, Option.map e y) to (p, y) (Tape.letterSubst_map). Its values are affine (Tape.isAffine_letterSubst). For an injective e, a polynomial after the substitution takes at the code of a word w over Δ the value that it takes before at the code of w.map e (Tape.eval_aeval_letterSubst).

Main definitions #

Main results #

References #

noncomputable def Cslib.Circuits.Arithmetic.Separation.Tape.letterSubst (K : Type u_1) [CommSemiring K] {Γ Δ : Type} (e : Δ → Γ) (N : ℕ) :
Fin N × Option Γ → MvPolynomial (Fin N × Option Δ) K

The substitution that names the letters of Γ by letters of Δ along e : Δ → Γ: the variable (p, y) becomes (p, y') for some y' with Option.map e y' = y (the only one when e is injective; y' = none for the end mark y = none), and 0 when there is no such y'.

theorem Cslib.Circuits.Arithmetic.Separation.Tape.letterSubst_map {K : Type u_1} [CommSemiring K] {Γ Δ : Type} {e : Δ → Γ} {N : ℕ} (he : Function.Injective e) (p : Fin N) (y : Option Δ) :

For an injective e, the variable (p, Option.map e y) becomes (p, y).

theorem Cslib.Circuits.Arithmetic.Separation.Tape.letterSubst_of_notMem_range {K : Type u_1} [CommSemiring K] {Γ Δ : Type} {e : Δ → Γ} {N : ℕ} {y : Option Γ} (hy : y ∉ Set.range (Option.map e)) (p : Fin N) :
letterSubst K e N (p, y) = 0

The variables of the letters outside the range of e become 0.

theorem Cslib.Circuits.Arithmetic.Separation.Tape.isAffine_letterSubst {K : Type u_1} [CommSemiring K] {Γ Δ : Type} (e : Δ → Γ) (N : ℕ) (b : Fin N × Option Γ) :

The values of letterSubst are affine: variables or 0.

theorem Cslib.Circuits.Arithmetic.Separation.Tape.eval_aeval_letterSubst {K : Type u_1} [CommSemiring K] {Γ Δ : Type} {e : Δ → Γ} {N : ℕ} [DecidableEq Γ] [DecidableEq Δ] (he : Function.Injective e) (w : List Δ) (P : MvPolynomial (Fin N × Option Γ) K) :
(MvPolynomial.eval fun (b : Fin N × Option Δ) => if wordCode N w b = true then 1 else 0) ((MvPolynomial.aeval (letterSubst K e N)) P) = (MvPolynomial.eval fun (b : Fin N × Option Γ) => if wordCode N (List.map e w) b = true then 1 else 0) P

Evaluation at a code after naming the letters. For an injective e : Δ → Γ, a polynomial after the substitution letterSubst K e N takes at the code of a word w over Δ the value that it takes at the code of the word w.map e over Γ.