Cylindrical Algebraic Decomposition in Coq

Similar documents
Cylindrical Algebraic Decomposition in Coq

Cylindrical Algebraic Decomposition in Coq

Cylindrical Algebraic Decomposition in Coq

Construction of Real Algebraic Numbers in Coq

Programming and certifying the CAD algorithm inside the Coq system

Computer Algebra: General Principles

Constructive Algebra in Type Theory

Change of Ordering for Regular Chains in Positive Dimension

A HYPERGEOMETRIC INEQUALITY

Computer Algebra in Coq using reflection

Differential Resultants and Subresultants

Real Root Isolation of Regular Chains.

FORMAL PROOFS IN REAL ALGEBRAIC GEOMETRY: FROM ORDERED FIELDS TO QUANTIFIER ELIMINATION

Parametric euclidean algorithm

Dividing Polynomials: Remainder and Factor Theorems

Construction of real algebraic numbers in Coq

Reliable and Efficient Geometric Computation p.1/27

Real Solving on Algebraic Systems of Small Dimension

Overview of Computer Algebra

Fast Polynomial Multiplication

x 2 + 6x 18 x + 2 Name: Class: Date: 1. Find the coordinates of the local extreme of the function y = x 2 4 x.

Computing with polynomials: Hensel constructions

Procedure for Graphing Polynomial Functions

Chapter 8. Exploring Polynomial Functions. Jennifer Huss

P-adic numbers. Rich Schwartz. October 24, 2014

A Maple Package for Parametric Matrix Computations

Proofs of transcendance

Factorization in Domains

Understanding Branch Cuts of Expressions

Lecture Notes Math 371: Algebra (Fall 2006) by Nathanael Leedom Ackerman

Chapter 14: Divisibility and factorization

Horizontal and Vertical Asymptotes from section 2.6

Notes on generating functions in automata theory

Limit computable integer parts

Ruppert matrix as subresultant mapping

Preliminaries and Complexity Theory

A heuristic prover for real inequalities

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

Exact Arithmetic on a Computer

Polynomial Review Problems

Algebra Homework, Edition 2 9 September 2010

Mathematical Olympiad Training Polynomials

Improved algorithms for solving bivariate systems via Rational Univariate Representations

Lecture 7: Schwartz-Zippel Lemma, Perfect Matching. 1.1 Polynomial Identity Testing and Schwartz-Zippel Lemma

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

Mathematics Standards for High School Algebra II

Dynamic Computations Inside the Algebraic Closure of a Valued Field

Algebra 2 Standards. Essential Standards:

Handbook of Logic and Proof Techniques for Computer Science

Solving bivariate systems using Rational Univariate Representations

MEMORIAL UNIVERSITY OF NEWFOUNDLAND

Section 4.3. Polynomial Division; The Remainder Theorem and the Factor Theorem

a + bi by sending α = a + bi to a 2 + b 2. To see properties (1) and (2), it helps to think of complex numbers in polar coordinates:

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 31 OCTOBER 2018

Decision Procedures 1: Survey of decision procedures

Course 311: Michaelmas Term 2005 Part III: Topics in Commutative Algebra

8. Prime Factorization and Primary Decompositions

Public-key Cryptography: Theory and Practice

Contents. O-minimal geometry. Tobias Kaiser. Universität Passau. 19. Juli O-minimal geometry

TEST CODE: PMB SYLLABUS

The p-adic numbers. Given a prime p, we define a valuation on the rationals by

Supplementary Material for MTH 299 Online Edition

Isomorphisms between pattern classes

Efficient Characteristic Set Algorithms for Equation Solving in Finite Fields and Application in Analysis of Stream Ciphers 1

Computer Algebra and Formal Proof

Algebraic Numbers in Isabelle/HOL

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

SOLVING ALGEBRAIC INEQUALITIES

Real Solving on Bivariate Systems with Sturm Sequences and SLV Maple TM library

Algebraic Varieties. Notes by Mateusz Micha lek for the lecture on April 17, 2018, in the IMPRS Ringvorlesung Introduction to Nonlinear Algebra

Section 4.2 Polynomial Functions of Higher Degree

Semester Review Packet

