用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/leanprover/skills --skill lean4-setup命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Use when asked to prove something in Lean. Covers one-step-at-a-time proving, error priority, working on the hardest case first, proof cleanup, and handling dependent type rewriting issues.
Bisect Lean toolchain versions to find where behavior changes. Use when trying to identify which Lean 4 commit caused a regression or behavior change.
Create minimal working examples (MWEs) from Lean errors for bug reports. Use when minimizing a Lean error, creating an MWE, or preparing a bug report for lean4 or mathlib4.
基于 SOC 职业分类
正在显示 SKILL.md
| name | lean4-setup |
| description | Set up a lean4 repository clone with proper elan toolchains. |
The first time you build in a lean4 repository clone, you need to run
cmake --preset release
make -j -C build/release
The cmake command is not needed on subsequent builds.
cd tests/lean/run
./test_single.sh example_test.lean
make -j -C build/release test ARGS="-j$(nproc)"
tests/lean/run/#guard_msgs to check for specific messagesIf you are cloning or repairing the leanprover/lean4 repository for a user to work in, you need to do further set up. First, do an initial build according to the instructions above. Then you'll need to pick a toolchain name. If this is the only clone of lean4 on the machine, just use lean4. Otherwise you might use something like lean4-XYZ.
Then run the following commands:
elan toolchain link lean4-XYZ build/release/stage1
elan toolchain link lean4-XYZ-stage0 build/release/stage0
echo lean4-XYZ > lean-toolchain
echo lean4-XYZ > script/lean-toolchain
echo lean4-XYZ > tests/lean-toolchain
echo lean4-XYZ-stage0 > src/lean-toolchain
After setting up the toolchains, verify it worked:
cd tests/lean/run
lean --version # Should show the commit hash from your clone, not a release version
When done with the clone, remove the toolchains:
elan toolchain uninstall lean4-XYZ
elan toolchain uninstall lean4-XYZ-stage0
tests/ directory needs stage1 because tests run against the full Lean systemsrc/ directory needs stage0 because it's rebuilding the stdlib itself