← Adversarial Mathematics: From First Principles

Records and Notebooks

What a run leaves behind, and how someone who did not watch it can check it later: the result record, the logs, the notebook rendered from them, and the hashes that bind them together. Three identities (of the claim, the evidence and the environment), why old runs are kept and never rewritten, how imported evidence is verified, and what a hash cannot tell you.

A mathematical argument written in a paper can be checked by anyone who reads it. A run of a proof checker cannot be watched after the fact. What remains is its record. This chapter is about what that record contains, and how a reader who trusts nobody, including the author, can check it.

What a run leaves behind

Every run writes one directory. Fermat’s approved run is experiments/investigations/n1-fermat/kernel-runs/2026-11-13-approved/:

result.json      the complete record of the run
notebook.md      a readable account, rendered from result.json
notebook.ipynb   the same account as a Jupyter notebook
runs/            every file the checks produced: sources, logs, records
SHA256SUMS       a hash for every other file in the directory

result.json is the record. Everything else is either raw material (the logs) or a view of it (the notebooks). It says which contract was run (by its sha256), in which environment and from which commit, what every check and control did, and what status followed. Chapter 33 — Evidence and Notebooks (Part IV, Chapter 5) lists every field.

The logs are the kernels’ and programs’ own output, unedited. Each check records the sha256 of its logs inside result.json as well, so the record names the exact logs it was derived from.

The notebooks are generated, never written by hand. Every statement in them comes from result.json or the contract. They quote the sha256 of the result.json they were rendered from, so a notebook cannot be paired with another run’s record without the mismatch showing.

SHA256SUMS lists the hash of every other file in the directory.

Three identities

A record answers three separate questions, each with its own identifier.

Question Identified by
Which claim was checked? the contract’s sha256 (ef384bbf… for Fermat)
Which evidence is this? the sha256 of result.json, and SHA256SUMS for the rest
Where and from what was it produced? the image identifier and build-manifest hash; the source commit; the per-file comparison with that commit

Keeping them apart matters. Two runs can check the same claim (same contract hash) in different environments, and should agree. One environment can check two versions of a claim (Gabriel v1 and v2) and should report both. A record that collapsed the three into one “run of Fermat” could not say which of them had changed.

Checking a record

math-engine proof fermat --verify experiments/investigations/n1-fermat/kernel-runs/2026-11-13-approved

This reruns nothing. It checks that every file is present and unchanged, that nothing has been added, that the notebooks belong to this record, and that the contract has not changed since the run (Chapter 33 — Evidence and Notebooks (Part IV, Chapter 5) gives the exact rules). It prints evidence intact, or the list of problems. A reader who trusts nobody can run it on any record in the book, and then read the logs directly: they are the kernels’ words, not the author’s.

Moving a run does not disturb it. Fermat’s approved run was produced in a directory called proof-fermat-approved-2 on one machine; its logs still show that path. It was then copied into the repository under a different name, verified again there, and committed. The hashes are of contents, not locations, so the verification holds wherever the directory goes.

Old runs are kept, and never rewritten

When a contract changes, its earlier runs are not deleted, updated or re-labelled. They stay, as records of what was checked then.

p07-simpson/kernel-runs/2026-11-13-pinned/      contract v1
p07-simpson/kernel-runs/2026-11-13-v2-pinned/   contract v2
p08-gabriel/kernel-runs/2026-11-13-v1-pinned/   contract v1
p08-gabriel/runner-runs/2026-11-13-v2-pinned/   contract v2

Verify the v1 runs today and you get:

the claim contract has changed since this run

That is not a failure of the record. It is the record telling the truth: its evidence is about a contract that is no longer the current one. The v1 runs remain valid evidence for v1, and anyone can see what changed between the versions.

The same rule applies to failures. Runs that failed, and the problems review found, stay in the repository beside the runs that passed. A laboratory that kept only its successes would have no way to show that its checks ever mattered.

Imported evidence has a chain too

Chapter 21 described two investigations whose kernel evidence is imported from an earlier procedure: Haraux and Grasshopper. Their records are checked by a chain of hashes:

  1. the contract is identified by its sha256;
  2. the contract pins the sha256 of the imported run’s manifest (SHA256SUMS);
  3. the manifest lists the sha256 of each of the run’s files.

