The

Double Entry

Why every structure that recovers also verifies

An auditor and a coding theorist, working from different textbooks, both need 59 samples for the same confidence level. Neither cites the other; neither has reason to. This book writes down the equation behind both answers, tests it in eight fields, and shows what happens when the equation returns zero.

Or read the short version — eight beats, one scroll →
1to1.386The entire range of the verification constant g(e), across every possible amount of redundancy. A 38.6% swing in the price of checking, however the system is built.
59=59Items an auditor samples for 95% confidence at a 5% tolerable rate, and the number the coding formula gives. Two fields, two formulas, one algebraic identity.
0bitsWhat a random sample can tell you about a system that assumes its parts are independent. Not little: none, however many samples you take.

The observation

One structure, two powers

In 1494 a Franciscan friar wrote down the method Venetian merchants had used for two centuries: every transaction is recorded twice, once as a debit and once as a credit, and the two must balance. That single constraint does two jobs at once. If an entry is lost, the others determine it. If an entry is wrong, the books no longer sum to zero.

This is not a quirk of accounting. Any structural constraint that makes a system recoverable from loss makes it checkable against corruption — at a price that hardly depends on how it was built. Recovery and verification are not two properties. They are one property, measured two ways.

YearEntryRecoversVerifies
1494PacioliSumma, 27 pages on bookkeepingEvery debit has a credit. A lost entry can be rebuilt from the rest, and a wrong one breaks the balance.
1948ShannonChannel coding theoremHow much redundancy reliable communication needs: any rate below capacity.Silent. The theorem does not ask what else the redundancy does.
1964Singletond ≤ n − k + 1One inequality bounds erasure correction and error detection at once.
1971EigenThe error catastropheA genome of length L needs a per-base error rate below about 1/L. DNA gets there with three layers, each repairing what the last one missed.
1982Lamport, Shostak, PeaseByzantine generalsAgreement needs n ≥ 3f + 1. Any two quorums share an honest node, and that overlap is the redundancy.
1982Wootters, ZurekNo-cloning theoremAn unknown quantum state cannot be copied, so a backup is impossible. Only structure inside the encoding is left.
2014Almheiri, Dong, HarlowHolographic error correctionThe AdS/CFT correspondence is an error-correcting code. Whether it is an instance of this law or a parallel is left open.
2020Ben-Sasson et al.Proximity gap for RS codesThe same algebra that allows erasure recovery makes verifiable encoding possible at zero overhead.
2026The Double Entrythis bookNone of these authors stated what joins their results. The book does, as one equation, and tests it.

Two fields, one formula

The auditor and the coder never met

Auditors have sized samples this way for half a century. Coding theorists wrote the same expression from the Singleton bound. The book shows they are algebraically the same, then checks the audit tables.

Attribute sampling · ISA 530, AICPA, HUD OIG
n = ln α / ln(1 − p)

Items an auditor must examine, finding none in error, to be 1 − α confident the true deviation rate is below p.

Coding theory · the duality law
s = λ / (−log2(1 − p))

Random checks a verifier must make to reach λ bits, when each check catches the fault with probability p, and λ = −log2 α.

divide numerator and denominator by ln 2  →  the same number

Confidence · tolerable rateAudit formulaCoding formulaCheck
95% · 5%, zero deviations58.4 → 5958.4 → 59matches the published AICPA / HUD OIG table: 59
95% · 10%, zero deviations28.4 → 2928.4 → 29matches the published table: 29
99% · 5%, zero deviations89.8 → 9089.8 → 90identical (computed)
95% · 5%, one deviation allowed93—derived: P(X≤1 | 93, 0.05) = 0.0500; at 92 it is 0.0521

The law

Redundancy buys recovery and verification at once

The two formulas agree because they are the same formula. Here is the law beneath both: one equation, two powers, and a cost that barely moves.

The redundancy duality

