Cylindrical Algebraic Decomposition in Coq MAP 2010 - Logro no - - PowerPoint PPT Presentation

cylindrical algebraic decomposition in coq
SMART_READER_LITE
LIVE PREVIEW

Cylindrical Algebraic Decomposition in Coq MAP 2010 - Logro no - - PowerPoint PPT Presentation

Cylindrical Algebraic Decomposition in Coq MAP 2010 - Logro no 13-16 November 2010 Assia Mahboubi INRIA Microsoft Research Joint Centre (France) INRIA Saclay Ile-de-France Ecole Polytechnique, Palaiseau November 8th 2010 This


slide-1
SLIDE 1

Cylindrical Algebraic Decomposition in Coq

MAP 2010 - Logro˜ no 13-16 November 2010 Assia Mahboubi

INRIA Microsoft Research Joint Centre (France) INRIA Saclay – ˆ Ile-de-France ´ Ecole Polytechnique, Palaiseau

November 8th 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 8th 2010 1 / 24

slide-2
SLIDE 2

Aim of these talks

Issues related to quantifier the theory of real closed fields. In the context of the formalization of these results in the Coq proof assistant. Sketch of the lectures:

◮ Quantifier elimination, real closed fields ◮ Projection of semi-algebraic sets, from algebra to logics ◮ Cylindrical Algebraic Decomposition ◮ Topics in formal proofs in real algebraic geometry

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 2 / 24

slide-3
SLIDE 3

The language of ring

Terms are: Variables : x, y, . . . Constants 0 and 1 Opposites: −t Sums: t1 + t2 Differences: t1 − t2 Products: t1 ∗ t2 Terms are polynomial expressions in the variables.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 3 / 24

slide-4
SLIDE 4

First order formulas in the language of ordered rings

Atoms are: Equalities: t1 = t2 Inequalities: t1 ≥ t2, t1 > t2, t1 ≤ t2, t1 < t2 Formulas are: Atoms Conjunctions: F1 ∧ F2 Disjunctions: F1 ∨ F2 Negations: ¬F Implications: F1 ⇒ F2 Quantifications: ∃x, F, ∀x, F Formulas are quantified systems of polynomial constraints.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 4 / 24

slide-5
SLIDE 5

A taste of the first order language of ordered rings

” Any polynomial of degree one has a real root.”

x y

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 5 / 24

slide-6
SLIDE 6

A taste of the first order language of ordered rings

” Any polynomial of degree one has a real root.”

x y

∀a∀b, ∃x, a ∗ x + b = 0

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 5 / 24

slide-7
SLIDE 7

A taste of the first order language of ordered rings

” Any polynomial of degree two has at most two real roots.”

x y x y x y

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 6 / 24

slide-8
SLIDE 8

A taste of the first order language of ordered rings

” Any polynomial of degree two has at most two real roots.”

x y x y x y

∀a∀b, ∀c∀x∀y∀z, (ax2 + bx + c = 0 ∧ ay2 + by + c = 0 ∧ az2 + bz + c = 0) ⇒ (x = y ∨ x = z ∨ y = z)

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 6 / 24

slide-9
SLIDE 9

A taste of the first order language of ordered rings

” Any two ellipses have at most four intersection points.”

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 7 / 24

slide-10
SLIDE 10

A taste of the first order language of ordered rings

” Any two ellipses have at most four intersection points.” Similar to the previous example.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 7 / 24

slide-11
SLIDE 11

A taste of the first order language of ordered rings

” Any two ellipses have at most four intersection points.” Similar to the previous example. ” Any polynomial of degree 18 has at least one root.”

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 7 / 24

slide-12
SLIDE 12

A taste of the first order language of ordered rings

” Any two ellipses have at most four intersection points.” Similar to the previous example. ” Any polynomial of degree 18 has at least one root.” Difficult to prove yet syntactically correct.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 7 / 24

slide-13
SLIDE 13

A taste of the first order language of ordered rings

