Certi ed Programs and Proofs, 21 Jan 2020

Post on 22-Apr-2022

1 views 0 download

Transcript of Certi ed Programs and Proofs, 21 Jan 2020

The Poincare-Bendixson Theorem inIsabelle/HOL

Fabian Immler and Yong Kiam Tan

Carnegie Mellon University

Certified Programs and Proofs, 21 Jan 2020

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

2 / 22

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

3 / 22

Recap: Ordinary Differential Equations (ODEs)

Ordinary differential equations (ODEs) provide mathematicalmodels of real world phenomena.

ODE model:x = v , v = −g

ODE solution:

x(t) = x0 + v0t −g

2t2

v(t) = v0 − gt

Properties of the ball’s falling motioncan be deduced from these solutions.

A model of glycolysis:

x = −x + ay + x2y

y = b − ay − x2y

ODE solution: ???

How can we deduce properties withoutknowing the closed-form solution?

4 / 22

Recap: Ordinary Differential Equations (ODEs)

Ordinary differential equations (ODEs) provide mathematicalmodels of real world phenomena.

ODE model:x = v , v = −g

ODE solution:

x(t) = x0 + v0t −g

2t2

v(t) = v0 − gt

Properties of the ball’s falling motioncan be deduced from these solutions.

A model of glycolysis:

x = −x + ay + x2y

y = b − ay − x2y

ODE solution: ???

How can we deduce properties withoutknowing the closed-form solution?

4 / 22

(Planar) ODEs and Dynamical Systems

x

y

0 1 2 x

0

1

2

y

A model of glycolysis:

x = −x + ay + x2y

y = b − ay − x2y

Fundamental Idea (Poincare):

ODEs describe dynamical systemswhose qualitative properties can bededuced directly from the equations.

5 / 22

(Planar) ODEs and Dynamical Systems

0 1 2 x

0

1

2

y

A model of glycolysis:

x = −x + ay + x2y

y = b − ay − x2y

Fundamental Idea (Poincare):

ODEs describe dynamical systemswhose qualitative properties can bededuced directly from the equations.

5 / 22

(Planar) ODEs and Dynamical Systems

0 1 2 x

0

1

2

y

A model of glycolysis:

x = −x + ay + x2y

y = b − ay − x2y

Fundamental Idea (Poincare):

ODEs describe dynamical systemswhose qualitative properties can bededuced directly from the equations.

5 / 22

(Planar) ODEs and Dynamical Systems

0 1 2 x

0

1

2

y

A model of glycolysis:

x = −x + ay + x2y

y = b − ay − x2y

Fundamental Idea (Poincare):

ODEs describe dynamical systemswhose qualitative properties can bededuced directly from the equations.

5 / 22

The Poincare-Bendixson Theorem

0 1 2 x

0

1

2

y

Theorem (Poincare-Bendixson)

(Under mild assumptions) trajectories of planar dynamical systemsare either periodic or tend towards a periodic trajectory.

6 / 22

The Poincare-Bendixson Theorem

In our paper/formalization:

Theorem (Poincare-Bendixson)

(Under mild assumptions) trajectories of planar dynamical systemsare either periodic or tend towards a periodic trajectory.

6 / 22

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

7 / 22

Formalization Challenges (the “easy” ones)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

1. Has substantial prerequisite formalized mathematics, e.g.:the Jordan curve theorem, (real) analysis, ODEs.

XIsabelle/HOL and the Archive of Formal Proofs (AFP) meetthese prerequisites.

2. Needs formalization of key dynamical systems concepts, e.g.:limit sets of trajectories, periodic orbits.

XMostly involves formalizing of (real) analysis-type argumentsfollowing standard presentations in textbooks.

8 / 22

Formalization Challenges (the “easy” ones)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

1. Has substantial prerequisite formalized mathematics, e.g.:the Jordan curve theorem, (real) analysis, ODEs.

XIsabelle/HOL and the Archive of Formal Proofs (AFP) meetthese prerequisites.

2. Needs formalization of key dynamical systems concepts, e.g.:limit sets of trajectories, periodic orbits.

XMostly involves formalizing of (real) analysis-type argumentsfollowing standard presentations in textbooks.

8 / 22

Formalization Challenges (the “easy” ones)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

1. Has substantial prerequisite formalized mathematics, e.g.:the Jordan curve theorem, (real) analysis, ODEs.

XIsabelle/HOL and the Archive of Formal Proofs (AFP) meetthese prerequisites.

2. Needs formalization of key dynamical systems concepts, e.g.:limit sets of trajectories, periodic orbits.

XMostly involves formalizing of (real) analysis-type argumentsfollowing standard presentations in textbooks.

8 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

Chicone:

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

Hartman:

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

