ResearchPublished ExplainedAll news from that day
How Lean checks an AI-written proof, and where that stops
Lean's manual describes a kernel check, an axiom listing and two stronger tools, and says a passing check is meaningful if the theorem statement matches its intended meaning.
Check our sources · 16 facts from 7 sources
Illustration made with AI for ai notis
Key points
- Lean's manual describes its trusted kernel as a small implementation of a type checker, and says newly elaborated inductive types and definitions must be checked by it.
- #print axioms lists what a declaration uses; sorryAx in the list means the theorem or a dependency uses sorry or is incomplete. Lean has four standard axioms.
- The manual separates whether a theorem has a valid proof from what its statement means, and calls the basic check meaningful if the statement matches its intended meaning.
What happened
Lean is an open-source system that works both as a programming language and as a proof assistant. You use it to write precise, verifiable code and formal proofs.
Lean's manual describes its trusted kernel as a small, robust implementation of a type checker for the core type theory. New inductive types or definitions must be checked by the kernel to guard against potential bugs in elaboration.
The idea behind the check is called propositions as types. A statement is a type, and a proof of it is simply an object of that type. In interactive proving, every step has to be justified by appealing to prior definitions and theorems, all the way down to basic axioms and rules.
Lean's manual says proof terms are sufficient evidence of the truth of a theorem and are amenable to independent verification.
The check has limits, and the manual lists them. A proof can contain the sorry placeholder, which Lean says can prove anything and is not intended to occur in finished proofs. Running the command #print axioms on a theorem shows which axioms it depends on. A result that lists sorryAx is incomplete.
Lean counts four standard axioms: propext, Classical.choice and Quot.sound, which the manual calls important parts of how mathematics is done in Lean, and sorryAx, which is not intended to occur in finished proofs.
The manual also separates two questions: whether a theorem has a valid proof, and what the theorem statement means. It says that if there are doubts the theorem means what it appears to mean, its statement and all referenced definitions must be investigated carefully.
For higher stakes it describes the lean4checker tool, which replays the stored declarations through the kernel, and a tool called Comparator, which builds the proof in a sandbox and checks that the proved statements match those in a trusted challenge file.
The manual says the check is meaningful if one believes the theorem statement matches its intended meaning and trusts the authors of the imported libraries to be honest.
Underlined sentences link to the facts we checked. Dotted words open a short explainer.
Fact 2 of 16 · from Lean FRO / Lean project
Lean's trusted kernel is a small, robust implementation of a type checker for the core type theory.
Fact 3 of 16 · from Lean FRO / Lean project
Before new inductive types or definitions are added to the environment by the command or term elaborators, they must be checked by the kernel to guard against potential bugs in elaboration.
Fact 7 of 16 · from Lean FRO / Lean project
Lean's reference manual says proof terms are sufficient evidence of the truth of a theorem and are amenable to independent verification.
Fact 10 of 16 · from Lean FRO / Lean project
There are four standard axioms in Lean. The first three axioms are important parts of how mathematics is done in Lean: Classical.choice ... propext ... Quot.sound ... The axiom sorryAx is used as part of the implementation of the sorry tactic ... Lean itself provides three such axioms that are known to be consistent.
What it means for you
Our viewA passing Lean check answers whether a proof is valid, and leaves open whether the theorem proved is the one you wanted. The manual says to investigate the statement and the definitions it refers to when there is doubt, in particular custom notation and type classes.
For higher stakes it describes lean4checker, which replays stored declarations through the kernel, and Comparator, which checks the proved statements against a trusted challenge file.
When someone presents an AI-written result as verified in Lean, ask for the #print axioms output and read the theorem statement against the claim being made before you rely on it.
It adds no new facts.
Your reaction
We count reactions per story and day, never who reacted. The counts help us choose what goes in the monthly issue. If you are signed in, your own page shows yours too.
We count reactions per story and day, never who reacted. They help choose what goes in the monthly issue.
Check our sources
Every sentence above is checked against these 7 sources.
1 Lean: programming language and proof assistant
Open the source archived copy-
The Lean home page describes Lean as an open-source programming language and proof assistant that enables correct, maintainable and formally verified code, and says Lean lets you write precise, verifiable code and formal proofs.
Toned down to what the source says cite
2 Lean reference: Elaboration and Compilation
Open the source archived copy-
Lean's reference manual says: 'Lean's trusted kernel is a small, robust implementation of a type checker for the core type theory.'
citeLean's trusted kernel is a small, robust implementation of a type checker for the core type theory.
-
The manual says newly elaborated inductive types and definitions 'must be checked by the kernel to guard against potential bugs in elaboration'.
citeBefore new inductive types or definitions are added to the environment by the command or term elaborators, they must be checked by the kernel to guard against potential bugs in elaboration.
3 Theorem Proving in Lean 4: Propositions and Proofs
Open the source archived copy-
Theorem Proving in Lean 4 describes propositions-as-types as an instance of the Curry-Howard isomorphism and says 'A proof of p is then simply an object t : p of the right type.'
cite...is an instance of the Curry-Howard isomorphism , sometimes known as the propositions-as-types paradigm. ... A proof of p is then simply an object t : p of the right type.
-
Theorem Proving in Lean 4 says: 'The sorry identifier magically produces a proof of anything, or provides an object of any data type at all.'
citeThe sorry identifier magically produces a proof of anything, or provides an object of any data type at all. Of course, it is unsound as a proof method
4 Theorem Proving in Lean 4: Introduction
Open the source archived copy-
Theorem Proving in Lean 4 says that in interactive proving, every step of a calculation has to be justified by appealing to prior definitions and theorems, all the way down to basic axioms and rules.
cite
5 Lean reference: The Type System
Open the source archived copy-
Lean's reference manual says proof terms are sufficient evidence of the truth of a theorem and are amenable to independent verification.
cite
6 Lean reference: Axioms
Open the source archived copy-
The Axioms page says sorryAx is used in the implementation of the sorry tactic and term, and that uses of this axiom are not intended to occur in finished proofs, as it can be used to prove anything.
citeThe axiom sorryAx is used as part of the implementation of the sorry tactic and sorry term. Uses of this axiom are not intended to occur in finished proofs, as it can be used to prove anything
-
The Axioms page says the command #print axioms prints the axioms used by a declaration, directly or indirectly.
cite#print axioms ... Prints the axioms used by a declaration, directly or indirectly.
-
The Axioms page says Lean has four standard axioms: Classical.choice, propext and Quot.sound, which it calls important parts of how mathematics is done in Lean and says are known to be consistent, and sorryAx, which implements sorry and is not intended to occur in finished proofs.
Toned down to what the source says
citeThere are four standard axioms in Lean. The first three axioms are important parts of how mathematics is done in Lean: Classical.choice ... propext ... Quot.sound ... The axiom sorryAx is used as part of the implementation of the sorry tactic ... Lean itself provides three such axioms that are known to be consistent.
7 Lean reference: Validating a Lean Proof
Open the source archived copy-
The Validating a Lean Proof page says that if sorryAx is reported by #print axioms, the theorem or a dependency uses sorry or is incomplete.
citeIf sorryAx is reported, then this theorem or one of its dependencies uses sorry or is otherwise incomplete.
-
The Validating a Lean Proof page separates the question of whether a theorem has a valid proof from the question of what the theorem statement means, and counts un-reviewed AI-generated proofs and programs as malicious in its sense: code that goes out of its way to trick or mislead the user, exploit bugs or compromise the system.
Toned down to what the source says
citewe use malicious to describe code that goes out of its way to trick or mislead the user, exploit bugs or compromise the system. This includes un-reviewed AI-generated proofs and programs. Furthermore it is important to distinguish the question does the theorem have a valid proof from what does the theorem statement mean.
-
The Validating a Lean Proof page says that if there are doubts that the theorem means what it appears to mean, its statement and all referenced definitions must be investigated carefully, in particular with regard to custom notation and type classes.
Toned down to what the source says
citeIf there are doubts that the theorem means what it appears to mean, its statement and all referenced definitions must be investigated carefully, in particular with regard to custom notation and type classes.
-
The Validating a Lean Proof page says lean4checker reads the declarations and proofs as stored by lean in the .olean files and replays them through the kernel.
citeThe lean4checker tool reads the declarations and proofs as they are stored by lean during building (the .olean files ), and replays them through the kernel. It trusts that the .olean files are structurally correct.
-
The Validating a Lean Proof page says Comparator, meant for high-risk cases such as proof marketplaces, high-reward proof competitions and unaligned AI, builds the proof in a sandbox, exports the proof term, and outside the sandbox replays the proofs and checks that the proved theorem statements match those in a trusted challenge file.
Toned down to what the source says
citeThis should only be necessary for high risk scenarios (proof marketplaces, high-reward proof competitions, unaligned AI). ... Comparator will build the proof in a sandboxed environment, to protect against malicious code in the build step. The proof term is exported to a serialized format. Outside the sandbox ... it validates the exported format, replays the proofs using both Lean's kernel and/or an external checker and also ensures that the proved theorem statements match those in the trusted challenge file.
-
The Validating a Lean Proof page says the basic check is meaningful if one believes the formal theorem statement corresponds to its intended informal meaning and trusts the authors of the imported libraries to be honest.
Toned down to what the source says
citeThis check is meaningful if one believes the formal theorem statement corresponds to its intended informal meanings and trusts the authors of the imported libraries to be honest
Every sentence above is checked against these 7 sources. Each fact has its own address you can cite.
Source 1 · Lean FRO / Lean project
Lean: programming language and proof assistant
The Lean home page describes Lean as an open-source programming language and proof assistant that enables correct, maintainable and formally verified code, and says Lean lets you write precise, verifiable code and formal proofs.
Toned down to what the source saysSource 2 · Lean FRO / Lean project
Lean reference: Elaboration and Compilation
Lean's reference manual says: 'Lean's trusted kernel is a small, robust implementation of a type checker for the core type theory.'
Lean's trusted kernel is a small, robust implementation of a type checker for the core type theory.
The manual says newly elaborated inductive types and definitions 'must be checked by the kernel to guard against potential bugs in elaboration'.
Before new inductive types or definitions are added to the environment by the command or term elaborators, they must be checked by the kernel to guard against potential bugs in elaboration.
Source 3 · Lean FRO / Lean project
Theorem Proving in Lean 4: Propositions and Proofs
Theorem Proving in Lean 4 describes propositions-as-types as an instance of the Curry-Howard isomorphism and says 'A proof of p is then simply an object t : p of the right type.'
...is an instance of the Curry-Howard isomorphism , sometimes known as the propositions-as-types paradigm. ... A proof of p is then simply an object t : p of the right type.
Theorem Proving in Lean 4 says: 'The sorry identifier magically produces a proof of anything, or provides an object of any data type at all.'
The sorry identifier magically produces a proof of anything, or provides an object of any data type at all. Of course, it is unsound as a proof method
Source 4 · Lean FRO / Lean project
Theorem Proving in Lean 4: Introduction
Theorem Proving in Lean 4 says that in interactive proving, every step of a calculation has to be justified by appealing to prior definitions and theorems, all the way down to basic axioms and rules.
Source 5 · Lean FRO / Lean project
Lean reference: The Type System
Lean's reference manual says proof terms are sufficient evidence of the truth of a theorem and are amenable to independent verification.
Source 6 · Lean FRO / Lean project
Lean reference: Axioms
The Axioms page says sorryAx is used in the implementation of the sorry tactic and term, and that uses of this axiom are not intended to occur in finished proofs, as it can be used to prove anything.
The axiom sorryAx is used as part of the implementation of the sorry tactic and sorry term. Uses of this axiom are not intended to occur in finished proofs, as it can be used to prove anything
The Axioms page says the command #print axioms prints the axioms used by a declaration, directly or indirectly.
#print axioms ... Prints the axioms used by a declaration, directly or indirectly.
The Axioms page says Lean has four standard axioms: Classical.choice, propext and Quot.sound, which it calls important parts of how mathematics is done in Lean and says are known to be consistent, and sorryAx, which implements sorry and is not intended to occur in finished proofs.
Toned down to what the source saysThere are four standard axioms in Lean. The first three axioms are important parts of how mathematics is done in Lean: Classical.choice ... propext ... Quot.sound ... The axiom sorryAx is used as part of the implementation of the sorry tactic ... Lean itself provides three such axioms that are known to be consistent.
Source 7 · Lean FRO / Lean project
Lean reference: Validating a Lean Proof
The Validating a Lean Proof page says that if sorryAx is reported by #print axioms, the theorem or a dependency uses sorry or is incomplete.
If sorryAx is reported, then this theorem or one of its dependencies uses sorry or is otherwise incomplete.
The Validating a Lean Proof page separates the question of whether a theorem has a valid proof from the question of what the theorem statement means, and counts un-reviewed AI-generated proofs and programs as malicious in its sense: code that goes out of its way to trick or mislead the user, exploit bugs or compromise the system.
Toned down to what the source sayswe use malicious to describe code that goes out of its way to trick or mislead the user, exploit bugs or compromise the system. This includes un-reviewed AI-generated proofs and programs. Furthermore it is important to distinguish the question does the theorem have a valid proof from what does the theorem statement mean.
The Validating a Lean Proof page says that if there are doubts that the theorem means what it appears to mean, its statement and all referenced definitions must be investigated carefully, in particular with regard to custom notation and type classes.
Toned down to what the source saysIf there are doubts that the theorem means what it appears to mean, its statement and all referenced definitions must be investigated carefully, in particular with regard to custom notation and type classes.
Show all 6 factsShow fewer facts
The Validating a Lean Proof page says lean4checker reads the declarations and proofs as stored by lean in the .olean files and replays them through the kernel.
The lean4checker tool reads the declarations and proofs as they are stored by lean during building (the .olean files ), and replays them through the kernel. It trusts that the .olean files are structurally correct.
The Validating a Lean Proof page says Comparator, meant for high-risk cases such as proof marketplaces, high-reward proof competitions and unaligned AI, builds the proof in a sandbox, exports the proof term, and outside the sandbox replays the proofs and checks that the proved theorem statements match those in a trusted challenge file.
Toned down to what the source saysThis should only be necessary for high risk scenarios (proof marketplaces, high-reward proof competitions, unaligned AI). ... Comparator will build the proof in a sandboxed environment, to protect against malicious code in the build step. The proof term is exported to a serialized format. Outside the sandbox ... it validates the exported format, replays the proofs using both Lean's kernel and/or an external checker and also ensures that the proved theorem statements match those in the trusted challenge file.
The Validating a Lean Proof page says the basic check is meaningful if one believes the formal theorem statement corresponds to its intended informal meaning and trusts the authors of the imported libraries to be honest.
Toned down to what the source saysThis check is meaningful if one believes the formal theorem statement corresponds to its intended informal meanings and trusts the authors of the imported libraries to be honest
Topics
The morning email
On the mornings we publish: the three top stories and up to four short ones. Free.
We email you a link to confirm. An issue may include one sponsor, always labelled Sponsored · Advertisement. Our emails count opens and clicks, not who made them. Unsubscribe in one click. What we keep