A Coq Formalization of Lebesgue Integration of Nonnegative Functions

Integration, just as much as differentiation, is a fundamental calculus tool that is widely used in many scientific domains. Formalizing the mathematical concept of integration and the associated results in a formal proof assistant helps in providing the highest confidence on the correctness of numerical programs involving the use of integration, directly or indirectly. By its capability to extend the (Riemann) integral to a wide class of irregular functions, and to functions defined on more general spaces than the real line, the Lebesgue integral is perfectly suited for use in mathematical fields such as probability theory, numerical mathematics, and real analysis. In this article, we present the Coq formalization of σ-algebras, measures, simple functions, and integration of nonnegative measurable functions, up to the full formal proofs of the Beppo Levi (monotone convergence) theorem and Fatou’s lemma. More than a plain formalization of the known literature, we present several design choices made to balance the harmony between mathematical readability and usability of Coq theorems. These results are a first milestone toward the formalization of L spaces such as Banach spaces. Key-words: formal proof, Coq, measure theory, Lebesgue integration ∗ Université Paris-Saclay, CNRS, ENS Paris-Saclay, Inria, Laboratoire Méthodes Formelles, 91190, Gif-surYvette, France. sylvie.boldo@inria.fr † a. Inria, 2 rue Simone Iff, 75589 Paris, France. b. CERMICS, École des Ponts, 77455 Marne-la-Vallée, France. francois.clement@inria.fr ‡ Université Paris-Saclay, CNRS, ENS Paris-Saclay, Inria, Laboratoire Méthodes Formelles, 91190, Gif-surYvette, France. F.Faissole@fr.merce.mee.com § LMAC (Laboratory of Applied Mathematics of Compiègne), CS 60319, Université de technologie de Compiègne, 60203 Compiègne Cedex, France. vincent.martin@utc.fr ¶ LIPN, CNRS UMR 7030, Université Paris 13, 93430 Villetaneuse, France. mayero@lipn.univ-paris13.fr Une formalisation en Coq de l’intégrale de Lebesgue des fonctions positives Résumé : Le calcul intégral, tout comme le calcul différentiel, est un outil fondamental utilisé largement dans de nombreux domaines scientifiques. La formalisation de la notion mathématique d’intégrale et de ses propriétés dans un assistant de preuve aide à donner la plus grande confiance sur la correction de programmes numériques utilisant l’intégration, directement ou indirectement. De part sa capacité à étendre l’intégrale (de Riemann) à une large classe de fonctions irrégulières, et à des fonctions définies sur des espaces plus généraux que la droite réelle, l’intégrale de Lebesgue est considérée comme parfaitement adaptée aux domaines mathématiques tels que la théorie des probabilités, les mathématiques numériques et l’analyse réelle. Dans cet article, nous présentons la formalisation en Coq des tribus (ou σ-algèbres), des mesures, des fonctions étagées et de l’intégrale des fonctions mesurables positives, jusqu’aux preuves formelles complètes du théorème de convergence monotone de Beppo Levi et du lemme de Fatou. Plus qu’une simple formalisation de la littérature connue, nous présentons plusieurs choix de design menés pour équilibrer l’harmonie entre la lisibilité mathématique et l’ergonomie des théorèmes Coq. Ces résultats sont un premier jalon vers la formalisation des espaces L comme espaces de Banach. Mots-clés : preuve formelle, Coq, théorie de la mesure, intégrale de Lebesgue A Coq Formalization of Lebesgue Integration of Nonnegative Functions 3

[1]  Feller William,et al.  An Introduction To Probability Theory And Its Applications , 1950 .

[2]  Gerald B. Folland,et al.  Real Analysis: Modern Techniques and Their Applications , 1984 .

[3]  F. Tulone,et al.  Dual of the Class of HKr Integrable Functions , 2019 .

[4]  Micaela Mayero,et al.  Formalisation et automatisation de preuves en analyses réelle et numérique , 2001 .

[5]  Guillaume Melquiond,et al.  Flocq: A Unified Library for Proving Floating-Point Algorithms in Coq , 2011, 2011 IEEE 20th Symposium on Computer Arithmetic.

[6]  G. Burton Sobolev Spaces , 2013 .

[7]  O. C. Zienkiewicz,et al.  The Finite Element Method: Its Basis and Fundamentals , 2005 .

[8]  Bas Spitters,et al.  The Picard Algorithm for Ordinary Differential Equations in Coq , 2013, ITP.

[9]  Fabian Immler,et al.  The Flow of ODEs , 2016, ITP.

[10]  Guillaume Melquiond,et al.  Trusting computations: A mechanized proof from partial differential equations to actual program , 2012, Comput. Math. Appl..

[11]  Rick Durrett Probability , 2019 .

[12]  T. P. Srinivasan,et al.  ON THE BOCHNER INTEGRAL , 1973 .

[13]  N. Bourbaki,et al.  Elements de mathematique. Livre III. Topologie Generale , 1962, The Mathematical Gazette.

[14]  Yi Wang,et al.  Formalization of continuous Fourier transform in verifying applications for dependable cyber-physical systems , 2020, J. Syst. Archit..

[15]  Fabian Immler,et al.  Formally Verified Computation of Enclosures of Solutions of Ordinary Differential Equations , 2014, NASA Formal Methods.

