Skip to content

About

A small JSON format that records correspondences between mathematical documents, such as a book passage and a Lean declaration.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Literature Links

tests License: Apache-2.0 Python 3.11+

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.

Example

{
  "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.

Try it

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-defaults

After 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"

Documentation

Within 1.x, valid annotations stay valid and the public Python API keeps its exported names. The project is licensed under Apache 2.0.

About

A small JSON format that records correspondences between mathematical documents, such as a book passage and a Lean declaration.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages