What Is Formal Verification? Math Proofs Explained

Quick answer: Formal verification uses mathematical logic and computer tools to establish that a precisely stated claim follows from explicit assumptions. In mathematics, proof assistants such as Lean, Rocq (formerly Coq) and Isabelle check every step of a formal proof, as they did for the four color theorem (2005), the Kepler conjecture (2014) and Fermat’s Last Theorem (2026). In software and hardware, verification checks specified properties of a system, as in the CompCert compiler and the seL4 kernel. Its guarantee depends on the specification, the assumptions and the trusted checking tools.

Updated November 22, 2026.

A published proof is usually checked by a few experts reading carefully. That works well, but people miss things, especially in proofs hundreds of pages long or produced by AI. Formal verification removes the guesswork: every step is written in a precise language and checked by a computer. Once a niche hobby, it became central to mathematics in 2026, when AI systems began producing proofs faster than humans could read them.

Formal Verification in One Example

On paper, you might write: “If \(n\) is even, then \(n^2\) is even, because \(n = 2k\) gives \(n^2 = 4k^2 = 2(2k^2)\).” A reader fills in the small gaps. In a proof assistant, you state the theorem precisely and justify every step, and the computer accepts it only if nothing is missing. In Lean it can look like this:

import Mathlib

theorem sq_even (n : ℕ) (h : Even n) : Even (n ^ 2) := by
  obtain ⟨k, rfl⟩ := h
  exact ⟨2 * k * k, by ring⟩

