<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://luisscoccola.github.io/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://luisscoccola.github.io/blog/" rel="alternate" type="text/html" /><updated>2026-02-10T21:35:35+00:00</updated><id>https://luisscoccola.github.io/blog/feed.xml</id><title type="html">Luis’ blog</title><entry><title type="html">Artificial Mathematical Intelligence in 2025</title><link href="https://luisscoccola.github.io/blog/artificial-mathematical-intelligence/" rel="alternate" type="text/html" title="Artificial Mathematical Intelligence in 2025" /><published>2025-12-01T00:00:00+00:00</published><updated>2025-12-01T00:00:00+00:00</updated><id>https://luisscoccola.github.io/blog/artificial-mathematical-intelligence</id><content type="html" xml:base="https://luisscoccola.github.io/blog/artificial-mathematical-intelligence/"><![CDATA[<p>Artificial Intelligence can be applied to many math-related tasks, including
formal and informal theorem proving,
formalization and informalization,
and math discovery.
In order to make long term progress, it is necessary to have a good understanding of each task, of their relationships, and of what is currently within reach.</p>

<p>I believe that math formalization will play a central role in Artificial Mathematical Intelligence.
If you are not familiar with formalization, you can check my previous post on <a href="/blog/formalization-of-math/">Why math should be formalized</a>.</p>

<p><strong>Acknowledgements.</strong>
I took the term “Artificial Mathematical Intelligence” from a <a href="https://emilyriehl.github.io/files/testing-ai.pdf">talk by Emily Riehl</a>, which I recommend.
I thank <a href="https://leni.sh/">Leni Aniva</a> and <a href="https://justinasher.me/">Justin Asher</a> for conversations about these topics.</p>

<p><br /></p>

<div style="width: fit-content;
  border: 2px solid #ccc;
  background-color: #f0f7ff;
  padding: 1rem 2em 0.3rem 1rem;
  border-radius: 5px;">
  
<p><strong>Contents</strong></p>
<ul>
  <li><a href="#what-is-artificial-mathematical-intelligence">What is Artificial Mathematical Intelligence</a></li>
  <li><a href="#the-semantic-gap">The semantic gap</a></li>
  <li><a href="#theorem-proving">Theorem Proving</a>
    <ul>
      <li><a href="#automated-formal-theorem-proving">Automated Formal Theorem Proving</a>
        <ul>
          <li><a href="#formal-methods-AFTP">Classical approaches and Formal Methods</a></li>
          <li><a href="#current-approaches-AFTP">Current approaches</a></li>
          <li><a href="#training-AFTP">Training data: math as a game, zero human knowledge, self-play</a></li>
          <li><a href="#LLMs-AFTP">Do we need language models?</a></li>
          <li><a href="#SOTA-AFTP">What can current agents prove?</a></li>
        </ul>
      </li>
      <li><a href="#automated-informal-theorem-proving">Automated Informal Theorem Proving</a></li>
    </ul>
  </li>
  <li><a href="#autoformalization">Autoformalization</a></li>
</ul>

</div>
<p><br /></p>

<h1 id="what-is-artificial-mathematical-intelligence">What is Artificial Mathematical Intelligence</h1>

<p>Mathematicians perform many tasks, such as coming up with new statements and theories, proving results, typing results and proofs in LaTex, and, more and more, formalizing statements and results in a proof assistant.
Any of these tasks can potentially be automated, and this automation is what I refer to as Artificial Mathematical Intelligence (AMI).
In this post, I will focus on the following three tasks, but I say a bit about other tasks below.</p>

<ul>
  <li>
    <p><strong>Informal Theorem Proving:</strong>
Given a mathematical statement (either formal or informal), provide an informal proof of it.</p>
  </li>
  <li>
    <p><strong>Formal Theorem Proving:</strong>
Given a mathematical statement formalized in a proof assistant, provide a formal proof which is accepted by the proof assistant.</p>
  </li>
  <li>
    <p><strong>Formalization:</strong>
Given a mathematical theory described in informal language, formalize this theory in a proof assistant in a way that is accepted by the proof assistant.
By <em>mathematical theory</em>, I mean any collection of definitions, result statements (ie the statement of a theorem, proposition, or lemma), and proofs.</p>
  </li>
</ul>

<p>When performed automatically using, for example, a combination of Machine Learning and Formal Methods, I’ll refer to these tasks as <em>Automatic Informal Theorem Proving</em>, <em>Automatic Formal Theorem Proving</em>, and <em>Autoformalization</em>, respectively.
There are important connections between these three tasks that are leveraged in practice, and I’ll discuss this below.</p>

<p style="text-align:center;">
</p>

<figure id="artificial-mathematical-intelligence-tasks" style="text-align:center;">
  <img src="/blog/assets/img/artificial-mathematical-intelligence-tasks.svg" alt="artificial-mathematical-intelligence-tasks" style="width:100%" />
  <figcaption>
    <p>The three Artificial Mathematical Intelligence tasks considered in this post, and some of the main relationships between them.</p>

  </figcaption>
</figure>

<p><strong>Other tasks.</strong>
There are many other important tasks.
These include specific tasks such as
solving exercises (similar to theorem proving, but might just involve a computation and not a proof),
performing calculations or simplifications (such as simplifying a complicated integral),
finding counterexamples or interesting examples,
as well as more complex tasks such as
mathematical discovery, that is,
coming up with new theories, conjectures, constructions, or proof strategies, formal or informal.
For more on this, see for example <a href="https://doi.org/10.1090/bull/1839">[Bengio, Malkin. Bull. AMS]</a>,
<a href="https://emilyriehl.github.io/files/testing-ai.pdf">[Riehl. Talk]</a>,
<a href="https://arxiv.org/abs/2412.15184">[Frieder et al.]</a>,
and <a href="https://arxiv.org/abs/2506.13131">[Novikov et al.]</a>.
Another important task is informalization: given a formalized mathematical theory, provide an informal version of it.
This task will become especially relevant with formalization at scale, since it will aid in understanding formalized proofs that were not produced by humans.</p>

<p>Before getting into more details, we need to discuss a fundamental problem that needs to be addressed when developing AMI.</p>

<h1 id="the-semantic-gap">The semantic gap</h1>

<p>A <strong>semantic gap</strong> is a disconnect between two semantic frameworks.
For instance, a semantic gap manifests whenever any two agents (human or AI) communicate in such a way that there exists the possibility that one agent is misrepresenting the intention of the other<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">1</a></sup>.
A down-to-earth example of a semantic gap is when your colleague in a different timezone misinterprets the time for your meeting.</p>

<p>The semantic gap affects two of the main mathematical tasks that I described earlier:
Autoformalization and Automated Informal Theorem Proving.
How the semantic gap affects Autoformalization is straightforward: the formalized output may or may not represent the intention of the agent (human or AI) that produced the informal input to the Autoformalizer.
For example the mathematical term “prime”
in the figure below might mean “prime integer” or “prime element” of some other ring:</p>

<figure style="text-align:center;">
  <img src="/blog/assets/img/autoformalization-semantic-gap.svg" alt="autoformalization-semantic-gap" style="width:100%" />
</figure>

<p>The semantic gap affects Automated Informal Theorem Proving in two ways:
one, the Automated Informal Theorem Prover could misinterpret the input; and two, the output of the prover could be misinterpreted by another agent.
This makes evaluating an Automated Informal Theorem Prover especially delicate.</p>

<figure style="text-align:center;">
  <img src="/blog/assets/img/informal-theorem-proving-semantic-gap.svg" alt="informal-theorem-proving-semantic-gap" style="width:100%" />
</figure>

<p>The semantic gap does not affect Automatic Formal Theorem Proving; and in a sense, this is exactly the point of formalization!
It is important to recognize this, since it can be leveraged in practice:
In Machine Learning terms, an agent can be trained to produce formal proofs using <em>verifiable rewards</em>, since each proof step can be objectively checked by the proof assistant.</p>

<figure style="text-align:center;">
  <img src="/blog/assets/img/artificial-mathematical-intelligence-no-semantic-gap.svg" alt="artificial-mathematical-intelligence-no-semantic-gap" style="width:100%" />
</figure>

<p>Unfortunately, we can’t only work with formal math (at least for now), so in many applications we need to mitigate the semantic gap.
I’ll discuss this more when describing each of the main tasks below.</p>

<h1 id="theorem-proving">Theorem Proving</h1>

<p>Let us start with Formal and Informal Theorem Proving, and, more generally, by being more specific about what the goal is.
There are at least two tasks that one can refer to theorem proving.</p>

<ul>
  <li>
    <p>In <strong>Novel Theorem Proving</strong> the goal is to provide a proof for a conjecture or for a new result that hasn’t been considered before.
Novel Theorem Proving can be seen as the holy grail of AMI, since it could involve providing proofs for long-standing mathematical conjectures.</p>
  </li>
  <li>
    <p>A simpler task is <strong>Known Theorem Proving</strong>, where the goal is to provide a proof for a result for which a proof strategy is known and believed to work.
