Proofs and Randomness
How can a verifier be convinced by a proof it never reads in full?
The part opens with three ways a proof can be more than a document read from start to end: sampled, interactive, and zero-knowledge. It first sorts the randomized classes RP, ZPP and BPP, amplifies a one-third error by majority vote, and shows by Adleman's union bound that one coin string works for every input of a length. Circuit lower bounds and communication complexity supply the tools: random restrictions collapse a DNF, and a fingerprint decides equality of n bits with two field elements. Then proofs become conversations. A prover shows that two graphs are not isomorphic by answering random challenges, and sum-check over the field of 97 elements verifies that a formula has seven satisfying assignments, one variable a round; Shamir's extension gives IP = PSPACE. A three-colouring is proved in zero knowledge with salted-hash commitments, where a colouring with two bad edges among fifteen survives k rounds with probability (13/15)^k. The part turns on the PCP theorem: a constant number of queried bits suffices, and that is why MAX-E3SAT cannot be approximated beyond 7/8. It ends with the Unique Games Conjecture, fine-grained, parameterized and counting complexity, and MIP* = RE.
What you need. Discrete probability (independence, the union bound), arithmetic modulo a prime, and polynomials over a field.
- Mathematics, ideas and history
- BPP, hardness vs randomness, circuit lower bounds, communication complexity, IP = PSPACE, zero knowledge, PCP, UGC, fine-grained and parameterized complexity, #P
- What we build or compute
- sum-check and ZK protocols, run
What you will be able to do
Degree
- Define RP, ZPP and BPP, and compute how many independent runs push a one-third error below a target.
- Explain the graph non-isomorphism protocol and why a cheating prover is caught in half the rounds.
- Explain with Ali Baba's cave what zero knowledge means and what a simulator is.
Graduate
- Run sum-check by hand on a small formula over a prime field and bound a cheating prover's success by nd / p.
- Prove BPP is in P/poly, and prove that deterministic equality needs n bits by fooling sets.
- State the PCP theorem with its completeness and soundness, and derive the 7/8 guarantee of a random assignment for MAX-E3SAT.
Research
- State the Nisan-Wigderson and Impagliazzo-Wigderson implications from circuit lower bounds to derandomization.
- State the Unique Games Conjecture and what it would make optimal for vertex cover and MAX-CUT.
- State MIP* = RE with its quantifiers, and what it settles about Tsirelson's problem.
Industry
- Use a conditional lower bound from SETH or 3SUM to decide when to stop looking for a faster algorithm.
- Solve vertex cover for small k by a bounded search tree and Buss's kernel.
- Name the assumptions, setup and proof size behind a succinct argument before relying on it.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Degree 11 min · Graduate 33 min · Research 42 min · Industry 14 min.
- 0Checking without readingDegree1 min
- 1Randomized classesDegree2 min
- 2Hardness against randomnessResearch2 min
- 3Circuit lower boundsGraduate3 min
- 4Communication complexityGraduate3 min
- 5Interactive proofsDegree2 min
- 6Sum-check and IP = PSPACEGraduate4 min
- 7Zero knowledgeDegree3 min
- 8The PCP theoremGraduate3 min
- 9Hardness of approximationGraduate2 min
- 10The Unique Games ConjectureResearch3 min
- 11Fine-grained complexityIndustry2 min
- 12Parameterized complexityIndustry2 min
- 13CountingGraduate2 min
- 14Average case and one-way functionsGraduate3 min
- 15Frontier: MIP* = RE and proofs in practiceResearch4 min
- Recap, problems, and where this comes backAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · 中文 · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.
Checking without readingDegree1 min
I can convince you that a statement is true while you read only a handful of bits of my proof. Write the proof in a robust code, and a wrong proof is wrong almost everywhere. A few random spot checks catch it. Or we can talk. I claim a formula has satisfying assignments. You ask me random questions about polynomials, and a liar gets caught. Or I can convince you that a graph is three-colourable, and show you nothing about the colouring. Each one trades certainty for an error you can make as small as you like. How can that possibly work?
1Randomized classesDegree2 min
Randomized decision classes use probabilities over the algorithm’s own independent coins, for each fixed input. RP has polynomial worst-case running time, rejects every no-instance, and accepts each yes-instance with probability at least one half. Compositeness supplies an example. coRP reverses those roles: yes-instances always pass, and no-instances are rejected with probability at least one half. ZPP requires zero error and expected polynomial running time on every input. BPP has polynomial worst-case running time and error at most one third on every input. Identity testing is a one-sided example within BPP. P is contained in ZPP, which equals the intersection of RP and coRP; these classes lie within BPP and PSPACE. None of these definitions averages over an input distribution. An adversary may choose the input.
Any fixed error bound below one half can be amplified. Run the algorithm independently an odd number of times and take the majority answer. We evaluate this expression numerically and check it against exact rational sums. Hoeffding’s inequality gives the simpler upper bound exponential in minus the number of runs divided by eighteen. Thus a linear number of independent repetitions in the desired error exponent suffices; independence and a constant gap below one half are essential.
Amplification also gives a nonuniform simulation of BPP. Reduce each fixed input’s failure probability below one divided by two raised to the quantity n plus one, using polynomially many independent runs. A union bound over all two-to-the-n inputs of length n makes the probability that a coin string fails on any of them less than one half. Hence at least one fixed coin string works for every input of that length. This is an existence argument. Hardwire that polynomial-length string into a polynomial-size circuit or advice string. The argument does not give a uniform efficient procedure for finding it. This proves BPP is contained in P over poly. The Sipser–Gács–Lautemann theorem separately places BPP in the second level of the polynomial hierarchy and its dual.
2Hardness against randomnessResearch2 min
The Nisan–Wigderson construction links circuit hardness with pseudorandomness. Apply a hard Boolean function to overlapping subsets of a random seed. The subset system must satisfy quantitative design bounds. The theorem controls distinguishability by circuits of a specified size. A hybrid argument converts a successful distinguisher into a circuit predicting the hard function; suitable hardness amplification supplies the needed average-case hardness. Under sufficiently strong, efficiently evaluable hardness assumptions, the seed can be logarithmic in the simulated input length. Enumerating all seeds then yields deterministic polynomial-time simulation.
General arithmetic-circuit identity testing remains a central derandomization problem. Evaluating a determinant and its product expression at a point avoids explicitly expanding all factorially many permutation terms. The recorded timings measure this implementation on this host. Over a prime field, a nonzero polynomial of total degree d has at most d divided by the field size probability of vanishing at uniformly independent coordinates. The open problem concerns general circuit representations with suitable degree and field access, not this specific identity, which has a deterministic proof.
Hardness and derandomization have precise conditional connections. Impagliazzo and Wigderson showed that if some language in E, deterministic time two to a constant times n, requires exponential-size Boolean circuits, then P equals BPP. This is a circuit-hardness assumption with a particular quantitative strength, rather than a consequence of P differing from NP alone. Kabanets and Impagliazzo connected suitable deterministic identity testing over integer arithmetic circuits to a disjunction of new Boolean or arithmetic circuit lower bounds. These implications connect different problems; they do not establish an unrestricted equivalence between all lower bounds and all derandomization. Primality provides a concrete success: the AKS algorithm places it in deterministic polynomial time. Efficient probabilistic tests remain useful in practice; this engineering comparison depends on the algorithms and input sizes.
3Circuit lower boundsGraduate3 min
Circuits give a sufficient route to separating P from NP. P over poly allows a nonuniform family, with one circuit per input length and a common polynomial size bound. Every P language and, by Adleman’s argument, every BPP language has such a family. Proving SAT has no polynomial-size circuit family would imply P differs from NP, and would establish the stronger statement that NP is not contained in P over poly. It is a sufficient route, not an equivalence. Karp and Lipton showed that if NP were contained in P over poly, the polynomial hierarchy would collapse to its second level. These implications explain the interest in circuit lower bounds while retaining the natural-proof and other barriers discussed in Part 26.
Johan Håstad's tool is the random restriction. Here is a formula in disjunctive normal form: twenty terms, each the AND of three literals, OR-ed together, over fourteen variables. Fix each variable to a random value, except that with probability p it stays free. Most terms die: one false literal kills a term. If any term becomes true, the whole formula is true. What survives is tiny. This restriction leaves a function that a decision tree of depth two computes.
This experiment fixes one width-three DNF and samples restrictions independently. Each variable is left free with probability p; otherwise it is fixed to a fair Boolean value. The switching lemma bounds the probability of depth at least t by five p times the width, raised to t, in this standard formulation. The bound can be vacuous when it exceeds one. A shallow decision tree yields a small-width CNF, explaining the switch between OR-of-ANDs and AND-of-ORs. Iterating carefully chosen restrictions controls fixed-depth circuits. Parity on the remaining free variables still has decision-tree depth equal to their number; it becomes constant if none remain. Håstad’s lower-bound theorem, with fixed circuit depth and its quantitative parameters, is a separate asymptotic result.
Other circuit models require their own exact restrictions. Parity lower bounds hold for constant-depth AND, OR and NOT circuits; Razborov and Smolensky extend the method to modular gates over a fixed prime characteristic different from the target parity modulus. Monotone-clique lower bounds exclude negation and depend on the clique-size regime. They must not be transferred to unrestricted Boolean circuits. Williams proved that NEXP has no polynomial-size nonuniform ACC-zero circuit family, with fixed depth and fixed allowed modular gates. His algorithm-to-lower-bound connection is a theorem about those circuit classes, not a solution of P versus NP.
4Communication complexityGraduate3 min
Equality illustrates how randomness can reduce communication. Assume equal-length n-bit strings and a prime field. Alice chooses a uniform field element, evaluates her string polynomial there, and sends the point and value. Bob evaluates his own polynomial at that point. This is a private-coin one-way protocol. Each field element uses the ceiling of log base two of the field size bits. The large-input rows are analytic communication bounds, not experiments on trillion-bit inputs. Equal strings always agree. For unequal strings, the difference polynomial has degree at most n minus one, so the error is at most that degree divided by the field size. Deterministic equality needs linear communication in the standard model. Randomization trades this communication for explicitly bounded one-sided error.
How do you prove that a protocol needs many bits? Write the function as a matrix, Alice's input for the row, Bob's for the column. A protocol that exchanges c bits cuts this matrix into at most two to the c rectangles, each constant. For equality the matrix is the identity. No rectangle can contain two diagonal ones, because a rectangle containing x, x and y, y also contains x, y, which is zero. So two to the n rectangles are needed, and n bits. Linear algebra gives the same bound through the rank of the matrix. Some functions resist even randomness. Deciding whether two sets intersect needs a linear number of bits, randomized or not. And whether the logarithm of the rank always predicts the true cost, up to a polynomial, is the log-rank conjecture, open since 1988.
Communication lower bounds explain some streaming-space limits. In a one-pass protocol, Alice processes the first portion of a stream and sends its memory state to Bob, who processes the rest. A streaming algorithm using s bits therefore yields a one-way communication protocol using s bits. For a suitably encoded disjointness problem over a growing universe, this yields linear worst-case space bounds even with bounded error. Exact distinct counting and higher frequency moments have hard instances in the relevant models. The first frequency moment in an insertion-only stream is simply the stream length and needs only a counter. The Alon–Matias–Szegedy results establish specific approximation and space trade-offs, rather than a universal lower bound for every statistic. HyperLogLog and Count-Min choose approximation to obtain useful small-space guarantees. The pass count, update model, universe size and desired error remain part of each statement.
5Interactive proofsDegree2 min
How do you prove that two graphs are different? For sameness, the matching of vertices is a short certificate. For difference, none is known. But a conversation works. The verifier flips a coin, picks one of the two graphs, scrambles its vertex labels, and shows the result to the prover. The prover, who has unlimited computing power, says which graph it came from. The verifier accepts if the answer matches the coin. If the graphs really differ, the prover can always tell, and our honest prover was right every time. If they are the same, the scrambled graph carries no information about the coin, and the prover can only guess: forty-nine percent in our two thousand rounds. Twenty rounds push a bluffer's chances below one in a million. Interaction has proved something no known written proof can.
IP formalizes interactive proofs with a probabilistic polynomial-time verifier and a computationally unbounded prover. The conversation has polynomially many rounds and polynomial communication. Completeness says that for a true input there exists a prover strategy making the verifier accept with probability at least two thirds. Soundness says that for a false input every prover strategy is accepted with probability at most one third. The input is fixed; probability is over verifier randomness. Goldwasser, Micali and Rackoff introduced the framework together with zero knowledge. Babai’s Arthur–Merlin protocols expose the verifier’s random coins. Constant-round AM is distinguished from the full polynomial-round class. Goldwasser and Sipser showed that private coins can be replaced by public coins with controlled round overhead; allowing polynomially many rounds preserves the power of IP. NP is the one-message deterministic-verification special case. IP equals PSPACE, but a strict separation between NP and IP has not been proved.
6Sum-check and IP = PSPACEGraduate4 min
Arithmetization converts a Boolean formula into a polynomial. Negation becomes one minus the variable; conjunction becomes multiplication; a clause becomes one minus the product of the false-literal indicators. On Boolean points this polynomial equals the formula. Summing over the Boolean cube therefore gives its satisfying-assignment count modulo the field characteristic. We use the prime field of ninety-seven elements. For this formula each variable occurs at most once per clause, so five is a valid individual-degree bound. Our implementation also handles repeated occurrences by enlarging that bound. The example has seven satisfying assignments, smaller than ninety-seven, so no ambiguity from modular counting arises. In general, a modulus larger than the possible count, or additional reconstruction information, is needed to recover the integer count. The protocol itself verifies a field-valued sum.
The verifier reduces the claimed sum one variable at a time. In each round the prover sends a univariate polynomial as six values at distinct field points, fixing a degree-at-most-five polynomial. The values at zero and one must add to the current claim. Only after receiving the message does the verifier draw an independent uniform challenge and update the claim by interpolation. After four rounds, the verifier evaluates the original arithmetized formula at the four challenges and compares it with the final claim. Communication and verifier arithmetic are polynomial in the number of variables, the degree bound and field-element bit length.
Soundness concerns every prover strategy, including adaptive ones. If the current claim is false, any polynomial that passes the sum-at-zero-and-one check must differ from the true polynomial. Two distinct polynomials of degree at most d agree at no more than d field points. Therefore, conditioned on any earlier transcript where the claim is still false, the next independent uniform challenge repairs that false claim with probability at most d divided by the field size. If no round repairs it, the final direct evaluation rejects. A union bound gives n d divided by the field size; a sequential conditional argument also gives one minus one minus d over p to the n. Independence between success events is unnecessary. Our specific cheating strategy adds a polynomial with chosen roots. Its measured frequency comes from three thousand trials, with ordinary sampling uncertainty. It is not a counterexample when a sample proportion lies above a theoretical probability bound. A larger field lowers the soundness bound.
This was a breakthrough. Sum-check shows that counting solutions has interactive proofs, far beyond NP. Weeks later Adi Shamir extended it to quantified formulas: a for-all becomes a product, an exists becomes one minus a product, and the same round-by-round checking works. A trick to keep the degree low makes it go through n quantifiers. In the other direction, an optimal prover can be simulated in polynomial space. So IP equals PSPACE: a polynomial-time verifier with coins can be convinced of anything provable in polynomial space, such as who wins a board game from a given position. And the proof does not relativize: there are oracles relative to which it is false. It was the first major technique to get past Part 26's first barrier.
7Zero knowledgeDegree3 min
Here is the classic story. A cave is shaped like a ring, with a door at the back that opens only with a secret word. Peggy walks in by one of two paths while Victor waits outside. Then Victor shouts which path she should come back by. If she knows the word, she can always comply, opening the door if needed. If not, she is caught half the time. After twenty rounds, a bluffer survives with probability one in a million. And Victor learns nothing about the word. He could have produced an identical video with an actor who doesn't know it, by simply editing out the failed rounds. That is the definition of zero knowledge: whatever the verifier sees, he could have simulated himself.
Goldreich, Micali and Wigderson obtained zero-knowledge proofs for NP using suitable commitments and reductions. Here is the three-colouring teaching protocol. Every round freshly permutes the three colours. The prover commits to each vertex using a salted hash. The honest verifier uniformly selects an edge only after commitments have been sent. The prover opens the endpoint commitments, and the verifier checks both hashes and the two colours. Different colours pass; equal colours fail. Fresh independent rounds amplify soundness under the commitment assumptions. The public graph and the claim of colourability are already known to the verifier.
The measured cheating experiment fixes an invalid colouring rather than solving a cryptographic attack. The supplied colouring has two bad edges among fifteen. With independent uniform edge challenges and binding commitments, it survives k rounds with probability thirteen fifteenths to the k. The table compares two thousand actual trials with this exact finite model. A colouring with only one bad edge has the weaker survival bound one minus one over the number of edges, raised to k. Three hundred and one rounds put that bound below one in a billion.
The histogram measures one carefully limited part of the verifier’s view. For a valid colouring and a fresh uniform colour permutation, the two opened endpoint colours form a uniform ordered pair of distinct colours. A simulator can sample that pair distribution without knowing the colouring. This equality is exact for the marginal distribution. Six thousand real and simulated pair samples fluctuate around one sixth for each ordered pair. A complete zero-knowledge argument must simulate commitments, openings, verifier randomness and the full interaction. It uses the commitment assumptions and, for arbitrary verifiers, the appropriate simulator and rewinding analysis. Fiat–Shamir can remove interaction from suitable public-coin protocols under additional security conditions.
8The PCP theoremGraduate3 min
The PCP theorem is a statement about specially encoded proofs and precise acceptance probabilities. A polynomial-time verifier uses logarithmically many random bits and queries a constant number of bits of a polynomial-length proof. For each true input there exists a proof accepted with probability one. For each false input every purported proof is accepted with probability at most one half. This does not promise to detect every isolated changed bit. Arora and Safra, and Arora, Lund, Motwani, Sudan and Szegedy established the theorem; later work refined its parameters. Håstad’s three-query refinement has completeness arbitrarily close to one and soundness just above one half. The near-perfect completeness qualifier matters; it cannot simply inherit the preceding perfect-completeness statement.
The BLR test provides an executable local-testing example, rather than a complete PCP construction. The target is a linear Boolean function: parity of a subset of the input bits, including the zero function. A constant-one offset is not linear in this convention. Draw x and y independently and uniformly, then test whether f of x plus f of y equals f of x exclusive-or y, with output addition in the field of two elements. Linear functions always pass. Independent Walsh-spectrum identities check both results. The curve three delta minus six delta squared is a lower bound in its stated distance range, not an asserted exact value for every corrupted function. Our exercise exhaustively determines all four-bit minima. Local robustness is a component used in PCP constructions; this experiment does not by itself establish the PCP theorem.
Dinur’s combinatorial PCP proof amplifies a constraint-satisfaction gap. A constraint graph represents a verifier: an assignment to its labels must satisfy all constraints in a yes-instance. Initially, a no-instance may force only an inverse-polynomial fraction of constraints to fail. Expander-based powering increases a sufficiently small gap by a controlled constant factor; it also changes the alphabet and graph size. Alphabet reduction and composition control that growth. These steps require careful completeness and size analysis; the gap does not double without limits. After logarithmically many amplification stages, the no-instance has a constant unsatisfied fraction while the total construction remains polynomial. This gives the PCP theorem through a combinatorial route.
9Hardness of approximationGraduate2 min
PCPs imply hardness of approximation through a gap-preserving reduction. Encode each verifier acceptance test as a bounded-arity constraint, with proof bits serving as assignment variables. Perfect completeness gives an assignment satisfying every constraint in a yes-instance. Soundness bounds the fraction that any assignment can satisfy in a no-instance, leaving a constant gap. Conversion to a particular clause format may change that constant. An approximation strong enough to distinguish the two cases would solve the original NP-hard decision problem. The objective, reduction, completeness and soundness parameters determine the actual approximation threshold.
Consider MAX-E3SAT with three distinct variables in each clause. A uniform random assignment satisfies each such clause with probability seven eighths, so linearity of expectation guarantees that fraction on average. Conditional expectation can derandomize this guarantee. Their better scores concern this sample distribution and do not improve a worst-case approximation guarantee. Håstad proved that for every fixed positive epsilon, distinguishing satisfiable instances from instances with optimum at most seven eighths plus epsilon is NP-hard. Consequently, a deterministic polynomial-time algorithm beating that threshold would imply P equals NP.
Compare approximation thresholds only for the stated optimization problems and models. MAX-E3SAT has the seven-eighths guarantee. The MAX-E3LIN result instead concerns distinguishing almost-satisfiable linear systems from systems whose optimum is near one half; exactly satisfiable linear systems are solved by elimination. Set-cover hardness has logarithmic dependence on the universe size. Clique hardness gives an n to the one-minus-epsilon barrier, while the trivial n approximation is merely a simple baseline, not the best known algorithm. Vertex cover and MAX-CUT retain gaps between unconditional algorithms and known hardness. The next chapter explains which sharper barriers would follow from the Unique Games Conjecture.
10The Unique Games ConjectureResearch3 min
A general unique game assigns labels from a finite alphabet, and each directed edge specifies a permutation relating its endpoint labels. Knowing one endpoint label uniquely determines the other. The drawing and experiment use the special case of cyclic shifts modulo k. For a satisfiable connected instance, choose a root label, propagate along a spanning tree, and check every remaining edge. General permutation games may require trying each possible root label. The Unique Games Conjecture says that for every positive completeness and soundness tolerance, some sufficiently large fixed alphabet makes distinguishing almost-satisfiable instances from instances with very small optimum NP-hard. The hard distinction is approximate satisfiability. It does not contradict the easy test for fully satisfiable games, and the planted shift instances are not a general hardness experiment.
This finite experiment plants a labelling on a connected simple graph, then corrupts a specified number of edge shifts. Ten chosen roots supply the displayed best propagation score. With no corrupted edges, propagation satisfies every constraint. After corruption, a spanning-tree mistake can spread through a subtree. The planted labelling’s displayed score is a lower bound on the true optimum, not a computed optimum certificate. The random baseline now uses independent label draws from one seeded generator per trial. An earlier implementation reset the generator at every vertex and produced constant labels; that original data is preserved. General unique-game approximation theorems and conjectured worst-case hardness use their own promises and alphabet parameters.
The consequences below are conditional on the Unique Games Conjecture, except where a separate theorem is explicitly stated. It would make improving vertex cover below factor two by any fixed positive constant NP-hard. It would make the Goemans–Williamson MAX-CUT approximation constant optimal up to arbitrarily small additive error in the appropriate worst-case sense. Raghavendra’s theorem concerns each fixed finite-domain, bounded-arity MAX-CSP: a canonical semidefinite relaxation and rounding achieve its optimal approximation threshold under the conjecture. It does not cover every optimization problem. Subexponential algorithms solve certain near-satisfiable unique-game promises with parameter-dependent runtimes. They neither refute the conjecture nor establish P equals NP. The Grassmann-graph and two-to-two games results establish related hardness theorems with different completeness promises. In particular, the known unique-game hardness regime with completeness near one half must not be confused with the conjecture’s near-one completeness requirement. These are precise conditional and partial results; our planted seven-label experiment decides none of the outstanding worst-case questions.
11Fine-grained complexityIndustry2 min
NP-hardness alone does not prove an exponential lower bound. Fine-grained hypotheses ask more specific questions about achievable exponents. SETH says that for every fixed positive epsilon, some fixed clause width rules out a two-to-the-one-minus-epsilon-times-n SAT algorithm in the specified deterministic model. The 3SUM and APSP hypotheses concern fixed exponent improvements over quadratic and cubic time, with input and machine models stated. Logarithmic speedups do not refute them. Split a sparse bounded-width SAT instance’s variables into two halves. Each partial assignment becomes a vector whose coordinates identify clauses it fails to satisfy. Two vectors are orthogonal exactly when their combined assignment satisfies every clause. Under the dimensional and polynomial-overhead conditions, a fixed exponent improvement for the relevant OV family would refute SETH. The three hypotheses are distinct conditional assumptions.
We execute the SAT-to-orthogonal-vectors reduction on six complete finite inputs. Each formula has twenty-four variables and a hundred and one clauses. Orthogonal-vector search is checked with a separate native implementation. Positive pairs decode to satisfying assignments; SAT statuses are also cross-checked with native Glucose. Each pair of half assignments corresponds to one full assignment, so the full cross-product has two to the twenty-fourth pairs. Search may stop early on positive instances.
The timing table uses finite negative instances with explicit certificates. Every vector in the OV fixtures shares bit sixty-three, so no orthogonal pair exists. Every integer in the 3SUM fixtures is odd, so three of them cannot sum to zero. These loops show roughly quadratic growth over the measured sizes.
12Parameterized complexityIndustry2 min
Parameterized algorithms separate dependence on a small parameter from dependence on the input size. For vertex cover of budget k, choose an uncovered edge. Every valid cover contains at least one endpoint, so branch on the two choices. The search tree has at most two to the k-plus-one minus one nodes. Each node still performs graph work; a small parameter does not by itself promise a practical runtime on arbitrarily large inputs. Buss’s rule forces a vertex whose degree exceeds the remaining budget. After applying it, too many remaining edges certify failure; otherwise an equivalent quadratic-size kernel remains.
Fixed-parameter tractability has a precise runtime definition. FPT means time f of k times n to a constant exponent independent of k. Vertex cover is FPT; the displayed one-point-two-seven-three-eight-to-the-k bound is a dated 2010 algorithmic example, not a verified current-record claim. Parameterized clique is W-one-hard. An FPT algorithm would collapse FPT and W-one; this does not rule out every improvement to the naive n-to-the-k enumeration. Stronger exponent barriers require stronger assumptions such as ETH. Treewidth measures how a graph can be decomposed into a tree of small overlapping bags. Courcelle’s theorem gives linear input-size dependence for each fixed monadic-second-order formula and fixed treewidth bound, with parameter-dependent constants and decomposition conditions. Colouring with a fixed palette, Hamiltonicity and independent-set variants illustrate this structural approach. Arbitrary formulas and unbounded treewidth are outside that fixed-parameter statement.
13CountingGraduate2 min
NP asks whether a polynomially bounded witness exists. Counting asks how many such witnesses are accepted. A number-P function counts accepting witnesses of a polynomial-time verifier under a fixed polynomial witness-length convention. For zero-one matrices, compare the determinant’s signed permutation sum with the permanent’s unsigned sum. The determinant is computable in polynomial time. Gaussian elimination has cubic arithmetic-operation complexity; integer bit complexity needs an additional size analysis. The permanent of a bipartite adjacency matrix counts perfect matchings exactly. Valiant proved that this counting problem is number-P-complete even though deciding whether a perfect matching exists is in P.
The measurements compare two exact integer implementations on retained random zero-one matrices. Ryser’s inclusion-exclusion formula uses exponentially many subsets with Gray-code updates. We independently check its complete integer result using a native assignment-subset dynamic program. The twenty-by-twenty matrix has the displayed exact perfect-matching count. Bareiss elimination gives exact determinants, including for the retained two-hundred-by-two-hundred matrix. An independent native modular determinant plus Chinese-remainder reconstruction certifies each complete integer using a Hadamard bound.
Counting has striking relationships with decision and approximation. Toda’s theorem places the polynomial hierarchy inside deterministic polynomial time with a number-P oracle. We state this oracle-class inclusion without deriving a query-count refinement here. Valiant and Vazirani give randomized isolation reductions connecting SAT with the promise of a unique solution. This is not a deterministic NP-completeness claim for the unique-solution promise problem. Stockmeyer’s approximate counting uses randomness and an NP oracle to obtain a specified multiplicative accuracy with polynomial dependence on the relevant precision parameters. It is not an ordinary polynomial-time counting algorithm. Jerrum, Sinclair and Vigoda give a fully polynomial randomized approximation scheme for the permanent of nonnegative rational matrices, including input-bit, accuracy and failure-probability costs. For planar graphs, Pfaffian methods count perfect matchings exactly under their specified graph and weight conventions. Structural restrictions can therefore change the counting problem substantially.
14Average case and one-way functionsGraduate3 min
Worst-case NP-hardness does not establish average-case cryptographic hardness. Planted clique gives a specific distributional example. Generate a thousand-vertex random graph with independent fair edges, then plant a clique on a uniformly chosen vertex subset. Twice the base-two logarithm of n is a rough asymptotic reference for the largest background clique. It is not a deterministic finite threshold proving uniqueness of the planted set. The degree heuristic selects high-degree vertices and applies the stated score-based cleanup. Each plotted recovery rate uses twenty actual trials, so sampling uncertainty matters. Spectral algorithms reach different size regimes under their own assumptions and success guarantees. Planted-clique hardness conjectures specify the clique-size regime, distribution, recovery or detection task and computational model. Information-theoretic identifiability and efficient recoverability are different questions.
A one-way function must be efficiently computable yet hard for every probabilistic polynomial-time inverter on its specified random-input distribution. Success means finding any valid preimage, and the allowed success probability must be negligible as the security parameter grows. A finite timing difference is not that definition. The experiment multiplies sampled balanced primes and factors their products with bounded Brent-style rho. The familiar fourth-root-of-the-product rho estimate assumes balanced factors and random-map heuristic behaviour. Actual trials can vary, and budget exhaustion returns no factor without a primality or hardness conclusion. More powerful factoring methods exist; dated record factorizations and this small rho implementation should not be conflated. Factoring-based one-way-function candidates require an appropriate input and preimage domain and an average-case hardness assumption. Their existence does not follow from P differing from NP alone.
Average-case complexity provides the bridge from algorithms to cryptographic assumptions. Levin’s distributional problems specify both a language and an efficiently samplable input distribution; the reduction must preserve the relevant average-case guarantees. Håstad, Impagliazzo, Levin and Luby showed that one-way functions imply pseudorandom generators, with the necessary quantitative reductions. Further constructions give fundamental private-key primitives. Public-key encryption requires additional capabilities and does not follow from an arbitrary one-way function by this theorem. Ajtai’s lattice results relate particular average-case problems to specified worst-case approximate lattice problems, with dimension and approximation parameters. Regev’s original LWE result uses a quantum reduction from appropriate worst-case lattice problems under its modulus and noise conditions. Worst-case-to-average-case reductions from unrestricted NP-complete problems face known barriers in particular reduction models. Those barriers do not establish that cryptography is impossible.
15Frontier: MIP* = RE and proofs in practiceResearch4 min
These proof models give a chain of class inclusions; not every adjacent inclusion is known to be strict. Ordinary polynomial-time witness verification gives NP. Polynomial-round randomized interaction with one unbounded prover gives IP, equal to PSPACE. Multiple classical provers who cannot communicate during the protocol give MIP, equal to NEXP. Their strategies can be agreed beforehand. Entangled provers change the class dramatically. The MIP-star theorem, first announced in 2020, gives equality with the recursively enumerable languages. A classical polynomial-time verifier can check an appropriate interaction encoding halting, while the provers may need unbounded finite-dimensional resources. This does not give a uniform algorithm deciding halting; the theorem’s completeness and soundness quantifiers remain essential.
The result has consequences for mathematical models of quantum correlations. The verifier asks separated provers questions and tests their answer correlations. The permitted entanglement helps honest strategies but also enlarges the cheating strategies covered by soundness. The tensor-product model allows finite-dimensional entangled resources without a computable uniform dimension bound sufficient for all instances. Recursive compression links games checking games to computations of unbounded duration. We describe this architecture without reproducing the full proof. The theorem separates the closure of finite-dimensional tensor-product correlations from the commuting-operator correlation model, yielding a negative answer to the relevant Tsirelson problem. Through known equivalences it also refutes Connes’ embedding conjecture.
Practical proof systems combine several ingredients with distinct security assumptions. Arithmetize a specified bounded computation into field constraints. Some systems use sum-check or related interactive oracle proofs to reduce verification work. Commitments bind the prover to the relevant polynomials or oracles; the commitment scheme determines important assumptions and costs. Fiat–Shamir removes interaction only for suitable protocols under an appropriate analysis, often in a random-oracle model. A fixed real hash is an instantiation rather than an unconditional theorem. Groth16 has constant-size proofs in group elements under its algebraic assumptions and structured setup. Transparent systems use different assumptions and typically different proof-size trade-offs. Validity rollups can aggregate transaction verification into such arguments; optimistic rollups follow a different dispute-based mechanism. A zkVM proves a bounded execution according to an encoded machine and constraints. Zero knowledge is an additional property and must not be inferred from succinctness alone. Proof size and verifier work depend on the system, security parameters and public input. Prover overhead can be substantial.
Here are the broader questions behind the examples. Does randomness increase the power of polynomial-time computation, and what new hardness results would derandomization imply? What is the status of the precise near-satisfiable Unique Games promise? How do the stated variants of SETH, 3SUM and APSP relate through fine-grained reductions? We do not assert an equivalence between them. Over a suitable field, such as characteristic zero, does the permanent require superpolynomial arithmetic circuits? Characteristic two is different because signs vanish and permanent equals determinant. Can useful average-case cryptographic hardness be derived from standard worst-case assumptions through suitable reductions? The reduction model matters. How do exact local-test soundness bounds behave as the dimension grows? Our exhaustive four-bit BLR computation settles only that finite domain. The research exercise starts with complete finite witnesses, then asks which general patterns can actually be proved.
Recap, problems, and where this comes backAll tracks3 min
This part built executable examples of amplification, fingerprints, random restrictions, interactive proofs and sum-check; checked salted-hash commitments and opened-colour marginals; explored PCP and approximation theorems, unique games, fine-grained and parameterized algorithms; and compared exact counting with average-case experiments. Full finite inputs, models and transcripts support the measurements. A marginal simulator histogram and a small hash-challenge demonstration do not independently establish cryptographic security.
Where this returns: Part 28 develops error-correcting codes and local testing; Part 29 studies pseudorandom generators and one-way functions; Part 30 develops suitable identification, signature, lattice and succinct-argument constructions with their assumptions. Part 53 studies quantum entanglement; Part 56 returns to expanders; Part 57 connects learning hardness with specified computational assumptions. Each connection uses a precise construction rather than a universal conversion between proof systems.
In practice, choose the object and guarantee first. Fingerprints need a length, field or hash model and an error bound. Succinct verification needs a specified computation and proof-system assumptions. Zero knowledge needs a simulator-based definition for the full verifier view. Fine-grained lower bounds apply conditionally to their exact input and machine models. Parameterized methods trade parameter dependence against input-size work; a small kernel and measured implementation costs help decide whether that trade is useful.
Six exercises connect the definitions with complete finite checks. Prove amplification and the deterministic equality lower bound. Prove sum-check soundness using conditional probabilities, and verify Buss’s kernel argument. Build the transcript-bound hash-challenge demonstration for the structured twenty-variable formula, with canonical serialization, domain separation, uniform challenges and explicit mutation checks; it is not a general security proof. Finally compare all sixty-five thousand five hundred and thirty-six four-bit Boolean functions with the exact BLR minima and inspect witnesses before proposing a higher-dimensional theorem.
Next time: errors. In 1947 Richard Hamming's weekend jobs kept dying on bad bits, so he taught the machine to fix them. Polynomials, the same ones that powered sum-check, become codes that survive scratches. Claude Shannon proved how much noise costs, and it took fifty years to reach his limit. We will scratch a QR code and recover its message. Part 28, Error-Correcting Codes.
The books and papers this part follows are on screen and in the notes. Thank you for watching.
Where it goes next. Part 28 develops error-correcting codes and local testing, Part 29 pseudorandom generators and one-way functions, and Part 30 identification, signatures, lattices and succinct arguments. Part 53 studies the entanglement behind MIP*, Part 56 returns to expanders, and Part 57 connects learning hardness with computational assumptions.
Key results
The part's results in one place, for revision.
Try it
Lab 27 · Soundness, measured: sum-check and fingerprints against their bounds
Run the film's sum-check protocol on its five-clause formula with an honest prover and with one that claims one satisfying assignment too many, over fields of growing size, and compare the cheater's survival rate with 1 - (1 - d/p)^n. Then test equality of two 64-bit strings by fingerprints and compare the error with (n - 1)/q.
python -m videos.cs.labs 27
needs numpy, scipy, matplotlib · download lab27.py ·
source on GitHubsatisfying assignments of the formula 7 (the film: seven)
honest prover, true claim accepted in 120 of 120 runs
cheater over GF(13) survives 0.868 1 - (1 - d/p)^n = 0.857 nd/p = 1.000
cheater over GF(29) survives 0.517 1 - (1 - d/p)^n = 0.531 nd/p = 0.690
cheater over GF(53) survives 0.323 1 - (1 - d/p)^n = 0.327 nd/p = 0.377
cheater over GF(97) survives 0.193 1 - (1 - d/p)^n = 0.191 nd/p = 0.206
cheater over GF(197) survives 0.102 1 - (1 - d/p)^n = 0.098 nd/p = 0.102
cheater over GF(397) survives 0.043 1 - (1 - d/p)^n = 0.049 nd/p = 0.050
fingerprints of a hard 64-bit pair, q = 17 wrong 0.948 exact 0.941 bound 63/17 > 1
the same pair, q = 769 wrong 0.023 exact 0.021 bound 63/769 = 0.082
Both protocols fail only when a random field element lands on a root of a low-degree polynomial, so the error is at most degree over field size: enlarge the field and the cheater runs out of roots.
The code (91 lines; it asserts its own result)
"""Lab 27: catch a cheating sum-check prover at the rate the theory predicts, and break a fingerprint with a small field."""
from videos.coursekit import labs
import random
import numpy as np
from explainer.cs.algo import proofs as P
TITLE = "Soundness, measured: sum-check and fingerprints against their bounds"
GOAL = ("Run the film's sum-check protocol on its five-clause formula with an honest prover and with one that claims "
"one satisfying assignment too many, over fields of growing size, and compare the cheater's survival rate with "
"1 - (1 - d/p)^n. Then test equality of two 64-bit strings by fingerprints and compare the error with (n - 1)/q.")
TASKS = [
"Run the cheater over the prime 1,000,003 for 300 trials. How many survive, and what does zero observed successes let you conclude?",
"Add a sixth clause to WEB. The degree bound d rises to 6: recompute the bound and check the measured survival still matches it.",
"Replace the hard pair by two random unequal strings. Why is the measured fingerprint error then far below (n - 1)/q?",
]
WEB = [[1, 2, -3], [-1, 3, 4], [-2, -3, -4], [1, -2, 4], [-1, 2, 3]] # chapter 6: seven satisfying assignments
PRIMES = (13, 29, 53, 97, 197, 397)
FIELDS = (17, 41, 97, 193, 257, 401, 769)
TRIALS = 400
def run(seed=0):
rng = random.Random(int(np.random.default_rng(seed).integers(2 ** 31)))
lab = labs.Lab()
n, d = 4, len(WEB)
true = P.count_sat(WEB, n)
assert true == 7
# 1. completeness: the honest prover is always accepted, and the transcript's checks hold
for p in PRIMES:
for _ in range(20):
ok, rounds, log = P.sumcheck(WEB, n, p, true, rng)
assert ok and rounds == n and all((r["g"][0] + r["g"][1]) % p == r["previous"] for r in log[:-1])
lab.row("satisfying assignments of the formula", f"{true} (the film: seven)")
lab.row("honest prover, true claim", f"accepted in {20 * len(PRIMES)} of {20 * len(PRIMES)} runs")
# 2. soundness: a prover claiming 8 survives only if some challenge hits a root of its error polynomial
surv, exact = [], []
for p in PRIMES:
s = sum(P.sumcheck(WEB, n, p, true + 1, rng, cheat=True)[0] for _ in range(TRIALS)) / TRIALS
e = 1 - (1 - d / p) ** n
se = (e * (1 - e) / TRIALS) ** 0.5
surv.append(s)
exact.append(e)
lab.row(f"cheater over GF({p})", f"survives {s:.3f} 1 - (1 - d/p)^n = {e:.3f} nd/p = {min(1, n * d / p):.3f}")
assert abs(s - e) < 4 * se + 0.01, "the cheater survives at the sequential bound, no more"
assert s <= min(1, n * d / p) + 4 * se
assert surv[0] > 0.6 and surv[-1] < 0.12, "a small field is unsound, a large one is not"
# 3. fingerprints: x = bit 16, y = bit 0, so x(r) - y(r) = r^16 - 1, padded to 64 bits
bits = 64
x = [1 if i == 16 else 0 for i in range(bits)]
y = [1 if i == 0 else 0 for i in range(bits)]
err, roots = [], []
for q in FIELDS:
wrong = sum(P.fingerprint_eq(x, y, q, rng)[0] for _ in range(4 * TRIALS)) / (4 * TRIALS)
k = sum(P.poly_eval(x, r, q) == P.poly_eval(y, r, q) for r in range(q)) / q # the exact error
err.append(wrong)
roots.append(k)
assert abs(wrong - k) < 4 * (k * (1 - k) / (4 * TRIALS)) ** 0.5 + 0.005 and k <= (bits - 1) / q
assert all(P.fingerprint_eq(x, x, q, rng)[0] for _ in range(20)), "equal strings always agree"
lab.row("fingerprints of a hard 64-bit pair, q = 17", f"wrong {err[0]:.3f} exact {roots[0]:.3f} bound 63/17 > 1")
lab.row("the same pair, q = 769", f"wrong {err[-1]:.3f} exact {roots[-1]:.3f} bound 63/769 = {63 / 769:.3f}")
lab.note = ("Both protocols fail only when a random field element lands on a root of a low-degree polynomial, so "
"the error is at most degree over field size: enlarge the field and the cheater runs out of roots.")
fig, ax = labs.figure(2, size=(11, 4.2))
grid = np.geomspace(11, 450, 100)
ax[0].plot(grid, 1 - (1 - d / grid) ** n, color=labs.GOLD, label="1 − (1 − d/p)ⁿ")
ax[0].plot(grid, np.minimum(1, n * d / grid), color=labs.MUTED, ls="--", label="union bound nd/p")
ax[0].plot(PRIMES, surv, "o", color=labs.RED, label=f"cheater accepted, {TRIALS} runs each")
ax[0].set(xscale="log", title="Sum-check: a false claim survives (n = 4, d = 5)", xlabel="field size p",
ylabel="probability the verifier accepts", ylim=(0, 1.05))
ax[0].set_xticks(PRIMES, [str(p) for p in PRIMES])
ax[0].set_xticks([], minor=True)
ax[0].legend()
qs = np.geomspace(16, 800, 100)
ax[1].plot(qs, np.minimum(1, (bits - 1) / qs), color=labs.MUTED, ls="--", label="bound (n − 1)/q, n = 64")
ax[1].plot(FIELDS, roots, "-", color=labs.GOLD, label="exact: roots of r¹⁶ − 1, over q")
ax[1].plot(FIELDS, err, "o", color=labs.BLUE, label="unequal strings declared equal")
ax[1].set(xscale="log", title="Equality by fingerprint: error against field size", xlabel="field size q",
ylabel="error probability", ylim=(0, 1.05))
ax[1].set_xticks(FIELDS, [str(q) for q in FIELDS])
ax[1].set_xticks([], minor=True)
ax[1].legend()
lab.fig = fig
return lab
Now change it
- Run the cheater over the prime 1,000,003 for 300 trials. How many survive, and what does zero observed successes let you conclude?
- Add a sixth clause to WEB. The degree bound d rises to 6: recompute the bound and check the measured survival still matches it.
- Replace the hard pair by two random unequal strings. Why is the measured fingerprint error then far below (n - 1)/q?
Problems, with solutions
Try each problem before opening its solution.
-
Amplification. Reduce BPP error from \(1/3\) to \(2^{-k}\).
Solution
Run the algorithm independently an odd number \(t\) of times. If \(X\) is the number of incorrect answers, then \(\mathbb E X\le t/3\) and a wrong majority requires \(X\ge t/2\). Hoeffding gives \(\Pr[X\ge t/2]\le e^{-t/18}\). Choose an odd \(t\ge18k\ln2\). Independence is necessary for this argument; the input is fixed. The producer checks numerical binomial tails against exact rational sums.
-
Deterministic equality. Prove an \(n\)-bit lower bound.
Solution
Fix the deterministic communication model in which each transcript leaf has a monochromatic rectangle. The \(2^n\) diagonal inputs \((x,x)\) require distinct accepting rectangles: a rectangle containing \((x,x)\) and \((y,y)\) would also contain the unequal input \((x,y)\). Thus depth is at least \(n\). If the model requires a monochromatic output leaf for both parties, there is also a rejecting leaf and the usual worst-case bound is \(n+1\) for \(n\ge1\). If only Bob outputs, Alice can simply send \(n\) bits. State which convention is being used.
For randomized equal-length fingerprints, choose a prime \(q\), view strings as polynomials of degree at most \(n-1\), and send the evaluation point and value. This costs \(2\lceil\log_2q\rceil\) bits and errs with probability at most \(\min(1,(n-1)/q)\) on unequal strings. Public coins change the accounting.
-
Sum-check soundness. Show an upper bound \(nd/p\).
Solution
Assume a prime field of size \(p\), individual degree at most \(d<p\), and a fresh uniform verifier challenge after each prover message. While the current claim is false, any message passing the endpoint-sum check differs from the true univariate polynomial. Two distinct degree-at-most-\(d\) polynomials agree at no more than \(d\) points. Conditional on any prior transcript with a false claim, the probability of repairing that claim is therefore at most \(d/p\). If no round repairs it, the final direct evaluation rejects. A union bound gives \(\min(1,nd/p)\); sequential conditional probabilities also give \(1-(1-d/p)^n\). The success events need not be independent.
The verified quantity is a field-valued sum. Integer #SAT recovery needs a sufficiently large modulus or additional reconstruction. Repeated occurrences of a variable contribute to its individual degree; an empty formula still has a well-defined constant sum.
-
Buss's kernel. Bound the residual graph.
Solution
Use a simple undirected graph and budget \(k\). A vertex of degree greater than the remaining budget must be selected, because omitting it forces all its distinct neighbours. Delete it and decrement the budget. In the residual graph, degree is at most \(k'\le k\). A cover of size \(k'\) covers at most \(k'^2\) edges; more edges imply failure. After deleting isolated vertices, at most \(k'\) cover vertices and \(k'^2\) neighbours remain. The algorithm must normalize duplicate edges before applying degree rules. The retained regression with three copies of each edge \((0,1)\) and \((1,2)\) has the one-vertex cover \(\{1\}\); the original implementation incorrectly rejected it. Linear-time kernel implementations exist, but this teaching routine repeatedly scans its edges.
-
Build: transcript-bound hash challenges. Reproduce the structured 20-variable example and its mutation checks.
Solution
The formula has ten disjoint clauses \((x_1\lor x_2),\ldots,(x_{19}\lor x_{20})\), so its count is \(3^{10}=59{,}049\). Work over \(p=2^{61}-1\), with individual degree one. The honest prover exploits the disjoint-pair factorization to sum the Boolean suffixes; this particular counting instance is easy. Native code separately enumerates all \(2^{20}\) assignments to check the count.
Canonically serialize the statement, field, degree bound and claim, followed by the full message/challenge history. Prefix the bytes with the versioned domain
CS27-SUMCHECK-FS-TEACHING-v1and a NUL byte. Derive each challenge using SHA-256 with an encoded retry counter and rejection sampling into the field; include each accepted challenge in subsequent hash inputs. The verifier checks message length, endpoint sums and the final formula evaluation. Preserve the actual messages, hashes, challenges and six cases: honest proof, changed claim, changed message, changed formula, truncation and oversized message.These finite checks establish the behaviour of this demonstration. They do not prove generic Fiat–Shamir security, a random-oracle theorem for an arbitrary protocol, zero knowledge, succinctness or security of a deployed system.
-
Research: exact BLR minima. Exhaust all four-bit Boolean functions.
Solution
Use truth-table bit \(x\) for \(f(x)\) and compare against all linear parities, including zero and excluding constant-one offsets. For each of the 65,536 functions, retain the exact Hamming distance numerator and the number of rejecting ordered pairs \((x,y)\) among 256 pairs. The producer uses Walsh coefficients; independent native code directly enumerates parities and pairs.
Distance numerator, out of 16 Minimum rejecting pairs, out of 256 0 0 1 42 2 72 3 90 4 96 5 90 6 120 7 166 8 256 Each minimum has a retained complete truth-table witness. Adding a linear parity and applying an invertible linear variable change preserve rejection and distance. They do not remove the need for a complete orbit argument when reducing a larger search. These exact finite minima do not prove a formula for every dimension.
Notes and sources
Sources
- Arora & Barak, Computational Complexity (2009), especially randomized classes, circuit complexity, interaction, PCPs and counting; Goldreich, Computational Complexity (2008); Wigderson, Mathematics and Computation (2019).
- Thaler, Proofs, Arguments, and Zero-Knowledge: inspected sum-check's degree/message checks and the random-oracle / Fiat–Shamir discussion, including the additional soundness conditions for many rounds.
- Håstad, Some Optimal Inapproximability Results, JACM 2001; inspected the downloaded February 2002 manuscript's introduction and three-query linear-equation test, including its near-perfect completeness.
- Kabanets–Impagliazzo, ECCC TR02-055 and revision: inspected the abstract's integer arithmetic-circuit hypothesis, Boolean/arithmetic lower-bound disjunction and partial formula-PIT converse. An attempted author-PDF retrieval failed and is not claimed as a downloaded proof.
- Gill; Adleman; Sipser–Gács–Lautemann; Nisan–Wigderson; Impagliazzo–Wigderson; Schwartz–Zippel; AKS: the definitions, quantitative hypotheses and representations matter, rather than an unqualified statement that all randomness is removable.
- Goldwasser–Micali–Rackoff; Babai; Goldwasser–Sipser; LFKN; Shamir; Goldreich–Micali–Wigderson; Fiat–Shamir: distinguish information-theoretic proofs, computational commitments, honest-verifier marginals and full zero knowledge.
- Arora–Safra; Arora–Lund–Motwani–Sudan–Szegedy; Dinur; Blum–Luby–Rubinfeld; Bellare–Coppersmith–Håstad–Kiwi–Sudan; Kaufman–Litsyn–Xie: finite local tests and their extremal bounds are distinct from a complete PCP construction.
- Khot; Khot–Regev; Khot–Kindler–Mossel–O'Donnell; Raghavendra; Charikar–Makarychev–Makarychev; Arora–Barak–Steurer; the 2018 Grassmann / games results: retain promise, alphabet and completeness parameters. The attempted ECCC Grassmann-page retrieval returned HTTP 503; no proof reading is claimed.
- Williams; Grønlund–Pettie; Downey–Fellows; Buss–Goldsmith; Chen–Kanj–Xia; Courcelle: hypotheses, word/bit cost, parameter dependence and dated bounds matter.
- Valiant; Toda; Valiant–Vazirani; Stockmeyer; Jerrum–Sinclair–Vigoda; Kasteleyn / Temperley–Fisher: exact, oracle-assisted and randomized approximate counting are different guarantees. The matching count uses the permanent of a bipartite adjacency matrix, not an arbitrary graph adjacency matrix.
- Levin; Håstad–Impagliazzo–Levin–Luby; Ajtai; Regev; Feigenbaum–Fortnow; Bogdanov–Trevisan; Kučera; Alon–Krivelevich–Sudakov; Pollard; Brent: average-case distribution, negligible success and lattice approximation/noise conditions remain explicit.
- Ji–Natarajan–Vidick–Wright–Yuen, MIP⋆ = RE, first announced 2020: inspected the abstract and stated consequences of arXiv v4, 16 October 2026. The finite-dimensional tensor-product/commuting-operator distinction and unbounded prover resources do not produce a halting decider.
- Kilian; Micali; Goldwasser–Kalai–Rothblum; Groth16; Zerocash; transparent argument systems: proof size, setup, zero knowledge, public input and verifier work depend on the particular construction. No production security audit is claimed here.
English/Chinese source and sampled-preview verification are separate from continuous narrated listening, synthesized Chinese speech/listening, whole-video native review and runtime approval at the chosen narration pace. Those production gates remain open.
About this partfrom its README
Part 27 of the 61-part course, Act V, Limits and Secrets. See the syllabus. This part develops randomized decision classes, interactive proofs, local testing and their connections to approximation, counting and cryptographic assumptions.
The teaching instrument is proofs.py. The producer module retains complete finite inputs, outputs and protocol records; its independent references use exact rational arithmetic, Fourier identities, native GMP subset dynamic programming and modular CRT determinants. Native Glucose cross-checks resolved SAT queries. UNSAT agreement is not called a checked proof trace.
What is computed and built
python -m unittest tests.test_cs27_proofs -v
python -m videos.cs.cs27.compute # build every missing/current item
python -m videos.cs.cs27.compute --force zk # explicit fresh run
python tools/build.py cs27 -q l # preview
python tools/build.py cs27 # native-resolution build
The 18 schema-2 producers include the 16 original experiments plus the two worked exercise computations. Each retains a raw evidence artifact before validation and a separately checked artifact afterwards, with source hashes and actual call times. Validation failures retain their full objects and failure records.
Timing tables for vertex cover, permanent/determinant and OV/3SUM use thirty actual calls per fixture, reporting medians. Multiplication uses five actual batches of 1,000 operations per size. PIT records every actual point evaluation. Serialization and independent checking occur outside the reported teaching-call intervals. These are measurements of the stated implementations on the current host.
Examples include all 7,500 sampled DNF restrictions, 2,200 GNI rounds, 3,301 complete
sum-check protocol runs, 220 planted graphs and every fixed/variable-dimension OV
input. The random unique-game baseline draws independent labels from one generator
per trial; the original constant-label bug and its data remain in the QA history.
The experiments use seeded random.Random, not a cryptographic random generator.
Chapter notes
| Chapter | Main construction and qualification |
|---|---|
| Hook | Sampling, interaction and zero knowledge have different completeness, soundness and security guarantees. |
| 1. Randomized classes | RP/coRP have bounded one-sided error; ZPP has zero error and expected polynomial time on every input. Amplification uses independent runs. |
| 2. Hardness and randomness | Quantitative Nisan–Wigderson / Impagliazzo–Wigderson implications; general arithmetic-circuit PIT is distinct from the known Vandermonde identity. |
| 3. Circuits | Nonuniform polynomial-size families, Karp–Lipton, random restrictions and exact finite decision-tree depth; circuit models and moduli remain fixed in the cited lower bounds. |
| 4. Communication | Equal-length private-coin fingerprints, exact bit accounting, rectangles/rank and one-pass streaming reductions. Insertion-only \(F_1\) is a counter. |
| 5. Interaction | Complete GNI challenge records; completeness is existential over provers and soundness universal. Public/private-coin equivalence allows controlled round overhead. |
| 6. Sum-check | Field-valued Boolean-cube sums, individual-degree checks, complete transcripts and adaptive conditional soundness. A full QBF/IP theorem is cited, not implemented. |
| 7. Zero knowledge | Salted-hash commitments and openings are retained. Opened-colour histograms check only a marginal; full zero knowledge requires the complete simulator definition and assumptions. |
| 8. PCP | Perfect-completeness PCP versus the near-perfect-completeness three-query refinement; BLR arithmetic is over \(\mathbb F_2\). |
| 9. Approximation | MAX-E3SAT's \(7/8\) guarantee, near-satisfiable MAX-E3LIN hardness and problem-specific reduction gaps. Random-instance heuristic scores are not worst-case guarantees. |
| 10. Unique games | General permutation games versus planted cyclic shifts; planted value is a lower bound on optimum. UGC and related hardness promises remain distinct. |
| 11. Fine-grained | Explicit SETH/OV dimensions and machine models; full SAT-to-OV vectors and witnesses. Fixed 64-bit negative fixtures are timing examples. |
| 12. Parameterized | Complete covers and Buss kernels; FPT/W[1] qualifications and fixed-formula, fixed-treewidth Courcelle scope. |
| 13. Counting | Exact permanent versus determinant, full matrices and independent checks; arithmetic operations versus bit complexity, oracle counting and FPRAS scope. |
| 14. Average case | Complete planted graphs and factors; finite recovery rates do not establish a hardness threshold or a one-way function. Lattice reductions retain their parameters. |
| 15. Frontier | MIP* = RE with unbounded finite-dimensional provers; protocol-specific succinct-argument assumptions, setup and public-input costs. |
| Outro | Six worked exercises, connections to later parts and the distinction between finite verification and general theorems. |
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- RP, coRP, ZPP, BPP; amplification by Chernoff (callback to AI, Built 5); BPP ⊆ P/poly (Adleman, proved); BPP ⊆ Σ₂ (Sipser–Gács–Lautemann).
- Hardness against randomness: Nisan–Wigderson; Impagliazzo–Wigderson (exponential circuit lower bounds for E imply P = BPP); primality as the poster child.
- Circuit lower bounds:
- Karp–Lipton;
- parity ∉ AC⁰ via Håstad's switching lemma, with random restrictions animated;
- Razborov–Smolensky;
- monotone clique (Razborov);
- NEXP ⊄ ACC⁰ (Williams 2011): algorithms imply lower bounds.
- Communication complexity (Yao 1979): equality, deterministic n against randomized O(log n); disjointness Ω(n); fooling sets and rank; streaming lower bounds (callback to Part 20).
- Interactive proofs: graph non-isomorphism; GMR (1985), Babai's Arthur–Merlin.
- Arithmetization and sum-check (Lund, Fortnow, Karloff & Nisan 1990), step by step over a finite field; #SAT ∈ IP; IP = PSPACE (Shamir 1990).
- Zero knowledge: Ali Baba's cave; GMW's 3-coloring protocol with commitments; simulation; Fiat–Shamir (Part 30).
- The PCP theorem (AS, ALMSS 1992; Dinur 2005): checking a proof by reading O(1) bits; gap amplification.
- Hardness of approximation: MAX-3SAT can't beat 7/8 (Håstad 2001), so a random assignment is optimal; clique n^{1−ε}; set cover ln n.
- The Unique Games Conjecture (Khot 2002): vertex cover 2 and MAX-CUT 0.878 would be optimal (Part 23); the 2-to-2 theorem (2018).
- Fine-grained complexity: SETH, OV, 3SUM, APSP; edit distance (Part 21); what conditional lower bounds buy.
- Parameterized complexity: FPT; vertex cover by bounded search trees; kernels (Buss); W[1]-hardness of clique; treewidth and Courcelle.
- Counting: #P (Valiant 1979); the permanent against the determinant; Toda's theorem; approximate counting (Jerrum, Sinclair & Vigoda; callback to MCMC).
- Average case and one-way functions, the bridge to Part 29. Outro.
Computed: Adleman's union bound in numbers; sum-check on a small #SAT instance, where a cheating prover is caught with the computed probability; ZK 3-coloring with cheating probability (1 − 1/m)ᵏ; equality by fingerprints; random assignments against the best found on MAX-3SAT; FPT vertex cover; permanent against determinant timings. Visuals: a DNF collapsing under a random restriction; sum-check's rounds as univariate polynomials; a ZK coloring revealing one edge; the PCP verifier sampling a few bits from a giant proof. In practice: zero-knowledge proofs in identity systems and blockchains, succinct proofs in rollups, conditional lower bounds that say when to stop optimizing. Reading: Arora & Barak ch. 7–11, 13–14, 18–22; Goldreich, Computational Complexity: A Conceptual Perspective; Wigderson, Mathematics and Computation; Kushilevitz & Nisan, Communication Complexity; Jukna; Thaler, Proofs, Arguments, and Zero-Knowledge; Cygan et al., Parameterized Algorithms; O'Donnell, Analysis of Boolean Functions; Vassilevska Williams 2018 (survey); Håstad 2001; Khot 2002; Dinur 2007; Shamir 1992.
中文讲义
本讲的中文部分(与英文版对应)。
习题与解答
-
放大。 对固定输入独立运行奇数次 \(t\),以多数决定答案。每次错误率至多三分之一, 错误多数需要比期望多至少 \(t/6\) 次错误。Hoeffding 界为 \(e^{-t/18}\);取不小于 \(18k\ln2\) 的奇数 \(t\),便使错误率至多 \(2^{-k}\)。不能把相关重复当作独立重复。
-
相等判定。 在每个输出叶子对应单色矩形的确定性通信模型中,\(2^n\) 个对角输入必须 属于不同的接受矩形,否则会误收交叉的不等输入,因此至少需要 \(n\) 位。双方都要由叶子 知道答案的常见约定,对 \(n\ge1\) 得到 \(n+1\) 位;若只让 Bob 输出,Alice 发送 \(n\) 位即可。 私有随机指纹假设等长串和素数域,发送点与值,成本为 \(2\lceil\log_2q\rceil\),误差至多 \(\min(1,(n-1)/q)\)。公开随机模型的计费不同。
-
Sum-check。 假设素数域、逐变量次数界 \(d<p\),且每轮先收消息,再独立均匀抽挑战。 当前声称为假时,通过端点求和检查的多项式必须不同于真实多项式,因此至多在 \(d\) 个点上 一致。对任何此前的假声称对话条件,修复概率都至多 \(d/p\)。并集界给出 \(nd/p\);逐步条件 论证给出 \(1-(1-d/p)^n\),不需要各轮成功事件独立。协议验证域上的和;整数计数还需足够大 的模数或重建信息。重复出现的变量必须计入次数,空公式也有明确的常数和。
-
Buss 核。 先把边规范化成简单无向图。若顶点度数超过剩余预算,不选它就必须选入 全部不同邻居,所以它被强制选入。剩余预算为 \(k'\) 时,最大度数至多 \(k'\),覆盖至多 \(k'\) 个顶点只能覆盖 \(k'^2\) 条边。删除孤立顶点后,至多剩 \(k'^2+k'\) 个顶点。重复边若被 误计为不同邻居,可能错误拒绝实际可解的实例;保留的三重复边路径回归展示了这个旧错误。 线性时间核化存在,但教学实现会重复扫描边。
-
动手:哈希挑战。 实际例子是十个互不相交的二变量或子句,计数为 \(3^{10}\),并用 独立本地程序枚举全部 \(2^{20}\) 个赋值核对。在 \(2^{61}-1\) 域上,证明者利用该实例的可分解 结构生成逐变量一次消息。哈希输入包括规范化语句、域、次数、声称和完整消息挑战历史, 带版本域分离与 NUL 字节,并用拒绝采样得到均匀域元素。保留真实消息、摘要、挑战以及 改动声称、消息、公式、截断和超次数等检查。教学演示不等于一般 Fiat–Shamir 安全证明, 也不自动得到零知识、简洁性或实际部署安全。
-
研究:BLR 最小值。 穷举全部四位布尔函数,保留每个函数的精确距离与拒绝有序对数量。 Python 用 Walsh 谱计算,独立本地程序直接枚举所有奇偶函数和全部 256 对输入。上表的每个 最小值都附有完整真值表见证。这里的线性函数包含零函数,不包含常数一偏移。加上线性 函数和可逆线性换元保持距离与拒绝率;把它用于更大搜索时,仍须证明轨道覆盖完整。 有限穷举没有证明所有维数的一般公式。
Build the film
python -m videos.cs.cs27.compute # the part's numbers, into .cache/cs27
python tools/build.py cs27 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py cs27 Hook # one chapter, silent, with a contact sheet
Scenes: videos/cs/cs27. Setup: see the course page. Source of these notes: the README and the scenes' narration.