Certi ed Programs and Proofs, 21 Jan 2020

52
The Poincar´ e-Bendixson Theorem in Isabelle/HOL Fabian Immler and Yong Kiam Tan Carnegie Mellon University Certified Programs and Proofs, 21 Jan 2020

Transcript of Certi ed Programs and Proofs, 21 Jan 2020

Page 1: 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

Page 2: Certi ed Programs and Proofs, 21 Jan 2020

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

2 / 22

Page 3: Certi ed Programs and Proofs, 21 Jan 2020

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

3 / 22

Page 4: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 5: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 6: Certi ed Programs and Proofs, 21 Jan 2020

(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

Page 7: Certi ed Programs and Proofs, 21 Jan 2020

(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

Page 8: Certi ed Programs and Proofs, 21 Jan 2020

(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

Page 9: Certi ed Programs and Proofs, 21 Jan 2020

(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

Page 10: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 11: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 12: Certi ed Programs and Proofs, 21 Jan 2020

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

7 / 22

Page 13: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 14: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 15: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 16: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 17: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 18: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 19: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 20: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 21: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 22: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 23: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 24: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 25: Certi ed Programs and Proofs, 21 Jan 2020

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

10 / 22

Page 26: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 27: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 28: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 29: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 30: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 31: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 32: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 33: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 34: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 35: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 36: Certi ed Programs and Proofs, 21 Jan 2020

The Monotonicity Lemma (Formal Proof)

Obvious Problem: Naive case splitting yields 8 cases.

15 / 22

Page 37: Certi ed Programs and Proofs, 21 Jan 2020

The Monotonicity Lemma (Formal Proof)

Obvious Problem: Naive case splitting yields 8 cases.

15 / 22

Page 38: Certi ed Programs and Proofs, 21 Jan 2020

The Monotonicity Lemma (Formal Proof)

Obvious Problem: Naive case splitting yields 8 cases.

15 / 22

Page 39: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 40: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 41: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 42: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 43: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 44: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 45: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 46: Certi ed Programs and Proofs, 21 Jan 2020

Outline

Background: The Poincare-Bendixson Theorem

Formalization Challenges

The Monotonicity Lemma

Conclusion and Outlook

18 / 22

Page 47: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 48: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 49: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 50: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 51: Certi ed Programs and Proofs, 21 Jan 2020

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

Page 52: Certi ed Programs and Proofs, 21 Jan 2020

Glycolysis Example Proof

0 1 2 x

0

1

2

y

2 / 2