Literature Links is a JSON format for linking passages in mathematical documents
to counterparts such as Lean declarations. Each annotation records the
subject and object, including the document and location on each side.
{
"subject": [ { "type": "html", "uri": "https://en.wikipedia.org/wiki/Lagrange's_theorem_(group_theory)",
"version": "1382438659",
"location": { "quote": { "exact": "every subgroup divides the order of the whole group" } } } ],
"object": [ { "type": "lean", "uri": "https://github.com/leanprover-community/mathlib4",
"version": "v4.33.0",
"location": { "declaration": "Subgroup.card_subgroup_dvd_card" } } ],
"relation": "exactMatch"
}exactMatch says that Mathlib's theorem
states the passage quoted from that revision of the article,
up to junk values.
For a worked example, explore the statements and proof steps in the annotated Seifert–van Kampen PDF or browse its annotation files.
The checker needs Python 3.11 or newer.
git clone https://github.com/mathlib-initiative/literature-links &&
cd literature-links &&
python3 -m venv .venv &&
. .venv/bin/activate &&
python -m pip install . &&
literature-links validate examples/companion/latex.json &&
literature-links scan examples/companion/folder-defaultsAfter pip's output, the last two commands print:
examples/companion/latex.json: ok (1 annotation, latex, lean)
3 annotations from 3 files; 0 problems
validate checks the named files. scan also walks directories, so point it at
your annotation folder. Both check the format offline. See the
checker guide for the CLI and Python API.
To install just the checker at a release tag:
python -m pip install "git+https://github.com/mathlib-initiative/literature-links@v1.0.2"- Annotation Format Map and sample files
- Format specification and JSON Schema
- Changelog and contributing guide
Within 1.x, valid annotations stay valid and the public Python API keeps its exported names. The project is licensed under Apache 2.0.