Papers
Topics
Authors
Recent
Search
2000 character limit reached

Formalizing Extended Complex Numbers, Mobius Transformations, and Cross Ratio in Lean 4

Published 18 Jun 2026 in math.CV and cs.MS | (2606.20358v1)

Abstract: The extended complex plane is a fundamental object in complex analysis, hyperbolic geometry, and mathematical physics. Its geometry is governed by Möbius transformations, with the cross ratio serving as a central invariant. We present a formalization of these concepts in the Lean4 theorem prover. The extended complex plane is represented using Mathlib's Option type over $\mathbb{C}$, where the additional element represents the point at infinity. On this foundation, we define Möbius transformations, their action on the extended complex plane, and the cross ratio. We formalize several basic properties of Möbius transformations, including their group structure, and identify them with a projective general linear group. We also prove the uniqueness of a Möbius transformation mapping any three distinct points to any other three distinct points, and the invariance of the cross ratio. All proofs are machine-checked in Lean 4. The complete development comprises approximately 6,000 lines of Lean code, including about 40 definitions and 150 lemmas and theorems. This work provides a verified foundation for future formalizations of conformal geometry, hyperbolic models, modular forms, and applications in mathematical physics.

Authors (2)

Summary

  • 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.

Formalization of Extended Complex Numbers and Möbius Transformations in Lean 4

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{}\overline{\mathbb{C}} = \mathbb{C} \cup \{\infty\}, 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\overline{\mathbb{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\mathbb{C}, with "none" encoding \infty. All arithmetic operations are defined by explicit pattern matching on whether any operand is \infty, to respect the topological conventions of the Riemann sphere. For instance, z+=z + \infty = \infty, z0=0z \cdot 0 = 0, z=z \cdot \infty = \infty, 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.

Möbius Transformations: Definition, Group Structure, and Action

A Möbius transformation is defined as f(z)=az+bcz+df(z) = \frac{az + b}{cz + d}, with adbc0ad-bc \neq 0. The action on C\overline{\mathbb{C}}0 is managed via case analysis, ensuring correct treatment at poles and the point at infinity. Composition is formalized as matrix multiplication:

C\overline{\mathbb{C}}1

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 C\overline{\mathbb{C}}2. A subgroup isomorphic to C\overline{\mathbb{C}}3 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 C\overline{\mathbb{C}}4, corresponding to a total of three explicit formulae for transformations mapping particular triples to C\overline{\mathbb{C}}5. The uniqueness proof handles partial cases rigorously, including actions fixing C\overline{\mathbb{C}}6, 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 C\overline{\mathbb{C}}7, with comprehensive coverage of degeneracies due to infinity:

C\overline{\mathbb{C}}8

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 C\overline{\mathbb{C}}9 action, corresponding to well-known fractional expressions:

C\mathbb{C}0

Explicit generators for the complement and inverse transformation are proved, paralleling classical geometric invariance results.

Discussion: Algebraic Formalization and AI-Assisted Proofs

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 C\mathbb{C}1 and the Lorentz group C\mathbb{C}2 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.

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 12 likes about this paper.