Documente Academic
Documente Profesional
Documente Cultură
M. W. Hopkins1
Abstract
The algebraic approach to formal language and automata theory is a contin-
uation of the earliest traditions in these fields in which languages, transduc-
tions and other computations were represented as expressions (e.g. regular
expressions) in suitably-defined algebras; grammars, automata and transitions
as relational systems over these algebras, with the expressions as their solutions.
Following such results as the algebraic reformulation of the Parikh Theorem, the
possibility has been recognized that other classical results of formal language
and automata theory may be similarly recast.
A foundation for such a reformulation is provided here centering on the
construction of a complete lattice of algebras linked by a network of adjunctions.
Each algebra is a dioid (or idempotent semiring) additive and distributive over a
distinguished subfamily of subsets. The hierarchy includes quantales and many
of the Kleene algebras that have been considered in the literature.
The subset families mirror the classical notion of language family, with rep-
resentatives for types 0, 2 and 3 in the Chomsky hierarchy. Notable features of
our development include the generalization of grammars to arbitrary monoids
(including type 1 grammars), a unified foundation for languages and transduc-
tions, and the generalization of regular expressions to expression algebras for
types 2 and 0 grammars.
Keywords: Kleene, Language, Chomsky Hierarchy, Context-Free, Grammar,
Transduction, Regular Expression, Context-Free Expression, Rational,
Monoid, Semigroup, Dioid, Quantale, Ideal, Semiring, Adjunction, Monad,
T-Algebra, Eilenberg-Moore, Tensor Product, Monoidal Category.
I This is an extended version of [16, 17]. Significant new material has been added, including
2 “Let F (V ) be the free monoid generated by [the terminals] V , i.e. the set of all strings
T T
in the vocabulary VT . A language is, then, a subset of F (VT )”, [6, p. 8].
3 This gives rise to conventions such as aU b = {aub : u ∈ U }, which we will observe.
2
Thus, we may consider more general algebras which contain at least the
structure of a partially ordered monoid closed under the least upper bounds of its
finite subsets4 and distributive with respect its least upper bound operator. This
replaces the classical formulation which treated languages and transductions just
as subsets, respectively, of PX ∗ and P (X ∗ × Y ∗ ).
However, the definitions in the classical theory are cast almost entirely in
set-theoretic terms, as are the arguments for the corresponding theorems, even
though the ideas and the results frequently have a purely algebraic or categorical
flavor that can be stated in such fashion, with both an increase in transparency
and generality. As a result, the full potential of the results arrived at classically
is missed. This discrepancy is what the algebraic approach seeks to rectify.
From its inception, the Applications in Kleene Algebra conference has rec-
ognized the possibility of such a foundation:
“Recent algebraic versions of classical results in formal language theory, e.g.
Parikh’s theorem [15], point to the exciting possibility of a general algebraic
theory that subsumes classical combinatorial automata and formal language
theory [pointing] to a much more general, purely axiomatic theory in the spirit
of modern algebra.”5
Taking a significant step in this direction, the beginnings of such a refor-
mulation are provided here, bringing fully to bear the power of monads and
adjunctions. At its foundation lies a complete lattice of algebras, each contain-
ing the structure of a dioid (or idempotent semiring) additive and distributive
over a distinguished family of subsets.
At one extreme, the algebra PM , possesses both unlimited additivity and
distributivity. It is the archetype of the quantale with a unit {1}; in fact, the
free quantale extension of the monoid M . At the opposite extreme, the algebra
FM of finite subsets contains only additivity and distributivity with respect
to finite subsets. This is another way of describing the dioid, or idempotent
semiring. Classically, it corresponds to the family FM of finite languages: the
free dioid extension of M .
More generally, each subset family is associated with a monad connecting
it to the category of monoids and generalizes the classical language family and
transduction family. The range of possible families mirrors the classical language
hierarchy, and includes representatives for types 0, 2 and 3 in the Chomsky
hierarchy, as well as families that go beyond type 0: oracles. The elements of
this formalism are developed in section 3 and its extensions and applications
in section 4. The inclusion of types 0, 2 and 3 of the Chomsky hierarchy is
discussed in section 6.
A notable feature of our development is the generalization of grammars to
arbitrary monoids that also incorporates a reformulation of type 1 grammars.
4 We will refer to the closure under least upper bounds here and below as additivity.
5 Programme introduction, Applications of Kleene Algebra, Schloss Dagstuhl, February
2001.
3
The treatment of generalized grammars is the topic of section 2. The formulation
that emerges brings to the forefront the roles played by free extensions and tensor
products.
Each member of the algebra hierarchy may be regarded as a subset of a
quantale subject to a restriction on distributivity and additivity. A network of
adjunctions between the different algebras can be defined which gives realization
to this idea. An outline of the general construction is given in section 5.
Much of these developments were foreshadowed by Kozen [19], where implicit
use was made of the monad concept to develop a hierarchical relation between
different varieties of Kleene algebras. Earlier work has been carried out by
Conway [7] in the study of the algebra that came to be known as the quantale,
the *-continuous Kleene Algebra, and the “countably-closed dioid”. In addition,
as we will see at the end of section 4, the Chomsky-Schützenberger theorem [6]
should also be considered as an early precursor to these developments.
The quantale emerged in the 1980’s in quantum physics (hence the name),
particularly in the study of C*-algebras and von Neumann algebras. Both the
quantale and dioid have also played a role in non-linear dynamics, linear logic,
Penrose tilings, discrete event systems ([1, 2, 11, 14, 30, 31, 34, 37]; see also
[13] and references contained therein), and related fields (e.g. see Maslov, et
al. [27]). Our use of these algebras in the setting of formal language theory
reveals what appears to be a cross-connection with the mathematics used in the
foundational physics of both classical and quantum physics, perhaps bringing us
one step closer to realizing von Neumann’s goal of providing a unified founda-
tion for both physics and automata theory6 . This correspondence is furthered
with the introduction of the “polycyclic dioids”, matrix algebras and braided
monoidal categories (which are used prominently in differential geometry and
knot theory).
In section 7, we will discuss the extension of the dioid hierarchy to semi-
groups, semirings and power series algebras, along with other issues that the
limitations of time and space prevented us from addressing more fully here.
In the following, we will assume familiarity with the semigroups, monoids,
partial orderings, semi-lattices and lattices. In addition, we will assume basic
familiarity with categories, and the related concepts of functors and natural
transformations. References include [4, 8, 13], and for category theory, [26].
Two appendix sections have added to provide further detail on the adjunc-
tion and tensor product constructions used in sections 2, 4 and 7, and to estab-
lish the notational conventions used for the categorical algebras involved. Also
included is a brief self-contained treatment rendering tensor categories, adjunc-
tions and monads as categorical algebras in the spirit of [18, part I]. Sections
2.1, 2.8, 4.1 and 4.5 also bear the strong imprint of [18].
6 “We are very far from possessing a theory of automata which deserves that name, that
is, a properly mathematical-logical theory” [35]. It was von Neumann who earlier established
the foundational roles played by Boolean logic and Quantum logic, respectively, in classical
and quantum physics.
4
A more detailed treatment of adjunctions, monads and co-monads may be
found in [26]. Tensor categories are discussed further in [25, 29]. After reading
sections 2.8, 4.10 and 7.6 a deeper appreciation should emerge on the important
role that they play in formal language and automata theory. In particular,
in section 4.10 we shall find that the tensor product plays a crucial role in
the algebraic reformulation of the Chomsky-Schützenberger Theorem, replacing
the intersection + erasure construction that is used in classical theory for this
theorem.
2. Generalized Grammars
Classically, a grammar over the alphabet X affixes a set Q of indetermi-
∗
nates, called non-terminals to the free monoid X ∗ to obtain a set (X ∪ Q)
of configurations . This requires the assumption X ∩ Q = ∅. A finite subset
∗ ∗
H ⊆ (X ∪ Q) × (X ∪ Q) of phrase structure rules is used to generate a transi-
∗ ∗
tion relation over (X ∪ Q) . A starting configuration S ∈ (X ∪ Q) is identified
∗
and the language is defined as the set of all the words in X derivable from S by
a finite number of applications of transitions α → β for (α, β) ∈ H to subwords
in the present configuration. The classical theory usually assumes, further, that
the starting configuration is one of the variables, S ∈ Q, though this restriction
is not essential.
The grammar expression (α1 → β1 , . . . , αn → βn , S) is introduced here as
a means to denote the subset that results from this grammar, where H =
{(α1 , β1 ) , . . . , (αn , βn )}.
7 To make this truly a categorical algebra requires making explicit the forgetful functor
M̂ : Monoid → Set, writing σM,Q : Q → M̂M [Q], σ : Q → M̂M 0 and replacingD the second
E
of equations 1 and 2 respectively by M̂ hf, σi ◦ σM,Q = σ and f 0 ◦ hf, σi = f 0 ◦ f, M̂f 0 ◦ σ .
In here and section 4.1 we will take the shortcut of treating M̂ as an identity functor.
5
For monoids, the universal property is realized by taking elements α ∈ M [Q]
to be words of the form α = m0 q1 m1 . . . qn mn , where m0 , m1 , . . . , mn ∈ M ,
q1 , . . . , qn ∈ Q and n = deg (α) > 0 is the degree of the word. The product is
defined by
(m0 q1 m1 . . . qn mn ) (m00 q10 m01 . . . qn0 0 m0n0 )
(3)
= m0 q1 m1 . . . qn (mn m00 ) q10 m01 . . . qn0 0 m0n0
with deg (αβ) = deg (α) + deg (β). The homomorphism ιM,Q : m ∈ M → m ∈
M [Q] embeds M into M [Q] as words of degree 0, while σM,Q : q ∈ Q → 1q1
maps the set Q into M [Q] as words of degree 1. The map determined by third
criterion of the universal property is explicitly given by
where m0 , m1 , . . . , mn ∈ M and q1 , . . . , qn ∈ Q.
The following isomorphisms are a direct consequence of the universal prop-
erty:
M [Q] [Q0 ] ∼
= M [Q ∪ Q0 ] (Q ∩ Q0 = ∅) , M∼
= M [∅] , 1 [Q] ∼
= Q∗ (5)
which one can verify are inverses. Other consequences of the universal property
include ∅∗ ∼
= 1 [∅] ∼
= 1 and
∗
(X ∗ ) [Q] ∼ = 1 [X ∪ Q] ∼
= 1 [X] [Q] ∼ = (X ∪ Q) (X ∩ Q = ∅). (6)
6
and α0 → β 0 then αα0 → ββ 0 , and T: if α → β and β → γ then α → γ. Other
consequences include H: if (α, β) ∈ H then α → β and HL : if (α, β) ∈ H and
γβδ → ε then γαδ → ε. In addition, one may verify that C, T and H also follow
from R and HL , so that one can equivalently define derivations inductively by
repeated applications of HL to R.
Corresponding to each α ∈ M [Q] is the subset [α] ≡ {m ∈ M : α → m} of
elements of M derivable from the configuration α. Generalizing the grammar
expression notation to grammars over monoids, this may be written8
[α] = (α1 → β1 , . . . , αn → βn , α)
where H = {(α1 , β1 ) , . . . , (αn , βn )}. Where clarity requires it, we write [α]G or
[α]H in place of [α] and α →G β or α →H β in place of α → β. By virtue of
C, we also have the inclusion [α] [β] ⊆ [αβ], and from R and T it follows that
[α] ⊇ [β], whenever α → β. Finally, the language generated by the grammar is
L (G) = [S] ⊆ M .
An important property, that we will need in the following, shows the invari-
ance of a grammar with respect to renaming of the variables in Q.
Lemma 2.1 (Substitution Invariance). Let G = (Q, S, H) be a grammar over
a monoid M , σ : Q → Q0 a bijection and
8 Strictly speaking, this expression is ambiguous – one needs to explicitly state which free
7
Proof. We have, immediately, that [α]Ĝ = [α]G for any α ∈ M [Q], since only
rules from H can be used in any derivationh fromi α. In addition, since the only
rule involving Ŝ is Ŝ → S, it follows that Ŝ = [S]Ĝ = [S]G , from which we
Ĝ
obtain the result.
As in the classical theory, derivations may be refined to a form that incor-
porates a “cursor”. As the following result shows, this applies here as well.
Theorem 2.3. Let G = (Q, S, H) be a grammar over a monoid M containing
a generating subset X. Then α →H β if and only if ·α →0H ·β, where →0H is
the closure under C, R and T of the following one-step derivations: (Shift Left)
·z →0H z· and (Shift Right) z· →0H ·z for z ∈ X ∪ Q, and (Generate) ·α →0H ·β
for (α, β) ∈ H.
Proof. One direction is immediate: if ·α →0H ·β then α →H β. For the converse,
we argue inductively. For R, the result is immediate. Therefore, assume α →H
β = γηε by HR , with α →H γδε and (δ, η) ∈ H. By inductive hypothesis
·α →0H ·γδε, by repetitions of Shift Left: ·γδε →0H γ · δε, by application of
Generate: γ · δε →0H γ · ηε, and by repetitions of Shift Right: γ · ηε →0H ·γηε.
Thus ·α →0H ·β.
8
of σX ; and (2) for all (α, β) ∈ H, m, m0 ∈ M and β̄ ∈ σ −1 (mβm0 ), there
exists ᾱ ∈ σ −1 (mαm0 ) such that ᾱ →H̄ β̄. Then [φ]H = [φ]H̄ for φ ∈ Q+ . In
particular, L (G) = L Ḡ .
Proof. Using (1), an easy inductive argument shows that σ (ᾱ) →H σ β̄ when-
ever ᾱ →H̄ β̄. From this, it follows that [ᾱ]H̄ ⊆ [σ (ᾱ)]H . From (2), we may
−1
show that: (3) if α →H σ β̄ then S there exists ᾱ ∈ σ (α) such that ᾱ →H̄ β̄.
From (3) it follows that [α]H = ᾱ∈σ−1 (α) [ᾱ]H̄ . From this, in turn, we obtain
our results.
The proof of (3) is also by induction. In the case R, we have α = σ β̄ ,
and we may take ᾱ = β̄ and use R to show that ᾱ →H̄ β̄. For the case HR ,
we have α →H γεδ, (ε, η) ∈ H and γηδ = β. Factor γ = γ 0 m and δ = m0 δ 0 ,
where m, m0 ∈ M , γ 0 ∈ {1} ∪ M [Q] Q and δ 0 ∈ {1} ∪ QM [Q]. Then, it follows
that β̄ = γ̄ η̄ δ̄, where σ (γ̄) = γ 0 , σ (η̄) = mηm0 and σ δ̄ = δ 0 . By (2), there
exists ε̄ ∈ σ −1 (mεm0 ) such that ε̄ →H̄ η̄. Since σ γ̄ ε̄δ̄ = γ 0 mεm0 δ 0 = γεδ,
then by inductive hypothesis, there exists ᾱ ∈ σ −1 (α), such that ᾱ →H̄ γ̄ ε̄δ̄.
Upon application of C, we get γ̄ ε̄δ̄ →H̄ γ̄ η̄ δ̄ = β̄ and upon application of T, we
have ᾱ →H̄ β̄, thus establishing the result.
This recovers, as a special case, the classical conversion to contextual form
of a grammar G = (Q, S, H) over M = X ∗ , whose rules (α, β) ∈ H are subject
to the restriction α 6= 1. We define X̄ = {x̄ : x ∈ X} and σX (x̄) = x for
∗ x ∈ X.
−1 ∗
Denoting the canonical extension of σX by σ̄ : (X ∪ Q) → X̄ ∪ Q , we set
H̄ = H̄0 ∪ H̄1 , where
(α1 → β1 , . . . , αn → βn , S → α, S → 1, S)
9
with a new start symbol S ∈ / M ∪ Q is added to Q.
Because of the explicit reference to length, the generalization of context-
sensitive grammars to monoids other than free monoids is not as straightfor-
ward. However, a generalization may be found if we require that the monoid
family M 7→ SM be well-behaved under non-erasing substitutions. In par-
ticular, if X ⊆ M − {1} is a generating subset of the monoid M then under
the canonical homomorphism σX : X ∗ → M , we should expect that SM =
{σ̃X (L) : L ∈ SX ∗ }.11 A grammar over M is non-contracting with respect to
X if its rules are of the form (σX,Q (α) , σX,Q (β)), where ln (α) 6 ln (β) in
∗ ∗
(X ∪ Q) and σX,Q : (X ∪ Q) → M [Q] is the canonical homomorphism of the
generating subset X ∪ Q → M [Q].
The requirement 1 ∈ / X is necessary to satisfy the length and the non-
erasing restrictions. In order to show that this produces a well-defined family,
we also need to ensure its independence with respect to the choice of a generating
subset X ⊆ M − {1}. That is, suppose Y ⊆ M − {1} is another generating
subset of M , with a canonical homomorphism σY : Y ∗ → M . Then we may
convert a grammar G = (Q, S, H) that is non-contracting with respect to X
to one Ḡ = Q̄, S, H̄ that is non-contracting with respect to Y by adding
new variables x̄ for each x ∈ X, replacing each symbol from X in the original
grammar with the corresponding variable, and then adding new rules x̄ → wx ,
where σY (wx ) = σX (x). That is, we define Q̄ = Q ∪ {x̄ : x ∈ X} and
q1 q2 . . . qm−1 qm → r1 r2 . . . rm−1 rm α
11 In here, and in the following, we will denote the image of a function f on a set A by
10
are broken down to the following rules
q1 q2 . . . qm−1 qm → Z1 q2 . . . qm−1 qm , Zm → rm α,
Zi qi+1 → Zi Zi+1 , Zi Zi+1 → ri Zi+1 (i = 1, . . . , m − 1) ,
with the introduction of the new symbols Z1 , . . . , Zm . This construction does
not require M to be a free monoid, so it can be applied generally. Thus, the
equivalence of non-contracting and context-sensitive grammars generalizes to
arbitrary monoids.
11
Going in the opposite direction, given a separable grammar G = (Q, S, H),
one may define the possibly infinite set
12
Theorem 2.8 (Separable grammars as fixed point systems). Let G = (Q, S, H)
be a separable grammar over a monoid M. Then (q = [q] : q ∈ Q) is the least so-
lution to the system ᾱ ⊇ β̄ : (α, β) ∈ H of fixed-point relations over the quan-
tale PM where we define m̄ = {m} for m ∈ M , αβ = ᾱβ̄, for α, β ∈ M [Q] and
q̄ = q, for q ∈ Q.
Proof. That ᾱ = [α] is a solution for α ∈ M [Q] follows immediately by defi-
nition of separability. For any other solution, an induction over the length of
derivations allows us to establish ᾱ ⊇ β̄, whenever α →H β. Therefore, for each
m ∈ [α]H , we have ᾱ ⊇ m̄ = {m}. Thus, ᾱ ⊇ [α].
suffice to embody all solutions to one-sided linear systems over the Kleene alge-
bra RM of rational subsets of the monoid M , that this family is the free Kleene
extension of M , and that every member is the least fixed point solution to a
finite one-sided linear system. Hence, RM is the family of all languages over
M recognized by one-sided linear grammars.
that commute with one another, LM,N (m) RM,N (n) = RM,N (n) LM,N (m) for
(m, n) ∈ M × N ; and (2) for any other monoid homomorphisms f : M → P
13
and g : N → P that commute with each other, there is a unique monoid
homomorphism hf, gi : (m, n) ∈ M × N 7→ (f (m) , g (n)) ∈ P such that
(M × N ) × P ∼
= M × (N × P ) ,
M ×1=M ∼∼ = 1 × M,
M ×N ∼
= N × M.
14
relation →, itself, is defined as the closure under C, R and T of the one-step
transitions. Finally, the subset generated by the transducer is
L (T ) = {(w, v) ∈ X ∗ × Y ∗ : Sw → vf, f ∈ F } .
It follows, by inductive argument, that each transition vq w̄ → v̄q 0 w can
be factored to vqw0 w → vv 0 q 0 w and then treated as the closure under C of
the transition qw0 → v 0 q 0 . The same information is contained in each of the
following
q →W (w0 , v 0 ) q 0 , q (w0 , v 0 ) →R q 0
where the write →W and read →R transitions each defined as relations over
(X ∗ × Y ∗ ) [Q]. These, in turn, may be generated for the corresponding one-
step transitions
HW = {(q, (w, v) q 0 ) : (q, w, v, q 0 ) ∈ H} ,
HR = {(q (w, v) , q 0 ) : (q, w, v, q 0 ) ∈ H}
where we add transitions f →α 1 for f ∈ F and α ∈ {W, R}. By inductive ar-
gument, we obtain the following correspondences (w, v) ∈ L (T ) iff S →W (w, v)
iff S (w, v) →R 1. In particular, G = (Q, S, HW ) is a right-linear grammar over
X ∗ × Y ∗ for which L (G) = L (T ). The other relation →R defines a transduc-
tion over (X ∗ × Y ∗ ) × 1, while →W can, itself, be viewed as a transduction over
1 × (X ∗ × Y ∗ ).
Going in the reverse direction, a right-linear grammar over X ∗ × Y ∗ can be
readily transformed into the form HW . First, we factor words (w, v) ∈ X ∗ × Y ∗
into products z0 . . . zk−1 of k > 0 words z0 , . . . , zk−1 ∈ (X ∪ {1}) × Y ∗ . Then
each rule of the form q → (w, v) q̄ (where q̄ ∈ Q ∪ {1}) is decomposed into a set
of rules qi → zi qi+1 for i = 0, . . . , k − 1, with q0 = q and qk = q̄, adding new
variables q0 , . . . , qk as needed. Thus, we have the following result:
Theorem 2.9. The finite transductions between alphabets X and Y consist of
the rational subsets R (X ∗ × Y ∗ ).
The equivalence between push-down transductions and simple syntax di-
rected translations (SSDTs) is well-established classically (e.g., [36, Theorems
7.4.1, 7.4.2, pp. 353–354]). Classically, a grammar for an SSDT over a monoid
X ∗ × Y ∗ ([36, section 7.3, p. 349]) is given by a structure G = (Q, X, Y, H, S)
∗
with S ∈ Q and configurations restricted to a finite subset H ⊆ Q × (Q ∪ X) ×
∗
(Q ∪ Y ) whose elements (q, α, β) ∈ H are further restricted by the condition
that the words α, β have the forms α = w0 q1 w1 . . . qn wn and β = v0 q1 v1 . . . qn vn ,
with q1 , . . . , qn ∈ Q, w0 w1 . . . wn ∈ X ∗ , v0 v1 . . . vn ∈ Y ∗ and n > 0. Configura-
tions (α, β) are subject to a similar restriction, with the starting configuration
being (S, S).
Thus, each such (q, α, β) ∈ H may be equivalently defined as a context-free
rule q → (w0 , v0 ) q1 (w1 , v1 ) . . . (wn , vn ) qn over the monoid X ∗ ×Y ∗ , with a sim-
ilar conversion applied to each configuration (α, β). With this correspondence,
each SSDT grammar is described equivalently as a context-free grammar over
the product monoid, and vice versa. Therefore, we arrive at the following result:
15
Theorem 2.10. The push-down transductions between alphabets X and Y are
given by the family C (X ∗ × Y ∗ ) of context-free subsets of the product monoid.
12 Generally, one distinguishes between quantales with or without the multiplicative unit 1.
Our focus, here, shall reside largely with the latter variety, the unital quantales, which we
shall, for brevity, refer to as just quantales.
13 A consequence is that the dioid operations (a, b) 7→ ab and (a, b) 7→ a + b are both
16
P ordered monoid in which every finite subset U ⊆ D has a
to that of a partially
least upper bound U ∈ D with
P
{u1 , . . . , un } = 0 + u1 + . . . + un (n > 0),
which is assumed to be finitely distributive with respect to the product. The zero
and distributivity properties are then equivalently characterized by equation 9
restricted to U, U 0 ∈ FD, which shows that the sum operator is a monoid
homomorphism from FD to D. In addition, because associativity 10 holds for
finite families Y ∈ FFD, the sum operator is also a dioid homomorphism.
A shift in the point of view away from semirings thus occurs when we regard
the ordering relation as the primitive operation, rather than the semiring addi-
tion, and it is more closely aligned to how formal languages were regarded prior
to the advent of the power series formalism. The partial ordering generalizes the
phenomena of reducibility, derivability, transformation, etc. The addition oper-
ator generalizes the phenomenon of non-deterministic branching, the additive
identity generalizes the notion of failure . The resulting shift in viewpoint places
primacy on partially ordered algebras for languages where (a) concatenation and
the empty word are captured by the underlying monoid structure, and (b) the
non-deterministic elements (derivability, branching, failure) are captured by the
ordering relation and least upper bound.
What the quantale and dioid both have in common is that the sum operation
and unit ηM : m ∈ M → {m} ⊆ M produce left-adjoints which inject the
monoid into the dioid FM and quantale PM . Each family of subsets may also
be thought of as a language family, with FM generalizing the classical concept
of finite languages, and PM the general languages .
17
property n>0 AB n C = AB ∗ C. As shown in [20], a *-continuous Kleene alge-
P
bra D is equivalently defined as a partially ordered monoid satisfying distribu-
tivity 9 for rational subsets U, U 0 ∈ RD. The Kleene algebra homomorphisms
are described equivalently as maps that preserve the Kleene operators, or as
monoid homomorphisms that preserve least upper bounds for rational subsets.
Moreover, since RD is closed under rational least upper bounds, associativity
10 follows for Y ∈ RRD.
Thus, just as the quantale is associated with the classical family of general
languages, and the dioid with the family of finite languages, the *-continuous
Kleene algebra is associated with the classical family of regular languages, i.e.,
the languages corresponding to type 3 grammars in the Chomsky hierarchy.
14 In [16], the names for the two forms of distributivity were inadvertently swapped.
18
What we have done is complete the construction of what is known as a T-
Algebra [26] or an Eilenberg-Moore Algebra. The category DA is referred to
as an Eilenberg-Moore category.15 The functor A can therefore be regarded as
a map between the categories Monoid and DA. Since the algebras in DA
contain the structure of monoids, then what we actually have is an adjunction
with a forgetful functor  : DA → Monoid that reduces each A-dioid D to
its underlying monoid ÂD = D and each A-morphism F : D → D0 to its
underlying monoid homomorphism ÂF = F : ÂD → ÂD0 . The adjunction
relation is established by the following theorem.
Theorem 3.2. The functor A : Monoid → DA and the forgetful functor
 : DA → Monoid form an adjunction pair A,  .
