Claim Contract Reference
Every field of investigation.json and approvals.json, which the runner reads and which are for people, how contracts are versioned and hashed, and how statements are bound to proofs.
A contract is the file experiments/investigations/<directory>/investigation.json,
schema math-proof-investigation/1. “Read by” says whether the runner uses a
field (and so a change to it changes a run) or only prints it for people.
Top level
| Field | Type | Read by | Meaning |
|---|---|---|---|
schema |
string | runner (must be math-proof-investigation/1) |
format version |
id |
string | notebook | e.g. N1-FERMAT-01 |
name |
string | runner | the NAME in math-engine proof NAME |
title |
string | CLI, notebook | |
tutorial |
bool, optional | runner | true exactly when the name is in TUTORIALS; otherwise refused |
contract_version |
integer | notebook | 1, 2, … |
contract_status |
string | notebook | draft_pending_author_review, tutorial_demonstration |
evidence_kind |
kernel (default), computation, historical |
runner | decides the status prefix; historical requires an archive check |
claim |
object | notebook | below |
propositions |
list | runner, notebook | below; each needs at least one of lean, rocq, computation, archive |
correspondence |
object | runner (id), notebook | below |
bridges |
list | notebook | {id, text, status}; status such as stated_not_kernel_checked |
checks |
list | runner | below |
controls |
list | runner | below |
toolchain_expected |
object | runner | any of lean, rocq, core_lean with a version; decides checked_unpinned |
establishes, does_not_establish |
lists of strings | notebook | printed on every run |
sources |
list of {text, status} |
notebook | |
revision |
object, optional | people | from_version, from_sha256, date, reason, formal_statements_changed |
Check and control ids must be unique within a contract.
claim
id, attribution, source_wording ({status, note}; e.g.
not_yet_transcribed, paper_pinned_reading_ours), mathematical_statement
(printed by the CLI and the notebook), reading (list of sentences),
verdict_under_test (refuted, established).
propositions[]
| Field | Meaning |
|---|---|
id, role, text |
e.g. N1-P01, refutation, the statement in words |
lean |
{decl, statement}: declaration name in the proof file’s namespace, and the exact Lean statement it must prove |
rocq |
{decl, statement}: the same for Rocq |
computation |
id of the computation check that bears on it, or null |
archive |
id of the archive check that holds its evidence (historical kind) |
The statement strings are what the kernel is asked about (statement binding,
below). The decl names only say where to look.
correspondence
id (approvals refer to it), claim_to_formal, summary, lean_rocq (list of
{proposition, relation, bridges} for statements checked in both systems),
single_kernel (list of proposition ids checked in one system), status (the
contract’s own field, which stays pending_author_approval; the real state is
read from approvals.json), note.
checks[]
system |
Fields | What runs |
|---|---|---|
lean |
id, kind: kernel, file, namespace, allowed_axioms, optional label |
the file is compiled; then a copy with the identity footer binds each lean.statement |
rocq |
id, kind: kernel, file, logical, module, allowed_axioms |
the same in Rocq, one binding file per statement |
python |
id, kind: computation, module or script, args, expect_exit, expect_stdout |
the program; passes if exit code and every expected string match. {core_lean} in args is replaced by the core Lean command |
files |
id, kind: pinned_files, files: [{path, sha256}], why |
each file hashed and compared |
archive |
id, kind: historical, directory, manifest, manifest_sha256, optional summary_file, summary_fields, recorded, why |
the manifest hashed and compared, then every file it lists; nothing executed or written |
controls[]
kind |
Fields | Passes when |
|---|---|---|
mutation |
system (lean/rocq), file, find, replace, optional error_window (default 3), Rocq also logical, module, why |
find occurs exactly once (else the run stops); the mutated copy is rejected with its first error between the changed line and that many lines after |
binding |
system, file, namespace (Lean) or logical, module (Rocq), decl, statement, why |
the original compiles, the declaration exists, and its binding to statement is refused |
computation |
as a python check, plus why |
exit code and every expected string match |
approvals.json
{
"schema": "math-proof-approvals/1",
"investigation": "<investigation id>",
"rule": "Only records with reviewer_role 'user' or 'human' count. …",
"approvals": [
{"correspondence": "<correspondence id>", "contract_sha256": "<contract hash>",
"reviewer": "<person answerable for the claim>", "reviewer_role": "user",
"decision": "approve", "date": "<date>",
"notes": "What the approval covers, and what it does not."}
]
}
A record counts only if reviewer_role is user or human, decision is
approve, correspondence is this contract’s correspondence id, and
contract_sha256 is the sha256 of the contract as it is now
(valid_approvals). The runner never writes this file.
Versioning and hashes
- The contract is identified by the sha256 of its bytes, recorded in every run.
- Any edit, even to a reading or a source note, gives a new hash. Approvals for
the old hash lapse;
--verifyon earlier runs reports “the claim contract has changed since this run”. - A deliberate change increments
contract_versionand records arevisionblock (Simpson and Gabriel are at v2; both revisions changed no formal statement). Earlier runs are kept.
Statement binding, in brief
For each proposition, the runner appends to a copy of the proof file:
namespace Inv02FIdentity.Spec
def <decl> : Prop := <statement from the contract>
end Inv02FIdentity.Spec
namespace Inv02FIdentity.Bind
theorem <decl> : Inv02FIdentity.Spec.<decl> := @<namespace>.<decl>
end Inv02FIdentity.Bind
followed by #print axioms for each declaration and binding, and a type
export. A declaration is accepted only if the file compiled, the declaration
exists, the binding is accepted (definitional equality), and every axiom is in
allowed_axioms. Proof files must therefore be importable with import Lean
available: core-Lean files start with import Lean. Chapter 22 — Statement Identity (Part III, Chapter 3) says
what this does and does not establish.
Further Reading
For deeper study; not sources for the chapter’s claims.
- Tim Bray (ed.). “The JavaScript Object Notation (JSON) Data Interchange Format.” RFC 8259, 2017. DOI. Why read it: The authoritative specification of the JSON format used by every contract and approvals file in the book.
- JSON Schema Organization. JSON Schema: Specification (json-schema.org, 2022). link. Why read it: The specification for describing and validating JSON documents, useful for readers who want to check or extend the contract format rigorously.
Next in Part IV: Chapter 32, the runner’s commands and statuses.