Encoding affine parity equations #
An affine equation is encoded as the framed pair of its framed variable list and its right-hand
side bit, the layout of encPair (encList encV) encBool (encAffineEquation_apply).
Cslib.Complexity.XORSAT.encoding and the affine template compiler of
Cslib.Complexity.CSP.computableInPolyTime_instantiateAffine both use it with binary labels.
Main definitions #
Cslib.Complexity.encAffineEquation: the encoding of an equation, withfun_proprules for reading its fields and building it.
theorem Cslib.Complexity.encAffineEquation_mk_budget {V : Type} (encV : V ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List V} {x1 : γ → Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (Turing.MultiTapeTM.encList encV) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBool budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { vars := x0 x, rhs := x1 x }) encIn (encAffineEquation encV)
budget
theorem Cslib.Complexity.encAffineEquation_rhs_length_le {V : Type} (encV : V ↪ List Bool) (a : Logic.PL.AffineEquation V) :
theorem Cslib.Complexity.encAffineEquation_mk_polyTime {V : Type} (encV : V ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List V} {x1 : γ → Bool} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn (Turing.MultiTapeTM.encList encV)) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn Turing.MultiTapeTM.encBool) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { vars := x0 x, rhs := x1 x }) encIn (encAffineEquation encV)
theorem Cslib.Complexity.encAffineEquation_mk_deg {V : Type} (encV : V ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List V × Bool) => { vars := p.1, rhs := p.2 })
(encAffineEquationFields encV) (encAffineEquation encV) 1 1
@[simp]
theorem Cslib.Complexity.encAffineEquation_apply {V : Type} (encV : V ↪ List Bool) (a : Logic.PL.AffineEquation V) :
theorem Cslib.Complexity.encAffineEquation_vars_polyTime {V : Type} (encV : V ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Logic.PL.AffineEquation V} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encAffineEquation encV) →
Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).vars) encIn✝ (Turing.MultiTapeTM.encList encV)
Encoding of an affine equation: its framed variable list, then its right-hand side bit.
theorem Cslib.Complexity.encAffineEquation_fields_deg {V : Type} (encV : V ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (a : Logic.PL.AffineEquation V) => (a.vars, a.rhs)) (encAffineEquation encV)
(encAffineEquationFields encV) 1 1
theorem Cslib.Complexity.encAffineEquation_mk_inO {V : Type} (encV : V ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List V} {T0 S0 : γ → ℕ} {x1 : γ → Bool} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (Turing.MultiTapeTM.encList encV) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBool T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { vars := x0 x, rhs := x1 x }) encIn (encAffineEquation encV)
(fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
theorem Cslib.Complexity.encAffineEquation_rhs_budget {V : Type} (encV : V ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Logic.PL.AffineEquation V} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encAffineEquation encV) S✝ →
Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).rhs) encIn✝ Turing.MultiTapeTM.encBool S✝
theorem Cslib.Complexity.encAffineEquation_vars_length_le {V : Type} (encV : V ↪ List Bool) (a : Logic.PL.AffineEquation V) :
theorem Cslib.Complexity.encAffineEquation_rhs_inO {V : Type} (encV : V ↪ List Bool) :
Turing.MultiTapeTM.ComputableInO Logic.PL.AffineEquation.rhs (encAffineEquation encV) Turing.MultiTapeTM.encBool
(fun (a : Logic.PL.AffineEquation V) => ((encAffineEquation encV) a).length) fun (a : Logic.PL.AffineEquation V) =>
((encAffineEquation encV) a).length
theorem Cslib.Complexity.encAffineEquation_rhs_polyTime {V : Type} (encV : V ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Logic.PL.AffineEquation V} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encAffineEquation encV) →
Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).rhs) encIn✝ Turing.MultiTapeTM.encBool
theorem Cslib.Complexity.encAffineEquation_vars_budget {V : Type} (encV : V ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Logic.PL.AffineEquation V} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encAffineEquation encV) S✝ →
Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).vars) encIn✝ (Turing.MultiTapeTM.encList encV) S✝
theorem Cslib.Complexity.encAffineEquation_vars_inO {V : Type} (encV : V ↪ List Bool) :
Turing.MultiTapeTM.ComputableInO Logic.PL.AffineEquation.vars (encAffineEquation encV) (Turing.MultiTapeTM.encList encV)
(fun (a : Logic.PL.AffineEquation V) => ((encAffineEquation encV) a).length) fun (a : Logic.PL.AffineEquation V) =>
((encAffineEquation encV) a).length