Upload CORPUS_README.md with huggingface_hub
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# Corpus and verified pairs — vector_behavior
Companion to the theorem/embedding/proof bundle already in this repo.
| file | contents ||---|---|| `corpus.jsonl.gz` | all 180,907 Mathlib declarations with source `code`, one JSON object per file: `{path, imports, premises:[{full_name, code, start, end, kind}]}` || `real_pairs_verified.json.gz` | 7,731 verified pairs over 1,666 substitutions, plus per-relation precision for the old name-matched pairs || `llm_judge.json` | blinded LLM verdicts on discovered groups, with decoy floors || `pca_view.json` | 2,761 arrows projected on the duality and strictness axes, and on PCA || `verified_relations.json` | every relation re-measured on verified pairs vs all pairs || `strictness_axis.json` | the strictness-axis test with bootstrap intervals || `ablation_relations*.json` | name-stripping ablation, e5-large and e5-mistral || `normalisation.json` | preprocessing study with a pre-registered decision rule |
## The pairs
```pythonimport gzip, jsonvp = json.load(gzip.open("real_pairs_verified.json.gz", "rt"))
for a, b, from_tok, to_tok in vp["pairs"][:5]: print(f"{from_tok} -> {to_tok}: {a} | {b}")
vp["top_substitutions"][:10] # the substitutions Mathlib actually attestsvp["rule_precision"] # how good the old name-matched pairs were```
A pair is here if one token can be substituted throughout A's statement to give B's,with nothing else changed and declaration names deleted before matching. No embeddingand no proof was consulted, so the set is usable as ground truth for either.
Precision is a **lower bound on relatedness**: a pair can be genuine without being aone-substitution match, since statements also differ in binders and `add→mul` usuallytravels with `zero→one`. Trust the ranking, not the level.
## The corpus
```pythonimport gzip, jsonfor line in gzip.open("corpus.jsonl.gz", "rt"): f = json.loads(line) for p in f["premises"]: if "@[to_additive" in p["code"]: print(p["full_name"])```
180,907 declarations against the bundle's 99,552 theorem statements — the extra ~81,000are definitions, instances and structures. Note that `@[to_additive]` twins aregenerated by the compiler and are **not** separate declarations here: of 9,602 markeddeclarations only 157 have a resolvable partner in the corpus and 12 have both halvesembedded. That route to ground-truth pairs is a dead end, which is why thesubstitution matcher above exists.
## Please read this before using either file
Both are answer keys, and the study they come from depends on their being held back.
Proofs validate discovery *because* no encoder ever saw one. The verified pairsvalidate the pairing step *because* they were not used to build it. Use either to findstructure and then confirm with the same thing, and you have proved nothing. Validatewith something else: human judgement, a held-out corpus, or the source organisation.CORPUS_README.mdAdded+62