Automating elementary number-theoretic proofs using Gr obner bases - - PowerPoint PPT Presentation

automating elementary number theoretic proofs using gr
SMART_READER_LITE
LIVE PREVIEW

Automating elementary number-theoretic proofs using Gr obner bases - - PowerPoint PPT Presentation

Automating elementary number-theoretic proofs using Gr obner bases John Harrison Intel Corporation CADE, Bremen Tue 17th July 2007 (12:0012:30) 0 Divisibility properties over the integers Often want to prove tedious lemmas like a n


slide-1
SLIDE 1

Automating elementary number-theoretic proofs using Gr¨

  • bner bases

John Harrison Intel Corporation CADE, Bremen Tue 17th July 2007 (12:00–12:30)

slide-2
SLIDE 2

Divisibility properties over the integers Often want to prove tedious lemmas like ∀a n x y. ax ≡ ay (mod n) ∧ coprime(a, n) ⇒ x ≡ y (mod n)

1

slide-3
SLIDE 3

Expanding divisibility properties Eliminate divisibility notions in terms of existentials:

  • s | t to ∃d. t = sd
  • s ≡ t (mod u) to ∃d. t − s = ud
  • coprime(s, t) to ∃x y. sx + ty = 1.

2

slide-4
SLIDE 4

Applied to the example ∀a n x y. (∃d. ay − ax = nd)∧ (∃u v. au + nv = 1) ⇒ (∃e. y − x = ne) Pull out the quantifiers in the antecedent: ∀a n x y d u v. ay − ax = nd ∧ au + nv = 1 ⇒ ∃e. y − x = ne

3

slide-5
SLIDE 5

Solving a more general problem We are already well into the realm of ‘undecidable in general’ thanks to the unsolvability of Hilbert’s 10th problem.

4

slide-6
SLIDE 6

Solving a more general problem We are already well into the realm of ‘undecidable in general’ thanks to the unsolvability of Hilbert’s 10th problem. Instead, attempt to prove the property holds in all rings. It turns out that this problem is decidable using well-known methods.

5

slide-7
SLIDE 7

Word problem for rings ∀x. p1(x) = 0 ∧ · · · ∧ pn(x) = 0 ⇒ q(x) = 0 holds in all rings iff q ∈ IdZ p1, . . . , pn i.e. there exist ‘cofactor’ polynomials with integer coefficients such that p1 · q1 + · · · + pn · qn = q

6

slide-8
SLIDE 8

Generalizes to linear existential theorems ∀x.

m

  • i=1

ei(x) = 0 ⇒ ∃y1 · · · yn. p1(x)y1 + · · · + pn(x)yn = a(x) holds in all rings iff (Horn-Herbrand) there are terms in the language

  • f rings s.t.

Ring ⊢ ∀x.

m

  • i=1

ei(x) = 0 ⇒ p1(x)t1(x) + · · · + pn(x)tn(x) = a(x) iff (previous theorem) a ∈ IdZ e1, . . . , em, p1, . . . , pn

7

slide-9
SLIDE 9

. . . and simultaneous linear existentials ∀x.

m

  • i=1

ei(x) = 0 ⇒ ∃y1 · · · yn. p11(x)y1 + · · · + p1n(x)yn = a1(x)∧ · · · ∧ pk1(x)y1 + · · · + pkn(x)yn = ak(x) holds in all rings iff (a1u1 + · · · + akuk) ∈ IdZ e1, . . . , em, (p11u1 + · · · + pk1uk), (p1nu1 + · · · + pknuk) where the ui are fresh variables.

8

slide-10
SLIDE 10

Solving ideal membership problems The most natural approach to solving ideal membership problem is Gr¨

  • bner bases.

Strictly, should use an integer version. However, can use the rational version speculatively and see if we get integer cofactors. With an instrumented version of Buchberger’s algorithm, can generate cofactors and hence easily generate a rigorous formal proof.

9

slide-11
SLIDE 11

In our example We want to prove (y − x) ∈ IdZ ay − ax − nd, au + nv − 1, n

10

slide-12
SLIDE 12

In our example We want to prove (y − x) ∈ IdZ ay − ax − nd, au + nv − 1, n This is true because y−x = (ay − ax − nd) · u + (au + nv − 1) · (x − y) + n · (ud + vy − vx)

11

slide-13
SLIDE 13

Extensions

  • Use linear equations x + a = b to substitute directly
  • Add greatest common divisors by characterizing theorem

g | a ∧ g | b ∧ (∃u v. au + bv = g)

  • Solve for existential witnesses sequentially to defer nonlinear
  • nes.

12

slide-14
SLIDE 14

Implementation in HOL Light A prototype of the procedure is available in the latest release of HOL Light, 2.20:

# INTEGER_RULE ‘!a1 a2 n1 n2:int. (a1 == a2) (mod (gcd(n1,n2))) ==> ?x. (x == a1) (mod n1) /\ (x == a2) (mod n2)‘;; 13

slide-15
SLIDE 15

Implementation in HOL Light A prototype of the procedure is available in the latest release of HOL Light, 2.20:

# INTEGER_RULE ‘!a1 a2 n1 n2:int. (a1 == a2) (mod (gcd(n1,n2))) ==> ?x. (x == a1) (mod n1) /\ (x == a2) (mod n2)‘;; 4 basis elements and 1 critical pairs 5 basis elements and 0 critical pairs 1 basis elements and 0 critical pairs Translating certificate to HOL inferences val it : thm = |- !a1 a2 n1 n2. (a1 == a2) (mod gcd (n1,n2)) ==> (?x. (x == a1) (mod n1) /\ (x == a2) (mod n2)) 14

slide-16
SLIDE 16

Various successful examples d|a ∧ d|b ⇒ d|(a − b) coprime(d, a) ∧ coprime(d, b) ⇒ coprime(d, ab) coprime(d, ab) ⇒ coprime(d, a) coprime(a, b) ∧ x ≡ y (mod a) ∧ x ≡ y (mod b) ⇒ x ≡ y (mod (ab)) m|r ∧ n|r ∧ coprime(m, n) ⇒ (mn)|r coprime(xy, x2 + y2) ⇔ coprime(x, y) coprime(a, b) ⇒ ∃x. x ≡ u (mod a) ∧ x ≡ v (mod b) ax ≡ ay (mod n) ∧ coprime(a, n) ⇒ x ≡ y (mod n) gcd(a, n) | b ⇒ ∃x. ax ≡ b (mod n)

15

slide-17
SLIDE 17

Failures Can’t solve problems where special properties of the integers are used 2|x2 + x This fails over some rings, e.g. R[x]. However, such examples very seldom appear in typical routine lemmas.

16

slide-18
SLIDE 18

Conclusions

  • Simple but surprisingly powerful idea; very useful for routine

lemmas

  • Another indication of the surprising versatility of ideal

membership

  • Hints at a general strategy for new decision methods:

17

slide-19
SLIDE 19

Conclusions

  • Simple but surprisingly powerful idea; very useful for routine

lemmas

  • Another indication of the surprising versatility of ideal

membership

  • Hints at a general strategy for new decision methods:

solve a more general problem

18