NLVerify Verification of Polynomial Inequalities using Formal - - PowerPoint PPT Presentation

nlverify
SMART_READER_LITE
LIVE PREVIEW

NLVerify Verification of Polynomial Inequalities using Formal - - PowerPoint PPT Presentation

NLVerify Verification of Polynomial Inequalities using Formal Floating-point Arithmetic Victor Magron (CNRS VERIMAG) Joint work with Tillmann Weisser and Benjamin Werner INRIA Spades Seminar October 27, 2015 V. Magron NLVerify 1 / 22


slide-1
SLIDE 1

NLVerify

Verification of Polynomial Inequalities using Formal Floating-point Arithmetic Victor Magron (CNRS VERIMAG) Joint work with Tillmann Weisser and Benjamin Werner

INRIA Spades Seminar

October 27, 2015

  • V. Magron

NLVerify 1 / 22

slide-2
SLIDE 2

Question:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

  • V. Magron

NLVerify 2 / 22

slide-3
SLIDE 3

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Applications:

Formal proofs, e. g. Hales proof of the Kepler Conjecture

Completed in 2014 ~1000 non linear inequalities took ~5000 CPU hours

Software verification System control

  • V. Magron

NLVerify 2 / 22

slide-4
SLIDE 4

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

  • V. Magron

NLVerify 2 / 22

slide-5
SLIDE 5

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

Bernstein Polynomials

  • V. Magron

NLVerify 2 / 22

slide-6
SLIDE 6

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

Bernstein Polynomials Quantifier Elimination

  • V. Magron

NLVerify 2 / 22

slide-7
SLIDE 7

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

Bernstein Polynomials Quantifier Elimination Naive Interval Enclosure

  • V. Magron

NLVerify 2 / 22

slide-8
SLIDE 8

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

Bernstein Polynomials Quantifier Elimination Naive Interval Enclosure

Naive Interval Enclosure:

y − 2x + 1 ∈ [0, 1] − [2, 2][0, 1] + [1, 1]

  • V. Magron

NLVerify 2 / 22

slide-9
SLIDE 9

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

Bernstein Polynomials Quantifier Elimination Naive Interval Enclosure

Naive Interval Enclosure:

y − 2x + 1 ∈ [0, 1] − [2, 2][0, 1] + [1, 1] ⊆ [−1, 2] (very coarse, very fast, does not use Hypothesis)

  • V. Magron

NLVerify 2 / 22

slide-10
SLIDE 10

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

Bernstein Polynomials Quantifier Elimination Naive Interval Enclosure Sums-of-Squares

Micromega (Besson) NLCertify (Magron) NLVerify (this work)

  • V. Magron

NLVerify 2 / 22

slide-11
SLIDE 11

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

Bernstein Polynomials Quantifier Elimination Naive Interval Enclosure Sums-of-Squares

Micromega (Besson) NLCertify (Magron) NLVerify (this work)

Sums-of-Squares:

y − 2x + 1 = (x − 1)2 + (y − x2)

  • V. Magron

NLVerify 2 / 22

slide-12
SLIDE 12

Automated formal proofs for questions like:

Does 0 ≤ x, y ≤ 1 ∧ x2 ≤ y imply y − 2x + 1 ≥ 0 ?

Existing Methods:

Taylor/Interval Method

Solovyev (HOL) Melquiond (COQ)

Bernstein Polynomials Quantifier Elimination Naive Interval Enclosure Sums-of-Squares

Micromega (Besson) NLCertify (Magron) NLVerify (this work)

Sums-of-Squares:

y − 2x + 1 = (x − 1)2 + (y − x2) tighter but slower, certificate can be computed by external oracles

  • V. Magron

NLVerify 2 / 22

slide-13
SLIDE 13

From Oranges Stack...

Kepler Conjecture (1611): The maximal density of sphere packings in 3D-space is

π √ 18

Face-centered cubic Packing Hexagonal Compact Packing

  • V. Magron

NLVerify 3 / 22

slide-14
SLIDE 14

...to Flyspeck Nonlinear Inequalities

The proof of T. Hales (1998) contains mathematical and computational parts Computation: check thousands of nonlinear inequalities Flyspeck [Hales 06]: Formal Proof of Kepler Conjecture

  • V. Magron

NLVerify 4 / 22

slide-15
SLIDE 15

...to Flyspeck Nonlinear Inequalities

