1. The problem: useful connections are fragile
Future quantum networks aim to connect devices using entanglement, a shared quantum resource. It can support tasks such as transferring an unknown quantum state between devices through a procedure called quantum teleportation. This is a transfer of quantum information, not the transport of a physical object, and it also requires an ordinary message.
The difficulty is that interactions with the environment can damage the shared resource. Even when both particles arrive, their joint state may no longer be the one the network needs. We call this unwanted disturbance noise.
BBPSSW is a recipe for trading quantity for quality: take two imperfect entangled pairs, test them together, and sometimes keep one pair that is better than either input. The name comes from its six authors: Bennett, Brassard, Popescu, Schumacher, Smolin, and Wootters, who published the protocol in 1996.
The central result: for the particular noise model studied here, if each input pair’s quality is above 50% but below 100%, a successful round produces one pair with strictly higher quality. Success is not guaranteed, and two input pairs yield at most one output pair.
This project uses Lean, a computer proof assistant, to verify that claim from an explicit mathematical description of the operations. It checks a theorem, rather than running a physical experiment.
2. The building blocks
What is a qubit?
An ordinary bit takes the value 0 or 1. A qubit is a quantum system with two reference states, also called 0 and 1. Unlike an ordinary bit, it can be prepared in a superposition of those states. A measurement in this 0/1 basis returns one ordinary outcome: 0 or 1. It does not let us read out two values at once.
What is an entangled pair?
Imagine two people, conventionally called Alice and Bob, in separate laboratories. Each holds one qubit of a pair. If the pair is entangled, its joint quantum state cannot be described simply as independent states for Alice’s and Bob’s qubits, or as a lottery over such independent states.
The ideal pair used here is a Bell state, named Phi-plus (Φ+). If Alice and Bob both measure it in the 0/1 basis, they obtain 00 or 11 with equal probability. Each individual result is random, but their results agree. Agreement in this one basis alone is not proof of entanglement—ordinary shared random bits could do that too. The Bell state also has quantum correlations in other measurement bases that distinguish it from that classical example.
Entanglement does not allow faster-than-light messaging. Alice cannot choose her random measurement outcome to send Bob a message.
How do we measure quality?
Here, fidelity, written F, measures how closely a pair matches the chosen ideal Bell state. It ranges from 0 to 1; F = 1 means a perfect match. More precisely, it is the probability of passing an ideal test that asks whether the pair is in that target state. That is a definition of quality, not a test Alice and Bob directly perform during purification.
The proof studies a special symmetric noise model called a Werner state in the project’s Bell-state convention. There are four Bell states: the target state and three alternatives. The target has weight F, and each alternative has equal weight (1 − F)/3. Think of these as probabilities describing a noisy preparation. This simplifies the problem to one quality number, but it does not describe every possible kind of noise.
3. One round, step by step
Alice and Bob start with two independent pairs of the same quality. Alice holds one qubit from each pair, and Bob holds the other two. Call the first pair the source, which might survive, and the second the target, which will be measured and used up.
- Couple the two qubits within each laboratory. Alice applies a controlled-NOT gate (CNOT) from her source qubit to her target qubit. Bob does the same with his two qubits. On 0/1 states, this gate flips the target bit exactly when the source bit is 1; it also acts coherently on superpositions. Neither person needs to send a qubit to the other during this round.
- Measure the target pair. Alice and Bob each measure their target qubit in the 0/1 basis. They now have one ordinary bit each. The target pair is consumed by this measurement; it is not a second purified output.
- Compare the results through an ordinary message. They share their bits over a classical channel, such as a conventional data link. If the results agree—00 or 11—they keep the source pair. If they disagree—01 or 10—they discard it. An accepted result is what “success” means here; it does not mean the surviving pair is perfect.
- Restore the symmetric noise form. The kept pair generally no longer has three equal error weights. Alice and Bob make a coordinated random choice of local rotations and then discard the record of that choice. This averaging, called a twirl, makes those three weights equal again while preserving fidelity to the target Bell state. The output is then described by the same kind of one-number noise model as the input.
Why can this help?
The local gates make the agreement test sensitive to some errors in the two input pairs. Rejecting disagreement removes some less favorable cases. Among the surviving cases, the target Bell state consequently has a larger share—provided the starting fidelity is in the range covered by the theorem.
This is selection, not a guaranteed repair. Alice and Bob learn whether to keep a pair without directly measuring the source qubits. They neither identify every error nor create perfect entanglement out of nothing: they spend two noisy resources and accept a chance of losing both.
4. A concrete example: 75% becomes about 78.8%
Suppose both input pairs have fidelity F = 3/4, or 75%. The verified formulas give:
- Chance that the round is accepted
- 13/18 ≈ 72.2%.
- Quality of the retained pair, conditional on acceptance
- 41/52 ≈ 78.8% fidelity, up from 75%.
- Resource cost
- Two input pairs per attempt; one output pair on success, none on failure.
For example, 1,000 attempts consume 2,000 input pairs and produce about 722 retained pairs on average. Their state, after the twirl, has the higher fidelity above. The actual number retained fluctuates. The 78.8% figure is a state-quality measure, not a count of pairs that Alice and Bob can individually label “perfect.”
The improvement is about 3.8 percentage points in one round. In principle, retained pairs can be collected and paired up for further rounds, trading away still more pairs. This project’s main theorem establishes the single-round step, not a complete long-run network performance guarantee.
5. Where the numbers come from
You can follow the rest of the page without doing the algebra. These equations make the result precise and connect the explanation to the code.
Let q = (1 − F)/3 be the weight of each of the three non-target Bell states. Let P(F) be the acceptance probability, and let F′ (read “F-prime”) be the output fidelity after a successful round.
P(F) = F2 + 2Fq + 5q2
F′ = (F2 + q2) / P(F)
The denominator counts all accepted cases. The numerator is the accepted contribution belonging to the target Bell state. Dividing by the acceptance probability is conditioning: we ask about quality among the cases we keep, rather than among all attempts. The products of input weights arise because the two input pairs are independent.
For F = 3/4, each error weight is q = 1/12. The acceptance probability is 13/18, and the numerator is 41/72. Their ratio is (41/72) / (13/18) = 41/52, as in the example.
The central inequalities are:
If 1/2 < F < 1, then F < F′ < 1 and 5/9 < P(F) ≤ 1.
In words: a successful round improves the pair without making it perfect, and acceptance has probability greater than about 55.6%. At exactly F = 1/2 the update gives 1/2 again; at F = 1 it gives 1. Neither boundary has a strict improvement. The 50% threshold belongs to this input model and target-state convention, not to arbitrary noisy quantum systems.
How the quantum state is represented in the proof
A density matrix is a table of numbers describing a quantum state, including both quantum coherence and uncertainty in its preparation. A physical density matrix is Hermitian (equal to its conjugate transpose), positive (giving nonnegative probabilities), and has trace one (total probability one). The trace is the sum of its diagonal entries.
A Bell projector is the matrix for the ideal yes/no test of one Bell state. The input density matrix is a weighted sum of four such projectors, with weights [F, q, q, q]. “Bell-diagonal” means a mixture of these Bell states without coherence between them.
The calculation first adds the two accepted measurement branches, 00 and 11. This intermediate matrix has trace P(F), rather than one. Dividing by its positive trace normalizes it into the state conditioned on acceptance.
The finite twirl used here averages three choices: do nothing, apply a particular coordinated local rotation, or apply that rotation twice. The rotation fixes the target Bell state and cycles the other three. Averaging therefore equalizes their weights. This construction is sufficient for the Bell-diagonal states produced here; it is not claimed to symmetrize arbitrary input matrices.
6. What does Lean actually verify?
A simulation might evaluate the recipe for a list of input fidelities. A mathematical proof establishes a statement for every fidelity satisfying its assumptions. Lean is a programming language and proof assistant in which definitions, theorem statements, and proofs are written so that a small logical kernel can check each inference. Mathlib supplies existing mathematical definitions and results.
This development connects the actual modeled circuit to the quality formula; it does not merely assume the formula and show that its value increases. Its main theorem, bbpssw_correct, combines these claims:
- The modeled input and final output are valid quantum density matrices.
- The local gates and accepted measurement outcomes give exactly the stated success probability, with 5/9 < P(F) ≤ 1 in the improvement range.
- After conditioning and twirling, the entire output state is the same symmetric family of state, now with fidelity F′.
- For every real F with 1/2 < F < 1, the output satisfies F < F′ < 1.
The calculations use exact mathematics, not floating-point tolerances or sampled test cases. The repository includes recorded build results and an axiom audit for 42 named theorems. The audit checks the foundational assumptions each theorem depends on, including dependencies reached through other theorems. It permits only Lean’s standard propext, Classical.choice, and Quot.sound, not custom unproved mathematical claims or incomplete proof placeholders.
A checked proof is strong evidence for the statement that was encoded. People still need to review whether the definitions capture the intended physics and whether the theorem matches the paper. Lean does not independently certify a laboratory device or the interpretation of a model.
7. Assumptions and limits
- Restricted inputs. The two pairs are independent, identically prepared Werner pairs with the same fidelity. Correlated pairs, unequal input fidelities, and general noise models are not covered by the main theorem.
- Ideal operations. Gates, measurements, and the coordinated twirl are modeled without implementation errors. The result does not establish robustness to faulty hardware.
- One round, with a conditional output. Acceptance probability is proved, but higher output fidelity applies only when the round succeeds. The proof does not claim that every attempt yields a better pair.
- No optimality or long-run rate theorem. It does not prove this is the best possible protocol, or establish the paper’s full asymptotic distillation result—a guarantee about the number of good pairs obtainable from very many inputs. It also does not verify the separate hashing protocols used in such analyses.
The precise contribution is a machine-checked bridge from a specified one-round circuit to a valid output state, an exact acceptance probability, and a strict improvement in fidelity.
8. Explore and check the proof
The complete Lean project lives in bbpssw-lean/. You do not need to run it to understand the result. If you want to examine the formal argument, these are its main pieces; file paths below are relative to that directory.
BBPSSW/Basic.lean— Defines states, Bell projectors, and fidelity, and proves that the input states are physically valid.BBPSSW/Recurrence.lean— Proves the properties of the probability and fidelity formulas, including the exact 75% example.BBPSSW/Protocol.lean— Models the local gates, measurement outcomes, acceptance, and conditioning.BBPSSW/Twirl.lean— Proves that the explicit local averaging restores the symmetric state with the updated fidelity.BBPSSW/Main.lean— Assembles the main correctness theorem.Audit.lean— Checks the allowed foundational assumptions of the listed theorems and prints the main result.
Run the verification yourself (macOS or Linux)
First download or clone the repository. In a terminal, from its root directory, run:
cd bbpssw-lean
bash run.sh
The script installs the Lean toolchain manager into your user account if needed, downloads the pinned Lean 4.19.0 toolchain and Mathlib dependencies, builds the proofs, and runs the audit. The first run needs Git, curl, an internet connection, several gigabytes of free disk space, and time for downloads and compilation. Review the script before running it if you do not want it to install tools automatically.
With the toolchain and dependencies already available, the core commands from bbpssw-lean/ are:
lake build
lake env lean Audit.lean
lake is Lean’s project build tool. A successful audit prints BBPSSW AUDIT PASSED. The runner also writes build.log and audit.log. See the project README for setup notes and the verification record and saved logs for the recorded checks.
9. The original research
C. H. Bennett, G. Brassard, S. Popescu, B. Schumacher, J. A. Smolin, and W. K. Wootters, Purification of Noisy Entanglement and Faithful Teleportation via Noisy Channels, Physical Review Letters 76, 722–725 (1996).
The formalization targets the paper’s Equation (7) and protocol steps A1–A3, with the corrected success-probability bound. It uses Phi-plus as the ideal state, a convention related to the paper’s by local changes of basis (rotations of individual qubits). Its explicit three-choice twirl is an equivalent averaging construction for the states encountered here, not a verbatim implementation of the paper’s corrected rotation list.
In short: BBPSSW sacrifices some noisy entangled pairs to improve the ones retained. This project makes the assumptions explicit and has Lean check the mathematics of that trade-off for one complete round.