Papers
Topics
Authors
Recent
Search
2000 character limit reached

Stokes' Theorem for Smooth Singular Cubes in Lean 4: True Pullback, Bridges to mathlib4, and Chain-Level d^2=0

Published 1 May 2026 in cs.LO and math.DG | (2605.01028v1)

Abstract: We present a sorry-free Lean 4/mathlib4 formalization of Stokes' theorem for smooth singular cubes in arbitrary dimension, using true differential-form pullback via the Frechet derivative. The development also includes a bridge to mathlib4's abstract extDeriv, chain-level Stokes extended by Z-linearity, d2=0 for singular cubical chains, box Stokes for axis-aligned cubes, dimensional specializations, and a structured comparison with Harrison's HOL Light formalization.

Summary

  • The paper establishes a rigorous Lean 4 formalization of Stokes' theorem for smooth singular cubes using true pullbacks.
  • The approach reduces singular Stokes to a coordinate-level box case, leveraging mathlib4’s exterior derivative and divergence theorem.
  • The work proves the chain-level property ∂² = 0 via algebraic techniques, bridging concrete computations with abstract differential geometry.

Formalization of Stokes' Theorem for Smooth Singular Cubes in Lean 4

Overview and Motivation

The paper "Stokes' Theorem for Smooth Singular Cubes in Lean 4: True Pullback, Bridges to mathlib4, and Chain-Level 2=0\partial^2 = 0" (2605.01028) presents a Lean 4 formalization of the cubical version of Stokes' theorem for smooth singular cubes, providing a mathematically rigorous and sorry-free framework. The formalization concerns smooth maps σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m and smooth nn-forms ω\omega on Rm\mathbb{R}^m, asserting the classical formula:

[0,1]n+1σ(dω)=i=0n(1)i[facei(1)σωfacei(0)σω]\int_{[0,1]^{n+1}} \sigma^*(d\omega) = \sum_{i=0}^{n} (-1)^i \left[ \int_{\mathrm{face}_i(1)} \sigma^*\omega - \int_{\mathrm{face}_i(0)} \sigma^*\omega \right]

The formalization connects concrete coordinate-level representations to the abstract exterior derivative API in mathlib4, establishes a chain-complex structure at the level of cubical chains, and provides proof-level transparency by reducing key results to established mathlib4 theorems (particularly the divergence theorem and exterior derivative machinery).

Technical Contributions

1. True Pullback and Singular Cubes

The definition of smooth singular cubes requires globally CC^\infty maps σ:Rn+1Rm\sigma : \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m, in contrast to traditional singular cubes (which require only local smoothness). Integration is performed over the unit cube domain. Differential forms are pulled back via the genuine differential-form pullback involving the Fréchet derivative Dσ(x)D\sigma(x), satisfying

(σω)(x)(v1,,vn)=ω(σ(x))(Dσ(x)v1,,Dσ(x)vn)(\sigma^* \omega)(x)(v_1,\ldots,v_n) = \omega(\sigma(x))(D\sigma(x)\cdot v_1, \ldots, D\sigma(x)\cdot v_n)

This matches the classical geometric semantics rather than coefficient precomposition.

2. Reduction to Box Stokes via mathlib4

The singular Stokes theorem is reduced to a coordinate-level box Stokes result. The key steps are:

  • Demonstrating naturality: σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m0 using mathlib4's abstract exterior derivative API.
  • Applying box Stokes to the σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m1 domain (with smoothness inherited by pullbacks).
  • Establishing a face-matching identity connecting box boundary integrals of pullback forms to integrals over cube faces.

This approach leverages mathlib4's divergence theorem and external derivative infrastructure, ensuring the formalization is tightly integrated with established library results.

3. Chain-Level σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m2 and Formal Chains

The chain-complex structure is realized by σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m3-linear extension to formal singular chains, implemented with finitely-supported functions. The boundary operator σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m4 is defined algebraically, and the identity σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m5 is proved via a sign-reversing involution on boundary indices and explicit use of Lean tactics for cancellation. This establishes the essential algebraic property needed for de Rham and singular cubical cohomology theories.

4. Bridge to Abstract Exterior Derivative (mathlib4)

A core methodological innovation is the bridge theorem pattern, connecting explicit coordinate formulas to the abstract mathlib4 exterior derivative (#extDeriv). The paper proves that evaluating abstract forms on standard basis vectors recovers the coordinate-level expressions and sign conventions. This validation guarantees that the formalization is consistent with higher-level differential geometry as implemented in mathlib4.

5. Dimensional Specializations and Consistency Checks

The framework encompasses the Fundamental Theorem of Calculus, Green's theorem, divergence, and Gauss (3D divergence), with all results being direct instantiations of the main Stokes theorem. Numerical consistency checks are included, particularly for the σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m6 case, ensuring that the formalization produces correct integral values and matches existing mathlib4 analyses.

Numerical Results and Explicit Claims

  • The Lean formalization comprises 44 modules, 4028 source lines, and 205 named declarations.
  • All proofs are sorry-free; only standard axioms (propext, Classical.choice, Quot.sound) are used.
  • Extensive axiom checking (79 declarations) confirms proof-level transparency.
  • The singular Stokes theorem applies for arbitrary globally smooth parametrizations, not only axis-aligned boxes.
  • Chain-level properties (additivity, scalar compatibility, σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m7) are available, facilitating foundational algebraic topology constructions.

Practical and Theoretical Implications

Practical Foundations in Formal Mathematics

By connecting coordinate-level calculations to abstract differential geometry and integrating tightly with mathlib4, the paper provides a robust foundation for formalizing further results in differential topology. The reusable bridge pattern enables future work to validate concrete formulas against abstract APIs, an essential aspect of large-scale mathematical library construction.

Algebraic Topology and Cohomology

The explicit realization and proof of chain-level algebraic identities bring Stokes' theorem into the context required for constructing cochain maps, singular and cubical cohomology, and de Rham theory within Lean. The ability to integrate differential forms over formal chains and prove σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m8 at chain-level is critical for downstream algebraic topology formalizations.

Limitations and Future Directions

The formalization covers parametrized singular cubes, but not full smooth manifolds with boundary. It omits chart-based integration, orientation theory, and partition-of-unity arguments. Extending the infrastructure to smooth manifolds will require additional foundational work in mathlib4, including manifold-valued singular chains and form integration. The singular cube framework provides a local building block for such extensions.

Comparison to Existing Formalizations

The formalization is compared explicitly to Harrison's HOL Light work, which covers convex and polyhedral domains, not smooth manifolds. The Lean 4/mathlib4 approach utilizes dependent types, leverages library infrastructure, and directly connects to abstract exterior algebra, while HOL Light remains self-contained and based on simple type theory. The Lean formalization is complementary: its domain is singular cubes and boxes, with true pullbacks and chain-level algebraic structure.

Conclusion

This formalization establishes Stokes' theorem for smooth singular cubes in Lean 4, achieving rigorous chain-level algebraic properties, true differential-form pullback, and practical integration with library abstractions in mathlib4. It provides technical innovations (the bridge theorem, chain-level σ:Rn+1Rm\sigma: \mathbb{R}^{n+1} \rightarrow \mathbb{R}^m9, face-matching identities), facilitating further developments in formal differential topology and algebraic topology within proof assistant infrastructure.

The artifact is reproducible, rigorously verified, and demonstrates a practical approach to integrating formalized mathematics libraries with classical geometric theory. Key elements are likely reusable for future extensions to manifold-level Stokes' theorem and related results.

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.

Open Problems

We haven't generated a list of open problems mentioned in 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 2 likes about this paper.