25
Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions F Towards Automatic Proofs of Inequalities Involving Elementary Functions Behzad Akbarpour and Lawrence C. Paulson University of Cambridge Computer Laboratory Automated Reasoning Group PDPAR 2006 B. Akbarpour and L. C. Paulson PDPAR 2006 1 / 25

Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Towards Automatic Proofs of InequalitiesInvolving Elementary Functions

Behzad Akbarpour and Lawrence C. Paulson

University of CambridgeComputer Laboratory

Automated Reasoning Group

PDPAR 2006

B. Akbarpour and L. C. Paulson PDPAR 2006 1 / 25

Page 2: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Outline

Introduction and Motivation

Related Work

Bounds for Elementary Functions

Example

Problems Solved

Conclusions

Future Works

B. Akbarpour and L. C. Paulson PDPAR 2006 2 / 25

Page 3: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Introduction and Motivation

I There are many applications in mathematics and engineeringwhere proofs involving functions such as ln, exp, sin, cos, etc.are required.

I In their formalization of the Prime Number Theorem, Avigadand his colleagues (from CMU), spent much time provingsimple facts involving logarithms.

I Other applications are not difficult to find.

B. Akbarpour and L. C. Paulson PDPAR 2006 3 / 25

Page 4: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Introduction and Motivation, Cont’d

I Our Starting Point: The theory of Real Closed Fields (RCF) -that is, the real numbers with addition and multiplication - isdecidable.

I However: Inequalities involving elementary functions lieoutside the scope of decision procedures, and can only besolved using heuristic methods. (Richardson’s Theorem)

I Our Idea: Replace each occurrence of an elementary functionby an upper or lower bound, as appropriate. Then, supply thereduced algebraic inequality problem to a decision procedurefor the theory of real closed fields (RCF).

B. Akbarpour and L. C. Paulson PDPAR 2006 4 / 25

Page 5: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Related Work

I Tarski found the first quantifier elimination procedure whichsolves problems over the reals involving + - * / in the 1930s.

I Collins introduced the first feasible method (cylindricalalgebraic decomposition) in 1975.

I One freely-available implementation is the QEPCAD decisionprocedure.

I HOL Light provides REAL QELIM CONV and REAL SOS .

I Other heuristic procedures such as Hunt et. al. and Tiwari.

I Munoz and Lester’s method is based on upper and lowerbounds for the elementary functions, coupled with intervalarithmetic.

B. Akbarpour and L. C. Paulson PDPAR 2006 5 / 25

Page 6: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Families of Lower and Upper Bounds

Functions f : (R, N) → R and f : (R, N) → R are closed under Qsuch that:

f (x , n) ≤ f (x) ≤ f (x , n),

f (x , n) ≤ f (x , n + 1)

f (x , n + 1) ≤ f (x , n)

limx→∞ f (x , n) = f (x) = limx→∞ f (x , n)

B. Akbarpour and L. C. Paulson PDPAR 2006 6 / 25

Page 7: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Bounds for the Exponential Function

exp(x , n) =

2(n+1)+1∑i=0

x i

i !if −1 ≤ x < 0

exp(x , n) =

2(n+1)∑i=0

x i

i !if −1 ≤ x < 0

exp(0, n) = exp(0, n) = 1

exp(x , n) =1

exp(−x , n)if 0 < x ≤ 1

exp(x , n) =1

exp(−x , n)if 0 < x ≤ 1

B. Akbarpour and L. C. Paulson PDPAR 2006 7 / 25

Page 8: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Bounds for the Exponential Function, Cont’d

exp(x , n) = exp(x/m, n)m if x < −1, m = −bxc

exp(x , n) = exp(x/m, n)m if x < −1, m = −bxc

exp(x , n) = exp(x/m, n)m if 1 < x , m = b−xc

exp(x , n) = exp(x/m, n)m if 1 < x , m = b−xc

B. Akbarpour and L. C. Paulson PDPAR 2006 8 / 25

Page 9: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

0

5

10

15

20

25

-3 -2 -1 0 1 2 3

lower bound of exp(x)with n=1lower bound of exp(x)with n=2

exp(x)upper bound of exp(x)with n=1upper bound of exp(x)with n=2

