A Verified ODE solver and Smale s 14th Problem Fabian Immler Big Proof @ Isaac Newton Institute Jul 6, 2017 = Isabelle λ β α
Smale s 14th Problem A computer-assisted proof involving ODEs. Motivation for Formal Verification considered important 1 / 30
Smale s 14th Problem A computer-assisted proof involving ODEs. Motivation for Formal Verification considered important computer-assisted proof : additional value of formal proof 1 / 30
Smale s 14th Problem A computer-assisted proof involving ODEs. Motivation for Formal Verification final theorem considered important computer-assisted proof : additional value of formal proof risk of Mexican hat specific lemmas general purpose lemmas Mexican Hat [Geuvers, MAP 2004] via [Boldo, 2004] 1 / 30
Smale s 14th Problem A computer-assisted proof involving ODEs. Motivation for Formal Verification considered important computer-assisted proof : additional value of formal proof risk of Mexican hat HOL-Analysis 1 / 30
Smale s 14th Problem A computer-assisted proof involving ODEs. Motivation for Formal Verification considered important computer-assisted proof : additional value of formal proof risk of Mexican hat interesting mathematics (ODEs, dynamical systems) HOL-ODE HOL-Analysis 1 / 30
Smale s 14th Problem A computer-assisted proof involving ODEs. Motivation for Formal Verification considered important computer-assisted proof : additional value of formal proof risk of Mexican hat interesting mathematics (ODEs, dynamical systems) general purpose ODE solver Numerics HOL-ODE HOL-Analysis 1 / 30
Smale s 14th Problem A computer-assisted proof involving ODEs. Motivation for Formal Verification considered important computer-assisted proof : additional value of formal proof risk of Mexican hat interesting mathematics (ODEs, dynamical systems) general purpose ODE solver final theorem Numerics HOL-ODE HOL-Analysis 1 / 30
History 2 / 30
Lorenz Equations (1963, E.N. Lorenz) model atmospheric flows ẋ = 10(y x) ẏ = x(28 z) y ż = xy 8 3 z 3 / 30
Lorenz Equations (1963, E.N. Lorenz) model atmospheric flows ẋ = 10(y x) ẏ = x(28 z) y ż = xy 8 3 z numerical simulations finite precision, approximate computations 3 / 30
Lorenz Equations (1963, E.N. Lorenz) model atmospheric flows ẋ = 10(y x) ẏ = x(28 z) y ż = xy 8 3 z numerical simulations finite precision, approximate computations 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11 11 3 / 30
Lorenz Equations (1963, E.N. Lorenz) model atmospheric flows ẋ = 10(y x) ẏ = x(28 z) y ż = xy 8 3 z numerical simulations finite precision, approximate computations 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 chaos, butterfly effect 11 11 3 / 30
Lorenz Attractor numerical observations: chaotic, strange, hyperbolic 4 / 30
Lorenz Attractor numerical observations: chaotic, strange, hyperbolic the number of man, woman, and computer hours spent on [the Lorenz equations] [... ] must be truly immense [Sparrow, 1982] 4 / 30
Lorenz Attractor numerical observations: chaotic, strange, hyperbolic the number of man, woman, and computer hours spent on [the Lorenz equations] [... ] must be truly immense [Sparrow, 1982] no proofs 4 / 30
Geometric Model (1979) G Σ L G Geometric Lorenz Attractor [Williams, Guckenheimer, Yorke, 1979] 5 / 30
Problem 14: Lorenz Attractor Is the dynamics of the ordinary differential equations of Lorenz that of the geometric Lorenz attractor of Williams, Guckenheimer, and Yorke? From Steve Smale (1998): Mathematical Problems for the Next Century 6 / 30
Tucker s Proof (1998) ( #$ '# '$ &# &$ %# %$ "# "$ # $!"#!"$!# $ # "$!# $ # "$ +, "#!"$ ) * Poincaré section Σ 7 / 30
Tucker s Proof (1998) ( #$ '# '$ &# &$ %# %$ "# "$ # $!"#!"$!# $ # "$!# $ # "$ +, "#!"$ ) * Poincaré section Σ rigorous numerics for global behavior 7 / 30
Tucker s Proof (1998) ( #$ '# '$ &# &$ %# %$ "# "$ # $!"#!"$!# $ # "$!# $ # "$ +, "#!"$ ) * Poincaré section Σ rigorous numerics for global behavior propagation of interval enclosures (100 cpu hours) 7 / 30
Tucker s Proof (1998) ( #$ '# '$ &# &$ %# %$ "# "$ # $!"#!"$!# $ # "$!# $ # "$ +, "#!"$ ) * Poincaré section Σ rigorous numerics for global behavior propagation of interval enclosures (100 cpu hours) analysis (normal form theory) locally around the origin 7 / 30
http://www2.math.uu.se/~warwick/main/pre_thesis.html 8 / 30
Verification 9 / 30
Overview: Verified Rigorous Numerics for ODEs High Level: Reachability Analysis Medium Level: Enclosures/Expressions Lowest Level: Numbers 10 / 30
High Level: Reachability Analysis 11 / 30
Rigorous Enclosure for Returns 1 1 1 ( #$ '# '$ &# &$ %# %$ "# "$ # $!"#!"$!# $ # "$!# $ # "$ +, "#!"$ ) * 1 1 1 1 1 1 1 1 1 1 1 12 / 30
Intermediate Poincaré Sections / Splitting ( #$ '# '$ &# &$ %# %$ "# "$ # $!"#!"$!# $ # "$!# $ # "$ +, "#!"$ ) * 13 / 30
Hyperbolicity 1 #$ '# '$ &# &$ ( %# 1 %$ "# "$ # $!"#!"$!# $ # "$!# $ # "$ +, "#!"$ ) * 1 1 14 / 30
Program Verification Framework (Automatic) Refinement in Isabelle/HOL [Lammich] nondeterministic result monad datatype α nres = FAIL RES (α set) 15 / 30
Program Verification Framework (Automatic) Refinement in Isabelle/HOL [Lammich] nondeterministic result monad datatype α nres = FAIL RES (α set) RES S RES T S T 15 / 30
Program Verification Framework (Automatic) Refinement in Isabelle/HOL [Lammich] nondeterministic result monad datatype α nres = FAIL RES (α set) RES S RES T S T return x := RES {x} 15 / 30
Program Verification Framework (Automatic) Refinement in Isabelle/HOL [Lammich] nondeterministic result monad datatype α nres = FAIL RES (α set) RES S RES T S T return x := RES {x} spec P := RES {x. P x} 15 / 30
Program Verification Framework (Automatic) Refinement in Isabelle/HOL [Lammich] nondeterministic result monad datatype α nres = FAIL RES (α set) RES S RES T S T return x := RES {x} spec P := RES {x. P x} program correctness: x. P x = f x spec (λy. Q y) 15 / 30
Program Verification Framework (Automatic) Refinement in Isabelle/HOL [Lammich] nondeterministic result monad datatype α nres = FAIL RES (α set) RES S RES T S T return x := RES {x} spec P := RES {x. P x} program correctness: x. P x = f x spec (λy. Q y) transfer rules for refinement, e.g., (λ x. return ( f x), f ) R r S nres r 15 / 30
Inference Algorithm (à la Shankar) Operations: split-spec X := spec (λ(a, B). X A B) 16 / 30
Inference Algorithm (à la Shankar) Operations: split-spec X := spec (λ(a, B). X A B) flow-spec X t := spec (λr. φ(x, t) R) 16 / 30
Inference Algorithm (à la Shankar) Operations: split-spec X := spec (λ(a, B). X A B) flow-spec X t := spec (λr. φ(x, t) R) poincare-spec X Σ := spec (λi. P Σ (X ) I ) 16 / 30
Inference Algorithm (à la Shankar) Operations: split-spec X := spec (λ(a, B). X A B) flow-spec X t := spec (λr. φ(x, t) R) poincare-spec X Σ := spec (λi. P Σ (X ) I ) Invariant: x 0 X 0. t 0.φ(x 0, t) X P Σ (x 0 ) I 16 / 30
Medium Level: Enclosures and Rigorous Numerics 17 / 30
Enclosures not intervals: 18 / 30
Enclosures not intervals: but zonotopes: {l 0 + i ε i l i ε i [ 1; 1]} 18 / 30
Enclosures not intervals: but zonotopes: {l 0 + i ε i l i ε i [ 1; 1]} (l, {l 0 + i ε i l i ε i [ 1; 1]}) zonotope r 18 / 30
Enclosures not intervals: but zonotopes: {l 0 + i ε i l i ε i [ 1; 1]} (l, {l 0 + i ε i l i ε i [ 1; 1]}) zonotope r e.g., (split-zonotope, split-spec ) zonotope r r zonotope r r zonotope r nres r 18 / 30
Rigorous Numerics aexp = Add aexp aexp Mult aexp aexp Minus aexp Inverse aexp Num R Var N... [[Add a b]] vs = [[Mult a b]] vs = [[Minus a]] vs = [[Inverse a]] vs = [[Num r]] vs = [[Var i]] vs =... [[a]] vs + [[b]] vs [[a]] vs [[b]] vs [[a]] vs 1/[[a]] vs r vs! i Rigorous Numerics: approx-spec aexp X = spec (λr. x X. [[aexp ]] x R) Refinement: (approx, approx-spec ) Id r zonotope r r zonotope r nres r 19 / 30
Runge-Kutta methods x 0 ϕ O(h 2 ) h f (x 0 ) 0 h ODE: φ(t) = f (φ(t)) 20 / 30
Runge-Kutta methods ϕ O(h 2 ) h f (x 0 ) x 0 0 h ODE: φ(t) = f (φ(t)) Expressions: [[Euler aexp]] x0,h,ξ x 0 + h f (x 0 ) + O(h 2 ) [[RK aexp]] x0,h,ξ x 0 + h + O(h 3 ) 20 / 30
Runge-Kutta methods ϕ O(h 2 ) h f (x 0 ) x 0 0 h ODE: φ(t) = f (φ(t)) Expressions: [[Euler aexp]] x0,h,ξ x 0 + h f (x 0 ) + O(h 2 ) [[RK aexp]] x0,h,ξ x 0 + h + O(h 3 ) Mathematics: φ(x 0, h) x 0 + h f (x 0 ) O(h 2 ) φ(x 0, h)... O(h 3 ) 20 / 30
Runge-Kutta methods ϕ O(h 2 ) h f (x 0 ) x 0 0 h ODE: φ(t) = f (φ(t)) Expressions: [[Euler aexp]] x0,h,ξ x 0 + h f (x 0 ) + O(h 2 ) [[RK aexp]] x0,h,ξ x 0 + h + O(h 3 ) Mathematics: φ(x 0, h) x 0 + h f (x 0 ) O(h 2 ) φ(x 0, h)... O(h 3 ) Rigorous: approx-spec (RK aexp) (X, t) flow-spec X t 20 / 30
Derivatives w.r.t. initial value 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 21 / 30
Derivatives w.r.t. initial value 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 21 / 30
Derivatives w.r.t. initial value 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 21 / 30
Derivatives w.r.t. initial value 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 21 / 30
Derivatives w.r.t. initial value ODE f : R n R n : ẋ(t) = f (x) 22 / 30
Derivatives w.r.t. initial value ODE f : R n R n : Variational Equation: ẋ(t) = f (x) W (t) = Df (x(t)) W (t) 22 / 30
Derivatives w.r.t. initial value ODE f : R n R n : Variational Equation: ẋ(t) = f (x) W (t) = Df (x(t)) W (t) W (t) :: R n2 22 / 30
Derivatives w.r.t. initial value ODE f : R n R n : Variational Equation: ẋ(t) = f (x) W (t) :: R n2 W (t) = Df (x(t)) W (t) Algorithmic: variational equation on the level of expressions 22 / 30
Derivatives w.r.t. initial value ODE f : R n R n : ẋ(t) = f (x) Variational Equation: W (t) :: R n2 W (t) = Df (x(t)) W (t) Algorithmic: variational equation on the level of expressions Mathematics: W (t) = φ(x, t) x :: (R n l R n ) 22 / 30
Lowest Level 23 / 30
Numbers Software Floating Point Numbers m 2 e, m, e Z Explicit Rounding p (x) := x 2 p log 2 x 2 p log 2 x 24 / 30
Computations 25 / 30
Overview ( #$ '# '$ &# &$ %# %$ "# "$ # $!"#!"$!# $ # "$!# $ # "$ +, "#!"$ ) * 26 / 30
Computation 300 initial rectangles 27 / 30
Computation 300 initial rectangles with a 20 core machine: 27 / 30
Computation 300 initial rectangles with a 20 core machine: 155h cpu time 27 / 30
Computation 300 initial rectangles with a 20 core machine: 155h cpu time factor 17 27 / 30
Computation 300 initial rectangles with a 20 core machine: 155h cpu time factor 17 9h elapsed time 27 / 30
Computation 300 initial rectangles with a 20 core machine: 155h cpu time factor 17 9h elapsed time without C 1 : speedup of factor 10 27 / 30
50 40 10 30 5 20 0 10-5 0-15 -10-5 0 5 10 15-10 -15-10 -5 0 5 10 15 28 / 30
50 40 10 30 5 20 0 10-5 0-15 -10-5 0 5 10 15-10 -15-10 -5 0 5 10 15 28 / 30
50 40 10 30 5 20 0 10-5 0-15 -10-5 0 5 10 15-10 -15-10 -5 0 5 10 15 28 / 30
50 40 10 30 5 20 0 10-5 0-15 -10-5 0 5 10 15-10 -15-10 -5 0 5 10 15 28 / 30
50 40 10 30 5 20 0 10-5 0-15 -10-5 0 5 10 15-10 -15-10 -5 0 5 10 15 28 / 30
28 / 30
28 / 30
28 / 30
50 40 10 30 5 20 0 10-5 0-15 -10-5 0 5 10 15-10 -15-10 -5 0 5 10 15 28 / 30
50 40 10 30 5 20 0 10-5 0-15 -10-5 0 5 10 15-10 -15-10 -5 0 5 10 15 28 / 30
50 40 10 30 5 20 0 10-5 0-15 -10-5 0 5 10 15-10 -15-10 -5 0 5 10 15 28 / 30
by eval 29 / 30
Thank You. 30 / 30
Conclusion Many compromises: intervals/zonotopes/taylor models Euler/Runge-Kutta/Taylor series (linear) variational equation with generic solver software/hardware floating point numbers But modular and good enough. 31 / 30