This results in
a hierarchy
of monads. For each natural family A there is an
adjunction pair A, Â that extends the category of monoids to the category of
A-dioids. The unit of the adjunction is the polymorphic function (i.e., natural
transformation) η : IMonoid → Â ◦ A with ηM (m) = {m} ∈ AM for m ∈ M ,
2
which is given by A1 . The monad product µ : Â ◦ A → Â ◦ A is the union
S
µM (Y) = Y ∈ AM for Y ∈ AAM , which is given by A2 . Closely P related to
the product is the co-unit ε : A ◦ Â → IDA given by εD (U ) = U ∈ D for
19
2
U ∈ AD. Finally, related to the unit is the co-product δ : A ◦ Â → A ◦ Â ,
defined by δD (U ) = {{u} : u ∈ D} ∈ AAD for U ∈ AD.
Elementary consequences of this construction, which are generally true for
T-algebras, are the following. Detailed proofs may be found in [16, theorems 1,
2, 3, 4].
Theorem 3.3. Let M 7→ AM be a natural family. Then
• AM is an A-dioid for any monoid M .
P
• ( ) : AD → D is an A-morphism for any A-dioid D.
• Every monoid homomorphism f : M → N lifts to an A-morphism f˜ :
AM → AN .
20
ordering under natural families. Then, we may write A (∧Z) M ⊆ AAM . Thus,
for any family of subsets Y ∈ (∧Z) (∧Z) M , we have that
\
Y∈ A (∧Z) M ⊆ A (∧Z) M ⊆ AAM.
A∈Z
S
Thus,
S T A3 , Y ∈ AM . Since A ∈ Z was arbitrarily chosen, this shows that
by
Y ∈ A∈Z AM = (∧Z) M . Thus ∧Z satisfies property A3 .
The lattice ordering relation is a restriction of the following to natural fami-
lies, while finite meets are directly expressible in terms of intersections as follows:
3.4. A-Topology
As preconditions to both forms of A-distributivity and to A-continuity, we
required A-additivity. However, the properties can be generalized to partially
ordered monoids and made independent of additivity, with the following defini-
tion.
21
We can then state the following results:
Theorem 3.9. Let M, M 0 be A-directed partially ordered monoids. Then f :
M → M 0 is A-continuous if and only if f˜ : AM → AM 0 is continuous. In
addition, M is weakly A-separable if and only if for each a, b ∈ M , the function
U ∈ AM 7→ aU b ∈ AM is continuous; and M is A-separable if and only if the
product U, V ∈ AM 7→ U V ∈ AM is continuous.
Proof. Both directions of each of the three correspondences rely on the equiv-
alence x > U ⇔ U ∈ Ax M . This is illustrated for A-continuity, the other
correspondences being similar.16
First, suppose f : M → M 0 is A-continuous and O ⊆ AM 0 is an open set.
Let U ∈ f˜−1 (O); i.e., f˜ (U ) ∈ O. Then, there is a neighborhood Ay M 0 ⊆ O
containing f˜ (U ); or, equivalently, y > f˜ (U ). By A-continuity, we have y >
˜
f (u), for some u > U . Since f is monotonic, then f˜ (Au M ) ⊆ Ay M 0 , while
U ∈ Au M . Thus, f˜ (O) is open.
−1
3.5. Examples
Example 3.10. From our prior discussion on generalized grammars, we have
the Chomsky hierarchy, which consists of the following families RM , CM , SM
and T M ordered by R 6 C 6 S 6 T . In the following, we will show that each
is a natural family, except S.
for each regular transfinite cardinal k and transfinite cardinal c. The closure of
each of these families under products, unions and monoid homomorphisms are
easy consequences of set theory17 , thus proving the naturality of each family.
As special cases, we have the natural families F = Fℵ0 and ω = Pℵ0 of finite
and countable subsets, respectively.
22
The largest such family is P0 . For the other natural families, we have A0 6
A ∧ P0 in the lattice ordering of natural families, with equality if A satisfies the
strong version of submonoid ordering.18
18 See the discussion following theorem 3.4. The proof of A3 is analogous to that in theorem
3.5.
23
by 2 [Q] ∼
= A [Q∗ ], where 2 = P1 = {∅, {0}} is the 2-element dioid. Similarly,
the following isomorphisms analogous to equation 6 holds
∗
(AX ∗ ) [Q] ∼
= 2 [X] [Q] ∼
= 2 [X ∪ Q] ∼
= A (X ∪ Q) (X ∩ Q = ∅). (13)
Finally, the relation to the monoid free extension is established by the following
theorem.
Theorem 4.1. A (M [Q]) ∼
= (AM ) [Q].
Proof. Explicitly, the isomorphism is given explicitly in terms of the categorical
algebra by the following:
∗
(ιAM,Q )∗ , σAM,Q : A (M [Q]) → (AM ) [Q] ,
AιM,Q , ηM [Q] ◦ σM,Q : (AM ) [Q] → A (M [Q])
which one may verify are inverses. Based on these considerations, may define
the substitution expression .
24
Theorem 4.4. A substitution σ : M → PM 0 determines and is uniquely deter-
mined by a quantale homomorphism φ : PM → PM 0 such that φ ({m}) = σ (m)
for m ∈ M .
Proof. In the forward direction, for Y ∈ PPM , we have
[ [ [ [ [
σ∗ Y = σ (m) = σ (m) = σ ∗ (U ).
U ∈Y m∈U U ∈Y
S
m∈ Y
25
Proof. The property of surjectivity may be stated solely in terms of the proper-
ties of homomorphisms in the following way: given homomorphisms g, h : N →
P to another monoid P , if g ◦ f = h ◦ f then g = h. Surjectivity for the f˜ is
proven analogously.
Therefore, assume G, H : AN → D are A-morphisms, such that G ◦ f˜ =
H ◦ f˜. Then, making use of the categorical algebra associated with adjunctions,
we have
G∗ ◦ f = (G ◦ Af )∗ = (H ◦ Af )∗ = H∗ ◦ f → G∗ = H∗ → G = H,
the first inference following by the surjectivity of f , the second following since
∗ ∗
G = (G∗ ) and H = (H∗ ) . This conclusion can also be regarded as an appli-
cation of the universal property (c.f. [16, theorem 9]).
As a consequence, we find that natural families respect inverse morphisms
in the following sense:
Theorem 4.7. Let A be a natural family. Then if f : M → N is a surjective
monoid homomorphism, and V ∈ AN then V = f˜ (U ) for some U ∈ AM .
Moreover, there is a monoid N̂ , a surjective map σ : N̂ → N , and a factoring
σ = f◦ φ into φ : N̂ → M and f ; such
that each V ∈ AN may be expressed as
σ V̂ for some V̂ ∈ AN̂ where φ V̂ ∈ AM .
Proof. The first statement follows directly from A6 . For the second part, let
Y ⊆ N be any generating subset of the monoid N . The universal property for
free monoids then associates a canonical monoid homomorphism σ : N̂ = Y ∗ →
N with the inclusion σ : Y → N . This maps the free monoid Y ∗ generated by
the set Y onto the closure of that set within N , which (by assumption) is just
N , itself.
Let V ∈ AN
. Since σ : N̂ → N is surjective then there exists V̂ ∈ AN̂ such
that V = σ V̂ . To define φ, for each y ∈ Y , we need to choose an element
m ∈ M such that f (m) = σ (y), and then define φ (y) = m. The remainder of
the theorem then follows by property A4 .
19 This property was adopted by [12, p. 356, following lemma 2.5] as a condition for context-
free subsets of arbitrary free monoids. Though it was also mentioned in [16], it was not
discussed in any detail there.
26
Theorem 4.8. F, R, C, S, T each satisfy A7 .
Proof. Let M be a monoid. For U ∈ FM , we take X = U . Then U ∈ F hXiM .
For the other cases, suppose Y is a generating subset of M . Then U is given by a
grammar expression U = (α0 → α1 , . . . , α2n−2 → α2n−1 , α2n ) of the appropriate
type over hY iM = M . Then, we may write the component words in the form
αi = zi0 zi1 . . . zini , where 0 6 i 6 2n, ni > 0 and zij ∈ Y ∪ Q for 0 6 j 6 ni .
Then
X = Y ∩ {zij : 0 6 i 6 2n, 0 6 j 6 ni }
gives us a suitable choice for the finite set X. Since the rules α2i → α2i+1 and
starting configuration α2n are all over hXiM [Q] ⊆ hY iM [Q] = M [Q], it follows
that the grammar expression yields a subset U ⊆ hXiM of the appropriate
type.
27
Other examples may be constructed from the syntactic monoids X ∗ /L ≡
{w/L : w ∈ X ∗ } associated with regular languages L ⊆ RX ∗ , where
For each natural family A, A (M/L) is a finite A-dioid, since M/L is finite.
More generally, each finite dioid D may be associated with a partition of
X ∗ , where X = D − {0, 1} is taken as a generating subset of D and σ : X ∗ → D
as the canonical monoid homomorphism to D. A finite state automaton A with
start state 1 ∈ D, final state F ∈ / D, and transitionsPd → dx on x ∈ X and
d → F on dˆ for d ∈ D yields a partition L(A) = ˆ
d∈D Ld d into mutually
∗ −1 ∗
disjoint subsets L0 , L1 ⊆ RX , and Lx = σ (x) ⊆ RX for x ∈ X.
For instance, associated with the direct sum 2 ⊕ 2 is the partition L1 = 1,
Lx = xx∗ and Ly = yy ∗ . Associated with the dioid given by 0 < x < y < 1,
y 2 = x and y 3 = 0 is the partition Lx = x + yy, Ly = y and L1 = 1.
28
where Y ∈ AA ÂD and Y0 ∈ AA ÂD0 . The factor morphisms may then
be represented by ÂLD,D0 = ηÂD×ÂD0 ◦ LÂD,ÂD0 and ÂRD,D0 = ηÂD×ÂD0 ◦
D E∗
RÂD,ÂD0 , while the morphism hF, Gi = ÂF, ÂG preserves the relations
15 and is therefore well-defined as a function on D ⊗A D0 , thus giving us a
realization of the universal property.
Again,
we recover the naive relations 14
0
through the co-product δ : A ÂD × ÂD , by associating each U ∈ AD and
U 0 ∈ AD0 respectively with δ Ū and δ Ū 0 , where Ū = {(u, 1) : u ∈ U } and
(D ⊗A D0 ) ⊗A D00 ∼
= D ⊗A (D0 ⊗A D00 ) ,
D ⊗A 2 ∼=D∼ = 2 ⊗A D,
D ⊗A D0 ∼
= D0 ⊗A D.
29
is,
†we need the property,
A8 : under an involution m ∈ M 7→ m† ∈ M , U † ≡
u ∈ M : u ∈ U ∈ AM for each U ∈ AM , thus yielding an involution on AM .
An equivalent statement of A8 is that for anti-homomorphisms f : M → M 0 ,
if U ∈ AM , then f˜ (U ) ∈ AM 0 . For, let X ⊆ M be a generating subset of M
and σ : X ∗ → M the canonical surjection onto M . Then we may define the
homomorphism fσ : w ∈ X ∗ 7→ f σ w† ∈ M 0 , where w ∈ X ∗ 7→ w† ∈ X ∗ is
∗
the reversaloperation.
Given U ∈ AM , by surjectivity, we can find a Û ∈ AX
such that σ̃ Û = U . By A8 , Û ∈ AX . Therefore, by A3 , f˜ (U ) = ff
† ∗
σ Û
†
∈
AM 0 .
Example 4.12 (Free extensions & tensor products). We can apply the
constructions used for free extensions and direct products of monoids to anti-
homomorphisms. Thus, if f : M → P and g : N → P are monoid anti-
homomorphisms and σ : Q → P a map, then we can define hf, σi : M [Q] →
P and hf, gi : M × N → P in the obvious way, by hf, σi (mq . . . q 0 m0 ) =
f (m0 ) σ (q 0 ) . . . σ (q) f (m) and hf, gi (m, n) = f (m) g (n). The free extension
constructor satisfies equations 1 and 2, while the direct product constructor
satisfies equations 7 and 8.
For this to be extended to A-morphisms requires A to satisfy A8 closure.
Assuming this is the case, then given A-involutions iD : d ∈ D 7→ d† ∈ D
0 0 0† 0 0
iD0 : d ∈ D 7→ d ∈ D on A-dioids D and D , the monoid involution on
and
†
ÂD [Q] may be extended to an A-involution iD[Q] on D [Q] by (U q . . . q 0 U 0 ) =
U 0† q 0 . . . qU † , where U, . . . , U 0 ∈ AD, and the monoid involution on ÂD × ÂD0
†
to an A-involution iD⊗A D0 on D ⊗A D0 by (U × U 0 ) = U † ×U 0† , where U ∈ AD
0 0
and U ∈ AD . They satisfy the properties
iD[Q] ◦ ιD,Q = ιD,Q ◦ iD , iD[Q] ◦ σD,Q = σD,Q ,
iD⊗A D0 ◦ LD,D0 = LD,D0 ◦ iD , iD⊗A D0 ◦ RD,D0 = RD,D0 ◦ iD0 .
More generally, given anti A-morphisms F : D → D00 and F 0 : D0 → D00 and
a map σ : Q → D00 , we may use the involutions to define hF, σi = iD[Q] ◦
hF ◦ iD , σi and hF, F 0 i = iD⊗A D0 ◦ hF ◦ iD , F 0 ◦ iD0 i. It follows, then, that
iD[Q] = hιD,Q ◦ iD , σD,Q i and iD⊗A D0 = iD ⊗A iD0 = hLD,D0 ◦ iD , RD,D0 ◦ iD0 i.
For cardinality-limited natural families, F or ω, for P, and more generally
for Fk , Pc , and for the finite generativity class P0 , involution closure A8 holds.
In addition, by the following theorem, we have involution closure for members
of the Chomsky hierarchy.
Theorem 4.13. R, C, S, T each satisfy A8 .
Proof. This follows by the following elementary argument. Let G = (Q, S, H) be
a grammar over a monoid M that has an involution m 7→ m† . Then,extending
the
†involution to M [Q], and defining the grammar G† = Q, S † , H † by H † =
α , β † : (α, β) ∈ H , it follows that α →G β iff α† →G† β † . Therefore,
† †
([α]G ) = α† G† and L G† = L (G) . Moreover, the type of grammar (regular,
30
4.8. A9 : Matrix Closure, Relations and Matrix Algebras
The relations over a set X form an involutive quantale P (X × X) ordered
by subset inclusion. The product R, R0 7→ R ◦ R0 is relational composition,
defined by (x, x0 ) ∈ R ◦ R0 iff (x, x00 ) ∈ R and (x00 , x0 ) ∈ R0 for some x00 ∈ X.
The identity is IX = {(x, x) : x ∈ X}. The involution R 7→ R† is the relational
transpose, defined by (x, x0 ) ∈ R† iff (x0 , x) ∈ R.
By A3 , the natural family A (X × X) is closed under A-sums and is therefore
an A-dioid. For finite ordinals20 n, A (n × n) = P (n × n), with a one-to-one
correspondence to 2n×n given by A ∈ 2n×n 7→ {(i, j) ∈ n × n : Aij = 1}. This
is the finite dioid of n × n binary matrices. More generally, let D be an A-dioid
and define the algebra Mn D ≡ 2n×n ⊗A D, denoting it Mn,A D if A needs to be
made explicit. Noting the isomorphism Mn 2 ∼ = 2n×n , we also write Mn = 2n×n .
The tensor product universal property for Mn D takes on the following form:
suppose D0 is an A-dioid containing a subset {zij : i, j ∈ n} such that21
P
zij zkl = δjk zil (i, j, k, l ∈ n) , zii = 1. (16)
i∈n
Then for each A-morphism F : D → D0 that commutes with the zij , there
0
P a unique A-morphism Mn F : Mn D → D such that Mn F (LMn ,D (R)) =
is
z
(i,j)∈R ij for R ∈ M n and M n F (R Mn ,D (d)) = F (d), for d ∈ D.
Since M0 and M1 are respectively 1 and 2 element dioids, the isomorphisms
M0 ∼ = 1 and M1 ∼ = 2 are immediate. Thus, it also follows that M0 D ∼ = 1
and M1 D ∼ = D. We can also establish M m ⊗ M ∼
n = M mn , and more generally
Mm (Mn D) ∼ = Mmn D by using the bijection (i, k) ∈ m × n 7→ ni + k ∈ mn
to establish P (m × m) × P (n × n) ∼ = P (mn × mn) as a monoid homomor-
phism. Since this correspondence is preserved by unions, this also gives us the
isomorphism Mm ⊗ Mn ∼ = Mmn .
Closely related to Mn D, the set Dn×n hasPthe structure of a partially ordered
monoid with the matrix product (AB)ik = j∈n Aij Bjk , the identity Iij = δij
and the ordering relation A > B iff Aij > Bij , for all i, j ∈ n. An involution
on D can be extended to an involution A ∈ Dn×n 7→ A† ∈ Dn×n , by defining
† †
A ij = Aji , for each i, j.
When least upper bounds are defined on the sets Uij ≡ {Aij : A ∈ U } for
n×n
each i, j, where PU ⊆ ADP , then P it follows by the definition of the ordering
relation that ( U )ij = Uij = A∈U Aij . At minimum, this makes Dn×n a
dioid.
Denoting the unit matrix for row i and column j by eij , and noting the
identity Uij ekl = eki U ejl , we have Uij ekl ∈ ADn×n . Summing over k = l ∈ n,
it also follows that Uij I ∈ ADn×n . However, to further conclude Uij ∈ AD
requires the matrix closure condition on A – A9 : if U ∈ ADn×n then Uij ∈ AD
for all i, j.
20 Note, we are identifying each ordinal with the set of the ordinals that precede it; thus,
31
In the absence of matrix closure, addition is subject to the limitations of
least upper bounds on D. However, we may define infinite P A-sums within Mn D
and use the dioid homomorphism φ : A ∈ Dn×n 7→ i,j∈n Aij (i, j) ∈ Mn D
to interpret infinite A-sums over Dn×n . If each of the Uij ∈ AD for U ∈
ADn×n , then the inverse map fulfills the universal property for Mn,A D and the
correspondence becomes an A-isomorphism Mn D ∼ n×n . Otherwise, we’re
P= D P
limited to only asserting the existence of the sum φ Uij ≡ φ̃ (Uij I) ∈ Mn D.
These considerations lead to a second form of the universal property for
Mn D. Suppose, again, there is a subset {zij } ⊆ D0 satisfying equation 16 and
suppose F : Dn×n → D0 is a dioid homomorphism satisfying F̃ (Uij I) ∈ D0
P
n×n
for all U ∈ AD there is aunique A-morphism F̄ : Mn D →
and alli, j. Then
P
D0 such that n×n
P P
F̃ φ̃ (U ) = i,j F̄ φ Uij zij for all U ∈ AD .
c×c ∼
The correspondence 2 = P (X × X) also applies to relations over infinite
sets X with cardinality c, since infinite addition is defined on 2c×c . Therefore,
we can define the A-dioid Mc D ≡ 2c×c ⊗A D. If A > Pc , where c is a transfinite
cardinal, then an A-dioid D has closure under infinite sums of cardinality c.
We can then define the matrix algebra Dc×c . Again, the same considerations
apply about the closure of sums over ADc×c . However, since infinitary addition
is defined on 2c×c , we still have the extension of Dc×c to the A-dioid Mc D ≡
2c×c ⊗A D.
32
be an A-dioid containing subsets {h0| , . . . , hn − 1|}, {|0i , . . . , |n − 1i} satisfying
the equations22
P
hi| |ji = δij (i, j ∈ n) , |ii hi| = 1. (19)
i∈n
Then any A-morphism f : D → D0 that commutes with the hi| and |ji ex-
tends uniquely extends to an A-morphism fn : Cn,A ⊗A D → D0 , such that
fn (LCn ,D (pi )) = hi|, fn (LCn ,D (qj )) = |ji and fn (RCn ,D (d)) = f (d).
For countably-additive and countably-distributive dioids D, a matrix repre-
sentation of Cn,A ⊗A D in 2ω×ω , can be given by
P P P
hi| = ea(na+i) , |ji = e(nb+j)b , d ∈ D 7→ dI = deaa , (20)
a∈ω b∈ω a∈ω
22 The appearance of the bra hi| and ket |ji, also satisfying these identities, and commonly
seen with Hilbert spaces for quantum theory, should not be taken as an analogy drawn with
quantum theory, but with linear Hilbert space representations. The synonymous identification
“Hilbert space” = “quantum theory” is a widespread misconception: classical systems also
have Hilbert space representations.
23 The analogy drawn here is this: though normally regarded as a vector in a Hilbert space
H, the bra can also be regarded as the “creation” operator in the many-body extension H∗
of H, with the ket playing the role of the annihilation operator. The many-body space H∗
(called the Maxwell-Boltzmann Fock space) is equivalently described as the space of all stack
configurations formed from 1-body states in H.
33
instance, the algebra of regular expressions in classical theory is transformed by
these means into algebras for context-free expressions and “Turing expressions”.
Theorem 4.14 (Chomsky-Schützenberger Theorem). Let D be an A-dioid,
with A > R. Then every U ∈ CD has a least upper bound in C2 ⊗ D.
for n > 0, where →n refers to n applications of Shift and Generate (see section
2.5). Applying *-continuity on the left and the definition of →L
H on the right,
it follows that ∗ X
h0| hα| X̂ + Ĥ = h0| hβ| m.
·α→L
H m·β
34
Then it follows by inductive argument that24
n X
(0] h0| (α] hβ| L + R + Ĥ = (0] h0| (γ] hδ|
α·β→n γ·δ
where →n now denotes n > 0 applications of Shift Left, Shift Right and Gen-
erate (see section 2.3). Then, again, applying *-continuity on the left and the
definition of →0H on the right, we get
∗ X
(0] h0| (α] hβ| L + R + Ĥ = (0] h0| (γ] hδ|
α·β→0H γ·δ
∗
Application on the right by X̂ ∗ [0) |0i filters out δ ∈
/ {hx| : x ∈ X} and all γ 6= 1.
Therefore, noting that ·α →0H ·β iff α →H β, it follows that
∗ X
(0] h0| (α] L + R + Ĥ X̂ ∗ [0) |0i = m = [α]H .
α→H ·m
P
Setting, α = S, it follows that Û = U.
These two results capture, in algebraic form, the classical result due origi-
nally to and named after Chomsky and Schützenberger [5, 6]. A self-contained
proof was published in ([22], Supplementary Lecture G, 197-199). A similar
result, in the context of power series algebras, is Theorem 4.5 in [32]. In [6], one
sees reference to a traditional form of grammatical analysis in which substruc-
tures are explicitly marked, e.g.
[S [NP the dog ]NP [VP ate [NP the homework ]NP ]VP ]S
where a noun phrase (NP), verb phrase (VP) and sentence (S) are marked
within labeled brackets. The classical theorem is established with a different
annotation convention, still, in which the terminals are also mapped to brackets.
In contrast, our choice of Chomsky-Schützenberger kernel corresponds to the
following annotation
[S ]S [VP [NP ]NP the dog ]VP [NP ate ]NP the homework
where all the opening brackets for a phrase are moved up front in reverse order,
and the closing brackets are moved to the head of the phrase – which is the
order characteristic for top-down parsers. To better show this, the parse may
itself be parsed
[S (]S [VP [NP ) (]NP the dog ) (]VP [NP ate ) (]NP the homework )
As the following example shows, other annotations, corresponding to other
parsing or analysis methods can be used as the basis for deriving Chomsky-
Schützenberger kernels.
24 This is where we require the grammar to be contextual. Otherwise, L and R may give us
35
Example 4.16. The archetypical context-free language is the Dyck language
Dn , which consists of the properly nested bracket sequences formed from n > 0
different types of brackets. Our particular interest is in its interleaves with other
sets. Let M be a monoid containing a finite subset Y ⊆ M and the (i , )i for all
i ∈ n. The interleaves of Dn and hY iM form a subset Dn (Y ) = L (G0 ) ⊆ M
given by the context free grammar G0 containing the start symbol N and rules
N → (i N )i N for i ∈ n, N → yN for y ∈ Y and N → 1.
Lemma 4.17. Using the notation of example 4.16, let D0 be an A-dioid with
A > R. Suppose Y ⊆ D0 is a finite subset and (i , )i ∈ D0 for all i ∈ n. Then
Dn (Y ) has a least upper bound in Cn ⊗A D0 given by
∗
X X X X
Dn (Y ) = h0| (i hi| + |ji)j + y |0i .
i∈n j∈n y∈Y
Proof. Let H denote the set of phrase structure rules of G0 . Left most deriva-
tions ·N →L H β · γ may only use the Shift and Generate rules in the following
combinations ·N →L L L
H ·(i N )i N →H (i ·N )i N for i ∈ n and ·N →H ·yN →H y · N
L
where n > 0 and →n denotes the number of applications of the revised one-step
rules. Thus,
∗
X X X X X
h0| (i hi| + |ji)j + y |0i = m= L (G0 ).
i∈n j∈n y∈Y ·N →D m·N
36
Proof. Adopting the notation of theorems 4.14 and 4.15, P let U = L (G) be given
0
by a contextual grammar, as before, and define n = L (G ) ∈ C2 ⊗ D̄, where
L (G0 ) ∈ C C2 ⊗ D̄ is given by a grammar G0 with start symbol N and rules
Thus,
∗ X
h0| hβ| nX̂ ∗ |0i = (0] h0| hβ| L + R + Ĥ X̂ ∗ |0i [0) = [β]H ,
In the following section, we will establish the existence of the closures D̄ and
¯ , with a general construction that freely extends an A-dioid D to its B-closure
D̄
QB C ¯
A D for B > A. For A = R, the respective closures are D̄ = QR D and D̄ =
¯
QTR D, and it will indeed be the case that D̄ = QTC D̄ and that QTR = QTC ◦ QCR .
5. A Network of Adjunctions
37
answers that was uncovered, but an algebraic analogue of the classical notion
of language hierarchy.
It is a hierarchy linked by a network of adjunctions. Through a construction
by ideals [7, 19], a series of adjunctions was established in which each of the
families in the hierarchy R < ω < P was completed to the families higher in the
hierarchy. Here, we will generalize these results, devising a general construction
for adjunctions between any two categories QB A : DA → DB, where A 6 B.
25 aU 0 b ⊆ (aU b)0 and f˜ (U 0 ) ⊆ f˜ (U )0 are established in [17] in the proofs of Corollary 1 and
Lemma 6 respectively.
38
well-definedness of these operations is a consequence of the identities [17, lemmas
2, 4, 6]:
D E D E
f˜ (U ) = f˜ (hU iA )
S P
hU V iA = hhU iA hV iA iA , h YiA = hU iA ,
U ∈Y A A
0
for U, V ∈ PM , Y ∈ PPM and A-continuous morphisms f : M → M P . It also
follows that with respect to the subset ordering on A [M ], the sum Y is the
least upper bound of Y ⊆ A [M ] in A [M ].
Together, this is enough to define a functor QA : DA → DP which maps
A-dioids D to A [D] and A-morphisms f : D → D0 to fA : A [D] → A [D0 ].
By virtue of the one-to-one embedding d ∈ D 7→ hdi ∈ A [D], the functor is
the right-adjoint of the forgetful functor QA : DP → DA. However, instead
of establishing these properties directly, we can generalize the construction to
yield a network of functors.
26 Since
P˜
f is only an A-morphism, one needs to show Pthat fP
(U ) is actually defined. This
˜ f˜ hU iA .
is done in [17, lemma 7], where it is also shown that f (U ) =
39
summation is needed because our construction by ideals replaces individual
elements by intervals.
Finally, the adjunctions defined here involve left-adjoints of forgetful func-
tors. However, since the forgetful functors close under composition, and the
composition of adjunctions is also an adjunction, then from the uniqueness of
left adjoints [26, corollary 1, p. 83], the following two theorems result (c.f. [17,
corollary 7]).
Theorem 5.4. Let A, D, B be natural families with A 6 D 6 B. Then
QA D A B D B
D ◦ QB = QB and QD ◦ QA = QA .
B = QB A
A ◦ A and B̂ = Â ◦ QB .
40
In addition, when A 6 B, then for free extensions we have an isomorphism
QB ∼ B
A (D [Q]) = QA D [Q], where D is an A-dioid. This is implemented by the
following two mutually inverse morphisms
D E∗
ιQBA D,Q , h ◦ σQBA D,Q : QB B
A (D [Q]) → QA D [Q] ,
∗
B
QA ιD,Q , k −1 ◦ η ◦ σD,Q : QB B
A D [Q] → QA (D [Q]) ,
where
h : QB A
QB k : QB A B
A D [Q] → QB A D [Q] , A (D [Q]) → QB QA (D [Q])
and for U, V ⊆ M ,
[ [ [
σ ∗ (U V ) = σ (uv) = σ (u) σ (v) = σ ∗ (U ) σ ∗ (V ) .
u∈U,v∈V u∈U v∈V
∗
From this, it follows that σ preserves Kleene stars,
∗
[ [ [ n
σ ∗ (U ∗ ) = σ ∗ U n = σ ∗ (U n ) = σ ∗ (U ) = σ ∗ (U ) .
n>0 n>0 n>0
41
Consequently, if we let U, V ∈ RM and assume by inductive hypothesis that
σ ∗ (U ) , σ ∗ (V ) ∈ RN , then it follows that
σ ∗ (U V ) = σ ∗ (U ) σ ∗ (V ) ∈ RN,
σ (U ∪ V ) = σ ∗ (U ) ∪ σ ∗ (V ) ∈ RN,
∗
∗
σ ∗ (U ∗ ) = σ ∗ (U ) ∈ RN
S → SS,
S→ A → e, A → f Af,
AgA S B → BBh, B → i, BB ,
S → C → Cj, C → k, CC ,
S D → lD, D → m, DnD S,
42
the embedded rules to the head of the overall grammar expression
A → e, A → f Af, B → BBh, B → i,
C → Cj, C → k, D → lD, D → m,
S → SS, S → (AgA) S (BB) , S → (CC) , S (DnD) S.
More generally, we need to also resolve the clashes in the names of bound
variables of two or more subexpressions with each other or with the main ex-
pression27 – hence, the need for the technical lemma, Substitution Invariance
(lemma 2.1). For technical reasons, we also replace composite starting configu-
rations by fresh variables, making use of Start Variable Normalization (lemma
2.2). Modulo the technical adjustments, the composition lemma may then be
stated with the assumption that the main grammar expression and each of the
grammar sub-expressions involved in substitutions make use of mutually dis-
joint sets of variables, and that each expression has been suitably normalized
with respect to their start variables.
For the following lemma, let M be a monoid G = (Q, S, H) be a context-
free grammar over a submonoid hXiM generated by a finite subset X ⊆ M .
Let σ : M → CN be a context-free substitution to the monoid N . For each
x ∈ X, let Gx = (Qx , Sx , Hx ) be a context-free grammar over N such that
L (Gx ) = σ (x); with the sets Q and Qx for each x ∈ X all mutually disjoint.
In addition, it is assumed that each component grammar Gx has been placed
in a form in which Sx ∈ Qx is a single variable that appears nowhere on the
right-hand side of any rule in Hx and in only one rule on the left. We also
require S ∈ Q to be a single variable, and that the production in Gx involving
Sx has at least one variable on the right-hand side (if necessary, by applying the
start variable normalization a second time).
Lemma 6.4 (The Composition Lemma). Define the composition of the gram-
mars by the following grammar over N
!
[ [
G0 = Q ∪ Qx , S, H̄ ∪ Hx ,
x∈X x∈X
∗
where the homomorphism σ̄ : (Q ∪ {Sx : x ∈ S}) → M [Q] is given by σ̄ (Sx ) =
x for x ∈ X and σ̄ (q) = q for q ∈ Q; and where
∗
H̄ ⊆ Q × (Q ∪ {Sx : x ∈ S})
27 In particular, notice that we’re not substituting bound variables into the grammar expres-
sion. With the convention we’re restricting ourselves to here, the scope of the non-terminals
in a grammar expression is local.
43
Proof. It is an easy induction to show, for each x ∈ X, that α →Gx β iff
α →G0 β, where α, β ∈ N [Qx ]. This uses of the mutual disjointness of the sets
Qx . The only rules that can apply here are therefore those from Hx . From this,
it follows that
[Sx ]G0 = [Sx ]Gx = L (Gx ) = σ (x) (x ∈ X).
Moreover, by induction, making use of the context-freeness of G0 , [α]G0 [β]G0 =
∗
[αβ]G0 , for α, β ∈ (Q ∪ {Sx : x ∈ S}) , we have [w̄]G0 = σ (σ̄ (w̄)), for w̄ ∈
∗
{Sx : x ∈ S} .
In a similar way, one may verify that σ̄ (α) →G σ̄ (β) ⇔ α →G0 β for
∗
α, β ∈ (Q ∪ {Sx : x ∈ S}) . This is where we require the assumptions made
about Sx in the grammar Gx . Making use of the disjointness of the set Q from
all the other sets Qx , it then follows that
[ [ [
[q]G0 = [w̄]G0 = σ (σ̄ (w̄)) = σ (w) = σ ∗ ([q]G )
σ̄(w̄)∈[q]G σ̄(w̄)∈[q]G w∈[q]G
6.3. C
With these preliminaries established, we then have the following corollary.
Corollary 6.5. C is natural family.
Proof. The Composition Lemma shows that C satisfies A5 . Property A0 is true
for all languages generated by general grammars, and A1 follows easily: a finite
subset U ∈ FM of a monoid has a regular grammar ({S} , S, {S} × U ).
The proof of A2 closely follows that in the classical theory. Given subsets
L (G1 ) , L (G2 ) ⊆ M generated by context-free grammars Gi = (Qi , Si , Hi ) over
M (i = 1, 2),
G = (Q1 ∪ Q2 ∪ {S} , S, H1 ∪ H2 ∪ {(S, S1 S2 )})
is a grammar for the product, provided that S ∈
/ Q1 ∪ Q2 ∪ M . We may then
use the property [αβ] = [α] [β] to show that
L (G) = [S1 S2 ]G = [S1 ]G [S2 ]G = [S1 ]G1 [S2 ]G2 = L (G1 ) L (G2 ) .
= q → β, . . . , q 0 → β 0 , q̄ → β̄, . . . , q̄ 0 → β̄ 0 , SS 0 .
It is assumed, here, that the sets {q, . . . , q 0 } and {q̄, . . . , q̄ 0 } are mutually disjoint.
44
Corollary 6.7. As a C-dioid, the push-down transductions between alphabets
X and Y , up to isomorphism, is CX ∗ ⊗C CY ∗ .
Proof. This follows from theorem 2.10, by application of theorem 4.10.
Corollary 6.8. As a *-continuous Kleene algebra, the push-down transductions
between alphabets X and Y is contained in the commutant of Cn,R in Cn,R ⊗R
RX ∗ ⊗R RY ∗ .
Proof. Using the Transduction Theorem (theorem 4.10) and the results of sec-
tion 5.4, the C-closure of RX ∗ ⊗R RY ∗ is
∗ ∼ ∗ ∼
QR C ∗ R C ∗ R ∗ ∗
C QR RX ⊗R RY = QC QR R (X × Y ) = QC C (X × Y )
6.4. S and T
Though the composition lemma and product construction are formulated
explicitly for C, they can be refined to make them applicable to S and T – with
one important proviso to be noted below.
First, the product construction works with general grammars. However, for
context-sensitive and non-contracting grammars, special consideration must be
paid to the cases where the erasing-rules α1 → 1 or α2 → 1 are present. In
the former case, we replace the rule with S → α2 , while in the latter case, we
replace it with S → α1 . If both erasing rules are present, then we must also
add S → 1 to the overall grammar.
Second, the homomorphism property A3 may be shown directly as follows.
Given a homomorphism f : M → N , we extend it to a homomorphism f :
M [Q] → N [Q] by defining f : q ∈ Q 7→ q ∈ N [Q]. Then, given a language
L (G) ⊆ M , each rule α → β of the grammar G is replaced by the rule f (α) →
f (β). This preserves the grammar type – unless it is a non-contracting or
context-sensitive grammar. A rule of the form αqβ → αγβ, where γ 6= 1 may
map to a rule of the form f (α) qf (β) → f (α) f (γ) f (β), where f (γ) = 1, thus
destroying context-sensitivity. A similar problem occurs with non-contracting
grammars.
Third, the substitution property applies to general grammars. However, to
avoid the need for the property [αβ] = [α] [β], which we used in the composition
lemma, the grammar Gx over the monoid N must be modified to a grammar
over a copy Nx of N (using Substitution Invariance to rename the non-terminals,
if need be). By finite generativity A7 , we may assume that N is generated by a
finite set Y ⊆ N , similarly Nx by Yx ⊆ Nx . We must then add rules nx → n to
map each copy nx ∈ Nx to its original n ∈ N . 28 Thus, we establish the result
Corollary 6.9. T is a natural family.
28 As in the proof of theorem 4.18, this is where we require that the grammars be contextual.
45
For S, in the composition lemma, we also need to prove that the grammar
G0 is context-sensitive. However, a similar problem may occur as happens with
homomorphisms. Erasing rules in the component grammars Gx cannot generally
be eliminated and the resulting grammar need not be context-sensitive at all.
Therefore, we only obtain the following.29
29 It was erroneously asserted in [17] that S also satisfied A . The proof breaks down for
3
erasing monoid homomorphisms.
30 In fact, by theorem 4.18, we can generate a type 0 language by erasing homomorphisms
46
f (z1 ) . . . f (zn ) is now modified to a form ẑ1 . . . ẑn that is no longer identically
equal to 1. The resulting rule is now non-contracting and context-sensitive.
Similarly, the argument used to prove the substitution property A5 may
still be applied in approximate form. The needed condition is that there be
a generating subset X ⊆ M , such that 1 ∈ / σ (x) for all x ∈ X. For such
substitutions, the language σ (x) = L (Gx ) ∈ SN no longer has any productions
of the form α → 1 in it. Therefore, we may proceed with the construction, as
before, and define the composition G0 of the grammar G, with the component
grammars Gx for σ (x), for each x ∈ X.
The condition inherited from this for the union property A4 is that corre-
sponding to the family Y ∈ SSM , there should be a finite subset S ⊆ SM of
languages, all free of erasing productions, such that Y ∈ SS ∗ .
We have shown how the classical notion of language hierarchy may be en-
capsulated and generalized in algebraic form as a hierarchy of algebras. At the
bottom of the hierarchy is the dioid, or idempotent semiring. Associated with
this is the functor F, which maps a given monoid M to its dioid of finite subsets.
Thus, the dioid may be regarded as an algebraization of the concept of the finite
language. At the top of the hierarchy is the unital quantale, which is associated
with the functor P that maps a monoid M to its quantale of subsets. Here, the
corresponding classical concept is the general language.
This hierarchy was complemented by a family of adjunctions with the prop-
erties that
• if A 6 B then there exists an adjunction QB A B A
A , QB with QA ◦ QB = IDB ;
• if A 6 D 6 B then QB D B A D A
D ◦ QA = QA and QD ◦ QB = QB ; and
• if A 6 B then QB A
A ◦ A = B and  ◦ QB = B̂.
47
of the new families is the “singleton family” I; its corresponding category being
the category of partially ordered monoids, itself. The related families of algebras
between I and F, comprise partially ordered monoids whose least upper bound
operator is reduced to a partial function over distinguished families of finite
subsets.
In the remaining sections, we discuss some of the issues that have only been
touched on briefly up to this point.
In general, we only have (A0M )S > A0 , which may not reduce to equality.
We can only show that (A0M )S S = A0 Se ∩ PS ⊇ A0 S. However, the identity
(AS )M = A may be verified as follows. For monoids M and monoid homomor-
phisms f : M → M 0 , we have (AS )M M = AMe ∩ PM and (AS )M f = f˜ = Af .
Since Me can be mapped homomorphically onto M , then surjectivity can be
used to show that AMe ∩ PM = AM .
48
in the formal power series approach [3, 9, 23], addition no longer need be idem-
potent. Therefore, a natural route of generalization is of the monad hierarchy
from dioids to semirings.
Unlike the case for dioids, the product, sum and morphism operators need
not be well-defined unless one makes restrictions on their domain, on the class
of monoids under consideration, or on the semiring, itself. Therefore, while
M 7→ PM yields a natural family, the analogue PS : M 7→ S M need not
be natural. The classification of natural families AS , for a given semiring S,
satisfying axioms A0S to A4S is left open here. Because of the absence of infinite
summability over S, there is no longer a clear-cut analogue to any portion of
the hierarchy of natural families AS , satisfying axioms A0S to A4S . Nor is it
clear whether the hierarchy even extends beyond the family FS of power series
with finite support. In particular, the question remains unresolved as to what
conditions are required to define analogues RS , CS , TS (and even SS ).
In [6], the power series was employed as a means to measure ambiguity. If
we were to attempt to generalize power series to arbitrary monoids, we would
immediately run into the problems just described, unless further restrictions
are made. One restriction, which is in the spirit of the approach adopted in
this paper, is to replace numerical coefficients by coefficients in a quantale,
such as the Boolean lattice of subsets. Then, we may factor the “ambiguity
count” function into the composition of two operations: (1) the output set for a
given input under the action of a transduction and (2) the cardinality function
applied to output sets. The ill-definedness of power series is factored out with
(2), leaving behind (1) – the well-defined notion of an idempotent power series .
In general, for a given semiring with unit S, we may define the following
partial (and not necessarily well-defined) operations over the function space S M :
for each m ∈ M , the unit is defined as ηM (m) = m̂, where m̂ : m0 ∈ M 7→ δmm0 .
For each s ∈ S, we also have s1̂ ∈ S M , whichP we may denote by s. Thus,
we can write out the decomposition φ = m∈M φ (m) m̂ which gives us the
M
representation of each φ ∈ S as a power series. For φ, φ0 ∈ S M , and Φ ∈ S S
M
we define,
49
power series operations all become well-defined and the analogue PS M = S M
to PM is defined.
The category DAS is then defined analogously by AS -additivity and AS -
distributivity:
(φφ0 ) = ( φ) ( φ0 )
P P P P
φ ∈ D,
respectively, where φ, φ0 ∈ ASP D. Equivalently in place of the latter, we may
adopt weak AS -distributivity ˆ dˆ0 ∈ d (P φ) d0 , where φ ∈ AS D and d, d0 ∈
dφ
D. Finally, an AS -morphism is defined by the condition that f˜ (φ) = f ( φ),
P P
where φ ∈ AS D.
Here, unlike the situation with semiring power series, we can go further and
develop analogues RS , CS , TS and even SS by applying our generalized grammar
formalism to the direct product monoid S × M , which is contained in S M by
the inclusion (s, m) ∈ S × M 7→ sm̂ ∈ S M . Which of the results established in
the previous sections carry over to this formalism is left as an unresolved issue.
50
Kleene star is inductively defined by the following decomposition
∗
E∗ E ∗ BD∗
A B
= , E = A + BD∗ C.
C D D∗ CE ∗ D + D∗ CE ∗ BD∗
The issue of proofs for A9 for C and T , however, has been left unresolved here.
Matrix closure can be derived from the stronger version of the submonoid
ordering property (section 3.3): if M, M 0 are monoids and M ⊆ M 0 then AM =
AM 0 ∩ PM . Then, from U ∈ ADn×n , we already have Uij I ∈ ADn×n . Since
DI = {dI : d ∈ D} ⊆ Dn×n is a submonoid, then under this stronger form
of submonoid ordering, we have Uij I ∈ A (DI). From DI ∼ = D, we conclude
Uij ∈ AD. The converse is posed as a conjecture.
Conjecture 7.1. If A satisfies matrix closure A9 then A satisfies the strong
submonoid ordering property.
U ◦ T ∈ A (M 00 × M 0 ) .
51
The inability to prove more comprehensive results regarding the nature of
transductions over general monoids is directly tied to the absence of any devel-
opment here for automata, analogous to the treatment of grammars in section
2. Without such a parallel treatment, the analogues of the classical theorems
relating automata classes to language and transduction families cannot be estab-
lished. One approach, already alluded to in section 2.8, is to define a transducer
over a product monoid M ×M 0 as a structure A = (Q, I, F, H) containing a set Q
of states, subsets I, F ⊆ Q, respectively, of initial and final states and a relation
H ⊆ Q × M × M 0 × Q for one-step transitions. The grammar GW = (Q, S, HW )
can be then used as a simple means for defining the language L (A) ≡ L (GW ).
The duality between the different “directionalities” of transducers, also al-
luded to in section 2.8, generalizes to give us an equivalence between transducers
over M1 × (M2 × M3 ) to transducers over (M1 × M2 ) × M3 , based on the fol-
lowing correspondence between their one-step transitions
H ⊆ (Q × X × B) × (Q × B ∗ ) ∪ (Q × X × {⊥}) × (Q × ⊥B ∗ )
52
The language is defined by L (M ) = {m ∈ X ∗ : ⊥sm → ⊥f, f ∈ F }.
When we rewrite the state set as Q × B ∗ , the corresponding automaton is
(Q × B ∗ , I × {1} , F × {1} , H 0 ) over the free monoid X ∗ . In H 0 , while the one-
step transition ⊥qx → ⊥βq 0 is replaced by (q, 1) x →H 0 (q 0 , β), each one-step
transition bqx → βq 0 must be replaced an entire set of relations: (q, β 00 b) x →H 0
(q 0 , β 00 β) for all β 00 ∈ B ∗ . The result is an automaton with the following sym-
metry condition: if β 6= 1, then (q, β) x →H 0 (q 0 , β 0 ) implies (q, β 00 β) x →H 0
(q 0 , β 00 β 0 ) for all β 00 ∈ B ∗ .
The conversion of F to F × {1} imposes the empty stack condition. If we
were to relax this condition, then we would replace F by F × B ∗ , instead. Then
a second symmetry condition would arise, stating that if (f, β) is a final state
then (f, β 0 ) is a final state, for all β 0 ∈ B ∗ .31
Acknowledgments.
The author would like to thank Dexter Kozen and Bernhard Möller for
their assistance, Bruce Litow for his enthusiastic support, Derick Wood for
inspiring research in the area of algebraizing formal language and automata
theory, Hans Leiss for our enlightening conversations during RelMiCS 10/AKA
5 and afterwards, Noam Chomsky for his words of encouragement, and the
UW-Milwaukee Golda Meir Library for providing the resources needed for the
research. Thanks also go to members of my family, who’ve provided moral
support and encouragement.
31 So, perhaps lending partial fulfillment to von Neumann’s attempt [35] at expanding his
53
For a given adjunction, the unit ηM ≡ (E1M )∗ : M → TM and co-unit
∗
εD ≡ (U1D ) : LD → D respectively yield natural transformations η : 1M →
T ≡ U ◦ E and ε : L ≡ E ◦ U → 1D , by virtue of the identities
∗
ηM 0 ◦ f = (Ef )∗ = Tf ◦ ηM , εD0 ◦ LF = (UF ) = F ◦ εD .
Similarly, for the category D, the co-monad (L, δ, ε) is introduced with the
co-product δD ≡ E (L1D )∗ = EηUD , which also yields a natural transformation
δ : L → L ◦ L, since δD0 ◦ LF = E (LF )∗ = LLF ◦ δD (for F : D → D0 ). The
corresponding coherence conditions are
For both the monad and co-monad, information from the original adjunction
is lost. In particular, the two equations enclosed in square brackets are no longer
present. We can partially recover the unit and co-unit by UδD = TηUD and
EµM = LεEM , and attempt to approximate the adjunction by trying to define
natural transformations Σ : T → 1M and ∆ : 1D → L such that UεD = ΣUD
and EηM = ∆EM . However, these natural transformations are only defined,
respectively, over the subcategories U (D) ⊆ M and E (M) ⊆ D within each
category that reflect the other. This observation serves as the basis for con-
structing a minimal adjunction from either the monad or co-monad.
54
and UF = F , where F : ΣM → ΣM 0 . The natural operations are given by
f ∗ = ΣM 0 ◦ Tf , where f : M → M 0 , and F∗ = F ◦ ηM , where F : µM → ΣM 0 .
These definitions suffice to recover an adjunction, the identity T = U ◦ E,
and a co-monad structure given by δΣM = TηM and εΣM = ΣM . The category
MT is referred to as an Eilenberg-Moore category of the monad (T, µ, η), and its
members as Eilenberg-Moore algebras, or just T-Algebras. The full subcategory
of free algebras µM : TTM → TM yields a category MT called the Kleisli
category of the monad (T, µ, η). An adjunction that (up to equivalence) arises
from a T-algebra construction is referred to as monadic .
55
exceptions that stand out are quantales – thus leading to the idea of idempotent
power series that we discussed in the concluding sections of the paper.
56
Appendix B.2. Application to the Tensor Product Algebras
The tensor product construction we outlined in sections 2.8 and 4.6 involve
two morphisms LAB : A → A ⊗ B, RAB : B → A ⊗ B that mutually commute
and a construction of hf, gi : A ⊗ B → C from any two morphisms f : A → C
and g : B → C that mutually commute. They are subject to the identities
hf, gi ◦ LAB = f , hf, gi ◦ RAB = g, hLAB , RAB i = 1A⊗B and h ◦ hf, gi =
hh ◦ f, h ◦ gi, where h : C → D is another morphism.
The initial object, described in sections 2.8 and 4.5 involved the morphisms
&A : I → A subject to the identities &I = 1I and f ◦ &A = &B , where
f : A → B. The uniqueness of initial morphisms also entails the following
relations &I⊗A = LIA and &A⊗I = RAI .
Together, as the following theorem shows, this is enough to define a sym-
metric monoidal category.
Theorem 1. A category with a tensor product and initial object is a symmetric
monoidal category with the correspondence f ⊗ g = hLA0 B 0 ◦ f, RA0 B 0 ◦ gi, where
f : A → A0 and g : B → B 0 .
Proof. The unitors are λA = h&A , 1A i, ρA = h1A , &A i, with inverses λ−1
A =
RIA and ρ−1A = L AI , the commutors are γ AB = hR BA , LBA i = γ −1
BA and the
associators and its inverses are
αABC = LA(B⊗C) , RA(B⊗C) ◦ LBC , RA(B⊗C) ◦ RBC ,
−1
αABC = L(A⊗B)C ◦ LAB , L(A⊗B)C ◦ RAB , R(A⊗B)C .
The verification of inverse relations, the naturality and coherence conditions are
all routine, but lengthy, calculations. For coherence, the key observation is that
since all the natural isomorphisms are built out of the ingredients used in the
universal property for tensor products and initial objects, then the universal
property forces circular chains of isomorphisms to all reduce to the identity. For
instance, the unit identity is converted to a loop by moving everything to the
right, to obtain: (1A ⊗ λB ) ◦ αAIB ◦ ρ−1 A ⊗ 1B = 1A⊗B . Direct computation,
omitting subscripts, then yields the following verification of the relation
(1 ⊗ λ) ◦ α ◦ ρ−1 ⊗ 1
Other calculations are similar. Note, in particular, the need for the identities
&I⊗A = LIA and &A⊗I = RAI to ensure the inverse property for the unitors,
e.g.,
λ−1
A ◦ λA = RIA ◦ h&A , 1A i = hRIA ◦ &A , RIA ◦ 1A i
= h&I⊗A , RIA i = hLIA , RIA i = 1I⊗A .
57
Appendix B.3. Tensor Functors and Adjunctions
Consistency of the tensor product across the adjunctions we define is assured
if the adjunctions involve monoidal functors. Let M and D be two categories
with initial objects 1 ∈ |M| and 2 ∈ |D| and tensor products M, N ∈ |M| 7→
M × N ∈ |M| and D, E ∈ |D| 7→ D ⊗ E ∈ |D|.
Given a functor U : D → M, a weak form of invariance is ensured by the
existence of two coherence maps ψ : 1 → U2 and φDE : UD ×UE → U (D ⊗ E)
satisfying the naturality condition φD0 E 0 ◦(UF × UG) = U (F ⊗ G)◦φDE where
F : D → D0 and G : E → E 0 . The coherence conditions involve the four
fundamental chains. Omitting subscripts for brevity, the respective identities
are:
φ ◦ (1 × φ) ◦ α = Uα ◦ φ ◦ (φ × 1) ,
λ = Uλ ◦ φ ◦ (ψ × 1) ,
ρ = Uρ ◦ φ ◦ (1 × ψ) ,
φ◦γ = Uγ ◦ φ.
58
Theorem 2. An adjunction (E, U) between categories M and D with ten-
sor products × and ⊗ respectively and initial objects 1 ∈ |M| and 2 ∈ |D| is
monoidal, with natural isomorphisms E1 ∼
= 2 and E (M × N ) ∼ = EM ⊗ EN .
Proof. The correspondences are ψ = &U2 and ψ̄ = &∗U2 with inverse ψ̄ −1 =
&E1 . In addition, we have φDE = hULDE , URDE i and
∗
φ̄−1
Again, verification of the conditions comes down to routine, but lengthy, calcula-
tions. The key points of interest are the inverse relations ψ̄ ◦ ψ̄ −1 = &∗U2 ◦&E1 =
&2 = 12 and
∗
ψ̄ −1 ◦ ψ̄ = &E1 ◦ &∗U2 = (U&E1 ◦ &U2 ) = &∗UE1 = η1∗ = 1E1 .
U (F ⊗ G) ◦ φ = U hL ◦ F, R ◦ Gi ◦ hUL, URi
= hU (hL ◦ F, R ◦ Gi ◦ L) , U (hL ◦ F, R ◦ Gi ◦ R)i
= hU (L ◦ F ) , U (R ◦ G)i ,
φ ◦ (UF × UG) = hUL, URi ◦ hL ◦ UF, R ◦ UGi
= hhUL, URi ◦ L ◦ UF, hUL, URi ◦ R ◦ UGi
= hU (L ◦ F ) , U (R ◦ G)i .
References
[1] Abramsky S., Vickers S.: Quantales, observational logic and process se-
mantics Mathematical Structures in Computer Science 3, 161–227 (1993).
[2] Baccelli, F., Mairesse, J.: Ergodic theorems for stochastic operators and
discrete event systems. In: [13].
[3] Berstel, J., Reutenauer, C.: Les Séries Rationelles et Leurs Langages. Mas-
son (1984). English edition: Rational Series and Their Languages. Springer-
Verlag (1988).
[4] Birkhoff, G.: Lattice Theory. American Mathematical Society (1967).
[5] Chomsky, N.: Context-Free Grammars and Pushdown Storage. Quarterly
Prog. Report No. 65, MIT Research Lab. In: Electronics, pp. 187–194,
Cambridge, (1962).
[6] Chomsky, N., Schützenberger, M.P.: The Algebraic Theory of Context-Free
Languages. In: Braort P. and Hirschberg D. (eds.), Computer Programming
and Formal Systems, pp. 118–161, North Holland, (1963).
59
[7] Conway, J.H.: Regular Algebra and Finite Machines. Chapman and Hall,
London (1971).
[8] Davey, B.A., Priestley, H.A.: Introduction to Lattices and Order. Cam-
bridge University Press (1990).
[9] Ésik, Z., Kuich, W.: Rationally Additive Semirings. Journal of Computer
Science 8, 173–183 (2002).
[10] Ésik, Z., Leiss, H.: Algebraically complete semirings and Greibach normal
form. Ann. Pure. Appl. Logic. 133, 173–203 (2005).
[11] Golan, J.S.: Semirings and their applications. Kluwer Academic Publishers,
Dordrecht (1999).
[12] Gruska, J.: A Characterization of Context-Free Languages. Journal of
Computer and System Sciences 5, 353–364 (1971).
[13] Gunawardena, J. (ed.): Idempotency. Publications of the Newton Institute,
Cambridge University Press (1998).
[14] Hoeft, H.: A normal form for some semigroups generated by idempotents.
Fund. Math. 84, 75–78 (1974).
[15] Hopkins, M.W., Kozen, D.: Parikh’s Theorem in Commutative Kleene Al-
gebra. LICS ’99, pp. 394–401 (1999).
[20] Kozen, D.: The Design and Analysis of Algorithms. Springer-Verlag (1992).
[21] Kozen, D.: A Completeness Theorem for Kleene Algebras and the Algebra
of Regular Events. Information and Computation 110, 366–390 (1994).
[22] Kozen, D.: Automata and Computability. Springer-Verlag (1997).
[23] Kuich, W., Salomaa, A.: Semirings, Automata and Languages. Springer-
Verlag, Berlin (1986).
[24] Kuroda, S.Y.: Classes of languages and linear bounded automata. Infor-
mation and Control 7, 203–223 (1964).
60
[25] MacLane, S.: Natural associativity and commutativity. Rice Univ. Studies
49, 28–46 (1963).
[26] MacLane, S.: Categories for the Working Mathematician. Springer-Verlag
(1971).
61