A Coq Formalization of Lebesgue Integration of Nonnegative Functions - - PowerPoint PPT Presentation

a coq formalization of lebesgue integration of
SMART_READER_LITE
LIVE PREVIEW

A Coq Formalization of Lebesgue Integration of Nonnegative Functions - - PowerPoint PPT Presentation

Formal Methods in Mathematics Carnegie Mellon University A Coq Formalization of Lebesgue Integration of Nonnegative Functions Sylvie Boldo Inria, Universit e Paris-Saclay January 7th, 2020 Disclaimers Disclaimer 1: this is joint work with


slide-1
SLIDE 1

Formal Methods in Mathematics Carnegie Mellon University

A Coq Formalization of Lebesgue Integration of Nonnegative Functions

Sylvie Boldo

Inria, Universit´ e Paris-Saclay

January 7th, 2020

slide-2
SLIDE 2

Disclaimers

Disclaimer 1: this is joint work with Fran¸ cois Cl´ ement, Florian Faissole, Vincent Martin, Micaela Mayero.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 2 / 39

slide-3
SLIDE 3

Disclaimers

Disclaimer 1: this is joint work with Fran¸ cois Cl´ ement, Florian Faissole, Vincent Martin, Micaela Mayero. Disclaimer 2: This formalization of mathematics is done in Coq.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 2 / 39

slide-4
SLIDE 4

Disclaimers

Disclaimer 1: this is joint work with Fran¸ cois Cl´ ement, Florian Faissole, Vincent Martin, Micaela Mayero. Disclaimer 2: This formalization of mathematics is done in Coq. Disclaimer 3: There is (nearly) no computer arithmetic!

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 2 / 39

slide-5
SLIDE 5

Outline

1

Introduction

2

Towards the Finite Element Method

3

Lebesgue Integration Measurability Measure Simple Functions and their Integral Lebesgue Integral of Nonnegative Functions

4

Conclusion and Perspectives

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 3 / 39

slide-6
SLIDE 6

Introduction

▼❛t❤❡♠❛t✐❝s

R,

  • , ∂2u

∂t2

theorems

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 4 / 39

slide-7
SLIDE 7

Introduction

▼❛t❤❡♠❛t✐❝s

R,

  • , ∂2u

∂t2

theorems

Applied Mathematics

numerical scheme, convergence algorithms + theorems

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 4 / 39

slide-8
SLIDE 8

Introduction

▼❛t❤❡♠❛t✐❝s

R,

  • , ∂2u

∂t2

theorems

Applied Mathematics

numerical scheme, convergence algorithms + theorems

Computer

floating-point numbers, implementation programs + ?

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 4 / 39

slide-9
SLIDE 9

Introduction

▼❛t❤❡♠❛t✐❝s

R,

  • , ∂2u

∂t2

theorems

Applied Mathematics

numerical scheme, convergence algorithms + theorems

Computer

floating-point numbers, implementation programs + ?

PARANOIA

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 4 / 39

slide-10
SLIDE 10

Motivations

PDE (Partial Differential Equation) ⇒ weather forecast ⇒ nuclear simulation ⇒

  • ptimal control

⇒ . . .

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 5 / 39

slide-11
SLIDE 11

Motivations

PDE (Partial Differential Equation) ⇒ weather forecast ⇒ nuclear simulation ⇒

  • ptimal control

⇒ . . . Usually too complex to solve by an exact mathematical formula ⇒ approximated by numerical scheme over discrete grids/volumes ⇒ mathematical proofs of the convergence of the numerical scheme (we compute something close to the PDE solution if the size decreases)

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 5 / 39

slide-12
SLIDE 12

Motivations

PDE (Partial Differential Equation) ⇒ weather forecast ⇒ nuclear simulation ⇒

  • ptimal control

⇒ . . . Usually too complex to solve by an exact mathematical formula ⇒ approximated by numerical scheme over discrete grids/volumes ⇒ mathematical proofs of the convergence of the numerical scheme (we compute something close to the PDE solution if the size decreases) ⇒ real program implementing the scheme/method

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 5 / 39

slide-13
SLIDE 13

Motivations

PDE (Partial Differential Equation) ⇒ weather forecast ⇒ nuclear simulation ⇒

  • ptimal control

⇒ . . . Usually too complex to solve by an exact mathematical formula ⇒ approximated by numerical scheme over discrete grids/volumes ⇒ mathematical proofs of the convergence of the numerical scheme (we compute something close to the PDE solution if the size decreases) ⇒ real program implementing the scheme/method Let us machine-check this kind of programs!

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 5 / 39

