Skip to content

Share Lean-derived problem metadata across consumers - #5375

Open
williamjblair wants to merge 17 commits into
google-deepmind:mainfrom
williamjblair:codex/shared-problem-metadata
Open

williamjblair wants to merge 17 commits into
google-deepmind:mainfrom
williamjblair:codex/shared-problem-metadata

Conversation

@williamjblair

@williamjblair williamjblair commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Publish full Lean statements in the existing data/conjectures.json, so the website and tools can read the same data.

Measured payloads — upstream baseline 10 September; fork deployment 11 September 2026

Measurement Before: upstream After: fork preview
conjectures.json, uncompressed 8.77 MB (8,765,122 bytes) 3.11 MB (3,105,385 bytes)
Declaration records 5,269 5,264
Records with Lean statement text 0 5,264
Verso HTML and hovers Included in the catalog Loaded per module

For example, Erdős 92's rendering JSON is 153,826 bytes. Catalog + manifest + that rendering total 3.26 MB, versus the old 8.77 MB combined catalog. This counts those JSON files only, not JavaScript, optional evidence feeds or HTTP overhead.

Sizes are decoded UTF-8 file sizes, not compressed transfer sizes or load-time measurements. The measured snapshots differ by five declarations. The fork is at integration revision eee8f2ec; its catalog digest is recorded in the published manifest.

Before — website display data · View full conjectures.json

{
  "conjectures": [
    {
      "theorem": "Erdos196.erdos_196",
      "module": "FormalConjectures.ErdosProblems.«196»",
      "categoryLabel": "Open",
      "categoryCss": "cat-open",
      "subjects": [
        {
          "code": "5",
          "name": "Combinatorics"
        },
        {
          "code": "11",
          "name": "Number theory"
        }
      ]
    }
  ]
}

After — native Lean data, including the statement · View full conjectures.json on the fork

{
  "schemaVersion": 2,
  "problems": [
    {
      "theorem": "Erdos196.erdos_196",
      "module": "FormalConjectures.ErdosProblems.«196»",
      "category": "research open",
      "subjects": ["5", "11"],
      "statement": "True ↔ ∀ (f : ℕ ≃ ℕ), HasMonotoneAP (⇑f) 4",
      "docstring": "Must every permutation of $\\mathbb{N}$, contain a monotone 4-term arithmetic progression?"
    }
  ]
}

These are shortened Erdős 196 records from the upstream catalog and fork catalog. Other records and fields are omitted.

The website now derives display labels and loads Verso HTML, hovers, and contributors per module. The full catalog also contains module docstrings and exact source/toolchain provenance; a manifest records its digest. The existing Lake/Verso build and static hosting remain in place.

Compatibility: the filename stays the same; conjectures becomes problems. Website readers migrate in this PR. extract_names options and field meanings are unchanged. Full JSON schema.

Live preview: Fork website · Erdős 92 example. This is the qualified integration deployment (eee8f2ec), including follow-up toolkit work. It demonstrates the combined site; the later copyright/source-link review edits are covered by PR CI below.

Checked: Full PR CI passed at 3646b794, including the maintainer review fixes. Focused checks cover 37 script tests, 8 post-processing tests and 9 Node/browser tests; changed Lean modules pass --wfail. Artifact replay preserves all 1,467 module links and produces byte-identical data after the refactor. The final fork qualification passed deployed statements, hovers, source links, fresh desktop/mobile containment, CLI browsing and website-only snapshot reuse. Upstream deployment awaits acceptance.

CLI: #5386 consumes this same catalog for conjectures find and show.

No prerequisite PR. Unblocks #4828 (including the consolidated proof-link checker) and #5386; the first production deployment must run the full build.

Fixes #5152. Roadmap: #4394.

@github-actions github-actions Bot added the CI label Sep 9, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation website javascript Pull requests that update javascript code labels Sep 9, 2026

@danielchin danielchin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a first pass for minor fixes, I still have to look at this more deeply

