- The paper's main contribution is the rigorous formalization of extended complex numbers, Möbius transformations, and the cross ratio in Lean 4 using nearly 6,000 lines of code.
- It employs an Option type for the extended complex plane to meticulously manage the point at infinity and formalizes Möbius transformations with explicit group-theoretic proofs.
- The work demonstrates potential for AI-assisted formalization by automating repetitive proof patterns, paving the way for advances in conformal geometry and mathematical physics.
Overview and Motivation
The formalization of extended complex numbers, Möbius transformations, and the cross ratio in Lean 4 provides a rigorous, machine-verified foundation for classical objects in complex analysis and geometry. The extended complex plane C=C∪{∞}, known as the Riemann sphere, encapsulates the geometric unification of lines and circles via stereographic projection. Möbius transformations, or linear fractional transformations, act as the automorphism group of C and preserve generalized circles. The cross ratio is a fundamental invariant under Möbius action. Despite advances in formalization across theorem provers, these objects had not been mechanized within Lean 4, specifically with comprehensive coverage of the point at infinity and group-theoretic structure. This work fills that gap using Lean 4 and Mathlib, explicitly implementing the structures, algorithms, and algebraic proofs that underpin complex analysis, hyperbolic geometry, and mathematical physics.
Construction of the Extended Complex Plane in Lean 4
The extended complex plane is represented by the Option type over C, with "none" encoding ∞. All arithmetic operations are defined by explicit pattern matching on whether any operand is ∞, to respect the topological conventions of the Riemann sphere. For instance, z+∞=∞, z⋅0=0, z⋅∞=∞, etc. This approach contrasts with homogeneous coordinate representations and provides straightforward equality management at the expense of increased case distinction in proofs. Approximately 6,000 lines of Lean code implement 40 definitions and 150 lemmas and theorems.
A Möbius transformation is defined as f(z)=cz+daz+b, with ad−bc=0. The action on C0 is managed via case analysis, ensuring correct treatment at poles and the point at infinity. Composition is formalized as matrix multiplication:
C1
with deterministic management of poles and infinity. The group structure is instantiated as a Lean Group typeclass, featuring proofs of associativity, identity, and inverses. Two transformations are equivalent if their coefficient matrices are proportional, leading to the formalization of the projective general linear group C2. A subgroup isomorphic to C3 is constructed within this framework.
Existence and Uniqueness of Möbius Mapping
The classical result that a Möbius transformation is uniquely determined by its mapping of three distinct points, and that such a transformation exists for any such assignment, is formalized and machine-checked. Existence is handled by explicit construction; uniqueness by a reduction to algebraic identities. Three special cases are covered for mappings involving C4, corresponding to a total of three explicit formulae for transformations mapping particular triples to C5. The uniqueness proof handles partial cases rigorously, including actions fixing C6, and reduces ambiguities via quadratic equations and analysis of fixed points.
Cross Ratio: Definition and Möbius Invariance
The cross ratio is defined for four points on C7, with comprehensive coverage of degeneracies due to infinity:
C8
where the formula is adapted according to which arguments are infinite. Theorem 6.1 proves, via exhaustive case analysis and algebraic manipulation, Möbius invariance of the cross ratio for all possible configurations of input points, with machine-checking via Lean's tactic framework.
Permutation properties of the cross ratio are mechanized, proving that there are only six distinct values under C9 action, corresponding to well-known fractional expressions:
C0
Explicit generators for the complement and inverse transformation are proved, paralleling classical geometric invariance results.
The algebraic approach, eschewing homogeneous coordinates for the Option type, enables fast-equality testing and aligns well with Lean's pattern-matching tactics. However, it produces many case splits—especially for Möbius action and cross ratio invariance—with dozens of subcases. These case distinctions are amenable to automation, suggesting the development of AI-assisted tactics or domain-specific generators for handling structurally repetitive proof patterns, potentially augmenting human formalization and accelerating theorem proving.
Implications and Future Directions
The formalization of extended complex numbers, Möbius transformations, and the cross ratio establishes a robust foundation for further mechanization of advanced topics:
- Generalized Circles: Formalizing circlines as Hermitian matrices, verifying Möbius-induced circle/line preservation.
- Conformal Geometry: Proving conformality via algebraic/analytic methods, supporting the study of complex derivatives and angles.
- Mathematical Physics: Bridging C1 and the Lorentz group C2 through Pauli matrices, formalizing celestial sphere transformations for special relativity.
- AI-Assisted Formalization: Leveraging repetitive structural case patterns for model training and tactic development.
By verifying these constructions in Lean 4, the paper provides a platform for rigorous development in number theory (modular forms, automorphic forms), mathematical physics, and geometry, with all proofs and code publicly available for further extension.
Conclusion
This formalization rigorously implements the extended complex plane, Möbius transformations, and the cross ratio in Lean 4, proving key algebraic and group-theoretic properties. Comprehensive coverage of degeneracies due to infinity and explicit case distinction underpin the robustness of results. The work enables future formalization in complex analysis, geometry, and physics, and motivates the integration of AI-assisted tactics for automating structurally patterned proofs.