” Any polynomial has less roots than its degree.”

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 8 / 24

slide-14
SLIDE 14

A taste of the first order language of ordered rings

” Any polynomial has less roots than its degree.” This demands higher order.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 8 / 24

slide-15
SLIDE 15

A taste of the first order language of ordered rings

” Any polynomial has less roots than its degree.” This demands higher order. ” Any number is either rational or non rational.”

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 8 / 24

slide-16
SLIDE 16

A taste of the first order language of ordered rings

” Any polynomial has less roots than its degree.” This demands higher order. ” Any number is either rational or non rational.” The language is not precise enough.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 8 / 24

slide-17
SLIDE 17

Ordered rings, ordered fields

The theory of discrete ordered rings is:

◮ The theory of rings ◮ A total order ≤ ◮ Compatibility of the order with ring operations

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 9 / 24

slide-18
SLIDE 18

Ordered rings, ordered fields

The theory of discrete ordered rings is:

◮ The theory of rings ◮ A total order ≤ ◮ Compatibility of the order with ring operations

The theory of discrete ordered fields is:

◮ Defined on an extended signature (inverse, quotient) ◮ The theory of fields ◮ A total order ≤ ◮ Compatibility of the order with field operations

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 9 / 24

slide-19
SLIDE 19

Ordered rings, ordered fields

The theory of discrete ordered rings is:

◮ The theory of rings ◮ A total order ≤ ◮ Compatibility of the order with ring operations

The theory of discrete ordered fields is:

◮ Defined on an extended signature (inverse, quotient) ◮ The theory of fields ◮ A total order ≤ ◮ Compatibility of the order with field operations

Any first order formula in discrete ordered fields has an equivalent in the theory of discrete ordered fields (possibly with more quantifiers).

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 9 / 24

slide-20
SLIDE 20

Examples of real closed fields

Real numbers Computable real numbers Real algebraic numbers The field of Puiseux series on a RCF R

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 10 / 24

slide-21
SLIDE 21

First order theory of real closed fields

Theorem (Tarski (1948))

The classical theory of real closed fields admits quantifier elimination and is hence decidable. There exists an algorithm which proves or disproves any theorem of real algebraic geometry (which can be expressed in this first order language).

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 11 / 24

slide-22
SLIDE 22

Remarks

We can decide whether an arbitrary given polynomial with rational coefficients has a root.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 12 / 24

slide-23
SLIDE 23

Remarks

We can decide whether an arbitrary given polynomial with rational coefficients has a root. But we do not know whether this root is an integer or a rational.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 12 / 24

slide-24
SLIDE 24

Remarks

We can decide whether an arbitrary given polynomial with rational coefficients has a root. But we do not know whether this root is an integer or a rational. There is indeed no algorithm to decide the solvability of diophantine equations (Matiyasevitch, 1970).

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 12 / 24

slide-25
SLIDE 25

Remarks

There is an algorithm which determines: If your piano can be moved through the stairs and then to your dinning room; If a (specified)robot can reach a desired position from an initial state; The solution to Birkhoff interpolation problem; ...

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 13 / 24

slide-26
SLIDE 26

Remarks

This algorithm gives the complete topological description of semi-algebraic varieties.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 14 / 24

slide-27
SLIDE 27

Remarks

This algorithm gives the complete topological description of semi-algebraic varieties.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 14 / 24

slide-28
SLIDE 28

Remarks

This algorithm gives the complete topological description of semi-algebraic varieties. Which seems a rather intricate problem...

Thanks to Oliver Labs for the pictures.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 14 / 24

slide-29
SLIDE 29

Formalization in the Coq system

The Coq system: a type theory based proof assistant. Coq is a (functional) programming language. Coq has such a rich type system that the types of objects can be theorem statements. In the absence of axiom, proofs should be intuitionistic. Examples.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 15 / 24

slide-30
SLIDE 30

Quantifier Elimination