e · s = g(e) · λ
g(e) = e / Hv,   Hv = −log2(1 − e/2),   1 ≤ g ≤ 2 ln 2
  • e, recoveryShare of the pieces that can be lost and rebuilt: (d − 1)/n.
  • s, verificationRandom positions checked against the committed codeword.
  • λ, the goalBits of security: a miss probability of 2−λ.
  • g(e), the exchange rate1 at full redundancy, 1.386 as redundancy vanishes. It never leaves that band.

The proof is three lines

  1. An adversary who corrupts the fewest symbols that could still fool a decoder corrupts ⌊(d−1)/2⌋ of them, so a random check hits one with probability p = e/2.
  2. After s independent checks, all of them miss with probability (1 − e/2)s. Setting that to 2−λ gives s = λ / Hv.
  3. Multiply by e. The ratio g(e) = e / Hv falls steadily from 2 ln 2 (as e → 0) to exactly 1 (at e = 1), so e·s is pinned within 38.6% of λ.

The formula is the geometric distribution and p = e/2 is the Singleton bound; the book says so on the page. What it claims is new is the synthesis: one parameter governing both powers, a product that hardly moves, and the same equation turning up in fields that do not cite each other.

The evidence

Eight fields, one equation

Each chapter takes a real system, reads off its redundancy, and checks what the law predicts against what is published or computed. Every number traces to a script in the downloadable code or to a cited source.

Chapter 4 · auditing

Audit sampling

59items, 95% confidence, 5% tolerable rate

The attribute-sampling formula auditors use is, step for step, the coding formula. The published table values 59 and 29 come out exactly; the one-deviation value 93 is derived.

IdentityAlgebraic, so it holds for every row, not only the checked ones.
Chapter 5 · codes

Reed–Solomon

s > kthe threshold for membership testing

Monte Carlo over GF(257): identity testing tracks the law to within sampling noise. Testing membership, without knowing the codeword, catches exactly nothing until more than k samples are drawn.

ConfirmedSimulated, then explained in chapter 15.
Chapter 6 · data availability

Blockchain light clients

144bits of confidence from 556 samples

Withholding is observable, so p = e instead of e/2. The book’s own ZODA and availability code matches the law: 354 × 0.415 ≈ 147 bits; Ethereum’s 73 samples at 1 bit each give 73.

ConfirmedArithmetic against the author’s own constants, plus the 2020 proximity-gap result.
Chapter 7 · consensus

Byzantine generals

n ≥ 3f+1e = 1/3, Hv = 0.263, g = 1.267

Quorum intersection is the constraint. Any two quorums of 2f + 1 share at least one honest node, and the overlap that prevents conflicting views is the redundancy.

Part analogyThe withholding model matches exactly; the lying model matches by structural analogy.
Chapter 8 · biology

DNA replication

33bits of fidelity per base

Polymerase 10−5 × proofreading 10−2 × mismatch repair 10−3 = 10−10. Eigen’s threshold for 3 × 109 bases is 3.3 × 10−10: a margin of 3.3×.

ConfirmedRates are sourced; the layers are treated as approximately independent.
Chapter 9 · quantum

Stabilizer codes

1.285g(e) for the [[7,1,3]] Steane code

You cannot copy a qubit, so a backup is forbidden and structure is all there is. Every stabilizer code from [[5,1,3]] to [[49,1,7]] lands inside [1, 2 ln 2], on the same curve as the classical codes.

ConfirmedComputed from each code’s parameters.
Chapter 10 · machine learning

Neural networks

84%of tiny corruptions caught in a trained network, against 5% in a random one

Perturb one weight of a trained network by 0.01 and the loss gives it away 84% of the time, with no false alarms. In a random network the detection rate is just the false-alarm rate, 4–5% at every noise level: no constraint, nothing to check against.

Direction onlyThe divide, Hv > 0 trained and 0 random, is measured. The quantitative law is not tested, because a network has no erasure tolerance e.
Chapter 11 · institutions

Human institutions

0.585bits per check, three separated branches of government