The proof of T. Hales (1998) contains mathematical and computational parts Computation: check thousands of nonlinear inequalities Flyspeck [Hales 06]: Formal Proof of Kepler Conjecture Project Completion on August 2014 by the Flyspeck team

  • V. Magron

NLVerify 4 / 22

slide-16
SLIDE 16

A “Simple” Example

In the computational part: Multivariate Polynomials:

∆x := x1x4(−x1 + x2 + x3 − x4 + x5 + x6) + x2x5(x1 − x2 + x3 + x4 − x5 + x6) + x3x6(x1 + x2 − x3 + x4 + x5 − x6) − x2(x3x4 + x1x6) − x5(x1x3 + x4x6)

  • V. Magron

NLVerify 5 / 22

slide-17
SLIDE 17

A “Simple” Example

In the computational part: Semialgebraic functions: composition of polynomials with | · |, √, +, −, ×, /, sup, inf, . . . p(x) := ∂4∆x q(x) := 4x1∆x r(x) := p(x)/

  • q(x)

l(x) := − π 2 + 1.6294 − 0.2213 (√x2 + √x3 + √x5 + √x6 − 8.0) + 0.913 (√x4 − 2.52) + 0.728 (√x1 − 2.0)

  • V. Magron

NLVerify 5 / 22

slide-18
SLIDE 18

A “Simple” Example

In the computational part: Transcendental functions T : composition of semialgebraic functions with arctan, exp, sin, +, −, ×, . . .

  • V. Magron

NLVerify 5 / 22

slide-19
SLIDE 19

A “Simple” Example

In the computational part: Feasible set Kbox := [4, 6.3504]3 × [6.3504, 8] × [4, 6.3504]2 Lemma9922699028 from Flyspeck: ∀x ∈ Kbox, arctan p(x)

  • q(x)
  • + l(x) ≥ 0
  • V. Magron

NLVerify 5 / 22

slide-20
SLIDE 20

New Framework (in my PhD thesis)

Certificates for Nonlinear Optimization using SDP and:

Maxplus approximation (Optimal Control) Nonlinear templates (Static Analysis)

Verification of these certificates inside Coq: p = σ0 + ∑j σjgj = ⇒ ∀x ∈ Kbox, p(x) ≥ 0 .

  • V. Magron

NLVerify 6 / 22

slide-21
SLIDE 21

Introduction The Oracle Framework Interval Methods Coq Implementation Benchmarks Future Work

slide-22
SLIDE 22

A hint on what the oracle is doing:

Linear Programming (LP): inf

z

c⊤z s.t. F z ≥ 0 .

Linear cost c Linear inequalities “∑i Fij zj ≥ 0”

Polyhedron

  • V. Magron

NLVerify 7 / 22

slide-23
SLIDE 23

A hint on what the oracle is doing:

Semidefinite Programming (SDP): inf

z

c⊤z s.t.

i

Fi zi 0 .

Linear cost c Symmetric matrices Fi Linear matrix inequalities “F 0” (F has nonnegative eigenvalues)

Spectrahedron

  • V. Magron

NLVerify 7 / 22

slide-24
SLIDE 24

A hint on what the oracle is doing:

Finding an SOS-representation boils down to solving an SDP.

  • V. Magron

NLVerify 8 / 22

slide-25
SLIDE 25

A hint on what the oracle is doing:

Finding an SOS-representation boils down to solving an SDP. There are efficient solvers available to solve SDPs. (SDPA, CSDP, SDPT3, SeDuMi, Mosek,. . . )

  • V. Magron

NLVerify 8 / 22

slide-26
SLIDE 26

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0!

  • V. Magron

NLVerify 9 / 22

slide-27
SLIDE 27

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X Y

 z1 z2 z4 z2 z3 z5 z4 z5 z6     1 X Y   +

  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-28
SLIDE 28

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X Y

 z1 z2 z4 z2 z3 z5 z4 z5     1 X Y   +

  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-29
SLIDE 29

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X Y

 z1 z2 z4 z2 z3 z4     1 X Y   +

  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-30
SLIDE 30

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X Y

 z1 z2 z2 z3     1 X Y   +

  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-31