B. Akbarpour and L. C. Paulson PDPAR 2006 9 / 25

Page 10: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Bounds for the Logarithmic Function

ln(x , n) =2n∑i=1

(−1)i+1 (x − 1)i

iif 1 < x ≤ 2

ln(x , n) =2n+1∑i=1

(−1)i+1 (x − 1)i

iif 1 < x ≤ 2

ln(1, n) = ln(1, n) = 0

ln(x , n) = − ln

(1

x, n

), if 0 < x < 1

ln(x , n) = − ln

(1

x, n

), if 0 < x < 1

B. Akbarpour and L. C. Paulson PDPAR 2006 10 / 25

Page 11: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Bounds for the Logarithmic Function, Cont’d

ln(x , n) = m ln(2, n) + ln(y , n) if x > 2, x = 2my , 1 < y ≤ 2

ln(x , n) = m ln(2, n) + ln(y , n) if x > 2, x = 2my , 1 < y ≤ 2

B. Akbarpour and L. C. Paulson PDPAR 2006 11 / 25

Page 12: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

-3

-2

-1

0

1

2

3

0 1 2 3 4 5 6 7 8 9 10

lower bound of ln(x)with n=1lower bound of ln(x)with n=2

ln(x)upper bound of ln(x)with n=1upper bound of ln(x)with n=2

B. Akbarpour and L. C. Paulson PDPAR 2006 12 / 25

Page 13: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

A Simple Example Concerning Exponentials

I Main Goal:

0 ≤ x ≤ 1 =⇒ exp x ≤ 1 + x + x2.

I It suffices to prove this algebraic formula:

0 ≤ x ≤ 1 =⇒ exp (x , n) ≤ 1 + x + x2

I Case Analysis:

x = 0 or 0 < x ≤ 1

B. Akbarpour and L. C. Paulson PDPAR 2006 13 / 25

Page 14: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

A Simple Example Concerning Exponentials, Cont’d

I If x = 0 then exp(0, n) = 1 ≤ 1 + 0 + 02 = 1, trivially.

I If 0 < x ≤ 1, then

exp(x , n) =

2(n+1)+1∑i=0

(−x)i

i !

−1

Setting n = 0, it suffices to prove(1 + (−x) +

(−x)2

2+

(−x)3

6

)−1

≤ 1 + x + x2.

B. Akbarpour and L. C. Paulson PDPAR 2006 14 / 25

Page 15: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

0

2

4

6

8

10

12

14

-1 -0.5 0 0.5 1 1.5 2 2.5

exp(x)1 + x + x^2

upper bound of exp(x)with n=1upper bound of exp(x)with n=2

B. Akbarpour and L. C. Paulson PDPAR 2006 15 / 25

Page 16: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

An Extended Example Concerning Logarithms

I Main Goal:

−1

2< x ≤ 3 =⇒ ln(1 + x) ≤ x .

I It suffices to prove this algebraic formula:

1

2< 1 + x ≤ 4 =⇒ ln(1 + x , n) ≤ x

I Case Analysis:

1

2< 1+x < 1 or 1+x = 1 or 1 < 1+x ≤ 2 or 2 < 1+x ≤ 4

B. Akbarpour and L. C. Paulson PDPAR 2006 16 / 25

Page 17: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

An Extended Example Concerning Logarithms, Cont’d

I If 1 + x = 1, then x = 0 and ln(1 + x , n) = ln(1, n) = 0 ≤ x .

I If 1 < 1 + x ≤ 2, then

ln(1 + x , n) =2n+1∑i=1

(−1)i+1 ((1 + x)− 1)i

i=

2n+1∑i=1

(−1)i+1 x i

i

Setting n = 0 yields ln(1 + x , n) = x and reduces ourinequality to the trivial x ≤ x .

B. Akbarpour and L. C. Paulson PDPAR 2006 17 / 25

Page 18: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

An Extended Example Concerning Logarithms, Cont’d

I If 2 < 1 + x ≤ 4, then we need to find a positive integer mand some y such that 1 + x = 2my and 1 < y ≤ 2. Clearlym = 1. In this case, putting n = 0, we have

2n+1∑i=1

(−1)i+1 (2− 1)i