Computations Modulo Regular Chains

Verified Implementation of Exact Real Arithmetic in Type Theory

Chapter 4. Greatest common divisors of polynomials. 4.1 Polynomial remainder sequences

Contents. 4 Arithmetic and Unique Factorization in Integral Domains. 4.1 Euclidean Domains and Principal Ideal Domains

Lecture 15: Algebraic Geometry II

Fast Computations in the Lattice of Polynomial Rational Function Fields

Chapter 3: Polynomial and Rational Functions

Questionnaire for CSET Mathematics subset 1

Math123 Lecture 1. Dr. Robert C. Busby. Lecturer: Office: Korman 266 Phone :

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

A NEW DEFINITION OF NATURAL NUMBERS And its Incidence on Teaching Mathematics Diego Pareja Heredia. Universidad del Quindío. Armenia.

Choosing a variable ordering for truth-table invariant cylindrical algebraic decomposition by incremental triangular decomposition

Chapter 1: Preliminaries and Error Analysis

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS

Reading Mathematical Expressions & Arithmetic Operations Expression Reads Note

Chinese Remainder Theorem

HOMEWORK 11 MATH 4753

Formal methods in analysis

Review all the activities leading to Midterm 3. Review all the problems in the previous online homework sets (8+9+10).

Homework 7 solutions M328K by Mark Lindberg/Marie-Amelie Lawn

A Constructive Formalisation of Semi-algebraic Sets and Functions

Formal Groups. Niki Myrto Mavraki

Common Core State Standards for Mathematics - High School PARRC Model Content Frameworks Mathematics Algebra 2

Computing Real Roots of Real Polynomials

be any ring homomorphism and let s S be any element of S. Then there is a unique ring homomorphism

Math 309 Notes and Homework for Days 4-6

Lecture 7.5: Euclidean domains and algebraic integers

Transcription:

Cylindrical Algebraic Decomposition in Coq MAP 2010 - Logroño 13-16 November 2010 Assia Mahboubi INRIA Microsoft Research Joint Centre (France) INRIA Saclay Île-de-France École Polytechnique, Palaiseau November 12th 2010 This work has been partially funded by the FORMATH project, nr. 243847, of the FET program within the 7th Framework program of the European Commission. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 1 / 32

Motivations An example from J. Avigad (Types Summer School 2005) Heuristic procedures for the reals Remember the example: verify (1 + using the following hypotheses: ε 3(C + 3) ) real(n) < K x real(n) (K/2)x 0 < C 0 < ε < 1 Idea: work backwards, applying obvious monotonicity rules. p. 44/50 (* Finished transaction in 163. secs *) A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 2 / 32

Reflexion, large scale, again Starting from a goal to be proved on an object t : T: Implement a Coq decision procedure f : T -> bool (P t): Prop Prove a correctness lemma: Lemma f_correct: forall x : T, (f x)= true -> (P x) Apply the correctness lemma to the goal: This reduces the goal to proving that: apply (f_correct t). (f t)= true The goal will be proved if the execution of the program f on the value t actually produces the value true A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 3 / 32

Cylindrical Algebraic Decomposition So far we have seen an elementary yet intractable decision algorithm; One of our motivation is to enhance the automation of the formalization process; We cannot hope anything reasonable from an algorithm with a complexity which is a tower of exponential; Collin s cylindrical algebraic decomposition is the best known and implemented algorithm: QEPCAD Redlog Axiom Mathematica (Coq) A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 4 / 32

Work plan Implementation of a cylindrical algebraic decomposition algorithm in the Coq system; Remarks: Formal proof of correctness of the algorithm. Both the program and the correctness proof are challenging This provides a complete formally guaranteed program Yet efficient decision might benefit from other approaches A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 5 / 32

Cylindrical Algebraic Decomposition A cylindrical algebraic decomposition (CAD) of R n is a sequence S 1,..., S n such that: i, S is a partition of R i (of level i); Each cell of level 1 is a point or an interval; For each cell S of level i, S R is the disjoint union of cells of level i + 1 For each cell S of level i, there exists ξ 1,..., ξ n algebraic functions such that a cell of level i + 1 above S is: either the graph of a semi-algebraic function or a band between the graph of two algebraic functions A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 6 / 32

