Papers
Topics
Authors
Recent
Search
2000 character limit reached

Synthetic Differential Geometry in Lean

Published 18 Mar 2026 in cs.LO and math.DG | (2603.17457v1)

Abstract: This article is about the formalization of synthetic differential geometry with the Lean proof assistant and the mathematical library mathlib. The main result we prove and formalize is a Taylor theorem for functions of several variables, where the series expansion is around an infinitesimal neighborhood. Most of our proofs are in fact new. Our investigations highlight the possibility of using mathlib to do constructive mathematics.

Summary

  • The paper presents a complete formalization of synthetic differential geometry in Lean, proving a synthetic Taylor theorem for functions of several variables.
  • It develops a constructive framework that replaces classical axioms with unique choice and introduces custom tools to eliminate implicit classical dependencies.
  • The work demonstrates that Lean’s proof assistant can robustly support intuitionistic mathematics, paving the way for advanced mechanizations in differential calculus.

Synthetic Differential Geometry Formalized in Lean: Framework, Implementation, and Results

Introduction and Motivation

The paper "Synthetic Differential Geometry in Lean" (2603.17457) establishes a comprehensive formalization of synthetic differential geometry (SDG) in the Lean proof assistant. SDG offers an axiomatic approach to differential geometry within topos theory, emphasizing infinitesimal methods while employing intuitionistic logic. This work presents the full mechanization of core elements of SDG in Lean, culminating in the formal proof of a synthetic Taylor theorem for functions of several variables on infinitesimal neighborhoods. Notably, virtually all proofs, including that of the Taylor theorem, are original and not previously found in the literature.

A principal technical challenge addressed is the reconciliation of SDG—a fundamentally constructive and intuitionistic theory—with Lean's proof environment, which by default admits classical principles, notably the axiom of choice. The authors demonstrate that Lean, together with its mathematical library mathlib, can support nontrivial constructive mathematics with localized adjustments. They further introduce infrastructure to ensure that all proofs avoid classical reasoning, and adapt portions of mathlib where necessary to ensure full constructivity.

Synthetic vs. Classical Differential Calculus

The paper succinctly delineates the core distinction between SDG and classical differential analysis. In the classical setting, Taylor polynomials offer local polynomial approximations to differentiable functions, with error terms vanishing as arguments approach the point of expansion. In contrast, SDG—via the Kock–Lawvere axiom—ensures the actual coincidence of every function on infinitesimal neighborhoods with a polynomial of fixed degree. That is, SDG internalizes tangent and higher-order structure: for any function defined on an infinitesimal object (such as a neighborhood Dk:={rRrk+1=0}D_k := \{ r \in R \mid r^{k+1}=0 \} for a commutative ring RR), the function is simply a polynomial of degree k\leq k.

This is made explicit in their formalized theorems, where Taylor expansions on infinitesimal neighborhoods hold as literal equalities. For example, for f:RRf: R \to R, and dD1d \in D_1, f(x+d)f(x+d) always equals f(x)+f(x)df(x) + f'(x)d. More generally, on DkD_k, all functions coincide exactly with their kk-th order Taylor polynomial around the expansion point.

Logical Infrastructure and Lean Implementation

Due to the incompatibility of the Kock–Lawvere property with the law of excluded middle (LEM), any formalization of SDG must rigorously avoid impredicative or classical tools. Lean, built upon dependent type theory, admits classical axioms in its standard library, with the axiom of choice being central. Since Diaconescu’s theorem implies that even weak forms of choice yield LEM, the direct use of Lean’s axiom of choice is proscribed.

The authors introduce and utilize the axiom of unique choice, a strictly weaker form allowing for the extraction of witnesses in cases of unique existence. This suffices for their formalization needs, e.g., constructing functions defined by unique existence properties, but avoids the pitfalls of the full axiom of choice.