Known Theorem Proving can be useful, for example, for understanding complicated or imprecise proofs, for filling in details, and for making sure that there are no gaps in an argument.</p>
  </li>
</ul>

<p>For a 2024 survey on ML methods for Theorem Proving, you can check <a href="https://arxiv.org/abs/2404.09939">[Li et al.]</a>.</p>

<h2 id="automated-formal-theorem-proving">Automated Formal Theorem Proving</h2>

<p><span id="formal-methods-AFTP">
<strong>Classical approaches and Formal Methods.</strong>
Classical approaches to AFTP rely on <em>Formal Methods</em>, a set of techniques and tools used to mathematically specify, design, and verify complex systems (typically software).
For example, modern <strong>proof assistants</strong> allow for specification via formal mathematical definitions, design via programs, and automated machine-checked verification of formal proofs.
Before the current wave of AI integration, automation was based on <em>search</em> achieving dramatic efficiency gains through key algorithmic breakthroughs:
</span></p>

<ul>
  <li>The <em>Resolution Principle</em> and the <em>Unification algorithm</em><sup><a href="https://dl.acm.org/doi/10.1145/321250.321253">[Robinson. JACM]</a></sup>, which reduce complex logical inference to a single, efficient rule of refutation.</li>
  <li><em>Conflict-Driven Clause Learning</em><sup><a href="https://dl.acm.org/doi/10.1145/378239.379017">[Moskewicz et al. DAC]</a></sup>, a SAT solving method that prunes vast regions of the search space.</li>
  <li>The <em>Superposition Calculus</em><sup><a href="https://doi.org/10.1093/logcom/4.3.217">[Bachmair, Ganzinger. J. Log. Comput.]</a></sup>, a powerful framework for equational reasoning.</li>
</ul>

<p>These techniques are integrated into specialized tools such as <em>Satisfiability Modulo Theory</em> solvers (<strong>SMT solvers</strong>), which represent the state-of-the-art of search-based formal deduction.
On top of these, <em>hammers</em> act as a translator between these automated tools and proof assistants.
Hammers are examples of <strong>tactics</strong>, which are proof assistant functions that a user can call to automate part of the formalization process.
For more about the subject, you can check, for instance,
the textbook <a href="https://dl.acm.org/doi/10.5555/1391237">[Kroening, Strichman. TTCS]</a> on formal reasoning, and the papers <a href="https://dl.acm.org/doi/10.1145/3573105.3575671">[Limperg, From. CPP]</a> and <a href="https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ITP.2025.14">[Norman, Avigad. ITP]</a> on a SOTA search-based tactics for AFTP in Type Theory.</p>

<p><span id="current-approaches-AFTP">
<strong>Current approaches.</strong>
Recently, significant progress has been made
in AFTP using Machine Learning.
While specific implementations are often complicated in the details, they usually rely on some of the following techniques:
</span></p>

<ul>
  <li>
    <p><strong>Agents based on Large Language Models</strong> (LLMs)<strong>.</strong>
This approach builds an AI agent consisting of an LLM that interacts with a proof assistant essentially like a human does, by directly producing code and using the proof assistant as a tool (eg, using <a href="https://github.com/oOo0oOo/lean-lsp-mcp">[Dressler. Git]</a>).
By treating formalization as a coding task, one can reuse infrastructure developed for AI coding agents.
There are at this point many implementations that use this approach.
For example <a href="https://arxiv.org/abs/2508.03613">[Goedel-Prover-V2]</a> fine-tunes a Qwen3 model,
while <a href="https://arxiv.org/abs/2507.15225">[Delta Prover]</a> is based on an agentic framework around an off-the-shelf LLM with no further training.</p>
  </li>
  <li>
    <p><strong>LLMs for informal reasoning.</strong>
Here, the informal reasoning capabilities of LLMs are leveraged in several ways, including
first producing an informal proof and then attempting to formalize it<sup><a href="https://iclr.cc/virtual/2023/poster/11536">[Jiang et al. ICLR]</a></sup>, generating possible useful lemmas and intermediate steps, guiding a formal theorem prover<sup><a href="https://arxiv.org/abs/2507.23726">[Seed-Prover]</a><a href="https://arxiv.org/abs/2510.01346v2">[Harmonic Team]</a><a href="https://arxiv.org/abs/2509.22819">[Varambally et al.]</a></sup>, or interleaving formal and informal reasoning<sup><a href="https://arxiv.org/abs/2504.11354">[Kimina-Prover Preview]</a></sup>.</p>
  </li>
</ul>

<figure style="text-align:center;" id="aristotle-pipeline">
  <img src="/blog/assets/img/aristotle-pipeline.png" alt="aristotle-pipeline" style="display:block; margin:0 auto; max-width:60%; height:auto;" />
  <figcaption>
    <p>Figure from <a href="https://arxiv.org/abs/2510.01346v2">[Harmonic Team]</a>.
    A high-level illustration of the approach to AFTP implemented in the Aristotle agent.
    Notice in particular that it leverages AITP to generate possibly useful lemmas.</p>


  </figcaption>
</figure>

<ul>
  <li>
    <p><strong>Reinforcement Learning</strong> (RL)<strong>.</strong>
This approach interprets theorem proving as an iterated decision problem, and uses techniques from RL to train or fine-tune an agent that, at each step, proposes a set of candidate tactics to try next, and tries to predict the expected return from applying these tactics.
For more details on this point of view, you can check AlphaProof’s paper <a href="https://www.nature.com/articles/s41586-025-09833-y">[Hubert et al. Nature]</a> and <a href="https://arxiv.org/abs/2504.11354">[Kimina-Prover Preview]</a>.</p>
  </li>
  <li>
    <p><strong>Monte Carlo Tree Search</strong> (MCTS)<strong>.</strong>
This is a stochastic search algorithm that incrementally builds and explores a search tree using randomized simulations to estimate promising paths, and it is key in the success of ML models for games such as chess and Go.
The use of MCTS for theorem proving was proposed in <a href="https://link.springer.com/chapter/10.1007/978-3-319-63046-5_34">[Färber et al. CADE]</a>, and SOTA approaches use MCTS with various modifications; see, eg, <a href="https://openreview.net/forum?id=I4YAIwrsXa">[DeepSeek-Prover-V1.5. ICLR]</a> and <a href="https://arxiv.org/abs/2510.01346v2">[Harmonic Team]</a>.
It is important to recognize that search in the context of theorem proving has several subtleties, such as <em>metavariable coupling</em>; you can read more about this in <a href="https://doi.org/10.1007/978-3-031-90643-5_6">[Aniva et al. TACAS]</a>.</p>
  </li>
  <li>
    <p><strong>Test Time Training.</strong>
This is also described in <a href="https://www.nature.com/articles/s41586-025-09833-y">[Hubert et al. Nature]</a>, and the idea is roughly the following: given a target statement, produce a set of variations and fine-tune the model using RL on those variations.
The fine-tuned model is then used to attempt to prove the original statement.</p>
  </li>
  <li>
    <p><strong>Domain-specific solvers.</strong>
The typical examples are geometry solvers such as AlphaGeometry<sup><a href="https://www.nature.com/articles/s41586-023-06747-5">[Trinh et al. Nature]</a></sup>, which is a specialized theorem prover for Euclidean plane geometry.</p>
  </li>
</ul>

<p>In all of the approaches above, Formal Methods are incorporated quite indirectly, by allowing the model to invoke proof assistant tactics that implement the methods outlined earlier, such as Lean’s SMT solver tactic <code class="language-plaintext highlighter-rouge">smt</code>.</p>

<p><span id="training-AFTP">
<strong>Training data: math as a game, zero human knowledge, self-play.</strong>
A big difficulty when training AFTP models is gathering enough good quality data, and this might be the main current bottleneck.
Formal math libraries such as 
Lean’s <a href="https://github.com/leanprover-community/mathlib4">mathlib</a>, while extremely impressive and useful,
are orders of magnitude smaller than what a large scale model needs (at least with the current models and training techniques).
Another issue is data contamination: approaches relying on LLMs are often tested on data the LLM was (potentially) trained on, which can make evaluation difficult.
</span></p>

<p>In practice, datasets are produced in large part using Autoformalization (hence the arrow from Autoformalization to AFTP in the <a href="#artificial-mathematical-intelligence-tasks">figure</a> at the beginning of the post).
This comes with several issues: for one, Autoformalization is imperfect, but also it is not known if algorithms trained exclusively on human data will generalize.
It is also unclear if human knowledge is useful for Formal Theorem Proving, or if there exist learning algorithms that can find better, more efficient proofs without human knowledge.
This would be similar to how algorithms such as AlphaZero are able to learn how to play board games at a superhuman level without any human input.</p>