SLIDE 31

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X z1 z2 z2 z3 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-32
SLIDE 32

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X z1 z2 z2 z3 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-33
SLIDE 33

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X 1 − z8 − z10 z2 z2 z3 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-34
SLIDE 34

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X 1 − z8 − z10 z2 z2 z3 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-35
SLIDE 35

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X 1 − z8 − z10 (z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z3 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-36
SLIDE 36

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X 1 − z8 − z10 (z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z3 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z11 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-37
SLIDE 37

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X 1 − z8 − z10 (z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z3 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z10 − z9 + 1 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-38
SLIDE 38

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X 1 − z8 − z10 (z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z3 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z10 − z9 + 1 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-39
SLIDE 39

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X 1 − z8 − z10 (z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z10 − z9 + 1 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z10 − z9 + 1 1 · (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-40
SLIDE 40

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! We restrict ourselves to representations of degree ≤ 2. Write Y − 2X + 1 =

  • 1

X 1 − z8 − z10 (z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z10 − z9 + 1 1 X

  • +
  • 1

z7 1 · X +

  • 1

z8 1 · (1 − X) +

  • 1

z9 1 · Y +

  • 1

z10 1 · (1 − Y) +

  • 1

z10 − z9 + 1 1 · (Y − X2) Find z7, z8, z9, z10 ≥ 0 such that

  • 1 − z8 − z10

(z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z10 − z9 + 1

  • 0.
  • V. Magron

NLVerify 9 / 22

slide-41
SLIDE 41

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! Find z7, z8, z9, z10 ≥ 0 such that

  • 1 − z8 − z10

(z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z10 − z9 + 1

  • 0.
  • e. g. z7 = z8 = z9 = z10 = 0.
  • V. Magron

NLVerify 9 / 22

slide-42
SLIDE 42

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! Find z7, z8, z9, z10 ≥ 0 such that

  • 1 − z8 − z10

(z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z10 − z9 + 1

  • 0.
  • e. g. z7 = z8 = z9 = z10 = 0.

Substituting the solution: Y − 2X + 1 =

  • 1

X 1 −1 −1 1 1 X

  • +
  • 1

· (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-43
SLIDE 43

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! Find z7, z8, z9, z10 ≥ 0 such that

  • 1 − z8 − z10

(z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z10 − z9 + 1

  • 0.
  • e. g. z7 = z8 = z9 = z10 = 0.

Substituting the solution: Y − 2X + 1 =

  • 1

X 1 −1 1 −1 1 X

  • +
  • 1

· (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-44
SLIDE 44

Example:

Find SOS-decomposition for 0 ≤ x, y ≤ 1 ∧ x2 ≤ y ⇒ y − 2x + 1 ≥ 0! Find z7, z8, z9, z10 ≥ 0 such that

  • 1 − z8 − z10

(z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z10 − z9 + 1

  • 0.
  • e. g. z7 = z8 = z9 = z10 = 0.

Substituting the solution: Y − 2X + 1 =

  • 1

X 1 −1 1 −1 1 X

  • +
  • 1

· (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-45
SLIDE 45

Example:

SOS-decomposition: Y − 2X + 1 = (1 − X)2 +

  • Y − X2

Find z7, z8, z9, z10 ≥ 0 such that

  • 1 − z8 − z10

(z8 − z7 − 2)/2 (z8 − z7 − 2)/2 z10 − z9 + 1

  • 0.
  • e. g. z7 = z8 = z9 = z10 = 0.

Substituting the solution: Y − 2X + 1 =

  • 1

X 1 −1 1 −1 1 X

  • +
  • 1

· (Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-46
SLIDE 46

Example:

SOS-decomposition: Y − 2X + 1 = (1 − X)2 +

  • Y − X2

sdp solvers only find approximate certificates:

Y − 2X + 1 ≃ 2.00014(0.707263X + 0.000078Y − 0.70695)2 + 0.000332(−0.408035X + 0.816664Y − 0.408126)2 + 0.000284Y + 0.000116(1 − Y) + 1.00034(Y − X2)

  • V. Magron

NLVerify 9 / 22

slide-47
SLIDE 47

Example:

SOS-decomposition: Y − 2X + 1 = (1 − X)2 +

  • Y − X2

sdp solvers only find approximate certificates:

Y − 2X + 1 ≃ 2.00014(0.707263X + 0.000078Y − 0.70695)2 + 0.000332(−0.408035X + 0.816664Y − 0.408126)2 + 0.000284Y + 0.000116(1 − Y) + 1.00034(Y − X2) Exact error polynomial ε := 0.000232209X2 − 5.81334 × 10−7XY − 0.0000297356X + 0.000221436Y2 + 0.0000621035Y − 0.000201126

  • V. Magron

NLVerify 9 / 22

slide-48
SLIDE 48

Example:

SOS-decomposition: Y − 2X + 1 = (1 − X)2 +

  • Y − X2

sdp solvers only find approximate certificates:

Y − 2X + 1 ≃ 2.00014(0.707263X + 0.000078Y − 0.70695)2 + 0.000332(−0.408035X + 0.816664Y − 0.408126)2 + 0.000284Y + 0.000116(1 − Y) + 1.00034(Y − X2) Exact error polynomial ε := 0.000232209X2 − 5.81334 × 10−7XY − 0.0000297356X + 0.000221436Y2 + 0.0000621035Y − 0.000201126 How can we employ such numerical certificates for formal verification?

  • V. Magron

NLVerify 9 / 22

slide-49
SLIDE 49

Introduction The Oracle Framework Interval Methods Coq Implementation Benchmarks Future Work

slide-50
SLIDE 50

How to use numerical certificates in COQ?

tactic strategy ε := 0.000232209X2 − 5.81334 × 10−7XY − 0.0000297356X + 0.000221436Y2 + 0.0000621035Y − 0.000201126

  • V. Magron

NLVerify 10 / 22

slide-51
SLIDE 51

How to use numerical certificates in COQ?

tactic strategy Micromega uses heuristics to get an exact representation ε =

  • V. Magron

NLVerify 10 / 22

slide-52
SLIDE 52

How to use numerical certificates in COQ?

tactic strategy Micromega uses heuristics to get an exact representation NLCertify gives lower bound on ε by exact computations ε∗ := 0.000232209X2−5.81334 × 10−7XY−0.0000297356X + 0.000221436Y2 + 0.0000621035Y−0.000201126

  • V. Magron

NLVerify 10 / 22

slide-53
SLIDE 53

How to use numerical certificates in COQ?

tactic strategy Micromega uses heuristics to get an exact representation NLCertify gives lower bound on ε by exact computations NLVerify use interval arithmetics to bound ε ε∗ := enclosure of ε

  • V. Magron

NLVerify 10 / 22

slide-54
SLIDE 54

General Framework

Consider n-variate polynomials f, g0, . . . , gm ∈ Q[X] and a compact set Kpop := {x ∈ Rn | g0(x) ≥ 0, . . . , gm(x) ≥ 0}.

  • V. Magron

NLVerify 11 / 22

slide-55
SLIDE 55

General Framework

Consider n-variate polynomials f, g0, . . . , gm ∈ Q[X] and a compact set Kpop := {x ∈ Rn | g0(x) ≥ 0, . . . , gm(x) ≥ 0}⊆ Kbox, where Kbox = [a, b], with a, b ∈ Qn (plus assumption on the gj). We are interested in the fact of f being non negative on Kpop, i. e. ∀x ∈ Kpop : f(x) ≥ 0.

  • V. Magron

NLVerify 11 / 22

slide-56
SLIDE 56

General Framework

Consider n-variate polynomials f, g0, . . . , gm ∈ Q[X] and a compact set Kpop := {x ∈ Rn | g0(x) ≥ 0, . . . , gm(x) ≥ 0} ⊆ Kbox, where Kbox = [a, b], with a, b ∈ Qn (plus assumption on the gj). We are interested in the fact of f being non negative on Kpop, i. e. ∀x ∈ Kpop : f(x)≥ 0.

Number formats

R axiomatic

  • V. Magron

NLVerify 11 / 22

slide-57
SLIDE 57

General Framework

Consider n-variate polynomials f, g0, . . . , gm ∈ Q[X] and a compact set Kpop := {x ∈ Rn | g0(x) ≥ 0, . . . , gm(x) ≥ 0} ⊆ Kbox, where Kbox = [a, b], with a, b ∈ Qn (plus assumption on the gj). We are interested in the fact of f being non negative on Kpop, i. e. ∀x ∈ Kpop : f(x) ≥ 0.

Number formats

R axiomatic Q exact, slow

  • V. Magron

NLVerify 11 / 22

slide-58
SLIDE 58

General Framework

Consider n-variate polynomials f, g0, . . . , gm ∈ Q[X] and a compact set Kpop := {x ∈ Rn | g0(x) ≥ 0, . . . , gm(x) ≥ 0} ⊆ Kbox, where Kbox = [a, b], with a, b ∈ Qn (plus assumption on the gj). We are interested in the fact of f being non negative on Kpop, i. e. ∀x ∈ Kpop : f(x) ≥ 0.

Number formats

R axiomatic Q exact, slow F fast, certified inside COQ (FLOCQ, Boldo/Melquiond), rounding errors

  • V. Magron

NLVerify 11 / 22

slide-59
SLIDE 59

General Framework

Consider n-variate polynomials f, g0, . . . , gm ∈ Q[X] and a compact set Kpop := {x ∈ Rn | g0(x) ≥ 0, . . . , gm(x) ≥ 0} ⊆ Kbox, where Kbox = [a, b], with a, b ∈ Qn (plus assumption on the gj). We are interested in the fact of f being non negative on Kpop, i. e. ∀x ∈ Kpop : f(x) ≥ 0.

Number formats

R axiomatic Q exact, slow F fast, certified inside COQ (FLOCQ, Boldo/Melquiond), rounding errors I to keep track of rounding errors

  • V. Magron

NLVerify 11 / 22

slide-60
SLIDE 60

Introduction The Oracle Framework Interval Methods Coq Implementation Benchmarks Future Work

slide-61
SLIDE 61

Notations

Floating point numbers F(p) := Fr,p with radix r and precision p.

  • V. Magron

NLVerify 12 / 22

slide-62
SLIDE 62

Notations

Floating point numbers F(p) := Fr,p with radix r and precision p. We are using one precision for all operations. In this talk r = 10, in the implementation r = 2.

  • V. Magron

NLVerify 12 / 22

slide-63
SLIDE 63

Notations

Floating point numbers F(p) := Fr,p with radix r and precision p. We are using one precision for all operations. In this talk r = 10, in the implementation r = 2. Intervals Ip := Ir,p with floating point bounds Fp.

  • V. Magron

NLVerify 12 / 22

slide-64
SLIDE 64

Notations

Floating point numbers F(p) := Fr,p with radix r and precision p. We are using one precision for all operations. In this talk r = 10, in the implementation r = 2. Intervals Ip := Ir,p with floating point bounds Fp. We map rationals to intervals via the enclosure Q → Ip, [a]p :=

  • max

x∈Fp{x | x ≤ a} , min x∈Fp{x | x ≥ a}

  • .
  • V. Magron

NLVerify 12 / 22

slide-65
SLIDE 65

Notations

Floating point numbers F(p) := Fr,p with radix r and precision p. We are using one precision for all operations. In this talk r = 10, in the implementation r = 2. Intervals Ip := Ir,p with floating point bounds Fp. We map rationals to intervals via the enclosure Q → Ip, [a]p :=

  • max

x∈Fp{x | x ≤ a} , min x∈Fp{x | x ≥ a}

  • .

Attention!

Interval arithmetic does not carry any ring structure. The enclosure does not commute with the operations in Q. In general: [a + b]p [a]p + [b]p .

  • V. Magron

NLVerify 12 / 22

slide-66
SLIDE 66

Two applications of intervals on polynomials

Replace coefficients by intervals to speed up computation. Replace variables by intervals to obtain bounds on the function.

  • V. Magron

NLVerify 13 / 22

slide-67
SLIDE 67

Two applications of intervals on polynomials

Replace coefficients by intervals to speed up computation. Replace variables by intervals to obtain bounds on the function.

  • V. Magron

NLVerify 13 / 22

slide-68
SLIDE 68

Two applications of intervals on polynomials

Replace coefficients by intervals to speed up computation.

Coefficient Enclosure

Building a coefficient enclosure of a polynomial f ∈ Q[X] is done by mapping its coefficients to the corresponding intervals via [•]p. If f = ∑α fαXα, its coefficient enclosure is the set of polynomials [f]p = ∑

α

[fα]p Xα :=

α

ˆ fαXα | ˆ fα ∈ [fα]p

  • V. Magron

NLVerify 13 / 22

slide-69
SLIDE 69

Two applications of intervals on polynomials

Replace coefficients by intervals to speed up computation.

Coefficient Enclosure

Building a coefficient enclosure of a polynomial f ∈ Q[X] is done by mapping its coefficients to the corresponding intervals via [•]p. If f = ∑α fαXα, its coefficient enclosure is the set of polynomials [f]p = ∑

α

[fα]p Xα :=

α

ˆ fαXα | ˆ fα ∈ [fα]p

  • Keep in mind!

The coefficient enclosure depends on the representation of f.

  • V. Magron

NLVerify 13 / 22

slide-70
SLIDE 70

Two applications of intervals on polynomials

Replace coefficients by intervals to speed up computation.

Coefficient Enclosure

f := 1 3X − 1 3X = 0 [f]2 = [0.33, 0.34]X − [0.33, 0.34]X [0]2 = [0, 0]

  • V. Magron

NLVerify 13 / 22

slide-71
SLIDE 71

Two applications of intervals on polynomials

Replace variables by intervals to obtain bounds on the function.

Variable Enclosure

The variable enclosure |f|B of a polynomial f with respect to a hyper box B = (I1 · · · , In) ⊆ In

p is built by replacing every variable Xi by

the corresponding interval Ii. If f = ∑α fαXα, its variable enclosure is |f|B = ∑

α

fαBα ⊆ Ip

  • V. Magron

NLVerify 13 / 22

slide-72
SLIDE 72

Two applications of intervals on polynomials

Replace variables by intervals to obtain bounds on the function.

Variable Enclosure

The variable enclosure |f|B of a polynomial f with respect to a hyper box B = (I1 · · · , In) ⊆ In

p is built by replacing every variable Xi by

the corresponding interval Ii. If f = ∑α fαXα, its variable enclosure is |f|B = ∑

α

fαBα ⊆ Ip

Of course:

The variable enclosure depends on the representation of f.

  • V. Magron

NLVerify 13 / 22

slide-73
SLIDE 73

Two applications of intervals on polynomials

Replace variables by intervals to obtain bounds on the function.

Variable Enclosure

Let B = [−1, 1] × [0, 1] × [0, 1]. Then X(Y − Z) = XY − YZ |X(Y − Z)|B = [−1, 1][−1, 1] = [−1, 1] |XY − XZ|B = [−1, 1] − [−1, 1] = [−2, 2]

  • V. Magron

NLVerify 13 / 22

slide-74
SLIDE 74

Two applications of intervals on polynomials

COEFFICIENT ENCLOSURE VARIABLE ENCLOSURE We are combining both methods and SOS-certification.

  • V. Magron

NLVerify 13 / 22

slide-75
SLIDE 75

Introduction The Oracle Framework Interval Methods Coq Implementation Benchmarks Future Work

slide-76
SLIDE 76

Coq Implementation

Theorem:

  • [f]p
  • Kbox

⊆ [ℓ, ∞) ⇒ f ≥ ℓ on Kbox.

  • V. Magron

NLVerify 14 / 22

slide-77
SLIDE 77

Coq Implementation

Theorem:

  • [f]p
  • Kbox

⊆ [ℓ, ∞) ⇒ f ≥ ℓ on Kbox.

COQVersion:

Lemma toPolI_ok p box pt : pt ∈ box → eval pt p ∈ Vencl box (toPolI p).

  • V. Magron

NLVerify 14 / 22

slide-78
SLIDE 78

Lemma toPolI_ok p box pt : pt ∈ box → eval pt p ∈ Vencl box (toPolI p).

  • V. Magron

NLVerify 15 / 22

slide-79
SLIDE 79

Lemma toPolI_ok p box pt : pt ∈ box → eval pt p ∈ Vencl box (toPolI p). PQ R PolI I

eval toPolI ∈ Vencl

  • V. Magron

NLVerify 15 / 22

slide-80
SLIDE 80

Lemma toPolI_ok p box pt : pt ∈ box → eval pt p ∈ Vencl box (toPolI p). PQ R PolI I

eval toPolI ∈ Vencl

Inductive PQ := | PEc : Q → PQ | PEx : positive → PQ | PEadd: PQ -> PQ → PQ | PEsub: PQ -> PQ → PQ | ... .

  • V. Magron

NLVerify 15 / 22

slide-81
SLIDE 81

Lemma toPolI_ok p box pt : pt ∈ box → eval pt p ∈ Vencl box (toPolI p). PQ R PolI I

eval toPolI ∈ Vencl

Inductive PQ := | PEc : Q → PQ | PEx : positive → PQ | PEadd: PQ -> PQ → PQ | PEsub: PQ -> PQ → PQ | ... . Inductive PolI := | IPc : I → PolI | IPinj: positive → PolI → PolI | IPX : PolI → positive → PolI → PolI.

  • V. Magron

NLVerify 15 / 22

slide-82
SLIDE 82

Lemma toPolI_ok p box pt : pt ∈ box → eval pt p ∈ Vencl box (toPolI p). PQ R PolI I

eval toPolI ∈ Vencl

Inductive PQ := | PEc : Q → PQ | PEx : positive → PQ | PEadd: PQ -> PQ → PQ | PEsub: PQ -> PQ → PQ | ... . Inductive PolI := | IPc : I → PolI | IPinj: positive → PolI → PolI | IPX : PolI → positive → PolI → PolI.

  • V. Magron

NLVerify 15 / 22

slide-83
SLIDE 83

Lemma toPolI_ok p box pt : pt ∈ box → eval pt p ∈ Vencl box (toPolI p). Proof: PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

Inductive PQ := | PEc : Q → PQ | PEx : positive → PQ | PEadd: PQ -> PQ → PQ | PEsub: PQ -> PQ → PQ | ... . Inductive PolQ := | QPc : Q → PolQ | QPinj: positive → PolQ → PolQ | QPX : PolQ → positive → PolQ → PolQ.

  • V. Magron

NLVerify 15 / 22

slide-84
SLIDE 84

Lemma toPolI_ok p box pt : pt ∈ box → eval pt p ∈ Vencl box (toPolI p). NLVerify: PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

Inductive PQ := | PEc : Q → PQ | PEx : positive → PQ | PEadd: PQ -> PQ → PQ | PEsub: PQ -> PQ → PQ | ... . Inductive PolQ := | QPc : Q → PolQ | QPinj: positive → PolQ → PolQ | QPX : PolQ → positive → PolQ → PolQ.

  • V. Magron

NLVerify 15 / 22

slide-85
SLIDE 85

Correctness lemmas for PolI

For PolQ a correctness lemma looks like: Lemma QPadd_ok (p q: PolQ) pt : eval pt (p !++ q) = eval pt p + eval pt q.

  • V. Magron

NLVerify 16 / 22

slide-86
SLIDE 86

Correctness lemmas for PolI

For PolQ a correctness lemma looks like: Lemma QPadd_ok (p q: PolQ) pt : eval pt (p !++ q) = eval pt p + eval pt q. The direct translation of this lemma to PolI is false.

  • V. Magron

NLVerify 16 / 22

slide-87
SLIDE 87

Correctness lemmas for PolI

For PolQ a correctness lemma looks like: Lemma QPadd_ok (p q: PolQ) pt : eval pt (p !++ q) = eval pt p + eval pt q. The direct translation of this lemma to PolI is false. A PolI

  • peration can only be correct w.r.t. the underlying PolQ expressions:

Lemma Padd_coef_ok (p q: PolQ) (P Q: PolI) : p ∈ P -> q ∈ Q -> (p !++ q) ∈ (P ?++ Q).

  • V. Magron

NLVerify 16 / 22

slide-88
SLIDE 88

Correctness lemmas for PolI

PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

  • V. Magron

NLVerify 16 / 22

slide-89
SLIDE 89

Correctness lemmas for PolI

PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

→ Correctness lemmas

  • V. Magron

NLVerify 16 / 22

slide-90
SLIDE 90

Proof of Lemma

PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

→ Correctness lemmas

  • V. Magron

NLVerify 16 / 22

slide-91
SLIDE 91

Proof of Lemma

PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

→ Correctness lemmas → easy because of same structure

  • V. Magron

NLVerify 16 / 22

slide-92
SLIDE 92

Proof of Lemma

PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

→ Correctness lemmas → easy because of same structure

  • V. Magron

NLVerify 16 / 22

slide-93
SLIDE 93

Proof of Lemma

PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

→ Correctness lemmas → easy because of same structure → basically proved in ring

  • V. Magron

NLVerify 16 / 22

slide-94
SLIDE 94

Proof of Lemma

PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

→ Correctness lemmas → easy because of same structure → basically proved in ring

  • V. Magron

NLVerify 16 / 22

slide-95
SLIDE 95

Proof of Lemma

PQ R PQ PolQ R PolI I

eval toPolQ = = toPolI eval Cencl ∈ Vencl

→ Correctness lemmas → easy because of same structure → basically proved in ring → follows from the correctness of interval arithmetic

  • V. Magron

NLVerify 16 / 22

slide-96
SLIDE 96

Introduction The Oracle Framework Interval Methods Coq Implementation Benchmarks Future Work

slide-97
SLIDE 97

Speedup NLVerify (p=50) vs. NLCertify

x-Axis: examples (ordered by time_nlc) y-Axis: ratio time_nlv / time_nlc

  • V. Magron

NLVerify 17 / 22

slide-98
SLIDE 98

Speedup NLVerify (p=50) vs. NLCertify

x-Axis: examples (ordered by time_nlc) y-Axis: ratio time_nlv / time_nlc

  • V. Magron

NLVerify 17 / 22

slide-99
SLIDE 99

Speedup Decreasing Precision

x-Axis: precision y-Axis: ratio time_formal / time_informal

  • V. Magron

NLVerify 18 / 22

slide-100
SLIDE 100

Speedup Decreasing Precision

x-Axis: precision y-Axis: ratio time_formal / time_informal

  • V. Magron

NLVerify 18 / 22

slide-101
SLIDE 101

Speedup Decreasing Precision (detail)

x-Axis: precision y-Axis: ratio time_formal / time_informal

  • V. Magron

NLVerify 19 / 22

slide-102
SLIDE 102

Precision vs. Accuracy w.r.t. NLCertify

x-Axis: precision y-Axis: ratio εp/ε∗ εp: loss with NLVerify precision p ε∗: loss with NLCertify

  • V. Magron

NLVerify 20 / 22

slide-103
SLIDE 103

Precision vs. Accuracy w.r.t. NLCertify

x-Axis: precision y-Axis: ratio εp/ε∗ εp: loss with NLVerify precision p ε∗: loss with NLCertify

  • V. Magron

NLVerify 20 / 22

slide-104
SLIDE 104

Introduction The Oracle Framework Interval Methods Coq Implementation Benchmarks Future Work

slide-105
SLIDE 105

Future Work

ToDo: Generalization to semi algebraic and transcendental functions

  • V. Magron

NLVerify 21 / 22

slide-106
SLIDE 106

Future Work

ToDo: Generalization to semi algebraic and transcendental functions Open: Can the performance be improved by using another SDP solver?

  • V. Magron

NLVerify 21 / 22

slide-107
SLIDE 107

Future Work

ToDo: Generalization to semi algebraic and transcendental functions Open: Can the performance be improved by using another SDP solver? Open: Is PolI the best polynomial representation for computation?

  • V. Magron

NLVerify 21 / 22

slide-108
SLIDE 108

Future Work

ToDo: Generalization to semi algebraic and transcendental functions Open: Can the performance be improved by using another SDP solver? Open: Is PolI the best polynomial representation for computation? Open: Should we use different precisions for the different interval

  • perations?
  • V. Magron

NLVerify 21 / 22

slide-109
SLIDE 109

Future Work

ToDo: Generalization to semi algebraic and transcendental functions Open: Can the performance be improved by using another SDP solver? Open: Is PolI the best polynomial representation for computation? Open: Should we use different precisions for the different interval

  • perations?

Open: Is there a better way to order arithmetic operations in the certificates?

  • V. Magron

NLVerify 21 / 22

slide-110
SLIDE 110

Future Work

ToDo: Generalization to semi algebraic and transcendental functions Open: Can the performance be improved by using another SDP solver? Open: Is PolI the best polynomial representation for computation? Open: Should we use different precisions for the different interval

  • perations?

Open: Is there a better way to order arithmetic operations in the certificates? Open: Would the computation be faster using 50bit words?

  • V. Magron

NLVerify 21 / 22

slide-111
SLIDE 111

Primal-dual Moment-SOS in COQ

M+(S): space of probability measures supported on S Σ[x]: polynomial sums of squares Theory: (Primal) (Dual) inf

  • S f dµ

= sup λ s.t. µ ∈ M+(S) s.t. λ ∈ R , f − λ ∈ Σ[x]

  • V. Magron

NLVerify 22 / 22

slide-112
SLIDE 112

Primal-dual Moment-SOS in COQ

Finite moment sequences z of measures in M+(S) Truncated quadratic module Σk[x] := Σ[x] ∩ R2k[x] Practice: (Moment) (SOS) inf

α

fα zα = sup λ s.t. Mk−vj(gj z) 0 , 0 ≤ j ≤ l, s.t. λ ∈ R , z1 = 1 f − λ ∈ Σk[x]

  • V. Magron

NLVerify 22 / 22

slide-113
SLIDE 113

End

Thank you for your attention! http://www-verimag.imag.fr/~magron