Skip to content

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.

How-to guides

Add modules, review semantic changes, release applications and manage a local store.

Reference

Look up Pythonic syntax, commands, records, primitives and runtime requirements.

Lema v0.3.2 · Updated 29 October 2026 · Version and compatibility