<p>Still in the context of board games,
it is also interesting to recall that
lack of data was overcome using self-play<sup><a href="https://ieeexplore.ieee.org/document/5392560">[Samuel. IBM J. Res. Dev.]</a></sup>: such games are symmetric, so a single model can be trained by playing against itself.
Unfortunately, theorem proving has no such simple symmetry: coming up with a mathematical statement seems, a priori, like a very different task from proving a statement.
Nevertheless, it is plausible that a useful analogue of self-play for theorem proving exists, and this could have a big impact.
Self-play in the context of AMI is explored in <a href="https://arxiv.org/pdf/2502.00212v4">[Dong, Ma]</a>.
It is also possible that true superhuman AFTP agents can only be trained at the same time as superhuman math discovery agents.</p>

<p><span id="LLMs-AFTP">
<strong>Do we need language models and informal reasoning?</strong>
The usage of LLMs for informal reasoning works well in practice for simple proofs 
(hence the arrow from AITP to AFTP in the <a href="#artificial-mathematical-intelligence-tasks">figure</a>)
but it is not clear that such approaches will scale to truly difficult proofs.
Going back to the comparison between math and games,
note that it is actually not straightforward to fine-tune a SOTA LLM to play chess or Go to the same level as, say, AlphaZero<sup><a href="https://proceedings.mlr.press/v267/schultz25a.html">[Schultz et al. ICML]</a><a href="https://neurips.cc/virtual/2025/loc/san-diego/poster/117166">[Ma et al. NeurIPS]</a></sup>.
One could read this as saying that those games are fundamentally not about language, so an LLM may not be the best tool for the job.
The same could be true for math, which I would guess is also not fundamentally about language.
Personally, I think that at a certain point informal reasoning will become a bottleneck when it comes to AFTP, but it is not clear at what point this will happen, and it is likely that a lot of progress can be made with LLMs.
</span></p>

<p><span id="SOTA-AFTP">
<strong>What can current agents prove?</strong>
So far, and to the best of my knowledge,
AFTP agents have performed well in limited contexts, such as olympiad-type problems.
Their performance in this context is impressive:
for example, Aristotle<sup><a href="https://arxiv.org/abs/2510.01346v2">[Harmonic Team]</a></sup>
achieved a gold-medal-equivalent performance on the 2025 International Mathematical Olympiad
by providing correct <em>formal</em> solutions to five out of six problems.
For an up-to-date comparison of different models, you can check <a href="https://trishullab.github.io/PutnamBench/leaderboard.html">[PutnamBench Leaderboard]</a>, which includes the performance of SOTA models on an olympiad-type dataset.
As an example of Novel Theorem Proving, Aristotle <a href="https://www.erdosproblems.com/forum/thread/124#post-1892">provided a proof</a> for an “easy version” of a conjecture by Erdős, although this is still regarded as “olympiad-style” math.
To the best of my knowledge, we have not yet reached the point when an AI agent proves or disproves a long-standing mathematical conjecture.
</span></p>

<h2 id="automated-informal-theorem-proving">Automated Informal Theorem Proving</h2>

<p>State-of-the-art Automated Informal Theorem Provers are based on LLMs.
Most commonly, the starting point is a general purpose LLM that has been trained on large portions of the internet.
The LLM is then fine-tuned on informal mathematical corpora such as text books, mathematical articles, and specialized datasets.
The main technique that enables these models to solve mathematical problems, and to reason more generally, is <strong>chain-of-thought</strong> (CoT)<sup><a href="https://proceedings.neurips.cc/paper/2022/hash/9d5609613524ecf4f15af0f7b31abca4-Abstract-Conference.html">[Wei et al. NeurIPS]</a></sup>, where the model is trained to generate intermediate steps before a final answer.
CoT can be used for self-reflection, self-verification, and correction.</p>

<p>Examples of agents that rely on CoT to solve mathematical problems and provide mathematical proofs include <a href="https://arxiv.org/abs/2511.22570v1">[DeepSeekMath-V2]</a>, and many of the general purpose models such as ChatGPT, Gemini, and Claude.
The <a href="https://epoch.ai/frontiermath">FrontierMath benchmark project</a> keeps track of the performance of many of these models on a series of math problems.
Some care has to be taken when interpreting these results: first, only final answers to problems are evaluated, so this may not reflect the performance of the models when producing proofs; second, to avoid data contamination, the problems are not public, so we don’t exactly know what is being evaluated.
The potential issues of evaluating models solely based on a final answer are considered in <a href="https://openreview.net/forum?id=3v650rMO5U">[Petrov et al. ICML AI4MATH workshop]</a>.</p>

<figure style="text-align:center;" id="deepseek-rl-response-length">
  <img src="/blog/assets/img/deepseek-rl-response-length.png" alt="deepseek-rl-response-length" style="display:block; margin:0 auto; max-width:70%; height:auto;" />
  <figcaption>
    <p>Figure from <a href="https://arxiv.org/abs/2501.12948">[DeepSeek-AI]</a>, where caption reads as follows <em>The average response length of DeepSeek-R1-Zero on the training set during the RL process. DeepSeek-R1-Zero naturally learns to solve reasoning tasks with more thinking time</em>.
    The paper demonstrates that emergent CoT-like behavior can arise in RL-trained reasoning agents, where more complex tasks require longer reasoning traces.</p>

  </figcaption>
</figure>

<p>AITP can be useful for guiding AFTP, informalization, and explanation of known proofs,
and it <a href="#LLMs-AFTP">may or may not be the case</a> that AITP is in necessary for AFTP.
Regardless of this, I believe that AITP by itself cannot scale to Novel Theorem Proving, due to the <a href="#the-semantic-gap">semantic gap</a> and the
<em>human-AI asymmetry of informal math</em>, that is, the fact that both a human and an AI can produce informal math, but only a human expert can verify it (which I observe in <a href="/blog/formalization-of-math/">Why math should be formalized</a>).
This asymmetry puts a hard limit on how much AITP-produced math can reliably be verified.</p>

<h1 id="autoformalization">Autoformalization</h1>

<p>There are lots of proposed approaches to Autoformalization (for early references, see, eg, <a href="https://dl.acm.org/doi/abs/10.1145/3372885.3373827">[Wang et al. CPP]</a><a href="https://proceedings.neurips.cc/paper_files/paper/2022/hash/d0c6bc641a56bebee9d985b937307367-Abstract-Conference.html">[Wu et al. NeurIPS]</a><a href="https://link.springer.com/chapter/10.1007/978-3-030-53518-6_1">[Szegedy. CICM]</a>).
I will not say too much about this since, in my experience, this problem is significantly easier to address than AFTP and AITP.</p>

<p>I find that current SOTA LLMs are actually pretty decent at Autoformalization, if including the right references in the context, and if incorporated into an agent that can use the proof assistant’s output as feedback to iteratively fix the formalization until it compiles.
Two other techniques that can make a significant difference are using informal math-guided AFTPs for formalizing proofs, like for example Aristotle<sup><a href="https://arxiv.org/abs/2510.01346v2">[Harmonic Team]</a></sup> (hence the arrow from AFTP to Autoformalization in the <a href="#artificial-mathematical-intelligence-tasks">figure</a>),
and using <em>blueprints</em><sup><a href="https://github.com/PatrickMassot/leanblueprint">[Lean blueprints]</a></sup>, that is, first organizing the mathematical theory into definitions and statements with dependencies, and then formalizing these one by one.</p>

<p>The main thing one needs to watch out for is the <a href="#the-semantic-gap">semantic gap</a>, which can be addressed to a reasonable extent by using an LLM-as-a-judge<sup><a href="https://proceedings.neurips.cc/paper_files/paper/2023/hash/91f18a1287b398d378ef22505bf41832-Abstract-Datasets_and_Benchmarks.html">[Zheng et al. NeurIPS]</a></sup>, in this case by adding one or more agents to the pipeline whose job is to identify and point out to the formalizer potential semantic gaps.
In order to use these ideas to reach a satisfactory pipeline, one or more mathematicians need to be consulted, since, as I mentioned <a href="#limitations-AITP">previously</a>, only a mathematician (in fact, an expert in the field) can function as a reliable safeguard against the semantic gap.</p>

<p>I believe that, in the short term, more and more math will be formalized using technologies that we already have.
Large scale formalized libraries will most likely enable the training of AI agents that can really make progress in Formal Novel Theorem Proving.</p>

<hr />
<p><br /></p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:2" role="doc-endnote">
      <p>In the context of AMI with black-box models, I have also seen this concept referred to as the <em>intention problem</em><sup><a href="https://leni.sh/post/250720-research-matp/">[Aniva. Blogpost]</a></sup>. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><summary type="html"><![CDATA[Artificial Intelligence can be applied to many math-related tasks, including formal and informal theorem proving, formalization and informalization, and math discovery. In order to make long term progress, it is necessary to have a good understanding of each task, of their relationships, and of what is currently within reach.]]></summary></entry><entry><title type="html">Why math should be formalized - and resources to get started</title><link href="https://luisscoccola.github.io/blog/formalization-of-math/" rel="alternate" type="text/html" title="Why math should be formalized - and resources to get started" /><published>2025-09-28T00:00:00+00:00</published><updated>2025-09-28T00:00:00+00:00</updated><id>https://luisscoccola.github.io/blog/formalization-of-math</id><content type="html" xml:base="https://luisscoccola.github.io/blog/formalization-of-math/"><![CDATA[<p>Proof assistants enable us to <em>formalize mathematics</em>: to express arbitrary mathematical statements and proofs without ambiguity, and to automatically verify their correctness.
