Algebraic coherent confluence and higher globular Kleene algebras

We extend the formalisation of confluence results in Kleene algebras to a formalisation of coherent confluence proofs. For this, we introduce the structure of higher globular Kleene algebra, a higher-dimensional generalisation of modal and concurrent Kleene algebra. We calculate a coherent Church-Rosser theorem and a coherent Newman's lemma in higher Kleene algebras by equational reasoning. We instantiate these results in the context of higher rewriting systems modelled by polygraphs.


Introduction
Rewriting is a model of computation widely used in algebra, computer science and logic.Rules of computation or algebraic laws are described by rewrite relations on symbolic or algebraic expressions.Rewriting theory is strongly based on diagrammatic intuitions.A central theme is the completion of certain branching shapes with confluence shapes into confluence diagrams.Traditionally, the rewriting machinery has been formalised in terms of algebras of binary relations: confluence properties are described by union, composition and iteration operations.A natural generalisation is given by Kleene algebras, in which proofs of classical confluence results such as the Church-Rosser theorem or Newman's lemma can be calculated [Str02,Str06,DMS11].Beyond that, Kleene algebras and similar structures are known for their ability to capture complex computational properties by simple equational specifications and reasoning [DBvdW97,Koz97,vW04,Str08] and their capacity to unify various semantics of computational interest, including formal languages, binary relations, path algebras or execution traces of automata [HS10].
The binary relations over a set X form a Kleene algebra with respect to relational composition, relational union, the reflexive transitive closure operation, the empty relation and the unit relation.The Church-Rosser theorem for → is thus an instance in the Kleene algebra of binary relations for x = ← and y = →.
The diagrammatic interpretation of → views an arrow u → v as a rewriting step whenever (u, v) is an element of →.When (u, v) is an element of * → (resp.* ↔), we say that u is related to v by a rewriting sequence (resp.zig-zag sequence) of finitely many rewriting steps.We denote such sequences by f, g....A branching (resp.confluence) is a pair (f, g) (resp.(f , g )) of rewriting sequences of the shape The Church-Rosser theorem then states that, for all branchings (f, g) of rewriting sequences, there exists a confluence (f , g ) if, and only if, for any zig-zag sequence h there exists a confluence (h , k ): By contrast to the relational Church-Rosser theorem, we can now no longer use inclusions as witnesses of the forall/exist-relationships between branchings or zig-zags and confluences in these diagrams.Formally, we need to replace inclusions as 2-cell in the 2-category Rel of relations by more general 2-cells, for which we write α, β....This leads to the coherent Church-Rosser theorems of higher rewriting.In two dimensions, it holds if there exists a set Γ of 2-dimensional cells such that, if every branching can be completed to a confluence diagram filled with elements of Γ that are pasted together along their 1-dimensional borders, then every zig-zag sequence can be completed to a Church-Rosser diagram filled with elements of Γ that are pasted along their 1-dimensional borders (and of course vice versa).Diagrammatically, for 2-cells α and β built from 2-cells in Γ, Algebraic coherence.The coherent Church-Rosser theorem constitutes one step in the proof of Squier's theorem for higher rewriting systems, which provides a constructive approach to coherence results in higher categories.These are related to the fact that certain algebraic properties of a categorical or algebraic structure may only hold up to the existence of higherdimensional morphisms.The classical coherence conditions on associatiors and unitors in monoidal categories, for example, require that if certain diagrams of natural isomorphisms commute, then all the diagrams built from the corresponding natural isomorphisms do.A key issue is then the reduction of the property "every diagram commutes" to the property "if a certain set of diagrams each commute then every diagram commute" [ML63,Sta63].For any collection of higher-dimensional morphisms, coherence is thus the requirement that the whole structure be contractible, that all parallel morphisms be linked by higher morphisms.A coherence theorem states that, for each generating collection of such morphisms, coherence is satisfied.An objective is thus to obtain a minimal collection of generating higher morphisms.
To solve coherence problems for monoids, formulated as two-dimensional word problems, Squier introduced graph-theoretical methods on string rewriting systems [SOK94].His idea was to compute extensions of string rewriting systems by homotopy generators, which model the relations amongst rewriting sequences, so that every pair of zig-zag sequences with same source and same target can be paved by composing these generators.In Squier's approach, the homotopy generators are defined by the confluence diagrams of the critical branchings of the string rewriting system, provided the string rewriting system is convergent.
Organisation and main results of the article.
Higher rewriting.In Section 2 we summarise notions from higher rewriting.We first recall polygraphs, which represent systems of generators and relations for higher categories used for modelling higher coherence properties.Polygraphs, also called computads, were introduced by Street and Burroni [Str76,Bur93a].They are widely used as rewriting systems that present higher algebraic structures [Mim14,GM09].Furthermore, polygraphs allow formulating homotopical properties of rewriting systems through polygraphic resolutions [Mét03,GM12b], as well as coherence properties for monoids [GMM13, GGM15, GM18], higher categories [GM09], and monoidal categories [GM12a].The latter are inspired by Squier's approach to coherence results for monoids using convergent string rewriting systems [SOK94].
Formally, an n-polygraph is a higher rewriting system made of globular cells of dimension 0, 1, . . ., n.It is defined recursively as a sequence P := (P 0 , P 1 , . . ., P n ), where for 0 ≤ k ≤ n, the set P k consists of generating k-cells of globular shape: The source s k−1 (α) and target t k−1 (α) belong to the free (k − 1)-category generated by the underlying (k − 1)-polygraph (P 0 , P 1 , . . ., P k−1 ).A generating n-cell f : u → v in P n corresponds to an n-dimensional rule, reducing the (n − 1)-cell u to the (n − 1)-cell v.
The free category on the polygraph P , denoted by P * n , is the category of higher rewriting sequences generated by the rules in P n .Its n-cells are (n − 1)-compositions of rewriting steps with respect to P n .The free (n, n − 1)-category on P n , denoted by P n , is the category of zig-zag sequences generated by the rules in P n , which correspond to congruences between (n − 1)-cells in P * n−1 modulo the rules in P n .In this work, we study the confluence properties of polygraphs by considering cellular extensions of the n-categories P * n and P n , whose elements are (n+1)-cells that are confluence witnesses.Formally, a cellular extension of the free n-category P * n (resp.free (n, n − 1)category P n ) consists of a set of globular (n + 1)-cells that relate the n-cells of P * n (resp.P n ).
Coherent confluence.A branching in an n-polygraph P , for n ≥ 1, is a pair (f, g) of n-cells of the free n-category P * n with the same (n − 1)-source.A branching is local when f and g are rewriting steps.A cellular extension Γ of the free (n, n − 1)-category P n is a confluence filler of the branching (f, g) if there exist n-cells f , g in the free n-category P * n and two (n + 1)-cells α and α u a a α in the free (n + 1, n − 1)-category P n [Γ] over P n generated by Γ.The cellular extension Γ is a (local) confluence filler for P if it is a confluence filler for each of its (local) branchings.Further, Γ is a confluence filler of an n-cell h in P n if there exist n-cells h and k in P * n and an (n + 1)-cell α in the free (n + 1, n − 1)-category P n [Γ] of the form The cellular extension Γ is a Church-Rosser filler for an n-polygraph P if it is a confluence filler for every n-cell in P n .Theorem 2.1 below states that, for an n-polygraph P , a cellular extension Γ of P n is a confluence filler for P if, and only if, Γ is a Church-Rosser filler for P .Theorem 2.2 below states that, when P is terminating, then Γ is a local confluence filler if, and only if, Γ is a confluence filler for P .These statements are coherent, higher-dimensional extensions of the Church-Rosser theorem and Newman's lemma, respectively.In Section 2.4, we relate these filler properties to the standard coherent confluence properties used in higher rewriting [GHM19].
Modal and concurrent Kleeene algebras.The forall/exist-relationships between higherdimensional cells and their sources and targets, expressed using various fillers, can be captured algebraically through the higher globular Kleene algebras introduced in Section 3. Before discussing them, we briefly review the modal Kleene algebras [DS11] and concurrent Kleene algebras [HMSW11] on which they are based.
Kleene algebras extend additively idempotent semirings (S, +, 0, •, 1), in which addition models a notion of nondeterministic choice or union and multiplication a non-commutative composition, with a Kleene star (−) * that models a finite repetition or iteration as a least fixpoint.Models include binary relations under union, relational composition and reflexive-transitive closure, and sets of paths in a quiver or directed graph under union, a complex product based on path composition and a Kleene star that iteratively composes all paths in a given set with each other.Kleene algebras allow specifying and proving the Church-Rosser theorem of abstract rewriting [Str06] using the fixpoint induction for the Kleene star instead of the standard explicit induction on the number of peaks in zig-zags.Their path model forms the basis for higher path algebras associated with polygraphic models of higher rewriting.
Modal Kleene algebras equip Kleene algebras K with forward and backward modal operators introduced via domain and codomain operations d : K → K and r : K → K.In the relational model, the domain of a relation describes the set of all elements that it relates to another element; its codomain describes those elements to which it relates another element.In the path model, the domain of a set of paths describes the set of all source elements of paths in the set, and the codomain all target elements.The relational model of Kleene algebra provides the standard relational Kripke semantics of modal diamond operators based on d and r .The forward diamond |x p = d (x • p), for a relation x and a set p, for instance, models the set of all elements that may be related by x with an element in p.In Kleene algebra, this generalises to arbitrary elements x and domain elements p, which are fixpoints of the domain operator.Modal box operators, as duals of diamonds, can be defined if the domain elements forms a Boolean algebra.They can be based on antidomain and anticodomain operators, which model the Boolean complements of domain and codomain operators.The antidomain of a relation, for instance, models the set of elements that is does not relate to any other element.Noethericity and wellfoundnedness can be expressed in modal Kleene algebras.Newman's lemma for abstract rewriting systems can therefore be proved in this setting [DMS11].
Finally, a concurrent Kleene algebra [HMSW11] is a double Kleene algebra in which + and 0 are shared and the two compositions • 0 and • 1 interact via a weak interchange law and the two multiplicative units coincide.Typical models come from concurrency theory.They include shuffle language models from interleaving concurrency and partial-order-based models from non-interleaving concurrency.
Higher globular Kleeene algebras.In Section 3.2, we introduce a notion of globular higher modal Kleene algebra.First, we define a 0-dioid as a bounded distributive lattice, and for n ≥ 1, an n-dioid as a family (S, +, 0, i , 1 i ) 0≤i<n of dioids, or additively idempotent semirings, satisfying weak interchange laws between the multiplications, akin to those of concurrent Kleene algebras.We then equip this structure with domain and codomain operations d i , r i : S → S for 0 ≤ i < n, satisfying typical axioms for n-categories such as The domain and codomain operations yield forward and backward diamond operators: for any A ∈ S, the |A i , A| i are modal operators on the i-dimensional domain algebra S i := d i (S).These are defined as usual and thus encode higher-dimensional generalisations of the relational Kripke semantics: |A i φ, for instance, denotes the subset of S i containing the i-cells from which a set A of n-cells may lead to the set φ of i-cells.A concrete polygraphic model that underpins these intuitions is introduced in Section 3.3.In (3.2.6) we impose conditions for globularity, conducing to the notion of globular modal n-dioid.
We further equip these structures with Kleene stars (−) * i : K → K for each 0 ≤ i < n.These are lax morphisms with respect to the i-multiplication of j-dimensional elements on the right (resp.left).Hence, for all 0 ≤ i < j < n, all elements A ∈ K and all φ ∈ K j in the j-dimensional domain algebra, The resulting structures are called globular modal n-Kleene algebras.
In Section 3.3 we relate this structure to polygraphs.We provide a model for higher Kleene algebras in the form of a higher path algebra K(P, Γ) induced by an n-polygraph P and a cellular extension Γ. Algebraic coherent confluence.Section 4 features our main results.After revisiting the Church-Rosser theorem and Newman's lemma in modal Kleene algebras in Section 4.1, we define notions of fillers in a globular modal n-Kleene algebra K in (4.2.1).For j-dimensional elements φ, ψ ∈ K The property on the left states that the set of all i-cells for which there exists an i-confluence for (φ, ψ) with witness A contains the i-branching for (φ, ψ).The explanation for the property on the right is analogous.We define a notion of local i-confluence filler along the same lines.We introduce a notion of whiskering in n-Kleene algebras in (4.2.3).We define, for φ, ψ ∈ K j and an i-confluence filler A ∈ K of (φ, ψ), the j-dimensional i-whiskering of A as We then prove two variants of the coherent Church-Rosser theorem in globular n-Kleene algebras.The first, Proposition 4.1, uses an explicit inductive argument external to the n-Kleene structure, based on powers that can be defined in any n-semiring.For 0 ≤ i < j < n, it states that for every φ, ψ ∈ K j , every i-confluence filler A of (φ, ψ) and every natural number k there exists an A k ≤ Â * j such that where (φ + ψ) By constrast, the proof of the second theorem relies only on the internal fixpoint induction given by the axioms for the Kleene star.It constitutes our first main result.
Theorem 4.2.Let K be a globular n-modal Kleene algebra and 0 ≤ i < j < n.Then, for every φ, ψ ∈ K j and every i-confluence filler Thus Â * j is an i-Church-Rosser filler for (φ, ψ).In Section 4.3, we introduce notions of termination and well-foundedness in n-Kleene algebras in which the domain algebras K i have a Boolean structure for all i ≤ p < n.This leads to our second main result: a specification and proof of a coherent Newman's lemma in such algebras.
Theorem 4.4.Let 0 ≤ i ≤ p < j < n, and let K be a globular p-Boolean modal Kleene algebra such that (1) (K i , +, 0, i , 1 i , ¬ i ) is a complete Boolean algebra, (2) K j is continuous with respect to i-restriction, that is, for all ψ, ψ ∈ K j and every family (p α ) α∈I of elements of K i such that sup I (p α ) exists, Then, for any ψ ∈ K j i-Noetherian, and φ ∈ K j i-well-founded, if A is a local i-confluence filler for (φ, ψ), then Thus Â * j is an i-confluence filler for (φ, ψ).Finally, in Section 4.4, we instantiate these results in the context of higher abstract rewriting, using the higher-dimensional path model defined in Section 3.3.

