Presented at PLMMS'09, Munich, Germany in August 21, 2011.
Citation preview
1. Galois: A Language for Proofs Using Galois connections and
Fork Algebras Paulo Silva1 Joost Visser2 Jos Oliveira1 1 CCTC
University of Minho Braga, Portugal 2 Software Improvement Group
The Netherlands PLMMS09 August 21, 2009 Munich, Germany Paulo Silva
(UMinho) Galois PLMMS09 1 / 28
4. Introduction Motivation Whole division Prove (a b) c = a (c
b) for b and c = 0. Easy if is the real number division Also valid
in natural numbers but the proof is not so straightforward Paulo
Silva (UMinho) Galois PLMMS09 4 / 28
5. Introduction Motivation Whole division specication Implicit
denition c =x y r : 0 r 0) PLMMS09 5 / 28
6. Introduction Motivation Whole division specication Implicit
denition c =x y r : 0 r 0) PLMMS09 5 / 28
7. Introduction Motivation Whole division specication Implicit
denition c =x y r : 0 r 0) PLMMS09 5 / 28
8. Introduction Motivation Proof. n (a b) c { z y nc (n c) b x
z x y } a { multiplication is associative } n (c b) { z y n Paulo
Silva (UMinho) x y } ab { z y x z a x z x y } a (c b) Galois
PLMMS09 6 / 28
9. Introduction Motivation Proof. n (a b) c { z y nc (n c) b x
z x y } a { multiplication is associative } n (c b) { z y n Paulo
Silva (UMinho) x y } ab { z y x z a x z x y } a (c b) Galois
PLMMS09 6 / 28
10. Introduction Motivation Proof. n (a b) c { z y nc (n c) b x
z x y } a { multiplication is associative } n (c b) { z y n Paulo
Silva (UMinho) x y } ab { z y x z a x z x y } a (c b) Galois
PLMMS09 6 / 28
11. Introduction Motivation Proof. n (a b) c { z y nc (n c) b x
z x y } a { multiplication is associative } n (c b) { z y n Paulo
Silva (UMinho) x y } ab { z y x z a x z x y } a (c b) Galois
PLMMS09 6 / 28
12. Introduction Motivation Proof. n (a b) c { z y nc (n c) b x
z x y } a { multiplication is associative } n (c b) { z y n Paulo
Silva (UMinho) x y } ab { z y x z a x z x y } a (c b) Galois
PLMMS09 6 / 28
13. Introduction Objectives Objectives Galculator = Galois
connection + calculator Build a proof assistant based on Galois
connections, their algebra and associated tactics Galois Language
for mathematical reasoning Equivalent to rst-order logic Typed
language Front-end for the Galculator Paulo Silva (UMinho) Galois
PLMMS09 7 / 28
15. Theoretical background Indirect equality Indirect
inequality Denition (Indirect inequality) a x :: x ax b a Paulo
Silva (UMinho) b b x :: b x a x Galois PLMMS09 9 / 28
16. Theoretical background Indirect equality Proof. a=b {
Anti-symmetry } a bb a { Indirect inequality } x :: x ax b x :: x
bx a { Rearranging quantiers } x :: x ax bx bx a { Mutual
implication } x :: x Paulo Silva (UMinho) ax b Galois PLMMS09 10 /
28
17. Theoretical background Indirect equality Proof. a=b {
Anti-symmetry } a bb a { Indirect inequality } x :: x ax b x :: x
bx a { Rearranging quantiers } x :: x ax bx bx a { Mutual
implication } x :: x Paulo Silva (UMinho) ax b Galois PLMMS09 10 /
28
18. Theoretical background Indirect equality Proof. a=b {
Anti-symmetry } a bb a { Indirect inequality } x :: x ax b x :: x
bx a { Rearranging quantiers } x :: x ax bx bx a { Mutual
implication } x :: x Paulo Silva (UMinho) ax b Galois PLMMS09 10 /
28
19. Theoretical background Indirect equality Proof. a=b {
Anti-symmetry } a bb a { Indirect inequality } x :: x ax b x :: x
bx a { Rearranging quantiers } x :: x ax bx bx a { Mutual
implication } x :: x Paulo Silva (UMinho) ax b Galois PLMMS09 10 /
28
20. Theoretical background Indirect equality Proof. a=b {
Anti-symmetry } a bb a { Indirect inequality } x :: x ax b x :: x
bx a { Rearranging quantiers } x :: x ax bx bx a { Mutual
implication } x :: x Paulo Silva (UMinho) ax b Galois PLMMS09 10 /
28
21. Theoretical background Indirect equality Indirect equality
Denition (Indirect equality) a=b x :: x ax b a=b Paulo Silva
(UMinho) x :: a x b x Galois PLMMS09 11 / 28
22. Theoretical background Galois connections Galois
connections Denition (Galois connection) Given two preordered sets
(A, A ) and (B, B ) and two functions g f Bo A and A o B , the pair
(f , g) is a Galois connection if and only if, for all a A and b B:
f a B b a A gb Graphical notation A Al f g Paulo Silva (UMinho)
,
23. B B or (A, Galois A) o (f ,g) (B, B) PLMMS09 12 / 28
24. Theoretical background Galois connections Properties
Property f a Bba Agb a A a f a B f a b B b g b A g b a A g (f a) f
(g b) B b f (g (f a)) = f a g (f (g b)) = g b g (b B b ) = g b A g
b f (a A a ) = f a B f a g B= A f A = B Paulo Silva (UMinho)
Description Shunting rule Monotonicity (LA) Monotonicity (UA) Lower
cancellation Upper cancellation Semi-inverse Semi-inverse
Distributivity (UA over meet) Distributivity (LA over join)
Top-preservation (UA) Bottom-preservation (LA) Galois PLMMS09 13 /
28
25. Theoretical background Galois connections Galois
connections Algebra Identity connection (A, A) o (id,id) (A, A)
Composition if (A, ) o (f ,g) (B, ) and (B, ) o (h,k ) (hf ,g k )
(C, ) then (A, ) o (C, ) Composition is associative and the
identity is its unit. Galois connections form a category. Paulo
Silva (UMinho) Galois PLMMS09 14 / 28
26. Theoretical background Galois connections Galois
connections Algebra Converse if (A, ) o (f ,g) (B, ) then (B, ) o
(g,f ) (A, ) Relator For every relator F if (A, ) o (f ,g) Paulo
Silva (UMinho) (B, ) then (FA, F Galois (F f ,F g) )o (FB, F )
PLMMS09 15 / 28
28. Theoretical background Fork algebras Relation algebras
Extension of Boolean algebras Original work of De Morgan, Peirce
and Schrder Further developed by Tarski in his attempt to formalize
set theory without variables Amenable for syntactic manipulation
Only one inference rule is needed: substitution of equals by equals
Equational reasoning Paulo Silva (UMinho) Galois PLMMS09 17 /
28
29. Theoretical background Fork algebras Relation algebras
Extension of Boolean algebras Original work of De Morgan, Peirce
and Schrder Further developed by Tarski in his attempt to formalize
set theory without variables Amenable for syntactic manipulation
Only one inference rule is needed: substitution of equals by equals
Equational reasoning Paulo Silva (UMinho) Galois PLMMS09 17 /
28
30. Theoretical background Fork algebras Fork algebras
Limitation of relation algebras Relations algebras can express
rst-order predicates with at most three variables Fork algebras
Extend relation algebras with a pairing operator Equivalent in
expressive and deductive power to rst-order logic Paulo Silva
(UMinho) Galois PLMMS09 18 / 28
31. Theoretical background Fork algebras Fork algebras
Limitation of relation algebras Relations algebras can express
rst-order predicates with at most three variables Fork algebras
Extend relation algebras with a pairing operator Equivalent in
expressive and deductive power to rst-order logic Paulo Silva
(UMinho) Galois PLMMS09 18 / 28
32. Theoretical background Point-free transform Point-free
transform summary Pointwise (bRa) bRa bSa bSa bSa True False b=a
aRb c :: bRc cSa x :: xRb xSa x :: aRx bSx bRa cSa bRa dSc a, b ::
bRa bSa a, b :: bRa bSa Paulo Silva (UMinho) Galois Pointfree b(R)a
b(R S)a b(R S)a b a ba b id a bR a b(R S)a b(R S)a b(S/R)a (b, c)(R
S)a (b, d)(R S)(a, c) RS R=S PLMMS09 19 / 28
33. Theoretical background Point-free transform Point-free
denitions Denition (Galois connection) f B = A g Denition (Indirect
equality) f =g f =g Paulo Silva (UMinho) f Galois f = =g g PLMMS09
20 / 28
34. Galois and Galculator Outline 1 Introduction Motivation
Objectives 2 Theoretical background Indirect equality Galois
connections Fork algebras Point-free transform 3 Galois and
Galculator Galois Galculator 4 Summary Summary Future work Paulo
Silva (UMinho) Galois PLMMS09 21 / 28
35. Galois and Galculator Galois Sub-languages of Galois Module
Denition GC Denition Axiom Type Theorem Strategy Proof Step Fork
Formula Rewriting Combinator Term Derivation Order Paulo Silva
(UMinho) Function Galois Galois connection PLMMS09 22 / 28
36. Galois and Galculator Galculator Architecture of Galculator
Combine GC Derive Laws Relation algebra Derive Properties Derive
Theory domain Derive Rules TRS Strategies Combine Paulo Silva
(UMinho) Galois PLMMS09 23 / 28
38. Summary Summary Summary Fork algebras Equivalent to
rst-order logic (same expressive and deductive power) Single
inference rule: substitution of equals for equals Equational No
variables Integrates Galois connections and indirect equality
Galois connections Provide structure Introduce semantic information
in syntactic reasoning Paulo Silva (UMinho) Galois PLMMS09 25 /
28
39. Summary Summary Summary Galois Follows the mathematical
concepts Alternative to rst-order languages Typed approach
Galculator Proof assistance prototype based on Galois connections
Innovative approach Uses a point-free equational approach Paulo
Silva (UMinho) Galois PLMMS09 26 / 28
40. Summary Future work Future work Mechanization of point-free
transform Automated proofs Extension of the type system
Free-theorems Evaluation of the language Integration with host
theorem provers (e.g., Coq) Paulo Silva (UMinho) Galois PLMMS09 27
/ 28
41. The End Download Source code and documentation available
from www.di.uminho.pt/research/galculator Contact Questions to
[email protected] Paulo Silva (UMinho) Galois PLMMS09 28 /
28