Separation of powers, replicated science and dual-source supply each add a constraint that both checks and repairs. Single-party rule, unreplicated findings and sole-source supply have Hv = 0: nothing to check against. Two independent labs give a full bit per check.

Structural analogyComputed from a model of each structure, not measured in any real institution.

The ledger of claims

Fourteen claims, and how firm each one is

A book about verification should be easy to verify. Each claim is marked as proved, confirmed against evidence, conjectured, or explicitly not claimed.

01e·s = g(e)·λ for MDS codes sampled at the unique decoding radius, with g in [1, 2 ln 2].ProvedFrom the geometric distribution. g is strictly decreasing, equals 1 at e = 1, and tends to 2 ln 2 as e → 0: a 38.6% variation.
02The auditor’s sample-size formula and the coding formula are the same expression.ProvedAlgebraic: n = ln α / ln(1 − p) is s = λ / Hv with λ = −log2 α. Checked on 21 rows of confidence and rate.
03Membership testing is blind for s ≤ k.ProvedThe information-set barrier: any k positions are consistent with some codeword. Sharp over a large field; small corrections over a small one.
04Composition law for tensor codes: stacking codes improves the trade.ProvedVerification entropy per sample multiplies across levels, and local row and column checks avoid the basis cost. This is why ZODA uses two levels.
05The audit tables match the formula.Confirmed59 and 29 match the published AICPA / HUD OIG tables. 93 for one allowed deviation is derived, not read from a table.
06ZODA’s sample counts match the law.Confirmed556 samples ≈ 144 bits, 354 × 0.415 ≈ 147, 102 × 1.26 ≈ 128, via the proximity gap for RS codes.
07The law holds for Byzantine fault tolerance.Confirmed, in partThe suppression model matches exactly. The corruption model matches by structural analogy rather than by derivation.
08DNA replication meets Eigen’s threshold through three composed layers.Confirmed10−10 per base against a threshold of 3.3 × 10−10. The layers are treated as approximately independent, as the standard multiplicative account does.
09Quantum stabilizer codes obey the same bounds.Confirmedg(e) lies in [1, 2 ln 2] for every code from [[5,1,3]] to [[49,1,7]]; the [[5,1,3]] code meets the quantum Singleton bound with equality.
10The duality holds for any constraint system with minimum Hamming distance d ≥ 2, over any alphabet, algebraic or not.ProvedThe general form (Chapter 3): recovery from d − 1 erasures implies detection of ⌊(d−1)/2⌋ corruptions. No algebraic structure is assumed; the configurations need not form a linear code and the alphabet need not be a field.
11The holographic correspondence is literally an instance of the law.OpenAnalogy or identity is left open. The constraints there are the equations of general relativity, not parity checks.
12Independence models have Hv = 0.ProvedFrom the definition of independence: jointly independent components have no cross-component constraint, so a sample reveals nothing about any other component. Hv = −log2(1 − 0) = 0 for every sample, by construction.
13Mathematical novelty in the formula.Not claimeds = λ / Hv is the geometric distribution and p = e/2 is the Singleton bound. The new thing is the synthesis.
14The law applies as an equality to non-MDS codes.Bound onlyFor LDPC, turbo and binary codes d < n − k + 1, so p < e/2: the law is an upper bound on their verification power, which MDS codes reach.

How to read the tags. Proved means derived in the text. Confirmed means checked against a published source or a reproducible computation in the book’s code/ folder. This list condenses chapters 3 and 21; the book itself does not number its claims.

Inside the book

Twenty-one chapters, three interludes, 139 pages

In a hurry? The preface says to read chapters 1, 3 and 21: the idea, the proof, and the punchline.

Part I

The Discovery

