Documentation

CslibFrontier.Computability.Circuit.Boolean.Polarization.PolyTime

Native generation of the polarization circuits #

Raw code generators for the circuits of the Sahai–Vadhan Polarization Lemma [SahaiVadhan2003, Lemma 3.3], built in Boolean.Polarization: the exclusive-or chain, the selection stage, one coordinate of the XOR construction, the XOR construction and the polarization construction. Each agrees exactly with the code of the typed circuit, and each is computable in polynomial time from the codes of the two input circuits, with the numbers of inputs, outputs, coordinates and copies in unary. So the map (C₀, C₁) ↦ polarizeCircuit C₀ C₁ lam ell k c is polynomial-time on circuit codes when lam, ell and k are polynomially bounded and computed in unary (computableInPolyTime_polarizeCode).

Main definitions #

Main results #

References #

The four gates of the exclusive-or gadget Program.appendXor number t of a chain on N inputs: it reads the last gate 4 t of the chain so far (wire N + 4 t) and input t.

The gates of xorChainProgram c j sel on N inputs, when sel selects inputs 0, …, j - 1.

theorem Cslib.Circuits.Boolean.xorChainCode_code {N : ℕ} (c : Bool) (j : ℕ) (sel : Fin j → Fin N) (hsel : ∀ (t : Fin j), ↑(sel t) = ↑t) :

The wire feeding bit t of output block i of xorMixStage c j n, as a number.

The code of the selection stage xorMixStage c j n.

The code of one coordinate xorMixBlock C₀ C₁ of the XOR construction, from the codes c₀ and c₁ of circuits with n inputs and m outputs.

The code of the XOR construction xorMixCircuit C₀ C₁ j c, from the codes c₀ and c₁ of circuits with n inputs and m outputs.

theorem Cslib.Circuits.Boolean.xorMixCode_code {n m : ℕ} (C₀ C₁ : Circuit signature n m) (j : ℕ) (c : Bool) :
xorMixCode n m j c C₀.code C₁.code = (xorMixCircuit C₀ C₁ j c).code
def Cslib.Circuits.Boolean.polarizeCode (n m lam ell k : ℕ) (c : Bool) (c₀ c₁ : List (Op × List ℕ) × List ℕ) :

The code of the polarization construction polarizeCircuit C₀ C₁ lam ell k c, from the codes c₀ and c₁ of circuits with n inputs and m outputs.

theorem Cslib.Circuits.Boolean.polarizeCode_code {n m : ℕ} (C₀ C₁ : Circuit signature n m) (lam ell k : ℕ) (c : Bool) :
polarizeCode n m lam ell k c C₀.code C₁.code = (polarizeCircuit C₀ C₁ lam ell k c).code

The exclusive-or chain is polynomial-time, with a binary input count and a unary length.

One coordinate of the XOR construction is polynomial-time in unary sizes and the codes.

The XOR construction is polynomial-time in unary sizes and the codes.

The polarization construction is polynomial-time in unary sizes and parameters and the codes.