Here I give some arguments for why math formalization might soon become inevitable.
I also include some resources on formalization for the interested reader.</p>

<p>In <a href="/blog/artificial-mathematical-intelligence/">a future post</a> I cover how Artificial Intelligence will help us in scaling up math formalization (but here I do cover how it will probably force us to).</p>

<p><br /></p>

<div style="width: fit-content;
  border: 2px solid #ccc;
  background-color: #f0f7ff;
  padding: 1rem 2em 0.3rem 1rem;
  border-radius: 5px;">
  
<p><strong>Contents</strong></p>
<ul>
  <li><a href="#tldr">TL;DR</a></li>
  <li><a href="#too-much-human-made-math">Too much human-made math</a></li>
  <li><a href="#too-much-ai-generated-math">Too much AI-generated math</a></li>
  <li><a href="#will-formalization-be-enough">Will formalization be enough?</a></li>
  <li><a href="#resources-to-get-started">Resources to get started</a></li>
</ul>

</div>
<p><br /></p>

<style>

blockquote {
  border-left: 4px solid #4a90e2;
  padding: 1em;
  margin: 1.5em 0;
  background: #f7faff;
  font-style: italic;
  color: #000 !important;
  font-size: inherit !important;   /* same size as body */
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: normal;
}

blockquote p {
  margin: 0;
  color: #000 !important;
  font-size: inherit !important;   /* same size as body */
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: normal;
}

</style>

<h1 id="tldr">TL;DR</h1>

<p>I believe that most of the new, main mathematical claims in the nearby future will have to be formalized.
I make three main arguments, which, in my opinion, go in increasing level of strength:</p>
<ol>
  <li>There already exists a lot of math (perhaps too much).</li>
  <li>Humans make mistakes.</li>
  <li>There will soon be an explosion of AI-generated math.</li>
</ol>

<h1 id="too-much-human-made-math">Too much human-made math</h1>

<figure style="text-align:center;">
  <img src="/blog/assets/img/arxiv-data-map.png" style="display:block; margin:0 auto; max-width:100%; height:auto; border: 2px solid black;" />
  <figcaption>
    <p>A portion of the awesome <a href="https://lmcinnes.github.io/datamapplot_examples/arXiv/">arXiv Data Map</a> interactive visualization.</p>

  </figcaption>
</figure>

<p>The first claim is simple: there already exists a lot of math.
There already are instances (and there will be many more) in which a single person cannot verify the validity of a statement, since it depends on more results than what they can possibly verify.
The typical example is the classification of finite simple groups, which, although believed to be correct,
spans over 10,000 pages, scattered across hundreds of papers by many authors,
and uses many deep sub-theories, which no single human masters.
Moreover, some parts are only really understood by a few experts, which is a somewhat fragile situation.
For more about the story of classification of finite simple groups, and how things piece together, you can check <a href="https://www.ams.org/notices/200407/fea-aschbacher.pdf">[Aschbacher. Notices AMS]</a> and <a href="https://www.ams.org/journals/bull/2001-38-03/S0273-0979-01-00909-0/S0273-0979-01-00909-0.pdf">[Solomon. Bulletin AMS]</a>.
But at the end of the day, each piece has been peer-reviewed by experts, and gaps that have been found have been corrected.</p>

<figure style="text-align:center;">
  <img src="/blog/assets/img/arxiv-submissions-per-year.png" style="display:block; margin:0 auto; max-width:50%; height:auto;" />
  <figcaption>
    <p>Number of math papers posted on arXiv per year (1993-2021). Image from <a href="https://info.arxiv.org/help/stats/2021_by_area/index.html">arXiv submission rate statistics</a>.</p>

  </figcaption>
</figure>

<p>Gaps… This takes us to the second point.
When doing informal mathematics,
humans can make mistakes that are very hard to spot.
Indeed, there are many past and current instances of important mathematical claims whose validity was or is contested by experts.
I will mention some well-known instances, but I want to emphasize that <ins>the point here is not about who’s wrong or right, but rather about the fact that, even though mathematics deals with absolute truths<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>, in practice experts can disagree about the validity of important mathematical claims</ins>.</p>

<p><strong>The abc conjecture.</strong>
This is a conjecture in number theory from the 1980’s and the name comes from the fact that it involves three positive, relatively prime integers $a$, $b$, and $c$ satisfying $a+b = c$.
The mathematical statement is not super technical, but it does not matter for this discussion.
A positive answer to the conjecture implies a positive answer to several other conjectures in mathematics<sup><a href="https://link.springer.com/chapter/10.1007/978-3-0348-0859-0_13">[Waldschmidt]</a></sup>, making the problem important.
Since it was originally stated, there have been several claimed proofs of the conjecture that have not been accepted by the mainstream math community.
The most well-known instance is the one in the $\sim 600$ page series of papers <a href="https://ems.press/journals/prims/issues/1507">[Mochizuki. PRIMS]</a>,
whose validity has been the object of much debate, in particular 
by experts in the area who have published explanations for why they believe that the proof is incorrect<sup><a href="https://www.math.uni-bonn.de/people/scholze/WhyABCisStillaConjecture.pdf">[Scholze, Stix]</a><a href="https://zbmath.org/1465.14002">[Scholze]</a></sup>.</p>

<p><strong>An example from Machine Learning.</strong>
The Adam optimizer<sup><a href="https://arxiv.org/abs/1412.6980">[Kingma, Ba. ICLR]</a></sup> is a staple of modern Machine Learning, being the go-to optimizer for lots of standard architectures.
In the paper that introduces it, it was shown that the method converges when optimizing a convex function.
It was shown a few years later<sup><a href="https://openreview.net/forum?id=ryQu7f-RZ">[Reddi et al. ICLR]</a></sup> that the original proof had a gap, and that convex functions exist for which Adam does not converge
(although that did not stop anyone from using Adam).</p>

<p><strong>A version of the homotopy hypothesis.</strong>
This one’s a bit more abstract.
It concerns a result, claimed in <a href="https://eudml.org/doc/91469">[Kapranov, Voevodsky. Cah. Topol. Géom. Différ. Catég.]</a>, published in 1991, which (very) roughly says that every space can be constructed using a special kind of recipe.
In 1998, <a href="https://arxiv.org/abs/math/9810059">[Simpson]</a> was made public, which contained a counterexample to the above claim.
Voevodsky, one of authors of the first article (and a Fields medalist), writes in
<a href="https://www.ias.edu/ideas/2014/voevodsky-origins">[Voevodsky. Institute Letter]</a>:</p>
<blockquote>
  <p>Kapranov and I had considered a similar critique ourselves and had convinced each other that it did not apply. I was sure that we were right until the fall of 2013 (!!).</p>
</blockquote>

<p>The letter is about how
Voevodsky became interested in the foundations of mathematics and proof assistants, and I can’t recommend Voevodsky’s letter enough.
It contains other interesting stories about incorrect claims such as the following (which concerns a different mistake):</p>

<blockquote>
  <p>This story got me scared. Starting from 1993, multiple groups of mathematicians studied my paper at seminars and used it in their work and none of them noticed the mistake. And it clearly was not an accident. A technical argument by a trusted author, which is hard to check and looks similar to arguments known to be correct, is hardly ever checked in detail.</p>
</blockquote>

<p>Voevodsky went on to develop <em>Univalent Foundations</em>, an approach to the foundations of mathematics based on Type Theory and Homotopy Theory, which I hope to cover in another post.</p>

<p><strong>Other examples.</strong>
There exist more examples of incorrect or contradictory claims in the literature;
Kevin Buzzard’s article
<a href="https://xenaproject.wordpress.com/2021/01/21/formalising-mathematics-an-introduction/">Formalising mathematics: an introduction</a>
mentions an instance of two published papers that contain contradicting results, with both papers being published in the Annals of Mathematics, possibly the most well-reputed mathematical journal!
The following related Math Overflow threads contain some examples as well:</p>
<ul>
  <li><a href="https://mathoverflow.net/q/35468/39910">Widely accepted mathematical results that were later shown to be wrong?</a></li>
  <li><a href="https://mathoverflow.net/questions/357317/results-that-are-widely-accepted-but-no-proof-has-appeared">Results that are widely accepted but no proof has appeared</a></li>
  <li><a href="https://mathoverflow.net/q/338607/39910">Why doesn’t mathematics collapse even though humans quite often make mistakes in their proofs?</a></li>
</ul>