A theory T on a language Σ with a set of variables V admits quantifier elimination if for every formula φ( x) ∈ F(Σ, V), there exists a quantifier free formula ψ( x) ∈ F(Σ, V) such that: T ⊢ ∀ x, ((φ( x) ⇒ ψ( x)) ∧ (ψ( x) ⇒ φ( x)))

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 16 / 24

slide-31
SLIDE 31

Formal definition of a first order theory

For an arbitrary type term of terms, formulas are: Inductive formula (term : Type) : Type := | Equal of term & term | Leq of term & term | Unit of term | Not of formula | And of formula & formula | Or of formula & formula | Implies of formula & formula | Exists of nat & formula | Forall of nat & formula.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 17 / 24

slide-32
SLIDE 32

Formal definition of the ring signature

Terms on the language of fields. Inductive term : Type := | Var of nat | Const0 : term | Const1 : term | Add of term & term | Opp of term | Mul of term & term | Inv of term

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 18 / 24

slide-33
SLIDE 33

Proving quantifier elimination on real closed fields

To state the theorem of quantifier elimination, we could: Build the list T of formulas describing the axioms of a real closed field structure. Formalize first order provability, T ⊢ φ, a predicate of type: Definition entails (T : seq (formula R))(phi : formula R) : bool := ...

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 19 / 24

slide-34
SLIDE 34

Theory of real closed fields

We use a record type to define a type which is simultaneously equipped with a field signature and a theory of real closed fields. Record rcf := RealClosedField{ carrier : Type; Req : carrier -> carrier -> bool; zero : carrier;

  • ne : carrier
  • pp : carrier -> carrier;

add : carrier -> carrier -> carrier; mul : carrier -> carrier -> carrier; inv : carrier -> carrier; _ : associative add; _ : commutative add; _ : left_id zero add; _ : left_inverse zero opp add; ...}.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 20 / 24

slide-35
SLIDE 35

Theory of real closed fields, and models

Now we can equip a given type R with a structure of real closed field as soon as we have: implemented the required operations over this type proved the required specifications over these operations To formalize a concrete instance of real closed field structure: Definition R_rcf : RealClosedField R R0 R1 Radd ...

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 21 / 24

slide-36
SLIDE 36

Theory of real closed fields, and models

Given an instance R_rcf of the real closed field structure , ie. R_rcf : rcf We can interpret any element of the type term in the type of the domain: Fixpoint eval (R_rcf : rcf) (ctxt : seq (carrier R_rcf))(t : term) : (carrier R_rcf) := ...

◮ A variable Var n is interpreted by the n-th element of the context; ◮ A term (Plus t1 t2) is interpreted by a sum in the real closed fields; ◮ ...

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 22 / 24

slide-37
SLIDE 37

Theory of real closed fields, and models

Given an instance R_rcf of the real closed field structure , ie. R_rcf : rcf We can interpret any first order formula of type (formula term) as a first order Coq statement quantified over the type of the domain: Fixpoint holds (R_rcf : rcf) (ctxt : seq (carrier R_rcf)) (f : formula term) : Prop := ...

◮ An atom (Leq t1 t2) is interpreted by:

(eval R_rcf ctxt t1) <= (eval R_rcf ctxt t1)

◮ A formula (Or f1 f2) is interpreted by a Coq disjunction; ◮ ...

Hence (R_rcf : rcf) can be understood as a formalization of: “R_rcf is a model of the rcf theory of real closed fields” .

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 23 / 24

slide-38
SLIDE 38

Semantic quantifier elimination

A theory T on a language Σ with a set of variables V admits semantic quantifier elimination if for every φ ∈ F(Σ, V), there exists a quantifier free formula ψ ∈ F(Σ, V) such that for any model M of T, and for any list e of values, M, e | = φ iff M, e | = ψ This is the (a priori weaker) quantifier elimination result we formalize.

  • A. Mahboubi (INRIA)

Cylindrical Algebraic Decomposition in Coq November 8th 2010 24 / 24