Formal Verification and AI Are Reshaping Mathematical Research

We are witnessing a paradigm shift in mathematical research, this much is clear. Mathematics is shifting from a blackboard-bound craft to a scalable, enterprise leveraging human and AI capabilities. This transformation stems from the convergence of large language models and proof assistants. LLMs generate hypotheses, suggest new proof strategies, and automate the mechanical parts of reasoning. Meanwhile, proof assistants such as Lean provide certainty through formal verification. Then the question is: how did we end up here?

Mathematics: Small Teams and Blackboards

Mathematics has traditionally been a field in which research is conducted by just a few people or even individually. As Terry Tao mentions it is still closely tied to blackboards, which is pretty rare these days for any field. This is less a sign of cultural conservatism than a reflection of the discipline’s structure: mathematical reasoning often requires sustained focus, long chains of tightly interdependent arguments, and deep conceptual immersion. Given the nature of mathematical research, it is not surprising that LLMs, which quickly became productive in other domains, had originally found little use here so far: generating draft proofs or exploring quickly is of little use if each step must be verified with extreme rigor, and much of the work relies on subtle intuitions and deep contextual knowledge that are difficult to capture automatically.

Combining automatic generation and formal verification

As we saw at the end of the previous section, LLMs by themselves were not powerful enough to tackle complex mathematical problems. Proof assistants, although they guarantee the correctness of every step, were not sufficient on their own either, due to being hard and time-consuming to use for most research level work. Tools such as Lean or Coq do not generate ideas, propose new techniques, or suggest strategies. They only verify what has already been fully specified. Their use calls for a deep understanding of both the formal language and its libraries, which really limits who can get involved.

To this difficulty we must add the phenomenon known as the de Bruijn factor.

The de Bruijn factor is basically how much longer (or more effort) it takes to write a formal proof in a verification system compared to doing it the traditional way on paper. Usually, that factor sits somewhere between 5 and 20 times more, though it varies quite a bit depending on the field and the tool you're working with.

Formalizing a proof does not simply consist of “rewriting it in more detail,” but rather of making explicit every inference, every dependency, and every auxiliary structure that is omitted in informal mathematical language for readability.

However, a balance is found thanks to the combination of the two elements we have been discussing: LLMs and proof assistants. Language models can quickly explore, suggest proof paths, and automate mechanical parts of formalization, while the proof assistant ensures the correctness of each step. By combining LLMs with proof assistants, researchers can now tackle entire problem collections, like the Erdős problems, that previously served only as benchmarks due to their complexity. We will examine them below.

Erdős Problems

Paul Erdős, who was one of the most prolific mathematicians of the 20th century, proposed more than a thousand problems. These problems range from simple exercises (he called them “marshmallows”), to more challenging ones that need new approaches (which he called “acorns”). Many of these problems were designed to encourage people to work together, even if they were not professional mathematicians.

This organized collection offers a great setup for combining LLMs and proof assistants: models can try out solutions, propose strategies, or handle routine steps, while proof assistants check each step carefully to make sure it's correct. Erdős problems aren’t just a legacy, they also serve as a hands-on test ground for big, AI-driven math work. They show how combining creative ideas with careful checking is changing how math gets done nowadays.

Why it works: An introduction to dependent types

At the core of what makes most proof assistants able to mechanically prove properties about code in a rigorous, sound way lies concept of dependent types. Unlike "ordinary" (i.e. non-dependent) types, with dependent types you can refer to specific values within the type. For example, a type Vector(int, n) represents a vector of integers with exactly n elements. This is where the dependent part of dependent types comes from: the Vector(int, n) type depends on the value n, which naturally defines an entire family of types (Vector(int, 1) is the type containing all possible vectors of integers with exactly one element, Vector(2) is the type containing all possible vectors of integers of exactly two elements, and so on).

This allows mathematical statements to be expressed as types, meaning that proving a theorem is equivalent to constructing an object of that type. In other words, the proof becomes a program whose type guarantees its correctness. This propositions as types, proofs as terms equivalence is known as the Curry-Howard correspondence, which establishes a direct correspondence between logic and type theory. In particular, what dependent types enable that non-dependent types cannot is first-order logic, which is needed to encode most meaningful theorems.

Example: Even Numbers

Consider the following elementary mathematical statement:

Every even natural number n can be written as 2 * k for some natural number k.

Informally, we would state it as:

For every n, if n is even, then there exists a k such that n = 2 * k.

In a proof assistant based on dependent types, this statement can be expressed as the following type:

∀ n : ℕ, is_even n → ∃ k : ℕ, n = 2 * k

Here:

  • ℕ denotes the natural numbers.
  • is_even n is the proposition that n is even.
  • ∃ k : ℕ, n = 2 * k represents the type of pairs consisting of
    a number k together with a proof that n = 2 * k.

Now comes the key point:

To prove this theorem is to construct an object of this type.

If n = 8, the proof is not just the statement “8 is 2 times 4.”
It is the explicit construction of:

  • the value k = 4, and
  • a proof object witnessing that 8 = 2 * 4.

If such a construction exists for every even n, the theorem is proven.
If it cannot be constructed, the theorem is false.

The proof assistant checks that the constructed object indeed has the required type, and if it does, correctness is guaranteed.

The real advantage is that high-level statements can be separated from mechanical proof details. LLMs can propose ideas, explore strategies, or complete routine steps, while the proof assistant verifies each inference step following the strict rules imposed by dependent types. This ensures that even AI-generated proofs are formally sound, dramatically reducing the barrier to large-scale formalization.

Software and verification

The same paradigm shift we have witnessed in the mathematical research domain is equally applicable in other fields, particularly in the domain of software development. It is possible to ensure the correctness of the systems in the aerospace, finance, and cryptography domains through the use of the software verification approach.

This method has the potential to speed up the development of high assurance software. It can assist in helping organizations avoid expensive failures and make software deployment easier. At Predictable Code, we are changing that. By combining LLMs with formal verification, our platform automatically generates the proofs that certify the correctness of the code we analyze. This dramatically lowers the barrier to entry, making high-assurance software accessible to a much wider audience.

Stay tuned to this blog for updates on our progress!

What we're building

Predictable Code gives every developer and AI assistant the same shared specifications so the code generated is consistent, verified, and always aligned with what your team intended.

Join the beta

Series

This article is part of our ongoing series on the hidden problems with AI code assistants in engineering teams.

Read the AI Code Pain Points →

More Articles

All articles

/ Curious to see our products in action? \

Let's have a chat about it

Predictable Code