Lema documentation
Learn how to read and write Pythonic and Lean contracts, work with AI coding agents over a content-addressed store, and build on Lema’s VM and proved HTTPS stack.
Lema is a programming language for building software the way mathematicians build theories: by stating clear
contracts, proving theorems about implementations once, and composing those guarantees across a codebase. Instead of
storing code in fragile text files where specifications, implementations and proofs are tangled together, Lema
stores canonical typed objects in a content-addressed database, renders contracts in pluggable Pythonic
(.lema) and Lean views, and compiles accepted definitions directly to its own register VM.
If you are new to Lema or pairing with an AI coding agent such as Claude Code or Codex, start with
Get started with Lema for agent-assisted or manual setup.
You can also read your first contract and proof on any
operating system, then follow Create a project and store to see how
lema new, lema add, lema test, lema run and
lema diff work. If you are a functional or systems programmer exploring the architecture, start with
Build software like mathematics,
Code stored by identity,
Layer 0 and the capability boundary, and
The proved HTTPS stack.
Tutorials
Read a contract, create a project, publish a proof and run your code on the VM.
Explanation
Understand the type system, content addressing, the VM and the proved HTTPS stack.
- Build software like mathematics
- Anatomy of a Lema program
- Types and invariants
- Contracts, selections and proofs
- Code stored by identity
- Evolving programs, handles and concurrency
- Capabilities and the host boundary
- The proved storage and HTTPS stack
- The compiler and VM
- How the store accepts code
- Checked, tested and assumed
- Semantic version control
- Lema Cloud and LemaHub
- Version and compatibility
- Where the ideas come from
- Design decisions
How-to guides
Add modules, review semantic changes, release applications and manage a local store.
- Work with a Lema project
- Review and merge semantic changes
- Replace an implementation
- Export and import a project or library bundle
- Develop a library on the private Cloud pilot
- Build a VM application
- Build an application with capabilities
- Release an application
- Build static inspection pages
- Move an alias safely
- Create a store with a narrower axiom policy
- Re-check a store from scratch
- Write a runtime configuration
- Install the pinned Lean distribution
- Recover from a HALTED latch
- Run the repository checks
- Update or uninstall Lema
- Build the Lema tools from source
Reference
Look up Pythonic syntax, commands, records, primitives and runtime requirements.
Lema v0.3.2 · Updated 29 October 2026 · Version and compatibility