Outlook.
Toward an algebraic Squier's theorem.Our results provide formal equational proofs of the coherent Church-Rosser theorem and the coherent Newman's lemma in higher globular Kleene algebras.These are the main ingredients in the proof of Squier's coherence theorem [SOK94] for string rewriting systems, used in constructive proofs of coherence in categorical algebra.It remains to formalise this result within the higher Kleene algebras framework.A first obstacle is the formalisation of the coherent critical branching lemma, stating that local coherent confluence is equivalent to coherence confluence of all critical branchings.This requires taking the algebraic and syntactic nature of terms in the rewriting system into account [Niv73,BO93,CDM22].This remains an open problem in formalisms such as Kleene algebras.In particular, it would be interesting to identify the enrichment of the Kleene algebra structure needed for formalising the critical confluence property of string or term rewriting systems.
Formalisation of cofibrant replacements.A second obstacle is to capture normalisation strategies in higher Kleene algebras algebraically [CGM21].Squier's coherence theorem is the first step in the construction of cofibrant replacements of algebraic structures using convergent presentations [GM12b].We expect that the material introduced in this article will enable us to give an algebraic formalisation of acyclicity, which could in turn yield an algebraic criterion for cofibrance.
Formalisation of cofibrant replacements in proof assistants.The results of this article are part of a research program that aims at developing constructive methods for higher algebras based on rewriting.The aim is to formalise, by rewriting, the computation in internal monoids of monoidal categories, which categorify the associative rewriting paradigm.This framework generalises word and term rewriting, linear rewriting, operadic and propadic rewriting.The overall goal is to compute cofibrant replacements of these structures by rewriting and to formalise these computations.In this article, we formalise the abstract coherent Church-Rosser and Newman theorems in globular Kleene algebras.The Knuth-Bendix procedure provides a characterisation of local confluence for algebraic rewriting systems in terms of critical branchings.Our aim is to extend the formalisation of the abstract case to coherent rewriting systems of internal monoids.We expect to implement the proofs of the coherence theorems in higher rewriting with Isabelle, Coq or Lean.
Another objective an algebraic formalisation of normalisation strategies in rewriting.These allow building cofibrant (ω, 1)-categorical replacements of algebraic structures presented by confluent and terminating rewriting systems [GM12b].We expect that these constructions can be formalised in ω-globular Kleene algebras.

Preliminaries on higher rewriting
In this preliminary section, we introduce the relevant notions of higher rewriting.In its two subsections we recall the definition of polygraphs and their properties as rewriting systems presenting higher categories.In Section 2.3 we introduce the notion of confluence filler for polygraphs with respect to cellular extensions.We then formulate and give point-wise proofs of the coherent versions of the Church-Rosser theorem and Neman's lemma in the polygraphic setting.Finally, in its last subsection, we relate the confluence filler property to a more standard coherent confluence property [GHM19].
2.1.1.Higher categories.Let n be a natural number.A (strict globular) n-category C consists of the following data.
(1) It is a reflexive n-globular set, that is, a diagram of sets and functions of the form whose functions s i , t i : C i+1 → C i and ι i : C i−1 → C i satisfy the globular relations and the identity relations (2) It is equipped with the structure of a category on for all k < , where and whose k-composition morphism on C is denoted by k : is a 2-category for all j < k < , see [ML98, XII.3.].9:10 2.1.2.Notations.The elements of C k are called k-cells of C. For 0 ≤ k < n, we abuse notation, denoting by C k the underlying k-category of k-cells of C. The maps s i , t i and ι i are called source, target and unit maps respectively.For a k-cell f of C and for 0 ≤ i < k, we call s i (f ) (resp.t i (f )) the i-source (resp.i-target) of f .We denote the identity (k + 1)-cell of ι k+1 (f ) by 1 f .When f and g are i-composable k-cells, for i < k, that is when t i (f ) = s i (g), we denote their i-composite by f i g.By condition iii), the compositions satisfy the interchange law 3) for all 0 ≤ j < k < n, and whenever all compositions are defined.
The (k − 1)-composition of k-cells f and g is denoted by juxtaposition f g, and the (k − 1)-source s k−1 (f ) and the (k − 1)-target t k−1 (f ) of a k-cell f are denoted by s(f ) and t(f ), respectively.To highlight the relative dimensions of cells, we denote cells by single arrows →, double arrows ⇒, and triple arrows .In particular, if we denote a k-cell in C by f : u ⇒ v, then we denote (k − 1)-cells of C by u : p → q the and the (k + 1)-cells of C by A : f g in to distinguish their dimensions notationally.Such globular cells are depicted as follows: The globular relations (2.1) imply that any k-cell f has globular shape: With this diagrammatic notation, the interchange law (2.3), for instance, becomes 2.1.3.Identities and whiskers.Given a k-cell f , the identity l-cell on f for k ≤ l ≤ n is denoted by ι l k (f ) and defined by induction, setting ι k k (f ) := f and ι l k (f ) := 1 ι l−1 k (f ) for k < l ≤ n.In this way, for 0 ≤ k < l ≤ n, we associate a unique identity cell ι l k (f ) of dimension l to every k-cell f , which is called the l-dimensional identity on f .In higher categories, such iterated identities are important for defining compositions.For 0 ≤ i < k < l ≤ n, a k-cell f and a l-cell g such that t i (f ) = s i (g), the i-composite of f and g is defined as , where u and v are j-cells, as in the diagram To simplify notation, we denote this k-cell by for short, which we simply call its inverse.If in addition the (k − 1)-cells u and v are invertible, then there exist k-cells For a natural number p ≤ n, or for p = n = ∞, an (n, p)-category is an n-category whose k-cells are invertible for every k > p.When n < ∞, this is a p-category enriched in (n − p)-groupoids and, when n = ∞, a p-category enriched in ∞-groupoids.

