- 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.
Overview and Motivation
The paper "Stokes' Theorem for Smooth Singular Cubes in Lean 4: True Pullback, Bridges to mathlib4, and Chain-Level ∂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+1→Rm and smooth n-forms ω on Rm, asserting the classical formula:
∫[0,1]n+1σ∗(dω)=i=0∑n(−1)i[∫facei(1)σ∗ω−∫facei(0)σ∗ω]
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 C∞ maps σ:Rn+1→Rm, 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), satisfying
(σ∗ω)(x)(v1,…,vn)=ω(σ(x))(Dσ(x)⋅v1,…,Dσ(x)⋅vn)
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+1→Rm0 using mathlib4's abstract exterior derivative API.
- Applying box Stokes to the σ:Rn+1→Rm1 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.
The chain-complex structure is realized by σ:Rn+1→Rm3-linear extension to formal singular chains, implemented with finitely-supported functions. The boundary operator σ:Rn+1→Rm4 is defined algebraically, and the identity σ:Rn+1→Rm5 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+1→Rm6 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+1→Rm7) are available, facilitating foundational algebraic topology constructions.
Practical and Theoretical Implications
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+1→Rm8 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.
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+1→Rm9, 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.