Documentation

CslibFrontier.Computability.MCSP.AntiChecker.Generator

The anti-checker generator as an oracle circuit #

generator n s ℓ R is an explicit oracle circuit that, given the truth table of a function f on n inputs, runs R rounds of the threshold greedy (Cslib.MCSP.AntiChecker.greedy) and appends the chosen samples. Each greedy round is one selection round (Cslib.Circuits.Boolean.selectionRound): round r has one oracle gate for each of the 2 ^ n inputs y, in the order of Cslib.BitString.enum. The gate for y asks about the exact query word encQuery (Query.ofSamples n s ℓ (R - 1 - r) (P ++ [(y, f y)])), where P are the samples chosen in the earlier rounds. Its bits are read from constants (the unary parameters, the bits of y and the framing) and from wires (the earlier samples and the table entry of y). The round appends the sample (y, f y) of the first accepted y, or (default, f default) when none is accepted, as the greedy does.

So, under any oracle O, the samples in the output (samplesOf) are exactly those of the greedy against O's answers to the greedy's queries (samplesOf_eval_generator), and each is a correct pair (y, f y) (snd_eq_of_mem_samplesOf_eval_generator). With power ℓ = L + 200 and R = L (L + 200) + 1 rounds, where L is the certificate length, and any oracle that agrees with antiCheckerOracle on query words, such as the P/poly language of exists_mem_PPoly_agrees_antiCheckerOracle, the chosen inputs are an anti-checker for the circuits with at most s gates against every f that needs more gates than n of them and their strict majority (isAntiChecker_samplesOf_generator). A later query about the samples of an output can read them from its blocks (map_querySources_blockSources).

The generator has R (2 + 2 ^ n (3 n + 5)) gates, R 2 ^ n oracle gates and at most R oracle gates on any path. Round r asks queries with r + 1 samples, so query lengths differ between rounds. They are not padded, so every query is an encQuery word, and queryLength n s ℓ R R bounds the fan-in of every gate. For the anti-checker parameters, the number of rounds and the query length are polynomial in n + s.

This is the library's deterministic greedy, not the proof of Oliveira, Pich and Santhanam, Lemma 4.1. Replacing the oracle gates by circuits for the oracle, under NP ⊆ P/poly, is done in CslibFrontier.Computability.MCSP.AntiChecker.Efficient, which proves that lemma.

Main definitions #

Main results #

References #

Query words read from sources #

The sources of the query with parameters n, s, ℓ, u and samples whose inputs and labels are read from the sources P: the parameters as constants, then the frame of each sample.

theorem Cslib.MCSP.AntiChecker.map_querySources {K : ℕ} (v : BitString K) (n s ℓ u : ℕ) (P : List (List (Circuits.Boolean.Source K) × Circuits.Boolean.Source K)) :
List.map (Sum.elim v id) (querySources n s ℓ u P) = encQuery { arity := n, size := s, power := ℓ, threshold := u, samples := List.map (fun (p : List (Circuits.Boolean.Source K) × Circuits.Boolean.Source K) => (List.map (Sum.elim v id) p.1, Sum.elim v id p.2)) P }

Reading a query word from sources. On the wires v, the sources of a query read the encQuery word of the samples read from v.

The length of a query word read from sources.

The generator #

The length of a query with threshold u and t samples of inputs of n bits, for circuits with at most s gates and power ℓ.

A greedy query with t samples has length queryLength n s ℓ u t.

theorem Cslib.MCSP.AntiChecker.queryLength_mono {n s ℓ ℓ' u u' t t' : ℕ} (hℓ : ℓ ≤ ℓ') (hu : u ≤ u') (ht : t ≤ t') :
queryLength n s ℓ u t ≤ queryLength n s ℓ' u' t'

The query length is monotone in the power, the threshold and the number of samples.

def Cslib.MCSP.AntiChecker.blockWire {n r : ℕ} (j : Fin r) (b : Fin (n + 1)) :
Fin (2 ^ n + (n + 1) * r)

Wire b of block j among r blocks of n + 1 wires after the truth table.

The sources of the sample in block j: its n input wires and its label wire.

The generator: R rounds of the threshold greedy over the truth table of a function on n inputs, for circuits with at most s gates and power ℓ. It keeps the table and appends one block of n + 1 wires per round, holding an input and its label.

def Cslib.MCSP.AntiChecker.samplesOf {n R : ℕ} (z : BitString (2 ^ n + (n + 1) * R)) :