Cylindrical Algebraic Decomposition Let P Q[X 1,..., X n ] a finite family of polynomials, and R a real closed field: A finite partition of R is adapted to P if on each cell, each P P has a constant sign. There exists a CAD S 1,..., S n such that S n is adapted to P. Moreover we can compute a sample of points for S n. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 7 / 32

Cylindrical Algebraic Decomposition R[X 1,..., X n ] R[X 1,..., X n 1 ] P = P 1,..., P s projection Q = Q 1,..., Q t CAD and signs for P lifting CAD and signs for Q R n R n 1 A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 8 / 32

Cylindrical Algebraic decomposition for X + Y A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 9 / 32

Remarks The polynomials studied are the same for all the cells at a same level. There is much more than one point per connected components. The tree structure is used for deciding prenex formulas. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 10 / 32

Deciding X, Y, X + Y A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 11 / 32

Deciding X, Y, XY A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 12 / 32

Description of the algorithm: key issues Lifting phase: re-compose a CAD for R k+1 from a CAD for R k. One dimensional real root isolation Projection phase: determine the family of polynomials each partition should be adapted to. Control over the growth of the number of cells. In all what follows we focus on archimedean discrete real closed fields. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 13 / 32

Base case: real root isolation Input : P Q[X ] a finite family of polynomials; Problem: partition the real line R into cells over which every P P has a constant sign; Solution: determine and isolate all the roots of the polynomials in P We consider only square free polynomials: P P has the same roots as P, but they are simple. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 14 / 32

Base case: real root isolation A root isolation for P is a list of disjoint open intervals and points, such that: Every root of P belongs to an element of the list; Every element of the list contains a single root of P. The method: Bound the problem using Cauchy bounds: x, i n a ix i = 0 x a n 1 i n a i Process by dichotomy using Descartes law of sign based tools. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 15 / 32