Palis & de Melo:

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

Perko:

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

Wiggins:

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

Teschl:

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

? How can we formalize these sketches in a proof assistant?

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

? How can we formalize these sketches in a proof assistant?

4. Textbook proofs argue by symmetry and present only one ofthe (several) cases required.

? How can we effectively formalize these symmetries in orderto minimize duplicated proof effort?

This Talk: our answers to these formalization challenges, focusingon the key monotonicity lemma used in the proof.

9 / 22

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

10 / 22

The Monotonicity Lemma (Textbook Proof)

Lemma (Monotonicity)

Successive intersections of a trajectory with a transversal segmentare ordered increasingly (or decreasingly) along the segment.

Definition (Transversal Segment)

A transversal segment is a (closed) 2D line segment where theRHS of the ODE is nowhere zero along the segment.

11 / 22

The Monotonicity Lemma (Textbook Proof)

Lemma (Monotonicity)

Successive intersections of a trajectory with a transversal segmentare ordered increasingly (or decreasingly) along the segment.

Proof.

Suppose trajectory from x1 on the transversal touches thetransversal again at x2:

12 / 22

The Monotonicity Lemma (Textbook Proof)

Lemma (Monotonicity)

Successive intersections of a trajectory with a transversal segmentare ordered increasingly (or decreasingly) along the segment.

Proof.

Construct the Jordan curve J formed by the trajectory and thesegment between x1, x2:

12 / 22

The Monotonicity Lemma (Textbook Proof)

Lemma (Monotonicity)

Successive intersections of a trajectory with a transversal segmentare ordered increasingly (or decreasingly) along the segment.

Proof.

By the Jordan curve theorem, J separates the plane into an insideI and outside O:

12 / 22

The Monotonicity Lemma (Textbook Proof)

Lemma (Monotonicity)

Successive intersections of a trajectory with a transversal segmentare ordered increasingly (or decreasingly) along the segment.

Proof.

Any further intersection at x3 must happen inside by construction,so the intersections are ordered x1 ≤ x2 ≤ x3:

12 / 22

The Monotonicity Lemma (Textbook Proof)

Lemma (Monotonicity)

Successive intersections of a trajectory with a transversal segmentare ordered increasingly (or decreasingly) along the segment.

Proof.

Any further intersection at x3 must happen inside by construction,so the intersections are ordered x1 ≤ x2 ≤ x3:

12 / 22

The Monotonicity Lemma (Textbook Proof)

Lemma (Monotonicity)

Successive intersections of a trajectory with a transversal segmentare ordered increasingly (or decreasingly) along the segment.

Proof.

Not quite done! There are several other cases, but the argumentfor them is symmetric:

12 / 22

The Monotonicity Lemma (Textbook Proof)

Lemma (Monotonicity)

Successive intersections of a trajectory with a transversal segmentare ordered increasingly (or decreasingly) along the segment.

Proof.

Not quite done! There are several other cases, but the argumentfor them is symmetric:

12 / 22

The Monotonicity Lemma (Formal Proof)

(Recall) Formalization Challenge:

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

Subtle Claim: these are the only possibilities that can occur for J.

13 / 22

The Monotonicity Lemma (Formal Proof)

Three pieces of information are needed for the (Left) case:

Symmetrically for (Right) case, e.g., flow always crosses frominside to outside between x1 to x2.

14 / 22

The Monotonicity Lemma (Formal Proof)

Obvious Problem: Naive case splitting yields 8 cases.

15 / 22

The Monotonicity Lemma (Formal Proof)

Obvious Problem: Naive case splitting yields 8 cases.

15 / 22

The Monotonicity Lemma (Formal Proof)

Obvious Problem: Naive case splitting yields 8 cases.

15 / 22

The Monotonicity Lemma (Formal Proof)

Obvious Problem: Naive case splitting yields 8 cases.

Not-so-obvious Problem: It is unclear how to finish the prooffrom the impossible cases.

15 / 22

The Monotonicity Lemma (Formal Proof)

Key Idea: Construct flow regions r1, r2 that must lie on oppositesides and case split to deduce the three pieces of information.

16 / 22

The Monotonicity Lemma (Formal Proof)

(Recall) Formalization Challenge:

4. Textbook proofs argue by symmetry and present only one ofthe (several) cases required.

Key Idea: reverse flows to obtain other cases by symmetry.

17 / 22

The Monotonicity Lemma (Formal Proof)

(Recall) Formalization Challenge:

4. Textbook proofs argue by symmetry and present only one ofthe (several) cases required.

Key Idea: reverse flows to obtain other cases by symmetry.

Formalized using Isabelle/HOL’s (sub-)locales:

ODE f : Rn → Rn

Flow: φ, Thm: P(φ(x0, t)) (≈760 line proof for monotonicity)

