QR code for the slides

Around Formalization: Why and How to Explain Mathematics to a Computer

Riccardo Brasca
Institut de Mathématiques de Jussieu-Paris Rive Gauche
Université Paris Cité
Colloquia Patavina | Università di Padova | May 5, 2026

Today

  • What does it mean to formalize mathematics?

  • Why formalize?

  • Formalization and mathematics in the age of AI

Formalization

  • At a low level, formalizing mathematics means writing the axioms of mathematics in a strict formal language, and then using a computer to check proofs line by line

  • This is nothing new: it started even before the existence of computers

  • It doesn't look very interesting for most mathematicians

Low-level formalization

Russell and Whitehead's Principia Mathematica.

Proof Assistants

  • Today, formalization is done with proof assistants

  • Proof assistants are programming languages that allow one to express mathematical concepts

  • They allow one to write mathematics in a human-friendly way

Low-level formalization

Forget this

Lean and mathlib

  • There are various proof assistants (Rocq, Isabelle, Agda, ...); we will focus on Lean

  • Lean has been developed by Leonardo de Moura at Microsoft Research in 2013

  • It is an open source software — the current version is Lean 4

  • Mathlib is Lean's official mathematical library

  • It covers mathematics at the level of an advanced undergraduate or first-year graduate student

  • Almost 2.5 million lines of code, contributed by hundreds of people

Parseval's identity: \dfrac{1}{2\pi}\int_{-\pi}^{\pi} |f(x)|^2 \, dx = \sum_{n=-\infty}^{\infty} |\hat f (n)|^2

Condensed spaces: \text{CompHaus}^{\text{op}} \Rightarrow \text{Set}

A Lean example

theorem Heine_Cantor (X Y : Type) [MetricSpace X] [MetricSpace Y] [CompactSpace X] (f : X Y) (hf : Continuous f) : UniformContinuous f := by rw [Metric.uniformContinuous_iff] intros ε ε_pos let K := { (p₁, p₂) : X × X | ε dist (f p₁) (f p₂) } have K_closed : IsClosed K := by apply isClosed_le · continuity · continuity have K_cpct : IsCompact K := by exact IsClosed.isCompact K_closed rcases K.eq_empty_or_nonempty with h | h · use 1, by grind intros x y have : (x, y) K := by grind grind obtain p, p_in, H : p K, q K, dist p.1 p.2 dist q.1 q.2 · apply K_cpct.exists_forall_le h continuity use dist p.1 p.2 constructor · simp intro eq apply lt_irrefl ε calc ε 0 := by simpa [eq, K] using p_in _ < ε := ε_pos · intros x x' contrapose! aesop

Why formalize?

  • Formalizing looks like explaining mathematics to an alien

  • Their way of thinking about mathematics is completely different from yours

  • To make them understand, you have to reorganize and rethink your mathematics

  • You have to reduce the noise in your mathematics

  • At the end you have much clearer thinking and a deeper understanding

"The Lean Proof Assistant was really that: an assistant in navigating through the thick jungle that this proof is." — Peter Scholze

Formalization can help understanding

 

Consider the following easy lemma:

 

Let (u_n) and (v_n) be sequences of real numbers and \ell \in \mathbb{R}. If \lim u_n = \ell^+ and \lim v_n = -\infty then \lim (u_n + v_n) = -\infty.

 

It seems like a special case of a more general result about limits of sums of sequences

 

But which one exactly?

Formalization can help understanding

 

Consider the following easy lemma:

 

Let (u_n) and (v_n) be sequences of real numbers and \ell \in \mathbb{R}. If \lim u_n = \ell^+ and \lim v_n = -\infty then \lim (u_n + v_n) = -\infty.

 

This is done in Lean (and in other proof assistants) using filters

 

Already done in Bourbaki

Checking correctness

  • Correctness is checked by the kernel of the proof assistant

  • The kernel is a relatively small piece of software

  • A bug in the kernel is very unlikely

  • In practice the chance that a wrong proof is accepted by the kernel is negligible...

  • ...if the proof is written by humans

  • But definitions should always be checked very carefully

"I spent much of 2019 obsessed with the proof of this theorem, almost getting crazy over it. I still have some small lingering doubts." — Peter Scholze

AI and formalization

  • LLMs are getting better and better at formalizing mathematics

  • A team led by Sidharth Hariharan was able, with the help of AI, to formally verify Viazovska's result on sphere packing in dimension 8

  • The same model was able to verify the result in dimension 24

  • Writing a formal proof of one theorem is very different from building a library

  • Humans are needed to check statements and definitions...

  • ...and also that the AI didn't cheat

Thank You

Thank you for your attention!