The reader’s run walks the chain. Haraux’s recorded run reported “78 recorded files match the pinned manifest”. If any of those 78 files had changed, or if the manifest itself had been replaced by a new one that listed the changed files, the run would have failed. Nothing in the imported directory is written to; the reader’s run keeps its own record separately, and its notebook says, in bold, that no kernel ran.

What a hash does not tell you

A matching hash says that a file is the same file. It says nothing else.

  • Not that the content is right. A record of a mistaken run verifies perfectly. Verification shows the record has not changed since it was made, not that what it records is true.
  • Not how the run was produced. The record says which image and commit the run claims. A determined forger could write a consistent record by hand. The defence against that is reproduction: running it again, independently, and comparing.
  • Not that the tools are sound. The image identifier names the tools; it does not vouch for them.
  • Not which representation was read. A hash pins bytes. The rendered typeset page and the text extracted from it are different byte streams with different hashes, and extraction can silently drop meaning. Chapter 23 works the corresponding case — a dropped overbar that flipped a probability claim until the rendered source was re-read. Pin which one the review read; never let the derivative stand in for the source. The audit record is arXiv:2608.14673; the version history is reconstructed in docs/research/MATH-OAI10-quantum-audit.md.

That last point leads to the honest limit of this book’s evidence. Every recorded run was produced on one machine with one image. The runs can be checked by anyone, and reproduced by anyone with Docker. No independent reproduction has been recorded, and that is the strongest limitation on the evidence. The records show what was run and that it has not been altered since, which is a great deal, and not everything.

Try it yourself

  1. Verify Fermat’s approved run. Then copy the directory elsewhere, verify the copy, and explain why the result is the same.
  2. Open the approved run’s result.json and find the hash of runs/lean/export.log in two places. Which two, and why record it twice?
  3. Edit result.json in a copy of the run (change one character in a log hash) and verify. How many problems are reported, and which?
  4. Verify Simpson’s v1 run and its v2 run. Explain each answer.
  5. Suppose someone replaced a file in Haraux’s imported 02F record and also rewrote that record’s SHA256SUMS to match. What would the reader’s Haraux run report, and which step of the chain catches it?

Worked answers: Chapter 35 — Appendix A: Solutions to the Exercises (Part IV, Appendix A)#chapter-6-records-and-notebooks.

Evidence record

Record and verification log_hashes, write_outputs, write_sums, verify_output, archive in src/math_engine/proofs/runner.py
Notebook rendering src/math_engine/proofs/notebook.py
Runs cited Fermat n1-fermat/kernel-runs/2026-11-13-approved/; Simpson and Gabriel v1 and v2; Haraux p03-haraux/runner-runs/2026-11-13-pinned/
Superseded-run behaviour --verify on Simpson and Gabriel v1: “the claim contract has changed since this run”
Reproduction by others no independent reproduction has been recorded

Further Reading

For deeper study; not sources for the chapter’s claims.

  1. Susan B. Davidson, Juliana Freire. “Provenance and scientific workflows: challenges and opportunities.” In Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data (ACM, 2008), 1345–1350. DOI. Why read it: A survey of provenance in computational workflows, the general problem that the run records, logs and hash manifests are designed to address.
  2. Luc Moreau, Ben Clifford, Juliana Freire, Joe Futrelle, Yolanda Gil, Paul Groth, Natalia Kwasnikowska, Simon Miles, Paolo Missier, Jim Myers, Beth Plale, Yogesh Simmhan, Eric Stephan, Jan Van den Bussche. “The Open Provenance Model core specification (v1.1).” Future Generation Computer Systems 27(6) (2011), 743–756. DOI. Why read it: A standard model for provenance graphs, useful for reading the chain of contracts, imported records and hashes in the book’s evidence.
  3. Thomas Kluyver, Benjamin Ragan-Kelley, Fernando Pérez, Brian Granger, Matthias Bussonnier, Jonathan Frederic, Kyle Kelley, Jessica Hamrick, Jason Grout, Sylvain Corlay, Paul Ivanov, Damián Avila, Safia Abdalla, Carol Willing, Jupyter Development Team. “Jupyter Notebooks – a publishing format for reproducible computational workflows.” In Positioning and Power in Academic Publishing: Players, Agents and Agendas (IOS Press, 2016), 87–90. DOI. Why read it: The paper behind the notebook format used for the book’s readable run records, explaining the format’s aims and its limits.

Next in Part III: Chapter 26, auditing someone else’s proof.