Certified Exact Transcendental Real Number Computation in Coq
Reasoning about real number expressions in a proof assistant is challenging. Several problems in theorem proving can be solved by using exact real number computation. I have implemented a library for reasoning and computing with complete metric spaces in the Coq proof assistant and used this library to build a constructive real number implementation including elementary real number functions and proofs of correctness. Using this library, I have created a tactic that automatically proves strict inequalities over closed elementary real number expressions by computation.
💡 Research Summary
The paper presents a comprehensive framework for exact, certified real number computation within the Coq proof assistant. It begins by highlighting the importance of real arithmetic in formal verification of mathematical theorems and notes the limitations of traditional Cauchy‑sequence based real implementations, especially regarding computational efficiency and certification. To overcome these issues, the author adopts the notion of regular functions—functions of the form ε ↦ Q that provide rational approximations of a real value at any requested precision. Regular functions are governed by a ball relation β_ε(a,b), which abstracts the metric without presupposing a real number type.
A generic theory of metric spaces is developed using this ball relation, satisfying reflexivity, symmetry, a triangle‑inequality‑like property, and closure. Metric spaces are encoded as dependent records in Coq, containing a carrier type, the ball relation, and proofs of the axioms. The completion operator C, which turns any metric space into a complete one, is shown to form a monad. Its four primitive operations—unit, join, map, and bind—allow one to embed points, flatten nested completions, lift uniformly continuous functions, and bind functions returning completed values, respectively. Crucially, each uniformly continuous function carries an explicit modulus of continuity µ_f : Q⁺ → Q⁺∪{∞}, enabling the system to compute exactly how much input precision is needed to achieve a desired output precision, thereby eliminating accumulated rounding errors.
Real numbers are defined as the completion of the rational numbers, R ≔ C(Q). Basic arithmetic operations on R are obtained by lifting their rational counterparts via map or map₂, which automatically respects the associated moduli. This two‑stage approach—first define a function on Q where equality is decidable, then prove uniform continuity, and finally lift to R—simplifies both proofs and computation.
The paper also addresses functions that are not globally uniformly continuous. For such functions, the author shows how to restrict them to closed subdomains where uniform continuity holds, using domain‑dependent bounds derived from the input’s approximation. For instance, squaring a real number is performed by first finding a bound c ≥ |x| + 1 and then applying a uniformly continuous version of the square function on
Comments & Academic Discussion
Loading comments...
Leave a Comment