Here Even n means \(n = k + k\) for some natural number \(k\). The proof supplies the witness \(2k^2\), because \((k + k)^2 = 2k^2 + 2k^2\), and the ring tactic checks that algebra. Change the witness to \(k^2\) and Lean rejects the proof. (Tested with Lean 4 and current Mathlib in November 2026; #print axioms sq_even shows only the standard axiom propext and no unfinished sorry.)

How Proof Assistants Work

  1. State it precisely. Definitions and the theorem are written in a formal language.
  2. Build the proof. You (or an AI) supply steps, often using tactics that automate routine reasoning.
  3. Check with a small kernel. A small, trusted core program verifies that every step follows from the rules of logic and earlier results.
  4. Reuse. Checked results go into libraries, such as Lean’s Mathlib, with hundreds of thousands of formalized theorems, so later proofs build on them.

The Main Proof Assistants

ToolSinceKnown for
Mizar1973One of the earliest large libraries of formal math
Rocq (formerly Coq)Begun 1984, released 1989; renamed 2025Four color theorem, Feit–Thompson theorem, CompCert compiler
Isabelle1986seL4 kernel, part of the Kepler proof
HOL Light1990sMost of the Kepler conjecture (Flyspeck)
LeanBegun 2013Mathlib, Liquid Tensor Experiment, Fermat’s Last Theorem, 2026 AI proofs

Famous Formally Verified Results

Year verifiedResultTool
2005Four color theoremCoq
2012Feit–Thompson (odd order) theorem, whose 1963 paper ran 255 pagesCoq
2014Kepler conjecture (Flyspeck)HOL Light (main proof) and Isabelle (graph classification)
2022Liquid Tensor Experiment (Scholze)Lean
2026Fermat’s Last Theorem: Anthropic reported 11 days of largely autonomous Claude work, building on existing formal librariesLean
2026Riemann Hypothesis proof developed with Claude, certified Nov 21Lean

Formal Verification of Software

The same idea protects critical software. CompCert, by Xavier Leroy and collaborators, is a C compiler whose main passes are proved in Coq to preserve program behavior; a 2011 testing study (Csmith) found no wrong-code errors in its verified parts, unlike other compilers it tested. Some toolchain components remain outside the proof. seL4, verified in Isabelle/HOL in 2009, is an operating-system kernel with a machine-checked proof that its code matches its specification, under stated assumptions. Software and hardware verification also uses automated methods such as model checking and SAT/SMT solvers, and chip makers use them to check processor designs. On November 10, 2026, Google DeepMind introduced AlphaProof Code, which uses AI agents and Lean to verify software against human-approved specifications.

Lean vs Rocq vs Isabelle

ToolLogicStrength
LeanDependent type theoryMathlib, the largest unified library of research mathematics; most AI math work
Rocq (Coq)Dependent type theoryMathematical Components library; certified programs
Isabelle/HOLHigher-order logicArchive of Formal Proofs; strong automation (Sledgehammer)

Which to choose depends on the library you need and the community you will work with. For research mathematics in 2026, most new work is in Lean.

Why Math Needs Computers Now

  • Long proofs. Some modern proofs run to hundreds of pages and depend on many earlier papers; few people can check them fully.
  • Computer-assisted proofs. When a proof depends on huge computations, formal checking is the most reliable way to trust it.
  • AI-written proofs. AI can produce millions of lines of proof. Only a computer can check that much, as with the 2026 Riemann Hypothesis proof. See can we trust AI math proofs?
  • Collaboration. With every step checked, hundreds of people can contribute to one project without needing to trust each other.

Limits of Formal Verification

  • The statement must be right. A proof of a wrongly stated theorem checks perfectly and proves the wrong thing.
  • Some trust remains. You must trust the small kernel, the hardware and any added axioms, a far smaller base than trusting every line.
  • It is still slow. Formalizing a proof by hand has taken many times longer than writing it, though AI assistance is cutting that cost quickly. Note that a file can compile with sorry placeholders, which means the proof is not finished.
  • It does not explain. A verified proof tells you that a result is true, not why.

Common Misconceptions

“Formal verification means testing.” No. Tests check examples; formal verification proves correctness for all cases covered by the statement.

“A formally verified result can never be wrong.” The logic is checked, but the statement, axioms and setup still need human review.

“Only computer scientists use it.” Not anymore. Fields Medalists such as Peter Scholze and Terence Tao have backed formalization projects.

Watch: Formal Verification Explained

If you learn better by watching, these videos are worth your time.

Automated Mathematical Proofs (Computerphile). A clear introduction to computer-checked proofs.
Kevin Buzzard – Where is Mathematics Going? (Simons Foundation). A leading formalization advocate on how proof assistants are changing math (September 2025).
What is Formal Verification? (Galois). A short explainer on formal verification of software.

Check Your Understanding

Five quick questions to see how much of this has stuck. Pick an answer and press Submit; you will see a short explanation either way.

Answer each question and press Submit to see your result right away.

1. What does a proof assistant’s kernel do?
Found a bug? Let us know!
2. Which proof assistant was used for the 2005 four color theorem verification?
Found a bug? Let us know!
3. What did seL4’s verification prove?
Found a bug? Let us know!
4. How is formal verification different from testing?
Found a bug? Let us know!
5. What can formal verification not guarantee by itself?
Found a bug? Let us know!

Frequently Asked Questions

What is formal verification in math?

It is the process of writing a mathematical proof in a formal language so a computer program, a proof assistant such as Lean, Rocq or Isabelle, can check every logical step. If any step is missing or wrong, the proof is rejected.

What is the difference between formal verification and testing?

Testing checks a program or claim on selected examples. Formal verification proves that it is correct for every case covered by its specification or statement.

What are examples of formally verified theorems?

The four color theorem (2005, Coq), the Feit–Thompson theorem (2012, Coq), the Kepler conjecture (2014, HOL Light and Isabelle), Scholze’s Liquid Tensor Experiment (2022, Lean) and Fermat’s Last Theorem (2026, Lean).

Is Coq the same as Rocq?

Yes. The Coq proof assistant was renamed the Rocq Prover in 2025.

Why is formal verification important for AI?

AI can generate proofs faster and longer than people can read. Formal verification lets a computer check every step, which is how 2026 AI-assisted proofs, such as the Riemann Hypothesis proof in Lean, were certified.

Keep Exploring

Sources and Further Reading

Related to This Article

What people say about "What Is Formal Verification? Math Proofs Explained - Effortless Math"?

No one replied yet.

Leave a Reply