@@ -0,0 +1,46 @@
/-
Copyright 2025 The Formal Conjectures Authors.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Copyright 2025 The Formal Conjectures Authors.
Copyright 2026 The Formal Conjectures Authors.

Same with all other new files

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3646b7949. All three new Lean files now use 2026; existing files retain their original copyright year. The changed metadata modules and fixtures pass lake --wfail build.

Comment on lines +38 to +43
def categoryToString : Category → String
| .textbook => "textbook"
| .research .open => "research open"
| .research .solved => "research solved"
| .test => "test"
| .API => "API"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have more categories than this?

I think undergrad and high school are a few others. You may want to search for the rest of the list.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the current Category definition and parser: textbook covers high-school, undergraduate and graduate problems. The other cases are research open, research solved, test and API. This match is exhaustive over that Lean type; no category is omitted.

Comment thread site/src/js/catalog.js Outdated
Arxiv: { name: 'arXiv', url: 'https://arxiv.org/archive/math' },
Paper: { name: 'Papers', url: null },
Books: { name: 'Books', url: null },
WrittenOnTheWallII: { name: 'Written on the Wall II', url: null },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the original website but it's not loading for me right now: https://cms.dt.uh.edu/faculty/delavinae/research/wowII/

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this URL to the collection metadata in 3646b7949. The problem modules already cite the same source path. The HTTPS endpoint also timed out in my check, so this records the cited source rather than asserting reachability.

Comment thread site/src/js/catalog.js
Comment on lines +137 to +143
const CATEGORY_META = {
'research open': { label: 'Open', css: 'cat-open' },
'research solved': { label: 'Solved', css: 'cat-solved' },
'textbook': { label: 'Textbook', css: 'cat-textbook' },
'test': { label: 'Test', css: 'cat-test' },
'API': { label: 'API', css: 'cat-api' },
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my other comment, I believe there's more categories.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JavaScript table covers the same five serialized categories as the current Lean type. High-school, undergraduate and graduate problems share textbook; there are no separate current keys for those levels.

Comment thread site/README.md Outdated
```
data/
conjectures.json # JSON produced by lake exe extract_names (created by CI)
conjectures.json # Complete native catalog with exact provenance

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fix comment indent to match the rest of the lines

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the alignment in 3646b7949.

@williamjblair

Copy link
Copy Markdown
Collaborator Author

@danielchin I merged main into this branch. There was one conflict in site/build.js, and I applied the Millennium key rename from #5849 to both collection tables. All checks pass at 513b804aa, including the full Lean build. Ready for the deeper pass whenever you have time.

@bocowgill bocowgill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated catalog drops unresolved proposition answers despite declaring answer_mode: "postpone". Please fix this before merging; the inline comment documents the mismatch in the current CI artifact.

I independently checked @danielchin's category question and agree with the reply: the five serialized categories exhaust Category, with textbook covering high-school, undergraduate, and graduate problems.

mkdir -p site/data
lake exe extract_names --exclude=statement,docstring,moduleDocstrings,fileFirstAdded,fileLastModified \
> site/data/conjectures.json
lake exe extract_names --exclude=fileFirstAdded,fileLastModified \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Preserve postponed answers until catalog extraction

Please extract the catalog immediately after FormalConjecturesAnswerPostpone, or rebuild that target immediately before this command. The intervening FormalConjectures:literate build recompiles the same problem modules in the default answer mode. In the current run's native-catalog artifact, Erdos196.erdos_196 has answerKinds: [] and a statement starting True ↔, although its source uses answer(sorry) and the manifest declares answer_mode: "postpone". Consumers therefore lose the distinction between an unresolved question and a supplied positive answer. Add an end-to-end assertion that an unresolved proposition answer still yields ["Prop"] after the full documentation/extraction pipeline.

@bocowgill

Copy link
Copy Markdown
Contributor

+awaiting-author

@github-actions github-actions Bot added the awaiting-author The author should answer a question or perform changes. Reply when done. label Oct 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author The author should answer a question or perform changes. Reply when done. CI documentation Improvements or additions to documentation javascript Pull requests that update javascript code website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share Lean-derived problem metadata across consumers

3 participants