Litex is a high-level language for formal mathematics
Litex is a high-level language for formal mathematics. Instead of building proofs command by command, you write natural mathematical statements: Litex automatically checks domain conditions (such as nonzero denominators) and searches existing context for justifications.
Litex makes formal code feel natural
1 / 6
Everyday mathematical writing already has rigorous logical structure; Litex lets that structure become checkable formal code directly.
The way you would say it
. Then .
The same words in Litex
forallx R:
x^2 >= 0
The same words in Lean
Extra proof commands
theorem nonneg_sq (x : ℝ) : x ^ 2 ≥ 0 := by
exact sq_nonneg x
Lean requires a theorem name ('nonneg_sq'), ':= by', and a library lemma call ('exact sq_nonneg x') beyond the mathematical statement itself.
Select a colored phrase to follow it into code and into the reason it holds.
See why each proof step holds
Click a statement to locate its JSON record. Hover for proof details. Edit, then Check (⌘ / Ctrl + Enter).
Why √2 is irrational
(Secondary)
Loading the interactive reading…
Litex automatically checks domains and finds justifications
Litex takes on routine deduction. Just as Python manages memory so programmers can focus on algorithms, Litex automatically checks domain conditions and verifies routine steps so authors can focus on the mathematical argument.
From a general rule to a particular fact.
Every element of A belongs to B, and a belongs to A. Litex finds the universal fact, substitutes a for x, checks its premise, and obtains a ∈ B.
Litex provides basic mathematical objects and their relations, mathematical axioms, and reasoning mechanisms such as syllogisms, contradiction and case analysis: the bricks and mortar. Your definitions, assumptions and verified facts form the context in which it searches for evidence.
What about a complicated proof?
Finding a proof may require deep insight. Checking it can be broken down into basic steps: substitution, calculation and applying established results. Litex also automatically checks domain conditions, such as a denominator being nonzero, and retrieves known facts. It searches for evidence for each step and makes its conclusion available to later steps, without needing a dedicated builtin rule for every new theorem.
What about abstract concepts?
An abstract concept can be defined by combining existing objects, properties and conditions. Litex lets you define new mathematical concepts yourself. Your concepts can then be used in the next layer of definitions and proofs, building the edifice of mathematics step by step.
A finite set of basic mechanisms can be combined repeatedly. This does not mean Litex already covers all mathematics; support for particular constructions and proofs still needs to be tested in practice.
Measured: program length and checking time
The de Bruijn factor compares formal code length to ordinary mathematical text: 1.0 means equal length; lower is shorter.
22–23 Oct 2026 · warm medians · native checking, excluding startup, imports, output and Lean replay.
Litex: A universal mathematical frontend across proof systems.
In programming, developers moved from assembly to Python to focus on algorithms. In formal mathematics, Litex serves as a high-level language and universal frontend: write mathematics once with automatic domain checks, compile supported proofs directly to Lean 4 today for independent kernel verification, and extend toward Coq (Rocq) and Isabelle on the roadmap.
From a single formal Litex source—without maintaining separate prose and proof files—generate a typeset interactive textbook (litex -reading -latex), inspect its dependency graph, export LaTeX, or compile supported numerical definitions to Python.
Interactive textbooks
litex -reading -latex
Conventional digital math notes either offer natural-language prose with no formal verification, or place prose and low-level proof scripts in two disconnected layers. In Litex, a single verified source is enough: litex -reading -latex compiles it directly into the typeset textbook below—click any sentence or symbol to inspect its cited reasons and domain conditions, switch to the Litex source, or click “Try editing” to modify and recheck in place.
Litex provides an interactive Session environment for AI agents and human authors. Submit one proof step at a time: when a step fails, Litex reports the exact reason—such as a missing domain condition x != 0—without terminating the Session or discarding earlier accepted facts. The agent repairs that step in place and continues.
Run with -session and keep the process open while AI adds or repairs statements.
First accepted definition
One statement in the live Session
have fn reciprocal(x R: x != 0) R = 1 / x
Litex response
Selected fields from the actual interactive success response