<p>The top answer in the last thread, by Shulman, makes a good point:</p>
<blockquote>
  <p>I think another reason that mathematics doesn’t collapse is that the fundamental content of mathematics is <em>ideas</em> and <em>understanding</em>, not only proofs. […] usually when a human mathematician proves a theorem, they do it by achieving some new understanding or idea, and usually that idea is “correct” even if the first proof given involving it is not.</p>
</blockquote>

<p>Tao makes similar points in the blogpost <a href="https://terrytao.wordpress.com/career-advice/theres-more-to-mathematics-than-rigour-and-proofs/">There’s more to mathematics than rigour and proofs</a>.
However, the part that I left out from Shulman’s comment reads as follows:</p>
<blockquote>
  <p>If mathematics were done by computers that mindlessly searched for theorems and proof but sometimes made mistakes in their proofs, then I expect that it would collapse.</p>
</blockquote>

<p>And this takes me to the third point.</p>

<h1 id="too-much-ai-generated-math">Too much AI-generated math</h1>

<p>Because of generative Artificial Intelligence, it will soon be possible to produce a huge amount of plausibly-looking mathematical claims and proofs; far more than what humans can verify.
Will the <a href="https://arxiv.org/">arXiv</a> get flooded with AI-generated math-looking content?
Will math journals be flooded with AI-generated submissions?
I think that this is entirely possible,
which is a problem due to the <em>human-AI asymmetry of informal math</em>:</p>
<p style="text-align: center;"><ins>
Both a human and an AI can produce informal math, but only a human expert can verify it.
</ins></p>
<p>And I do not expect this to change easily.</p>

<p>If one cannot verify the math itself, one could try to filter submissions by, say, the authors’ or institutions’ trustworthiness, or by using AI as a preliminary judge, but these approaches would likely be deeply unfair and so imperfect as to not really address the problem.
Ethical questions of this kind are considered in Emily Riehl’s
<span id="emily-talk">
talk
</span>
<a href="https://emilyriehl.github.io/files/testing-ai.pdf">Testing Artificial Mathematical Intelligence</a><sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup>, which I highly recommend.</p>

<p>It is not clear if there are good solutions.
What is clear is that formal mathematics does not have this problem, since it can be checked automatically by a deterministic program.</p>

<h1 id="will-formalization-be-enough">Will formalization be enough?</h1>

<p>Suppose that we do get the mainstream mathematical community to back up any important claims with a formalized proof.
Will this overcome the issues presented so far?
It seems to me that the points concerning errors or gaps (human or AI) will be addressed, but I see at least two remaining hard problems.</p>

<p>One is that a human expert would still have to be involved in <em>interpreting</em> the results that have been formally proven.
A formal proof could look as if it is proving a breakthrough result, but after unfolding the definitions it may become apparent that what is proven is actually something much weaker.
Relatedly, the talk by Emily Riehl that I referenced <a href="#emily-talk">above</a> proposes the following bar by which to judge AI-generated mathematics, which highlights the fact that human experts are still needed even for formalized results:</p>
<blockquote>
  <p>Any artificially generated mathematical text will not be considered as a proof unless:</p>
  <ul>
    <li>It has been communicated in both a natural language text paired with a computer formalization of all definitions, theorems, and proofs.</li>
    <li>The formalization has been accepted by the proof assistant and human expert referees have vetted both the formalization and the paired text.</li>
  </ul>
</blockquote>

<p>The second problem is that we could still end up in a situation in which we are flooded by correct, formalized claims, and where it is not clear how to sort through all of these claims.
In this case, there will have to be a radical reorganization of how the mathematical community produces and publishes math.
This quickly leads us to the broader question of how the advancement of AI will force us to reconsider how lots of aspects of society work, an important example being education.
There’s a lot of work to be done here, and it is outside the scope of this post.
I just want to acknowledge the fact that the solutions we arrive at concerning a flood of AI-generated content will most likely go well beyond math.</p>

<h1 id="resources-to-get-started">Resources to get started</h1>

<p>Here are some resources in case you are interested in math formalization.
I’ll try to keep this concise, and I will not mention AI-related options for now: there are enough basics to learn as it is.</p>

<p>The first step is to choose a proof assistant, and there are many choices here.
In fact, the real first step is to choose a foundation for mathematics!
Many of the modern proof assistants are based on Dependent Type Theory (more specifically, the <a href="https://rocq-prover.org/doc/V8.11.1/refman/language/cic.html">Calculus of Inductive Constructions</a>), but not all of them.</p>

<p>At the moment, the <em>de facto</em> default choice of proof assistant to do math formalization is <a href="https://lean-lang.org/">Lean 4</a>, which is based on Dependent Type Theory;
but if you want to learn about other choices, a good starting point is the series of talks <a href="https://math.andrej.com/category/every-proof-assistant/">Every proof assistant</a> and a <a href="https://youtu.be/7oBkEbKJvnE?si=grCBEH3MNiouUESG">recent talk by Jon Sterling</a> on developing modern proof assistants.
I say “<em>de facto</em> default choice” because Lean seems to have the largest active community, especially when it comes to classically trained mathematicians who want to prove standard math results and don’t necessarily care about experimenting with different foundations or logical frameworks.
Because of this, I will focus on Lean 4, but know that a lot transfers to other proof assistants based on Dependent Type Theory such as <a href="https://agda.readthedocs.io/en/latest/index.html">Agda</a> or <a href="https://rocq-prover.org/">Rocq</a>.</p>

<figure style="text-align:center;">
  <img src="/blog/assets/img/lean-euclid-thm.png" style="display:block; margin:0 auto; max-width:80%; height:auto; border: 2px solid black;" />
  <figcaption>
    <p>Lean 4 proof of Euclid’s theorem on the infinitude of primes, in <a href="https://github.com/leanprover-community/mathlib4/blob/41c8cd5fe18250b622395f10bf74193f72b6863c/Mathlib/Data/Nat/Prime/Infinite.lean#L27-L38">Mathlib/Data/Nat/Prime/Infinite.lean</a>.</p>

  </figcaption>
</figure>

<p>In terms of tutorials, there are two excellent free online books: <a href="https://leanprover-community.github.io/mathematics_in_lean/index.html">Mathematics in Lean</a> and <a href="https://leanprover.github.io/theorem_proving_in_lean4/">Theorem Proving in Lean 4</a>.
If you are wondering which one to start with, here’s an excerpt from the former one (clarification mine):</p>
<blockquote>
  <p><em>Theorem Proving in Lean</em> is for people who prefer to read a user manual cover to cover before using a new dishwasher. If you are the kind of person who prefers to hit the <em>start</em> button and figure out how to activate the potscrubber feature later, it makes more sense to start here [Mathematics in Lean] and refer back to <em>Theorem Proving in Lean</em> as necessary.</p>
</blockquote>

<p>There’s also <a href="https://adam.math.hhu.de/#/g/leanprover-community/nng4">The Natural Number Game</a>, which is a game-like introduction to mathematical proofs in Lean.
If you want to follow a course, I strongly recommend Stanford’s <a href="https://perfect-math-class.leni.sh/">CS 99: Functional Programming and Theorem Proving in Lean 4</a>, but keep in mind that formalization of mathematics is not the only focus of the course.</p>

<p>Lean 4 has an impressive mathematical library, the <a href="https://github.com/leanprover-community/mathlib4?tab=readme-ov-file">mathlib</a> library, which includes a lot of fundamental and advanced mathematics.
There exist search tools such as
<a href="https://huggingface.co/spaces/delta-lab-ai/Lean-Finder">Lean finder</a> and
<a href="https://leansearch.net/">LeanSearch</a>
that allow for natural language, semantic search in the library, which can be extremely useful.</p>

<p>Other great resources include
the <a href="https://lean-lang.org/doc/reference/latest/">Lean reference manual</a>,
a <a href="https://lean-lang.org/learn/">list of resources</a> in the official Lean website,
the <a href="https://leanprover-community.github.io/index.html">Lean Community website</a>,
and
the <a href="https://leanprover-community.github.io/blog/">Official Lean blog</a>.</p>

<p>Finally, in terms of getting help, there’s the highly active <a href="https://leanprover.zulipchat.com/">Lean Zulip channel</a>, and keep in mind that Lean is a programming language, so tools like coding agents and general purpose LLMs can help with debugging, can provide examples, and can aid in digesting concepts.</p>

<hr />
<p><br /></p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>But note that math as a human discipline deals with much more than mathematical statements. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2" role="doc-endnote">
      <p>The recording is on <a href="https://www.youtube.com/live/svF-1ekPqjM?si=YhaL2iYW0pjWMo0c">YouTube</a>. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><summary type="html"><![CDATA[Proof assistants enable us to formalize mathematics: to express arbitrary mathematical statements and proofs without ambiguity, and to automatically verify their correctness. Here I give some arguments for why math formalization might soon become inevitable. I also include some resources on formalization for the interested reader.]]></summary></entry><entry><title type="html">Cover Learning for Topological Inference</title><link href="https://luisscoccola.github.io/blog/cover-learning/" rel="alternate" type="text/html" title="Cover Learning for Topological Inference" /><published>2025-04-01T00:00:00+00:00</published><updated>2025-04-01T00:00:00+00:00</updated><id>https://luisscoccola.github.io/blog/cover-learning</id><content type="html" xml:base="https://luisscoccola.github.io/blog/cover-learning/"><![CDATA[<p>The standard approach to Topological Inference is based on geometric complexes.