Spheres and cellular extensions. Let
A cellular extension of C is a set Γ equipped with a map ∂ : Γ → Sph n (C).For α ∈ Γ, the boundary of the sphere ∂(α) is denoted (s n (α), t n (α)), defining in this way two maps s n , t n : Γ → C n satisfying the globular relations The free (n + 1)-category over C generated by the cellular extension Γ is the (n + 1)category, denoted by C[Γ] and defined as follows: i) its underlying n-category is C, ii) its (n + 1)-cells are built as formal i-compositions, for 0 ≤ i ≤ n, of elements of Γ and k-cells of C, seen as (n + 1)-cells with source and target in C n .The quotient of the n-category C by Γ, denoted by C/Γ, is the n-category we obtain from C by identifying the n-cells s n (α) and t n (α), for every n-sphere α of Γ.
The free (n + 1, n)-category over C generated by Γ, denoted by C(Γ), is defined by We refer to [Mét03] for explicit free constructions on cellular extensions over n-categories.
2.1.6.n-polygraphs.Polygraphs are models of free higher categories.They are defined by induction on the dimension.For n ≥ 0, an n-polygraph P consists of a set P 0 and for every 0 ≤ k < n a cellular extension P k+1 of the free k-category For 0 ≤ k ≤ n, the elements of P k are called the generating k-cells of P .The free n-category P 0 generated by P will be denoted by P * n (resp.P n ).We refer to [Mét03] for the details of the free constructions on an n-polygraph.Note that a 0-polygraph is a set and an 1-polygraph corresponds to a directed graph, whose set of vertices is P 0 and P 1 is the set of arrows f with source s 0 (f ) and target t 0 (f ).

Polygraphic rewriting.
A rewriting step of an n-polygraph P is an n-cell of the free n-category P * n of the form for a generating n-cell f in P n and i-cells u i , v i in P * n , with 1 ≤ i < n.We denote by P c n the set of rewriting steps of P .An (n − 1)-cell u of P * n−1 is irreducible with respect to P if there is no rewriting step of P with source u.A rewriting sequence of P of length k is an (n − 1)-composition where the f i are rewriting steps of P .If there exists such a rewriting sequence, we say that the (n − 1)-cell in the free (n, n − 1)-category P n , where the f i are rewriting steps of P , and 1 , . . ., k ∈ {−1, 1}, and which is reduced with respect the rules f n−1 f − → 1, for n-cells f in P * n .The rewriting steps of P define an abstract rewriting system on the set of parallel (n − 1)-cells of the free n-category P * n , whose binary relation, denoted by → Pn , is defined by u → Pn u if there exists a rewriting step of P that reduces u to u .2.2.2.Remark.Given a cellular extension Γ of an n-category C, we also denote by Γ c the set of cells of Γ in context, that is the set of (n + 1)-cells of the form where f i , g i are i-cells of C for 0 ≤ i ≤ n, and α ∈ Γ. Recall from [GM09, Prop.2.1.5],that any (n + 1)-cell γ in the free (n + 1)-category C[Γ] can be written as an n-composition where the γ i are (n + 1)-cells of Γ c , using the algebraic laws of higher categories, most notably the interchange laws.