[16]  Guillaume Melquiond,et al.  Journal of Automated Reasoning manuscript No. (will be inserted by the editor) Wave Equation Numerical Resolution: a Comprehensive Mechanized Proof of a C Program , 2022 .

[17]  Yasunari Shidama,et al.  Fatou's Lemma and the Lebesgue's Convergence Theorem , 2008, Formaliz. Math..

[18]  Jean-Baptiste Jeannin,et al.  A formal proof of the Lax equivalence theorem for finite difference schemes , 2021, NFM.

[19]  Ioana Pasca,et al.  Canonical Big Operators , 2008, TPHOLs.

[20]  Y. Shidama,et al.  Lebesgue Integral of Simple Valued Function , 2007 .

[21]  Noboru Endou Fubini’s Theorem , 2019, Formaliz. Math..

[22]  A. Weil,et al.  Sur les espaces à structure uniforme et sur la topologie générale , 1939 .

[23]  Guillaume Melquiond,et al.  Coquelicot: A User-Friendly Library of Real Analysis for Coq , 2015, Math. Comput. Sci..

[24]  Lawrence C. Paulson,et al.  An Isabelle/HOL Formalisation of Green’s Theorem , 2016, Journal of Automated Reasoning.

[25]  Sören Bartels,et al.  Numerical Approximation of Partial Differential Equations , 2016 .

[27]  Jeremy Avigad,et al.  The Lean Theorem Prover (System Description) , 2015, CADE.

[28]  Franccois Cl'ement,et al.  Lebesgue integration. Detailed proofs to be formalized in Coq , 2021, ArXiv.

[29]  Guillaume Melquiond,et al.  Formalization of real analysis: a survey of proof assistants and libraries † , 2015, Mathematical Structures in Computer Science.

[30]  J. Guermond,et al.  Theory and practice of finite elements , 2004 .

[31]  W. W. Zachary,et al.  Functional Analysis and the Feynman Operator Calculus , 2016 .

[32]  Lawrence Charles Paulson,et al.  Isabelle/HOL: A Proof Assistant for Higher-Order Logic , 2002 .

[33]  Johannes Hölzl,et al.  Numerical Analysis of Ordinary Differential Equations in Isabelle/HOL , 2012, ITP.

[34]  Alexandre B. Tsybakov,et al.  Introduction to Nonparametric Estimation , 2008, Springer series in statistics.

[35]  Catherine Lelay How to express convergence for analysis in Coq , 2015 .

[36]  R. Cooke Real and Complex Analysis , 2011 .

[37]  Johannes Hölzl,et al.  Three Chapters of Measure Theory in Isabelle/HOL , 2011, ITP.

[38]  Constantin Carathéodory,et al.  Algebraic Theory of Measure and Integration , 1986 .

[39]  Nicolas Bourbaki,et al.  Elements de Mathematiques , 1954, The Mathematical Gazette.

[40]  H. Lebesgue,et al.  Leçons sur l'intégration et la recherche des fonctions primitives professées au Collège de France , 2009 .

[41]  Natarajan Shankar,et al.  PVS: A Prototype Verification System , 1992, CADE.

[42]  Philippe G. Ciarlet,et al.  The finite element method for elliptic problems , 2002, Classics in applied mathematics.

[43]  Robert G. Bartle,et al.  A modern theory of integration , 2001 .

[44]  Aad van der Vaart,et al.  Fundamentals of Nonparametric Bayesian Inference , 2017 .

[45]  The mathlib Community The lean mathematical library , 2020, CPP.

[46]  Tobias Nipkow,et al.  Isabelle/HOL , 2002, Lecture Notes in Computer Science.

[47]  Florian Faissole Formalization and Closedness of Finite Dimensional Subspaces , 2017, 2017 19th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing (SYNASC).

[48]  L. Schwartz Théorie des distributions , 1966 .

[49]  H. Brezis Analyse fonctionnelle : théorie et applications , 1983 .

[50]  J. Dieudonné,et al.  Éléments d'analyse , 1972 .

[51]  Hyunjoong Kim,et al.  Functional Analysis I , 2017 .

[52]  W. B. The Theory of Integration , 1928, Nature.

[53]  Catherine Lelay Repenser la bibliothèque réelle de Coq : vers une formalisation de l'analyse classique mieux adaptée. (Reinventing Coq's Reals library : toward a more suitable formalization of classical analysis) , 2015 .

[54]  A. Quarteroni,et al.  Numerical Approximation of Partial Differential Equations , 2008 .

[55]  S. Bochner,et al.  Integration von Funktionen, deren Werte die Elemente eines Vektorraumes sind , 1933 .

[56]  Vincent Martin,et al.  A Coq formal proof of the Lax-Milgram theorem , 2017, CPP.

[57]  E. Bishop Foundations of Constructive Analysis , 2012 .

[58]  MESURE, INTEGRATION, PROBABILITES , 2013 .

[59]  J. K. Hunter,et al.  Measure Theory , 2007 .

[60]  Sofiène Tahar,et al.  On the Formalization of the Lebesgue Integration Theory in HOL , 2010, ITP.

[61]  J. Kurzweil Generalized ordinary differential equations and continuous dependence on a parameter , 1957 .

[62]  P. J. Daniell A General Form of Integral , 1918 .

[63]  F. Burk A Garden of Integrals , 2007 .