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.
What the checker uses
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).
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.
“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.”
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
“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
More reader comments and acknowledgements
“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, Zhaoxuan Hong, and Qiushi Geng for their support and advice.