From e6b6180ebead3123a601025f0d5c4b9790619388 Mon Sep 17 00:00:00 2001 From: Zhenhao Liu <3100378030@qq.com> Date: Tue, 1 Dec 2026 17:47:41 +0800 Subject: [PATCH] docs(readme): make English README default, surface proof highlights, and unify Star CTA --- README.md | 205 ++++++++++++++++++++++--------------- README.zh-CN.md | 264 ++++++++++++++++++++++++++++++++++++++++++++++++ README_EN.md | 255 ---------------------------------------------- 3 files changed, 385 insertions(+), 339 deletions(-) create mode 100644 README.zh-CN.md delete mode 100644 README_EN.md diff --git a/README.md b/README.md index 6b1e651e..96dba19c 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,26 @@
-

简体中文 · English

+

English · 简体中文

TheoremOS

TheoremOS

-

人机协同的 Lean 4 数学研究工作台与模块化可编程运行时

+

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

- 由西湖大学 - WestlakeNLP WestlakeNLP 实验室(自然语言处理实验室)开源研发 + Developed at + WestlakeNLP WestlakeNLP + (Natural Language Processing Lab, Westlake University)

- ⭐ 点赞收藏 · - 演示视频 · - 在线工作台 · - 产品官网 · - 公开证明档案 · - 运行指南 · - 研究组件 (M1–M5) · - 引用本项目 + ⭐ Star · + 1-Min Film · + Proof Highlights · + 5-Cmd Replay · + Browse 29 Proofs · + Cloud Workbench · + M1–M5 Modules · + Cite

GitHub stars @@ -31,48 +32,66 @@


- TheoremOS 研究工作台界面:支持自然语言、TeX 与 Lean 题目输入、研究配置与预算控制 + TheoremOS workbench entry supporting natural language, TeX, and Lean problem input, research mode selection, and budget controls
-**TheoremOS** 是一套面向前沿数学与形式化推理的**人机协同 Lean 4 研究系统**,包含完整开源的[网页研究工作台](./docs/web-workbench.md)、命令行求解器(`bun run math` / `theorem-os`)、独立的 Lean 内核验收运行时(`S1` 档案与 `S3` 终验),以及可逐个替换的 **M1–M5 研究决策组件**。 +**TheoremOS** is an open-source **human-in-the-loop Lean 4 mathematical research workbench and modular agent runtime** (`AGPL-3.0-only`). Instead of trusting black-box LLM claims of *"proof complete"*, TheoremOS lets mathematicians review formal statements via blind back-translation, steer lemma decomposition, swap five versioned research policy modules (**M1–M5**), and enforce **zero-trust independent Lean 4 kernel acceptance** (`S1` archives & `S3` final verification). + + + +### Verified Proof Highlights + +| 🏆 10 Official Lean-Eval Passes | 📐 IMO 2026: `6/6` (`15/15` Goals) | 🔬 18 OpenAI Math Trajectories | +| :--- | :--- | :--- | +| Officially accepted on frozen submission targets — incl. ***Unit Conjecture***, ***Hopf–Rinow***, ***Dimitrov***, ***Improved Sunflower Bounds***, ***Lorentzian Polynomials***, and ***Optimal Paper Möbius Band*** ([view table](#lean-eval-and-public-records)). | Verified on aligned AxiomMath formalizations (`TheoremOS + GPT-5.6`, **285.55 min** total; local independent Lean kernel check, `official: false`). Full proofs & timing in [`examples/imo2026/RESULTS.md`](./examples/imo2026/RESULTS.md). | Locally checked in Lean 4 with problem comparators (`official: false`) and full saved research trajectories — browseable with **zero login** in the [Interactive Proof Archive](https://theoremos.top/en/archive.html). | + +> [!NOTE] +> All public records strictly separate **official hosted evaluations** (`official: true`) from **local independent Lean kernel checks** (`official: false`). Archived success chains and preview runs do not represent a general zero-shot pass rate. > [!TIP] -> **觉得这个开源研究底座有帮助?** 欢迎点击右上角给 [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os)(以及我们的公开证明档案与官网仓库 [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS))点亮 **⭐ Star**!你的支持能帮助更多数学与 AI4Science 研究者发现本项目,并持续追踪 [WestlakeNLP](https://westlakenlp.com/) 的后续研究进展。 +> **Finding TheoremOS useful?** Click **⭐ Star** on [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) to bookmark the open-source workbench, CLI, and M1–M5 runtime and follow upcoming releases from [WestlakeNLP](https://westlakenlp.com/). + +--- - + -### 演示视频(1 分钟 · 1080p) +## Overview Film (1 min · 1080p) https://github.com/user-attachments/assets/57562769-aa15-474c-87ff-73265f097ec8 -

TheoremOS 官方演示视频(1:07 · 英文旁白与字幕) — 提出猜想 → 引理图谱与人机点拨 → 终端诊断 → 多学者协作 → M1–M5 开放架构 → S3 独立核验 → 公开档案与成功解答轨迹回溯 · 下载 1080p 高码率原片 (31 MB)

+

TheoremOS Overview Film (1:07 · EN narration & subtitles) — Conjecture → Lean Lemma Graph & Guidance → CLI Replay → Co-Authorship → M1–M5 Harness → S3 Kernel Acceptance → Public Archives & Solved Proof Trajectory · Download full-bitrate 1080p master (31 MB)

