Interactive textbooks
Set a to 1. Hover over the next line to see why it holds.
Loading the interactive reading…


“Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things.”
Litex is a language for writing mathematics that a machine can check. Most proof assistants ask you to build a proof command by command: rewrite here, apply that lemma, split into cases. Litex asks for the mathematics instead. You define an object or state a fact in ordinary notation, and the checker looks through the definitions and facts already in scope for a reason that the step holds. If it finds none, it tells you which step failed and why.
Every phrase has a job: it names an object, fixes a range, or states what has to be shown. Litex checks the same three things.
The way you would say it
. Then .
The same words in Litex
forall x R:
x^2 >= 0
What the checker uses
Select a colored phrase to follow it into code and into the reason it holds.
Assume √2 = p/q in lowest terms. Show that p and q must both be even, contradicting gcd(p, q) = 1.
Uses: Built-in primes · Reduced fractions · Euclid on powers
Hover to see why a step holds. ⌘ / Ctrl + click to follow its evidence. Edit, then Check (⌘ / Ctrl + Enter).
Loading the interactive reading…

“An algorithm must be seen to be believed.”
Litex takes on more of the details of proving. Authors write definitions and mathematical steps; the system automatically checks domain conditions, searches the context and built-in rules for justification, and records how each step holds. This is Litex’s exploration of a high-level language for formal mathematics—source that follows the mathematical argument, with the language handling the mechanical work of everyday reasoning.
Search is bounded. You still supply the mathematical argument.
See the full checking processEvery 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.
1.0 means the formal source is as long as the informal text; lower is shorter.
| Mathematical task | de Bruijn factor ↓ | Verification (ms) ↓ | Litex speedup ↑ | |||
|---|---|---|---|---|---|---|
| Litex | Lean | Lean ÷ Litex ↑ | Litex | Lean | ||
| Set theory: the set of positive reals is nonempty | 0.54 | 1.07 | 2.0× | 0.084 | 6.439 | 76.9× |
| Natural-number arithmetic: 1 + 1 = 2 | 1.00 | 5.20 | 5.2× | 0.037 | 1.361 | 36.7× |
| Universal statement: the sum of two positive reals is positive | 0.57 | 1.34 | 2.4× | 0.392 | 10.487 | 26.7× |
| The derivative of the square function at 3 is 6 | 0.51 | 1.34 | 2.6× | 1.464 | 29.945 | 20.5× |
22–23 Oct 2026 · warm medians · native checking, excluding startup, imports, output and Lean replay.

“Computer science is a science of abstraction — creating the right model for thinking about a problem and devising the appropriate mechanizable techniques to solve it.”
Where this is going
Programmers stopped writing machine code. Assembly came first, then C and Python: each step moved the language closer to how people think and left less machine detail to the writer. Formal mathematics is earlier on that road. Proof assistants still ask for proof terms and tactic scripts; Lean's kernel checks them. Checking belongs to the machine, but the writing does not — it is still closer to the machine than to the mathematics. Litex is meant to be the next layer: you write mathematics, the language handles the routine steps, and supported proofs compile to a system that checks them. Lean works today; the other backends are goals.
View full-size diagram ↗One Litex proof, and the Lean code the compiler generates for it.
Proof compilation
Litex source
Source ↗# The number one equals itself.
1 = 1
Generated Lean
Complete file ↗import Litex
set_option linter.unusedVariables false
namespace LitexCompiled.file_lean_x2f_examples_x2f_one_x5f_equals_x5f_itself_x2f_statement_x2e_lit
universe u
variable {M : Litex.Semantics.{u}}
theorem h_1 : Litex.Same (Litex.number (M := M) (1 : ℂ)) (Litex.number (M := M) (1 : ℂ)) :=
(by
litex_complete =>
exact (
(show @Eq M.Value _ _ from Eq.refl _)
)
)
end LitexCompiled.file_lean_x2f_examples_x2f_one_x5f_equals_x5f_itself_x2f_statement_x2e_lit

“A mathematician, like a painter or a poet, is a maker of patterns.”
Turn a Litex proof into an interactive textbook, explore its dependency graph, export it to LaTeX, or reuse its theorems in another proof.
Set a to 1. Hover over the next line to see why it holds.
Loading the interactive reading…
Follow the definitions and facts one proof depends on.
Newton’s update, typeset from its Litex definition.
Litex
have fn newton(x R+) R = (x + 2 / x) / 2Run the Newton step as a Python function.
Litex
algo newton_step(x R) R by cases:
case x = 0: 1
case x != 0: (x + 2 / x) / 2Python
def newton_step(x):
if x == 0.0:
return 1.0
elif x != 0.0:
return ((x + (2.0 / x)) / 2.0)
raise AssertionError("unreachable verified Litex cases")
“What I cannot create, I do not understand.”
Litex is useful at every stage of AI work. When training a model, the verification record of every step can serve as feedback. When an agent works on a mathematics problem, it can submit one proof step at a time in the same Litex Session, repair the step that fails, and keep the results already accepted. In AI safety experiments, the action rules can be written down first, and Litex checks a proposed action against them before the agent acts.
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 / xLitex response
Actual interactive success response
successThe definition is accepted. Save it before moving on.

“If I have seen further, it is by standing on the shoulders of giants.”
Language carries information and is itself information. Litex aims to make mathematics as code useful to everyone who uses and loves mathematics.
Sponsors and partners
“From knotted cords to symbolic notation, the choice of representation has always shaped human thought. Arabic numerals and Newton's calculus notation prevailed because of their clarity and simplicity. As formal languages evolve today, Litex may likewise open new possibilities by enabling us to reason clearly, simply, and formally.”
Zeyu Zheng
PhD Candidate at CMU
“The only language capable of verifying advanced arguments using the mathematical notation familiar since elementary school.”
Yuniruyuni
Math Lover from Japan
“I appreciate a serious contender in the field of interactive theorem proving. Currently the field is dominated by Lean and Rocq, and I appreciate that Litex is challenging this duopoly.”
Huỳnh Trần Khanh
Lean Expert from Vietnam
“Litex is a hacker-built, community-driven, and highly creative project that brings value to everyone working on AI and mathematics.”
Siqi Sun
CTO of Intelligen, Research Scientist at Shanghai AI Lab and Fudan University
“I'm a happy researcher dedicated to making AI more trustworthy and protective of humanity. Litex is the formal language that can help align AI reasoning with human understanding in this big AI dream!”
Jie Fu
Yoshua Bengio's Postdoc
“Litex is much easier to use compared to other formal languages like Lean. While it is still in its infancy, I believe it has the potential to become a powerful research tool that every scientist will be able to easily use and be eager to adopt in the future.”
Yan Lu
Research Scientist at Shanghai AI Lab
Special thanks to Wei Lin, Siqi Sun, Peng Sun, Yi Wang, Chenxuan Huang, Yan Lu, Sheng Xu, Hao Wu, Keyao Zhu, Xingjian Ma, and Zhaoxuan Hong for their support and advice.