slide-14
SLIDE 14

Outline

1

Introduction

2

Towards the Finite Element Method

3

Lebesgue Integration Measurability Measure Simple Functions and their Integral Lebesgue Integral of Nonnegative Functions

4

Conclusion and Perspectives

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 6 / 39

slide-15
SLIDE 15

Motivations

http://www.ima.umn.edu/~arnold/disasters/sleipner.html

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 7 / 39

slide-16
SLIDE 16

Motivations

Real life applications need solving PDE (Partial Differential Equation) on complex 3D geometries.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 8 / 39

slide-17
SLIDE 17

Motivations

Real life applications need solving PDE (Partial Differential Equation) on complex 3D geometries.

@ V. Martin

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 8 / 39

slide-18
SLIDE 18

Motivations

Real life applications need solving PDE (Partial Differential Equation) on complex 3D geometries.

@ V. Martin

Instead of regular 2D/3D grids, we consider meshes made of triangles/tetrahedra.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 8 / 39

slide-19
SLIDE 19

Motivations

The Finite Element Method (FEM) is the most used method to solve PDEs over meshes. FEM encompasses methods for connecting many simple element equations over many small subdomains, named finite elements, to approximate a more complex equation over a larger domain. (https://en.wikipedia.org/wiki/Finite_element_method)

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 9 / 39

slide-20
SLIDE 20

Motivations

The Finite Element Method (FEM) is the most used method to solve PDEs over meshes. FEM encompasses methods for connecting many simple element equations over many small subdomains, named finite elements, to approximate a more complex equation over a larger domain. (https://en.wikipedia.org/wiki/Finite_element_method) ⇒ mathematical proofs of the FEM ⇒ C++ library (Felisce) implementing the FEM

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 9 / 39

slide-21
SLIDE 21

Motivations

The Finite Element Method (FEM) is the most used method to solve PDEs over meshes. FEM encompasses methods for connecting many simple element equations over many small subdomains, named finite elements, to approximate a more complex equation over a larger domain. (https://en.wikipedia.org/wiki/Finite_element_method) ⇒ mathematical proofs of the FEM ⇒ C++ library (Felisce) implementing the FEM Let us machine-check this program!

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 9 / 39

slide-22
SLIDE 22

Motivations

The Finite Element Method (FEM) is the most used method to solve PDEs over meshes. FEM encompasses methods for connecting many simple element equations over many small subdomains, named finite elements, to approximate a more complex equation over a larger domain. (https://en.wikipedia.org/wiki/Finite_element_method) ⇒ mathematical proofs of the FEM ⇒ C++ library (Felisce) implementing the FEM Let us machine-check this program! First, let us understand/formally prove the mathematics.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 9 / 39

slide-23
SLIDE 23

Mathematicians at work for Lax-Milgram theorem

more 50 pages of mathematical proofs

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 10 / 39

slide-24
SLIDE 24

Mathematicians at work for Lax-Milgram theorem

more 50 pages of mathematical proofs very detailed!

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 10 / 39

slide-25
SLIDE 25

Mathematicians at work for Lax-Milgram theorem

more 50 pages of mathematical proofs very detailed! more than 7,000 lines and 220,000 characters

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 10 / 39

slide-26
SLIDE 26

Mathematicians at work for Lax-Milgram theorem

more 50 pages of mathematical proofs very detailed! more than 7,000 lines and 220,000 characters with dependencies!

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 10 / 39

slide-27
SLIDE 27

Mathematicians at work for Lax-Milgram theorem

more 50 pages of mathematical proofs very detailed! more than 7,000 lines and 220,000 characters with dependencies!

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 10 / 39

slide-28
SLIDE 28

Mathematicians at work for Lax-Milgram theorem

more 50 pages of mathematical proofs very detailed! more than 7,000 lines and 220,000 characters with dependencies!

4 1 6 2 5 8 7 9 10 3 11 13 12 16 14 22 20 21 23 26 25 27 18 24 28 29 31 30 33 32 34 37 35 36 42 41 44 38 39 40 45 46 48 47 49 50 51 43 60 52 61 64 62 65 67 66 68 69 71 70 73 76 75 77 79 78 81 53 80 82 54 83 84 55 86 85 87 57 90 89 91 95 93 94 96 97 98 63 100 15 99 101 102 103 74 105 104 107 19 106 108 109 110 111 112 114 113 115 116 118 117 119 123 120 121 122 125 124 126 127 128 129 130 131 132 135 134 137 92 136 139 56 58 59 138 141 140 144 142 143 145 146 147 148 149 151 150 152 153 154 156 155 157 158 159 160 161 163 162 164 165 166 72 167 168 169 88 133 171 170 172 173 174 175

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 10 / 39

slide-29
SLIDE 29

Proof engineering

Let us build upon the Coquelicot library (Boldo, Lelay, Melquiond) + general spaces

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 11 / 39

slide-30
SLIDE 30

Proof engineering

Let us build upon the Coquelicot library (Boldo, Lelay, Melquiond) + general spaces + many existing theorems

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 11 / 39

slide-31
SLIDE 31

Proof engineering

Let us build upon the Coquelicot library (Boldo, Lelay, Melquiond) + general spaces + many existing theorems

  • not always the space we need

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 11 / 39

slide-32
SLIDE 32

Enriched Hierarchy

AbelianGroup (0, +, −)

sum n m

− →: “used to define” : “parameter of” − →: “is proved to be a” Ring (1, ×)

pow n

Mn(C) ModuleSpace (·) Mn,m(C) AbsRing (|

|)

R, C NormedModule (

) ,

  • , f ′

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 12 / 39

slide-33
SLIDE 33

Enriched Hierarchy

AbelianGroup (0, +, −)

sum n m

− →: “used to define” : “parameter of” − →: “is proved to be a” Ring (1, ×)

pow n

Mn(C) ModuleSpace (·) Mn,m(C) AbsRing (|

|)

R, C NormedModule (

) ,

  • , f ′

UniformSpace (ball)

locally

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 12 / 39

slide-34
SLIDE 34

Enriched Hierarchy

AbelianGroup (0, +, −)

sum n m

− →: “used to define” : “parameter of” − →: “is proved to be a” Ring (1, ×)

pow n

Mn(C) ModuleSpace (·) Mn,m(C) AbsRing (|

|)

R, C NormedModule (

) ,

  • , f ′

UniformSpace (ball)

locally

CompleteSpace (lim) Cauchy R → C

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 12 / 39

slide-35
SLIDE 35

Enriched Hierarchy

AbelianGroup (0, +, −)

sum n m

− →: “used to define” : “parameter of” − →: “is proved to be a” Ring (1, ×)

pow n

Mn(C) ModuleSpace (·) Mn,m(C) AbsRing (|

|)

R, C NormedModule (

) ,

  • , f ′

UniformSpace (ball)

locally

CompleteNormedModule

  • lim = lim
  • R, R2, C

CompleteSpace (lim) Cauchy R → C

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 12 / 39

slide-36
SLIDE 36

Enriched Hierarchy

AbelianGroup (0, +, −)

sum n m

− →: “used to define” : “parameter of” − →: “is proved to be a” Ring (1, ×)

pow n

Mn(C) ModuleSpace (·) Mn,m(C) PreHilbert (inner)

norm

AbsRing (|

|)

R, C NormedModule (

) ,

  • , f ′

UniformSpace (ball)

locally

CompleteNormedModule

  • lim = lim
  • R, R2, C

CompleteSpace (lim) Cauchy R → C

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 12 / 39

slide-37
SLIDE 37

Enriched Hierarchy

AbelianGroup (0, +, −)

sum n m

− →: “used to define” : “parameter of” − →: “is proved to be a” Ring (1, ×)

pow n

Mn(C) ModuleSpace (·) Mn,m(C) PreHilbert (inner)

norm

AbsRing (|

|)

R, C NormedModule (

) ,

  • , f ′

UniformSpace (ball)

locally

CompleteNormedModule

  • lim = lim
  • R, R2, C

CompleteSpace (lim) Cauchy R → C Hilbert (lim)

Cauchy

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 12 / 39

slide-38
SLIDE 38

Summary of the work done

results about functional spaces, linear and bilinear mappings

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-39
SLIDE 39

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-40
SLIDE 40

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module decide if a space (≥ NormedModule) is only zero

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-41
SLIDE 41

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module decide if a space (≥ NormedModule) is only zero norm on functions (operator norm) on R ∪ {+∞}

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-42
SLIDE 42

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module decide if a space (≥ NormedModule) is only zero norm on functions (operator norm) on R ∪ {+∞} 8 equivalences of continuity of linear mappings

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-43
SLIDE 43

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module decide if a space (≥ NormedModule) is only zero norm on functions (operator norm) on R ∪ {+∞} 8 equivalences of continuity of linear mappings definitions of pre-Hilbert and Hilbert spaces in Coquelicot hierarchy

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-44
SLIDE 44

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module decide if a space (≥ NormedModule) is only zero norm on functions (operator norm) on R ∪ {+∞} 8 equivalences of continuity of linear mappings definitions of pre-Hilbert and Hilbert spaces in Coquelicot hierarchy define clm: the set of the continuous linear mappings

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-45
SLIDE 45

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module decide if a space (≥ NormedModule) is only zero norm on functions (operator norm) on R ∪ {+∞} 8 equivalences of continuity of linear mappings definitions of pre-Hilbert and Hilbert spaces in Coquelicot hierarchy define clm: the set of the continuous linear mappings prove it is a NormedModule, to consider clm E (clm E R)

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-46
SLIDE 46

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module decide if a space (≥ NormedModule) is only zero norm on functions (operator norm) on R ∪ {+∞} 8 equivalences of continuity of linear mappings definitions of pre-Hilbert and Hilbert spaces in Coquelicot hierarchy define clm: the set of the continuous linear mappings prove it is a NormedModule, to consider clm E (clm E R) prove Lax-Milgram theorem and C´ ea’s lemma

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-47
SLIDE 47

Summary of the work done

results about functional spaces, linear and bilinear mappings fixed-point theorem in a sub-complete normed module decide if a space (≥ NormedModule) is only zero norm on functions (operator norm) on R ∪ {+∞} 8 equivalences of continuity of linear mappings definitions of pre-Hilbert and Hilbert spaces in Coquelicot hierarchy define clm: the set of the continuous linear mappings prove it is a NormedModule, to consider clm E (clm E R) prove Lax-Milgram theorem and C´ ea’s lemma for a total of about 10k lines of Coq and 430 lemmas/definitions

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 13 / 39

slide-48
SLIDE 48

Lax-Milgram Theorem and C´ ea’s Lemma

Theorem (Lax-Milgram)

Let E : Hilbert, f ∈ E ′, C, α ∈ R∗

+. Let ϕ : E → Prop, ϕ

ModuleSpace-compatible and complete. Let a be a bilinear form of E bounded by C and α-coercive. Then: ∃!u ∈ E, ϕ(u) ∧ ∀v ∈ E, ϕ(v) = ⇒ f (v) = a(u, v) ∧ uE ≤ 1 α|||f |||ϕ.

Lemma (C´ ea)

Let E : Hilbert, f ∈ E ′, 0 < α. Let ϕ : E → Prop, ϕ ModuleSpace-compatible and complete. Let a be a bilinear form of E, bounded by C > 0 and α-coercive. Let u and uϕ be the solutions given by Lax–Milgram Theorem respectively on E and on the subspace ϕ. Then: ∀vϕ ∈ E, ϕ(vϕ) = ⇒ u − uϕE ≤ C α u − vϕE .

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 14 / 39

slide-49
SLIDE 49

Where are we?

Towards the Coq formalization of the finite element method: Lax-Milgram theorem ()

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 15 / 39

slide-50
SLIDE 50

Where are we?

Towards the Coq formalization of the finite element method: Lax-Milgram theorem () requires the subspace to be complete ( for finite-dimensional subspaces)

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 15 / 39

slide-51
SLIDE 51

Where are we?

Towards the Coq formalization of the finite element method: Lax-Milgram theorem () requires the subspace to be complete ( for finite-dimensional subspaces) requires E to be a Hilbert space

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 15 / 39

slide-52
SLIDE 52

Where are we?

Towards the Coq formalization of the finite element method: Lax-Milgram theorem () requires the subspace to be complete ( for finite-dimensional subspaces) requires E to be a Hilbert space E will be instantiated as the Sobolev space L2

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 15 / 39

slide-53
SLIDE 53

Where are we?

Towards the Coq formalization of the finite element method: Lax-Milgram theorem () requires the subspace to be complete ( for finite-dimensional subspaces) requires E to be a Hilbert space E will be instantiated as the Sobolev space L2 ⇒ prove that L2 is an Hilbert space

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 15 / 39

slide-54
SLIDE 54

Where are we?

Towards the Coq formalization of the finite element method: Lax-Milgram theorem () requires the subspace to be complete ( for finite-dimensional subspaces) requires E to be a Hilbert space E will be instantiated as the Sobolev space L2 ⇒ prove that L2 is an Hilbert space ⇒ Lebesgue integration!

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 15 / 39

slide-55
SLIDE 55

Where are we?

Towards the Coq formalization of the finite element method: Lax-Milgram theorem () requires the subspace to be complete ( for finite-dimensional subspaces) requires E to be a Hilbert space E will be instantiated as the Sobolev space L2 ⇒ prove that L2 is an Hilbert space ⇒ Lebesgue integration! . . .

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 15 / 39

slide-56
SLIDE 56

Outline

1

Introduction

2

Towards the Finite Element Method

3

Lebesgue Integration Measurability Measure Simple Functions and their Integral Lebesgue Integral of Nonnegative Functions

4

Conclusion and Perspectives

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 16 / 39

slide-57
SLIDE 57

Outline

1

Introduction

2

Towards the Finite Element Method

3

Lebesgue Integration Measurability Measure Simple Functions and their Integral Lebesgue Integral of Nonnegative Functions

4

Conclusion and Perspectives

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 17 / 39

slide-58
SLIDE 58

Measurability

Given a set E→ Prop, is it measurable?

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 18 / 39

slide-59
SLIDE 59

Measurability

Given a set E→ Prop, is it measurable? We chose the definition from the generator sets:

Context {E : Type}. (* initialization sets *) Variable gen : (E → Prop) → Prop. Inductive measurable : (E→ Prop) → Prop := | measurable_gen : forall omega, gen omega → measurable omega | measurable_empty : measurable (fun _ ⇒ False) | measurable_compl : forall omega, measurable (fun x ⇒ not (omega x)) → measurable omega | measurable_union_countable : forall omega:nat → (E→ Prop), (forall n, measurable (omega n)) → measurable (fun x ⇒ exists n, omega n x).

The measurable sets are aka σ-algebras.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 18 / 39

slide-60
SLIDE 60

Measurability

Advantages of Inductive: ⇒ induction is possible ⇒ easy theorems

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 19 / 39

slide-61
SLIDE 61

Measurability

Advantages of Inductive: ⇒ induction is possible ⇒ easy theorems We defined generators on R and R:

Definition gen_R_cc := (fun om ⇒ exists a b, (forall x, om x ↔ a <= x <= b)). Definition gen_Rbar_mc := (fun om ⇒ exists a, (forall x, om x ↔ Rbar_le a x)).

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 19 / 39

slide-62
SLIDE 62

Measurability

Advantages of Inductive: ⇒ induction is possible ⇒ easy theorems We defined generators on R and R:

Definition gen_R_cc := (fun om ⇒ exists a b, (forall x, om x ↔ a <= x <= b)). Definition gen_Rbar_mc := (fun om ⇒ exists a, (forall x, om x ↔ Rbar_le a x)).

But we may use other generators and prove the measurable sets are the

  • same. For instance a < x < b or with a and b in Q.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 19 / 39

slide-63
SLIDE 63

Measurability

Advantages of Inductive: ⇒ induction is possible ⇒ easy theorems We defined generators on R and R:

Definition gen_R_cc := (fun om ⇒ exists a b, (forall x, om x ↔ a <= x <= b)). Definition gen_Rbar_mc := (fun om ⇒ exists a, (forall x, om x ↔ Rbar_le a x)).

But we may use other generators and prove the measurable sets are the

  • same. For instance a < x < b or with a and b in Q.

And we proved that it is equivalent to the usual Borel σ-algebras:

Lemma measurable_R_open : forall om, measurable gen_R_cc om ↔ measurable open om.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 19 / 39

slide-64
SLIDE 64

Measurable functions

A function f : E → F is measurable if the set A(f (x)) is measurable in F for all measurable sets A in E:

Definition measurable_fun : (E → F) → Prop := fun f ⇒ (forall (A: F → Prop), measurable genF A → measurable genE (fun x ⇒ A (f x))).

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 20 / 39

slide-65
SLIDE 65

Measurable functions

A function f : E → F is measurable if the set A(f (x)) is measurable in F for all measurable sets A in E:

Definition measurable_fun : (E → F) → Prop := fun f ⇒ (forall (A: F → Prop), measurable genF A → measurable genE (fun x ⇒ A (f x))).

The sum and multiplication by a scalar of measurable functions on R and R are measurable functions.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 20 / 39

slide-66
SLIDE 66

Measurable functions

A function f : E → F is measurable if the set A(f (x)) is measurable in F for all measurable sets A in E:

Definition measurable_fun : (E → F) → Prop := fun f ⇒ (forall (A: F → Prop), measurable genF A → measurable genE (fun x ⇒ A (f x))).

The sum and multiplication by a scalar of measurable functions on R and R are measurable functions. When considering the restriction of f on the subset A.

Lemma measurable_fun_when_charac : forall (f f’: E→ Rbar) (A : E→ Prop), measurable gen A → (forall x, A x → f x = f’ x) → measurable_fun_Rbar f’ → measurable_fun_Rbar (fun x ⇒ Rbar_mult (f x) (charac A x)).

with charac A the characteristic function 1A.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 20 / 39

slide-67
SLIDE 67

Outline

1

Introduction

2

Towards the Finite Element Method

3

Lebesgue Integration Measurability Measure Simple Functions and their Integral Lebesgue Integral of Nonnegative Functions

4

Conclusion and Perspectives

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 21 / 39

slide-68
SLIDE 68

Measure definition

We choose to not (yet) define the Lebesgue measure, but define what a measure is supposed to satisfy:

Context {E : Type}. Variable gen : (E → Prop) → Prop. Record measure := mk_measure { meas :> (E→ Prop) → Rbar ; meas_False : meas (fun _ ⇒ False) = 0 ; meas_ge_0: forall om, Rbar_le 0 (meas om) ; meas_sigma_additivity : forall omega :nat → (E→ Prop), (forall n, measurable gen (omega n)) → (forall n m x, omega n x → omega m x → n = m) → meas (fun x ⇒ exists n, omega n x) = Sup_seq (fun n ⇒ sum_Rbar n (fun m ⇒ meas (omega m))) }.

Note that we have at least a measure: the Dirac measure.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 22 / 39

slide-69
SLIDE 69

Measure properties

Many properties hold for all measures such as:

Lemma measure_Boole_ineq : forall (mu:measure) (A:nat → E→ Prop) (N : nat), (forall n, n <= N → measurable gen (A n)) → Rbar_le (mu (fun x ⇒ exists n, n <= N ∧ A n x)) (sum_Rbar N (fun m ⇒ mu (A m))).

µ  

i∈[0..N]

Ai   ≤

  • i∈[0..N]

µ(Ai)

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 23 / 39

slide-70
SLIDE 70

Outline

1

Introduction

2

Towards the Finite Element Method

3

Lebesgue Integration Measurability Measure Simple Functions and their Integral Lebesgue Integral of Nonnegative Functions

4

Conclusion and Perspectives

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 24 / 39

slide-71
SLIDE 71

Simple functions?

Examples of simple functions @ mathonline f =

  • y∈f (E)

1f −1({y})

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 25 / 39

slide-72
SLIDE 72

Simple functions?

Examples of simple functions @ mathonline f =

  • y∈f (E)

1f −1({y}) We have tried various definitions of simple functions, especially as we prefer to sum over a finite set of values.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 25 / 39

slide-73
SLIDE 73

Simple functions definition

Definition finite_vals : (E→ R) → (list R) → Prop := fun f l ⇒ forall y, In (f y) l.

⇒ OK, but not unique.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 26 / 39

slide-74
SLIDE 74

Simple functions definition

Definition finite_vals : (E→ R) → (list R) → Prop := fun f l ⇒ forall y, In (f y) l.

⇒ OK, but not unique.

Definition finite_vals_canonic : (E→ R) → (list R) → Prop := fun f l ⇒ (LocallySorted Rlt l) ∧ (forall x, In x l → exists y, f y = x) ∧ (forall y, In (f y) l).

⇒ unique! We were able to construct the second list from the first.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 26 / 39

slide-75
SLIDE 75

Simple functions integration

  • f dµ def.

=

  • a∈f (X)

a µ

  • f −1(a)
  • ∈ R

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 27 / 39

slide-76
SLIDE 76

Simple functions integration

  • f dµ def.

=

  • a∈f (X)

a µ

  • f −1(a)
  • ∈ R

Definition SF_aux : (E→ R) → (list R) → Prop := fun f l ⇒ finite_vals_canonic f l ∧ (forall a, measurable gen (fun x ⇒ f x = a)). Definition SF : (E→ R) → Set := fun f ⇒ { l | SF_aux f l}. Definition af1 (f:E→ R) := (fun a : Rbar ⇒ Rbar_mult a (mu (fun (x:E) ⇒ f x = a))). Definition LInt_simple_fun_p := fun (f:E→ R) (H:SF gen f) ⇒ let l:= (proj1_sig H) in sum_Rbar_map l (af1 f).

We proved the value does not depends on the proof H.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 27 / 39

slide-77
SLIDE 77

Simple functions integration

  • f dµ def.

=

  • a∈f (X)

a µ

  • f −1(a)
  • ∈ R

Definition SF_aux : (E→ R) → (list R) → Prop := fun f l ⇒ finite_vals_canonic f l ∧ (forall a, measurable gen (fun x ⇒ f x = a)). Definition SF : (E→ R) → Set := fun f ⇒ { l | SF_aux f l}. Definition af1 (f:E→ R) := (fun a : Rbar ⇒ Rbar_mult a (mu (fun (x:E) ⇒ f x = a))). Definition LInt_simple_fun_p := fun (f:E→ R) (H:SF gen f) ⇒ let l:= (proj1_sig H) in sum_Rbar_map l (af1 f).

We proved the value does not depends on the proof H. ⇒ theorems about sum, multiplication by a scalar and change of variable

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 27 / 39

slide-78
SLIDE 78

Outline

1

Introduction

2

Towards the Finite Element Method

3

Lebesgue Integration Measurability Measure Simple Functions and their Integral Lebesgue Integral of Nonnegative Functions

4

Conclusion and Perspectives

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 28 / 39

slide-79
SLIDE 79

Lebesgue integral

  • f dµ def.

= sup

ϕ∈SF+,ϕ≤f

  • ϕ dµ

∈ R

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 29 / 39

slide-80
SLIDE 80

Lebesgue integral

  • f dµ def.

= sup

ϕ∈SF+,ϕ≤f

  • ϕ dµ

∈ R

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 29 / 39

slide-81
SLIDE 81

Lebesgue integral

  • f dµ def.

= sup

ϕ∈SF+,ϕ≤f

  • ϕ dµ

∈ R Riemann integral vs Lebesgue integral

@ Serge Mehl chronomath.com

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 29 / 39

slide-82
SLIDE 82

Lebesgue integral definition

  • f dµ def.

= sup

ϕ∈SF+,ϕ≤f

  • ϕ dµ

∈ R

Definition LInt_p :(E→ Rbar) → Rbar := fun f ⇒ Rbar_lub (fun x ⇒ exists (g:E→ R), exists (Hg: SF gen g), non_neg g ∧ (forall (z:E), Rbar_le (g z) (f z)) ∧ LInt_simple_fun_p mu g Hg = x).

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 30 / 39

slide-83
SLIDE 83

Theorems (1/3)

Theorem (Beppo Levi, monotone convergence)

Let (fn)n∈N be a sequence of nonnegative measurable functions, that is pointwise nondecreasing. Then, the pointwise limit of (fn)n∈N is nonnegative and measurable, and we have in R

  • lim

n→∞ fn dµ = lim n→∞

  • fn dµ.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 31 / 39

slide-84
SLIDE 84

Theorems (2/3)

Theorem (Fatou–Lebesgue)

Let (fn)n∈N be a sequence of nonnegative measurable functions. Then, we have in R

  • lim inf

n→∞ fn dµ ≤ lim inf n→∞

  • fn dµ.

Theorem Fatou_Lebesgue : forall f: nat → E → Rbar, (forall n, non_neg (f n)) → (forall n, measurable_fun_Rbar gen (f n)) → Rbar_le (LInt_p mu (fun x ⇒ LimInf_seq’ (fun n ⇒ f n x))) (LimInf_seq’ (fun n ⇒ LInt_p mu (f n))).

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 32 / 39

slide-85
SLIDE 85

Theorems (3/3): focus on a hard one

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 33 / 39

slide-86
SLIDE 86

Theorems (3/3): focus on a hard one

  • (f + g) =
  • f +
  • g

Lemma LInt_p_plus : forall f g, non_neg f → non_neg g → measurable_fun_Rbar gen f → measurable_fun_Rbar gen g → LInt_p mu (fun x ⇒ Rbar_plus (f x) (g x)) = Rbar_plus (LInt_p mu f) (LInt_p mu g).

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 33 / 39

slide-87
SLIDE 87

Proof of

  • (f + g) =
  • f +
  • g (1/2)

It needs adapted sequences:

Definition is_adapted_seq (f:E→ Rbar) (phi:nat→ E→ R) := (forall n, non_neg (phi n)) ∧ (forall (x:E) n, phi n x <= phi (S n) x) ∧ (forall n, exists l, SF_aux gen (phi n) l) ∧ (forall (x:E), is_sup_seq (fun n ⇒ phi n x) (f x)).

as their limit gives the integral:

Lemma LInt_p_with_adapted_seq : forall f phi, is_adapted_seq f phi → is_sup_seq (fun n ⇒ LInt_p mu (phi n)) (LInt_p mu f).

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 34 / 39

slide-88
SLIDE 88

Proof of

  • (f + g) =
  • f +
  • g (2/2)

Adapted sequences may be defined like that: ∀x, fn(x) def. =    ⌊2nf (x)⌋ 2n when f (x) < n, n

  • therwise.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 35 / 39

slide-89
SLIDE 89

Proof of

  • (f + g) =
  • f +
  • g (2/2)

Adapted sequences may be defined like that: ∀x, fn(x) def. =    ⌊2nf (x)⌋ 2n when f (x) < n, n

  • therwise.

that may be written in Coq as:

Definition mk_adapted_seq (n:nat) (x:E) := match (Rbar_le_lt_dec (INR n) (f x)) with | left _ ⇒ INR n | right _ ⇒ round radix2 (FIX_exp (−n)) Zfloor (f x) end.

relying on fixed-point arithmetic defined by the Flocq library!! And then:

Lemma mk_adapted_seq_is_adapted_seq : is_adapted_seq f mk_adapted_seq.

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 35 / 39

slide-90
SLIDE 90

Outline

1

Introduction

2

Towards the Finite Element Method

3

Lebesgue Integration Measurability Measure Simple Functions and their Integral Lebesgue Integral of Nonnegative Functions

4

Conclusion and Perspectives

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 36 / 39

slide-91
SLIDE 91

Conclusion

For the Lebesgue integration: mathematicians at work: 184 pages and 600 lemmas/definitions formal proofs at work: 11 k lines lines and 635 lemmas/definitions

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 37 / 39

slide-92
SLIDE 92

Conclusion

For the Lebesgue integration: mathematicians at work: 184 pages and 600 lemmas/definitions formal proofs at work: 11 k lines lines and 635 lemmas/definitions Difficult parts: handling subspaces (mainly with 1 here) having usable simple functions

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 37 / 39

slide-93
SLIDE 93

Perspectives

extend to functions of varying sign

  • f =
  • max(0, f ) −
  • max(0, −f )

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 38 / 39

slide-94
SLIDE 94

Perspectives

extend to functions of varying sign

  • f =
  • max(0, f ) −
  • max(0, −f )

define the Lebesgue measure

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 38 / 39

slide-95
SLIDE 95

Perspectives

extend to functions of varying sign

  • f =
  • max(0, f ) −
  • max(0, −f )

define the Lebesgue measure merge/take advantage of mathcomp-analysis

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 38 / 39

slide-96
SLIDE 96

Perspectives

extend to functions of varying sign

  • f =
  • max(0, f ) −
  • max(0, −f )

define the Lebesgue measure merge/take advantage of mathcomp-analysis write the corresponding article

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 38 / 39

slide-97
SLIDE 97

Perspectives

extend to functions of varying sign

  • f =
  • max(0, f ) −
  • max(0, −f )

define the Lebesgue measure merge/take advantage of mathcomp-analysis write the corresponding article define L2 and prove it is a Hilbert

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 38 / 39

slide-98
SLIDE 98

Perspectives

extend to functions of varying sign

  • f =
  • max(0, f ) −
  • max(0, −f )

define the Lebesgue measure merge/take advantage of mathcomp-analysis write the corresponding article define L2 and prove it is a Hilbert define the FEM algorithm and prove it

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 38 / 39

slide-99
SLIDE 99

Perspectives

extend to functions of varying sign

  • f =
  • max(0, f ) −
  • max(0, −f )

define the Lebesgue measure merge/take advantage of mathcomp-analysis write the corresponding article define L2 and prove it is a Hilbert define the FEM algorithm and prove it prove a real implementation (in floating-point arithmetic)

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 38 / 39

slide-100
SLIDE 100

Thank you for your attention

Sylvie Boldo (Inria) Lebesgue Integration January 7th, 2020 39 / 39