Skip to content

About

Open-source human-in-the-loop Lean 4 research workbench & modular agent runtime (M1–M5) with zero-trust kernel verification — from WestlakeNLP.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

836 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TheoremOS

Open-Source Human-in-the-Loop Lean 4 Research Workbench & Modular Agent Runtime

Built by WestlakeNLP (Natural Language Processing Lab, Westlake University)

English · 简体中文

⭐ Star · 1-Min Demo · Browse Proof Archive · Cloud Workbench · Quick Start · Rust CLI v0.1.0 · Docs · Cite

GitHub stars WestlakeNLP Lab Rust CLI v0.1.0 Verify TheoremOS CI Lean 4.36.0 License AGPL-3.0-only


TheoremOS workbench with natural language, TeX, and Lean problem input, research mode selection, and budget controls

TheoremOS is an open-source human-in-the-loop Lean 4 research workbench and modular agent harness (AGPL-3.0-only). Start from natural language, TeX, or an incomplete Lean file, verify formal statement fidelity before spending search budget, steer lemma decomposition with a single agent or native research team, and enforce zero-trust Lean 4 kernel acceptance over the frozen original goal.

Tip

Finding TheoremOS useful? Click ⭐ Star on HuggingMath/theorem-os-harness to bookmark the open-source workbench, CLI, and M1–M5 runtime and follow updates from WestlakeNLP. Join the community in GitHub Discussions!


Proof Highlights

🏆 Lean-Eval Archive (10 Passes) 📐 IMO 2026: 6/6 (15/15 Goals) 🔬 OpenAI Math Trajectories
10 archived submissions with official LeanEval passing responses (incl. Unit Conjecture, Hopf–Rinow, Dimitrov, Improved Sunflower Bounds, Lorentzian Polynomials). See accepted/README.md for system attribution & official links. TheoremOS + GPT-5.6 passed local Lean checks on all 15 goals across 6 formalized problems (official: false). Full proof sources & timing methodology in examples/imo2026/RESULTS.md. Browse OpenAI Math formalizations, proofs, and local Lean checks (official: false) with zero login at the Public Proof Archive or in results/openai-math/.

Note

These are historical results on fixed statements. Local Lean kernel checks (official: false) are strictly distinguished from official hosted passes (official: true); archived success chains do not measure the current solver's general zero-shot pass rate.


Black-Box LLM Provers vs. TheoremOS

Dimension Typical Black-Box Automated Provers TheoremOS (HuggingMath/theorem-os-harness)
Statement Fidelity Formalize silently; a subtle quantifier bug wastes the whole search budget Pre-search human review via formalization fidelity checks before proving
Stalled Proofs Opaque search loop; hard to inspect or intervene mid-run Interactive lemma steering, preserved source/attempts & resumable runs
Completion Trust Easy to be fooled by sorry, helper lemmas, or environment drift Zero-trust host acceptance (evaluation.ts) re-verifies the frozen original goal cleanly
Research Ablations Prompts, retrieval, and scheduling tangled inside one script Swappable M1–M5 interfaces (solver-modules.md) decoupled from fixed host verification

1-Minute Overview Film

Watch the 1-minute TheoremOS overview film (1080p) · Self-host the workbench · Request hosted cloud access


Quick Start (Zero-Setup to Self-Hosted)

What you want to do Where to start Requirements
1. Browse proofs in browser (0 setup) Public Proof Archive · Cloud Workbench Browser only (archive needs no login)
2. Run prebuilt Rust CLI replay (Linux) rust-cli-v0.1.0 Release · migration/rust x86-64 Linux, Git, Bubblewrap, Lean 4.36.0 (no API key)
3. Run TypeScript CLI replay from source 5-Command Replay below · docs/usage.md Linux, Bun, Git, Bubblewrap (user_namespaces), Elan
4. Reproduce Dimitrov proof locally Dimitrov Reproduction Guide Local Lean 4 (no model API key)
5. Self-host web workbench or swap M1–M5 Web Workbench Guide · M1–M5 Interfaces Linux, Docker Compose + Responses API key

5-Command Local Lean Replay (Zero API Keys, Zero Mathlib)

Run a complete host-checked verification loop on your machine (requires Linux, Bun, Git, Bubblewrap with user namespaces enabled, and Elan):

git clone https://github.com/HuggingMath/theorem-os-harness.git && cd theorem-os-harness
bun install --frozen-lockfile
elan toolchain install leanprover/lean4:v4.36.0
bun run math doctor --lean-only

# Choose a new directory outside the checkout.
export THEOREMOS_REPLAY="$PWD/../theorem-os-runs/first-replay"
bun run math example replay --dir "$THEOREMOS_REPLAY"
bun run math inspect --run "$THEOREMOS_REPLAY/result.json"

Lean rejects the first candidate on 0 + n = n. The second uses Nat.zero_add and passes both goals (evaluated_passed, official: false, modelInvoked: false). To run an agent or native team on your own problem, follow the CLI guide.

Or download the prebuilt Linux Rust CLI binary (rust-cli-v0.1.0)

The Rust CLI and its build instructions are maintained on the migration/rust branch (see docs/rust-migration.md). To run the packaged x86-64 Linux offline replay directly from the v0.1.0 release:

sha256sum --check theorem-os-x86_64-linux-gnu-7fca2fe79ab2.tar.gz.sha256
tar -xzf theorem-os-x86_64-linux-gnu-7fca2fe79ab2.tar.gz
./theorem-os-x86_64-linux-gnu-7fca2fe79ab2/bin/theorem-os example replay --dir ./replay

Find Your Way Around

Task Start here
Submit a problem, inspect diagnostics, or resume a run CLI guide · Web workbench
Review a formal statement before proving it Formalization · Statement fidelity
Read the solver & verification core Run lifecycle · Research orchestration · Final acceptance · Archive
Swap M1–M5 research policies or run benchmarks M1–M5 interfaces · Examples
Contribute, pick up a good first issue, or run checks Contributing · Good First Issues · CI workflow

Repositories & Community

Repository Scope & Contents License
HuggingMath/theorem-os-harness (this repo) Open-source web workbench, TypeScript & Rust CLIs, M1–M5 harness, host verifier & tests AGPL-3.0-only
HuggingMath/TheoremOS Product site (theoremos.top), historical proof archive & guides Rights reserved
  • ⭐ Star this repo (HuggingMath/theorem-os-harness) to follow workbench, CLI, and M1–M5 updates.
  • 💬 Join Discussions — Share your local replays, Lean 4 tips, or custom M1–M5 policies in GitHub Discussions.
  • 🤝 Contribute — Check CONTRIBUTING.md or grab a good first issue.

License, Attributions & Citation

Project-authored code is licensed under AGPL-3.0-only. See NOTICE for third-party software and problem sources, and CITATION.cff to cite the version used.

About

Open-source human-in-the-loop Lean 4 research workbench & modular agent runtime (M1–M5) with zero-trust kernel verification — from WestlakeNLP.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages