Documentation

Complexitylib.Classes.PCP.Internal.Materialize

Writing out a table #

Every stage of an algorithmic reduction writes a list: the edges of a graph, the entries of a rotation table, the records of a gadget. The list encoder listEncFn of Complexitylib.Classes.P.Range writes it from a polynomial-time rule for its entries, with no bound on the loop to supply; this module names that fact the way the reductions use it, and adds the unary comparisons they branch on. The counting and searching loops that used to live here (countOver, findFirst and their lemmas) moved to Complexitylib.Classes.P.Range under the same names.

Main results #

A record rule materializes a list in polynomial time. No bound need be supplied: this is listEncFn_mem_FP.

The list encoder writes the list.

Comparing #

noncomputable def Complexity.ifEqLen (a b x y : List Bool) :

x when the two strings have the same length, y otherwise.

Equations
Instances For
    theorem Complexity.ifEqLen_pos {a b : List Bool} (h : a.length = b.length) (x y : List Bool) :
    ifEqLen a b x y = x
    theorem Complexity.ifEqLen_neg {a b : List Bool} (h : a.length ≠ b.length) (x y : List Bool) :
    ifEqLen a b x y = y
    theorem Complexity.ifEqLen_mem_FP {a b x y : List Bool → List Bool} (ha : a ∈ FP) (hb : b ∈ FP) (hx : x ∈ FP) (hy : y ∈ FP) :
    (fun (z : List Bool) => ifEqLen (a z) (b z) (x z) (y z)) ∈ FP
    noncomputable def Complexity.ifLtLen (a b x y : List Bool) :

    x when the first string is shorter than the second, y otherwise.

    Equations
    Instances For
      theorem Complexity.ifLtLen_pos {a b : List Bool} (h : a.length < b.length) (x y : List Bool) :
      ifLtLen a b x y = x
      theorem Complexity.ifLtLen_neg {a b : List Bool} (h : ¬a.length < b.length) (x y : List Bool) :
      ifLtLen a b x y = y
      theorem Complexity.ifLtLen_mem_FP {a b x y : List Bool → List Bool} (ha : a ∈ FP) (hb : b ∈ FP) (hx : x ∈ FP) (hy : y ∈ FP) :
      (fun (z : List Bool) => ifLtLen (a z) (b z) (x z) (y z)) ∈ FP