i+

2n+1∑i=1

(−1)i+1 (y − 1)i

i= 1 + (y − 1)

= y

≤ 2y − 1

= x .

B. Akbarpour and L. C. Paulson PDPAR 2006 18 / 25

Page 19: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

An Extended Example Concerning Logarithms, Cont’d

I If 12 < 1 + x < 1, then 1 < 1/(1 + x) < 2. Putting n = 1, we

have

ln(1 + x , n) = − ln

(1

1 + x, n

)= −

2n∑i=1

(−1)i+1( 11+x − 1)

i

i

=2n∑i=1

(−1)i

i

(−x

1 + x

)i

=

(x

1 + x

)+

(1

2

)(−x

1 + x

)2

.

B. Akbarpour and L. C. Paulson PDPAR 2006 19 / 25

Page 20: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

An Extended Example Concerning Logarithms, Cont’d

Now (x

1 + x

)+

(1

2

)(−x

1 + x

)2

≤ x ⇐⇒

x(1 + x) +1

2x2 ≤ x(1 + x)2 ⇐⇒

x +3

2x2 ≤ x + 2x2 + x3 ⇐⇒

−1

2x2 ≤ x3 ⇐⇒

−1

2≤ x

which holds because 12 < 1 + x .

B. Akbarpour and L. C. Paulson PDPAR 2006 20 / 25

Page 21: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

-3

-2

-1

0

1

2

3

4

5

-1 0 1 2 3 4 5

upper bound ln(1+x)with n=3upper bound ln(1+x)with n=2upper bound ln(1+x)with n=1

ln (1+x)x

B. Akbarpour and L. C. Paulson PDPAR 2006 21 / 25

Page 22: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Logarithmic Problems

−1

2≤ x ≤ 3 =⇒ x

1 + x≤ ln(1 + x) ≤ x

0 ≤ x ≤ 3 =⇒ |ln(1 + x)− x | ≤ x2

|x | ≤ 1

2=⇒ |ln(1 + x)− x | ≤ 2x2

0 ≤ x ≤ 0.5828 =⇒ |ln(1− x)| ≤ 3x

2

B. Akbarpour and L. C. Paulson PDPAR 2006 22 / 25

Page 23: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Exponential Problems

0 ≤ x ≤ 1 =⇒ e(x−x2) ≤ 1 + x

−1 ≤ x ≤ 1 =⇒ 1 + x ≤ ex

−1 ≤ x ≤ 1 =⇒ ex ≤ 1

1− x

−1

2≤ x =⇒ ex/(1+x) ≤ 1 + x

−1 ≤ x ≤ 0 =⇒ ex ≤ 1 +x

2

0 ≤ |x | ≤ 1 =⇒ 1

4|x | ≤ |ex − 1| ≤ 7

4|x |

B. Akbarpour and L. C. Paulson PDPAR 2006 23 / 25

Page 24: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Conclusions

I Our preliminary investigations are promising.

I We have used the method described above to solve about 30problems.

I We manually reduced each problem to algebraic form, thentried to solve the reduced problems using three different tools.

I QEPCAD solved all of the problems, usually taking less thanone second.

I HOL Light’s sum-of-squares tool REAL SOS solved all of theproblems but two, again usually in less than a second.

I HOL Light’s quantifier elimination tool REAL QELIM CONVsolved all of the problems but three. It seldom required morethan five seconds

B. Akbarpour and L. C. Paulson PDPAR 2006 24 / 25

Page 25: Towards Automatic Proofs of Inequalities Involving ...disi.unitn.it/~rseba/pdpar06/SLIDES_TALKS/Akbarpour.pdf · solved using heuristic methods. (Richardson’s Theorem) I Our Idea:

Outline Introduction and Motivation Related Work Bounds for Elementary Functions Example Problems Solved Conclusions Future Works

Future Works

I Much work remains to be done before this procedure can beautomated.

I We need to experiment with a variety of upper and lowerbounds.

I Case analyses will still be inevitable, so we need techniques toautomate them in the most common situations.

I We have to evaluate different ways of deciding the RCFproblems that are finally generated.

B. Akbarpour and L. C. Paulson PDPAR 2006 25 / 25