Lectures on Algebraic Rewriting
Philippe Malbos
Institut Camille Jordan Université Claude Bernard Lyon 1
- December 2019 - PHILIPPE MALBOS Univ Lyon, Université Claude Bernard Lyon 1 [email protected] CNRS UMR 5208, Institut Camille Jordan 43 blvd. du 11 novembre 1918 F-69622 Villeurbanne cedex, France
— December 6, 2019 - 17:47 — Contents
1 Abstract Rewriting 1 1.1 Abstract Rewriting Systems ...... 2 1.2 Confluence ...... 4 1.3 Normalisation ...... 6 1.4 From local to global confluence ...... 10
2 String Rewriting 13 2.1 Preliminaries: one and two-dimensional categories ...... 13 2.2 String rewriting systems ...... 21 2.3 The word problem ...... 25 2.4 Branchings ...... 26 2.5 Completion ...... 30 2.6 Existence of finite convergent presentations ...... 32
3 Coherent presentations and syzygies 35 3.1 Introduction ...... 35 3.2 Categorical preliminaries ...... 37 3.3 Coherent presentation of categories ...... 40 3.4 Finite derivation type ...... 42 3.5 Coherence from convergence ...... 44
4 Two-dimensional homological syzygies 51 4.1 Preliminaries on modules ...... 51 4.2 Monoids of finite homological type ...... 55 4.3 Squier’s homological theorem ...... 61 4.4 Homology of monoids with integral coefficients ...... 63 4.5 Historical notes ...... 65
iii CONTENTS
5 Linear rewriting 69 5.1 Linear 2-polygraphs ...... 70 5.2 Linear rewriting steps ...... 77 5.3 Termination for linear 2-polygraphs ...... 79 5.4 Monomial orders ...... 80 5.5 Confluence and convergence ...... 82 5.6 The Critical Branchings Theorem ...... 85 5.7 Coherent presentations of algebras ...... 90
6 Paradigms of linear rewriting 95 6.1 Composition Lemma ...... 96 6.2 Reduction operators ...... 98 6.3 Noncommutative Gröbner bases ...... 99
7 Anick’s resolution 103 7.1 Homology of an algebra ...... 104 7.2 Anick’s chains ...... 105 7.3 Anick’s resolution ...... 107 7.4 Computing homology with Anick’s resolution ...... 113 7.5 Minimality of Anick’s resolution ...... 115
Bibliography 118
iv CHAPTER 1
Abstract Rewriting
Contents 1.1 Abstract Rewriting Systems ...... 2 1.2 Confluence ...... 4 1.3 Normalisation ...... 6 1.4 From local to global confluence ...... 10
The principle of rewriting comes from combinatorial algebra. It was introduced by Thue when he considered systems of transformation rules on combinatorial objects such as strings, trees or graphs in order to solve the word problem, [Thu14]. Given a collection of objects and a system of transformation rules on these objects, the word problem is
INSTANCE: given two objects, QUESTION: can one of these objects be transformed to the other by means of a finite number of applications of the transformation rules? Dehn described the word problem for finitely presented groups, [Deh10] and Thue studied this problems for strings, which correspond to the word problem for finitely presented monoids, [Thu14]. Note that it was only much later, that the problem was shown to be undecidable, independently by Post [Pos47] and Markov [Mar47a, Mar47b]. Afterwards, the word problem have been considered in many contexts in algebra and in computer science. Far beyond the precursor works on this decidabilty problem on strings, rewriting theory has been mainly developed in theoretical computer science, producing numerous variants corresponding to differ- ent syntaxes of the formulas being transformed: strings in a monoid, [BO93, GM18], paths in a graph,
1 1.1. Abstract Rewriting Systems terms in an algebraic theory, [BN98, Klo92, Ter03], terms modulo, λ-terms, trees, Boolean circuits, [Laf03], graph grammars, etc. Rewriting appears also on various forms in algebra, for commutative algebras, [Buc65, Buc87], Lie algebras, [Shi62], with the notion of Gröbner-Shirshov bases, or asso- ciative algebras, [Bok76, Ber78, Mor94, Ufn95, GHM19] and operads, [DK10], as well as on topolog- ical objects, such as Reidemeister moves, knots or braids, [Bur01], or in higher-dimensional categories, [GM09, GM12a, Mim10, Mim14]. Many of the basic definitions and fundamental properties of these forms of rewriting can be stated on the most abstract version of rewriting that is given by a binary relation on set. In this chapter, we present the notion of abstract rewriting system and the main abstract rewriting properties used in these lectures. We refer the reader to [BN98, Klo92, Ter03] for a complete account on the abstract rewriting theory.
1.1. ABSTRACT REWRITING SYSTEMS
1.1.1. Abstract Rewriting Systems. An abstract rewriting system, ARS for short, is a data (A, I) made of a set A and a sequence I of binary relations on A indexed by a set I, that is, → →I = ( α)α∈I, and α ⊆ A × A.
The relation is called reduction→ or →rewrite relation on→A. An element (a, b) in the relation will be denoted by a b, and we said that b is a one-step reduct of a, and that a is a one-step expansion of b. An element of is called a reduction step. In most cases the elements of A have a syntactic→ or graphical nature→ (string, term, tree, graph, polynomial...). We will denoted by ≡ the syntactical or graphical identity. →
1.1.2. Reduction sequence. A reduction sequence, or rewriting sequence, with respect to a reduction relation is a finite or infinite sequence of reduction steps
→ a0 a1 a2 ...
If we have a reduction sequence → → →
a ≡ a0 a1 a2 ... an−1 an ≡ b we say that a reduces to b. The length→of a→ finite reduction→ → sequence→ is the number of its reduction steps.
1.1.3. Composition. Given two reduction relations 1 and 2 on A, their composition is denoted by 1 · 2 and defined by → → → → a 1 · 2 b if a 1 c 2 b, for some c in A.
1.1.4. Notations. The identity→ relation→ is denoted→ by→
0 = {(a, a) | a ∈ A}.
→
2 1.1.5. Branchings and confluence pairs
The inverse relation of is denoted by , or by −, and defined by:
= {(b, a) | a b}. → ← → 0 A relation is reflexive if ⊆ and transitive if · ⊆ . The reflexive closure of is denoted by ≡ ← → and defined by ≡ 0 → → =→ ∪→ →. → → The symmetric closure of is denoted by and defined by → → → = ∪ . → ↔ + The transitive closure of is denoted by and defined by ↔ → ← + [ i → → ⊆ , i>0 → → i+1 i ∗ where = · for all i > 0. The reflexive and transitive closure of is denoted by , or by , and defined by + 0 → → → = ∪ . → → ∗ The reflexive, transitive and symmetric closure of is denoted by and defined by → → ∗ = ( )∗. → ↔ ∗ In particular, we have a b is there is a rewriting↔ ↔ sequence from a to b and we have a b if and only if there is a zig-zag of rewriting sequence from a to b: ↔ a ≡ a0 a1 a2 ... an−1 an ≡ b.
∗ The relation is equal to the equivalence relation generated by . ↔ ↔ ↔ ↔ ↔
1.1.5. Branchings↔ and confluence pairs. A branching (resp. →local branching) of the relation is an element of the composition · (resp. · ). It is defined by a triple a c b (resp. a c b) as pictured by the following diagram: → ← → c c ← → (resp. ) a b a b
A confluence pair (resp. local confluence pair) of the relation is an element of the composition · (resp. · ). It is defined by a triple a d b as pictured by the following diagram: → a b a b → ← ÐÐ (resp. Ð ) d d
Note that the relations · and · are symmetric.
← →
3 1.2. Confluence
1.1.6. Commutation. Two relations 1 and 2 on A commute if
→ 1 · →2 ⊆ 2 · 1 .
1.2. CONFLUENCE
1.2.1. Diamond property. A relation has the diamond property if it commutes with itself. This means that for any local branching a c b there exists a local confluence: → ← → c a b Ð d
This property is hard to obtain in general. Let us give the main confluence patterns used in rewriting.
1.2.2. Confluence patterns. A reduction relation is called
∗ i) Church-Rosser if ⊆ · . →
ii) confluent if the relation↔ commutes, that is · ⊆ · . iii) semi-confluent if · ⊆ · . ≡ iv) strongly-confluent←if · ⊆ · .
v) locally confluent if ←· →⊆ · ←. vi) has the diamond property← →if the relation commutes, that is · ⊆ · .
→ ← → → ← o ∗ / i) ii) iii)
≡ iv) v) vi)
4 1.2.3. Remark
1.2.3. Remark. The diamond property implies the Church-Rosser property, [New42, Theorem 1]. Note that in [New42] Newman called confluence the Church-Rosser property defined above. He showed that these properties coincide. Obviously, any Church-Rosser property is confluent, and the reverse implication is shown by the following diagram:
...
"" ||
|| ""
"" ||
1.2.4. Proposition. For an abstract rewriting system (A, ) the following conditions are equivalent
i) is confluent, →
ii) → is semi-confluent, iii) → has the Church-Rosser property.
Proof.→Prove that iii) implies i). Suppose that is Church-Rosser. Given a branching a c b, we ∗ have a b. Hence by the Church-Rosser property, there is a confluence pair a d b, hence is confluent. Obviously i) implies ii). Prove that ii) implies iii). Suppose that is semi-confluent and let ∗ → a b.↔ Prove by induction on the length of the sequence of reductions between a and b, that there→ is a confluence pair a d b. This is obvious when the sequence is of length 0→, that is a ≡ b, or when the n−1 1 sequence↔ is of length 1, that is a b or a b. Let consider a sequence of reductions a b0 b. 0 0 By induction hypothesis, there is a confluence pair a d b . If b b , that is → ← ↔ ↔ n − 1 1 → a o / b0 o b
Induction
& x & d x
0 by induction, this gives a confluence pair a d b. In the other case, if b b, by semi-confluence,
→
5 1.3. Normalisation
0 there is a confluence pair d d b:
n − 1 1 a o / b0 / b
Semi- Induction Confluence
%% yy d - - d0
0 hence, by induction we have a confluence pair a d b. It follows that the relation is Church- Rosser. → 1.2.5. Exercise. Prove that strong confluence implies confluence.
1.2.6. Exercise. Let A be a set and let 1 and 2 be two reduction relations on A. 1. Prove that the confluence of 1 and 2 does not imply the confluence of 1 ∪ 2. → → 2. Prove that → → → → 1 ⊆ 2 ⊆ 1 implies 1 = 2 .
3. Prove that if 1 ⊆ 2 ⊆→1 and→ 2 is strongly confluent, then 1 is confluent.
4. Prove that if 1 and 2 are confluent and commute, then the relation 1 ∪ 2 is also confluent. → → → → → → → → 1.3. NORMALISATION
Let (A, ) be an abstract rewriting system.
1.3.1. Normal→ form. An element a in A is in normal form, or irreductible, with respect to if there is no b in A such that a b. It is reductible if it is no irreductible. We denote by NF( ) the set of normal forms in A with respect to . → → → → 1.3.2. Normalizing. An element a in A is (weakly) normalizing if a b for some b in NF( ). Then we say that a has a normal form b and b is called a normal form of a. The relation is (weakly) normalizing if every element a in A is normalizing. → → 1.3.3. Termination. An element a in A is strongly normalizing if every reduction sequence starting from a is finite. The relation is strongly normalizing, or terminating, or noetherian if every a in A is
→
6 1.3.4. Convergence strongly normalizing. Any terminating relation is normalizing. Note that the converse is false as shown by the following abstract rewriting system
a0 / a1 / a2 / a3 / a4 / a5 / ···
} b qrstv
1.3.4. Convergence. We say that is convergent, or complete, canonical, uniquely terminating, if is confluent and terminating. → → 1.3.5. Normal form property. The relation has the normal form property if for any a in A and any normal form b in A ∗ a b →implies a b. The relation has the unique normal form property if for all normal forms a and b in A ↔∗ a b implies a ≡ b. → 1.3.6. Semi-convergence. We say that ↔ is semi-convergent, or semi-complete, if has the unique normal form property and is normalizing. If (A, ) is semi-convergent, then every element a in A reduces to a unique normal form denoted→ by ab. → → 1.3.7. Confluence and unicity of the normal form. If is confluent, every element has at most one normal form. As an immediate consequence of the equivalence of the Church-Rosser property and the confluence property, Proposition 1.2.4, we have → 1.3.8. Theorem. For an abstract rewriting system (A, ) the following implications hold: i) The normal form property implies the unique normal form property. → ii) If is confluent then has the normal form property. iii) If is semi-convergent then it is confluent. → → For a confluent abstract rewriting system (A, ), two elements a and b in A are equivalent if there are joignable:→ a · b. The test of joignability may be not possible when the relation is not terminating. For example, how to test the joignability→ of −n and n in the following example: ··· o −2 o −1 o 0 / 1 / 2 / ··· Let us show that normalisation suffices to determine joignability. If is normalizing and confluent, every element a in A has a unique normal form denoted by ab. 1.3.9. Theorem. If is normalizing and confluent then we have → ∗ a b if and only if ab ≡ b.b → As a consequence of the previous result, for a normalizing and confluent abstract rewriting system (A, ) an equivalence test of two↔ elements a and b in A is to check the syntactical equality of their normal forms ab and b. If the normal forms are computable and the syntactic identity is decidable then the equivalence→ is decidable.
7 1.3. Normalisation
1.3.10. Exercise. Prove Theorem 1.3.8 and Theorem 1.3.9.
1.3.11. Examples. The abstract rewriting system
' a g a0
Ò b is confluent, not terminating and admits a unique normal form. The abstract rewriting system
' 0 co b / a f a is not confluent, not terminating and admits a unique normal form.
1.3.12. Example. Let A = N − {0, 1}. Consider the relation on A defined by the {(m, n) | m > n and n divides m }.
Then m is in NF( ) if and only if m is prime. An element p is a normal form of m if and only if p is a prime factor of m. We have m · n if and only if m and n are note relatively prime. The transitive closure of coincide woth because > and divide relations are already transitive. We have ∗ → = A × A and terminates and it is not confluent. → → ↔1.3.13. Example.→ Let A = {a, b}∗ be the free monoid on {a, b}. We consider the relation defined by the set {(ubav, uabv) | u, v ∈ A}. → n m Then an element of A is in normal form if and only if it is of the form a b for n, m ∈ N. Not that the relation terminates and its confluent. Thus every element of A has a unique normal form and we have 0 ∗ 0 0 w · w if and only if w w if and only if w and w contain the same number of as and bs. We will see→ in the next chapter on string rewriting that such an abstract rewriting system can be specified by only one rewriting rule ba ↔ab.
1.3.14. Exercise, [Jan88]. →Consider the set N × N with the reduction relation 1 defined by (x, y) 1 (x0, y0) if