2.2.3.
Rewriting properties of an n-polygraph.The rewriting properties of an n-polygraph P are those of the reduction relation → Pn .In particular, an n-polygraph P is terminating if there is no infinite rewriting sequences with respect to → Pn .
A branching of an n-polygraph P is an unordered pair (f, g) of rewriting sequences of P such that s n−1 (f ) = s n−1 (g).Such a branching is local when f and g are rewriting steps.We say that P is confluent (resp.locally confluent) if for any branching (resp.local branching) (f, g) there exist rewriting sequences f and g of P with t n−1 (f ) = t n−1 (g ) such that the compositions f n−1 f and g n−1 g are defined, as illustrated in the diagram The source of a branching (f, g) is the common (n − 1)-source u of f and g.We say that P is Church-Rosser if for any zig-zag sequence h of P there exist rewriting sequences h and k of P as in the diagram 4. Example: one-dimensional polygraphs.One-dimensional polygraphs are models of abstract rewriting systems.Recall that an abstract rewriting system A = (X, {→ i } i∈I ) consists of a set X and a family → = {→ i } i∈I of binary relations on X, that is, → i ⊆ X × X for all i ∈ I [Ter03].Then A can be described by a 1-polygraph P = (P 0 , P 1 ), whose set of generating 0-cells is X, and whose set of generating 1-cells consists of u (x,y,i) : x → y for all x, y ∈ X and i ∈ I such that (x, y) ∈→ i .If I is a singleton, then A is a set X together with a binary relation →, and the underlying directed graph of the free 1-category P * 1 is isomorphic to the reflexive and transitive closure * → of the relation →.The underlying directed graph of the (1, 0)-category P 1 is isomorphic to the symmetric closure of the relation 2.2.5.Example: two-dimensional polygraphs.Two-dimensional polygraphs are models of string rewriting systems.A string rewriting system is an abstract rewriting system on a free monoid [BO93].It can be defined as a 2-polygraph P = (P 0 , P 1 , P 2 ), where P 0 is a singleton, P 1 is an alphabet, and the maps s 0 , t 0 : P 1 → P 0 are trivial.The free 1-category P * 1 has one single 0-cell.It thus isomorphic to the free monoid generated by P 1 , whose elements are the strings on P 1 .The cellular extension P 2 defines a binary relation on strings on P 1 , whose elements are the pairs (s 1 (α), t 1 (α)), for α in P 2 , and which are rules of the string rewriting system.The binary relation → P 2 is the rewrite relation generated by the set of rules.
2.2.6.Example: three-dimensional polygraphs.Three-dimensional polygraphs are models of rewriting systems on free 2-categories.A two-dimensional diagrammatic rewriting system is a 3-polygraph P = (P 0 , P 1 , P 2 , P 3 ), where the underlying polygraph (P 0 , P 1 ) is the signature, made of sorts in P 0 and generators in P 1 , the cellular extension P 2 is the set of operators with a finite number of inputs and outputs, and the rules relate two-dimensional diagrams made of 0-compositions and 1-compositions of operators in P 2 .Applications include term rewriting systems for the explicit manipulation of variables in terms [Gui06], and rewriting systems on monoidal categories [GM12a], 2-categories [Mim14, GM09] and linear 2-categories [Dup21].
2.3.Coherent confluence.We now define two notions of coherence of an n-polygraph P with respect to a cellular extension Γ: (1) a vertical one in which coherence cells, (n + 1)-cells generated by Γ, have branchings as n-sources and confluences as n-targets, (2) a horizontal one in which coherence cells have rewriting sequences as n-sources and n-targets.A vertical approach has been used previously in Kleene algebra, the horizontal approach is the classical polygraphic approach.
2.3.1.Coherent confluence.Let P be an n-polygraph and (f, g) be a branching of P .A cellular extension Γ of P n is a confluence filler for (f, g) if there exist n-cells f and g in P * n , and two (n + 1)-cells α and α in the (n + 1)-category P n [Γ] of the form α : The cellular extension Γ is a confluence filler (resp.local confluence filler ) for the polygraph P if Γ is a confluence filler for each of its branchings (resp.local branchings).
Let h be an n-cell in P n .The cellular extension Γ is a Church-Rosser filler for h if there exist n-cells h and k in P * n and an (n + 1)-cell α in the (n + 1)-category The cellular extension Γ is a Church-Rosser filler for an n-polygraph P if it is a Church-Rosser filler of every n-cell in P n .
Remarks.The (n + 1)-cells α and α in the definitions above are n-compositions of (n + 1)cells of Γ c as defined in Remark 2.2.2.Whiskering the (n + 1)-cells α and α in (2.4) yields (n + 1)-cells Theorem 2.1 (Church-Rosser coherent filler lemma).Let P be an n-polygraph.A cellular extension Γ of P n is a confluence filler for P if, and only if, Γ is a Church-Rosser filler for P .
Proof.First suppose Γ is a Church-Rosser filler for P .Then, for any branching (f, g), the composites f − n−1 g and g − n−1 f are n-cells of P n , and Γ is thus a Church-Rosser filler for them.This yields the cells α and α as in (2.4), and so Γ is a confluence filler for P .
Conversely, suppose Γ is a confluence filler for P and let f be an n-cell of P n .We prove by induction on the length of f that Γ is a Church-Rosser filler for f .This shows that Γ is a Church-Rosser filler for P .For f of length 0 or 1, f is clearly Γ-confluent, since it suffices to take an identity (n + 1)-cell.So suppose every n-cell of length i ≥ 2 is Γ-confluent and that f is of length i + 1.Then f = f 1 n−1 f 2 with f 1 : u → u 1 in P n of length i and f 2 of length 1 in P * n is either of the form v → u 1 or u 1 → v.By the induction hypothesis, there exist n-cells h and k in P * n , and an (n + 1)-cell there exist n-cells k and f in P * n , and an (n + 1)-cell 2 is a Church-Rosser filler for f : Theorem 2.2 (Coherent Newman filler lemma).Let P be a terminating n-polygraph and Γ a cellular extension of P n .Then Γ is a local confluence filler for P if, and only if, Γ is a confluence filler for P .
Proof.First observe that if Γ is a confluence filler for P , then it is also a local confluence filler for P since local branchings are branchings.Now suppose Γ is a local confluence filler for P .We prove by Noetherian induction that, for every (n − 1)-cell u of P * n , Γ is a confluence filler for every branching of P with source u.For the base case, if u is irreducible for P , then (1 u , 1 u ) is the only branching with source u, and it is Γ-confluent, taking the (n + 1)-cell 1 For the induction step, suppose u is a reducible (n − 1)-cell of P * n and Γ a confluence filler for every branching with source an (n − 1)-cell u such that u rewrites to u .Let (f, g) be a branching of P with source u.If one of f or g is an identity, f say, then Γ is a confluence filler for (f, g) by considering the (n + 1)-cells 1 g and 1 g − in P n [Γ].Otherwise, if the n-cells f and g are not identities, then we may write f = f 1 n−1 f 2 and g = g 1 n−1 g 2 , where g 1 , f 1 are rewriting steps and g 2 , f 2 are n-cells of P * n .Since Γ is a local confluence filler for P , there exist n-cells f 1 , g 1 in P * n , and an (n + 1)-cell α in P * n [Γ] as in the diagram (2.9).We can apply the induction hypothesis to the branching (f 2 , f 1 ), which yields n-cells f 2 , h in P * n and an (n + 1)-cell β in P * n [Γ] as in the diagram (2.9).Finally, we can apply the induction hypothesis again to the branching (g 1 n−1 h, g 2 ), which yields n-cells k and g 2 in P * n and an (n + 1)-cell γ in P * n [Γ] as in (2.9). (2.9) The n-composition . We can similarly find an (n + 1)-cell δ with source g − n−1 f and with target a confluence.As a consequence, Γ is a confluence filler for P , which proves the result.2.3.2.Remark.Readers familiar with abstract rewriting may notice that the proofs of Theorems 2.1 and 2.2 are similar to the classical ones for abstract rewriting systems.Indeed, forgetting the (n + 1)-dimensional coherence cells and look only at their n-dimensional borders in (2.7), (2.8) and (2.9) yields precisely the diagrams used to prove the 1-dimensional results for abstract rewriting systems.The higher-dimensional approach is thus consistent with the abstract case while offering several advantages.First, using explicit witnesses for confluence allows for a constructive formulation of classical results using normalisation strategies.Furthermore, as the higher-dimensional cells may be considered as rewriting systems in their own right, and as the procedures described above work in any dimension, higher rewriting provides a constructive method for calculating resolutions and cofibrant replacements of algebraic structures.Another advantage is that we work directly on rewrite sequences instead of relations.
2.4.Γ-confluence and filling.Recall from [GHM19] that, for any n-polygraph P and a cellular extension of P * n , we say that P is Γ-confluent (resp.Γ-locally confluent) if for every branching (resp.local branching) (f, g) of P there exist n-cells f , g in the free n-category P * n , and an (n + 1)-cell α : We say that P is Γ-Church-Rosser if for every n-cell h of P n there exist n-cells h and k in the free n-category P * n and an (n + 1)-cell α : h n−1 h ⇒ k in the free (n + 1, n)-category P n (Γ) as in the diagram Theorems 2.1 and 2.2 were formulated in terms of fillers above.Now we express them using Γ-confluence.
Theorem 2.3 (Church-Rosser coherent lemma).Let P be an n-polygraph and Γ a cellular extension of P * n .The polygraph P is Γ-confluent if, and only if, it is Γ-Church-Rosser.
Proof.The proof is similar to that of Theorem 2.1, but with (n+1)-cells oriented horizontally in the induction step, as pictured in the following diagram: Theorem 2.4 (Coherent Newman lemma).Let P be a terminating n-polygraph and Γ a cellular extension of P * n .The polygraph P is locally Γ-confluent if, and only if, it is Γ-confluent.

