computation in real closed infinitesimal and transcendental extensions of the rationals

51
Computation in Real Closed Infinitesimal and Transcendental Extensions of the Rationals Leonardo de Moura Grant Passmore

Upload: armine

Post on 24-Feb-2016

54 views

Category:

Documents


0 download

DESCRIPTION

Computation in Real Closed Infinitesimal and Transcendental Extensions of the Rationals. Leonardo de Moura Grant Passmore. What?. Transcendental. Infinitesimal. FindRoots ( ). Real Closed Fields. Ordered Field Positive elements are squares All polynomials of odd degree have roots. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Computation in Real Closed Infinitesimal andTranscendental Extensions of the Rationals

Leonardo de MouraGrant Passmore

Page 2: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

What?

𝜋+𝜖<𝜋

1+𝜖𝜖2

>10100

FindRoots ()

√2+√3

InfinitesimalTranscendental

3√ 19− 3√ 29 + 3√ 49=3√ 3√2−1

Page 3: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Real Closed Fields

ℝ 𝑎𝑙𝑔

Real Algebraic Numbers

Ordered FieldPositive elements are squares All polynomials of odd degree have roots

Page 4: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Real Closed Fields

ℝ 𝑎𝑙𝑔=~ℚ

⊆Real Closure of the Rational Numbers

Page 5: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Real Closed Fields

ℝ 𝑎𝑙𝑔=~ℚ

⊆~𝐾 ,𝐾=ℚ(𝜋)

⊆Field extension

Page 6: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Real Closed Fields

ℝ 𝑎𝑙𝑔=~ℚ

⊆~𝐾 ,𝐾=ℚ(𝜋)

⊆~𝐾 1 ,𝐾 1=ℚ(𝜋 )(𝑒)⊆

Page 7: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Real Closed Fields

ℝ 𝑎𝑙𝑔=~ℚ

~𝐾 ,𝐾=ℚ(𝜋)

~𝐾 1,𝐾 1=ℚ(𝜋 )(𝑒)

⊆ℍ⊆

~𝐾 2 ,𝐾 2=ℚ (𝜋)(𝑒)(𝜖)⊇Hyperreals

Infinitesimal

Page 8: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Real Closed Fields

ℝ 𝑎𝑙𝑔=~ℚ

~𝐾 ,𝐾=ℚ(𝜋)

~𝐾 1,𝐾 1=ℚ(𝜋 )(𝑒)

⊆ℍ⊆

~𝐾 2 ,𝐾 2=ℚ (𝜋)(𝑒)(𝜖)⊇Hyperreals

Infinitesimal

Page 9: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Why?

NLSat: Nonlinear Arithmetic Solver (RCF) IJCAR 2012(joint work with Dejan Jovanovic)

Also relevant for any CAD-based procedure, and model generating solvers

NLSat bottlenecks:

• Real algebraic number computations

• Subresultant computations

Page 10: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

NLSat

𝑥→−√2Decide

Page 11: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

NLSat

𝑥→−√2DecideThere is no s.t.

Page 12: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

NLSat

𝑥→−√2DecideThere is no s.t. Conflict resolution (and backtrack) implies

Page 13: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

NLSat

𝑥→√2Decide𝑦→−1/2Decide

Page 14: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

NLSat

Example:

𝑦 5− 𝑦+(𝑥¿¿3+1)¿

Before: timeout (old package used Resultant theory)After: 0.05 secs

Page 15: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

NLSat + Transcendental constants

Nonlinear Arithmetic Solver

Transcendental Constants (e.g., MetiTarski)

Page 16: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Exact Nonlinear Optimization (on demand)

Find smallest s.t.

Output:unsatunboundedminimum()infimum()

Page 17: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Exact Nonlinear Optimization (on demand)

Find smallest s.t.

Observation 1:

Univariate case is easy

Inefficient solution:

Page 18: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Exact Nonlinear Optimization (on demand)

Find smallest s.t.

Observation 2:Adapt NLSat for solving the satisfiability modulo assignment problem.

Page 19: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Satisfiability Modulo Assignment (SMA)

Given and Output:sat satisfies

unsat() implies and is false

Page 20: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

No-good sampling

,

,

, …, …

Finite decomposition property:The sequence is finite

approximates

Page 21: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Exact Nonlinear Optimization (on demand)

−∞

Univariate minimization

Page 22: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Related WorkTranscendental constants

MetiTarskiInterval Constraint Propagation (ICP)

RealPaver, Rsolver, iSat, dReal

Reasoning with InfinitesimalsACL2, Isabelle/HOLNonstandard analysis

Real Closure of a Single Infinitesimal Extension [Rioboo]Puiseux series

Coste-Roy: encoding algebraic elements using Thom’s lemma

Page 23: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Our approach

Tower of extensions

Hybrid representation

Interval (arithmetic) + Thom’s lemma

Clean denominators

Non-minimal defining polynomials

Page 24: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Tower of extensions

Transcendental, Infinitesimal, or

Algebraic extension

Page 25: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Tower of extensions

Transcendental Extensions

Infinitesimal Extensions

Algebraic Extensions

ℚ (𝑡 1)… (𝑡𝑛 ) (𝜖1)… (𝜖𝑚 ) (𝛼1 )… (𝛼𝑘)

Page 26: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Tower of extensionsBasic Idea:

Given (computable) ordered field Implement

Page 27: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Tower of extensions(Computable) ordered field Operations:

Approximation: -interval

Refine approximation