+ +--- -### 核心亮点 +## Why TheoremOS? -| 网页工作台与人机协同 | 零信任独立 Lean 验收 (`S1` / `S3`) | M1–M5 可替换策略与实验对比 | +| Human-in-the-Loop Workbench | Zero-Trust Acceptance (`S1` / `S3`) | Replaceable M1–M5 Modules | | :--- | :--- | :--- | -| 内置 [`apps/web`](./apps/web/) 科研工作台,支持自然语言、TeX 与单文件 Lean 输入、后台语义审查、Codex 原生团队、可选的首轮路线审批与实时 Lean 反馈视图。 | 模型输出“已完成”或局部引理通过**从不替代最终验收**;[`evaluation.ts`](./src/solver/evaluation.ts) 固定完整原题与环境独立重验,[`archive.ts`](./src/solver/archive.ts) 完整保留每轮尝试、报错与用量以便断点续跑。 | 将证明构造、检查反馈、搜索调度、上下文筛选与协作分工拆分为 5 个带版本的 TypeScript 组件,历史对照消融实验可用各自固定的版本复现。 | +| Built-in [`apps/web`](./apps/web/) UI supporting natural language, TeX, or single-file Lean input, blind back-translation statement review, native Codex teams, optional initial route approval, and live Lean diagnostics. | A model claiming completion or passing local helper lemmas **never counts as theorem acceptance**; [`evaluation.ts`](./src/solver/evaluation.ts) re-verifies the frozen original problem cleanly, while [`archive.ts`](./src/solver/archive.ts) checkpoints every attempt for pause and resume. | Decouples proof construction, evidence checks, search scheduling, context assembly, and role assignment into 5 versioned TypeScript interfaces (`M1–M5`) so ablation runs stay reproducible on pinned revisions. | -| 仓库 | 定位与内容 | 许可证 | +| Repository | Role & Contents | License | | --- | --- | --- | -| [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os)(本仓库) | 开源网页工作台、命令行工具(`bun run math`)、M1–M5 核心运行时与测试 | [`AGPL-3.0-only`](./LICENSE) | -| [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) | [产品官网](https://theoremos.top/)、29 条公开证明档案、Dimitrov 独立复核包与双语指南 | [Rights reserved](https://github.com/HuggingMath/TheoremOS/blob/main/LICENSE) | +| [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) *(main open-source repo)* | Web workbench (`apps/web`), CLI runner (`bun run math`), M1–M5 runtime, S1/S3 verifier & tests | [`AGPL-3.0-only`](./LICENSE) | +| [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) *(archive & site)* | [Product website](https://theoremos.top/en/), 29 archived proof records, Dimitrov proof kit & bilingual guides | [Rights reserved](https://github.com/HuggingMath/TheoremOS/blob/main/LICENSE) | --- -## 快速开始 + + +## Quick Start -| 你想做什么 | 推荐入口 | 需要准备 | +| What you want to do | Where to start | Requirements | | --- | --- | --- | -| **免密钥体验独立 Lean 验收闭环** | [小题示例与回放](./examples/getting-started/README.md) | Linux、Bun 1.2+、Lean 4.36.0(无需模型 API Key) | -| **使用在线云端工作台** | [在线工作台](https://app.theoremos.top/) · [申请内测](https://github.com/HuggingMath/TheoremOS/issues/new?template=early-access.yml) | 白名单邮箱与支持 Responses API 的模型 Key | -| **本地 Docker Compose 自部署网页工作台** | [工作台部署指南](./docs/web-workbench.md) · [`compose.yml`](./apps/web/compose.yml) | Linux、Docker Compose、`/dev/fuse`(完整 Mathlib 环境) | -| **替换 M1–M5 研究策略并跑基准对比** | [组件替换示例](./examples/components/README.md) · [IMO2026 示例](./examples/imo2026/README.md) | Codex CLI、Elan/Lean、Bubblewrap 与 FUSE | +| **Replay local Lean verification (no API key)** | [5-Command Replay below](#1-replay-preset-local-lean-verification-in-5-commands-zero-api-keys) · [Getting-Started](./examples/getting-started/README.md) | Linux, Bun 1.2+, Lean 4.36.0 (stdlib only; zero LLM calls) | +| **Browse 29 verified proofs & trajectories** | [Proof Archive (EN)](https://theoremos.top/en/archive.html) · [中文档案](https://theoremos.top/archive.html) | Browser only (no account required) | +| **Self-host the workbench via Docker Compose** | [Workbench Deployment Guide](./docs/web-workbench.md) · [`compose.yml`](./apps/web/compose.yml) | Linux, Docker Compose, `/dev/fuse` (full Mathlib image) | +| **Try the hosted cloud workbench** | [Cloud Workbench](https://app.theoremos.top/) · [Request Access](https://github.com/HuggingMath/TheoremOS/issues/new?template=early-access.yml) | Allowlisted email & Responses API key | +| **Swap M1–M5 research policies & benchmark** | [Component Example](./examples/components/README.md) · [IMO2026 Guide](./examples/imo2026/README.md) | Codex CLI, Elan/Lean, Bubblewrap & FUSE | -### 1. 五条命令本地体验预设验收回放(无需模型 API Key) +### 1. Replay Preset Local Lean Verification in 5 Commands (Zero API Keys) -从 GitHub 克隆后安装依赖并准备示例所需的 Lean 工具链(只需标准库,无需下载 Mathlib): +Run the standalone standard-library example on your host (no Mathlib download or LLM credentials needed): ```bash git clone https://github.com/HuggingMath/theorem-os.git && cd theorem-os @@ -85,21 +104,21 @@ bun run math example replay --dir "$THEOREMOS_REPLAY" bun run math inspect --run "$THEOREMOS_REPLAY/result.json" ``` -回放会在本机真实构建并运行宿主检查流程:先提交故意失败的候选并接收 Lean 报错,再用 `Nat.zero_add` 修复并由独立内核验收输出 `evaluated_passed`(`modelInvoked: false`、`official: false`)。准备好模型凭据后,可按 [运行指南](./docs/usage.md) 运行 `bun run math example prepare / check / resume`。 +The replay builds the pinned runtime, submits a deliberately failing candidate, inspects the Lean diagnostic, repairs it using `Nat.zero_add`, and runs independent whole-problem verification (`evaluated_passed`, `modelInvoked: false`, `official: false`). Once your model profile is ready, continue with `bun run math example prepare / check / resume` — see the [Usage Guide](./docs/usage.md).
-2. 使用 Docker Compose 或 GHCR 镜像本地自部署网页工作台 +2. Self-Host the Web Workbench with Docker Compose or GHCR Images -完整依赖与 FUSE / 磁盘要求(建议为每个并发 Mathlib 任务预留 30 GiB 可用磁盘)详见 [网页工作台文档](./docs/web-workbench.md) 与[运维指南](./docs/web-operations.md): +See the [Web Workbench Guide](./docs/web-workbench.md) and [Operations Guide](./docs/web-operations.md) for host `/dev/fuse` requirements and disk headroom (~30 GiB recommended per concurrent Mathlib run): ```bash -# 方式 A:从当前源码构建 web、worker 和 tex 镜像并启动 +# Option A: Build web, worker and tex locally, then start the workbench THEOREMOS_SOURCE_COMMIT=$(git rev-parse HEAD) docker compose -f apps/web/compose.yml build worker web tex docker compose -f apps/web/compose.yml up -d web docker compose -f apps/web/compose.yml ps -# 方式 B:拉取 GitHub Actions 发布到 GHCR 的同一 SHA 的三个镜像 -export THEOREMOS_IMAGE_TAG=<完整的40位提交SHA> +# Option B: Pull all three images published by GitHub Actions for the same commit +export THEOREMOS_IMAGE_TAG= docker compose -f apps/web/compose.yml -f apps/web/compose.ghcr.yml pull worker web tex bun scripts/web-operations.ts images --commit "$THEOREMOS_IMAGE_TAG" docker compose -f apps/web/compose.yml -f apps/web/compose.ghcr.yml up -d --no-build web @@ -108,60 +127,60 @@ docker compose -f apps/web/compose.yml -f apps/web/compose.ghcr.yml up -d --no-b
-3. 生成并验证自定义研究组件(M1–M5) +3. Scaffold and Check a Custom M1–M5 Research Module -可在不改动宿主运行时或 `S3` 验收规则的前提下,生成自定义 `SolverModules` 模板并运行本地静态/排序校验(见 [组件替换示例](./examples/components/README.md)): +Swap individual research policies without altering the host verification loop or `S3` acceptance contract (details in [Component Replacement Guide](./examples/components/README.md)): ```bash bun run math component init --name my-search bun run math component check --name my-search ``` -新版协作由 Codex Lead 派工。旧宿主协作的档案继续可查,续跑和 M3 调度对照使用各自固定的历史版本。[续跑说明](./docs/usage.md#4-恢复运行) +The Codex Lead assigns work in current collaborative runs. You can still inspect older host-scheduled runs. Resume them and reproduce M3 scheduling experiments with their respective pinned historical revisions. [Resume guide](./docs/harness-portability.md#resume-and-isolation)
--- -## 工作台界面与研究架构展示 +## Workbench & Architecture Showcase
- TheoremOS 五个可替换研究模块与独立 S3 验收循环图谱 + TheoremOS five replaceable research modules separated from independent S3 acceptance - TheoremOS Lean 与 Mathlib 实时代码工作区 + TheoremOS Lean and Mathlib live source workspace
- 研究循环图谱 — M1–M5 决策边界与 S3 独立最终验收解耦(EN)。 + Modular Research Loop — Five swappable M1–M5 components separated from fixed S3 acceptance (中文图). - Lean 实时工作区 — 按题隔离环境、依赖导入与编译器诊断一目了然(EN)。 + Live Lean Workspace — Per-task sealed environment, imports, and compiler diagnostics (中文截图).
-查看更多界面截图与本地验收回放示例 +View verification replay output and strategy plan library screenshots
- TheoremOS 本地预设 Lean 验收回放输出:evaluated_passed 且 official 为 false + TheoremOS preset local Lean replay output showing evaluated_passed and official false - TheoremOS 方案库管理与策略配置界面 + TheoremOS saved strategy plan library interface
- 预设回放结果 — 无模型调用展示 evaluated_passed 与零 sorry 检查输出。 + Preset Local Replay — Zero-model verification check showing evaluated_passed and zero sorry placeholders. - 研究方案库 — 浏览器内保存、切换、导入或导出自定义研究配置(EN)。 + Strategy Plan Library — Save, switch, export, or import custom module configurations (中文截图).
@@ -169,60 +188,77 @@ bun run math component check --name my-search --- -## 五个可替换研究组件与核心文档 +## Five Replaceable Research Components -系统将策略决策与结果验收分开。下表也列出了解读历史调度实验所需的 M3 任务排序与 M5 固定角色契约。新版团队的分工由 Codex Lead 决定。[模块说明](./docs/solver-modules.md) +TheoremOS separates research decisions from proof verification. The table includes the historical M3 task ordering and M5 fixed-role contracts used to interpret scheduling experiments. The Codex Lead assigns work in current teams. [Module guide](./docs/solver-modules.md) -| 组件 / 层级 | 核心职责 | 实现入口 | 文档与示例 | +| Component / Layer | Responsibility | Implementation | Guide & Examples | | --- | --- | --- | --- | -| **M1 · 执行** | 在隔离工作区执行模型对话、候选生成与笔记记录 | [`execution.ts`](./src/solver/modules/execution.ts) | [组件合约](./examples/components/README.md) | -| **M2 · 证据** | 绑定 commit 与声明身份,执行 Lean 候选检查与诊断反馈 | [`evidence.ts`](./src/solver/modules/evidence.ts) | [形式化检查](./docs/formalization.md) | -| **M3 · 搜索调度** | 选择下一步操作、就绪任务排序与可恢复重试策略 | [`search.ts`](./src/solver/modules/search.ts) | [M3 替换示例](./examples/components/README.md) | -| **M4 · 上下文选择** | 为模型轮次按版本和预算组装精确的题目、依赖与约束信息 | [`context.ts`](./src/solver/modules/context.ts) | [恢复与检查点](./docs/recovery.md) | -| **M5 · 职责分配** | 向协作角色、Engineer 与独立审阅者分派研究与验证任务 | [`organization.ts`](./src/solver/modules/organization.ts) | [模块边界说明](./docs/solver-modules.md) | -| **S1 / S3 · 宿主验收** | 归档完整过程状态,并在洁净环境里按原始完整原题重验(不可被研究策略跳过) | [`archive.ts`](./src/solver/archive.ts) · [`evaluation.ts`](./src/solver/evaluation.ts) | [运行指南](./docs/usage.md) | +| **M1 · Execution** | Run bounded agent turns, candidate synthesis, and research notes in an isolated workspace | [`execution.ts`](./src/solver/modules/execution.ts) | [Component Contracts](./examples/components/README.md) | +| **M2 · Evidence** | Bind commits and declaration identity, run Lean candidate checks and compiler feedback | [`evidence.ts`](./src/solver/modules/evidence.ts) | [Formalization Guide](./docs/formalization.md) | +| **M3 · Search Scheduling** | Select next actions, prioritize ready tasks, and manage recoverable retries | [`search.ts`](./src/solver/modules/search.ts) | [M3 Replacement Demo](./examples/components/README.md) | +| **M4 · Context Selection** | Assemble version-consistent theorem statements, dependencies, and constraints within budgets | [`context.ts`](./src/solver/modules/context.ts) | [Recovery & Checkpoints](./docs/recovery.md) | +| **M5 · Organization** | Assign tasks, engineers, and independent reviewers across isolated slots | [`organization.ts`](./src/solver/modules/organization.ts) | [Module Boundaries](./docs/solver-modules.md) | +| **S1 / S3 · Host Acceptance** | Archive all search attempts/receipts and re-verify the full original problem cleanly | [`archive.ts`](./src/solver/archive.ts) · [`evaluation.ts`](./src/solver/evaluation.ts) | [Usage Guide](./docs/usage.md) | --- -## 独立验收与公开实验记录 + -> [!NOTE] -> 以下公开记录均明确区分**官方托管验收**(`official: true`)与**本地独立 Lean 内核核验**(`official: false`);选定成功链或早期试用反馈均不能外推为当前系统的零样本通过率。 +## Verification & Public Experimental Records -- **IMO2026 公开对比(`6/6` 题目 / `15/15` 目标)**:在对齐的 AxiomMath 形式化题面下完成全部 6 题(`TheoremOS + GPT-5.6` 合计 **285.55 分钟**,本地独立 Lean 内核验收 `official: false`),完整记录与统计口径说明见 [`examples/imo2026/RESULTS.md`](./examples/imo2026/RESULTS.md) 与 [IMO2026 复现指引](./examples/imo2026/README.md)。 -- **Lean-Eval 与扩展基准**:公开提交归档与源码哈希记录见 [`accepted/accepted.json`](./accepted/accepted.json)、[`submitted/README.md`](./submitted/README.md)、[PutnamBench 示例](./examples/putnambench/README.md) 与 [First Proof 示例](./examples/first-proof/README.md),完整浏览请访问 [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) 与 [**theoremos.top/archive.html**](https://theoremos.top/archive.html)。 -- **工作台文档与试用记录**:[自然语言形式化](./docs/formalization.md) · [非形式化讲解](./docs/informalization.md) · [站点发布架构](./docs/website.md) · [首轮试用记录](./docs/web-release-trial.md) · [v0.1.0 发布说明](./docs/releases/v0.1.0.md) +- **IMO 2026 Public Comparison (`6/6` problems / `15/15` goals)**: Verified on aligned AxiomMath formal statements (`TheoremOS + GPT-5.6` total **285.55 min**, local Lean verification `official: false`); methodology, timing definitions, and complete proofs are in [`examples/imo2026/RESULTS.md`](./examples/imo2026/RESULTS.md) and the [IMO2026 Guide](./examples/imo2026/README.md). +- **Lean-Eval & Extended Benchmarks**: Frozen archive provenance in [`accepted/accepted.json`](./accepted/accepted.json) and [`submitted/README.md`](./submitted/README.md), alongside [PutnamBench](./examples/putnambench/README.md) and [First Proof](./examples/first-proof/README.md) adapters. Browse all 29 interactive trajectories at [**theoremos.top/en/archive.html**](https://theoremos.top/en/archive.html) or [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS). +- **Technical Documentation**: [Formalization](./docs/formalization.md) · [Informalization](./docs/informalization.md) · [Website & Archive Architecture](./docs/website.md) · [Release Trial Notes](./docs/web-release-trial.md) · [v0.1.0 Release Notes](./docs/releases/v0.1.0.md) + +
+View all 10 proofs officially accepted by Lean-Eval + +| Proof Package | Area | Official Result | +| --- | --- | --- | +| [Unit conjecture: a nontrivial group-ring unit](https://github.com/HuggingMath/TheoremOS/tree/main/accepted/annals_unit_conjecture) | Algebra | [#1246 · pass](https://github.com/leanprover/lean-eval-submissions/issues/1246#issuecomment-5380977645) | +| [Rademacher type and Enflo type coincide](https://github.com/HuggingMath/TheoremOS/tree/main/accepted/annals_rademacher_enflo_type) | Functional analysis | [#2115 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2115#issuecomment-6161355838) | +| [Equiangular lines with a fixed angle](https://github.com/HuggingMath/TheoremOS/tree/main/accepted/annals_equiangular_lines_fixed_angle) | Discrete geometry | [#2135 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2135#issuecomment-6186332699) | +| [Fractional expectation thresholds](https://github.com/HuggingMath/TheoremOS/tree/main/accepted/annals_fractional_expectation_thresholds) | Probabilistic combinatorics | [#2141 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2141#issuecomment-6197783762) | +| [Dimitrov's lower bound for algebraic integers](https://github.com/HuggingMath/TheoremOS/tree/main/accepted/dimitrov) | Algebraic number theory | [#2143 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2143#issuecomment-6215093969) | +| [Hopf–Rinow theorem](https://github.com/HuggingMath/TheoremOS/tree/main/accepted/hopf_rinow) | Riemannian geometry | [#2143 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2143#issuecomment-6215093969) | +| [Improved bounds for the sunflower lemma](https://github.com/HuggingMath/TheoremOS/tree/main/submitted/annals_improved_bounds_sunflower_lemma) | Combinatorics | [#2144 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2144#issuecomment-6222767100) | +| [Lorentzian polynomials](https://github.com/HuggingMath/TheoremOS/tree/main/submitted/annals_lorentzian_polynomials) | Algebraic combinatorics | [#2144 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2144#issuecomment-6222767100) | +| [The optimal paper Möbius band](https://github.com/HuggingMath/TheoremOS/tree/main/submitted/annals_optimal_moebius) | Geometry | [#2144 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2144#issuecomment-6222767100) | +| [Algebraic integers: an upper bound for λ_SSS](https://github.com/HuggingMath/TheoremOS/tree/main/submitted/annals_algebraic_integers) | Algebraic number theory | [#2144 · pass](https://github.com/leanprover/lean-eval-submissions/issues/2144#issuecomment-6222767100) | + +
--- -## 关于 WestlakeNLP +## About WestlakeNLP
- WestlakeNLP · 西湖大学自然语言处理实验室 + WestlakeNLP · Westlake University - TheoremOS 由西湖大学 WestlakeNLP 实验室(自然语言处理实验室,2018 年成立,由张岳教授领导)研发。实验室围绕自然语言处理、大模型推理与 AI for Science 开展基础与应用研究,致力于探索辅助自然科学与人文社科发现的智能系统。 + TheoremOS is developed at WestlakeNLP, the Natural Language Processing Lab at Westlake University (founded in 2018 and led by Prof. Yue Zhang). The lab pursues fundamental and applied research in natural language processing, language-model reasoning, and AI for Science.

- 实验室官网:westlakenlp.com · - X (Twitter):@NlpWestlake · - 联系邮箱:liuzhenhao@westlake.edu.cn + Website: westlakenlp.com · + X (Twitter): @NlpWestlake · + Contact: liuzhenhao@westlake.edu.cn
--- -## 许可证、致谢与引用 +## License, Attributions & Citation -- 本仓库自有源代码默认采用 **[AGPL-3.0-only](./LICENSE)** 许可;具体范围说明、第三方组件、字体、内置 Lean 库(44 个上游模块)、改编自 [DeepScientist](https://github.com/ResearAI/DeepScientist)(及其含有的 `Apache-2.0` 文件与 [AionUi](https://github.com/iOfficeAI/AionUi) 源流)、[LeanAide](https://github.com/zhangir-azerbayev/LeanAide)、[autoform-bot](https://github.com/reaslab/autoform-bot)、Codex 后端及基准题面各自保留的许可声明,均完整记录于 **[NOTICE](./NOTICE)**。 -- 学术研究、实验对照或工程二次开发使用 TheoremOS 时,请参照 **[CITATION.cff](./CITATION.cff)** 引用本项目(建议附上使用的 release 标签或 commit),并按各自条款署名所涉及的第三方软件、数学题目及证明作者。 +- Project-authored source code in this repository is licensed under **[AGPL-3.0-only](./LICENSE)**. Third-party notices—covering components adapted from [DeepScientist](https://github.com/ResearAI/DeepScientist) (including `Apache-2.0` files tracing back to [AionUi](https://github.com/iOfficeAI/AionUi)), [LeanAide](https://github.com/zhangir-azerbayev/LeanAide), [autoform-bot](https://github.com/reaslab/autoform-bot), bundled fonts, the 44 upstream Lean modules, Codex backend notices, and benchmark problem licenses—are detailed in **[NOTICE](./NOTICE)**. +- When citing TheoremOS in papers or evaluations, please follow **[CITATION.cff](./CITATION.cff)** (including the release tag or commit used) and cite third-party software, problems, or datasets separately under their respective terms.
-引用 TheoremOS(BibTeX) +Cite TheoremOS (BibTeX) ```bibtex @software{liu2026theoremos, @@ -240,15 +276,16 @@ bun run math component check --name my-search --- -## 支持与社区参与 +## Support & Community -- **⭐ Star 支持两个仓库** — 给本仓库 [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) 点星追踪工作台、CLI 与 M1–M5 运行时更新;同时关注 [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) 收藏 29 条公开证明档案与独立复核包。 -- **💬 反馈问题与共建** — 欢迎提交 Pull Request 改进研究策略模块或工具链支持,或在 [Issues / 反馈中心](https://github.com/HuggingMath/TheoremOS/issues/new/choose) 交流本地复现与功能建议。 -- **🤝 学术合作** — 关注 [@NlpWestlake](https://x.com/NlpWestlake),或发信至 [liuzhenhao@westlake.edu.cn](mailto:liuzhenhao@westlake.edu.cn) 讨论多文件 Lake 工程接入、自定义工具链与联合评测。 +- **⭐ Star this repository** — Bookmark [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) for open-source workbench, CLI, and M1–M5 solver releases. +- **📚 Explore archived proofs** — Visit [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) or [**theoremos.top/en/archive.html**](https://theoremos.top/en/archive.html) for the 29 archived proof records and standalone Dimitrov verification kit. +- **💬 Contribute & report issues** — Open Pull Requests for solver module ideas and toolchain support, or share feedback and verification findings via [GitHub Issues](https://github.com/HuggingMath/TheoremOS/issues/new/choose). +- **🤝 Research collaboration** — Follow [@NlpWestlake](https://x.com/NlpWestlake) or email [liuzhenhao@westlake.edu.cn](mailto:liuzhenhao@westlake.edu.cn) to discuss multi-file Lake projects and joint evaluations.

- ⭐ Star theorem-os · - ⭐ Star TheoremOS · - 体验在线工作台 · - 提交反馈 / Issue + ⭐ Star TheoremOS · + Browse 29 Proofs · + Launch Cloud Workbench · + Open an Issue

diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 00000000..ed2aa830 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,264 @@ +
+

简体中文 · English

+ + + + TheoremOS + +

TheoremOS

+

人机协同的 Lean 4 数学研究工作台与模块化可编程运行时

+

+ 由西湖大学 + WestlakeNLP WestlakeNLP 实验室(自然语言处理实验室)开源研发 +

+

+ ⭐ 点赞收藏 · + 演示视频 · + 在线工作台 · + 产品官网 · + 公开证明档案 · + 运行指南 · + 研究组件 (M1–M5) · + 引用本项目 +

+

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

+
+ + TheoremOS 研究工作台界面:支持自然语言、TeX 与 Lean 题目输入、研究配置与预算控制 + +
+ +**TheoremOS** 是一套面向前沿数学与形式化推理的**人机协同 Lean 4 研究系统**,包含完整开源的[网页研究工作台](./docs/web-workbench.md)、命令行求解器(`bun run math` / `theorem-os`)、独立的 Lean 内核验收运行时(`S1` 档案与 `S3` 终验),以及可逐个替换的 **M1–M5 研究决策组件**。 + +### 核心验证战绩 + +| 🏆 10 条 Lean-Eval 官方通过 | 📐 IMO 2026:`6/6`(`15/15` 目标) | 🔬 18 条 OpenAI Math 轨迹 | +| :--- | :--- | :--- | +| 冻结提交目标官方核验通过 —— 涵盖 ***单位猜想(Unit Conjecture)***、***Hopf–Rinow 定理***、***Dimitrov 下界***、***向日葵引理改进界***、***Lorentzian 多项式*** 与 ***最优纸带莫比乌斯带***([查看档案](https://github.com/HuggingMath/TheoremOS#lean-eval-10-officially-accepted-proofs))。 | 在对齐的 AxiomMath 形式化题面下完成全部 6 题(`TheoremOS + GPT-5.6` 合计 **285.55 分钟**,本地独立 Lean 内核验收 `official: false`),完整记录见 [`examples/imo2026/RESULTS.md`](./examples/imo2026/RESULTS.md)。 | 本地 Lean 4 与题面比对器复核通过(`official: false`),保留完整研究轨迹 —— **免登录**即可在[公开证明档案](https://theoremos.top/archive.html)交互浏览。 | + +> [!NOTE] +> 所有公开记录严格区分**官方托管验收**(`official: true`)与**本地独立 Lean 内核核验**(`official: false`);选定成功链或早期试用反馈均不能外推为当前系统的零样本通过率。 + +> [!TIP] +> **觉得这个开源研究底座有帮助?** 欢迎点击右上角给 [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) 点亮 **⭐ Star**,追踪网页工作台、CLI 与 M1–M5 模块的后续开源更新([WestlakeNLP](https://westlakenlp.com/))。 + + + +### 演示视频(1 分钟 · 1080p) + +https://github.com/user-attachments/assets/57562769-aa15-474c-87ff-73265f097ec8 + +

TheoremOS 官方演示视频(1:07 · 英文旁白与字幕) — 提出猜想 → 引理图谱与人机点拨 → 终端诊断 → 多学者协作 → M1–M5 开放架构 → S3 独立核验 → 公开档案与成功解答轨迹回溯 · 下载 1080p 高码率原片 (31 MB)

+ +### 核心亮点 + +| 网页工作台与人机协同 | 零信任独立 Lean 验收 (`S1` / `S3`) | M1–M5 可替换策略与实验对比 | +| :--- | :--- | :--- | +| 内置 [`apps/web`](./apps/web/) 科研工作台,支持自然语言、TeX 与单文件 Lean 输入、后台语义审查、Codex 原生团队、可选的首轮路线审批与实时 Lean 反馈视图。 | 模型输出“已完成”或局部引理通过**从不替代最终验收**;[`evaluation.ts`](./src/solver/evaluation.ts) 固定完整原题与环境独立重验,[`archive.ts`](./src/solver/archive.ts) 完整保留每轮尝试、报错与用量以便断点续跑。 | 将证明构造、检查反馈、搜索调度、上下文筛选与协作分工拆分为 5 个带版本的 TypeScript 组件,历史对照消融实验可用各自固定的版本复现。 | + +| 仓库 | 定位与内容 | 许可证 | +| --- | --- | --- | +| [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os)(本仓库) | 开源网页工作台、命令行工具(`bun run math`)、M1–M5 核心运行时与测试 | [`AGPL-3.0-only`](./LICENSE) | +| [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) | [产品官网](https://theoremos.top/)、29 条公开证明档案、Dimitrov 独立复核包与双语指南 | [Rights reserved](https://github.com/HuggingMath/TheoremOS/blob/main/LICENSE) | + +--- + +## 快速开始 + +| 你想做什么 | 推荐入口 | 需要准备 | +| --- | --- | --- | +| **免密钥体验独立 Lean 验收闭环** | [小题示例与回放](./examples/getting-started/README.md) | Linux、Bun 1.2+、Lean 4.36.0(无需模型 API Key) | +| **使用在线云端工作台** | [在线工作台](https://app.theoremos.top/) · [申请内测](https://github.com/HuggingMath/TheoremOS/issues/new?template=early-access.yml) | 白名单邮箱与支持 Responses API 的模型 Key | +| **本地 Docker Compose 自部署网页工作台** | [工作台部署指南](./docs/web-workbench.md) · [`compose.yml`](./apps/web/compose.yml) | Linux、Docker Compose、`/dev/fuse`(完整 Mathlib 环境) | +| **替换 M1–M5 研究策略并跑基准对比** | [组件替换示例](./examples/components/README.md) · [IMO2026 示例](./examples/imo2026/README.md) | Codex CLI、Elan/Lean、Bubblewrap 与 FUSE | + +### 1. 五条命令本地体验预设验收回放(无需模型 API Key) + +从 GitHub 克隆后安装依赖并准备示例所需的 Lean 工具链(只需标准库,无需下载 Mathlib): + +```bash +git clone https://github.com/HuggingMath/theorem-os.git && cd theorem-os +bun install --frozen-lockfile +elan toolchain install leanprover/lean4:v4.36.0 + +export THEOREMOS_REPLAY="$PWD/../theorem-os-runs/first-replay" +bun run math doctor --lean-only +bun run math example replay --dir "$THEOREMOS_REPLAY" +bun run math inspect --run "$THEOREMOS_REPLAY/result.json" +``` + +回放会在本机真实构建并运行宿主检查流程:先提交故意失败的候选并接收 Lean 报错,再用 `Nat.zero_add` 修复并由独立内核验收输出 `evaluated_passed`(`modelInvoked: false`、`official: false`)。准备好模型凭据后,可按 [运行指南](./docs/usage.md) 运行 `bun run math example prepare / check / resume`。 + +
+2. 使用 Docker Compose 或 GHCR 镜像本地自部署网页工作台 + +完整依赖与 FUSE / 磁盘要求(建议为每个并发 Mathlib 任务预留 30 GiB 可用磁盘)详见 [网页工作台文档](./docs/web-workbench.md) 与[运维指南](./docs/web-operations.md): + +```bash +# 方式 A:从当前源码构建 web、worker 和 tex 镜像并启动 +THEOREMOS_SOURCE_COMMIT=$(git rev-parse HEAD) docker compose -f apps/web/compose.yml build worker web tex +docker compose -f apps/web/compose.yml up -d web +docker compose -f apps/web/compose.yml ps + +# 方式 B:拉取 GitHub Actions 发布到 GHCR 的同一 SHA 的三个镜像 +export THEOREMOS_IMAGE_TAG=<完整的40位提交SHA> +docker compose -f apps/web/compose.yml -f apps/web/compose.ghcr.yml pull worker web tex +bun scripts/web-operations.ts images --commit "$THEOREMOS_IMAGE_TAG" +docker compose -f apps/web/compose.yml -f apps/web/compose.ghcr.yml up -d --no-build web +``` + +
+ +
+3. 生成并验证自定义研究组件(M1–M5) + +可在不改动宿主运行时或 `S3` 验收规则的前提下,生成自定义 `SolverModules` 模板并运行本地静态/排序校验(见 [组件替换示例](./examples/components/README.md)): + +```bash +bun run math component init --name my-search +bun run math component check --name my-search +``` + +新版协作由 Codex Lead 派工。旧宿主协作的档案继续可查,续跑和 M3 调度对照使用各自固定的历史版本。[续跑说明](./docs/usage.md#4-恢复运行) + +
+ +--- + +## 工作台界面与研究架构展示 + + + + + + + + + + +
+ TheoremOS 五个可替换研究模块与独立 S3 验收循环图谱 + + TheoremOS Lean 与 Mathlib 实时代码工作区 +
+ 研究循环图谱 — M1–M5 决策边界与 S3 独立最终验收解耦(EN)。 + + Lean 实时工作区 — 按题隔离环境、依赖导入与编译器诊断一目了然(EN)。 +
+ +
+查看更多界面截图与本地验收回放示例 +
+ + + + + + + + + +
+ TheoremOS 本地预设 Lean 验收回放输出:evaluated_passed 且 official 为 false + + TheoremOS 方案库管理与策略配置界面 +
+ 预设回放结果 — 无模型调用展示 evaluated_passed 与零 sorry 检查输出。 + + 研究方案库 — 浏览器内保存、切换、导入或导出自定义研究配置(EN)。 +
+
+ +--- + +## 五个可替换研究组件与核心文档 + +系统将策略决策与结果验收分开。下表也列出了解读历史调度实验所需的 M3 任务排序与 M5 固定角色契约。新版团队的分工由 Codex Lead 决定。[模块说明](./docs/solver-modules.md) + +| 组件 / 层级 | 核心职责 | 实现入口 | 文档与示例 | +| --- | --- | --- | --- | +| **M1 · 执行** | 在隔离工作区执行模型对话、候选生成与笔记记录 | [`execution.ts`](./src/solver/modules/execution.ts) | [组件合约](./examples/components/README.md) | +| **M2 · 证据** | 绑定 commit 与声明身份,执行 Lean 候选检查与诊断反馈 | [`evidence.ts`](./src/solver/modules/evidence.ts) | [形式化检查](./docs/formalization.md) | +| **M3 · 搜索调度** | 选择下一步操作、就绪任务排序与可恢复重试策略 | [`search.ts`](./src/solver/modules/search.ts) | [M3 替换示例](./examples/components/README.md) | +| **M4 · 上下文选择** | 为模型轮次按版本和预算组装精确的题目、依赖与约束信息 | [`context.ts`](./src/solver/modules/context.ts) | [恢复与检查点](./docs/recovery.md) | +| **M5 · 职责分配** | 向协作角色、Engineer 与独立审阅者分派研究与验证任务 | [`organization.ts`](./src/solver/modules/organization.ts) | [模块边界说明](./docs/solver-modules.md) | +| **S1 / S3 · 宿主验收** | 归档完整过程状态,并在洁净环境里按原始完整原题重验(不可被研究策略跳过) | [`archive.ts`](./src/solver/archive.ts) · [`evaluation.ts`](./src/solver/evaluation.ts) | [运行指南](./docs/usage.md) | + +--- + +## 独立验收与公开实验记录 + +> [!NOTE] +> 以下公开记录均明确区分**官方托管验收**(`official: true`)与**本地独立 Lean 内核核验**(`official: false`);选定成功链或早期试用反馈均不能外推为当前系统的零样本通过率。 + +- **IMO2026 公开对比(`6/6` 题目 / `15/15` 目标)**:在对齐的 AxiomMath 形式化题面下完成全部 6 题(`TheoremOS + GPT-5.6` 合计 **285.55 分钟**,本地独立 Lean 内核验收 `official: false`),完整记录与统计口径说明见 [`examples/imo2026/RESULTS.md`](./examples/imo2026/RESULTS.md) 与 [IMO2026 复现指引](./examples/imo2026/README.md)。 +- **Lean-Eval 与扩展基准**:公开提交归档与源码哈希记录见 [`accepted/accepted.json`](./accepted/accepted.json)、[`submitted/README.md`](./submitted/README.md)、[PutnamBench 示例](./examples/putnambench/README.md) 与 [First Proof 示例](./examples/first-proof/README.md),完整浏览请访问 [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) 与 [**theoremos.top/archive.html**](https://theoremos.top/archive.html)。 +- **工作台文档与试用记录**:[自然语言形式化](./docs/formalization.md) · [非形式化讲解](./docs/informalization.md) · [站点发布架构](./docs/website.md) · [首轮试用记录](./docs/web-release-trial.md) · [v0.1.0 发布说明](./docs/releases/v0.1.0.md) + +--- + +## 关于 WestlakeNLP + + + + + + +
+ + WestlakeNLP · 西湖大学自然语言处理实验室 + + + TheoremOS 由西湖大学 WestlakeNLP 实验室(自然语言处理实验室,2018 年成立,由张岳教授领导)研发。实验室围绕自然语言处理、大模型推理与 AI for Science 开展基础与应用研究,致力于探索辅助自然科学与人文社科发现的智能系统。 +

+ 实验室官网:westlakenlp.com · + X (Twitter):@NlpWestlake · + 联系邮箱:liuzhenhao@westlake.edu.cn +
+ +--- + +## 许可证、致谢与引用 + +- 本仓库自有源代码默认采用 **[AGPL-3.0-only](./LICENSE)** 许可;具体范围说明、第三方组件、字体、内置 Lean 库(44 个上游模块)、改编自 [DeepScientist](https://github.com/ResearAI/DeepScientist)(及其含有的 `Apache-2.0` 文件与 [AionUi](https://github.com/iOfficeAI/AionUi) 源流)、[LeanAide](https://github.com/zhangir-azerbayev/LeanAide)、[autoform-bot](https://github.com/reaslab/autoform-bot)、Codex 后端及基准题面各自保留的许可声明,均完整记录于 **[NOTICE](./NOTICE)**。 +- 学术研究、实验对照或工程二次开发使用 TheoremOS 时,请参照 **[CITATION.cff](./CITATION.cff)** 引用本项目(建议附上使用的 release 标签或 commit),并按各自条款署名所涉及的第三方软件、数学题目及证明作者。 + +
+引用 TheoremOS(BibTeX) + +```bibtex +@software{liu2026theoremos, + author = {Liu, Zhenhao}, + title = {TheoremOS}, + version = {0.1.0}, + year = {2026}, + month = nov, + note = {WestlakeNLP, Westlake University}, + url = {https://github.com/HuggingMath/theorem-os} +} +``` + +
+ +--- + +## 支持与社区参与 + +- **⭐ Star 本仓库** — 给 [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) 点亮 Star,追踪开源工作台、CLI 与 M1–M5 运行时更新。 +- **📚 浏览公开档案** — 访问 [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) 或 [**theoremos.top/archive.html**](https://theoremos.top/archive.html) 查看 29 条公开证明档案与独立复核包。 +- **💬 反馈问题与共建** — 欢迎提交 Pull Request 改进研究策略模块或工具链支持,或在 [Issues / 反馈中心](https://github.com/HuggingMath/TheoremOS/issues/new/choose) 交流本地复现与功能建议。 +- **🤝 学术合作** — 关注 [@NlpWestlake](https://x.com/NlpWestlake),或发信至 [liuzhenhao@westlake.edu.cn](mailto:liuzhenhao@westlake.edu.cn) 讨论多文件 Lake 工程接入、自定义工具链与联合评测。 + +

+ ⭐ Star theorem-os · + ⭐ Star TheoremOS · + 体验在线工作台 · + 提交反馈 / Issue +

diff --git a/README_EN.md b/README_EN.md deleted file mode 100644 index c7b03dd2..00000000 --- a/README_EN.md +++ /dev/null @@ -1,255 +0,0 @@ -
-

English · 简体中文

- - - - TheoremOS - -

TheoremOS

-

Open-Source Collaborative Lean 4 Mathematical Research Workbench & Modular Runtime

-

- Developed at - WestlakeNLP WestlakeNLP - (Natural Language Processing Lab, Westlake University) -

-

- ⭐ Star · - Overview Film · - Cloud Workbench · - Website · - Proof Archive Repo · - Usage Guide · - Modules (M1–M5) · - Cite -

-

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

-
- - TheoremOS workbench entry supporting natural language, TeX, and Lean problem input, research mode selection, and budget controls - -
- -**TheoremOS** is an open-source **collaborative Lean 4 mathematical research workbench and modular agent runtime** (`AGPL-3.0-only`). It brings together the browser workbench ([`apps/web`](./apps/web/)), a reproducible CLI runner (`bun run math` / `theorem-os`), zero-trust final Lean kernel acceptance (`S1` archives & `S3` verification), and five swappable research policy modules (**M1–M5**). - -> [!TIP] -> **Finding TheoremOS helpful for your work?** Please give [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) (alongside our proof archive and product site repository [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS)) a **⭐ Star** to help fellow mathematicians and AI-for-Math researchers discover the project and follow updates from [WestlakeNLP](https://westlakenlp.com/). - - - -### Overview Film (1 min · 1080p) - -https://github.com/user-attachments/assets/57562769-aa15-474c-87ff-73265f097ec8 - -

TheoremOS Overview Film (1:07 · EN narration & subtitles) — Conjecture → Lean Lemma Graph & Guidance → CLI Replay → Co-Authorship → M1–M5 Harness → S3 Kernel Acceptance → Public Archives & Solved Proof Trajectory · Download full-bitrate 1080p master (31 MB)

- -### Why TheoremOS? - -| Web Workbench & Human Control | Zero-Trust Acceptance (`S1` / `S3`) | Replaceable M1–M5 Modules | -| :--- | :--- | :--- | -| Built-in [`apps/web`](./apps/web/) UI supporting natural language, TeX, or single-file Lean input, background semantic review, native Codex teams, optional initial route approval, and live Lean diagnostics. | A model claiming completion or local helper passes **never counts as theorem acceptance**; [`evaluation.ts`](./src/solver/evaluation.ts) re-verifies the frozen original problem cleanly, while [`archive.ts`](./src/solver/archive.ts) checkpoints every attempt for pause and resume. | Decouples proof construction, evidence checks, search scheduling, context assembly, and role assignment into versioned TypeScript interfaces used by past ablation studies. Use the pinned revision to reproduce a study. | - -| Repository | Scope & Contents | License | -| --- | --- | --- | -| [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) *(this repo)* | Open-source web workbench, CLI runner (`bun run math`), M1–M5 modules, and test suite | [`AGPL-3.0-only`](./LICENSE) | -| [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) | [Product website](https://theoremos.top/en/), 29 archived proof records, Dimitrov proof kit & bilingual guides | [Rights reserved](https://github.com/HuggingMath/TheoremOS/blob/main/LICENSE) | - ---- - -## Quick Start - -| What you want to do | Where to start | Requirements | -| --- | --- | --- | -| **Replay local Lean verification (no API key)** | [Getting-Started Example](./examples/getting-started/README.md) | Linux, Bun 1.2+, Lean 4.36.0 (stdlib only; zero LLM calls) | -| **Try the hosted cloud workbench** | [Cloud Workbench](https://app.theoremos.top/) · [Request Access](https://github.com/HuggingMath/TheoremOS/issues/new?template=early-access.yml) | Allowlisted email & Responses API key | -| **Self-host the workbench via Docker Compose** | [Workbench Deployment Guide](./docs/web-workbench.md) · [`compose.yml`](./apps/web/compose.yml) | Linux, Docker Compose, `/dev/fuse` (full Mathlib image) | -| **Swap M1–M5 research policies & benchmark** | [Component Example](./examples/components/README.md) · [IMO2026 Guide](./examples/imo2026/README.md) | Codex CLI, Elan/Lean, Bubblewrap & FUSE | - -### 1. Replay Preset Local Lean Verification in 5 Commands (Zero API Keys) - -Run the standalone standard-library example on your host (no Mathlib download or LLM credentials needed): - -```bash -git clone https://github.com/HuggingMath/theorem-os.git && cd theorem-os -bun install --frozen-lockfile -elan toolchain install leanprover/lean4:v4.36.0 - -export THEOREMOS_REPLAY="$PWD/../theorem-os-runs/first-replay" -bun run math doctor --lean-only -bun run math example replay --dir "$THEOREMOS_REPLAY" -bun run math inspect --run "$THEOREMOS_REPLAY/result.json" -``` - -The replay builds the pinned runtime, submits a deliberately failing candidate, inspects the Lean diagnostic, repairs it using `Nat.zero_add`, and runs independent whole-problem verification (`evaluated_passed`, `modelInvoked: false`, `official: false`). Once your model profile is ready, continue with `bun run math example prepare / check / resume` — see the [Usage Guide](./docs/usage.md). - -
-2. Self-Host the Web Workbench with Docker Compose or GHCR Images - -See the [Web Workbench Guide](./docs/web-workbench.md) and [Operations Guide](./docs/web-operations.md) for host `/dev/fuse` requirements and disk headroom (~30 GiB recommended per concurrent Mathlib run): - -```bash -# Option A: Build web, worker and tex locally, then start the workbench -THEOREMOS_SOURCE_COMMIT=$(git rev-parse HEAD) docker compose -f apps/web/compose.yml build worker web tex -docker compose -f apps/web/compose.yml up -d web -docker compose -f apps/web/compose.yml ps - -# Option B: Pull all three images published by GitHub Actions for the same commit -export THEOREMOS_IMAGE_TAG= -docker compose -f apps/web/compose.yml -f apps/web/compose.ghcr.yml pull worker web tex -bun scripts/web-operations.ts images --commit "$THEOREMOS_IMAGE_TAG" -docker compose -f apps/web/compose.yml -f apps/web/compose.ghcr.yml up -d --no-build web -``` - -
- -
-3. Scaffold and Check a Custom M1–M5 Research Module - -Swap individual research policies without altering the host verification loop or `S3` acceptance contract (details in [Component Replacement Guide](./examples/components/README.md)): - -```bash -bun run math component init --name my-search -bun run math component check --name my-search -``` - -The Codex Lead assigns work in current collaborative runs. You can still inspect older host-scheduled runs. Resume them and reproduce M3 scheduling experiments with their respective pinned historical revisions. [Resume guide](./docs/harness-portability.md#resume-and-isolation) - -
- ---- - -## Workbench & Architecture Showcase - - - - - - - - - - -
- TheoremOS five replaceable research modules separated from independent S3 acceptance - - TheoremOS Lean and Mathlib live source workspace -
- Modular Research Loop — Five swappable M1–M5 components separated from fixed S3 acceptance (中文图). - - Live Lean Workspace — Per-task sealed environment, imports, and compiler diagnostics (中文截图). -
- -
-View verification replay output and strategy plan library screenshots -
- - - - - - - - - -
- TheoremOS preset local Lean replay output showing evaluated_passed and official false - - TheoremOS saved strategy plan library interface -
- Preset Local Replay — Zero-model verification check showing evaluated_passed and zero sorry placeholders. - - Strategy Plan Library — Save, switch, export, or import custom module configurations (中文截图). -
-
- ---- - -## Five Replaceable Research Components - -TheoremOS separates research decisions from proof verification. The table includes the historical M3 task ordering and M5 fixed-role contracts used to interpret scheduling experiments. The Codex Lead assigns work in current teams. [Module guide](./docs/solver-modules.md) - -| Component / Layer | Responsibility | Implementation | Guide & Examples | -| --- | --- | --- | --- | -| **M1 · Execution** | Run bounded agent turns, candidate synthesis, and research notes in an isolated workspace | [`execution.ts`](./src/solver/modules/execution.ts) | [Component Contracts](./examples/components/README.md) | -| **M2 · Evidence** | Bind commits and declaration identity, run Lean candidate checks and compiler feedback | [`evidence.ts`](./src/solver/modules/evidence.ts) | [Formalization Guide](./docs/formalization.md) | -| **M3 · Search Scheduling** | Select next actions, prioritize ready tasks, and manage recoverable retries | [`search.ts`](./src/solver/modules/search.ts) | [M3 Replacement Demo](./examples/components/README.md) | -| **M4 · Context Selection** | Assemble version-consistent theorem statements, dependencies, and constraints within budgets | [`context.ts`](./src/solver/modules/context.ts) | [Recovery & Checkpoints](./docs/recovery.md) | -| **M5 · Organization** | Assign tasks, engineers, and independent reviewers across isolated slots | [`organization.ts`](./src/solver/modules/organization.ts) | [Module Boundaries](./docs/solver-modules.md) | -| **S1 / S3 · Host Acceptance** | Archive all search attempts/receipts and re-verify the full original problem cleanly | [`archive.ts`](./src/solver/archive.ts) · [`evaluation.ts`](./src/solver/evaluation.ts) | [Usage Guide](./docs/usage.md) | - ---- - -## Verification & Public Experimental Records - -> [!NOTE] -> Published records strictly distinguish **official hosted evaluations** (`official: true`) from **local Lean kernel checks** (`official: false`). Archived success chains and early preview feedback do not represent a general zero-shot pass rate. - -- **IMO2026 Public Comparison (`6/6` problems / `15/15` goals)**: Verified on aligned AxiomMath formal statements (`TheoremOS + GPT-5.6` total **285.55 min**, local Lean verification `official: false`); methodology, timing definitions, and complete proofs are in [`examples/imo2026/RESULTS.md`](./examples/imo2026/RESULTS.md) and the [IMO2026 Guide](./examples/imo2026/README.md). -- **Lean-Eval & Extended Benchmarks**: Frozen archive provenance in [`accepted/accepted.json`](./accepted/accepted.json) and [`submitted/README.md`](./submitted/README.md), alongside [PutnamBench](./examples/putnambench/README.md) and [First Proof](./examples/first-proof/README.md) adapters. Browse the full interactive catalog at [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) or [**theoremos.top/en/archive.html**](https://theoremos.top/en/archive.html). -- **Technical Documentation**: [Formalization](./docs/formalization.md) · [Informalization](./docs/informalization.md) · [Website & Archive Architecture](./docs/website.md) · [Release Trial Notes](./docs/web-release-trial.md) · [v0.1.0 Release Notes](./docs/releases/v0.1.0.md) - ---- - -## About WestlakeNLP - - - - - - -
- - WestlakeNLP · Westlake University - - - TheoremOS is developed at WestlakeNLP, the Natural Language Processing Lab at Westlake University (founded in 2018 and led by Prof. Yue Zhang). The lab pursues fundamental and applied research in natural language processing, language-model reasoning, and AI for Science. -

- Website: westlakenlp.com · - X (Twitter): @NlpWestlake · - Contact: liuzhenhao@westlake.edu.cn -
- ---- - -## License, Attributions & Citation - -- Project-authored source code in this repository is licensed under **[AGPL-3.0-only](./LICENSE)**. Third-party notices—covering components adapted from [DeepScientist](https://github.com/ResearAI/DeepScientist) (including `Apache-2.0` files tracing back to [AionUi](https://github.com/iOfficeAI/AionUi)), [LeanAide](https://github.com/zhangir-azerbayev/LeanAide), [autoform-bot](https://github.com/reaslab/autoform-bot), bundled fonts, the 44 upstream Lean modules, Codex backend notices, and benchmark problem licenses—are detailed in **[NOTICE](./NOTICE)**. -- When citing TheoremOS in papers or evaluations, please follow **[CITATION.cff](./CITATION.cff)** (including the release tag or commit used) and cite third-party software, problems, or datasets separately under their respective terms. - -
-Cite TheoremOS (BibTeX) - -```bibtex -@software{liu2026theoremos, - author = {Liu, Zhenhao}, - title = {TheoremOS}, - version = {0.1.0}, - year = {2026}, - month = nov, - note = {WestlakeNLP, Westlake University}, - url = {https://github.com/HuggingMath/theorem-os} -} -``` - -
- ---- - -## Support & Community - -- **⭐ Star both repositories** — Bookmark [**HuggingMath/theorem-os**](https://github.com/HuggingMath/theorem-os) for workbench, CLI, and M1–M5 solver updates, and [**HuggingMath/TheoremOS**](https://github.com/HuggingMath/TheoremOS) for the 29 archived proof records and standalone verification kits. -- **💬 Contribute & report issues** — Open Pull Requests for solver module ideas and toolchain support, or share feedback and verification findings via [GitHub Issues](https://github.com/HuggingMath/TheoremOS/issues/new/choose). -- **🤝 Research collaboration** — Follow [@NlpWestlake](https://x.com/NlpWestlake) or email [liuzhenhao@westlake.edu.cn](mailto:liuzhenhao@westlake.edu.cn) to discuss multi-file Lake projects and joint evaluations. - -

- ⭐ Star theorem-os · - ⭐ Star TheoremOS · - Launch Cloud Workbench · - Open an Issue -