9:18
Proof.The proof is similar to that of Theorem 2.2, but with the following induction diagram: The n-composition δ = (((f is then an (n + 1)-cell in P * n (Γ) with source f n−1 (f 2 n−1 k) and target g n−1 g 2 , proving the result.
2.4.1.Remarks.In this section, we have defined a vertical and a horizontal notion of coherence of an n-polygraph P with respect to a cellular extension Γ.The vertical notion requires inverses of n-cells, that is, Γ is a cellular extension of P n .The proofs of Theorems 2.1 and 2.2 do not need inverses of (n + 1)-cells.The horizontal notion, by contrast, does not need inverses of n-cells, that is, we consider cellular extensions of P * n , but only inverses of (n + 1)-cells are needed to prove Theorems 2.3 and 2.4.In the vertical approach, the proofs thus take place in P n [Γ] whereas, in the horizontal one, they take place in P * n (Γ).Furthermore, in the first approach, we specify two filler cells α and α as depicted in diagram (2.4) for each branching (f, g).Branchings are unordered pairs, we must therefore account for both cases.This is another reason why we require inverses of (n + 1)-cells in the horizontal approach.
In the remainder of this article, we exclusively consider the vertical approach to paving diagrams with higher-dimensional cells.

Higher modal Kleene algebras
In this section we introduce higher globular modal Kleene algebras.In its first subsection, we list the axioms of modal Kleene algebra [DS11] and two of its main models.Its relational model provides the original intuition for defining modal operators based on relational domain and codomain operations over Kripke frames.Its path model, which can be defined over any graph, forms the basis for using modal Kleene algebras in higher rewriting.We then define n-dimensional dioids and equip these with domain, codomain and star operations to obtain modal n-Kleene algebras.Finally, we construct a higher path algebra associated to an n-polygraph with a cellular extension Γ as a model of this structure.

Modal Kleene algebras.
3.1.1.Semirings.A semiring is a structure (S, +, 0, •, 1) made of a set S and two binary operations + and • such that (S, +, 0) is a commutative monoid, (S, •, 1) is a monoid whose multiplication operation • distributes over the addition operation +, from the left and right, and 0 is a left and right zero of multiplication.A dioid is a semiring S in which addition is idempotent: x + x = x for all x ∈ S. In this case, (S, +, 0) is a semilattice with partial order defined by x ≤ y ⇔ x + y = y, (3.1) for all x, y ∈ S, with respect to which addition and multiplication are order-preserving and 0 is minimal.We will often denote multiplication simply by juxtaposition.

Domain semirings. A domain semiring
These structures are called domain semirings and not domain dioids because semirings equipped with a domain operation are automatically idempotent [DS11].
Intuitions for the domain axioms are given in Examples 3.1.7and 3.1.8below.In the first, we explain that the domain of a binary relation, which models the set of all elements that it relates to another element of the underlying set, satisfies the domain semiring axioms.The second example shows that the algebra of sets of paths over a digraph or quiver, represented by a 1-polygraph, satisfies the domain semiring axioms.The domain of a set of paths then corresponds to the set of all sources of paths in the set.
Consequences of the domain semiring axioms include the fact that the image of S under d is precisely the set of fixpoints of d , that is, and that S d forms a distributive lattice with + as join and • as meet, bounded by 0 and 1.It contains the largest Boolean subalgebra of S bounded by 0 and 1.We henceforth write p, q, r, . . .for elements of S d and refer to S d as the domain algebra of S. In particular, S d is a subsemiring of S in the sense that its elements satisfy the semiring axioms, 0 and 1 are in the set, and the set is closed with respect to • and +.
In the relational model of domain semirings, the set S d consists of the set of all relations included in the identity relation, called subidentities.In the path model, it consists of subsets of the set of all paths of length 0. In both cases, the distributive sublattices form Boolean algebras.
Further properties of domain semirings include for all x, y ∈ S d , and d commutes with all existing sups [DS11].
3.1.3.Boolean domain semirings.A limitation of domain semirings is that Boolean complementation in S d cannot be expressed; these structures admit chains as models [DS11].Yet complementation is desirable for at least two reasons: It reflects the Boolean nature of the path models, in which we are interested, more faithfully.It also allows us to define a modal box operator from the modal diamond, built using domain, via standard De Morgan duality, see (3.1.6).We need both Boolean domain algebras and the box-diamond duality in the proof of coherent Newman's lemma in Section 4.3.
To enforce Boolean domain algebras, it is standard to axiomatise a notion of antidomain that abstractly describes those elements that are not in the domain of a particular element.The antidomain of a relation, for instance, models the set of all elements that are not related to any other element of the underlying set; the antidomain of a set of paths corresponds to the set of all vertices of the underlying graph that are not a source of any path in the set.
A Boolean domain semiring [DS11] is a dioid (S, +, 0, •, 1) equipped with an antidomain operation ad : S → S that satisfies, for all x, y ∈ S: As the antidomain operation is, implicitly, the Boolean complement of the domain operation, we have d = ad 2 .Hence we recover a domain semiring: d satisfies the domain semiring axioms.In the presence of ad , the subalgebra S d of all fixpoints of d in S is now the greatest Boolean algebra in S bounded by 0 and 1, and S d = ad (S) and ad acts indeed as Boolean complementation on S d .We therefore write ¬ for the restriction of ad to S d .
3.1.4.Modal semirings.We denote the opposite of a semiring S, in which the order of multiplication has been reversed, by S op .It is once again a semiring.A codomain (resp.Boolean codomain) semiring is a semiring equipped with a map r : S → S (resp.ar : S → S) such that (S op , r ) (resp.(S op , ar )) is a domain (resp.Boolean domain) semiring.
As expected, the codomain operation models the domain of the converse relation in the relational model, and in the path model the set of all targets of paths in a given set of paths.
Consider a semiring equipped with a domain and a codomain operation.The domain and codomain axioms alone do not imply that S d = S r , let alone the compatibility properties In the third step, we have ar (x)d (r (x)) = 0 because ar (x)r (x) = 0 and yz = 0 ⇔ yd(z) = 0 hold in any Boolean modal semiring.In the fourth step, r (x)d (r (x))ar (x) = 0 because d (r (x)) ≤ 1 and again ar (x)r (x) = 0. Moreover r (x)d (r (x))r (x) = r (x)r (x) because d (y)y = y holds in any modal semiring.
The proof of the second identity in (3.2) follows by opposition.
In Boolean modal semirings, d (x) = x therefore implies r (x) = r (d (x)) = d (x) = x, while r (x) = x implies d (x) = x by opposition.This forces that S d = S r , as desired.
3.1.5.Modal Kleene algebras.A Kleene algebra is a dioid K equipped with a Kleene star (−) * : K → K that satisfies, for all x, y, z ∈ K, (1) (unfold axioms) The axioms on the left are the opposites of those on the right.Intuitively, the axioms for the Kleene star model a finite iteration of an element x as a least fixpoint.The first unfold axiom, for instance, states that iterating x either amounts to doing nothing, that is, doing 1, or doing x once and then continuing the iteration.As possibly infinite iterations would satisfy such unfold laws, too, the induction laws filter out the least fixpoints of the corresponding pre-fixpoint equations.More detailed explanations of the induction laws can be found in the literature.In the relational model, (−) * is the reflexive-transitive closure of a relation, in the path model it captures the repetitive composition of paths in a given set.
Useful consequences of Axioms i) and ii) include, for all x, y ∈ K, and i ∈ N, where x i denotes the i-fold multiplication of x with itself, as well as the quasi-identities The Kleene plus (−) + : K → K is defined as x + = xx * .It corresponds to the transitive closure operation in the relational model.The above notions of domain and codomain extend to Kleene algebras without any additional axioms.A (Boolean) modal Kleene algebra is thus a Kleene algebra that is also a (Boolean) modal-semiring.
3.1.6.Modal Operators.In our algebraic approach to higher rewriting, modalities allow relating sets of higher-dimensional cells to their sets of lower-dimensional source and target cells, see (3.2.6), and thus expressing the forall/exists properties defining fillers and pasting conditions in proofs of higher rewriting.
In the relational model of the 1-dimensional case, |x p indicates the subset of the underlying set from which one may reach the set p along relation x, and x|p the set that one may reach from p along x.Similarly, |x]p indicates the set from which we must reach the set p along x, and [x|p the set that we must reach from p along x.Similar intuitions underlie the path model of modal Kleene algebra, and these generalise to the notions of higher paths and their relations expressed in the filler properties and pasting conditions of higher rewriting.These explanations motivate the following algebraic definitions.
Let (S, +, 0, •, 1, d , r ) be a modal semiring.For x ∈ S and p ∈ S d , we define the forward and backward modal diamond operators Finally, boxes and diamonds are adjoints in Galois connections: As a consequence, diamonds preserve all existing sups in S, whereas boxes reverse all existing infs to sups, and all modal operators are order preserving.
The subidentity relations below Id X form the greatest Boolean subalgebra between ∅ X and Id X .It is isomorphic to the power set algebra P(X).Every subalgebra of a full relation Kleene algebra is a relation Kleene algebra.
The full relation Kleene algebra over X extends to a full relation Boolean modal Kleene algebra over X by defining, as expected, The domain algebra P(X × X) d equals the Boolean algebra of subidentity relations.The antidomain and anticodomain maps are then given by relative complementation ad (R) = Id X \ d (R) and ar (R) = Id X \ r (R) within the domain algebra.Finally, it is straightforward to check that the algebraic definitions of boxes and diamonds expand to their standard relational Kripke semantics: and likewise for the backward modalities.This requires swapping (a, b) to (b, a) in the above expressions, which amounts to taking relational converse.
3.1.8.Example: path Kleene algebras.The path model of modal Kleene algebra is a stepping stone towards polygraph models of higher Kleene algebras.Instead of a 1-polygraph, we could speak of a directed graph or quiver.So let P * be the free 1-category generated by the 1-polygraph P = (P 0 , P 1 ).Its elements are paths in P to which we assign source and target maps s 0 and t 0 as well as a path composition 0 in the standard way.Then (P(P * 1 ), ∪, ∅, , 1, (−) * ) forms a Kleene algebra, the full path (Kleene) algebra K(P ) over P .
Here, composition is defined as a complex product for any φ, ψ ∈ P(P * 1 ), and 1 is the set of all identity arrows, or paths of length zero, of P .
The Kleene star is defined as where φ 0 = 1 and φ i+1 = φ φ i .It models the repetitive composition of the paths in φ mentioned before.Every subalgebra of the full path Kleene algebra over P is a path Kleene algebra.As in the case of relational Kleene algebras, the set of all subidentities (subsets of 1), the set of sets of identity arrows, forms a Boolean subalgebra.
The full path algebra over P extends to a full path Boolean modal Kleene algebra over P by defining where 1 x denotes the identity arrow on an object x ∈ P 0 .The domain algebra induced equals the Boolean algebra of subidentities.The antidomain and anticodomain maps are therefore given again by relative complementation ad (φ) = 1 \ d (φ) and ar (φ) = 1 \ r (φ) within the domain algebra.Finally, unfolding definitions shows that where p ⊆ 1 is some set of identity arrows.Reachability along a relation has now been replaced by reachability along a set of paths.Similar expressions for backward modalities can be obtained again by swapping source and target maps in the right places.
The relational model and the path model are very similar.In fact the relational model can be obtained from the path model by applying a suitable homomorphism of modal Kleene algebras.
3.2.Higher globular Kleene algebras.We now extend the axiomatisations in the previous sections to a new notion of globular n-dimensional modal Kleene algebra.First, we provide axioms for n-dimensional dioids that satisfy lax interchange laws between multiplications of different dimension, similar to those of concurrent Kleene algebra [HMSW11].We then extend it with domain operations of different dimension and add further axioms that capture globularity.Finally we equip these algebras with star operations for each dimension and impose novel lax interchange laws between compositions and stars of different dimension.

n-Dioid.
A 0-dioid is a bounded distributive lattice; a 1-dioid is a dioid.More generally, for n ≥ 1, an n-dioid is a structure (S, +, 0, i , 1 i ) 0≤i<n satisfying the following conditions: i) (S, +, 0, i , 1 i ) is a dioid for 0 ≤ i < n, ii) the following lax interchange laws hold for all 0 ≤ i < j < n: iii) higher-dimensional units are idempotents of lower-dimensional multiplications, for 0 ≤ i < j < n, 1 j i 1 j = 1 j (3.7)With lax interchange laws we need not worry about an Eckmann-Hilton collapse.