Most commonly, geometric complexes scale cubically (and often worse) in the number of data points, which poses a big problem.
Here I describe an alternative approach to Topological Inference.</p>

<p>For motivation and an intro to simplicial complexes, you can check
my previous post on 
<a href="/blog/topological-inference/">Topological Inference and Unsupervised Learning</a>.
The approach described in this post appears in our recent paper <a href="https://proceedings.mlr.press/v267/scoccola25a.html">[Scoccola et al. ICML]</a>;
for more details and references, it’s best to check there.</p>

<p><br /></p>

<div style="width: fit-content;
  border: 2px solid #ccc;
  background-color: #f0f7ff;
  padding: 1rem 2em 0.3rem 1rem;
  border-radius: 5px;">
  
<p><strong>Contents</strong></p>
<ul>
  <li><a href="#geometric-complexes">Geometric Complexes</a></li>
  <li><a href="#covers-and-nerve">Covers and Nerve</a></li>
  <li><a href="#cover-learning">Cover Learning</a></li>
</ul>

</div>
<p><br /></p>

<h1 id="geometric-complexes">Geometric Complexes</h1>

<p>Standard examples of geometric complexes include the Rips complex, the Čech complex, and the Alpha complex.
All of these are filtered (or weighted) simplicial complexes defined given an input metric space (assumed to be a subset of $\mathbb{R}^n$ in the latter two).</p>

<p><strong>Why geometric complexes?</strong>
Two main results make them particularly appealing from a theoretical point of view.
First, the geometric complexes of metric spaces that are similar (in the Gromov-Hausdorff sense) are necessarily similar<sup><a href="https://link.springer.com/article/10.1007/s10711-013-9937-z">[Chazal et al. Geom. Dedicata]</a></sup>.
Second, the geometric complex of a sufficiently well-behaved metric space (such as a compact manifold) encodes the topology of the space itself<sup><a href="https://www.degruyterbrill.com/document/doi/10.1515/9781400882588-013/html">[Hausmann. Prospects in Topology]</a></sup>.
These two results imply a consistency result for geometric complexes: When applied to a sufficiently good sample of a sufficiently well-behaved space, they encode the topology of the space, and can thus be used for Topological Inference<sup><a href="https://doi.org/10.1017/9781108297806">[Boissonnat et al. Cambridge Texts Appl. Math.]</a></sup>.</p>

<p><strong>Complexity and sparsification.</strong>
Unfortunately, geometric complexes are huge.
For example, to compute the homology of the Rips complex of a finite metric space $X$ up to dimension $m$, one needs to construct a simplicial complex with $\Theta(|X|^{m+2})$ simplices, and then perform Gaussian elimination on a matrix of that size!</p>

<p>Because of this, many sparsification techniques for geometric complexes (and simplicial complexes in general) have been proposed.
While these do improve computation time and memory to an extent,
scaling remains well above quadratic, and it is rare to be able to compute the homology of a high-dimensional point cloud with more than a few thousand points.</p>

<p><strong>The problem.</strong>
I believe that the main issue is that geometric complexes always have the data points as vertices.
This will remain an issue as long as we use simplicial complexes that take data points as vertices.</p>

<h1 id="covers-and-nerve">Covers and Nerve</h1>

<p>Luckily, there is a great (and classical) source of simplicial complexes that does not use points as vertices: the nerve complex of a cover.</p>

<p>A <strong>cover</strong> of a set $X$ is a set of subsets of $X$ whose union is $X$.
The <strong>nerve</strong> of such a cover is a simplicial complex with vertices the subsets in the cover, and with higher dimensional simplices given by the non-empty intersections:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/cover-nerve.svg" alt="cover-nerve" style="width:100%" />
</p>

<h1 id="cover-learning">Cover Learning</h1>

<p>In the context of Topological Inference, the nerve construction allows us to reduce the problem of constructing a simplicial complex to that of constructing a cover of the data.
If we construct a cover with $k$ elements, the output simplicial complex will have $k$ vertices, and if we have control over $k$, we can make it much smaller than the number of data points.
How to learn covers is an interesting problem in its own right, and is related to soft clustering.</p>

<p>In our <a href="https://proceedings.mlr.press/v267/scoccola25a.html">paper</a>, we approach it from the perspective of geometric optimization, by minimizing a certain loss function for covers that we design.
Here’s an example from the paper:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/cover-nerve-human.svg" alt="cover-nerve-human" style="width:60%" />
</p>

<p>Pretty cool tricks go into our approach, but what I want to emphasize here is not our particular method, but rather that:</p>
<p style="text-align: center;"><ins>Covers should be a central tool in Topological Inference</ins>.</p>

<p>I’ll conclude with some open questions:</p>
<ul>
  <li>Are there practical cover learning algorithms that are consistent even if one fixes the number of cover elements $k$?
That is, I want a practical cover learning algorithm whose output nerve is topologically correct in the limit of infinitely many sample points, and is restricted to have no more than $k$ vertices (with $k$ depending on the space the data is being sampled from).
This would stand in stark contrast to the consistency of geometric complexes, whose size is unbounded as the sample size grows.</li>
  <li>Are there approaches to cover learning that are simpler and more robust than the one we propose?</li>
  <li>What is the relationship between fuzzy covers and fuzzy clusterings? Are any of the standard fuzzy clustering algorithms topologically consistent?
What is a fuzzy cover and why would one consider this is explained in Section 3 of our <a href="https://proceedings.mlr.press/v267/scoccola25a.html">paper</a>.</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[The standard approach to Topological Inference is based on geometric complexes. Most commonly, geometric complexes scale cubically (and often worse) in the number of data points, which poses a big problem. Here I describe an alternative approach to Topological Inference.]]></summary></entry><entry><title type="html">Topological Inference and Unsupervised Learning</title><link href="https://luisscoccola.github.io/blog/topological-inference/" rel="alternate" type="text/html" title="Topological Inference and Unsupervised Learning" /><published>2025-02-01T00:00:00+00:00</published><updated>2025-02-01T00:00:00+00:00</updated><id>https://luisscoccola.github.io/blog/topological-inference</id><content type="html" xml:base="https://luisscoccola.github.io/blog/topological-inference/"><![CDATA[<p>Fundamental problems in classical Unsupervised Learning, such as Clustering and Dimensionality Reduction, can be fruitfully interpreted from the point of view of Topological Inference.
This is an introduction to this point of view.</p>

<p><br /></p>

<div style="width: fit-content;
  border: 2px solid #ccc;
  background-color: #f0f7ff;
  padding: 1rem 2em 0.3rem 1rem;
  border-radius: 5px;">
  
<p><strong>Contents</strong></p>
<ul>
  <li><a href="#topology">Topology</a></li>
  <li><a href="#topological-inference-and-persistent-homology">Topological Inference and Persistent Homology</a></li>
  <li><a href="#beyond-ph-topology-in-unsupervised-learning">Beyond Persistent Homology: Topological Inference in Unsupervised Learning</a>
    <ul>
      <li><a href="#topology-and-clustering">Topology and Clustering</a></li>
      <li><a href="#topology-and-dimensionality-reduction">Topology and Dimensionality Reduction</a></li>
    </ul>
  </li>
</ul>

</div>
<p><br /></p>

<h1 id="topology">Topology</h1>

<p><strong>Topology</strong> is the branch of mathematics that studies the properties of spaces that remain unchanged under continuous deformations.
For example, the number of connected components of a planar graph, such as $G_1$ below, is independent of how the graph is drawn: it does not depend, for example, on how long the edges are.
Mathematicians say that the number of connected components is a <strong>topological invariant</strong> of the graph.
On the other hand, the distance between a pair of vertices is not a topological invariant: it can change if the graph is drawn differently.</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/graphs.svg" alt="graphs" style="width:100%" />
</p>

<p>The number of connected components of a topological space $X$ is one of the simplest topological invariants, and it is called the <strong>zeroth Betti number</strong> of the space, and denoted $\beta_0(X)$. 
The <strong>first Betti number</strong>, denoted $\beta_1(X)$, counts the number of “one-dimensional holes”.
For example, the space $S^1$ given by the circumference of a circle has a single one-dimensional hole $\beta_1(S^1) = 1$ and a single connected component $\beta_0(S^1) = 1$.</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/spaces.svg" alt="spaces" style="width:100%" />
</p>