Binary Rational

Page 28: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

(Computable) Transcendental Extensions

-interval

𝜋2+𝜋 −2𝜋+1

Elements of the extension are encoded as rational functions

Page 29: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

(Computable) Transcendental Extensions

12𝜋+ 1

𝜋+1=

12𝜋2

+12𝜋+1

𝜋+112𝜋+ 1

𝜋+1=

12𝜋2

+12𝜋+1

𝜋+1

Standard normal form for rational functionsGCD(numerator, denominator) = 1Denominator is a monic polynomial

Page 30: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

(Computable) Transcendental Extensions

Refine intervalInterval arithmeticRefine coefficients and extension

Zero iff numerator is the zero polynomialIf is not the zero polynomial, then can’t be zero, since is transcendental.

Remark is transcendental with respect to

is not transcendental with respect to

Page 31: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Infinitesimal Extensions

Every infinitesimal extension is transcendental

Rational functions

sign of first non zero coefficient

Non-refinable intervals

Page 32: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Algebraic Extensions

is a root of a polynomial with coefficients in Encoding as polynomial + interval does not work may not be Archimedian

Roots can be infinitely close to each other.Roots can be greater than any Real.

Thom’s LemmaWe can always distinguish the roots of a polynomial in a RCF using the signs of the derivatives

Page 33: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Algebraic Extensions

Three roots of

Roots: , ,

Page 34: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Algebraic Extensions

The elements of are polynomials .

Implement using polynomial arithmetic.

Compute sign (when possible) using interval arithmetic.

Page 35: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Algebraic Extensions

Let be =

We can normalize a by computing the polynomial remainder.

Polynomial Remainder

Page 36: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Algebraic Extensions: non-minimal Polynomials

Computing the inverse of , where

Find s.t.

Compute the extended GCD of and .

0

Page 37: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Algebraic Extensions: non-minimal Polynomials

We only use square-free polynomials in

They are not necessarily minimal in our implementation.

Solution: Dynamically refine , when computing inverses.

Only is is minimal

Page 38: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Algebraic Extensions

Given Feasible sign assignments of at roots of in Based on Sturm-Tarski TheoremBen-Or et al algorithm.

where

Page 39: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Algebraic Extensions: Clean Representation

Clean denominators of coefficients of in

Use pseudo-remainder when computing Sturm-sequences.

Page 40: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examplewhere is (

𝛼

Page 41: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examplewhere is (

𝛼

𝜋

1 1

Page 42: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examplewhere is (

𝛼

𝜋

1 1 1

√2

Page 43: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examplewhere is (

𝛼

𝜋

1 1 1

√2

𝜖

1

Page 44: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examplewhere is (

𝛼

𝜋

1 1 1

√2

𝜖

1𝜋1

Page 45: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examples

msqrt2, sqrt2 = MkRoots([-2, 0, 1])

print(msqrt2)

>> root(x^2 + -2, (-oo, 0), {})

print(sqrt2)

>> root(x^2 + -2, (0, +oo), {})

print(sqrt2.decimal(10))

>> 1.4142135623?

−2+𝑥2√2−√2

Page 46: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examplesr1,r2,r3,r4 = MkRoots([1, 0, -10, 0, 1])

msqrt2, sqrt2 = MkRoots([-2, 0, 1])

msqrt3, sqrt3 = MkRoots([-3, 0, 1])

print sqrt3 + sqrt2 == r4>> True

print sqrt3 + sqrt2 > r3>> True

print sqrt3 + msqrt2 == r3>> True

1−10 𝑥2+𝑥4

Page 47: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examples

pi = Pi()

rs = MkRoots([pi, - sqrt2, 0, 0, 0, 1])

print(len(rs))

>> 1

print(rs[0])

>> root(x^5 + -1 root(x^2 + -2, (0, +oo), {}) x + pi, (-oo, 0), {})

𝜋−√2𝑥+𝑥5

Page 48: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examples

eps = MkInfinitesimal()

print(eps < 0.000000000000001)

>> True

print(1/eps > 10000000000000000000000)

>> True

print(1/eps + 1 > 1/eps)

>> True

[r] = MkRoots([-eps, 0, 0, 1])

print(r > eps)

>> True −𝜖+𝑥33√𝜖>𝜖

Infinity value

Page 49: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Examples

[x] = MkRoots([-1, -1, 0, 0, 0, 1])

[y] = MkRoots([-197, 3131, -31*x**2, 0, 0, 0, 0, x])

[z] = MkRoots([-735*x*y, 7*y**2, -1231*x**3, 0, 0, y])

print x.decimal(10), y.decimal(10), z.decimal(10)

>> 1.1673039782?, 0.0629726948?, 31.4453571397?

instantaneously solved

Page 50: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Same Example in Mathematica

x = Root[#^5 - # - 1 &, 1]

y = Root[x #^7 - 31 x^2 #^2 + 3131 # - 197 &, 1]

z = Root[y #^5 - 1231 x^3 #^2 + 7 y^2 # - 735 x y &, 1]

10min, is encoded by a polynomial of degree 175.

Page 51: Computation in Real Closed Infinitesimal and Transcendental Extensions of the  Rationals

Conclusion

Package for computing with transcendental, infinitesimal and algebraic extensions.

Main application: exact nonlinear optimization.

Code is available online.

You can play with it online: http://rise4fun.com/z3rcf

More info: https://z3.codeplex.com/wikipage?title=CADE24

PSPACE-complete procedures