Audit a real Mathlib theorem from start to finish: find it, read it, check its definitions, axioms and proof.
This section is hands-on. You audit a real theorem from Mathlib, the library where Lean's mathematics lives, one checklist step at a time, the way you would audit a file an AI sent you.
After each step, a question.
Cantor's theorem (1891): no set can be matched with all of its subsets.
However you assign a subset of S to each element of S, some subset is left over.
It is the reason there are different sizes of infinity, and it is famous for a short, clever proof.
Some vocabulary: α is any type (any collection of things). Set α is a subset of α.
f : α → Set α assigns a subset to each element.
Function.Surjective f means every subset is assigned to some element.
The statement has only variables before the conclusion: a type α and a function f.
There is no hypothesis, no “if”, so nothing can be impossible and nothing can secretly assume the answer.
You do not have to read a proof to audit it: Lean checks every step.
But Cantor's argument is famous, so here it is in tactics.
Hover over the tactics to see the goal before and after each one.
The idea: suppose f hits every subset. Look at the diagonal subset of the elements not in their own subset. Some d is sent to it.
Is d in its own subset? If yes, the diagonal's rule says it is not. If no, the rule says it is. Both are impossible.
Proved with no axioms; the statement says the claim; there are no hypotheses; the definitions are Mathlib's standard ones, which we printed. The audit passes.