<p>Holes come in all dimensions: for instance, a two-dimensional sphere $S^2$, such as a basketball, has a two-dimensional hole $\beta_2(S^2) = 1$ (its “inner void”),
no one-dimensional holes $\beta_1(S^2)=0$,
and a single connected component $\beta_0(S^2) = 1$.
Another cool topological space is the surface of a donut (usually called a <em>torus</em>) denoted as $T$ in the picture above.</p>

<p>Topological spaces are continuous entities with potentially infinitely many points.
A <strong>simplicial complex</strong> is a special kind of topological space that can be described using a finite amount of data.
A simplicial complex is essentially an undirected hypergraph: like a graph, it can have vertices (called $0$-simplices) and edges (called $1$-simplices), but it can also have $n$-simplices for $n \geq 2$.
For example, a $2$-simplex is a filled triangle, and a $3$-simplex is a filled tetrahedron.
Here are the three spaces above represented as simplicial complexes:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/simplicial-complexes.svg" alt="simplicial-complexes" style="width:100%" />
</p>

<h1 id="topological-inference-and-persistent-homology">Topological Inference and Persistent Homology</h1>

<p>Topological Inference is about estimating topological properties of spaces from incomplete information.
A classical example is <a href="https://link.springer.com/article/10.1007/s00454-008-9053-2">[Niyogi et al. DGC]</a>, which provides a statistically consistent algorithm for estimating the Betti numbers of a manifold from a finite sample.
Topological Inference relates to the following keywords:</p>

<p><strong>Computational Topology</strong>: the algorithmic computation of topological invariants.</p>

<p><strong>Topological Data Analysis</strong>: theory and algorithms related to the usage of topological methods in data analysis, part of the broader fields of Geometric Data Science and Geometric Machine Learning.</p>

<p><strong>Persistent Homology</strong> (PH): a particular construction with applications in Topological Inference and abstract Mathematics.
Roughly speaking, PH provides a generalization of the concept of Betti number (sometimes called <strong>persistent Betti number</strong> or <strong>barcode</strong>) that applies to families of topological spaces, rather than to single topological spaces.</p>

<p>Here’s the typical toy example showcasing PH as a finite sample estimator for the Betti numbers of the circle $S^1$:</p>

<p style="text-align:center;">
  <figure id="PH">
    <img src="/blog/assets/img/PH.svg" alt="PH" style="width:100%" />
  </figure>
</p>

<p>Persistent Homology has had several successes in the analysis of data coming from scientific applications.
Cool examples include
PH as a feature for the classification of cells in subcellular spatial transcriptomics<sup><a href="https://www.nature.com/articles/s41586-024-07563-1">[Benjamin et al. Nature]</a></sup>,
and
PH as a means to detect and quantitatively describe center vortices in $SU(2)$ lattice gauge theory in a gauge-invariant way<sup><a href="https://journals.aps.org/prd/abstract/10.1103/PhysRevD.107.034501">[Sale et al. Phys. Rev. D]</a></sup>.
More examples can be found at the <a href="https://donut.topology.rocks/">DONUT database</a>.</p>

<h1 id="beyond-ph-topology-in-unsupervised-learning">Beyond PH: Topology in Unsupervised Learning</h1>

<p>Unsupervised Learning is the branch of Machine Learning concerned with unlabeled data, but exactly what this means will depend on whom you ask.
For example, should self-supervision, as done in the pretraining phase of large language models, be regarded as Unsupervised Learning?
For concreteness, let’s focus on a class of unsupervised learning techniques that is best represented by the following two classical problems:</p>

<ul>
  <li>
    <p>The <strong>clustering problem</strong>: the problem of grouping data points of an unlabeled dataset into meaningful clusters.</p>
  </li>
  <li>
    <p>The <strong>dimensionality reduction problem</strong>: the problem of representing an unlabeled dataset as a subset of a well-understood metric space, such as a Euclidean space, in a geometrically meaningful way.</p>
  </li>
</ul>

<p>The mathematical models underlying many of the approaches to these problems have a nice topological interpretation, as I now describe.
I thank <a href="https://github.com/lmcinnes">Leland McInnes</a> for various conversations on these topics.</p>

<h2 id="topology-and-clustering">Topology and Clustering</h2>

<p>Many clustering algorithms are in essence Topological Inference algorithms, designed to estimate the connected components of high-density regions of the sample distribution.
This is done by estimating connectivity structure, typically with a graph, and then taking connected components.</p>

<p><strong>A motivating example.</strong>
As a starting point, let’s consider the most standard clustering algorithm: $k$-means.
Informally, $k$-means assumes that the input data is sampled from a set of “blob-shaped” clusters, and seeks to assign each data point to its corresponding blob.
More formally, the algorithm is an instance of the expectation-maximization procedure applied to a Gaussian mixture model with equal isotropic covariances, equal priors, and hard assignments.
Mathematically, the model is the limit of the mixture $\frac{1}{k} \sum_{i=1}^k \mathcal{N}(\mu_i, \sigma^2\, \mathrm{I})$ as $\sigma^2 \to 0$.
The model gives a precise mathematical meaning to the clusters that one seeks: these are represented by the means $\mu_i$, which correspond to the modes of the distribution.
Thus, after estimating the means $\mu_i$, there is no need to estimate any connectivity structure directly, since points can be clustered by mapping them to their closest mode.</p>

<p>I like this interpretation of $k$-means because it naturally leads to density-based clustering, which can be roughly thought of as a non-parametric version of $k$-means.</p>

<p><strong>Density-based clustering.</strong>
In the simplest incarnation of density-based clustering, the data is assumed to be sampled from a distribution with probability density function $f : \mathbb{R}^n \to \mathbb{R}$, and the clusters are declared to be the “high-density regions” with respect to $f$.
This can be made precise in a few ways.
The simplest is to fix a threshold $\lambda \in \mathbb{R}$, and define the <strong>clusters at level</strong> $\lambda$ to be the connected components of the $\lambda$-<strong>superlevel set</strong> $\{x \in \mathbb{R}^n : f(x) \geq \lambda\}$, like so:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/density-based-clustering.svg" alt="density-based-clustering" style="width:60%" />
</p>

<p>A standard density-based clustering algorithm based on this principle is DBSCAN <sup><a href="https://dl.acm.org/doi/10.5555/3001460.3001507">[Ester et al. KDD]</a></sup>, which, as observed<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> in <a href="https://ieeexplore.ieee.org/document/8215642">[McInnes, Healy. ICDMW]</a>, can be recast as the combination of two main tools:</p>
<ol>
  <li>A kernel density estimator, from Statistics.</li>
  <li>A Rips complex, from Topological Inference.</li>
</ol>

<p>The <strong>Rips complex</strong> at scale $\varepsilon$ has as vertices the data points, and puts an edge between each pair of data points at distance at most $\varepsilon$.
The Rips complex already showed up <a href="#PH">earlier</a> in the figure illustrating PH.
Here’s the Rips complex of a tiny point cloud at a fixed scale $\varepsilon$:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/rips.svg" alt="rips" style="width:60%" />
</p>

<p>DBSCAN has two parameters, often denoted $\varepsilon$ and $k$.
The parameter $k$ plays the role of the threshold $\lambda$, above.
The parameter $\varepsilon$ is more interesting, and has two uses: as the width parameter for the kernel density estimator, and as the scale parameter for the Rips complex.
So $\varepsilon$ is used for both Statistical Inference (density properties of the data) and Topological Inference (connectivity properties of the data).</p>

<p><strong>Hierarchical clustering.</strong>
If one does not want to, or does not know how to choose the threshold $\lambda$, one enters the realm of hierarchical clustering.
Going back to the probability density function $f : \mathbb{R}^n \to \mathbb{R}$, if one lets $\lambda$ vary from larger to smaller, the superlevel sets of $f$
are nested, meaning that the $\lambda_1$-superlevel set is included in the $\lambda_2$-superlevel set whenever $\lambda_1 \geq \lambda_2$.
By considering the connected components of all the superlevel sets, one obtains a hierarchical clustering, sometimes known as a <strong>cluster tree</strong>, which keeps track of how the connected components of the superlevel sets of $f$ appear and merge.
The cluster tree can be summarized using PH, allowing one to quantify the prominence of modes and high density regions, and to do cluster inference robustly.</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/cluster-tree.svg" alt="cluster-tree" style="width:60%" />
</p>

<p>Similarly, one can fix one of the two parameters of DBSCAN and let the other one vary, to obtain a hierarchical clustering algorithm that consistently estimates the cluster tree<sup><a href="https://papers.nips.cc/paper_files/paper/2010/hash/b534ba68236ba543ae44b22bd110a1d6-Abstract.html">[Chaudhuri, Dasgupta. NeurIPS]</a><a href="https://dl.acm.org/doi/10.1145/2535927">[Chazal et al. JACM]</a></sup>.
This is, in essence, a version of the HDBSCAN algorithm, in case you have heard of it.</p>