Domain n-semirings.
For n = 0, we stipulate that a domain 0-semiring is a 0-dioid.For n ≥ 1, a domain n-semiring is an n-dioid (S, +, 0, i , 1 i ) 0≤i<n equipped with n domain maps d i : S → S, for all 0 ≤ i < n, satisfying the following conditions: (1) (S, +, 0, i , For 0 ≤ i < n, the set S d i = d i (S) is called the i-dimensional domain algebra and denoted by S i .Furthermore, to distinguish elements of different dimensions 0 ≤ i < j < n, we henceforth denote elements of S i by p, q, r, . . ., elements of S j by φ, ψ, ξ, . . ., and other elements of S by A, B, C, . . .This simplifies reading proofs where elements of different dimension are interacting.For any natural number k, the k-fold i-multiplication of an element A of S, for 0 ≤ i < n, is defined by The axioms ii) and iii) from (3.2.1) for n-dioids provide the basic algebraic structure for reasoning about higher rewriting systems.Indeed, the dependencies between multiplications of different dimension expressed by the lax interchange laws capture the lifting of the equational interchange law for n-categories, while the idempotence of i-multiplication for the j-unit expresses completeness of the set of j-dimensional cells in an n-category with respect to i-composition.In this way, these axioms begin to capture the higher dimensional character of polygraphs, as is explained in (3.3.1), in which we provide a model of this structure based on polygraphs.The domain axiom ii) from (3.2.2) further captures characteristics of dimension, which are expressed abstractly in the following proposition.Proposition 3.2.In any domain n-semiring S such that n ≥ 1, for all 0 ≤ i < j < n, Proof.The first identity is proved by a simple induction on axiom ii) in (3.2.2).The second one quickly follows, since d i (1 i ) = 1 i follows from the domain semiring axioms, and thus d j (1 i ) = 1 i using i).The third identity is again a direct consequence, since by ii) we know that 1 i ∈ S j , and that 1 j is the greatest element of S j .The fourth one follows since x ∈ S i if, and only if, d i (x) = x, which is equivalent to d j (x) = x by i).The fifth identity is verified by noticing that the inclusion S j → S is a morphism of domain semirings with the operation i .Furthermore, since d i (S j ) ⊆ S i and S i ⊆ S j , we have d i (S j ) = S i .Noticing that, in fact, S j → S is a morphism of domain semirings with the operation k for any 0 ≤ k ≤ i gives us vi).The final result follows from basic properties of domain semirings.
For any n-semiring S, we denote by S op the n-semiring in which the order of each multiplication operation has been reversed.An n-semiring S is a codomain n-semiring if S op is a domain n-semiring.The codomain operations are denoted by r i .A modal n-semiring is an n-semiring with domains and codomains, in which the coherence conditions d i • r i = r i and r i • d i = d i hold for all 0 ≤ i < n.
3.2.3.Remarks.Section (3.1.8)explains that the path algebra K(P ) defined as the power set of 1-cells in the free category generated by a 1-polygraph P = (P 0 , P 1 ) is a model of modal 1-semirings.The domain algebra K(P ) d is isomorphic to the power set of P 0 .According to (3.1.2),in the general case of a domain semiring (S, +, 0, •, 1, d), the domain algebra S d forms a bounded distributive lattice with + as join, • as meet, 0 as bottom and 1 as top.This is why we consider a 0-dioid as a bounded distributive lattice.The idempotence and commutativity of multiplication reflect the algebraic properties of a set of identity 1-cells.
In Section 3.3 we construct higher path algebras over n-polygraphs and show that these form models of modal n-semirings.In this case it makes sense that (S i , +, 0, i , 3.2.4.Diamond operators.Let S be a modal n-semiring.We introduce forward and backward i-diamond operators defined via (co-)domain operations in each dimension by analogy to (3.1.4).For any 0 ≤ i < n, A ∈ S and φ ∈ S i , we define (3.8) These diamond operations have all of the properties listed in (3.1.6)with respect to imultiplication and elements of S i .As before, antidomains are required to express box operators.
These show that multiplication of elements in a Kleene algebra amounts to to multiplying their restrictions to the appropriate domain or range as using properties of domain semirings (3.1.2) and compatibility of these restrictions with globular relations.
3.2.7.Modal n-Kleene algebra.An n-Kleene algebra is an n-dioid K equipped with Kleene stars (−) For 0 ≤ i < j < n, the Kleene star (−) * j is a lax morphism with respect to the i-whiskering of j-dimensional elements on the right (resp.left).Hence, for all A ∈ K and φ ∈ K j , As in the case of 1-Kleene algebras in (3.1.5),the notions of (p-Boolean) n-semiring structures with (co)domains are compatible with those of n-Kleene algebra.Hence, a n-Kleene algebra with domains (resp.codomains) is a n-Kleene algebra such that the underlying semiring has domains (resp.codomains).When the underlying n-semiring is modal, this yields a modal n-Kleene algebra.If it is p-Boolean, we have a p-Boolean modal n-Kleene algebra.We call it globular when the underlying modal n-semiring is.
Finally, note that for n = 2, we recover the standard concurrent Kleene algebra axioms [HMSW11], except that 1 0 = 1 1 and commutativity of 1 is normally assumed in this case.

A model of higher modal Kleene algebras.
3.3.1.Polygraphic model.Let P be an n-polygraph and Γ a cellular extension of the free (n, n − 1)-category P n .In what follows, write A, B, C, . . .for sets of (n + 1)-cells and α, β, γ, . . .for individual (n + 1)-cells.For any k-cell α, the elements s i (α), t i (α), ι l k (α) were defined for 0 . The i-composition of a k-cell α and an l-cell β for 0 ≤ i < k ≤ l ≤ n+1 was defined in (2.1.1).For 0 ≤ k ≤ l < n + 1, we define l (β) for l ≤ i.An (n + 1)-modal Kleene algebra K(P, Γ), the full (n + 1)-path algebra over P n [Γ] is given by the following data: 9:28 i) The carrier set of K(P, Γ) is the power set P(P n [Γ]).ii) For 0 ≤ i < n + 1, the binary operation i on K(P, Γ) corresponds to the lifting of the composition operations of P n [Γ] to the power-set, that is, for any A, B ∈ K(P, Γ), iii) For 0 ≤ i < n + 1, the sets are the multiplicative units: Furthermore, when i < j, the inclusion 1 i ⊆ 1 j holds.Indeed, in that case ) by uniqueness of identity cells, and ι j i (u) ∈ P n (Γ) j is a j-cell.iv) The addition in K(P, Γ) is set union ∪.The ordering is therefore set inclusion.v) The i-domain and i-codomain maps d i and r i are defined by These are thus given by lifting the source and target maps of P n [Γ] to the power set.The i-antidomain and i-anticodomain maps are then given by complementation with respect to the set of i-cells: vi) The i-star is, for Proposition 3.4.For any n-polygraph P and cellular extension Γ of P n , K(P, Γ) is an n-Boolean (n + 1)-modal Kleene algebra.The set Γ c of rewriting steps generated by Γ, defined in Remark 2.2.2, is represented in n-Kleene algebra by Therefore, α is an Proof.It is easy to check that, for 0 ≤ i < n + 1, the tuple is a modal semiring.The fact that it is n-Boolean is a result of it being a power-set algebra.Let A, A , B, B ∈ K(P, Γ) and 0 ≤ i < j < n + 1.We wish to check the lax interchange law ) is defined, then as a consequence of the interchange law for (n + 1) categories, we have which gives the desired inclusion (3.14).This situation is illustrated by the diagram The lax interchange law does not reduce to an equality due to composition of diagrams of the shape is defined, whereas neither α and β nor α and β are j-composable, so that in general the inclusion (3.14) is strict.
Further, given 0 ≤ i < j < n + 1, we have 1 j ⊆ 1 j i 1 j .Indeed, for any j-cell α, we The first two globularity axioms are immediate consequences of the globularity conditions on the source and target maps of P n (Γ).Furthermore, for 0 ≤ i < j < n + 1 and A, B ∈ K(P, Γ), we have u ∈ d j (A i B) if, and only if, there exist α ∈ A and β ∈ B such that u = s j (α i β) = s j (α) i s j (β), which is equivalent to u ∈ d j (A) i d j (B).Similarly, we show that r j (A i B) = r j (A) i r j (B).
Finally, we consider the Kleene star axioms.It is easy to check that, given a family (B k ) k ∈I of elements of K(P, Γ) and another element A, we have, for all 0 ≤ i < n + 1, It then follows by routine calculations that A * i defined above satisfies, for each i, the Kleene star axioms from (3.1.5).It only remains to check that for 0 ≤ i < j < n + 1, the j-star is a lax morphism for i-whiskering of j-dimensional elements on the left (the right case being symmetric), that is φ i A * j ⊆ (φ i A) * j for φ ∈ K(P, Γ) j and A ∈ K(P, Γ).By construction, K(P, Γ) j is in bijective correspondence with (P n (Γ)) j , the set of j-cells of P n [Γ].Considering such elements φ and A, we have β ∈ φ i A * j in the following two cases: i) There exist u ∈ φ and α ∈ A + j , where A + j := A j A * j is the Kleene plus operation, such that β = u i α.Since α ∈ A + j , there exist a k > 0 and cells α 1 , α 2 , . . ., Since i < j, the following is a consequence of the interchange law for n-categories: and thus we have β ∈ (φ i A) + j .
ii) There exist u ∈ φ and v ∈ (P n (Γ)) j with v ∈ A such that β = u i v.This is due to the fact that A * j = 1 j + A + j .In that case, we have β ∈ (P n (Γ)) j , i.e. β ∈ 1 j .By the unfold axiom, we have 1 j ⊆ (φ i A) * j , and thus β ∈ (φ i A) * j .
The fact that α is an (n + 1)-cell of P n [Γ] if, and only if, α ∈ (Γ c ) * n , follows by definition of Γ c and the fact that any (n + 1)-cell of P n [Γ] is an n-composition of rewriting steps.

Algebraic coherent confluence
In this section, we present algebraic proofs of the coherent Church-Rosser theorem and coherent Newman's lemma in higher globular Kleene algebras.Apart from the definitions of these Kleene algebras, these constitute the main contribution of this article.First, we revisit abstract rewriting properties formulated in modal Kleene algebras [DMS11,Str02,Str06] .We then formalise notions from higher rewriting needed to prove our results, introducing fillers in the setting of globular modal n-Kleene algebras, which correspond to the notion of fillers for polygraphs defined in (2.3.1).We also define the notion of whiskering in modal n-Kleene algebras, analogous to the polygraphic definition in (2.1.3)and describe the properties thereof needed for our proofs.This does not require modalities.Newman's Lemma in K, with K d a complete Boolean algebra [DMS11], states that for any x, y ∈ K such that (x + y) ∈ N (K), Our proofs of the coherent Church-Rosser theorem below are quite different from those in Kleene algebra.They require modalities, but follow the standard diagrammatic proof quite closely.The parts of the proof of coherent Newman's lemma that deal with termination are quite different from the standard diagrammatic proof, whereas this proof follows the Kleene-algebraic one quite closely.We therefore recommend to study this proof [DMS11] before reading the coherent one.

4.2.
A coherent Church-Rosser theorem.Let K be a globular n-modal Kleene algebra and 0 ≤ i < j < n.Before defining fillers in globular modal n-Kleene algebras, we first explain the intuition behind the forward diamond operators in n-modal Kleene algebras, defined in (3.2.4).Given A ∈ K and φ, φ ∈ K j , by definition, In terms of quantification over sets of cells, as for example in the polygraphic model, this means that for every element u in φ , there exist elements v in φ and α in A such that the j-source (resp.j-target) of α is u (resp.v), as required.This motivates the definitions in the following paragraph.4.2.1.Confluence fillers.For elements φ and ψ of K j , we say that an element 4.2.2.Remarks.In any n-Kleene algebra, This shows that an i-Church-Rosser filler for (φ, ψ) is an i-confluence filler for (φ, ψ) and that an i-confluence filler for (φ, ψ) is a local i-confluence filler for (φ, ψ).
Given an i-confluence filler A for (φ, ψ), the conditions on domain and codomain in the above definitions imply an i-dimensional globular property of (φ, ψ).For all p ∈ K i , Indeed, writing A = A j (ψ * i i φ * i ), we have The first step uses the definition of diamonds, the second the fact that A is an i-confluence filler and order-preservation of d i , the third, fourth and fifth the globularity relations (3.11), (3.9) and (3.12) respectively.The final inequality follows because d (p • x) = p • d (x) holds in modal Kleene algebra, see (3.1.2).For codomains, opposition implies that r j (A ) = r j (A j (ψ * i i φ * i )) = r j (A) j r j (ψ The final step is again by definition of diamonds.Similar results hold for local and semiconfluence fillers.Thus φ and ψ commute modally (resp.locally modally) with respect to i-multiplication.For this reason, the confluence filler (local confluence filler) defined in (4.2.1) can be represented diagrammatically: Let K be a globular modal n-Kleene algebra.For 0 ≤ i < j < n and φ ∈ K j , the right (resp.left) i-whiskering of an element A ∈ K by φ is the element In what follows, we list properties of whiskering and define completions.i) Let φ, ψ ∈ K j and A ∈ K.We have (4.1) Indeed, since φ j φ = φ, the interchange law gives Applying domain on each side yields where we used monotonicity of domains, the definition of diamonds (3.8) and one of the globular laws (3.11).A similar argument yields absorption laws for whiskering on the right, as well as corresponding inequalities for backward diamonds.ii) We define completions of elements by whiskering.Let A be an i-confluence filler of a pair (φ, ψ) of elements in K j .The j-dimensional i-whiskering of A is the following element of K: The j-star of this element is called the i-whiskered j-completion of A. iii) The i-whiskered j-completion of a confluence filler A absorbs whiskers, that is, for each where Â is the j-dimensional i-whiskering of A. Indeed, by definition of Â, for any ξ ≤ (φ + ψ) * i .Using the fact that (−) * j is a lax morphism with respect to i-whiskering by j-dimensional elements, see (3.1.5),we deduce where the last inequality holds by monotonicity of (−) * j .A similar proof shows that Â * j i ξ ≤ Â * j .
Next we show two proofs of coherent Church-Rosser theorems in globular n-MKA to show the versatility of our approach.The first one procedes, as usual, by induction on the size of the zig-zag.It has no "closed" proof in Kleene algebra.The second one uses the fixpoint induction for the Kleene star.Let K be a globular modal n-Kleene algebra and 0 ≤ i < j < n.Given φ, ψ ∈ K j , an i-confluence filler A of (φ, ψ) and any natural number k ≥ 0, there exists an A k ≤ Â * j such that where Â is the j-dimensional i-whiskering of A.
Proof.In this proof, juxtaposition of elements denotes i-multiplication.We reason by induction on k ≥ 0. For k = 0, we may take A 0 = 1 i .Indeed, For k > 0, supposing that A k−1 is constructed, we set • The first step unfolds the definition of A k , the second uses axiom ii) from (3.1.2) and the third globularity (3.11).The inequality in the fourth step is by hypothesis that A is an i-confluence filler, and the fifth is a consequence of the fact that The sixth step is again a consequence of globularity (3.11), the seventh follows from the induction hypothesis, and the last equality is by definition of the k-fold i-multiplication.
Next we show r j (A k ) ≤ ψ * i φ * i : The first equality holds by definition of A k , the second by axiom ii) from (3.1.2) (for codomains), the third by the induction hypothesis, the fourth by φ ≤ φ * i and ψψ * i ≤ ψ * i .The fifth step holds since A is an i-confluence filler, the sixth by the fact that d (x) • x = x, a consequence of axiom i) from (3.1.2).Finally, as explained in (4.2.2), which gives step seven since ψ * i i φ * i ∈ K j .The final step is due to φ * i i φ * i = φ * i , a basic consequence of the Kleene star axioms.
To conclude, it remains to show that A k ≤ Â * j .By whisker absorption, described in (4.3), and the fact that We now prove an analogous theorem using the implicit fixpoint induction of Kleene algebra.
Proof.As in the previous proof, i-multiplication is denoted by juxtaposition.Let φ, ψ be in K j , for 0 < j < n, and A in K be an i-confluence filler of (φ, ψ), with 0 ≤ i < j.By the left i-star induction axiom in (3.1.5), The inequality 1 i ≤ ψ * i φ * i ≤ | Â * j j (ψ * i φ * i ) holds: by the unfold axiom from (3.1.5), 1 i ≤ ψ * i , 1 i ≤ φ * i , which yields the first inequality, and 1 j ≤ Â * j .Using the latter, Distributivity allows us to prove this for each summand separately: • In the case of whiskering by φ on the left, The first step follows from whiskering properties in (4.2.3), the second from the hypothesis that A is an i-confluence filler and φψ * i ≤ φ * i ψ * i .The third step is again by whiskering, and the fourth by definition of diamonds and axiom ii) from (3.1.2).The fifth follows by whisker absorption, (4.2.3), and the last step follows from the unfold axiom from (3.1.5),since it implies that x • x * ≤ x * .• In the case of whiskering by ψ on the left, The first step is again by whiskering properties from (4.2.3), the second by the fact that ψψ * i ≤ ψ * i which, as explained above, is a consequence of the unfold axiom from (3.1.5).Finally, whisker absorption justifies the last inequality.
4.2.4.Remarks.In Theorem 4.1, the elements A k satisfy |A k j (ψ * i φ * i ) ≥ (φ + ψ) k i .This means that scanning backward along A k from ψ * i φ * i , we see at least all of the "zig-zags" in φ and ψ of length k, whereas in Theorem 4.2, the inequality | Â * j j (ψ * i φ * i ) ≥ (φ + ψ) * i means that scanning back from ψ * i φ * i , we see at least all of the zig-zags in φ and ψ of any length.However, the elements A k from Theorem 4.1 satisfy in addition This formulation is consistent with the intuition of paving from zigzags (φ + ψ) k i to the confluences ψ * i φ * i .Yet this sort of inequality cannot be expected of the j-dimensional icompletion of A, since in general, using the path-algebraic intuition, Â * j contains additional cells that go from zigzags to zigzags.In conclusion, the fact that the diamonds scan all possible future or past states implies that we must proceed as in Theorem 4.2 when considering completions, or construct the elements paving precisely what we would like as in Theorem 4.1.
Corollary 4.3.Let K be a globular modal n-Kleene algebra.If φ, ψ ∈ K j , for i < j < n, for any semi-i-confluence filler A ∈ K, then where Â is the j-dimensional i-whiskering of A.
Proof.In the case of a left semi-confluence filler, the proof is identical.If A is a right semi-confluence filler, we use the right i-star axiom and the proof is given by symmetry.
4.3.1.Termination in n-semirings.We define the notion of termination, or Noethericity, in a modal n-semiring K as an extension of that for modal Kleene algebras in (4.1.1).For 0 ≤ i < j < n, an element φ ∈ K j is i-Noetherian or i-terminating if p ≤ |φ i p ⇒ p = 0 holds for all p ∈ K i .The set of i-Noetherian elements of K is denoted by N i (K).When K is a modal p-Boolean semiring, then, as a consequence of the adjunction between diamonds and boxes outlined in (3.1.6),we obtain an equivalent formulation of Noethericity in terms of the forward box operator: Finally, φ is i-well-founded if it is i-Noetherian in the opposite n-semiring of K.
Theorem 4.4 (Coherent Newman's lemma for globular p-Boolean MKA).Let K be a globular k-Boolean modal Kleene algebra, and 0 ≤ i ≤ k < j < n, such that (1) (K i , +, 0, i , 1 i , ¬ i ) is a complete Boolean algebra, (2) K j is continuous with respect to i-restriction, that is, for all ψ, ψ ∈ K j and every family (p α ) α∈I of elements of K i , ψ i sup I (p α ) i ψ = sup I (ψ i p α i ψ ).
Let ψ ∈ K j be i-Noetherian and φ ∈ K j i-well-founded.If A is a local i-confluence filler for (φ, ψ), then that is, Â * j is a confluence filler for (φ, ψ).
For the middle summand, we calculate The first step uses the local i-confluence filler hypothesis, the second whiskering properties from (4.2.3) and the third RP (p φ ).The fourth step is again by whiskering properties, and the fifth follows from axiom ii) in (3.1.2) and the definition of diamond operators.The final step is by whisker absorption, see (4.2.3).A similar arguments yields ≤ | Â j Â * j j (|ψ * i Â * j j (ψ * i φ * i )) ≤ | Â j Â * j j ψ * i Â * j j (ψ * i φ * i ) ≤ | Â j Â * j j Â * j j (ψ * i φ * i ).The first step follows from RP (p ψ ) and the second by whiskering properties.The third step follows from axiom ii) in (3.1.2) and the definition of diamond operators as in the preceding calculation.The final step follows from whisker absorption.Finally, we observe that Â j Â * j j Â * j ≤ Â * j , and thus by monotonicity of the diamond operator we may conclude that This shows that ∀p(RP (p φ ) ∧ RP (p ψ ) ⇒ RP (p)) and thus that r = 1 i , which completes the proof.
4.3.2.Remark.Similarly to the discussion in Remark 2.3.2 in the context of polygraphs, the proofs of Theorems 4.2 and 4.4 resemble those for 1-dimensional results modal Kleene algebra in [Str02,DMS11].Considering exclusively the induction axioms and deductions applied to j-dimensional cells yields the same proof structures as for modal Kleene algebras.Globular modal n-Kleene algebra therefore form a natural higher-dimensional generalisation of modal Kleene algebras in which proofs of coherent confluence can be calculated.The consistency of the abstract algebraic results from the previous sections with the point-wise polygraphic results from Section 2.3 is made explicit in the next and final section.
4.4.Instantiation to polygraphs.In the previous sections we have specified and proved Kleene algebraic versions of Theorems 2.1 and 2.2.Now we show that they provide faithful abstractions of the original polygraphic results, instantiating Theorems 4.2 and 4.4 to the polygraphic model of globular higher Kleene algebras from Section 3.3.First we add an operation of conversion to higher Kleene algebra, to capture zig-zag sequences faithfully.We fix an n-polygraph P and a cellular extension Γ of the (n, n − 1)category P n .It is an involution that distributes through addition, acts contravariantly on multiplication and commutes with the Kleene star.A modal Kleene algebra with converse [DMS06] is then a modal Kleene algebra which is also a Kleene algebra with converse.
Note that for φ ∈ K i with i < j, we have φ ∨ j = φ.This is a consequence of the fact that j is idempotent for elements of K i .4.4.3.Conversion in the polygraph model.The modal (n + 1)-Kleene algebra K(P, Γ) generated by P and Γ, as defined in (3.3.1), is a modal (n + 1, n − 1)-Kleene algebra.For all φ ∈ K(P, Γ) n and A ∈ K, φ ∨ n−1 := { u − | u ∈ φ} and A ∨n := { α − | α ∈ A} is well defined in the following sense: Every φ ∈ K(P, Γ) n is a set of cells of dimension less than or equal to n.Any cell v of dimension i < n is its own n-inverse, since we consider it as an identity.For any n-cell u, we know that u − is well defined since if u ∈ P n then u − ∈ P n .The case of (−) ∨n is similar.
.2) for every x ∈ S. Indeed, consider the domain and range semiring S = ({a}, +, 0, •, 1, d , r ) with addition defined by 0 < a < 1, multiplication by a 2 = a, domain by d (a) = 1 and codomain by r (a) = a.Then S d = {0, 1} = {0, a, 1} = S r and d (r (a)) = 1 = a = r (a), but r • d = d fails in the opposite semiring.A modal semiring S [DS11] is a domain semiring and a codomain semiring that satisfies the compatibility properties (3.2).Boolean domain semirings that are also Boolean codomain semirings are called Boolean modal semirings.In this case, maximality of S d and S r = {x ∈ S | r (x) = x} forces the domain and range algebra of S to coincide, so that the extra axioms (3.2) are unnecessary.We provide a formal proof, as this fact has so far been overlooked in the literature.Lemma 3.1.In every Boolean modal semiring the compatibility properties (3.2) hold.Proof.Suppose S is a Boolean modal semiring and let x in S. Then d (r (x)) = (ar (x) + r (x))d (r (x)) = ar (x)d (r (x)) + r (x)d (r (x))(ar (x) + r (x)) = 0 + r (x)d (r (x))ar (x) + r (x)d (r (x))r (x) = 0 + r (x)r (x) = r (x) proves the first identity in (3.2).
|x p = d (xp) and x|p = r (px).(3.3)When S is a Boolean modal semiring, we additionally define the forward and backward modal box operators |x]p = ¬|x (¬p) and [x|p = ¬ x|(¬p).(3.4)Beyond the intuitions given, these are modal operators in the sense of Jónsson and Tarski's Boolean algebras with operators [JT51] because the identities |x (p + q) = |x p + |x q, |x 0 = 0, x|(p + q) = x|p + x|q, x|0 = 0, hold, and dually |x](pq) = |x]p + |x]q, |x]1 = 1, [x|(pq) = [x|p + [x|q, [x|1 = 1.It is easy to see that |− and −|, as well as |−] and [−| are related by opposition.In a (Boolean) modal Kleene algebra, following Jónsson and Tarski, this can be expressed by the conjugation laws|x p • q = 0 ⇔ p • x|q = 0 and |x]p + q = 1 ⇔ p + [x|q = 1.In the relational model, it can be expressed explicitly using relational converse.In a Boolean modal semiring, boxes and diamonds are related by De Morgan duality by their definition (3.4) and additionally by |x p = ¬|x](¬p) and x|p = ¬[x|(¬p).(3.5) Finally, we mention the properties |xy = |x • |y , xy| = y| • x|, |xy] = |x] • |y] and [xy| = [y| • [x|.3.1.7.Example: relation Kleene algebra.Here we put our aforementioned intuitions on solid foundations.The relational model of plain Kleene algebra has been the starting point for Kleene-algebraic proofs of the Church-Rosser theorem of abstract rewriting, that of modal Kleene algebra has motivated the Kleene-algebraic proof of Newman's lemma.For any set X, the structure (P(X × X), ∪ , ∅ X , ; , Id X , (−) * ) forms a Kleene algebra, the full relation Kleene algebra over X.The operation ; is relational composition defined by (a, b) ∈ R ; S if, and only if, (a, c) ∈ R and (c, b) ∈ S, for some c ∈ X.The relation Id X = {(a, a) | a ∈ X} is the identity relation on X and (−) * is the reflexive transitive closure operation defined, for R 0 = Id X and R i+1 = R ; R i , by (a, b) ∈ R} and r (R) = {(a, a) | ∃b.(b, a) ∈ R}.
[DMS11]erent Church-Rosser theorem is proved in Section 4.2, first in Proposition 4.1 using classical induction and then in Theorem 4.2 using only the induction axioms for the Kleene star.In Section 4.3, we define notions of termination and well-foundedness in globular modal p-Boolean Kleene algebras and prove Theorem 4.4, the coherent Newman's lemma.Termination.An element x ∈ K terminates, or is Noetherian[DMS11], if p ≤ |x p ⇒ p = 0 holds for all p ∈ K d .The set of Noetherian elements of K is denoted by N (K).The Galois connections (3.1.6)leadtothefollowingequivalentcharacterisation:x∈Kis Noetherian if, and only if, for all p ∈ K d , |x]p ≤ p ⇒ p = 1.4.1.2.Semi-commutation.Local confluence, confluence and the Church-Rosser property for abstract rewriting systems are captured in Kleene algebras as follows.For elements x, y ∈ K, the pair (x, y) semi-commutes (resp.semi-commuteslocally)ifx*y*≤ y * x * (resp.xy≤y*x* ).The ordered pair (x, y) semi-commutes modally (resp.semi-commuteslocallymodally)if|x* • |y * ≤ |y * • |x * (resp.|x•|y≤ |y * • |x * ).Confluence results in Kleene algebras.The Church-Rosser theorem and Newman's lemma for abstract rewriting systems are instances of the following specifications in modal Kleene algebra.In the following subsections we prove higher-dimensional generalisations of these results.The Church-Rosser theorem in K [Str02, Thm.4] states that, for any x, y ∈ K,x * y * ≤ y * x * ⇔ (x + y) * ≤ y * x * .* ≤ y * x * .