A friar, a ledger, and the law.

  1. 1Pacioli’s Ledger

    What did a Franciscan friar discover in 1494, and why does it still run the world?

    Twenty-seven pages inside a six-hundred-page encyclopedia, describing what Venetian merchants had done for two centuries. Every debit has a credit, and that single constraint gives you two things at once.

    Read chapter 1 →
  2. 2Shannon’s Other Theorem

    Everyone knows Shannon proved how much redundancy communication needs. What did the redundancy give back?

    The channel coding theorem is silent on what else redundancy does. The code’s distance determines two things at the same moment: how much loss it survives, and how much corruption it can reveal.

    Read chapter 2 →
  3. 3The Law

    What is the precise statement, what does it assume, and what is it not?

    The statement, a proof from the geometric distribution, the bounds on g, the five assumptions, and what the law is not: not a new formula, but a duality, a near-constant product, and a universality claim. Proved

    Read chapter 3 →
  4. ·Interlude: One Equation

    What does it mean for two fields to discover the same formula? When two paths through different territory reach the same destination, the destination is real.

    Read the interlude →
Part II

The Evidence

The law tested in eight fields, with every number sourced.

  1. 4The Auditor’s Formula

    Does the formula from coding theory match the one auditors actually use?

    ISA 530, the AICPA guide and the HUD OIG tables. The two formulas are identical, the published values 59 and 29 come out exactly, and 93 is derived for one allowed deviation. ProvedConfirmed

    Read chapter 4 →
  2. 5Codes and Sampling

    Does the law hold exactly for real error-correcting codes?

    Monte Carlo on Reed–Solomon codes over GF(257). Identity testing matches the law; membership testing is exactly zero up to k and then jumps to match it. Confirmed

    Read chapter 5 →
  3. 6Data Availability

    Can we verify that data exists in a distributed network, without downloading it all?

    The adversary withholds rather than corrupts. A [255,128] code and tensor ZODA, checked against the book’s own implementation: 556, 354 and 102 samples reach roughly 144, 147 and 128 bits. Confirmed

    Read chapter 6 →
  4. 7Byzantine Generals

    Does the duality hold when the adversary is not passive but actively lying?

    n ≥ 3f + 1, quorum intersection as the redundancy, e ≈ 1/3. Recovery and verification in a network of liars. Confirmed in part

    Read chapter 7 →
  5. 8The Error Catastrophe

    Did nature discover the duality three billion years before Pacioli?

    Eigen’s 1971 threshold, and the three layers of DNA repair, each of which finds and fixes an error with one structural event. 10−10 per base, about 33 bits. Confirmed

    Read chapter 8 →
  6. 9The No-Cloning Duality

    What happens to the duality when copying is forbidden by physics?

    You cannot back up a qubit, so the only protection is the double entry. Stabilizer codes from [[5,1,3]] to [[49,1,7]], all inside the band. Confirmed

    Read chapter 9 →
  7. 10The Weights That Learn

    Does training a neural network create structural constraints?

    Random weights are independent, so Hv = 0. Training binds them to the data and corruption becomes detectable. The constraint is a loss landscape rather than a parity-check matrix, so this chapter tests the direction of the law, not its quantitative form. Pruning and the lottery ticket find the weights that carry none.

    Read chapter 10 →
  8. 11The Institutional Double Entry

    Do human institutions discover the duality on their own?

    Frontinus walking Rome’s aqueducts, bridge inspections every twenty-four months, separation of powers, replicated science, dual-source supply. Each adds a constraint that gives recovery and verification at once. Single-party rule, unreplicated findings and sole-source supply are Hv = 0 systems.

    Read chapter 11 →
  9. ·Interlude: Convergence

    Eight domains, eight derivations, one equation. Eight names for the same operation: test a sample against a structural constraint.

    Read the interlude →
Part III

The Mechanism