<p>Even more, one can let both parameters of DBSCAN vary and obtain a two-parameter hierarchical clustering algorithm, which is also consistent and contains many standard hierarchical clusterings as “one-dimensional slices”.
This is introduced in <a href="https://jmlr.org/papers/v25/21-1185.html">[Rolle, Scoccola. JMLR]</a> and is implemented in our Python package <a href="https://github.com/LuisScoccola/persistable">persistable-clustering</a>.
It makes use of a density-sensitive generalization of the Rips complex from Topological Inference, called <strong>degree-Rips</strong>.</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/degree-rips.svg" alt="degree-rips" style="width:80%" />
</p>

<h2 id="topology-and-dimensionality-reduction">Topology and Dimensionality Reduction</h2>

<p>Many non-linear dimensionality reduction algorithms also start with a Topological Inference phase, where a graph or simplicial complex is constructed, which is then used as a proxy for the space the data is assumed to be sampled from.</p>

<p><strong>A motivating example.</strong>
A classical example is Laplacian Eigenmaps (LE)<sup><a href="https://ieeexplore.ieee.org/document/6789755">[Belkin, Niyogi. Neural Comput.]</a></sup>, which starts by constructing a graph estimating the connectivity of the data.
This graph is then weighted using distance information, since the next step is to use it as a proxy for a manifold to estimate the Laplacian eigenfunctions, which are then used to find a low-dimensional embedding.
The weighing is strictly speaking Geometric Inference, since its goal is to estimate geometric properties.
It is only natural that Topological and Geometric Inference often show up together.</p>

<p><strong>Uniform Manifold Approximation and Projection</strong> (UMAP)<strong>.</strong>
A more modern non-linear dimensionality reduction algorithm is UMAP<sup><a href="https://arxiv.org/abs/1802.03426">[McInnes et al.]</a></sup>, which has become the go-to algorithm for lots of applications.
UMAP shares some similarities with LE, and in fact relies on LE for initialization,
but the theoretical justification for UMAP is more topological in nature, and uses weighted simplicial complexes in a crucial way.
In essence, the data is modelled as a probabilistic simplicial complex for which a low-dimensional embedding is found using stochastic gradient descent and several clever computational shortcuts.
I am skipping over lots of very interesting details here; besides the original paper, I recommend the <a href="https://umap-learn.readthedocs.io/en/latest/index.html">documentation</a> for the official <a href="https://github.com/lmcinnes/umap">implementation</a>, and other online resources, such as the interactive blog post <a href="https://pair-code.github.io/understanding-umap/">[Coenen, Pearce]</a>, from where I took the following illustrative example:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/coenen-pearce.png" alt="coenen-pearce" style="width:90%" />
</p>

<p>In practice, UMAP is robust to many types of noise and data imperfections, and it is an excellent starting point in many scenarios, including exploratory data analysis.
However, as opposed to the clustering techniques that I described <a href="#topology-and-clustering">earlier</a>, it does not come with theoretical guarantees (at least for the moment), and interpretability may not be straightforward.</p>

<p>Next, I’ll describe a topological dimensionality reduction procedure that is limited in scope and less robust, but that, thanks to this, admits theoretical guarantees and higher interpretability.</p>

<p><strong>The circular coordinates algorithm.</strong>
The motivating question is the following:
Given a space $X$ with a one-dimensional hole, does there exist a function $f : X \to S^1$ from the space to the circle that parametrizes this hole?</p>

<p>Such function $f$ would provide us with a topologically faithful representation of $X$, at least when it comes to preserving its circularity.
For example, here are two functions from a “double-torus” to the circle, which parametrize two of its one-dimensional holes:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/circular-coordinates.png" alt="circular-coordinates" style="width:100%" />
</p>

<p>A standard theorem from topology (sometimes called the <em>representability theorem for cohomology</em>) guarantees that such function $f$ always exists; moreover, if $X$ is a Riemannian manifold, then there is a canonical choice for such function: the one with minimal Dirichlet energy.
The exact meaning of this is not crucial; what matters is that, given a finite sample of a space with a one-dimensional hole, a bit of Topological and Geometric Inference gives us back a map from the sample to the circle $S^1$.
This procedure is known as the <strong>circular coordinates algorithm</strong><sup><a href="https://dl.acm.org/doi/10.1145/1542362.1542406">[de Silva, Vejdemo-Johansson. SoCG]</a></sup>, and is implemented in our Python package <a href="https://github.com/scikit-tda/DREiMac">DREiMac</a>,
which was used, for instance, in Neuroscience<sup><a href="https://www.nature.com/articles/s41586-023-06031-6">[Schneider et al. Nature]</a></sup>.
Another interesting source of circularity in data is periodicity and quasiperiodicity in time series<sup><a href="https://link.springer.com/article/10.1186/s12859-015-0645-6">[Perea et al. BMC Bioinformatics]</a></sup>.</p>

<p><strong>The toroidal coordinates algorithm.</strong>
There exist examples where data can have more than one one-dimensional hole.
For instance, <a href="https://www.nature.com/articles/s41586-021-04268-7">[Gardner et al. Nature]</a>
shows that the population activity of grid cells (part of the neural system concerned with an individual’s position) resides on a topological torus.
When dealing with a sample from a space $X$ with more than one one-dimensional hole $\beta_1(X) = n \geq 2$ the original circular coordinates algorithm often outputs circle-valued maps that are “geometrically correlated”, and which are thus harder to interpret.
In <a href="https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SoCG.2023.57">[Scoccola et al. SoCG]</a>, we make formal the notion of geometric correlation for circle-valued maps using the Dirichlet form, which endows the set of circle-valued maps with the structure of a lattice:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/dirichlet-form.png" alt="dirichlet-form" style="width:60%" />
</p>

<p>In that paper, we describe the <strong>toroidal coordinates algorithm</strong>, which enhances the circular coordinates algorithm by “decorrelating” the circle-valued maps.
Informally, this decorrelation is an analogue of PCA for maps into a product of circles (rather than maps into a product of real lines).
The difficulty is that a product of circles is not a vector space, so the projection matrix is constrained to have integer entries.
We addressed this using <em>lattice reduction</em>, a method from Computational Number Theory:</p>

<p style="text-align:center;">
  <img src="/blog/assets/img/lattice-reduction.png" alt="lattice-reduction" style="width:100%" />
</p>

<p>The toroidal coordinates algorithm is also implemented in <a href="https://github.com/scikit-tda/DREiMac">DREiMac</a>.
There also exist other topological dimensionality reduction algorithms, which parametrize topological features other than circularity, such as the one in <a href="https://link.springer.com/article/10.1007/s41468-023-00141-w">[Schonsheck, Schonsheck. JACT]</a>.</p>

<p><strong>What’s next?</strong>
In the world of Dimensionality Reduction, the gap between theoretical guarantees and practical methods is much wider than in Clustering, where, as described <a href="#topology-and-clustering">earlier</a>, there exist practical methods with strong topology recovery guarantees.
Non-linear dimensionality reduction methods with theoretical guarantees have limited scope and tend not to be very robust, while general purpose methods that are efficient and robust tend to be justified by heuristics.
This is not surprising: Dimensionality Reduction is more complicated than clustering, and higher dimensional topological invariants are more complicated than the connected components.</p>

<p>The practical Dimensionality Reduction method with
perhaps the strongest available guarantees is Laplacian Eigenmaps, for which geometric consistency has been established in <a href="https://proceedings.neurips.cc/paper/2006/hash/5848ad959570f87753a60ce8be1567f3-Abstract.html">[Belkin, Niyogi. NeurIPS]</a>.
To the best of my knowledge, the topological properties of the LE embedding are not well understood beyond connected components.</p>

<p>What would be really nice to see is any of the following:</p>
<ul>
  <li>Methods that lie in-between UMAP and the topological parametrization methods, and which enjoy the good properties of both.
This could be, for example, making UMAP more interpretable or making the topological parametrization methods more widely applicable and robust.</li>
  <li>Theoretical guarantees for at least some parts of the UMAP pipeline or a suitably modified pipeline.</li>
  <li>In particular, I would like to see topological consistency results for the nearest neighbor graph construction.
While a lot is known about the Rips complex, it’s sibling, the nearest neighbor graph (ubiquitous in non-linear dimensionality reduction methods) has been mostly neglected when it comes to Topological Inference.
The only related work that I know of is <a href="https://www.aimsciences.org/article/doi/10.3934/fods.2019001">[Berry, Sauer. FoDS]</a>, which establishes geometric consistency.</li>
</ul>

<p>If you know of interesting work in these directions, feel free to contact me!</p>

<hr />
<p><br /></p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>To be fully precise, it is the algorithm DBSCAN* that exactly has that form. DBSCAN* is a minor modification of DBSCAN introduced in <a href="https://link.springer.com/chapter/10.1007/978-3-642-37456-2_14">[Campello et al. KDD]</a>. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><summary type="html"><![CDATA[Fundamental problems in classical Unsupervised Learning, such as Clustering and Dimensionality Reduction, can be fruitfully interpreted from the point of view of Topological Inference. This is an introduction to this point of view.]]></summary></entry></feed>