xiaohongshu
xiaohongshu
lean-build
Build, test, and debug Lean 4 projects using Lake. Use when building the ComputationalPaths project, checking for errors, running tests, cleaning artifacts, or debugging Lean 4 compilation issues.
Full skill instructions
This skill covers building, testing, and debugging the ComputationalPaths Lean 4 project using Lake (Lean's build system).
Toolchain: leanprover/lean4:v4.24.0 (see lean-toolchain)
Build file: lakefile.toml
name = "computational_paths"
version = "0.1.0"
defaultTargets = ["computational_paths"]
[[lean_lib]]
name = "ComputationalPaths"
[[lean_exe]]
name = "computational_paths"
root = "Main"
# Build entire project (default targets)
lake build
# Build specific library
lake build ComputationalPaths
# Build specific module
lake build ComputationalPaths.Path.HIT.Circle
# Build executable
lake build computational_paths
# Build with verbose output
lake build -v
# Run the executable
lake exe computational_paths
# Clean build artifacts
lake clean
# Full clean (removes .lake directory)
rm -rf .lake && lake build
# Update lake-manifest.json
lake update
# Resolve and fetch dependencies
lake exe cache get # if using Mathlib cache
type mismatch
h
has type
Path a b
but is expected to have type
Path a' b'
Solution: Check that terms have the expected types. Use @ for explicit arguments or add type annotations.
unknown identifier 'foo'
Solution:
ComputationalPaths.Path.foofailed to synthesize instance
Decidable (RwEq p q)
Solution: RwEq is not decidable. Use axioms or noncomputable where needed.
universe level mismatch
Solution: Ensure consistent universe variables. HITs typically use Type u.
axiom MyHIT : Type u -- not Type or Type*
'foo' depends on 'axiom', and therefore must be marked as 'noncomputable'
Solution: Add noncomputable keyword:
noncomputable def foo := ...
invalid 'exact' tactic, term has type ... but is expected to have type ...
Solution: The proof term doesn't match the goal. Check:
@ to make implicits explicitambiguous, possible interpretations: ...
Solution: Use qualified names or local open with hiding:
open Path hiding trans -- if 'trans' conflicts
#check myTerm
#check @myFunction -- show all arguments
#check (myTerm : ExpectedType) -- verify type
#print myDefinition
#print axioms myTheorem -- show axioms used
#reduce myTerm -- fully normalize
#eval myTerm -- for decidable terms only
set_option trace.Meta.Tactic.simp true in
theorem foo : ... := by simp
theorem foo : ... := by
show_term exact? -- suggests exact term
trace "{goal}" -- print current goal
Ensure ComputationalPaths/Path.lean imports all submodules:
import ComputationalPaths.Path.Basic
import ComputationalPaths.Path.Rewrite
import ComputationalPaths.Path.Groupoid
import ComputationalPaths.Path.Homotopy.FundamentalGroup
import ComputationalPaths.Path.HIT.Circle
-- etc.
ComputationalPaths/
├── Basic.lean → import ComputationalPaths.Basic
├── Path.lean → import ComputationalPaths.Path
└── Path/
├── Basic/
│ └── Core.lean → import ComputationalPaths.Path.Basic.Core
└── HIT/
└── Circle.lean → import ComputationalPaths.Path.HIT.Circle
The project uses GitHub Actions with leanprover/lean-action@v1:
# .github/workflows/lean_action_ci.yml
name: Lean Action CI
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: leanprover/lean-action@v1
Simulate CI by running:
lake clean && lake build
Lake caches compilation. After changes, only affected files rebuild:
lake build # rebuilds only changed modules
Lake builds independent modules in parallel by default.
private for internal definitions| Command | Description |
|---|---|
lake build | Build default targets |
lake build <target> | Build specific target |
lake clean | Remove build artifacts |
lake update | Update dependencies |
lake exe <name> | Run executable |
lake env <cmd> | Run command in Lake environment |
lake --version | Show Lake version |
lake --help | Show help |
cat lean-toolchain
# leanprover/lean4:v4.24.0
Edit lean-toolchain:
leanprover/lean4:v4.XX.Y
Then rebuild:
lake clean && lake build
When builds fail:
cat lean-toolchainlake clean && lake buildnoncomputable: If using axiomsxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience