+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Galois: A Language for Proofs Using Galois Connections and Fork Algebras
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
PLMMS’09
August 21, 2009
Munich, Germany
Paulo Silva (UMinho)
Galois
PLMMS’09
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
PLMMS’09
4 / 28
8. Introduction
Motivation
Proof.
n
⇔
(a ÷ b) ÷ c
{ z ×y
n×c
⇔
(n × c) × b
x ⇔z
x ÷y }
a
{ multiplication is associative }
n × (c × b)
⇔
{ z ×y
n
Paulo Silva (UMinho)
x ÷y }
a÷b
{ z ×y
⇔
x ⇔z
a
x ⇔z
x ÷y }
a ÷ (c × b)
Galois
PLMMS’09
6 / 28
9. Introduction
Motivation
Proof.
n
⇔
(a ÷ b) ÷ c
{ z ×y
n×c
⇔
(n × c) × b
x ⇔z
x ÷y }
a
{ multiplication is associative }
n × (c × b)
⇔
{ z ×y
n
Paulo Silva (UMinho)
x ÷y }
a÷b
{ z ×y
⇔
x ⇔z
a
x ⇔z
x ÷y }
a ÷ (c × b)
Galois
PLMMS’09
6 / 28
10. Introduction
Motivation
Proof.
n
⇔
(a ÷ b) ÷ c
{ z ×y
n×c
⇔
(n × c) × b
x ⇔z
x ÷y }
a
{ multiplication is associative }
n × (c × b)
⇔
{ z ×y
n
Paulo Silva (UMinho)
x ÷y }
a÷b
{ z ×y
⇔
x ⇔z
a
x ⇔z
x ÷y }
a ÷ (c × b)
Galois
PLMMS’09
6 / 28
11. Introduction
Motivation
Proof.
n
⇔
(a ÷ b) ÷ c
{ z ×y
n×c
⇔
(n × c) × b
x ⇔z
x ÷y }
a
{ multiplication is associative }
n × (c × b)
⇔
{ z ×y
n
Paulo Silva (UMinho)
x ÷y }
a÷b
{ z ×y
⇔
x ⇔z
a
x ⇔z
x ÷y }
a ÷ (c × b)
Galois
PLMMS’09
6 / 28
12. Introduction
Motivation
Proof.
n
⇔
(a ÷ b) ÷ c
{ z ×y
n×c
⇔
(n × c) × b
x ⇔z
x ÷y }
a
{ multiplication is associative }
n × (c × b)
⇔
{ z ×y
n
Paulo Silva (UMinho)
x ÷y }
a÷b
{ z ×y
⇔
x ⇔z
a
x ⇔z
x ÷y }
a ÷ (c × b)
Galois
PLMMS’09
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 first-order logic
Typed language
Front-end for the Galculator
Paulo Silva (UMinho)
Galois
PLMMS’09
7 / 28
16. Theoretical background
Indirect equality
Proof.
a=b
⇔
{ Anti-symmetry }
a
⇔
b∧b
a
{ Indirect inequality }
∀ x :: x
⇔
a⇒x
b ∧ ∀ x :: x
b⇒x
a
{ Rearranging quantifiers }
∀ x :: x
⇔
a⇒x
b∧x
b⇒x
a
{ Mutual implication }
∀ x :: x
Paulo Silva (UMinho)
a⇔x
b
Galois
PLMMS’09
10 / 28
17. Theoretical background
Indirect equality
Proof.
a=b
⇔
{ Anti-symmetry }
a
⇔
b∧b
a
{ Indirect inequality }
∀ x :: x
⇔
a⇒x
b ∧ ∀ x :: x
b⇒x
a
{ Rearranging quantifiers }
∀ x :: x
⇔
a⇒x
b∧x
b⇒x
a
{ Mutual implication }
∀ x :: x
Paulo Silva (UMinho)
a⇔x
b
Galois
PLMMS’09
10 / 28
18. Theoretical background
Indirect equality
Proof.
a=b
⇔
{ Anti-symmetry }
a
⇔
b∧b
a
{ Indirect inequality }
∀ x :: x
⇔
a⇒x
b ∧ ∀ x :: x
b⇒x
a
{ Rearranging quantifiers }
∀ x :: x
⇔
a⇒x
b∧x
b⇒x
a
{ Mutual implication }
∀ x :: x
Paulo Silva (UMinho)
a⇔x
b
Galois
PLMMS’09
10 / 28
19. Theoretical background
Indirect equality
Proof.
a=b
⇔
{ Anti-symmetry }
a
⇔
b∧b
a
{ Indirect inequality }
∀ x :: x
⇔
a⇒x
b ∧ ∀ x :: x
b⇒x
a
{ Rearranging quantifiers }
∀ x :: x
⇔
a⇒x
b∧x
b⇒x
a
{ Mutual implication }
∀ x :: x
Paulo Silva (UMinho)
a⇔x
b
Galois
PLMMS’09
10 / 28
20. Theoretical background
Indirect equality
Proof.
a=b
⇔
{ Anti-symmetry }
a
⇔
b∧b
a
{ Indirect inequality }
∀ x :: x
⇔
a⇒x
b ∧ ∀ x :: x
b⇒x
a
{ Rearranging quantifiers }
∀ x :: x
⇔
a⇒x
b∧x
b⇒x
a
{ Mutual implication }
∀ x :: x
Paulo Silva (UMinho)
a⇔x
b
Galois
PLMMS’09
10 / 28
22. Theoretical background
Galois connections
Galois connections
Definition (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)
,
24. Theoretical background
Galois connections
Properties
Property
f a Bb⇔a 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
PLMMS’09
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 )
(h◦f ,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
PLMMS’09
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
)
PLMMS’09
15 / 28
28. Theoretical background
Fork algebras
Relation algebras
Extension of Boolean algebras
Original work of De Morgan, Peirce and Schröder
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
PLMMS’09
17 / 28
29. Theoretical background
Fork algebras
Relation algebras
Extension of Boolean algebras
Original work of De Morgan, Peirce and Schröder
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
PLMMS’09
17 / 28
30. Theoretical background
Fork algebras
Fork algebras
Limitation of relation algebras
Relations algebras can express first-order predicates with at most
three variables
Fork algebras
Extend relation algebras with a pairing operator
Equivalent in expressive and deductive power to first-order logic
Paulo Silva (UMinho)
Galois
PLMMS’09
18 / 28
31. Theoretical background
Fork algebras
Fork algebras
Limitation of relation algebras
Relations algebras can express first-order predicates with at most
three variables
Fork algebras
Extend relation algebras with a pairing operator
Equivalent in expressive and deductive power to first-order logic
Paulo Silva (UMinho)
Galois
PLMMS’09
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
b⊥a
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)
R⊆S
R=S
PLMMS’09
19 / 28
33. Theoretical background
Point-free transform
Point-free definitions
Definition (Galois connection)
f◦ ◦
B
=
A
◦
g
Definition (Indirect equality)
f =g
f =g
Paulo Silva (UMinho)
⇔
⇔
◦
f
◦
◦
Galois
f =
=g
◦
◦
g
◦
PLMMS’09
20 / 28
35. Galois and Galculator
Galois
Sub-languages of Galois
Module
Definition
GC
Definition
Axiom
Type
Theorem
Strategy
Proof Step
Fork
Formula
Rewriting
Combinator
Term
Derivation
Order
Paulo Silva (UMinho)
Function
Galois
Galois
connection
PLMMS’09
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
PLMMS’09
23 / 28
38. Summary
Summary
Summary
Fork algebras
Equivalent to first-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
PLMMS’09
25 / 28
39. Summary
Summary
Summary
Galois
Follows the mathematical concepts
Alternative to first-order languages
Typed approach
Galculator
Proof assistance prototype based on Galois connections
Innovative approach
Uses a point-free equational approach
Paulo Silva (UMinho)
Galois
PLMMS’09
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
PLMMS’09
27 / 28
41. The End
Download
Source code and documentation available from
www.di.uminho.pt/research/galculator
Contact
Questions to paufil@di.uminho.pt
Paulo Silva (UMinho)
Galois
PLMMS’09
28 / 28