Functorial
Spec engineering with mathematical precision.
How it works
A proof checker only answers the question you asked.
So the question is the job. We call that job specification engineering: a person states what the system must do, a model searches for the proof, and a checker has the last word.
-
1
You write the spec
Decide what must be true, and say it in Lean. This is the part that cannot be delegated.
-
2
AI searches
A model looks for a proof or a counterexample. A counterexample means the program is wrong, or the spec is.
-
3
The checker decides
Lean's kernel accepts the proof or it does not. Nobody has to take the model's word for it.
theorem sort_spec (l : List Nat) : Sorted (sort l) ∧ (sort l).Perm l := by constructor · simpa [Sorted, sort] using l.pairwise_mergeSort (le := (· ≤ ·)) (by simp; omega) (by simp; omega) · exact l.mergeSort_perm _
✓ Lean accepted. No sorry. Axioms: propext, Quot.sound.
The first spec in the demo says only that the output is sorted. A function that returns the empty list meets it. Own the meaning is the principle that catches that.
Functorial Academy
Learn Lean by proving things.
Every answer you type is checked by real Lean 4 with all of Mathlib loaded. Nothing is compared to a stored answer. If Lean accepts it, it is correct.
- courses
- 5
- units
- 47
- exercises
- 559
- stored answers
- 0
Zero to Riemann Zeros
Learn Lean and the proof of the Riemann Hypothesis. Start with no Lean at all, and end by compiling the proof's final theorem yourself.
Start hereLean 4 for Programmers
From your first definition to specifications an AI can prove.
Start hereLean 4 for Mathematicians
Learn Lean 4 and Mathlib through the algebra you already know.
Level upIntro to Proofs
What a proof is, how to read the goal, and the tactics every proof is built from.
AdvancedSpecification Engineering
Say what a C function and its RISC-V binary must do, tightly enough to hand the proof to an AI.
Faithfulness Review
Lean can tell you a proof is correct. It cannot tell you the proof is about your theorem.
An autoformalizer turns a paper into Lean, and Lean checks the Lean. The open question is whether the Lean says what the paper says.
In a faithfulness review you step through every correspondence between the paper and the Lean code, statement by statement and hypothesis by hypothesis, and grade each one. The mappings are the product.
The term was coined by Tobi Lehman in Math, AI, Lean and the Faithfulness Review.
- Lean certificate This exact source builds, with no
sorry, on these axioms, with this toolchain. - Faithfulness certificate A named person checked that each Lean declaration says what the paper says.
Principles
-
1
Own the meaning
A proved specification can still miss the requirement. You can delegate finding a proof, but not understanding what is to be proved.
-
2
Make the claim inspectable
A checked proof establishes a precise statement under stated assumptions. Show the statement, the definitions, the assumptions and the proof status.
-
3
State the conditions and the scope
A guarantee applies only when its assumptions hold and its model fits the situation. Say when that is.
Get the spec right, and sleep at night.
Latest
What we have shipped lately.
- Case studyVerifying formal models of K8s APF and using spec engineering to generate bug fixes→
- CompanyOur three principles, and one big goal→
- CourseZero to Riemann Zeros opens: from no Lean to the proof of the Riemann Hypothesis→
- TalkFaithfulness reviews of Lean autoformalizations, at Portland State University→
- ProgramThe pilot program opens to researchers→
- PaperShift-symmetric configurations in d-dimensional cellular automata, with a detection algorithm verified in Lean 4→
Have a program, a distributed system, or a paper that has to be right?
Tell us what you are working on. We will set up a call.