A significant practical contribution is their development of custom dependency analysis tools. Given that even trivial uses of tactics like grind can introduce implicit classical dependencies, they generate explicit dependency graphs and custom linters to ensure that all their formalizations (and underlying mathlib statements upon which they depend) are genuinely constructive. When dependencies on classical axioms are discovered in core parts of mathlib (such as the field structure on ℚ or arithmetic on finite types), they isolate and rewrite only the minimal necessary library fragments, achieving wide-ranging ‘choice-elimination’ in key finitary domains.

Synthetic Differential Calculus: One and Several Variables

The formalization covers the construction of infinitesimal objects DkD_k within a commutative ring RR and develops the full apparatus of differentiation internally to SDG. The treatments of one-variable and several-variables calculus mirror each other structurally but are developed in a fully synthetic context.

One Variable

For any $1$-Kock–Lawvere ring, the authors define the derivative operator \partial by uniqueness properties on infinitesimal neighborhoods and prove that all functions on DD are affine, with \partial being R-linear and satisfying the full Leibniz rule. Higher-order derivatives are derived, and for DkD_k-neighborhoods, they formalize and prove that all functions coincide with their full Taylor polynomial of degree kk.

Several Variables

Partial derivatives are synthetically defined via analogous uniqueness conditions along coordinate directions. The authors prove commutativity of mixed partials (Schwarz's theorem) and, most significantly, the synthetic multivariate Taylor theorem: for f:RnRf: R^n \to R and any dDk0××Dkn1d \in D_{k_0} \times \dots \times D_{k_{n-1}}, the value f(r+d)f(r+d) expands exactly as the expected multivariate Taylor polynomial truncated by the orders of nilpotency in each direction.

This provides a synthetic foundation where, internally, all smooth functions exhibit the same local polynomialal behavior as in classical settings, but these are equalities rather than approximations. The formalization is general with respect to base rings, variable indices, and order of expansion.

Implementation Issues and Solutions

The necessity of avoiding classical reasoning imposes severe constraints on the application of tactics, the construction of quotient types, and the instantiation of certain typeclass-based structures. The authors describe in detail their methodology for identifying and eliminating classical dependencies deep within Lean’s libraries, particularly in parts managing finite sets, finite products, and the construction of rational numbers.

Where possible, they adapt definitions or supply new, constructive proofs for previously classically-proven results. They push their approach further by proposing a maintainable paradigm for managing choice-free alternatives in a modular way, aligning with ongoing developments in the Lean community around proof refinement and tactic control. As a result, their synthetic formalization is not only internally consistent but also robust with respect to future developments in the Lean/mathematics libraries.

Theoretical and Practical Implications

This work has substantial implications for both the formalization of mathematics and the mechanization of synthetic approaches to geometry and calculus. By demonstrating that with moderate modifications, Lean can support substantial intuitionistic mathematics, the paper charts a path for constructive, synthetic formalizations of broader branches of mathematics.

From the perspective of SDG, the complete formalization of the synthetic Taylor theorem in several variables provides a valuable proof-of-concept for using type-theoretic proof assistants as platforms for developing, testing, and unifying results in local differential geometry. The fact that SDG internalizes strong computation laws (polynomiality on infinitesimal neighborhoods) suggests that mechanized SDG could serve as a potent tool for automating or conjecture-proving in differential geometry, where the technical complexity of explicit local calculations is often a barrier.

Conclusion

"Synthetic Differential Geometry in Lean" (2603.17457) provides both technical depth and significant practical advancements in the formalization of SDG within an intuitionistic logic framework. The robust synthetic treatment of Taylor expansion—across arbitrary variables and degrees—and the tools and methodology for classical-axiom elimination set new standards for constructivist formalization in proof assistants. Future extensions might include formalizations of well-adapted models, further integration with homotopy type theory, or generalized synthetic treatments of geometry and physics. The work illustrates the feasibility and power of combining advanced mathematical logic, topos theory, and modern proof technology for the development and verification of sophisticated mathematics.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 58 likes about this paper.