Spaces:
Running on Zero
Running on Zero
Download setup_lean.sh from Angshul/lean-proof-checker: direct link, hf CLI and curl.
- Browser
- Download file 864 Bytes
-
https://huggingface.co/spaces/Angshul/lean-proof-checker/resolve/main/setup_lean.sh
- Command line
-
hf download hf://spaces/Angshul/lean-proof-checker/setup_lean.sh
-
curl -L -o setup_lean.sh https://huggingface.co/spaces/Angshul/lean-proof-checker/resolve/main/setup_lean.sh
864 Bytes
| # Installs elan + Lean 4 + a Mathlib project with prebuilt cache into $HOME/leancheck. | |
| # Idempotent: re-running skips what is already there. Runs at every Space start | |
| # (the Space disk is not persistent), takes ~5-10 minutes on a cold start. | |
| set -euo pipefail | |
| export PATH="$HOME/.elan/bin:$PATH" | |
| if [ ! -x "$HOME/.elan/bin/lake" ]; then | |
| echo "== installing elan" | |
| curl -sSfL https://elan.lean-lang.org/elan-init.sh -o /tmp/elan-init.sh | |
| sh /tmp/elan-init.sh -y --default-toolchain none --no-modify-path | |
| fi | |
| cd "$HOME" | |
| if [ ! -f leancheck/lakefile.toml ] && [ ! -f leancheck/lakefile.lean ]; then | |
| echo "== creating Mathlib project" | |
| rm -rf leancheck | |
| lake +leanprover-community/mathlib4:lean-toolchain new leancheck math | |
| fi | |
| cd leancheck | |
| echo "== downloading prebuilt Mathlib" | |
| lake exe cache get | |
| mkdir -p scratch | |
| echo "LEAN-SETUP-DONE" | |