Skip to main content Accessibility help

A monadic, functional implementation of real numbers



Large scale real number computation is an essential ingredient in several modern mathematical proofs. Because such lengthy computations cannot be verified by hand, some mathematicians want to use software proof assistants to verify the correctness of these proofs. This paper develops a new implementation of the constructive real numbers and elementary functions for such proofs by using the monad properties of the completion operation on metric spaces. Bishop and Bridges's notion (Bishop and Bridges 1985) of regular sequences is generalised to what I call regular functions, which form the completion of any metric space. Using the monad operations, continuous functions on length spaces (which are a common subclass of metric spaces) are created by lifting continuous functions on the original space. A prototype Haskell implementation has been created. I believe that this approach yields a real number library that is reasonably efficient for computation, and still simple enough to verify its correctness easily.



Hide All
Bishop, E. and Bridges, D. (1985) Constructive Analysis. Grundlehren der mathematischen Wissenschaften 279, Springer-Verlag
Boehm, H.-J., Cartwright, R., Riggle, M. and O'Donnell, M. J. (1986) Exact real arithmetic: a case study in higher order programming. In: LFP '86: Proceedings of the 1986 ACM conference on LISP and functional programming, ACM Press 162173.
Burago, D., Burago, Y. and Ivanov, S. (2001) A Course in Metric Geometry, Graduate Studies in Mathematics 33, American Mathematical Society.
Cruz-Filipe, L. (2003) A constructive formalization of the fundamental theorem of calculus. In: Geuvers, H. and Wiedijk, F. (eds.) Types for Proofs and Programs. Springer-Verlag Lecture Notes in Computer Science 2646 108126.
Cruz-Filipe, L. and Spitters, B. (2003) Program extraction from large proof developments. In: Basin, D. and Wolff, B. (eds.) Theorem Proving in Higher Order Logics, 16th International Conference, TPHOLs 2003. Springer-Verlag Lecture Notes in Computer Science 2758205220.
Hales, T. C. (2002) A computer verification of the Kepler conjecture. In: Proceedings of the International Congress of Mathematicians, Beijing, 2002, Volume III, Higher Ed. Press 795804.
Kurzweg, U. H. (2001) Pi. (Available at
Lester, D. (2003) Using PVS to validate the inverse trigonometric functions of an exact arithmetic. In: Alt, R., Frommer, A., Kearfott, R. B. and Luther, W. (eds.) Numerical Software with Result Verification. Springer-Verlag Lecture Notes in Computer Science 2991259273.
Lester, D. and Gowland, P. (2002) Using PVS to validate the algorithms of an exact arithmetic. Theoretical Computer Science 291 (2)203218.
Moggi, E. (1991) Notions of computation and monads. Information and Computation 93 (1)5592.
Muñoz, C. and Lester, D. (2005) Real number calculations and theorem proving. In: Hurd, J. and Melham, T. (eds.) Proceedings of the 18th International Conference on Theorem Proving in Higher Order Logics, TPHOLs 2005. Springer-Verlag Lecture Notes in Computer Science 3603195210.
Niqui, M. and Wiedijk, F. (2005) The ‘many digits’ friendly competition 2005. (Details at
O'Connor, R. (2005) Few digits 0.4.0. (Available at
Odlyzko, A. M. and te Riele, H. J. J. (1985) Disproof of the Mertens conjecture. J. Reine Angew. Math. 357 138160.
Peyton Jones, S. (ed.) (2003) Haskell 98 Language and Libraries: The Revised Report, Cambridge University Press.
The Coq development team (2004) The Coq proof assistant reference manual, Version 8.0, LogiCal Project.
Wadler, P. (1992) Monads for functional programming. In: Proceedings of the Marktoberdorf Summer School on Program Design Calculi.

Related content

Powered by UNSILO

A monadic, functional implementation of real numbers



Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed.