Towards numerical integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Towards numerical integration in Coq Faster real computation Numerical integration Picard method Bas Spitters (jww Eelis van der Weegen) Radboud University Nijmegen November 10, 2010
Towards numerical Context integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real computation Numerical integration Gap between theory and implementation of numerics. Picard method The interval community started to narrow this gap. Mathematically correct, but not formally provably so. Are open to help from formal mathematics.
Towards numerical Context integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real computation Numerical integration Gap between theory and implementation of numerics. Picard method The interval community started to narrow this gap. Mathematically correct, but not formally provably so. Are open to help from formal mathematics. We need computations in formal proofs.
Towards numerical integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real computation Numerical integration Picard method
Towards numerical Kantorovich integration in Coq The Newton-Kantorivich theorem gives sufficient conditions Bas Spitters (jww Eelis van der for the convergence of Newton ’s method. Weegen) Theorem: Let X and Y be Banach spaces and Integration F : D ⊂ X → Y . Suppose that on an open convex set Experiment building a library D 0 ⊂ D , F is Frechet differentiable and Faster real computation Numerical integration || F ′ ( x ) − F ′ ( y ) || ≤ K || x − y || , x , y ∈ D 0 . Picard method For some x 0 ∈ D 0 , assume that Γ 0 = [ F ′ ( x 0 )] − 1 is defined on all of Y and that h := β K η ≤ 1 2 where || Γ 0 || ≤ β and || Γ 0 Fx 0 || ≤ η . Set √ √ 1 1 t ∗ = t ∗∗ = β K (1 − 1 − 2 h ) , β K (1 + 1 − 2 h ) and suppose that S := { x | || x − x 0 || ≤ t ∗ } ⊂ D 0 . Then the Newton iterates x k +1 := x k − [ F ′ ( x k )] − 1 Fx k , k = 0 , 1 , . . . , are well defined, lie in S and converge to a solution x ∗ of Fx = 0 which is unique in D 0 ∩ { x | || x 0 − x || < t ∗∗ } . Moreover, if h < 1 2 the order of convergence is quadratic.
Towards numerical Methodology integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real computation Bishop: use contructive analysis as a programming language Numerical integration Picard method for numerical analysis Martin-L¨ of: type theory as a language for constructive mathematics Verified exact numerical analysis running inside Coq Clean implementation first, speed up later
Towards numerical Overview integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real computation Numerical integration ◮ Experiment building a library using type classes Picard method ◮ Faster real computation ◮ Numerical integration ◮ Picard method
Towards numerical Experiment building a library integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Request for input Faster real computation Numerical integration Three libraries: stdlib, corn, ssr. Picard method ssr: solves many problems, but discrete corn: computational continuous structures, needs updating Experiment using type classes. To be integrated with canonical structures → unification hints?
Towards numerical Dyadics integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real Improve efficency of the reals. computation Numerical integration The current implementation (O’Connor) is fast, but can be Picard method improved. Use dyadics instead of rationals, use machine integers (Krebbers) Code refactoring, data structures ... Example: verified plot of a circle.
Towards numerical Numerical integration integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real computation Numerical integration Picard method Riemann very slow, but general and verified!
Towards numerical Numerical integration integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real computation Numerical integration Picard method Riemann very slow, but general and verified! Newton-Cotes: Approximate a function by a polynomial and integrate this.
Towards numerical Lagrange polys integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Definition Experiment building a library Let x 1 , . . . , x n be distinct and y 1 , . . . , y n arbitrary, then a Faster real computation unique polynomial L of degree at most n − 1 exists with Numerical integration Picard method L ( x k ) = y k . This polynomial is called the Lagrange polynomial. x − x i Explicitly, L ( x ) := � � j y j x j − x i . i , j � = i Definition L: cpoly CRasCRing := Sigma (map (fun p = > let ’((x, y), rest) := p in C y [ ∗ ] Pi (map (fun xy’ = > (’ ( − fst xy’) [+X ∗ ] One) [ ∗ ] C (’ (/ (x − fst xy’)))) rest)) (separates qpoints)).
Towards numerical integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Faster real Theorem (Lagrange error formula) computation Numerical integration Picard method Let f be n times differentiable. Then for all x, � ( x − x k ) sup | f ( n ) | . | f ( x ) − P n ( x ) | � n ! Proof uses generalized Rolle’s theorem. This is a paradigmatic example.
Towards numerical Generalized Rolle integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Experiment building a library Theorem (Classical Rolle’s theorem) Faster real computation Numerical integration Let f be differentiable and have two zeroes in an interval Picard method [ a , b ] . Then f ′ has a zero in ( a , b ) . Theorem (Classical generalized Rolle’s theorem) Let f be n times differentiable and have n + 1 zeroes in an interval [ a , b ] . Then f ( n ) has a zero in [ a , b ] . Is not constructive, i.e. does not compute inside Coq.
Towards numerical Generalized Rolle integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Three solutions: Experiment building a library Faster real ◮ Approximate ( ǫ ) version computation Numerical integration Was used before in corn, Ugly Picard method The reason we have two libraries for reals in Coq?
Towards numerical Generalized Rolle integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Three solutions: Experiment building a library Faster real ◮ Approximate ( ǫ ) version computation Numerical integration Was used before in corn, Ugly Picard method The reason we have two libraries for reals in Coq?
Towards numerical Generalized Rolle integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Three solutions: Experiment building a library Faster real ◮ Approximate ( ǫ ) version computation Numerical integration Was used before in corn, Ugly Picard method The reason we have two libraries for reals in Coq? ◮ Generic zeroes using sheaf models Computational interpretation of classical logic a la Hilbert program Beautiful, but too early
Towards numerical Generalized Rolle integration in Coq Bas Spitters (jww Eelis van der Weegen) Integration Three solutions: Experiment building a library Faster real ◮ Approximate ( ǫ ) version computation Numerical integration Was used before in corn, Ugly Picard method The reason we have two libraries for reals in Coq? ◮ Generic zeroes using sheaf models Computational interpretation of classical logic a la Hilbert program Beautiful, but too early ◮ Divided differences (Thanks Henri)
Towards numerical Hermite-Genocchi formula integration in Coq Bas Spitters (jww Eelis van der Replace Generalized Rolle by Hermite-Genocchi. Weegen) Let R be a field and f : R → R . The interpolation Integration polynomial in the Newton form is a linear combination of Experiment building a library Newton basis polynomials Faster real computation Numerical integration Picard method k � N ( x ) := a j n j ( x ) j =0 with the Newton basis polynomials defined as j − 1 � n j ( x ) := ( x − x i ) i =0 and the coefficients defined as a j := f [ x 0 , ..., x j ], where f [ x 0 , ..., x j ] is the notation for divided differences:
Towards numerical Hermite-Genocchi formula integration in Coq Bas Spitters (jww Eelis van der divided differences defined recursively by: Weegen) Integration f [ a ] = f ( a ) Experiment building a library Faster real computation f [ a , b ] = f ( a ) − f ( b ) / a − b Numerical integration Picard method f [ a , b , c ] = f [ a , c ] − f [ b , c ] / a − b and in general, f [ a : b : l ] := f [ a : l ] − f [ b : l ] / a − b .
Recommend
More recommend