rev.ODE −f : Rn → Rn

Flow: φ−f , rev.Thm: P(φ−f (x0, t)) (automatically generated)

⇓export and rewrite φ−f (x0, t) = φ(x0,−t) (≈30 line boilerplate)⇓Flow: φ, Thm: P(φ(x0,−t)) (symmetric lemma proved!)

17 / 22

The Monotonicity Lemma (Formal Proof)

(Recall) Formalization Challenge:

4. Textbook proofs argue by symmetry and present only one ofthe (several) cases required.

Key Idea: reverse flows to obtain other cases by symmetry.

Formalized using Isabelle/HOL’s (sub-)locales:

ODE f : Rn → Rn

Flow: φ, Thm: P(φ(x0, t)) (≈760 line proof for monotonicity)

rev.ODE −f : Rn → Rn

Flow: φ−f , rev.Thm: P(φ−f (x0, t)) (automatically generated)

⇓export and rewrite φ−f (x0, t) = φ(x0,−t) (≈30 line boilerplate)⇓Flow: φ, Thm: P(φ(x0,−t)) (symmetric lemma proved!)

17 / 22

The Monotonicity Lemma (Formal Proof)

(Recall) Formalization Challenge:

4. Textbook proofs argue by symmetry and present only one ofthe (several) cases required.

Key Idea: reverse flows to obtain other cases by symmetry.

Formalized using Isabelle/HOL’s (sub-)locales:

ODE f : Rn → Rn

Flow: φ, Thm: P(φ(x0, t)) (≈760 line proof for monotonicity)

rev.ODE −f : Rn → Rn

Flow: φ−f , rev.Thm: P(φ−f (x0, t)) (automatically generated)

⇓export and rewrite φ−f (x0, t) = φ(x0,−t) (≈30 line boilerplate)⇓

Flow: φ, Thm: P(φ(x0,−t)) (symmetric lemma proved!)

17 / 22

The Monotonicity Lemma (Formal Proof)

(Recall) Formalization Challenge:

4. Textbook proofs argue by symmetry and present only one ofthe (several) cases required.

Key Idea: reverse flows to obtain other cases by symmetry.

Formalized using Isabelle/HOL’s (sub-)locales:

ODE f : Rn → Rn

Flow: φ, Thm: P(φ(x0, t)) (≈760 line proof for monotonicity)

rev.ODE −f : Rn → Rn

Flow: φ−f , rev.Thm: P(φ−f (x0, t)) (automatically generated)

⇓export and rewrite φ−f (x0, t) = φ(x0,−t) (≈30 line boilerplate)⇓Flow: φ, Thm: P(φ(x0,−t)) (symmetric lemma proved!)

17 / 22

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

18 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

XWe give the first (as far as we know*) fully rigorousargument for this step, that is amenable to formalization.

4. Textbook proofs argue by symmetry and present only one ofthe (several) cases required.

XUse Isabelle/HOL’s locale system to formally reverse flows.

19 / 22

Formalization Challenges (this talk)

* While preparing these slides, we came across a proof in Croninbased on indexes but we have not attempted to formalize it.

Cronin (on the Poincare-Bendixson theorem):

. . . part of the difficulty in proving thetheorem lies in the fact that all theconsiderations take place in the Euclideanplane and distinguishing between intuitiveand rigorous arguments in the plane issometimes difficult.

20 / 22

Formalization Challenges (this talk)

Our Claim: the Poincare-Bendixson theorem is an interestingbenchmark for formalized mathematics.

3. Textbook proofs rely heavily on sketches, especially for a keylemma that is fundamental to the plane.

? But our proof is rather different from the textbook sketches.Is this unavoidable? Are there cleaner or more abstract proofs?

4. Textbook proofs argue by symmetry and present only one ofthe (several) cases required.

XUse Isabelle/HOL’s locale system to formally reverse flows.

21 / 22

Conclusion

Theorem (Poincare-Bendixson)

(Under mild assumptions) trajectories of planar dynamical systemsare either periodic or tend towards a periodic trajectory.

0 1 2 x

0

1

2

y

Future Directions:

1. Formalize other tools for the analysis of planar dynamicalsystems, e.g., Lienard’s theorem, Dulac’s criterion.

2. Generalize beyond planar ODEs, e.g., Poincare-Bendixsontheorem for ODEs defined on the sphere or 2-manifolds.

22 / 22

The Monotonicity Lemma (Formal Proof)

The (Left) case of our flow region construction, is sketched here:

Key Idea: Construct flow regions r1, r2 that must lie on oppositesides and case split to deduce the three pieces of information.

1 / 2

Glycolysis Example Proof

0 1 2 x

0

1

2

y

2 / 2