Diagrammatic syntax for algebra
Yves Lafont
Institut de Mathématiques de Luminy Université d’Aix-Marseille
Logic and interactions 2012 Algebra and computation
CIRM, Marseille 27 February
1
Presentations (of groups) by generators and relations
S 3 = ‹ a,b ⎜ a 2 , b 2 , (ab) 3 › = ‹ a,b ⎜ a 2 , b 2 , abab -1 a -1 b -1 › S 2 = ‹ a ⎜ a 2 › ↪ S 3
B 3 = ‹ a,b ⎜ abab -1 a -1 b -1 › ඈ S 3
G = ‹ a 1 ,…,a p ⎜ r 1 ,…,r q › = F/N where F = ‹ a 1 ,…,a p › and N is the normal subgroup of F generated by r 1 ,…,r q
2
Presentations of monoids
B 3 = ‹ a,b ⎜ bab = aba ›
B 3 = ‹ a,a’,b,b’ ⎜ aa’ = a’a = bb’ = b’b = 1, bab = aba › +
B 3+ = ‹ a,b ⎜ bab = aba › +
M = ‹ a 1 ,…,a p ⎜ u 1 = v 1 ,…, u q = v q › + = W / R * where W = {a 1 …,a p }* and R * is the congruence generated by the pairs (u 1 ,v 1 ), …, (u q ,v q )
This leads to the notion of reduction: u → R * v.
In fact, reductions define a monoidal category.
3
Presentations of PROs
generators:
relations:
The PRO is the free PRO D of diagrams
built with the generators, quotiented by the congruence R * generated by the relations.
= = =
A PRO is a strict monoidal category whose objects are natural numbers (with sum).
4
Diagrams
inputs/outputs :
sequential composition:
parallel composition:
Towards an Algebraic Theory of Boolean Circuits
Yves Lafont
∗February 12, 2003
Abstract
Boolean circuits are used to represent programs on finite data. Reversible Boolean circuits and quantum Boolean circuits have been introduced to modelize some physical aspects of computation.
Those notions are essential in complexity theory, but we claim that a deep mathematical theory is needed to make progress in this area. For that purpose, the recent developments of knot theory is a major source of inspiration.
Following the ideas of Burroni, we consider logical gates as generators for some algebraic structure with two compositions, and we are interested in the relations satisfied by those generators. For that purpose, we introduce canonical forms and rewriting systems. Up to now, we have mainly studied the basic case and the linear case, but we hope that our methods can be used to get presentations by generators and relations for the (reversible) classical case and for the (unitary) quantum case.
Keywords: boolean circuit; reversible gate; monoidal category; presentation by generators and relations;
canonical form; rewriting; symmetric group; alternating group; linear group; orthogonal group.
1 Introduction
We use diagrams to represent certain kinds of maps. If p and q are natural numbers, φ : p → q stands for a diagram with p inputs and q outputs. It is pictured as follows:
· · · φ
!"#$ q
#$!" p
· · ·
Typically, such a diagram represents:
• a map from {1, . . . , p} to {1, . . . , q} (basic case);
• a map from X
pto X
q, where X is a given set (classical case);
• a K-linear map from K
pto K
q, where K is a given field (linear case);
• a K -linear map from %
pV to %
qV , where V is a given vector space over a field K, and %
nV stands for the n-ary tensor product V ⊗ · · · ⊗ V (quantum case ).
The basic case corresponds to control flow diagrams and the classical case to data flow diagrams.
Diagrams may be composed in two different ways. For any φ : p → q and ψ : q → r, we have a diagram ψ ◦ φ : p → r, which corresponds to the usual composition of maps, and which is pictured as follows:
· · ·
· · ·
· · · φ ψ
This vertical (or sequential ) composition is associative, and we have an identity diagram id
p: p → p for each p, such that φ ◦ id
p= φ = id
q◦ φ for any φ : p → q. This id
pis pictured as follows:
· · ·
∗Universit´e de la M´editerran´ee & Institut de Math´ematiques de Luminy, UPR 9016 du CNRS, 163 avenue de Luminy, case 930, 13288 Marseille Cedex 9, France. E-mail: lafont@iml.univ-mrs.fr
1
Towards an Algebraic Theory of Boolean Circuits
Yves Lafont
∗February 12, 2003
Abstract
Boolean circuits are used to represent programs on finite data. Reversible Boolean circuits and quantum Boolean circuits have been introduced to modelize some physical aspects of computation.
Those notions are essential in complexity theory, but we claim that a deep mathematical theory is needed to make progress in this area. For that purpose, the recent developments of knot theory is a major source of inspiration.
Following the ideas of Burroni, we consider logical gates as generators for some algebraic structure with two compositions, and we are interested in the relations satisfied by those generators. For that purpose, we introduce canonical forms and rewriting systems. Up to now, we have mainly studied the basic case and the linear case, but we hope that our methods can be used to get presentations by generators and relations for the (reversible) classical case and for the (unitary) quantum case.
Keywords: boolean circuit; reversible gate; monoidal category; presentation by generators and relations;
canonical form; rewriting; symmetric group; alternating group; linear group; orthogonal group.
1 Introduction
We use diagrams to represent certain kinds of maps. If p and q are natural numbers, φ : p → q stands for a diagram with p inputs and q outputs. It is pictured as follows:
· · · φ
!"#$ q
#$!" p
· · ·
Typically, such a diagram represents:
• a map from {1, . . . , p} to {1, . . . , q} (basic case);
• a map from X
pto X
q, where X is a given set (classical case);
• a K -linear map from K
pto K
q, where K is a given field (linear case );
• a K -linear map from %
pV to %
qV , where V is a given vector space over a field K , and %
nV stands for the n-ary tensor product V ⊗ · · · ⊗ V (quantum case ).
The basic case corresponds to control flow diagrams and the classical case to data flow diagrams.
Diagrams may be composed in two different ways. For any φ : p → q and ψ : q → r, we have a diagram ψ ◦ φ : p → r, which corresponds to the usual composition of maps, and which is pictured as follows:
· · ·
· · ·
· · · φ ψ
This vertical (or sequential ) composition is associative, and we have an identity diagram id
p: p → p for each p, such that φ ◦ id
p= φ = id
q◦ φ for any φ : p → q. This id
pis pictured as follows:
· · ·
∗Universit´e de la M´editerran´ee & Institut de Math´ematiques de Luminy, UPR 9016 du CNRS, 163 avenue de Luminy, case 930, 13288 Marseille Cedex 9, France. E-mail: lafont@iml.univ-mrs.fr
1
For any φ : p → q and φ
!: p
!→ q
!, we have a diagram φ | φ
!: p + p
!→ q + q
!which is pictured as follows:
· · ·
· · · φ · · · φ
!· · ·
If φ represents f and φ
!represents f
!, the interpretation g of φ | φ
!depends on the considered case:
• in the basic case, g is the disjoint union (or coproduct ) f " f
!defined by g(i) = f (i) for i = 1, . . . , p and g(p + i) = q + f
!(i) for i = 1, . . . , p
!;
• in the classical case, g is the cartesian product f × f
!defined by g(x
1, . . . , x
p+p!) = (y
1, . . . , y
q+q!) where (y
1, . . . , y
q) = f (x
1, . . . , x
p) and (y
q+1, . . . , y
q+q!) = f
!(x
p+1, . . . , x
p+p!);
• in the linear case, g is the direct sum f ⊕ f
!defined by g (u ⊕ u
!) = f (u) ⊕ f
!(u
!) for u ∈ K
pand u
!∈ K
p!. Note that g coincides with the cartesian product f × f
!;
• in the quantum case, g is the tensor product f ⊗ f
!defined by g(u ⊗ u
!) = f (u)⊗ f
!(u
!) for u ∈ !
pV and u
!∈ !
p!V .
This horizontal (or parallel ) composition is associative, and the void diagram id
0: 0 → 0 is such that φ | id
0= φ = id
0| φ for any φ : p → q. Furthermore, we have id
p| id
p!= id
p+p!, and the two compositions are compatible in the following sense: for any φ : p → q, ψ : q → r, φ
!: p
!→ q
!, and ψ
!: q
!→ r
!, we have (ψ ◦ φ) | (ψ
!◦ φ
!) = (ψ | ψ
!) ◦ (φ | φ
!). This diagram is pictured as follows:
· · ·
· · ·
· · · φ ψ
· · · φ
!· · ·
· · · ψ
!In particular, for any φ : p → q and φ
!: p
!→ q
!, we get (φ | id
q!) ◦ (id
p| φ
!) = φ | φ
!= (id
q| φ
!) ◦ (φ | id
p!).
This corresponds to the following picture:
· · · φ
· · · φ
!· · ·
· · ·
φ φ
!· · ·
· · · · · ·
· · ·
· · · φ
!· · ·
φ · · ·
· · ·
= =
All this can be summarized as follows: the diagrams are the morphisms of a (strict) monoidal category whose objects are natural numbers (with addition). See [Mac71] for the notion of monoidal category.
Moreover, this monoidal category is freely generated by a given list of atomic diagrams called cells. In other words, all diagrams are built from identities and cells using vertical and horizontal composition, and an equality between two diagrams holds only if it follows from the above properties.
An elementary diagram is a diagram ξ of the form id
i| α | id
jwhere α is a cell:
· · · α
· · ·
· · · · · ·
It is easy to see that any diagram φ is a vertical composition of elementary diagrams ξ
1◦ · · · ◦ ξ
n, but this decomposition is not unique. In fact, two decompositions define the same diagram if and only if they are equivalent modulo the following commutation rule:
· · · · · ·
· · ·
· · · α
· · · · · · α
!· · ·
· · · α
· · · α
!· · ·
· · ·
· · ·
· · ·
· · · =
In particular, all decompositions of φ have the same length. This common length is called the size of φ:
it is the total number of cells in φ.
Diagrams may be interpreted in any monoidal category. We have already seen four examples:
• sets with disjoint union (basic case) or with cartesian product (classical case);
• vector spaces with direct sum (linear case) or with tensor product (quantum case).
We may also consider monoidal subcategories obtained by restricting the class of objects or the class of morphisms. For instance, we may limit our study to finite sets or to finite dimensional spaces, to bijective, surjective, or injective maps, and whenever it makes sense, to monotone, orthogonal, or unitary maps. In this paper, we give presentations by generators and relations for some of those monoidal categories.
2
interchange:
For any φ : p → q and φ
!: p
!→ q
!, we have a diagram φ | φ
!: p + p
!→ q + q
!which is pictured as follows:
· · ·
· · · φ · · · φ
!· · ·
If φ represents f and φ
!represents f
!, the interpretation g of φ | φ
!depends on the considered case:
• in the basic case, g is the disjoint union (or coproduct ) f " f
!defined by g(i) = f (i) for i = 1, . . . , p and g(p + i) = q + f
!(i) for i = 1, . . . , p
!;
• in the classical case, g is the cartesian product f × f
!defined by g(x
1, . . . , x
p+p!) = (y
1, . . . , y
q+q!) where (y
1, . . . , y
q) = f (x
1, . . . , x
p) and (y
q+1, . . . , y
q+q!) = f
!(x
p+1, . . . , x
p+p!);
• in the linear case, g is the direct sum f ⊕ f
!defined by g(u ⊕ u
!) = f (u) ⊕ f
!(u
!) for u ∈ K
pand u
!∈ K
p!. Note that g coincides with the cartesian product f × f
!;
• in the quantum case, g is the tensor product f ⊗ f
!defined by g(u ⊗ u
!) = f (u) ⊗ f
!(u
!) for u ∈ !
pV and u
!∈ !
p!V .
This horizontal (or parallel ) composition is associative, and the void diagram id
0: 0 → 0 is such that φ | id
0= φ = id
0| φ for any φ : p → q. Furthermore, we have id
p| id
p!= id
p+p!, and the two compositions are compatible in the following sense: for any φ : p → q, ψ : q → r, φ
!: p
!→ q
!, and ψ
!: q
!→ r
!, we have (ψ ◦ φ) | (ψ
!◦ φ
!) = (ψ | ψ
!) ◦ (φ | φ
!). This diagram is pictured as follows:
· · ·
· · ·
· · · φ ψ
· · · φ
!· · ·
· · · ψ
!In particular, for any φ : p → q and φ
!: p
!→ q
!, we get (φ | id
q!) ◦ (id
p| φ
!) = φ | φ
!= (id
q| φ
!) ◦ (φ | id
p!).
This corresponds to the following picture:
· · · φ
· · · φ
!· · ·
· · ·
φ φ
!· · ·
· · · · · ·
· · ·
· · · φ
!· · ·
φ · · ·
· · ·
= =
All this can be summarized as follows: the diagrams are the morphisms of a (strict) monoidal category whose objects are natural numbers (with addition). See [Mac71] for the notion of monoidal category.
Moreover, this monoidal category is freely generated by a given list of atomic diagrams called cells. In other words, all diagrams are built from identities and cells using vertical and horizontal composition, and an equality between two diagrams holds only if it follows from the above properties.
An elementary diagram is a diagram ξ of the form id
i| α | id
jwhere α is a cell:
· · · α
· · ·
· · · · · ·
It is easy to see that any diagram φ is a vertical composition of elementary diagrams ξ
1◦ · · · ◦ ξ
n, but this decomposition is not unique. In fact, two decompositions define the same diagram if and only if they are equivalent modulo the following commutation rule:
· · · · · ·
· · ·
· · · α
· · · · · · α
!· · ·
· · · α
· · · α
!· · ·
· · ·
· · ·
· · ·
· · · =
In particular, all decompositions of φ have the same length. This common length is called the size of φ:
it is the total number of cells in φ.
Diagrams may be interpreted in any monoidal category. We have already seen four examples:
• sets with disjoint union (basic case) or with cartesian product (classical case);
• vector spaces with direct sum (linear case) or with tensor product (quantum case).
We may also consider monoidal subcategories obtained by restricting the class of objects or the class of morphisms. For instance, we may limit our study to finite sets or to finite dimensional spaces, to bijective, surjective, or injective maps, and whenever it makes sense, to monotone, orthogonal, or unitary maps. In this paper, we give presentations by generators and relations for some of those monoidal categories.
2
5
Diagram rewriting
• Termination (existence of normal form)
• Confluence (uniqueness of normal form) Conflicts (critical peaks) :
Rewriting
Theorem: This rewrite system is noetherian and confluent.
!
Termination is straightforward.
!
Confluence follows from the previous results.
What are the critical peaks?
Rewriting
Theorem: This rewrite system is noetherian and confluent.
!
Termination is straightforward.
!
Confluence follows from the previous results.
What are the critical peaks?
Rewriting
Theorem: This rewrite system is noetherian and confluent.
!
Termination is straightforward.
!
Confluence follows from the previous results.
What are the critical peaks?
Rewriting
Theorem: This rewrite system is noetherian and confluent.
!
Termination is straightforward.
!
Confluence follows from the previous results.
What are the critical peaks?
Rewriting
Theorem: This rewrite system is noetherian and confluent.
!
Termination is straightforward.
!
Confluence follows from the previous results.
What are the critical peaks?
Canonical forms
Grammar for canonical forms:
is void or
· · ·
· · ·
· · ·
· · ·
· · ·
· · ·
· · ·
· · ·
· · ·
· · · or
is
Lemma:
! Any permutation corresponds to a unique canonical form.
! Any diagram reduces to a canonical form by these rules:
Canonical forms
Grammar for canonical forms:
is void or
· · ·
· · ·
· · ·
· · ·
· · ·
· · ·
· · ·
· · ·
· · ·
· · · or
is
Lemma:
! Any permutation corresponds to a unique canonical form.
! Any diagram reduces to a canonical form by these rules:
This system is convergent:
Rules:
6
Confluence of critical peaks
Confluence
Confluence of critical peaks:
Confluence
Confluence of critical peaks:
Confluence
Confluence of critical peaks:
Confluence
Confluence of critical peaks:
Confluence
Confluence of critical peaks:
7
Rewrite system for the PRO of finite maps
Rewrite rules for F
Termination is proved by using some polynomial interpretation. This rewrite system is convergent.
8
The 68 critical peaks
The 68 critical peaks for F
9
Proof nets (by Girard)
axiom and cut:
connectives:
cut elimination:
A A ⊥
A B
⊗
A⊗B
A B
⅋ A ⅋ B A A ⊥
→ ⊗ ⅋ →
+ correctness criterion + boxes
but no associativity (and no commutativity)
10
Interaction combinators
duplicator: eraser:
constructor:
interaction rules:
Theorem: this interaction system is universal.
11
Remarks
This has nothing to do with algebra.
But those rules are very similar to the definition of a Hopf algebra: it is a generalized bialgebra.
There is no conflict (except if we insist on
explicite encoding of axiom, cut, and exchange).
Interaction nets are a paradigm of distributed (strongly deterministic) computation.
12
Computation with
!-diagrams
Many computations happen in algebras rather than in groups or in monoids.
The syntax must be linearized: use linear combinations of diagrams (called !-diagrams) instead of diagrams.
In that case, a congruence corresponds to a two-sided ideal.
Sometimes, relations need to be consider as rules (explicitely oriented). Sometimes, they do not.
13
Examples of !-diagrams (Rannou 2010)
14