Base case: real root isolation If the family P has a single element P. We can program a test T (P, a, b) such that: If T (P, a, b) = 0 then P has no root in ]a, b[ If T (P, a, b) = 1 then P has a single root in ]a, b[ Else the situation is unknown But if a and b are close enough we are in one of the two first cases. A simple dichotomy process isolates the roots of P. A sample of points is easy to compute. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 16 / 32

Base case: real root isolation If the family P has n + 1 elements. Bound globally the interval of interest; Compute l isolating the roots of P 1,..., P n ; Outside intervals delimited by elements of l, compute an isolation of the roots of P n+1 ; On each ]A, B[ in l, containing a root of P i : determine the sign of P n+1 at A and B (evaluation) determine the sign of Pn+1 at the unique root of P i contained in ]A, B[ (gcd and refinement) determine all the signs of Pn+1 on the interval ]A, B[ Add the new sample points to the previous list The base case of CAD is addressed, up to programming the test. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 17 / 32

Bernstein polynomials Let c, d Q, p N. The Bernstein basis of degree p is defined by: ( ) p (X c) i (d X ) p i B p,i (c, d) = i (d c) p The are obtained from the standard basis by translation, dilatation, and reverse of the coefficients. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 18 / 32

Bernstein polynomials The test T (P, a, b) for P of degree d is implemented by the number of sign changes in the list of coefficients of P in B d (a, b): Descartes law of signs The dichotomy process means recomputing Bernstein coefficients on sub-intervals: de Casteljau algorithm The archemedeanity is crucial to termination. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 19 / 32

Analysis of the method The base case deals with polynomials in Q[X ]. But the whole process is still valid if polynomials are in D[X ] where D a sub-ring of R containing Q for which: The sign of any d D is computable; The sign of P(q) where q is rational and P D[X ] is computable. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 20 / 32

Lifting phase Suppose we have constructed a CAD S k of R k ; We need to construct a CAD S k+1 of R k+1 for the family P Q[X 1,..., X k, X k+1 ] A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 21 / 32

Lifting phase Cells of level k + 1 are pieces of the cylinder S R; For each cell S S k, we have computed a sample point x S ; The cells obtained as pieces of S S k are described by a root isolation of the univariate family P(x S ) Q[x S 1,... xs k, X k+1] A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 22 / 32

Lifting phase This lifting phase is addressed by our remark on the base case if D := Q[x1 S,... xs k ] satisfies the conditions: The sign of elements in Q[x1 S,... xs k ] can be computed; The sign of P(x1 S,... xs k, r) with P Q[X 1,..., X k, X k+1 ] and r Q can be computed. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 23 / 32

Algebraic numbers Cells which are thin in at least one dimension make algebraic number arithmetic unavoidable. Algebraic numbers in Q n alg are represented by triangular encodings. Required computations are obtained by recursive use of root isolation. Triangular encodings include a bounding box which can be used for testing sign conditions by interval arithmetic computations. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 24 / 32

Projection operator Given P Q[X 1,..., X k, X k+1 ], a family Q Q[X 1,..., X k ] is a good projection if on any partition on R k adapted to Q, and any cell S of such a partition: For every P P, the degree and the number of roots of P(x, X k+1 ) is independent from the choice of x S For every P 1, P 2 P, the degree of gcd(p 1 (x), P 2 (x)) is independent from the choice of x S. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 25 / 32

Multivariate gcds The last condition demands investigating gcds for univariate polynomials with coefficients in a ring, like Q[X ][Y ]: In an Euclidean ring, the gcd of two elements are computed using the Euclidean algorithm. But if R is an Euclidean ring, there is no reason R[X ] should be Euclidean as well. Be we can still use pseudo-euclidean division, and pseudo-gcd. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 26 / 32

Multivariate gcds A pseudo Euclidean division corrects the default of divisibility so that the Euclidean division can still be tractable inside the ring: ca = B Q + R with d(a) = n, d(b) = m, lcoef (A) = α, lcoef (B) = β. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 27 / 32

Multivariate gcds A pseudo Euclidean division corrects the default of divisibility so that the Euclidean division can still be tractable inside the ring: ca = B Q + R with d(a) = n, d(b) = m, lcoef (A) = α, lcoef (B) = β. There are many suitable choices for c: The Jacobi factor c := bm n m+1 is always sufficient. But leads to an exponential growth in the size of the coefficients. We can always simplify polynomials by their content. But this leads to recursive gcd computations. A trade-off is not easy to find but crucial in our case. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 27 / 32

Multivariate gcds The control over gcd computation is obtained by allowing one more degree of freedom in the definition of each pseudo-division step: ca = B Q + dr Such a chain is called a pseudo-remainder sequence. The subresultant algorithm defines a pseudo-remainder sequence which achieves the best trade off (linear in the degrees and bitsize of coefficients). The vanishing of leading coefficients of subresultant polynomial control the degree of the gcd of A and B. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 28 / 32

The actual projection operator There are many way of achieving the projection. Here we project P Q[X 1,..., X k, X k+1 ] on P by: Saturating P with relevant truncations Adding to Q all the possibly vanishing in a row head coefficients of polynomials in P Adding to Q all the leading coefficients of subresultant polynomials of P and P for P P Adding to Q all the leading coefficients of subresultant polynomials of P 1 and P 2 for P 1, P 2 P A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 29 / 32

The actual projection operator Over a cell S of a partition adapted to Q: Polynomials in P have a constant degree, since their leading coefficients do not cancel. Each polynomial of P have a constant number of root, since a change in the number of roots would imply a change in the multiplicity of a root (by continuity). The pairwise gcds also do not change their degree hence the behavior of common roots is stable over the S. A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 30 / 32

The complete algorithm The projection operator The isolation of roots of univariate polynomials in D[X ] The recursive process Base case uses the isolation process with D = Q Recursive case builds sign computations elements of D(α) for any α Q alg and root isolation for polynomials in D(α)[X ] A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 31 / 32

Conclusion This has been implemented in the Coq system. It s purely functional program, but could benefit from semi-imperative features. It should be completed by other incomplete, possibly certificate based decision methods (sums of squares...). The correctness proof is in progress. It will benefit from the recent developments in formalized mathematics (algebraic hierarchy, linear, multilinear algebra,...) A. Mahboubi (INRIA) Cylindrical Algebraic Decomposition in Coq November 12th 2010 32 / 32