Polarization of circuit samplers #
The Polarization Lemma of Sahai and Vadhan [SahaiVadhan2003, Lemma 3.3] acts on pairs of circuits:
from De Morgan circuits C₀ and C₁ with n inputs and m outputs it builds circuits whose
output distributions are the polarized pair Cslib.Probability.PMF.polarize of the output
distributions of C₀ and C₁, up to the flattening of tuples of outputs into one bit string.
The XOR construction on j + 1 coordinates (xorMixCircuit C₀ C₁ j c) reads j selector bits
r and j + 1 blocks of n data bits. A chain of exclusive-or gadgets computes the last
selector c ⊕ parity r, completing r to BitString.parityComplete c r (xorMixStage).
Coordinate i then runs C₁ or C₀ on data block i according to selector bit i, through a
multiplexer (xorMixBlock). On uniform inputs the selectors are uniform among the strings of
parity c and the data blocks are independent uniform seeds, so the output distribution is the XOR
construction xorMix (outputDist_xorMixCircuit). Independent copies are Circuit.replicate
(Circuit.outputDist_replicate), and the polarization construction alternates the two
(polarizeCircuit, outputDist_polarizeCircuit). Flattening is injective, so the polarized
circuits are exactly as far apart as the polarized distributions
(dist_outputDist_polarizeCircuit).
The numbers of coordinates are passed as predecessors, lam for lam + 1 inner coordinates and
k for k + 1 outer coordinates. The XOR construction needs at least one coordinate, and this
keeps the circuit types free of subtraction. Every circuit here has an explicit structure. Their
codes are generated in polynomial time by Boolean.Polarization.PolyTime
(computableInPolyTime_polarizeCode); their sizes are not stated separately.
Main definitions #
Cslib.Circuits.Boolean.xorChainProgram: a chain of exclusive-or gadgets computingc ⊕ parity (x ∘ sel).Cslib.Circuits.Boolean.xorMixStage: completes the selector bits and routes them to the data blocks.Cslib.Circuits.Boolean.xorMixBlock: one coordinate of the XOR construction.Cslib.Circuits.Boolean.xorMixCircuit: the XOR construction on circuits.Cslib.Circuits.Boolean.polarizeCircuit: the polarization construction on circuits.Cslib.Circuits.Boolean.polarizeEquiv: flattening of the polarized outputs.
Main results #
Cslib.Circuits.Boolean.eval_xorMixCircuit: coordinateievaluatesC₁orC₀on data blocki, according to bitiof the completed selector.Cslib.Circuits.Boolean.outputDist_xorMixCircuit: the output distribution is the XOR construction of the output distributions.Cslib.Circuits.Boolean.outputDist_polarizeCircuit: the output distribution is the polarized pair of the output distributions.Cslib.Circuits.Boolean.dist_outputDist_polarizeCircuit: the polarized circuits are as far apart as the polarized distributions.
References #
A De Morgan program whose last gate computes c ⊕ x (sel 0) ⊕ ⋯ ⊕ x (sel (j - 1)): a constant
gate followed by j exclusive-or gadgets. Unlike parityProgram, it reads arbitrary inputs, folds
in a constant, and handles j = 0.
The last gate of xorChainProgram c j sel computes c ⊕ parity (x ∘ sel).
The selection stage of the XOR construction: from j selector bits r and j + 1 data
blocks of n bits, output j + 1 blocks of n + 1 bits, block i being bit i of
BitString.parityComplete c r followed by data block i.
Block i of the output of the selection stage is bit i of the completed selector followed
by data block i.
xorMixBlock C₀ C₁ runs C₁ or C₀ on the data bits according to the selector bit.
The XOR construction on circuits [SahaiVadhan2003, Lemma 3.5], on j + 1 coordinates: the
inputs are j selector bits followed by j + 1 consecutive blocks of n data bits, and output
block i is C₁ or C₀ on data block i, according to bit i of the selector completed to
parity c.
Output block i of xorMixCircuit C₀ C₁ j c on selector bits r and data blocks d is
C₁ (d i) or C₀ (d i), according to bit i of BitString.parityComplete c r.
The XOR construction on circuits samples the XOR construction of the output distributions
of C₀ and C₁, with the j + 1 output blocks flattened by Cslib.BitString.blocksEquiv.
The polarization construction on circuits [SahaiVadhan2003, proof of Lemma 3.3]: the XOR
construction on k + 1 coordinates applied to ell independent copies of the XOR construction on
lam + 1 coordinates.
The polarization construction on circuits samples the polarized pair of the output
distributions of C₀ and C₁, flattened by polarizeEquiv.
The polarized circuits are as far apart as the polarized distributions of the output
distributions of C₀ and C₁, with lam + 1 inner and k + 1 outer coordinates.