Add textbook formalization pipeline (extract -> LLM formalize -> elaboration check -> library assembly)
- extract_section.py: slice a book section out of a pdftotext -layout dump and list its labeled Theorem/Proposition/Lemma/Corollary/Definition items. - formalize.py: LLM-formalize a section into Lean 4 candidate statements (preferring Mathlib vocabulary) plus a definitions manifest. - check_statements.py: elaboration-only sanity check against a real Mathlib-backed Lean project (must run outside the Cowork sandbox, which has no Lean toolchain and can't run macOS binaries anyway). - build_library.py: assemble solved lean-bench results into a reusable .lean file, reusing each winning proof verbatim. - llm.py: standalone OpenAI-compatible chat client + .env loader, kept independent of lean_agent so this pipeline works without it installed. - Source PDFs and raw/layout text dumps are gitignored (copyrighted material); only code and the final short Lean statement datasets are tracked.
This commit is contained in:
@@ -26,3 +26,9 @@ python3 -m unittest discover -s tests -v
|
||||
```
|
||||
|
||||
mock 返回固定证明,仍由真实 Lean 检查。真实 LLM 需配置 endpoint/model 或适配器。
|
||||
|
||||
## 教科书形式化流水线
|
||||
|
||||
`textbook/` 下有一套从教材 PDF 生成 lean-bench 数据集的工具(LLM 辅助抽取
|
||||
Theorem/Proposition/Lemma/Corollary,配 Definition 清单,事后把证出来的结果
|
||||
组装成可复用的 Lean 库文件),用法见 [textbook/README.md](textbook/README.md)。
|
||||
|
||||
Reference in New Issue
Block a user