Why the duality arises, and how to improve the trade.

  1. 12One Pool, Two Operations

    Why must recovery and verification come from the same structure?

    An [n, k, d] code has n − k independent constraints. Recovery draws on that pool to solve for what is missing; verification draws on the same pool to test what is present. A constraint that determines a missing value must be violated by a wrong one.

    Read chapter 12 →
  2. 13The Factor of Two

    Why is erasure correction capacity always twice the error correction capacity?

    An erasure is a loss at a known position; an error is a corruption at an unknown one. The Singleton gap is the factor of two between p = e and p = e/2, and it is the cost of not knowing where the problem is.

    Read chapter 13 →
  3. 14Composition

    What happens when you stack codes: does the duality improve?

    Tensor product codes check rows and columns locally. Verification entropy per sample multiplies, and the book explains why ZODA uses two levels. Proved

    Read chapter 14 →
  4. 15The k Threshold

    Why can’t you verify without a reference, and what does it cost?

    The information-set barrier and the basis cost. Two costs of verification, and how tensor codes eliminate one of them. Proved

    Read chapter 15 →
  5. ·Interlude: What Is Missing

    What about systems without structural constraints? The law says their verification entropy is exactly zero.

    Read the interlude →
Part IV

The Connection

Invisible risk, four failures, and the design frontier.

  1. 16The Blind Spot

    What happens to systems with no structural constraints?

    The link to The Rogue Wave: the exponential mispricing of independence is invisible because Hv = 0. The compound blindness: s · 0 = 0 for all s. Extrapolation

    Read chapter 16 →
  2. 17When Systems Go Blind

    What does Hv = 0 look like when it kills?

    The Gaussian copula, Challenger, Therac-25 and the 737 MAX. In every case people were checking, and found nothing, because there was nothing to find.

    Read chapter 17 →
  3. 18The Frontier

    How should you design a system that needs both recovery and verification?

    Where Reed–Solomon, BFT, Steane, CRC-32 and TCP checksums sit, how to move along the frontier, and how composition moves above it. A design tool, with the computed positions.

    Read chapter 18 →
  4. 19The Blind-Spot Audit

    How do you find the failures your system cannot see?

    A four-step method: list the failure modes, name the constraint that would catch each, compute Hv, and flag the zeros. The fix is always a new constraint, never more monitoring, and four principles say what makes a good one: independence from the failure path, efficiency, composability, and robustness.

    Read chapter 19 →
  5. 20The Holographic Double Entry

    Does the duality extend to spacetime itself?

    The AdS/CFT correspondence, recast as a quantum error-correcting code. If it obeys the law, g(e) stays within [1, 2 ln 2], with e set by the geometry of the entanglement wedge. Stated as a prediction and left to the quantum-gravity community to compute. Conjecture

    Read chapter 20 →
  6. 21The Double Entry

    What does the law mean?

    What it gives (a conservation law, a mechanism for the Rogue Wave, a design tool, a unifying framework), what it does not give, the objection and the answer, and the temporal frontier. The title, revisited. Conjecture

    Read chapter 21 →

Check it yourself

Every number has a script or a source behind it

Each quantitative claim is either reproduced by a script, with its output in a data folder, or traced to a cited source. A claim that could not be sourced was left out of the text. Download the scripts, run them, and see whether you get the book’s numbers.

python 3 · unzip, then run from the folder
cd the-double-entry
python3 code/es_product.py              # e*s = g(e)*lambda, g in [1, 2 ln 2], 38.6% variation
python3 code/audit_identity.py          # the audit formula and the coding formula, row by row
python3 code/membership_threshold.py    # membership detection is 0 for s <= kpython3 code/frontier_comparison.py     # where each real system sits
python3 code/dna_composition.py         # 1e-5 x 1e-2 x 1e-3 = 1e-10, about 33 bits per base

The independence series

One assumption, two books

The assumption that things are independent is wrong in a way that matters, and each book asks what it hides. The Rogue Wave measured how large the error is. This book explains why it cannot be seen from inside the model.

Book one

The Rogue Wave

R ≈ dn

Independence misprices compound events exponentially, measured across 29 datasets.

roguewavebook.com →
Book two · this one

The Double Entry

e·s = g(e)·λ

Structure that recovers also verifies. Without it, verification is zero, and the mispricing is invisible.

Every ledger balances twice:
once to recover, once to check.

Recovery and verification are one property, measured two ways. Take the structure away and both vanish — along with any evidence that they were ever needed.