The samples in the blocks of an output of the generator: block j holds an input and its label.

@[simp]
theorem Cslib.MCSP.AntiChecker.length_samplesOf {n R : ℕ} (z : BitString (2 ^ n + (n + 1) * R)) :

An output of R rounds holds R samples.

theorem Cslib.MCSP.AntiChecker.map_fst_samplesOf {n R : ℕ} (z : BitString (2 ^ n + (n + 1) * R)) :
List.map Prod.fst (samplesOf z) = List.ofFn fun (j : Fin R) (b : Fin n) => z (blockWire j b.castSucc)

The inputs of the samples of an output are read from the input wires of its blocks.

theorem Cslib.MCSP.AntiChecker.map_ofFn_blockSources {n r : ℕ} (z : BitString (2 ^ n + (n + 1) * r)) :
List.map (fun (p : List (Circuits.Boolean.Source (2 ^ n + (n + 1) * r)) × Circuits.Boolean.Source (2 ^ n + (n + 1) * r)) => (List.map (Sum.elim z id) p.1, Sum.elim z id p.2)) (List.ofFn fun (j : Fin r) => blockSources j) = List.map (fun (p : BitString n × Bool) => (List.ofFn p.1, p.2)) (samplesOf z)

On an output z, the sources of the blocks read the samples of z.

theorem Cslib.MCSP.AntiChecker.map_querySources_blockSources {n r : ℕ} (z : BitString (2 ^ n + (n + 1) * r)) (s ℓ u : ℕ) :
List.map (Sum.elim z id) (querySources n s ℓ u (List.ofFn fun (j : Fin r) => blockSources j)) = encQuery (Query.ofSamples n s ℓ u (samplesOf z))

Reading the samples of an output as a query. On an output z, the sources of the query whose samples are the blocks read the encQuery word of the samples of z.

theorem Cslib.MCSP.AntiChecker.length_querySources_blockSources {n : ℕ} (s ℓ u r : ℕ) :
(querySources n s ℓ u (List.ofFn fun (j : Fin r) => blockSources j)).length = queryLength n s ℓ u r

The query whose samples are the r blocks has length queryLength n s ℓ u r.

noncomputable def Cslib.MCSP.AntiChecker.queryOracle (O : Language Bool) (n s ℓ : ℕ) (P : List (BitString n × Bool)) (u : ℕ) :

The answers of a language O to the greedy's queries (P, u) for circuits on n inputs with at most s gates and power ℓ.

theorem Cslib.MCSP.AntiChecker.queryOracle_eq_true_iff {n : ℕ} {O : Language Bool} {s ℓ u : ℕ} {P : List (BitString n × Bool)} :
queryOracle O n s ℓ P u = true ↔ encQuery (Query.ofSamples n s ℓ u P) ∈ O

O answers a greedy query yes exactly when its encQuery word is in O.

The generator runs the greedy #

The generator runs the greedy. On the truth table of f, under any oracle O, the samples in the output of R rounds are those of R rounds of the greedy against O's answers, over the inputs in the order of Cslib.BitString.enum.

Every sample of the generator is a correct pair (y, f y), whatever the oracle.

The anti-checker generator #

The power of the anti-checker generator for circuits on n inputs with at most s gates: L + 200, where L is the certificate length.

The number of rounds of the anti-checker generator: L (L + 200) + 1, where L is the certificate length.

The power of the anti-checker generator is positive.

The anti-checker generator has at least one round.

The anti-checker generator. Let O agree with the anti-checker oracle on query words, and let f need more gates than n circuits with at most s gates and a circuit for their strict majority. On the truth table of f, every circuit with at most s gates differs from f on one of the inputs that the generator with the anti-checker parameters chooses.

Measures #

theorem Cslib.MCSP.AntiChecker.size_generator (n s ℓ R : ℕ) :
(generator n s ℓ R).size = R * (2 + 2 ^ n * (3 * n + 5))

The generator has R (2 + 2 ^ n (3 n + 5)) gates.

The generator has R 2 ^ n oracle gates.

The generator has at most R oracle gates on any path.

theorem Cslib.MCSP.AntiChecker.fanInAtMost_generator (n s ℓ R : ℕ) :
(generator n s ℓ R).FanInAtMost (queryLength n s ℓ R R)

Every gate of the generator reads at most queryLength n s ℓ R R wires.

The anti-checker generator has at most 610 (n + s + 1) ^ 4 rounds.

The queries of the anti-checker generator have length at most 5000 (n + s + 1) ^ 5.