You are on page 1of 53

The Algebraic Approach II-V

Mark Hopkins
*


In this compilation, I included an updated version of the Algebraic Approach II paper delivered in the RelMiCS 2008
conference [16], along with expanded versions of the papers III and IV which were originally meant to be presented at
Ramics 2012, and paper V. Most of what was originally in the Algebraic Approach I paper [15] has been expanded on
or subsumed (or corrected) by part III and, to a lesser extent, part IV, and so it is not included. In addition, the appendix
(originally meant to go with Part IV) contains a fairly complete self-contained account of (co-)monads and adjunctions
that includes all the elements used in these papers, we well as others.

II: A Network of Adjunctions
In this section, we will discuss, in outline form, the quantale completion for each variety of natural dioid. This is an
updated version of the Algebraic Approach II paper delivered in the RelMiCS 2008 conference [16].

1. Preliminaries
In the standard formulation of formal languages and automata, which we will refer to henceforth as the classical theory,
a language is usually regarded as a subset of a free monoid
*
M X = . In contrast, in the Algebraic Approach, a formal
language is viewed as an algebraic entity residing in a partially ordered monoid. Through the conventional
identification { } x x , the point of view grounded in set theory is algebraized, with each set actually being viewed as
a sum of its elements, e.g.,

{ } { } { }
0 0
: 0 .
m m
m m m m
m m
a b m a b a b
> >
> =


In the classical theory, the process of algebraization ended abruptly at the type 3 level in the Chomsky hierarchy: the
regular languages and their corresponding algebra of regular expressions. Attempts were made to extend this process to
the type 2 level (i.e., context-free expressions) [14], [25], [31], but did not find particularly fruitful applications; e.g.,
no algebraic reformulation of parsing theory. A significant step, however, in this direction had already been taken early
on [6], the result being the Chomsky-Schtzenberger Theorem for context-free languages. However, no theory of
context-free expressions arose from this result. In recent times, weve begun to see renewed progress in this direction
[12].

Much of what stood in the way may have been the difficulty in clarifying the algebraic foundation underlying the
theory of regular expressions. In what algebra(s) do these objects live? As was noted in [20], in which adjunctions were
constructed to embody the hierarchical relation ses R P , the landscape is populated by a diversity of candidates that
seem to get in the way of clearly answering the question.

Though the large number of inequivalent formulations may seem to be a setback, what we have seen is that a complete
lattice of natural dioids can be defined which presents no less than an algebraic analogue of the classical notion of
language hierarchy.

For, in addition to the operators M F , M R , M e and M P defining, respectively, the finite, rational, countable and
general subsets of a monoid M , we also have operators M C , M S and M T defining, respectively, the context-free,
context-sensitive and Turing-computable subsets of M . Correspondingly, one may then seek to define adjunctions
between the members of the larger hierarchy
s s s s ses F R C S T P
and, indeed, between all the members of the natural dioid lattice, itself.

A precursor to the results formulated here may be found in [20], where adjunctions are defined connecting the
operators ses R P and their corresponding categories of dioids, which we shall term DR , e D and DP . The
functors
e D D D R P

*
UW-Milwaukee alumnus, not presently affiliated. E-mail: federation2005@netzero.net.
are constructed by defining appropriate families of ideals for the respective algebras, while the opposite members of the
respective adjoint pairs
e D D D R P
give us the structure-reducing forgetful functors. Conway [7] had earlier provided a construction for the adjunction
formed of the pair : Q D D
P
R
R P and : Q D D
R
P
P R .

These constructions may also be viewed as results in Kleene algebra, whereby a given *-continuous Kleene algebra is
extended to a form that has closure and distributivity under a larger family of subsets. Expanding on this point of view,
the adjunctions relating the pairs s R C, s R S and s R T may be viewed as operations that give us a fixed-point
closure of a given *-continuous Kleene algebra for C, or a relational closure for S and T . Concrete realizations of
these constructions, in particular for C, would then provide us with an algebraization of the classical result known as
the Chomsky-Schtzenberger theorem (thus, also resolving a question raised in the closing section of [12]).

More generally, denoting by DA the category of A -diods and A -morphisms, a desired outcome would be to reflect
the hierarchy of natural dioids by a hierarchy of adjunctions : Q D D
A
B
A B where s A B , such that = Q Q Q
B B C
C A A
,
whenever s s A B C.

For reference, the following results from the previous sections are used below:

Theorem 1 (The Universal Property). The free A -dioid extension of a monoid M is M A . Equivalently, this may be
stated as follows: that { } :
M
m M m M q e eA is a monoid homomorphism and that a monoid homomorphism
: f M D to an A -dioid D extends uniquely to an A -morphism
*
: f M D A ; i.e., such that
*
M
f f = q .

Theorem 2 (Hierarchical Completeness). Natural families form a complete lattice with top M M = A P and bottom
M M = A F , with lattice meet defined for a family Z be a family of natural families by
( ) . M M M
e
. =
A
P A
Z
Z
We will denote the lattice ordering relation by
{ } , . s . . = > A B A B A B A B Av

2. Ideals, Basic Properties
Corresponding to each operator A is a variety of ideals to be termed A -ideals. The definition makes use of the
following closure, which is generic to partial orderings.

Definition 1. For a partially ordered set D , let ( ) { }
: U x D y U y x ' = e > > .

If a set U has a least upper bound U

, then the relation y U > is equivalent to y U >

. Therefore, defining the


interval { } : a x D x a = e s we have the following properties.

Theorem 3. For a partially ordered set D :
{ } a a
'
= ;
-- if 0 is the minimal element of D , then { } 0 ' C = ; and
-- if U D _ has a least upper bound U

then U U ' =

.
We may define the family | | D A of A -ideals. The sole requirement we impose on such ideals I D _ is that (I
1
): for
all U D eA and , a b D e , if aUb I _ , then aU b I ' _ . The definition applies in the general setting of partially ordered
monoids, not just for A -dioids.

Since
| | a a
'
= , property I
1
implies that an A -ideal I must also be closed downward with respect to the partial
ordering s , (I
2
): x d I x I s e e .

Though the definition is generic to partially ordered monoids, its primary application will be to A -dioids, D . In such
a case, an A -ideal of D may be equivalently defined by property (I
3
): U D U I U I e . _ e

A . We prove this in
the following.

Corollary 1. For A -dioids, D , I
1
is equivalent to I
2
and I
3
.
Proof: Taking 1 a b = = in I
1
, leads to the result I
3
. For the converse, we note that the A -separability property D
1
of
D implies for U D eA and , a b D e that
( ) ( ) . a Ub aU b aUb aUb
'
' = _ =


Combined with I
2
and I
3
, this leads to I
1
.

For { } , e A F R , equivalent definitions of A -ideals may be formulated in the general setting of dioids. In particular,
since { } 0 ' C = , property I
1
requires that 0 I e .

Corollary 2. Let D be a dioid. Then for an A -ideal I D _ ,
IF
0
I = C;
IF
1
0 I e ;
IF
2
, d e I d e I e + e .
Moreover, an F -ideal I D _ is equivalently defined by I
2
, IF
1
(or, equivalently, IF
0
) and IF
2
.
Proof: All three properties IF
0
, IF
1
and IF
2
follow from I
3
, for the case = A F . Taking 1 a b = = with U =C yields
IF
1
from which IF
0
follows, while taking 1 a b = = with { } , U d e = yields IF
2
. Similarly, for A -dioids, the result
follows in virtue of the inclusion D D _ F A .

Conversely, suppose I
2
, IF
1
and IF
2
hold, and that { }
1
, ,
n
U u u D = _ with 0 n > . Then we have
0 0 n U I = > = C= e


by IF
1
and I
2
, and

1
0
n
n U u u I > = + + e


by IF
2
.

For the operator R , we have the following characterization:

Corollary 3. An R -ideal I D _ of an R -dioid D is an F -ideal of D for which:
IR
1
( )
*
0
n
n ab c I ab c I > e e .
Proof: If I D _ is an R -ideal, from { } { }
*
: 0
n
a b c ab c n I = > _ , we conclude that { }
*
*
ab c a b c I = e

, by I
3
. To
prove the converse, for an F -ideal I D _ satisfying IR
1
, we need to inductively establish, for U D eR , that
( )
aUd I a U d I _ e

. The argument is quite analogous to that used to establish the equivalence of R -dioids and
*-continuous Kleene algebras. We already have the property for finite subsets, by assumption. Showing that the
property is preserved by sums, products, stars is easy, noting the following

( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( )
*
0
,
,
v V
n
n
a U V d a U d a V d
a UV d a U V d a U vd
a U d a U d
e
>
= +
= =
=




and using IR
1
in conjunction with the last equality.

In general A -ideals will form a hierarchy closed under intersection. This is a consequence of the following:

Theorem 4. For a partially ordered monoid D , | | | | D D _ e A A Y Y .
Proof: Let | | D _A Y . Then suppose U D eA with aUb _ Y. Then for any A -ideal I eY, we have
, aUb I aU b I ' _ _ _ Y
by I
1
. Hence, aU b ' _ Y, thus proving that Y is an A -ideal. For the special case where = C Y , we set
D = Y and note that D is an ideal of itself.

As a result it follows that | | A D forms a complete lattice under the subset ordering _ with D as the maximal
element. One may therefore define the ideal-closure of arbitrary sets:

Definition 2. Let D be a partially ordered monoid. Then
| | { } ( ) : . U I D U I U D e _ _
A
A

Basic properties, generic to partially ordered monoids, include the following:

Theorem 5. In any partially ordered monoid D , if , U V D _ then
| | , , . U U U V U V U D U U _ _ _ e =
A A A A
A
Restricted to the case of A -dioids, the following results also hold:

Corollary 4. Let D be an A -dioid. Then 0 C =
A
is the minimal A -ideal in D ; and each interval { } a a =
A
,
for a D e , is a principal A -ideal in D .

More generally, if D is already an A -dioid, then U U ' =

for any U D eA , so that these subsets generate
principal ideals.

Lemma 1. Let D be an A -dioid. Then for any U D eA , then U U =
A
.

This then shows that the ideals generated by the subsets from D A will be in a one-to-one correspondence with D
itself, when D has the structure of an A -dioid. Taking the ideals generated from a larger family D B provides the
natural candidate for the extension of D to a B -dioid. If we could define the product and sum operations on ideals,
then this would provide a basis for extending the A -dioid D to a B -dioid for an operator > B A . We would simply
take those ideals generated from D B .

In the most general case, where = B P\, the family of ideals generated is just | | D A , itself. The entire collection of
ideals should then yield a full-fledged quantale structure. In fact, this is what we will examine next.

3. Defining a Quantale Structure on Ideals
The family | | D A , when provided with a suitable algebraic structure, will define the extension of D to a dioid with
the structure characteristic of a P -dioid or quantale with identity 1 : a complete upper semilattice in which
distributivity applies to all subsets. As a result, we will be able to define the map | | : D D Q
A
A that yields a functor
: Q D D
A
A P from the category DA of A -dioids and A -morphisms to the category DP of quantales (with
units) and quantale (unit-preserving) morphisms.

3.1. Products
The product of two ideals should preserve the correspondence U U =
A
that holds in A -dioids D with respect
to A -ideals generated by subsets U D eA . But this would require that
. U V UV UV
A

Therefore, the product should satisfy the property

1 2 1 2 1 1 2 2
. U U V V U V U V = . = =
A A A A A A

We will prove this is so by showing, in particular, the following result.

Lemma 2 (The Product Lemma). Suppose D is a dioid. Then
. UV U V =
A A A
A

Proof: One direction is already immediate: from
.
U U
UV U V UV U V
V V
_

_ _
`
_

)
A
A A A A A
A
A

In the other direction, if we can show that U V UV _
A A A
then it would follow that
. U V UV UV _ =
A A A A
A A


To this end, let

{ } { }
: , : . Y y D yV UV Z z D U z UV = e _ = e _
A A A

Then clearly
, . U Y YV UV _ _
A

So, if we can show that Y is an ideal, then we could argue
. U Y Y U V UV _ = _
A A A A

From this, in turn, it would follow that
, . V Z U Z UV _ _
A A

So, if we can also show that Z is an ideal, then we could conclude
. V Z Z U V U Z UV _ = _ _
A A A A A A


Suppose, then, that aWb Y _ , where , a b D e and W D eA . Then, for each v V e , by definition of Y , we have
. aWbv UV aWbv UV _ _
A A

The last inference comes from applying property I
1
to the ideal UV
A
. Therefore, it follows that aW bV UV ' _
A
,
and, from this, that aW b Y ' _ . Thus, Y is an ideal.

The argument showing that Z is an ideal is similar. Suppose aWb Z _ , again, with , a b D e and W D eA . Then, for
each u U e , by definition of Z , we have
. uaWb UV uaW b UV ' _ _
A A

The last inference, again, comes from applying property I
1
to the ideal UV
A
. Therefore, we conclude that
uaW b UV ' _
A
, from which it follows that U aW b UV ' _
A A
and aW b Z ' _ .

This clears the way for us to define products over subsets of D .

Definition 3. Let D be a dioid. Then, define , U V D U V UV _
A
.

Lemma 3. Let D be a dioid. Then
| | D A is a partially ordered monoid with product , U V U V , identity { } 1 and
ordering _.
Proof: Let , , U V W D _ . Then

{ } { } { } { }
( ) ( )
1 1 1 1 ,
.
V V V V V
U V W U VW UVW UV W U V W
= = = =
= = = =
A A A A A
A A A A A A A A A A A


We can treat this algebra as an inclusion of the monoid structure of D , itself, through the correspondence { } x x .
But in general, it will not be an embedding, unless D also possesses the structure of an A -dioid. This result is
captured by the following property:

Theorem 6. Let D be a A dioid. Then
( ) , . a b ab a b D = e
Thus, | | _ _ : D D =
A
A , is a monoid embedding with the unit 1 .
Proof: This follows from the relation between principal ideals and intervals, which generally holds in dioids:
{ } { } { }{ } { } . a b a b a b ab ab = = = =
A A A A

The one-to-one ness of a a is a consequence of the anti-symmetry property of partial orders.

3.2. Sums
In a similar way, we would like to preserve the correspondence U U

with respect to the sum operator. So, if
U D eA , then we should be able to write a reduction formula in terms of component principal ideals,
.
u U u U
U u u
e e
= =
A

In order for this to work, we need to know that if
( ) ( )
.
A A
A U V U V
o o o o
oe oe
oe = =
A A
A A

In particular, we will prove the following result:

Lemma 4 (The Sum Lemma). Let D be a dioid. Then
( ).
V
D
e
= e
A
A
A
P
Y
Y V Y
Proof: Unlike the Product Lemma, this result may be established directly without an inductive proof. Suppose
D eP Y . For V eY , we then have the following line of argumentation
. V V V e _ _
A
A
Y Y
Here, we can continue and argue as follows
.
V V
V V
e e
_ _ =
A A
A A A
A
A
Y Y
Y Y Y
Going in the opposite direction, we have the inclusions V V _
A
, for each V eY . Therefore,
.
V V
V V
e e
_ _
A A
A
A
Y Y
Y Y
This clears the way for us to define a summation operator over D P .

Definition 4. Let D be a dioid. Then define D _

A
P Y Y Y .

Theorem 7. Let D be a dioid. Then

Y Y is the least upper bound operator over | | D A .


Proof: Suppose | | I D eA is an upper bound of D eP Y . That is, assume that V I _ for all V eY . Then it follows
that
. I I I _ = _ =
A
A
Y Y Y
But clearly

Y is, itself, an upper bound of Y . Indeed, for all V eY, we have


. V _ _ =

A
Y Y Y
Therefore,

Y is the least upper bound of Y .



We can also prove that the ( ) _

operator is distributive.

Lemma 5. Let D be a dioid. Then
( ) , , .
W
U V U W V U V D D
e
= _ _

P
Y
Y Y
Proof: This is a direct consequence of definition 4 and theorem 7 with

( )
W
U V U V U V UWV
e
= = =

A
A
A
Y
Y Y Y

while
.
W W W
U W V UWV UWV
e e e
= =
A
A
Y Y Y


3.3. Quantale Structure
Finally, this leads to the result

Theorem 8. For any dioid D and natural family A , | | D A is a quantale with a unit { } 1 . Moreover, if D is an A -
dioid, then the map | | : D D Q
A
A is an A -morphism.

Proof: In general, the restriction of the map | | _ : D D
A
A is an order-preserving monoid homomorphism since
{ } 1 1 , . U V UV = =
A A A A

When D also happens to have the structure of an A -dioid, then the correspondence reduces to an embedding
| | : D D Q
A
A into the principal ideals of D , for in that case, we have U U =
A
, for all U D eA . The
result is then an extension of the A -dioid D to a quantale | | D A .

3.4. Morphisms
Finally, we should have consistency with respect to A -morphisms : f D E . In particular, wed like to have the
property that
( ) ( ) . U V f U f V = =
A A
A A

This result, too, will be true. We will prove it in the following form:

Lemma 6 (The Morphism Lemma). Let , D E be dioids and : f D E an A -morphism. Then
( )
( )
( ). f U f U U D = _
A
A A

Proof: The forward inclusion is easy since
( )
( )
( )
( )
. U U f U f U f U f U _ _ _
A A A
A A

To prove the converse inclusion, define
( ) ( )
{ }
: . X x D f x f U = e e
A

Then X is an A -ideal. For if V D eA and , a b D e with aVb X _ , then
( ) ( ) . f aVb f U _
A

Since f is a monoid homomorphism, then ( ) ( ) ( ) ( ) f aVb f a f V f b = . Moreover, by property A
4
, since V D eA ,
then ( ) f V E eA . Therefore,
( ) ( ) ( ) ( ) , f a f V f b f U
'
_
A

where we apply I
1
to the ideal ( ) f U
A
. If we can then show that ( ) ( ) f V f V
'
' _ , then it will follow that
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) , f aVb f a f V f b f a f V f b f U
'
= _ _
A

so that aV b X ' _ , thus proving that X is an ideal. With that given, we could then conclude with the following
argument

( )
( ) ( ) . U X U X X f U f X f U _ _ = _ _
A A A
A


It is at this point that the A -additivity of f comes into play. Let x V' e . Pick any upper bound ( ) y f V > . Then by
the A -additivity of f , we have ( ) y f v > for some v V > . By definition of V ' , it then follows that x v > . In turn, by
the order-preserving property of f (which is a part of the definition of an A -morphism), it follows that
( ) ( ) f x f v y s s . Thus, ( ) ( ) f x f V
'
e .

This result clears the way to unambiguously defining the lifting of f to a mapping | | | | : f D E
A
A A over the
respective quantales.

Definition 5. Let , D E be dioids, and : f D E an A -morphism. Then define
( ) ( ) ( ). f U f U U D _
A
A


Theorem 9. Let , D E be dioids, and : f D E an A -morphism. Then | | | | : f D E
A
A A is an identity-preserving
quantale homomorphism; or, equivalently, a P -morphism.
Proof: The identity { } 1 1 =
A
is clearly preserved, since

( ) ( ) { }
1 1 1 . f f = =
A
A

Products are preserved, since
( )
( )
( ) ( ) ( ) f U V f UV f UV f U f V = = =
A A
A
A A

while
( ) ( ) ( ) ( ) ( ) ( ) , f U f V f U f V f U f V = =
A A
A A A

for , U V D _ . Finally, suppose D _P Y . Then

( ) ( ) ( )
( ) ,
U
f f f f U
e
= = =
A A
A
A
A
Y
Y Y Y
while
( ) ( ) ( ) ,
U U U
f U f U f U
e e e
= =
A
A
A
Y Y Y

which establishes our result. In particular, the Morphism Lemma is made use of in the second equality of each
reduction to remove the inner bracket.

3.5. Free Quantale Extensions
This is the final ingredient needed to show that : Q D D
A
A P is a functor. Moreover, we may also show that the
extension provided by the function is a free extension, in the sense of satisfying an appropriate universal property.

A functor must preserve identity morphisms. This is almost immediate. In fact, letting D be an A -dioid, then for the
identity morphism 1 :
D
D D , we have for
( ) ( ) ( ) ( ) 1 1 .
D D
U U U U D = = _
A A
A

Restricted to | | U D eA , this produces the result ( ) ( ) 1
D
U U U = =
A A
. The preservation of the functor under
composition is given by the following result.

Theorem 10. Let , , D E F be dioids with : f D E and : g E F being A -morphisms. Then ( ) f g f g =
A A
A
.
Proof: Let U D _ . Then
( ) ( )
( )
( )
( )
( ) ( )
. f g U f g U f g U f g U = = =
A A A
A A
A
A

Reducing the left-hand side, we get
( ) ( ) ( ) ( ) ( )
. f g U f g U f g U = =
A
A A

Thus, we finally arrive at the result

Corollary 5. Let : Q D D
A
Ad P be given by | | D D = Q
A
A , for A -dioids D , and f f = Q
A A
, for A -morphisms
: f D E between A -dioids , D E . Then
( )

, A A is a functor.

The universal property is stated as follows. Letting Q denote a quantale with identity, we may define : Q Q
A
as the
algebra Q , itself, with only the A -dioid structure. This map is actually a functor : Q D D
A
P A which is termed a
forgetful functor. It is nothing more than the identity map, where the extra structure associated with a P -dioid, not
already present as part of the A -dioid structure, is forgotten.

The universal property states that any A -morphism : f D Q Q
A
from an A -dioid D should extend uniquely to a
unit-preserving quantale morphism (or P -morphism) | |
*
: f D Q A . The sense in which this is an extension is that
it works in conjunction with the unit A -morphism | | :
D
d D d D q e eA with ( ) ( )
*
f d f d = . The functor pair
A A A = + comprises an adjunction between DA and DP with a unit
D
D q . We will not directly prove this result
here, since it will be superseded by the more general result in the following section.

4. The Adjunction Network
If we restrict the family of A -ideals to those generated by B -subsets, then we may obtain a representation for a B -
algebra. Therefore, let us define the following:

Definition 6. Let D be a dioid, and , A B be natural families. Then define
{ }
: D U U D = e Q
B
A
A
B .

This is a generalization of our previous construction, with
| | D D = Q
P
A
A ; or, = Q Q
P
A A
. The algebra D Q
B
A
is closed
under products. For, if , U V D eB , then
, U V UV D = eQ
B
A
A A A

since , U V D eB , by A
2
. Similarly, D Q
B
A
is also closed under sums from D Q
B
A
B . Let D e Q
B
A
B Z . Since
U D U D e eQ
B
A
A
B is a monoid homomorphism, then by A
6
it follows that
{ }
: U U = e
A
Z Y for some
D eBB\ Y . But, then we can write
,
U
U D
e
= = e

Q
B
A
A
A
Y
Z Y
since, by A
3
, D eB Y . Together, this proves the following result:

Theorem 11. Let D be a dioid, and , A B be natural families. Then D Q
B
A
is a B -dioid.

We also have closure under the lifting of A -morphisms:

Theorem 12. Let A and B be natural families. If , D D' are dioids and : f D D' is an A -morphism, then
( ) . I D f I D' e e Q Q
B B
A A A

Proof: Let I U =
A
, with U D eB . Then ( ) f U D' eB , by A
4
. Therefore
( ) ( ) . f I f U E = eQ
B
A A
A


This allows us to generalize our previous result to the following:

Theorem 13. Let A and B be natural families. Define

{ }
: , D U U D f f = e = Q Q
B B
A A A
A
B
for A -dioids D and A -morphisms : f D D' . Then Q
B
A
is a functor.

Theorem 14. Let A and B be natural families with s A B . Then : Q D D
A
A
A B is the forgetful functor. In
particular, for Q
A
A
is the identity functor on DA .
.
Proof: Under the stated condition, every ideal reduces to a principal ideal
. U D D U U e _ =
A
B A
This establishes a one-to-one correspondence between D Q
B
A
and D . Previously, we pointed out that the product is
preserved with x y xy = for , x y D e , and we already know that { } I I =
A
is the identity. This shows that
D Q
B
A
and D are isomorphic as monoids.

Here, we can show that sums over D Q
B
A
B exist in D Q
B
A
without using property A
6
for B . Suppose D eQ
B
A
Z . Since
the map
( )
1
: x x

Q
B
A
is a monoid isomorphism then

( ) ( ) { }
1
: , V x D x D

= = e e e Q
B
A
B Z Z
by A
4
. Therefore,
{ } .
v V v V
v v V D
e e
= = = e

Q
A
B
A
A A
Z
Therefore, D Q
B
A
is a B -dioid.

Thus, we only need to show that : x D x e Q
B
A
is B -additive. To that end, let U D eB . Then, we have
( ) { } .
u U u U
U u u U U
e e
= = = =

Q
B
A
A
A

This shows that, as a B -dioid, D Q
B
A
is isomorphic to D .

Finally, we already know that f f = Q
B
A A
preserves arbitrary sums, for A -morphisms : f D D' . Therefore, Q
B
A
is
a B -morphism. This establishes our result.

Finally, the following theorem shows the sense in which the hierarchy of natural dioids may be considered as a chain of
free extensions.

Theorem 15. Let A and B be natural families with s A B . Then Q
B
A
is a left adjoint of Q
A
B
.

Before proceeding with the proof, it will first be necessary to describe in more detail the result being sought out here.
We are seeking to show that the functors = E Q
B
A
and = U Q
A
B
forms an adjunction between the categories DA and
DB. This requires showing that there is a one-to-one correspondence between A -morphisms : f A B U and B -
morphisms : g A B E , for any A -dioid A and B -dioid B ; that is natural, in the sense that it respects compositions
on both sides. Let the correspondence be denoted by the following rules

*
*
: :
, .
: :
f A B g A B
g A B f A B


U E
U E

To implement the one-to-one nature of the correspondence, we require

( ) ( )
*
*
*
*
: :
, .
f A B g A B
f f g g

= =
U E

To implement the naturalness condition, we require

( )
*
*
: , : , :
.
g A A f A B h B B
h f g h f g
' '
=
U
U E


The candidate chosen for this correspondence is
( )
( )
*
f U f U =
A
. But we must first show that this is well-
defined. This is done through the following lemma, which is an elaboration of an argument presented originally in [20].

Lemma 7. Let A be an A -dioid and B a B -dioid with : f A B U an A -morphism. Then
( )
( )
( ). f U f U U A = e
A
B
Proof: It is important to note that this is also an existence result. Though ( ) f U B eB , by A
4
, it need not be the case
that
( )
f U B e
A
B . Therefore, there is no guarantee at the outset that the latter be summable in B .

However, we do have the following result. Making use of the Morphism Lemma (lemma 6), we know that
( )
( )
( ). f U f U U A = e
A
A A
B
Moreover, since ( ) f U B eB , by A
4
, then the sum ( ) f U B e

is defined, and we can write



( )
( ) ( ) . f U f U f U = =
A
A A

This shows that ( ) f U

is an upper bound of
( )
f U
A
. But it is already the least upper bound of the smaller set
( ) f U . Therefore, it must be the least upper bound of the larger set, as well.

On the basis of this result, the map
*
: f A B E is well-defined. With this matter resolved, we can then proceed to the
proof of Theorem 15.

Proof: (of Theorem 15). That fact that
*
f f is one-to-one comes from showing that f is recovered from the
principal ideals by ( ) ( )
*
f x f x = . In particular, since x is an interval, then

( ) ( ) ( ). f x f x f x = =


Therefore,

( ) ( ) ( ) ( )
*
. f x f x f x f x = = =



To show that
*
: f A B E is actually a B -morphism, we must first show that the monoid structure is preserved. For
the identity, noting that ( ) 1 1 f B = eU , we have:

( ) ( ) ( ) { } ( )
*
1 1 1 1 1 1. f f f f = = = = =


For products, we can write
( ) ( ) ( ) ( ) ( )
( )
. f UV f U f V f U f V = =


Noting that the sum on the right distributes and applying the definition of
*
f , we obtain the result

( ) ( ) ( )
* * *
. f U V f U f V =
A A A A


Next, we must show that the summation operator is preserved over A E B . Let A A e = E Q
B
A
B B Z . Its at this point that
we use property A
6
. Since U A U A e eQ
B
A
A
B is a monoid homomorphism, then we may assume that there is a
set A eBB Y such that
{ }
: U U = e
A
Z Y . Then the summation
( )
( )
*
f f =

A
Z Z can be rewritten,
using the Sum Lemma, with
.
U U
U U
e e
= = =
A
A A
A A
Y Y
Z Y
Using the Morphism Lemma, we then have

( ) ( ) ( )
. f f f = =

A A
Z Y Y
The application to the union can be broken down to that on the component sets,

( )
( ).
U
f f U
e
=

Y
Y
Since each set ( ) f U B eB (by property A
4
), the least upper bound ( ) f U B e

is defined. The associativity of least


upper bounds, which is a general property of partially ordered sets, can then be used to write making use, again, of
the Sum Lemma
( ) ( ) ( )
.
U U U
f U f U f U
e e e
= =
A
Y Y Y

Similarly, applying associativity again, we can write

( ) ( ) ( )
*
.
U U
f f U f U
e e
= =
A A
Y Y
Z
From the other direction, we may write,
( ) ( ) ( )
* *
.
U U
f Z f U f U
e e
= =
A A
Y Y

which establishes preservation of sums over A E B .

The additional property of naturalness requires showing that this correspondence be well-behaved with respect to
composition with morphisms from the respective categories. In particular, for an A -morphism : g A A ' and a B -
morphism : h B B' , we need to show that ( )
*
*
h f g h f g = U E .

To this end, let U A' eB and let I denote the interval
( ) ( )
f g U B e

U
A
. Noting, by the Morphism Lemma, that
( )
( )
I f g U =

A
, we can write

( ) ( ) ( ) ( ) ( ) ( )
* *
h f g U h f g U h I = =

E E
A A

while
( )
( ) ( ) ( ) ( )
( )
*
. h f g U h f g U h I = =

U U U
A A

Since I is an interval in B , then ( )
( )
h I h I =

U follows, which establishes the result.

It is worth pointing out that B B ~ EU . The ideal U U =
A
is principal, noting that U B e

is defined for all


U B eB , since B is a B -dioid. The map g
A
applied to this ideal results in

( ) ( )
( ) ( )
( )
g U g U g U g U g U = = = =
A
A A A
A

for a B -morphism : g B B' . Therefore, the composition E U is just the identity functor on DB .

Corollary 6. Let , A B be natural families with s A B . Then Q Q
B A
A B
is the identity functor on DB .

In addition, we may show that the adjunctions behave consistently under compositions.

Corollary 7. Let , , A B C be natural families with s s A B C. Then = Q Q Q
U V U
V W W
, for any permutation , , U V W of
, , A B C.
Proof: It is actually only necessary to take ( ) , , A B C or ( ) , , C B A as the permutations of ( ) , , U V W since the other
cases can be derived by composition using corollary 6.

These two cases result from showing that adjunctions are closed under composition which is a general category-
theoretic result. The adjunctions here involve left-adjoints of forgetful functors. However, since the forgetful functors
close under composition, and the composition of adjunctions is also an adjunction, then the result follows directly from
the uniqueness of left adjoints [23, Corollary 1, p. 83].

Expand this proof in order to serve as a set up for the subsequent discussion on power series.
Theorem 16. The functor : Monoid D A A and the forgetful functor

: D Monoid A A form an adjunction pair.


Proof: This is the essence of the properties A
1
-A
4
. Here, the unit { } :
M
m M m M q e eA is the inclusion. The
extension of the monoid homomorphism

: f M A A to an A -morphism
*
: f M A A is related to the least upper
bound operator by
( ) ( ) ( )
*
` . f U f U U M = e

A
The naturalness of this correspondence is, in fact, the essential point of Theorem 1. In fact, the construction of A -
dioids is a special case of a general construction, through adjunctions, of what are known in category theory as T-
algebras [23]. To complete the proof will actually require establishing properties
D
4
{ } ( ) , m m m D = e


D
5

( )
( ) ,
U
U D
e
= e

AA
Y
Y Y
D
6

( ) { } ( ) ( )
a A
f A f a A M
e
= e

A , where : f M D A is an A -morphism
which are all elementary consequences for partially ordered sets.

It follows, also, from these considerations that = Q
B
A
A B for s A B and that, under the same condition,

= Q
B
A
B A .

III: A Unified Framework for Grammars and Transductions
Expanding part I of the Algebraic Approach series, a more refined framework is provided for grammars and
transductions over arbitrary monoids in which the key role is played by a generalization of bisimulation equivalence to
grammars.

Two varieties of grammar are introduced: separable and contextual grammars, which not only generalize
grammars respectively of types 2 and 0 in the Chomsky hierarchy to arbitrary monoids, but also generalize the
corresponding transduction classes (the simple syntax directed translations and Turing transductions, respectively) to
product monoids.

To capture the latter result, an algebraic formulation for transducers is employed in which a distinction is drawn
between generators, translators and recognizers. Closely paralleling the underlying structure of monoids as a braided
monoidal category, a duality result connecting the respective varieties of automata is established.

Keywords:
Language, Grammar, Transduction, Translation, Monoid, Context-Free, Syntax-Directed, Automata, Turing, Tensor
Product

1. Background
In part I of this series [15], a hierarchy of monoid subset families was defined, in which each subset family is
associated with a monad connecting it to the category of monoids. From this, using the T-Algebra construction [23], a
corresponding hierarchy of algebras was devised, resulting in what are known as Eilenberg-Moore Categories. Such
subset families are referred to, here, as natural families, and the corresponding algebras - which all include the
structure of a dioid (= idempotent semiring) - as natural dioids. The range of possible families mirrors the classical
language hierarchy, and includes representatives for types 0, 2 and 3 in the Chomsky hierarchy. A brief discussion of
these topics appears in section 3.

Through this device, we formulated the backbone of what we termed the Algebraic Approach, whose essence is that a
language or transduction is no longer regarded as a set of words or word pairs constructed out of one or more alphabets,
but as an element of an algebraic structure. In the classical formulation, languages are subsets of free monoids
*
M X = .
1
Within our more general framework, the subset families for free monoids comprise the free members of
each T-algebra, while the subset families for more general monoids give us the Kleisli subcategory. Thus, for instance,
corresponding to the respective families M F , M R and M P of finite, rational and general subsets of monoids M
are the categories of dioids, *-complete Kleene algebras and quantales with unit. The free elements of this category are
the finite, regular and general languages, while the Kleisli subcategory consists of the subset families of the monoids
themselves.

In the classical formulation, the specificity to free monoids applies not just to languages, but to grammars, translations,
automata and transducers, with an apparent absence of formalisms in the literature other than for free monoids. This
absence is felt most significantly in the unfortunate duplication of formalisms. Since a transduction between alphabets
X and Y is just a subset of the product monoid
* *
X Y , then a consequence of generalizing grammars and language
families to arbitrary monoids is that we bring both languages and transductions into a unified formalism; for instance,
providing a unifying framework for context free languages and simple syntax directed translations. In [15], we
made only passing mention of this generalization, relegating its outlines to an appendix. Here, in section 2 we will
provide a treatment of generalized grammars, and of transductions in section 4.

Finally, in section 5, concluding remarks (and corrections) are made concerning the type 1 languages, and the roles that
erasure, transductions, and the Duality Theorem (theorem 4.3) play in a broader formalism suitable for embodying
multi-channel, multi-party communications. The emergence in formal language theory of algebras such as quantales
and monoidal categories reveals what appears to be a cross-connection with the mathematics used in the foundations of
both classical and quantum physics, perhaps bringing us one step closer to realizing von Neumanns goal of providing
a framework for automata theory cast in the same mould as that which he helped establish for foundational Physics.
2


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 [3], [8], and for category theory, [22], [23], [24]. We also make reference to
monoidal categories, which are discussed further in [23], [26]. We use the notation 1
X
to denote the identity
function/homomorphism on a set/structure X . We use
*
X and X
+
to refer respectively to the free monoid and
semigroup generated by X . Monoid identities are generally denoted 1 , thus { }
*
1 X X
+
= . Monoid homomorphisms
are generally referred to as morphisms, and images under map by a function are denoted ( ) ( ) { }
: f A f a a A e rather
than ( ) f A . We will also use ( ) ( ) _ _ to denote both Cartesian products and direct monoid products, relying on
context to distinguish between the two (e.g. if , M N are monoids and Q is an ordinary set then N Q M is a
Cartesian product). Finally, references to [15] will be prefixed by I (e.g. Lemma I.1, the Composition Lemma, for [15]
Lemma 1).

2. Grammars over Monoids
2.1. Free Extensions as a Categorical Algebra
In I.A.1, a central role is played by free extensions in a formulation of grammars for general monoids. Associated with
the free extension | | M Q of an algebra M by a set Q is a pair of destructors:
3
a morphism | |
,
:
M Q
M M Q i and a
map | |
,
:
M Q
Q M Q o , denoted i and o for brevity. A constructor is defined by the universal property as the unique
morphism | | | | , : f s M Q M' associated to each morphism : f M M' and map : s Q M' such that
reconstruction identities | | , f s f i = and | | , f s s o = hold. In the following, we treat i and o as inclusions, and

1
Let ( )
T
F V be the free monoid generated by
T
V , i.e. the set of all strings in the vocabulary
T
V . A language is, then, a subset of ( )
T
F V , [3, p.
8].
2
We are very far from possessing a theory of automata which deserves that name, that is, a properly mathematical -logical theory [28]. It was von
Neumann who earlier established the foundational roles played by Boolean logic and Quantum logic, respectively, in classical and quantum physics.
3
In here and the following, the term constructor is used to designate an operation that constructs a morphism for composite types from morphisms
for simpler types, while the destructors are morphisms that break a composite type down to its component types.
regard | | , f s as a simultaneous extension of both f and s .
4
The uniqueness required by the universal property is
ensured by the uniqueness identities | | | | , , g f g s g f s = (for morphisms : g M M ' '' ) and
| | , ,
, 1
M Q M Q M Q
( i o =

.
5


An important application of the universal property is the construction of the degree function | | { } deg : 0,1, 2, M Q ,
which combines the constant functions { } : 0 f M and { } : 1 s Q . Thus deg o counts the number of variables
from Q in | | M Q oe . Additional applications of the universal property allow us to establish the following
isomorphisms
| || | | | ( ) | | | |
*
, , M Q Q M Q Q Q Q M M Q Q ' ' ' ~ = C ~ C ~ 1
where { } 0 = 1 is the 1-element monoid. For instance,

| || | | |
| | | |
( )
| |
| | | || |
, , ,
, , , , ,
, , : ,
, : ,
M Q Q M Q Q M Q Q
Q Q
M Q M Q M Q Q M Q Q M Q Q
M Q Q M Q Q
M Q Q M Q Q
' ' '
'
' ' '
' ' i o o
' ' i i i o o

In addition, for free monoids, we have the following consequences
| | ( )| | | || | | | ( ) ( )
*
* *
, . X Q X Q X Q X Q X Q C ~ C ~ ~ ~ ~ = C 1 1 1 1

2.2. General Grammars
In the classical account (e.g. [5]), a grammar ( ) , , , G Q X S H = contains a set Q of variables, a relation H over
( )
*
X Q comprising the phrase structure rules and a starting configuration ( )
*
S X Q e . It is normally assumed
that S Q e . If not, one can add a new variable

S Q e and a new rule


( )

, S S H e to yield an equivalent grammar with


this property. In addition, it is assumed classically that X Q = C. This reduces ( )
*
X Q algebraically, to the free
extension of
*
X by the set Q . Thus, when we generalize from
*
X to arbitrary monoids M , the configuration set
becomes the free extension | | M Q . Accordingly, we define a grammar over a monoid M as a structure ( ) , , G Q S H =
composed of a set Q of variables; the starting configuration | | S M Q e and a relation | | | | H M Q M Q _ .

A transition relation
H
over | | M Q (denoted for brevity) is generated from H by the rules

| | ( ) ( )
( ) | | ( ) ( )
, ,
,
: , : , : , : ,
, , , , , , ,
: , : , : .
R L
M Q H H
H M Q H H
oe o | e o | e
o | |
o o o o | o |
o | e e o | | e o | e |
o | o o
R T H H
P H H

We may also write
n
o | to indicate the number 0 n > of times H is used in a derivation o | (i.e. the number
of applications from ( ) , , ,
L R
H H H P ). One may readily verify that R taken with any of the sets { } , , T C H , { }
R
H ,
{ }
L
H or { } , T P suffices to equivalently define the relation
H
. Finally, corresponding to each | | M Q oe is the

4
In place of , f s , which we used in I.A.1, we use the notation | | , f s , drawing an analogy with the coproduct constructor in [22, Section I.1].
5
To make this truly a categorical algebra requires making explicit the forgetful functors

: M Monoid Set , writing | |


,

:
M Q
Q M Q o M and
replacing the second of equations reconstruction identities respectively by
| | | |
, ,

, , , .
M Q M Q
f s s f s f o = i = M
In here and the following we will take the shortcut of treating

M as an identity functor.

monoid subset | | { } :
H
H
m M m o e o (denoted | | o for brevity) derivable from o . We have the inclusion
| || | | | o | _ o| by C , while | | | | o _ | follows from o | by R and T. Finally, ( ) | |
H
L G S = defines the subset of
M generated by the grammar.

2.3. Simulation Ordering and Contextual Grammars
In the classical account of grammars for free monoids
*
M X = , one also assumes that H is finite and, for each
( ) , H o | e , that deg 0 o > . As we will shortly see, this permits the conversion of the grammar to a form we call
contextual: a form in which S Q e and H is reduced to a subset | | H Q M Q
+
_ . However, when generalizing to
arbitrary monoids, the condition deg 0 o > does not suffice to yield this type of grammar nor even a grammar that
generates a morphism of a classical type 0 language. When a monoid is not free, if factoring over the monoid is not
recursive, then matching of the left-hand sides phrase structure rules may be non-recursive. Classical proofs of key
theorems (e.g. substitution closure, property
5
A which is described briefly below) may cease to hold in the general
context of grammars over arbitrary monoids.
6


To correct this problem, we adopt an approach analogous to that taken in [27]. For free monoids
*
M X = , we define
M T as the family of languages represented by type 0 grammars over alphabets drawn from finite subsets of X . Since
the classical type 0 languages are closed under morphisms between free monoids (e.g. [30, theorem 9.2.3]), with the
free monoids comprising a full subcategory of the category of monoids, then we may define the family M T , for
general monoids M by taking any generating subset X along with the canonical surjective morphism
*
: X M o
and setting

( ) ( ) { }
* *
: . M X L L X = o = o e T T T
The independence of the generating subset chosen is, then, a consequence of the closure of the family under morphisms
between free monoids. Thus, if
*
: X M ' o another canonical surjective morphism, we then choose
( ) ( )
1
x x

' ' ' eo o and define a morphism


* *
: X X ' o by ( )
x x ' ' o = . Then it follows that ' o o= o and that

( ) ( )
( )
( )
* * *
. X X X ' ' ' o = o o _o T T T
The reverse inclusion is obtained analogously.

A similar approach may be adopted for the subset families M C and M R corresponding, respectively, to the extension
of type 2 and 3 languages to general monoids. However, as we will soon see, direct proofs of the morphism closure
property are possible using the concept of simulation ordering.

A partial resolution is provided by the following result.

Theorem 2.1: Simulation Ordering and Bisimulation Equivalence
Let
( )

, , G Q S H = and ( ) , , G Q S H = be grammars respectively over monoids

M and M , and suppose there is a


morphism | |

: h M Q M Q
(


such that
( )
{ }
( )
( ) ( )
1 1

, , , . h S S h Q Q h Q Q M h M M

= _ _ _
Consider the following assumptions:
1. for all
( )

, H o | e , ( )
( )

H
h h o | ,
2. for all ( ) , H o | e and , m m M

e , if
( )

h m m

| = | then

H
o | for some
( )
1
h m m


oe o ,
3. for all ( ) , H o | e and , m m M

e , if ( )
h m m

o = o then

H
o | for some
( )
1

h m m


|e | .

6
For instance, the proof of
5
A in Lemma I.1 tacitly assumes the freeness underlying monoid at key points.
From 1 follows
( ) ( )
( )

h L G L G _ , and from 2 or 3 follow ( )


( ) ( )

L G h L G _ . More specifically:
4. from 1 it follows that if

H
o | then ( )
( )

H
h h o | , therefore | | ( ) ( )


H H
h h o _ o (

;
5. from 2 it follows that if
( )

H
h o | then for some ( )
1
h

oe o ,

H
o | , therefore | | | | ( )
( )
1

H H
h
h

oe o
o _ o ;
and
6. from 3 it follows that if ( )

H
h o | then ( )
( )
1

H
h

-|e | o | , therefore ( ) | | ( )

H H
h h o _ o (

.
Proof:
First, for assumption 2 we will also assume that the condition
( )

h M M _ has been strengthened to


( )

h M M = , say,
by taking a generating subset X M _ , defining { }

: X x x X = e , ( )
h x x = and adding

X to

M . This does not


change the grammar

G and affects neither the assumptions 1, 2, 3, nor any of the other assumptions made of h .

For 1, we may establish ( )
( )

H
h h o | from

H
o | by a routine inductive argument. From this immediately
follows | | ( ) ( )


H H
h h o _ o (

. Noting that
( )

h S S = ,
( )


H
L G S
(
=

and ( ) | |
H
L G S = , our results follow. Another
inductive argument applies for 2. The case for R is trivial. If
( )

H
h o | with
( )

h o = | , then we choose

o = | and
conclude by R that

H
o | . The inductive step, however, is non-trivial. Assume we have, by application of
R
H ,
H
o , with ( ) , H o e and
( )

h o = | = | . Since | | , M Q e , we can produce the following factorings



{ } | | ( )
{ } | | ( )
, 1 , ,
, 1 , .
m M Q Q m M
m QM Q m M


' ' = e e
' ' = e e

Since
( )

h m m

' ' | = o , then using our assumptions on h , it follows that we have a similar factoring

| = o , where

( ) ( )
( ) { } { }
( )

, , , 1 , 1 . h h m m h M Q Q QM Q

( ( ' ' = o = o = e e


Then, by 2 it follows that there exists
( )
1
h m m


e such that

H
o . In addition, since

( )

, h m m

' ' = =
then by inductive hypothesis there exists ( )
1
h

oe o such that


H
o . Therefore, by P and T, it follows that



H
o o = |. From this, we conclude that if | |
H
me o then by the surjectivity of
M
h , we have ( )
m h m = for some

m M e . By 2 there exists ( )
1
h

oe o such that | |


H
me o . The stronger assumption ( )
{ }
1

h S S

= in place of
( )

h S S = is required for the conclusion ( )


( ) ( )

L G h L G _ .

The argument for 3 is symmetric to that for 2, except that
L
H is used in place of
R
H for the inductive step. However,
only the weaker assumptions
( )

h M M _ and
( )

h S S = are required rather than


( )

h M M = and ( )
{ }
1

h S S

= .
QED

Example 2.2: Classical Reduction to Contextual Grammars
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 o, | e are subject to the restriction deg 0 o > . We define { }

: X x x X = e and the
grammar
( )

, , G Q S H = over M , where
( ) ( ) ( ) ( ) { } ( ) { }

, , ; , : , , , : ,
H X H X
Q Q X S S Q H H H H H H x x x X = = e = = o o o | o | e = e
where we define the morphism ( )
*
*

: X Q Q o by

: , 1 ,
Q
Q
x X x X o e e o =
and the morphism
( )
( )
*
*

: h X Q X Q by

1 , : .
X Q
X Q
h h x X x X

= e e

Condition 1 is satisfied since
( )
*
1
X Q
h

o = . For condition 2, we first note that by an inductive argument we have
( )


X
H
o for any ( )
1
h

e . So, suppose ( ) , H o | e and


( )

h m m

| = | . Then ( ) ( )


H
H
o o o | . Taking
( )
m m

o = o o , it follows by P that
( )


H
H
m m

o o | . Since
( )

X
H
m m

o | | , it follows from T that

H
o | . Thus, applying theorem 2.1 and noting that
* *
1
X X
h = , it follows that
( )
( ) ( ) ( )

L G h L G L G = = . The
assumption that deg 0 o > for each ( ) , H o | e means that the grammar

G has the form



S Q e and
( )
*

H Q Q X
+
_ which is a further specialization of the contextual form.

For contextual grammars, a simpler account of simulation ordering may be established by the following result.

Theorem 2.3: Simulation ordering (contextual form)
With the same notation of theorem 2.1, assume that the grammars

G and G are contextual and in place of 3, assume


that: 4) for
( ) ( )

, h H | | e there exists ( )
1

|e | such that


H
| | . Then it follows for all

M Q
(
oe

and
| | M Q |e where ( )

H
h o |, that

H
o | for some ( )
1

|e | .
Proof:
As in the proof of theorem 2.1, for the inductive step, we assume by way of
L
H that
( ) ( ) ( )
, , , .
H
h H Q
+
o = | | e |e |
Then since ( )
1

h Q Q

_ we must have a factoring



o = | , with

( ) ( ) ( )
( )

, , . h h Q h
+
= | = | |e =
By 4, it follows that

H
| for some ( )
1
h

e . Therefore, we may set



| = and use P and T to conclude

H
o | .
QED

As we shall see, a consequence of theorem 2.3 is that the classical reduction of type 0 grammars to contextual form
holds true for the family M T for general monoids M , with an analogous restriction to the form where S Q e and
( )
*
H Q Q X
+
_ , where X M _ is a finite subset.

2.4. Separable and Algebraic Grammars
We next consider the family of grammars subject to the restriction that the phrase structure rules comprise a finite
subset | | H Q M Q _ , thus generalizing the family of grammars known classically as context-free. However, though
the classical terminology is well-established, a more apt term for these grammars - which we will adopt here - is
algebraic. In its place, a better characterization of context-freeness is one that captures the essence of the term: namely,
that sets | | o be independent of context, i.e. | || | | | o | = o| . To this end, we call a grammar separable if
1. whenever m| , where m M e , then m | = , and
2. whenever o| , then there exists a factoring ' ' = o | such that ' o o and ' | | .
For separable grammars, the reverse inclusion | | | || | o| _ o | trivially follows. The equivalence of the two types of
grammars is captured by the following results.

Theorem 2.5: Algebraic grammars are separable
Proof:
This result follows by inductive argument. Let ( ) , , G Q S H = be algebraic. In case R , o| = o|, and separability
is trivial. For the case
R
H , we have a derivation
( ) ( ) , , , . q q Q q H o| e o e o =
By inductive hypothesis, there is a factoring q ' ' o | = such that ' o o , ' | | . Since q is prime in | | M Q , the
only possibilities are either
( ) ( ) , or , . q q ' ' ' ' o = c = c| = o c | = c
In the former case, by
R
H , we have o oc and by C , ' o| oc| = o. In the latter case, by, again by
R
H , we
have | co and by C , ' o| o co = o, thus completing the induction.
QED

Conversely, as the following result shows, in a separable grammar a finite H can always be converted to finite
algebraic form H .

Theorem 2.6: Conversion of separable grammars to algebraic form
If ( ) , , G Q S H = is a separable grammar, with H finite, then there exists an algebraic grammar
( )
, , G Q S H = with
H containing a finite number of the ( ) | | , q Q M Q o e for which
H
q o, such that | | | |
H H
o = o for all
| | M Q oe .
Proof:
For finite H , a finite subset H may be obtained by taking each ( ) , H o | e , where
( )
0 1 1 1 0 1
, , , , , ,
n n n n
m q m q m q q Q m m m M o = e e
and using separability to factor
0 1 1 n n
m m m | = | | , such that
i H i
q | for 1, , i n = . Then, we replace ( ) , H o | e
by ( ) { }
, : 1, ,
i i
q i n | = , adding this subset to H .
QED

Separate into a section on Fixed Point Systems and One-Sided Linearity
As in the classical theory, the left-linear and right-linear grammars may be defined by the respective restrictions
( ) ( ) , . H Q M QM H Q M MQ _ _
Together, these are referred to as one-sided linear grammars. We denote by M C and M R the subfamilies of M that
are recognized respectively by separable and one-sided linear grammars.

For the following, we extend the terms contextual, algebraic, separable and one-sided linear to grammars where the
transition relation H may be an infinite set. If necessary, we draw the distinction by using the terms finite or
infinite for both the transition relation and the grammar. Note that there is nothing in the proofs of theorems 2.3 or
2.5 that required the grammar to be finite! This will become especially important in our treatment of transducers.

3. Natural Families
3.1. Review
As described in Example I.1, in place of M R , M C or M T , and in place of the finite subsets M F or power set M P ,
other subset families M M M _ _ F A P may be considered that we deem here natural, and a variety of algebra we
term collectively the natural dioids. In particular, corresponding to , , , e F R P are respectively the dioid (=
idempotent semiring), *-complete Kleene algebra, countable semiring
7
and quantale with unit. In addition, we also
have the algebras corresponding to C, which are equivalent to the -continuous Chomsky algebras of [13]; i.e.
dioids closed under the least solutions of finite least fixed point systems, possessing a certain continuity property. Here,
we shall even be able to go as far as to provide a topological underpinning to both this form of continuity and the *-
continuity property of the *-continuous Kleene algebra.

To review, an A -dioid D is a partially ordered monoid which is closed under least upper bounds sup U U =

from
U D eA such that distributivity holds ( )
( ) ( )
UU U U ' ' =

for , U U D ' eA . For consistency, this requires
that we define a natural family A to be a correspondence that:
0
A : associates with each monoid M a subset family M M _ A P ,
1
A : such that M M _ F A .
2
A : M A to be closed under products, endows the family with the structure of a monoid partially ordered by subset
inclusion, thus allowing us to consider the family M AA .
3
A : By also requiring that M A be closed under unions from M AA , we endow M A with the further structure of
an A -dioid.
4
A : Finally, we require that M A be closed under morphisms : f M M' ; that is, for any U M eA ,
( ) ( ) { }
: f U f m M m U M ' ' e e eA \.
As a result, A becomes an endofunctor on the category of monoids and morphisms. A consequence of these properties
(Theorem I.9) is:
6
A : (surjectivity) if the morphism : f M M' is surjective, then so is : f M M' A A .

3.2. Morphism Closure for R , C and T .
The morphism closure property
4
A for R , C and T may be directly established as a consequence of theorem 2.3 by
the following.

Example 3.1: Construction I
Let
( )

, , G Q S H = be a contextual grammar over a monoid

M and let

: h M M be a morphism. Define the


grammar ( ) , , G Q S H = , where

( ) ( ) ( ) ( ) ( ) { }

, , : , , S h S Q Q H h h H = = = | | | | e
where we extend the morphism to | |

: h M Q M Q
(


by setting 1
Q
Q
h = . Then property 1 of theorem 2.1, along with
its assumptions on h , are satisfied, as is property 4 of theorem 2.3. Thus, we conclude that
( ) ( )
( )

h L G L G = . A key
point in establishing 4 for this construction is noting that ( ) ( ) { }
1
h h

| = | for Q
+
|e , since h is bijective on Q
+
.

Example 3.2: Construction II
Conversely, suppose that we start out with a grammar ( ) , , G Q S H = over a monoid M of this form. Then define the
free monoid
*

M X = , the set { }

: X x x X = e and a morphism

: h M M by ( )
h x x = . Define the contextual
grammar
( )

, , G Q S H = over

M by selecting any ( )
1

S h S

e and setting

( ) ( ) ( ) { }
*

, : , . H H Q Q x x H
+
= | | e
8


7
Equivalently described as a dioid possessing countable distributivity and least upper bounds for countable subsets.
8
If X is infinite, then we only take a finite number of ( )
, x | , sufficient in number to represent all the ( ) , x H | e .
Then, once again, we have a construction satisfying theorem 2.3. Thus, it follows that ( )
( ) ( )

L G h L G = , with
( )

L G M = T . Similar results hold if G is algebraic or one-sided linear.

We note that in both constructions, if either grammar is one-sided linear, algebraic or contextual, then the other shares
this feature. Therefore, we establish the morphism closure property for R , C and T . Moreover, since the reduced
contextual form
( )
*

H Q Q X
+
_ is preserved by this construction, yielding a grammar of the form where S Q e
and
( )
*
H Q Q X
+
_ for some finite subset X M _ , then the classical reduction of type 0 grammars to this form
applies generally.

3.3. Naturality for R , C and T .
A key result (Theorem I.8) is that the conjunction of
3
A and
4
A is equivalent to:
5
A : (closure under substitutions) an A substitution, i.e. a morphism : M M' o A , lifts to a morphism
( ) { }
*
:U M U M' o e o e

A A .
For , , R C T , the corresponding property for free monoids
*
M X = recovers the well-known classical results for
substitution closures of types 0, 2 and 3 languages ([30, Theorems 9.2.1, 9.2.2, 9.2.3]). We may generalize the result
with the following construction that we describe generically for { } , , e A R C T .

Let : M M' o A be an A -substitution and U M eA given by ( ) ( )
U h L G = for a grammar ( ) , , G Q S H = of type
A over
*
X , via the morphism
*
: h X M . For each x X e , let ( ) s x M' eA be given by ( ) ( ) ( ) ( )
x
s h x h L G ' = for
a grammar ( ) , ,
x x x x
G Q S H = of type A over a monoid
*
x
X , via the morphisms

*
: .
x
x X
h X M
e
| |
' '
|
|
\ .

We assume, without loss of generality, that the sets ( ) :
x
X x X e are mutually disjoint from one another and from X .
Define the A -substitution ( )
:
x
x X L G o e . Then, it follows that h h' o = o over
*
X . Therefore,
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )
( ) ( ) ( )
* * *
. U h L G h L G h L G h L G h L G ' ' ' o = o = o = o = o = o
Thus, the classical closure result which entails
( ) ( )
*
*
x
x X
L G X
e
| |
o e
|
|
\ .
A
combined with the closure of the A -subsets under the morphism h' yields the corresponding closure result
( )
*
U M' o eA for general monoids.

Corollary 3.3: R , C and T are natural families.

3.4. Finite Generativity
Following the proof of Theorem I.10, brief mention was made of the property we termed
7
A : (Finite Generativity): for each U M eA , there is a finitely generated submonoid
0
M M _ such that
0
U M eA .
For a given grammar ( ) , , G Q S H = over a monoid M , if H is finite, then we may reduce each ( ) , H o | = and S to
a form
0 1 1 k k
m q m q m where
1
, ,
k
q q Q e extracting out all the factors
0
, ,
k
m m M e of S and of all the
( ) , H o | e and collecting them into a finite subset X M _ . Then, it follows that ( )
M
L G X _ , where
M
X M _
is the submonoid generated by X . Thus, we obtain the following result

(Note: S also satisfies the property.)

Corollary 3.4: R , C and T satisfy finite generativity.

Note: A similar property in Proof Theory establishes that all proofs no matter how many underlying axioms there
may be rest on a finite number of assumptions. This is known as compactness. This suggests that a better name for
property
7
A may be compactness. Whether, or how, it may be related to a compactness property in the
topologization to be presented below is an issue that will remain unresolved here.

4. Transductions over Product Monoids
4.1. Product Monoids and Tensor Categories
Classically, transductions are characterized as sets of ordered pairs between two free monoids
*
M X = and
*
M Y ' = ,
the former providing the set of possible inputs, the latter the set of possible outputs. The subsets of M M' give us
descriptions of transductions between two monoids M and M' . The restriction to direct products of free monoids,
with the rational, context-free and Turing subsets yields, respectively, the rational transductions, push-down
transductions (equivalently, simple syntax directed translations) and Turing transductions (equivalently, recursively
enumerable relations between
*
X and
*
Y ). To go beyond this, we consider in its stead the subset families
( ) M M' A for more general product monoids M M' . In this section, we will lay a foundation for a general theory
and establish the correspondence between the grammar and transduction families for { } , e A R C .

Formally, the direct product M M' of monoids M and M' is formed as the Cartesian product, with multiplication
defined pointwise: ( ) ( ) ( ) , , , m m m m mm m m ' ' ' ' = , for , m m M e and , m m M ' ' ' e . It follows that
( ) ( ) ( ) ( ) ( ) ( ) ,1 1, , 1, ,1 , . m m m m m m m M m M ' ' ' ' ' = = e e
Therefore, the direct product may be characterized as the free extension of both factor monoids in which the elements
of each commute with those of the other. More precisely, we have two destructor morphisms
( ) ( ) : ,1 , : 1, ,
MM MM
m M m M M T m M m M M
' '
' ' ' ' ' e e e e
(respectively denoted and T for brevity) that are mutually commuting
( ) ( ) ( ) ( ). m T m T m m ' ' =
The universal property associates with any mutually commuting morphisms : f M M'' and : f M M ' ' '' a unique
constructor morphism
| | ( ) ( ) ( ) , : , f f m m M M f m f m M ' ' ' ' ' '' e e
that satisfies the reconstruction identities | | , f f f ' = and | | , f f T f ' ' = . The uniqueness property is equivalently
captured by the uniqueness identities | | | | , , g f f g f g f ' ' = and | | , 1
MM MM M M
T
' ' '
= . In the following, we treat
the destructors as inclusions and the product as a mutually commuting simultaneous extension of the two factor
algebras.

In addition, we have the one-element monoid { } 0 = 1 , which may be characterized as the initial object in the category
of monoids. This is the object defined by the universal property that to each monoid M there be a unique morphism
| | _ : 0 1
M
M e e 1 . The uniqueness is equivalently given by the following conditions | | | | _ _
M M
f
'
= for
morphisms : f M M' and | | _ 1 =
1
1
.

The combination of the tensor product construction and initial object yields what is known as a braided monoidal (or
tensor) category. In such a category, the tensor product is a bifunctor which, here, is established by extending the
tensor product to morphisms | | , f f f T f ' ' = . In addition, it entails are the following isomorphisms
( ) ( ) , , , M N P M N P M M M M N N M ~ ~ ~ ~ 1 1
which may be readily constructed from , T and | | _, _ , e.g.

| |
| |
1
1
1
1
_ ,1 : , : ,
1 , _ : , : .
M M M M
M
M M M M
M
M M M M
M M T M M

(

(

1 1
1 1

For reference, the isomorphisms
M
and
M
are respectively referred to as the left unitor and right unitor, while the
other two isomorphisms
( ) ( ) : , :
MNP MN
M N P M N P M N N M o
are respectively the associator and commutor.

Additional requirements are also readily verified, but will only be noted in passing, since they will not be used in the
following. These are: that the isomorphisms be natural, e.g.
( ) ( ) 1 , 1 ,
M M M M
f f f f
' '
= =
1 1

for morphisms : f M M' and that the category be coherent, meaning that any two morphisms constructed out of
, T and | | _, _ with compositions and identities are equal if they have the same source and target. The braided
monoidal categories are distinguished from the more general family of monoidal categories which need not have the
commutor nor any of its associated identities.

4.2. Transducers and Automata
A transducer ( ) , , , T Q I F H = over a monoid M N consists of a state set Q , subsets , I F Q _ respectively of initial
and final states and a (possibly infinite) subset H Q M N Q _ . The relation
H
is defined on N Q M as the
closure of the one-step relations
H
qm nq' for ( ) , , , q m n q H ' e under applications of the following

( ) , , ,
: , : , : .
H H H
MN MN
H H H
m n M N
N Q M
n m n m
o | e o | | oe
o o o o |
R T P
Finally, the subset generated by the transducer is
( ) ( ) { }
, : , , .
H
L T m n M N im nf i I f F = e e e
For the case M =1 the transducer reduces to a generator for N ; and for N =1 , to a recognizer for M , all
collectively referred to as automata. One may then write, in the respective cases, H Q N Q _ or H Q M Q _ .
These conversions are both an application and reflection of the natural isomorphisms N N ~ 1 and M M ~ 1 .

4.3. The Duality Theorem
A transducer may be equivalently expressed as a recognizer or generator, where the one-step transition
H
qm nq' is
replaced respectively by the read relation ( ) ,
R
H
q m n q' and write relation ( ) ,
W
H
q m n q' . These conversions
correspond to the natural isomorphisms
( ) ( ) . M N M N M N ~ ~ 1 1
However, instead of proving these results directly, we may take advantage of the monoidal category structure formed
by the monoids and prove a more general result: the one corresponding to the natural isomorphism
( ) ( ) M N P M N P ~ .

Theorem 4.1: Duality Theorem
Let , , M N P be monoids and ( )
0 0
, , , T Q I F H = and ( )
1 1
, , , T Q I F H = transducers, respectively, over ( ) M N P
and ( ) M N P such that
( ) ( ) ( ) ( )
0 1
, , , , , , , , . q m n p q H q m n p q H ' ' e e
Then
( ) ( ) ( ) ( ) ( )
0 1
0 0 0 1
, , , .
H H MNP
q m n p q qm n p q L T L T ' ' ' ' = o
Proof:
The second part of the theorem follows trivially from the first, by using the definitions for ( )
0
L T and ( )
1
L T . For the
first part, we argue inductively from
0
H
to
1
H
, the argument for the converse being similar. The induction is non-
trivial, since it needs to account for the reversal of the roles played by N from reading to writing. The inductive
assertion is that if ( ) ( )
0
, ,
H
pq m n p q m n ' ' ' ' , then there exists a factoring
0
n n n' = such that
( ) ( )
1
0
1, ,
H
p qm n p q m ' ' ' . This recovers the first part of the theorem as a special case.

For the one-step transitions and for R , the assertion is trivial. Therefore, we need only establish the result inductively
for T and the restricted forms of P . For T, suppose
( ) ( ) ( )
0 0
, , , .
H H
pq m n p q m n p q m n '' '' '' '' ' ' ' '
Then applying the inductive hypothesis to each step and applying T, we factor
0
n n n'' = ,
1
n n n '' ' = and write
( ) ( ) ( ) ( )
1 1
0 1
1, , , 1, , .
H H
p qm n p q m p q m n p q m '' '' '' '' '' '' ' ' '
Multiplying the second transition on the left by
0
n (i.e. applying P ), and using T, we get
( ) ( ) ( )
1
0 1 0 1
1, , , .
H
p qm n n p q m n n n n ' ' ' ' =
For P , suppose
( ) ( )
0
, ,
H
ppq mm nn pp q m m n n ' ' ' '
arises from
( ) ( )
0
, , , , , .
H
pq m n p q m n m M n N p P ' ' ' ' e e e
Again, applying the inductive step, we have a factoring
( ) ( )
1
0 0
, 1, , .
H
n n n p qm n p q m ' ' ' ' =
Applying P to this, we obtain the result
( ) ( ) ( )
1
0 0
1, , , ,
H
pp qmm n pp q m m nn n n n ' ' ' ' =
thus rounding out the induction.
QED

4.4. The Transduction Theorem
Because of the duality theorem, we can represent a transducer between M and N as a generator over M N with H
replaced by
W
H , which is (possibly infinite) right-linear and then treat it as a grammar. This correspondence is
captured by the following result.

Theorem 4.2: Transduction Theorem
Let ( ) , , , T Q I S H = be a transducer over M N , and define the (possibly infinite) right-linear grammar
( ) , ,
T
G Q S H ' ' = where S Q e is chosen as the start symbol, and
{ } ( ) { } ( ) { }
, , : ,1 : .
W
Q Q S H H S i i I f f F ' ' = = e e
Then ( ) ( )
T
L G L T = .
Proof:
Since the only one-step transitions from S are to start states i I e and the only one-step transitions of the form
( ) ,
H
q m n
'
are those which arise from ( ) ,
W
H
q m n f for a final state f F e , then it follows that ( ) ,
H
S m n
'
if
and only if ( ) ,
H
i m n f for some i I e and f F e . This is the defining condition for ( ) ( ) , m n L T e . Thus,
( ) ( ) L G L T = .
QED

4.5. Rational Transductions
The classical definition of a finite transducer (e.g. [30, section 7.2, p. 340]) over
* *
M N X Y = is a structure
( ) , , , , , T Q X Y H S F = with S Q e and F Q _ . The configurations comprise the set N Q M (with the assumption
Y Q = C. Transition relations are generated by a finite subset
9
{ } ( )
1 H Q X N Q _ , with each
( ) , , , q m n q H ' e yielding the one-step transition qm nq' . There is no loss of generality in reducing a finite relation
H Q M N Q _ to this form, for each ( ) , , , q m n q H ' e , we can factor ( ) , m n over { } ( )
1 X N and convert this
one-step transition into a multi-step transition, adding intermediate states, as needed. Thus, the classical construction
for rational transductions essentially coincides to the general formulation for transductions provided here, where H is
assumed to be finite. This leads to the following result.

Theorem 4.3: The finite transductions between monoids M and N consist of the rational subsets ( ) M N R .
Proof:
In the forward direction, assume ( ) U M N e R . Pull back the monoids to free monoids
*

M X = and
*

N Y = with
surjective morphisms

:
X
s M M and

:
Y
s N N . By surjectivity, there exists
( )
* *

U X Y e R such that
( )

h U U = , where
X Y
h = o o . Applying the classical result, we may devise a finite transducer
( )

, , , T Q I F H = such
that
( )

L T U = . We may either apply a conversion analogous to the Construction I (example 3.1) to

T to obtain a
transducer ( ) , , , T Q I F H = of the same form as, where
( )
( )

, , , , Q I F Q I F = , or we may apply Construction I, itself, to
the regular grammar

T
G G = obtained from

T , resulting in a grammar of the form


T
G G = . Then as a consequence of
theorem 2.3 (or Construction I), we obtain ( )
( ) ( ) ( )

L G h L G h U U = = = . In the reverse direction, if we have a finite
transducer ( ) , , , T Q I F H = , we may apply a conversion analogous to Construction II (example 3.2) to obtain a
transducer
( )

, , , T Q I F H = over a monoid of the form
* *
X Y , along with a morphism
* *
: h X Y M N , and
use theorem 2.3 to conclude that ( )
( ) ( )

L T h L T = , from the result


( ) ( )
* *

L T X Y e R obtained classically.
QED

4.6. Algebraic Transductions
A similar argument may be used to lift other classical correspondence results for translations, automata and transducers
from free monoids to general monoids. We will describe here the application of this argument to simple syntax directed
translations (SSDTs), and briefly outline the argument for push-down transductions (PDTs), in each case lifting the
correspondences established classically (e.g., [30, Theorems 7.4.1, 7.4.2, pp. 353-354]) to forms applicable to general
monoids.

Classically (e.g. [30, section 7.3, p. 349]), a grammar for an SSDT over
* *
M N X Y = is given by a structure
( ) , , , , G Q X Y H S = with S Q e . Configurations are restricted to a finite subset | | | | H Q M Q N Q _ and the
elements ( ) , , q H o | e are further restricted by the condition that the appearances of elements of Q in both words
, o | occur in the same number and order. Configurations ( ) , o | are subject to a similar restriction, with the starting
configuration being ( ) , S S . We may generalize this definition to arbitrary monoids, resulting in a similar structure
( ) , , , , G Q M N H S = which replaces the generating sets by the monoids themselves.

In either case, each such ( ) , , q H o | e may be characterized as a rule
( ) ( ) ( )
0 0 1 1 1
, , ,
k k k
q m n q m n q m n
over the monoid M N , by factoring out the common occurrences of factors from Q . A similar conversion may be
applied to each configuration ( ) , o | . With this correspondence, each SSDT grammar is described equivalently as a

9
In [30], the factors N and Q are listed in the opposite order relative to our definition.
context-free grammar over the product monoid, and vice versa. Having established the correspondence for free
monoids
*
M X = and
*
N Y = , we may then proceed to lift the result to general monoids with Constructions I and II.

Therefore, we arrive at the following result:

Theorem 4.4: The syntax-directed translations between monoids M and N are given by the family ( ) M N C of
context-free subsets of the product monoid.

A similar process may be applied to push down transducers over
* *
M N X Y = . Classically (e.g., [30, section 5.2, p.
259]), it is defined as a structure ( ) , , , , , , T Q X Y Z H I F = with and
{ } ( ) ( ) ( )
* * *
. H Q X Z Q Z Q Z Y _
The configurations are reduced to the space
* * *
Y Z Q X with
H
generated by closure under C , R and T
from the one-step relations
( ) ( ) ( ) ( ) ( ) ( )
, , , , , , , , , , , . zqx n q q x z q n H qx n q q x q n H ' ' ' ' | | e | | e
The language is defined by
( ) ( ) { }
* *
, : . L T m n X Y sm n f f F = e . e

When we rewrite the state set as
*
Q Z , the corresponding automaton is { } { } ( )
*
, 1 , 1 , Q Z I F H' over the free
monoid
*
X . In H' , while the one-step transition qx q' | is replaced by ( ) ( ) ,1 ,
H
q x q
'
' | , each one-step
transition zqx q' | must be replaced an entire set of relations: ( ) ( ) , ,
H
q z x q
'
'' ' '' | | | for all
*
B '' | e . The result is
an automaton with the following symmetry condition: if 1 | = , then ( ) ( ) , ,
H
q x q
'
' ' | | implies
( ) ( ) , ,
H
q x q
'
'' ' '' ' | | | | for all
*
Z '' | e . The conversion of F to { } 1 F imposes the empty stack condition. If we
were to relax this condition, then we would replace F by
*
F Z , instead. Then a second symmetry condition would
arise, stating that if ( ) , f | is a final state then ( ) , , f ' | | is a final state, for all
*
Z ' | e .
10


5. Conclusion and Further Topics
5.1. The 2008 Treatment of S
Classically, a family M S for type-1 languages may be defined for free monoids
*
M X = which satisfies properties,
0
A ,
1
A and
2
A , but not
3
A even at the classical level: the morphism closure of type 1 languages are type 0
languages. Instead, it is the non-erasing morphisms that type 1 languages are closed under. To be able to account for
this requires either restricting to a subcategory of monoids with non-erasing morphisms, or adding structure to the
monoids (e.g. normed monoids, following the treatment in Appendix I.A.3) to serve in place of the category of
monoids. A similar approach was adopted by sik and Ito [10] and Straubing [27], the latter introducing the C-variety,
which lifts a subcategory C of the category of finitely generated free monoids to the subcategory of the finitely
generated monoids. Typically, the restriction placed on morphisms is that they be length-preserving (and thus non-
erasing).

5.2. The Duality Theorem and Communications
Erasing morphisms also come into play with multi-layered communications. When modelling how the sender and
receiver each appear to one another, part of what lies on one end comprises hidden degrees of freedom seen from the
vantage point of the other end. One may thus think of a spoken expression as an element of M N , where M contains
the hidden or non-verbal channels, and N contains the part which is expressed by orthography or verbally (or on
separate channels by prosody). From the vantage point of the sender, the interaction is represented by an element of the

10
So, perhaps lending partial fulfillment to von Neumanns attempt [28] at expanding his foundational work in physics to automata theory, we may
draw the analogous correspondence of H to the Hamiltonian for a dynamics, the restriction on the forms of one-step rules to selection rules, and the
symmetry conditions to symmetries imposed on the dynamics of a physical system and its states.
product monoid ( ) M N P , where P is the reaction of the receiver. On the receiving end, the reader maps the
expression that is heard or otherwise perceived as an element of N P , and the interaction from the vantage point of
the receiver is an element of ( ) M N P . Ideally, P is a reflection of M , while N is used to establish that
reflection. This is where the duality theorem comes fully into play. Here, underlying the duality is the monoid
equivalence ( ) ( ) M N P M N P ~ , where the dual roles of N as output (for the sender) and input (for the
receiver) are made explicit.

IV: Natural Families and Natural Dioids
Further expanding the treatment in part I of the Algebraic Approach series of what we here term natural families and
natural diods, define topologies associated with the respective families, and provide algebraic generalizations of
word reversal within the framework of involutive monoids, of tensor products within the framework of braided tensor
categories, as well as of free extensions and matrix closure.

Expanding on part II of the Algebraic Approach series, we generalize our formulation of the hierarchy of natural dioids
downward to partially ordered monoids. In addition, we broaden the scope of the natural family construction to
idempotent semirings, and lay out the framework for a theory of idempotent power series.

Keywords:
Tensor Category, Tensor Product, Category, Adjunction, Monad, Free Extension, Topology, Locale, Frame, Power
Series, Idempotent, Dioid, Quantale, Semiring

1. Summary and Conventions
Expanding on the treatment in parts I and II of this series [15], [16], we will provide a deeper formulation of the
hierarchy of natural families and natural dioid that brings to the forefront more of the elements of the underlying
categorical algebra.

In section 2, we review the hierarchy of natural families and dioid categories. The basic constructions (free extensions,
tensor products) are discussed in section 3, along with closure properties that embody classical word reversal and
matrix algebras. In section 4, we outline the basic features of the network of adjunctions that link the members of the
dioid hierarchy. Two extensions beyond the treatment in [16] are discussed here: the downward extension of the
hierarchy that includes the category of partially ordered monoids as its minimal member, and the generalization of the
natural dioid hierarchy to a form suitable for representing power series over idempotent semirings.

Finally, we close with some concluding remarks in section 5, where we discuss the extension of the dioid hierarchy to
semirings. An appendix (section A) has added to provide further detail on adjunctions and (co-)monads, and to
establish the notation we use for their categorical algebras in the spirit of [17, part 1] and [22, part 1]. A more detailed
treatment of adjunctions, monads and co-monads may be found in [23]. Tensor categories are discussed further in [24],
[26].

Items in [15], [16], section III are prefixed respectively by I, II and III (e.g. Lemma II.4, the Sum Lemma). We observe
the conventions described in section III.1. In addition, we use , , A B D to refer to generic natural families. A morphism
means a monoid homomorphism, similarly an antimorphism is a monoid anti-homomorphism, an A -[anti-]morphism
is a[n] [anti-]homomorphism over the category DA (defined in section 2.1).

2. Naturality
2.1. Natural Families and Dioids
A natural dioid D contains the structure of a monoid: a product , d d D dd D ' ' e e and identity 1 D e . In addition,
a partial ordering is imposed that is complete and distributive with respect to a distinguished family of subsets, denoted
generically D A . Thus, if D is an A -dioid, then each subset A D eA has a least upper bound, A D e

( A -
completeness), such that ( )
( ) ( )
AA A A ' ' =

for , A A D ' eA ([strong] A -distributivity). As noted in
definition I.2, the distributivity property can be replaced by the following property (weak A -distributivity):
11


( )
( ) , , . dAd d A d d d D A D ' ' ' = e e

A
We term the algebras A -dioids, and define an A -morphism : F D D' as an order-preserving morphism such that
the following property, which we call A -additivity, holds:
( )
( )
( ) f A f A A D = e

A
where ( ) ( ) { }
: f A f a a A e . The result is a category we denote DA .

The archetypical members of DA are the subsets families M A of monoids M , the partial ordering given by subset
ordering, the least upper bound by union. The product operation on M lifts to one over M A given by
{ } : , AB ab M a A b B e e e for , A B M eA . This endows the subset family, itself, with the structure of a monoid
that contains an isomorphic copy of the original monoid through the unit morphism { } :
M
a M a M q e eA . The
A -dioid structure is obtained by requiring that the subset family be closed under unions taken from the iterated family
M AA . The resulting morphism :
M
M M e e AA A Y Y then yields an instance of a A -morphism: i.e., an
order-preserving morphism that is additive with respect to least upper bounds of A -subsets. Finally, each monoid
homomorphism : f M M' lifts to an A -morphism : f M M' A A , given by ( ) A f A . Thus, the
preconditions required for the subset families M A are that they
0
A be subset families, that
1
A contain the finite
subsets,
2
A are closed under products,
3
A are closed under unions taken from the iterated family and
4
A are closed
under morphisms. Together, these conditions define the natural families.

For instance, if the subset family A includes the family of all finite subsets, denoted here F , then the corresponding
category contains least upper bounds 0 = C

and { } , a b a b + =

, thus endowing it with the structure of a dioid (=


idempotent semiring). In particular, DF is the category of dioids and dioid-morphisms. At the opposite extreme are
the families of general subsets, denoted here P . The corresponding category DP consists of quantales with unit. As
seen in Corollary III.3.3, natural families exist, denoted respectively R , C and T whose free algebras
*
X R ,
*
X C
and
*
X T are respectively the type 3, 2 and 0 languages over a given alphabet X .

2.2. Review of Basic Properties
What we have done is complete the construction of what is known as a T-Algebra [23] or an Eilenberg-Moore Algebra.
The category DA is referred to as an Eilenberg-Moore category.
12
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

: D Monoid A: A that reduces each A -dioid D to its


underlying monoid D D = A and each A -morphism : F D D' to its underlying monoid homomorphism

: F F D D' = A A A . The adjunction relation is established by the following theorem.

Theorem 2.1: The functor A and the forgetful functor

A form an adjunction pair


( )

, A A .
Proof:
An adjunction that (up to equivalence) arises from a T-algebra construction is referred to as monadic. This is what we
are actually verifying. In the following, we will use the notation and conventions defined in the appendix. The proof
that A is actually a functor requires showing closure under identity functions and composition: 1 1
M M
=
A
and
f g f g = , which are both trivial consequences of set theory.

11
In Definition I.2, the names for the two forms of distributivity were inadvertently swapped.
12
The subcategory of DA consisting only of the free A -extensions M A of monoids M gives us what is called a Kleisli category.

The one-to-one correspondence between monoid homomorphisms

M D A and A -morphisms : F M D A is
defined as follows:
( ) { } ( )
*
*

: , : . f U M f U D F m M F m D e e e e

A A
The identities
( )
*
*
f f = and ( )
*
*
F F = immediately follow.

The naturalness of this correspondence is shown as follows. Let : F D D' be an A -morphism between A -dioids
D and D' , let : h M M ' and : g M D A be monoid homomorphisms. Then for each U M' eA , we have
( ) ( ) ( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( ) ( ) ( )
*
* *
. F g h U F g h U F g h U F g h U F g h U = = = =

A A
QED

This results in a hierarchy of monads. For each natural family A there is an adjunction pair
( )

, A A that extends the


category of monoids to the category of A -dioids. The unit

: I q
Monoid
A A , given by
M
M q , arises from
1
A .
The product
( )
2

: A A A A , given by
M
M arises from
2
A . Closely related to the product is the co-unit

: I c
DA
A A given by ( )
D
U U D c = e

for U D eA . Finally, related to the unit is the co-product by


( )
2

: o A A A A , defined by ( ) { } { }
:
D
U u u D D o = e eAA for U D eA .

Elementary consequences of this construction, which are generally true for T-algebras, are reviewed in Theorems I.1,
I.2, I.3 and I.4:

Theorem: Let M M A be a natural family. Then
- M A is an A -dioid for any monoid M ,
- ( ) _ : D D

A is an A -morphism for any A -dioid D ,


- every monoid homomorphism : f M M' lifts to an A -morphism : f M M' A A ,
- (the universal property) the free A -dioid extension of a monoid M is M A .

In categorical language, the universal property that describes M A as the free A -dioid extension of a monoid M may
be equivalently described by the following: (a) :
M
M AM q is a morphism, and (b) each morphism

: f M D A
is associated with a unique A -morphism
*
: f M D A such that
*
M
f f = q . As an illustration of the categorical
algebra developed in the appendix for adjunctions, the uniqueness can be established as follows. If

M M
f F F = q = q A , then noting the identity ( )
*
1
M M
q =
A
, it follows that
*
1
M M
q =
A
. Therefore,
( )
*
* *
M M
f F F F = q = q = A .

In Theorem I.6, we proved that the hierarchy is a complete lattice ordered by s A B iff M M _ A B for all monoids
M , with F and P respectively as the lattice top and bottom, and lattice meet defined by ( ) M M M . = A B A B .
The members of the algebra hierarchy may be regarded as a quantale subject to a restriction on distributivity and
additivity. In section II.3, a network of adjunctions between the different algebras was defined which gave realization
to this idea. The key results of this construction are summarized in section 4.

Other results that are not general consequences of the T-algebra construction, but specific to our application of the
construction are the following. An A -substitution is a morphism : M M' o P such that ( ) m M' o eA , for each
m M e . Substitution closure
5
A asserts that the quantale extension (proven to be unique in Theorem I.7)
( ) ( ) ( )
*
,
m U
U m M U M
e
' o = o e e P P
yields an A -morphism upon restriction:
*
: M M' o A A . Moreover, property
5
A may be taken as an equivalent
replacement for
3
A and
4
A (Theorem I.8).

In addition, a partial recapitulation of the classical property of closure under inverse homomorphisms can be obtained
with the surjectivity property (
6
A ), which asserts that a surjective morphism : f M N yields a surjective A -
morphism : f M N A A as was proven in Theorem I.9. In addition, finite generativity
13
(
7
A ) which asserts that each
subset A M eA is a subset
0
A M _A of a finitely-generated submonoid
0
M M _ .

Under the assumption of
0
A ,
1
A and
2
A , this property is equivalent to the combination of
3
A and
4
A (Theorem
I.8). Finite generativity is trivially satisfied by F . In Corollary III.2, it was also proven for , , R C T .

2.3. Examples
Example 2.2: Chomsky Families
From our prior discussion on generalized grammars, we have the Chomsky hierarchy, which consists of the following
families M R , M C and M T ordered by s s R C T .

Example 2.3: Cardinality Families
We may define the following cardinality-limited subset families

{ } { }
# #
: , : , M U M U M U M U = _ < = _ s
k c
k c F P
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 theory,
14
thus proving the naturality of each family.
As special cases, we have the natural families
0

= F F and
0

e= P of finite and countable subsets, respectively.



Example 2.4: Finite Dioids
All finite dioids have a complete lattice ordering. Therefore, each category DA contains the same finite algebras. The
smallest dioid { } 0 = 1 is uniquely defined by the identity 0 1 = .

The next smallest dioid is { } 0,1 = 2 .

Beyond this are the dioids of cardinality 3, defined by the presentations

2 2 2
0 2 3
: 1 , :1 , : 0, 1 . x x x x x x x x x = = < = < = = = < 3 3 3

Example 2.5: Generalized Frames and Locales
A quantale Q with the unit 1 is a complete lattice. Because of the identity 1 x s , it follows that ab a s , ab b s . In
addition, if a x s and b x s then
2
ab x x s s . Thus the product coincides with the lattice meet (therefore it is
commutative), and the lattice meet has infinite distributivity with respect to the lattice join. This equivalently define
frames and locales
15
, the varieties differing from each other only in what is considered a morphism: frame morphisms
coinciding quantale morphisms, locale morphisms going the opposite way. The most important example of frames and
locals are the lattices of open sets comprising a topology. Here, the frame and locale morphisms are respectively the
open maps and continuous maps.


13
This property was adopted by [14, p. 356], following lemma 2.5 as a condition for context-free subsets of arbitrary free monoids. It was also
mentioned at the end of section I.2, but was not discussed in any further detail.
14
For
k
F , property
3
A is the definition of a regular cardinal.
15
As well as complete Heyting lattices.
We may generalize our example and define an A -restricted frame/locale as an A -dioid in which the unit is maximal,
and the respective morphism types as the A -morphisms and their reversals, respectively.

Example 2.6: Binary Matrices
For each ordinal o , the matrix algebra M
oo
o
= 2 is a quantale with the monoid structure given by the matrix product
and identity matrix, and the ordering given component wise: A B s iff
ij ij
A B s for all , i j eo.
16
For finite ordinals
nee, the dioid
n n
2 is finite. Since
0
M and
1
M are dioids respectively of sizes 1 and 2, the isomorphisms
0
M ~ 1
and
1
M ~ 2 are immediate.

Example 2.7: Relations
The relations over a set X form an involutive quantale ( ) X X P ordered by subset inclusion. The product is
relational composition , R R R R ' ' , the identity is the diagonal ( ) { }
, :
X
I x x x X = e , and the involution is the
transpose
T
R R . By
3
A , the natural family ( ) X X A is closed under A -sums and is therefore an A -dioid. For
ordinals o a one-to-one correspondence with
oo
2 is given by
( ) { }
, : 1 .
ij
A i j A
oo
e eoo = 2
For finite ordinals n , ( ) ( ) n n n n = A P . Using the bijection ( ) , i k m n ni k mn e + e , we may establish
( ) ( ) ( ) m n m n mn mn ~ P P P
as an isomorphism. Since this correspondence is preserved by unions this also yields a quantale isomorphism. As a
consequence, it also follows that
m n mn
M M M ~ .

Add this example:
Example. Finite Generativity Families
Each A can be restricted to the subfamily formed from finitely generated submonoids:

0
.
M
X M
M X
e
=
F
A A
The largest such family is
0
P . For the other natural families, we have
0 0
s . A A P in the lattice ordering of natural
families. To prove equality requires that the submonoid ordering property ( M M M M ' ' _ _ A A ) be strengthened
to a form ( ( ) M N M N = A P A ) that is too strong to be derivable from the axioms
0
A to
4
A .

2.4. Topology
Strong and weak A -distributivity, and A -continuity all require A -completeness as a precondition. However, the
properties can be generalized to partially ordered monoids and made independent of completeness, with the following
definition.

Definition 2.8: Let M be a partially ordered monoid and write m U > if m M e is an upper bound of a subset
U M _ . Then M is strongly A -separable if for all m UU' > , there exists u U > and u U ' ' > such that m uu' > ,
where m M e and , U U M ' eA ; M is weakly A -separable if for all m aUb > , there exists u U > , such that
m aub > , where , a b M e and U M eA . Finally, an order-preserving monoid homomorphism : f M M' to a
partially ordered monoid M' is A -continuous, if for all ( ) m f U ' > , there exists u U > , such that ( ) m f u ' > , where
U M eA and m M ' ' e .


16
We are identifying each ordinal with the set of the ordinals that precede it; thus, { } 0, , 1 n n = , for finite ordinals n .
In an A -dioid D , the condition u U > is equivalent to u U >

, when U D eA . Therefore, one may verify that


when restricted to the category DA , the strong and weak forms of A -separability are equivalent to one another and to
both forms of A -distributivity, while A -continuity equivalently defines an A -morphism.

The family M A can be endowed with a topological structure with respect to which a monoid homomorphism
: f M M' is A -continuous if and only if : f M M' A A is continuous. A sufficient condition for this
correspondence is given by the following:

Definition 2.9: A partially ordered monoid M is A -directed if the set of upper bounds of each U M _A form a non-
empty downward-directed subset of M (i.e. for every two upper bounds
0 1
, u u U > there is a third upper bound
u U > such that
0 1
, u u u > .) For such monoids, it follows that the neighborhoods { } :
x
M U M U x = e < A A generate
a topology that we will adopt as the A -topology of M A . The open sets are defined as arbitrary unions of
neighborhoods.

We can then state the following results:

Theorem 2.10: Let , M M' be A -directed partially ordered monoids. Then : f M M' is A -continuous if and only
if : f M M' A A is continuous. In addition, M is weakly A -separable if and only if for each , a b M e , the
function U M aUb M _ e A A is continuous; and M is A -separable if and only if the product
, U V M UV M e e A A is continuous.
Proof:
Both directions of each of the three correspondences rely on the equivalence
x
x U U M > eA . This is illustrated for
A -continuity, the other correspondences being similar.
17


First, suppose : f M M' is A -continuous and O M' _A is an open set. Let ( )
1
U f O

e ; i.e., ( ) f U O e . Then,
there is a neighborhood
y
M O ' _ A 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 ( )
u y
f M M' _ A A , while
u
U M eA . Thus, ( )
1
f O

is
open.

Next, suppose : f M M' A A is continuous. Let U M eA and ( ) f U y < . Then ( )
y
f U M' eA . Therefore, by
continuity, there is a neighborhood
u
M A containing U , such that ( )
u y
f M M' _ A A . In particular, since
{ }
u
u M eA , then ( ) { }
y
f u M' eA , or ( ) f u y s . Since
u
U M eA , then u U > . Thus, we establish the A -continuity
of f .
QED

3. Constructions and Closure Properties
3.1. Initial and Terminal Objects
In each category DA , the dioids 1 and 2 are respectively the terminal and initial objects, possessing the universal
properties that associated with each algebra D are unique morphisms _ :
D
D1 and | | _ :
D
D 2 . The
uniqueness is expressed by the identities

17
For the continuity of the product, we use the product topology on M M A A .

| |
| | | |
:
_ 1 , ,
_ _
:
_ 1 , .
_ _
D D
D D
F D D
F
F D D
F
'
'
'
=
=
'
=
=
1
1
2
2

where F denotes an A -morphism. Because 0 1 = in 1 , no dioid morphism : f D 1 exists, except for D =1.

Since the monoid 1 is also the initial object in the category of monoids (c.f. discussion in section III.4.1), then it
follows from their respective universal properties that
| | | | | | | | | | | |

_ _ _ and _ _ _ .
M M D D
= =
1 2 A A A A
A A

3.2. Free Extensions
The description of free extensions we gave in section III.2.1 as a categorical algebra applies also to the category DA
of A -dioids. Here, the destructors are the A -morphism | |
,
:
D Q
D D Q i , the map | |
,
:
D Q
Q D Q o , respectively
denoted i and o for brevity, and the constructor defined by the universal property is the unique A -morphism
| | | | , : f s D Q D' associated to each A -morphism : f D D' and map : s Q D' such that reconstruction
identities | | , f s f i = and | | , f s s o = hold.

To define the free extension | | D Q which we defined in terms of the monoid free extension by | |
( )

D Q A A , subject to
the a suitable set of relations. From the monoid destructors

,
:
D Q
i i
A
and

D Q
o = o
A
, we define
D
i = q i and

D
o = q o. In order to ensure that the former is an A -morphism we need to impose the free-extension relations:
( ) { } ( )

.
a A a A
a a A D
e e
| |

i = i e
| `
|
\ . )

AA

From the monoid constructor, we define | |
*

, , f s f s
(
=

A . The preservation of the reconstruction identities, uniqueness
identities and free-extension relations are routine, but lengthy exercises in categorical algebra. As a consequence of the
free extension universal property, isomorphisms analogous to those established in III.2.1 for monoids may be obtained,
where the role played by the monoid 1 is now played by the initial object, the dioid 2 :

| || | | | ( ) | | | |
( )| | | || | | | ( ) ( )
*
*
*
, , ,
.
M Q Q M Q Q Q Q M M Q Q
X Q X Q X Q X Q X Q
' ' ' ~ = C ~ C ~
~ ~ ~ = C
2
2 2
A
A A


Finally, the relation to the monoid free extension is established by the following theorem.

Theorem 3.1: | | ( ) ( )| | M Q M Q ~ A A .
Proof:
Explicitly, the isomorphism is given explicitly in terms of the monoid destructors
,

M Q
i = i ,
,

M Q
o = o and constructors
in the forward direction by | |
, i o and the reverse direction by

,
(
i q o

A , which one may readily verify are inverses.
QED

3.3. Tensor Products
The description of monoid direct products in section III.4.1 as a categorical algebra applies to natural dioid categories
DA , to yield a tensor product D D'
A
(also denoted D D' for brevity) of two A dioids , D D' . We start by
defining the tensor product as
( )

D D' A A A and subject to the minimal set of relations required to make the
destructors A -morphisms. Denoting the monoid destructors by

,

D D'
=
A A
and

,

D D
T T
'
=
A A
, when we define the dioid
destructors
DD'
= and
DD
T T
'
= by
( ) ( ) ( ) ( )
( )
( ) { } ( )

, , , d T d d T d d d d D d D ' ' ' ' ' = q = e e
noting that their mutual commutativity trivially follows. To make this an A -morphism, we impose the tensor product
relations:
( ) { } ( ) { }
( )
( )
,

, , , .
a a A A
a a A A A D A D
' ' e
' ' ' ' = e e

AA AA
The constructor associated with a pair of mutually commuting A -morphisms : F A A'' and : F A A ' ' '' is defined
in terms of the monoid constructor by
*

, F F
(
'

A A . Again, it is a lengthy but straightforward application of categorical
algebra to show that this preserves the tensor product relations and satisfies the reconstruction identities | | , F F F ' =
and | | , F F T F ' ' = and uniqueness identities | | | | , , G F G F G F F ' ' = and | | , 1
DD DD D D
T
' ' '
=
A
. By an argument
analogous to that in section III.4.1, the tensor product endows DA with the structure of a braided tensor category, with
the following natural isomorphisms
( ) ( ) , , . D D D D D D D D D D D D D ' '' ' '' ' ' ~ ~ ~ ~ 2 2
A A A A A A A A


In addition, we have the following result:

Theorem 3.2: For any A -dioid D , D D = = 1 1 1
A A
.
Proof:
Since there is no dioid morphism from 1 other than to itself, then the destructors : D 1 1
A
and : T D 1 1
A

immediately yield the stated dioid isomorphisms.
QED

Finally, we have the following property, as an exercise in categorical algebra

Corollary 3.3: ( ) M M M M ' ' ~
A
A A A
Proof:
We note in passing that we can actually go further and establish : Monoid D A A as a monoidal adjunction with the
stated isomorphism being natural. But for the following, we will only need the isomorphism. Let and T denote the
tensor product destructors for M M'
A
A A and

and

T the monoid product destructors for M M' . Then forward


direction is given by

,
M M
T
'
(
q q

A A , and the reverse direction by

, , T
(


A A .
QED

As a consequence of this result and Theorem III.4.3 and III.4.4, we have the following characterizations:

Corollary 3.4: The rational transductions and syntax-directed translations between monoids M and N form algebras
respectively isomorphic to M N
R
R R and M N
C
C C .

3.4. Reversal and Involution
An antimorphism : f M M' is a map with the properties
( ) ( ) ( ) ( ) ( ) 1 1, , . f f mm f m f m m m M ' ' ' = = e
A special case is an involution: a bijection onto M M ' = with
1
f f

= . Such a morphism ( )

f m m = may be
equivalently defined by the properties

( ) ( )


1 1, , , m m mm m m ' ' = = =
for , m m M ' e . A similar definition applies to the category DA , where we require that an A -involution in an A -
dioid D also be A -additive,

( )
( )

,
a A
A a A D
e
= e

A
and that an A -antimorphism : F D D' be an antimorphism that also satisfies A -additivity. However, in order for
such operations to be meaningful, we need to know that the sum can actually be defined. That is, we need the
involution closure property:
8
A : under an involution

m M m M e e ,
{ }

: , U M U u M u U M e e e e A A
thus yielding an involution on M A .

Example 3.5: Word Reversal
Over the free monoid
*
X the unique involution satisfying
R
x x = for x X e is word reversal. For subsets
*
U X _ we
define
{ }
:
R R
U w w U = e , thus endowing each natural family
*
X A with an A -involution.

An equivalent statement can be expressed in terms of A -antimorphisms.

Theorem 3.6: Involution closure is equivalent to closure under A -antimorphisms.
Proof:
Suppose A satisfies
8
A and that : f M M' is an antimorphism. Let X M _ be a generating subset of M , and
*
: X M o the canonical surjection onto M . Then we define the morphism

( ) ( )
*
: .
R
f w X f w M
o
' e o e
Given U M eA , by surjectivity (
6
A ), we can find a
*

U X eA such that
( )

U U o = . By
8
A ,
*

R
U X eA . Therefore,
by
3
A , ( )
( )

R
f U f U M
o
' = eA .
QED

Example 3.7: Involution on free extensions and tensor products
The constructors for monoid free extensions and products in sections III.2.1 and III.4.1 can be generalized to
antimorphisms. If : f M M'' and : f M M ' ' '' are antimorphisms and : Q M'' o a map. Then we define the
constructors | | , f s and | | , f f ' in the obvious way:
| |( ) ( ) ( ) ( ) ( ) | |( ) ( ) ( ) , , , , . f s mq q m f m s q s q f m f f m m f m f m ' ' ' ' ' ' ' ' = =
Both sets of reconstruction identities apply, e.g. | | , f s f i = and | | , f s s o = .

Similar constructors for A -dioids in terms of the monoid constructors. Let : F D D'' , : F D D ' ' '' be A -
morphisms and : s Q D'' a map. Then, making use of the free extension and tensor product constructions
respectively in sections 3.2 and 3.3, we define | |
*

, , F s F s
(
=

A and | |
*

, , F F F F
(
' ' =

A A . To show that these are
well-defined requires that they respectively preserve the free extension and tensor product relations, which is a routine
but lengthy verification. Similarly, it is routine to verify that these satisfy the reconstruction and uniqueness identities,
e.g.
| | ( ) ( ) ( ) ( ) { } ( )
( ) ( ) ( ) ( )
*

, , , . F s d F s d F s d F d F d
( (
i = i = i = =

A A A

As an application of the universal property: given involutions
D
i and
D
i
'
respectively on A -dioids D and D' these
constructions yield involutions
| | D Q
i on | | D Q and
D D
i
'
A
in D D'
A
satisfying the following identities:

| |
| |
| |
| |
,
,
, ,
, ,
, , , .
D Q DQ D D D DD DD D D Q
D Q DQ D D D DD DD D D Q
DQ D DQ D D DD D DD D D Q
i i i i
i i i T T i
i i i i T i
' ' '
' ' '
' ' ' '
i = i =
o = o =
( = i o =

A
A
A


For cardinality-limited natural families, F or e, for P , and more generally for
k
F ,
c
P , and for the finite generativity
class
0
P , involution closure
8
A holds. In addition, by the following theorem, we have involution closure for the
Chomsky hierarchy.

(Add S to this list)
Theorem 3.8: , , R C T each satisfy
8
A .
Proof:
Let ( ) , , G Q S H = be a grammar over a monoid M that has an involution

m m . Then, extending the involution to


| | M Q , and defining the grammar
( )

, , G Q S H = by
( ) ( )
{ }

, : , H H = o | o | e , it follows that
H
o | iff


H
o | . Therefore, | |

H
H
( o = o

and as a consequence ( ) ( )

L G L G = . Moreover, the type of grammar (one-


sided linear, context-free, contextual) is preserved by the conversion, with left-linear grammars converting to right-
linear grammars and vice versa.
QED

3.5. Matrix Closure
Using the binary matrix algebra and tensor product, a matrix algebra in DA may be defined by
,
n n
n
M D D

2
A A
.
As a consequence of the isomorphisms noted in Example 2.6 and the tensor product identities, we have

0 1
, , .
n n m n mn
M M M D M D D M M D M D ~ ~ ~ ~ 2 1

Closely related to
n
M D, in the category DF of dioids, the set
n n
D

can be given the structure of a dioid with the
matrix product, identity matrix and matrix sums. An involution

d d on D yields an involution on
n n
D

given by

( ) ( ) ( )

, .
ji
ij
A A i j n = e
However, in order to define matrix algebras of the form
n n
D

in DA , we need to be able to define the sums

( )
,
ij ij
ij
A U
U U A
e
= =


for each , i j n e , where
n n
U D

eA . This requires that each of the sets
{ }
:
ij ij
U A A U = e have least upper bounds. At
best, we can infer the following: denoting the unit matrix for row i and column j by
ij
e , and noting the identity
ij kl ki jk
U e e Ue = , we have
n n
ij kl
U e D

eA . Summing over k l n = e , it also follows that
n n
ij n
U I AD

e , where
n
I is the
identity matrix. However, to further conclude
ij
U D eA requires the matrix closure condition on A ,
9
A : if
n n
U D

eA then
ij
U D eA for all , i j n e .

Assume that A satisfies matrix closure. Then associated with the matrix algebras are the following constructors:

( ) ( )
: : , , : ,
n n n n n n n n
ij D
F A D F A i j n D I d D dI D

' e e e e e
where : F D D' is an A -morphism. In addition, as the following result shows, the two constructions for matrix
algebras become isomorphic for such natural families.

Theorem 3.9: If A satisfies
9
A , then for each A -dioid and finite ordinal nee,
,
n n
n
M D D

~
A
.
Proof:
The forward direction is given by
1
_ ,
n n
n D
D
I

( | =

, and the reverse direction by the A -morphism
( ) { } ( ) ( )
,
,
: , .
n n n n
n ij n
i j n
A D i j T A D M D

e
| e e =

2
A A
A
QED

Matrix closure
9
A is easily verified for the natural families F , e, P and more generally for M
k
F and M
c
P . The
case for R is established in [19], where the Kleene star is inductively defined by the following decomposition

* *
* * *
*
* * * * * *
, .
A B E E BD
E A BD C
C D D CE E D CE BD
| | | |
= = + | |
| |
+
\ . \ .

However, the question of whether
9
A holds for C and T , is here left unresolved. A direct proof involving grammars
can be formulated.

Theorem 3.10: , , R C T each satisfy matrix closure
9
A .
Proof:
Not yet written. This makes use of the morphisms | |

:
n n
n n
n
h D Q D Q


, where

Q Q n n = .
Use submonoid ordering.

4. Adjunction Networks
4.1. Review
In section II.3 a network of functors : Q D D
B
A
A B was defined satisfying the properties that (Theorems II.14, II.15,
Corollaries II.6 and II.7):
- Q
A
A
is the identity functor on DA ,
- for s A B , Q
A
B
is the forgetful functor which restricts the range of the sum operator to A -subsets and has
Q
B
A
as a left adjoint (thus making DB an Eilenberg-Moore category relative to DA ), and
- for s s A D B , = Q Q Q
A D A
D B B
and = Q Q Q
B D B
D A A
.
In addition, using the uniqueness of left adjoints to forgetful functors, we also have that for s A B , = Q
B
A
B A and

= Q
B
A
B A .

4.2. Closure Results
Since each of the natural dioid categories shares the same finite algebras, then the isomorphisms D D ~ Q
B
A
follow for
any finite dioid D . In particular, the terminal dioid 1 and initial dioid 2 remain the same in each category DA , up to
isomorphism. In particular,
( ) , , .
n n
M M n ~ ~ ~ ee Q 1 1 Q 2 2 Q
B B B
A A A

When s A B the functors
( )
, Q Q
B A
A B
form a monoidal adjunction pair which, by an argument analogous to that in
corollary 3.3, have the following natural isomorphisms
( )
, ,
,
n n
D D D D M D M D ' ' ~ ~ Q Q Q Q Q
B B B B B
A A A A A A A B A

where , D D' are A -dioids and nee. The second of these follows from
n n
M M = Q
B
A
, since the finite dioid
n n
n
M

= 2 is the same in every category, up to isomorphism.

In addition, when s A B , then for free extensions we have an isomorphism | | ( ) ( )| | D Q D Q ~ Q Q
B B
A A
, where D is an
A -dioid. This is implemented by the following two mutually inverse morphisms (omitting indices for brevity)
| | ( ) ( )| | ( )| | | | ( )
*
1
*
, : , , : , h D Q D Q k D Q D Q

i o i q o Q Q Q Q Q
B B B B B
A A A A A

where

( )| | ( )| |
( )
| | ( ) | | ( )
: , : h D Q D Q k D Q D Q Q Q Q Q Q Q
B A B B A B
A B A A B A

are identity maps defined by the forgetful functor Q
A
B
, and

| |
| | | | ( )
:
D Q
D Q D Q q= q Q Q
A B
B A

is the unit morphism for | | D Q .

4.3. Downward Extension to I
To have the structure of a monad does not require including all finite sets in natural families. We actually only need the
unit map { } m M m M e eA . Therefore,
1
A can be weakened by only requiring singleton sets to be members of a
natural family, thus resulting in the condition ( ) { }
1
:
W
m m M q = e A A , for each m M e . Then, the minimal family
F is replaced by the singleton family { } { }
: M m m M = e I , resulting in an extension of the hierarchy downward to
a family of algebras that have partially ordered monoid structures, but not necessarily an upper semilattice structure. Its
minimal member is the category DI of partially ordered monoids with monotonic monoid homomorphisms.

The corresponding functor I takes a monoid M and maps it to the partially ordered monoid M I , which has the
same underlying set M equipped with the flat-ordering, m m m m ' ' s = . Conversely, the forgetful functor

I takes
a partially ordered monoid produces the monoid without the partial ordering. Correspondingly, we have the factorings


, . = = Q Q
A I
I A
A I Av I
Thus, the hierarchy of natural dioids is, itself, embedded in the network of adjunctions.

4.4. Expansion to Idempotent Power Series
Idempotency is the feature critically involved in the appearance of the partially ordered monoid structure. It is the
replacement of a sum operator by a partial ordering that made it possible to define adjunctions, grammars,
transductions for the full category of monoids, rather than just for the subcategory of free monoids. In contrast, in the
formal power series approach [2], [11], [21], addition no longer need be idempotent. Therefore, the generalization of
the monad hierarchy from dioids to semirings is not clear. However, a closer study of the history of the power series
formalism reveals a compromise.

At the outset [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 were 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
M
S : for each m M e , the unit is defined as ( )
:
M
m m q = , where
:
mm
m m M
'
' e o . For each s S e , we also have

1
M
s S e , which we may denote by s . Thus, we can write out the
decomposition
( )

m M
m m
e
| = |


which gives us the representation of each
M
S |e as a power series. For ,
M
S ' | | e , and
M
S
S ue we define,
( ) ( ) ( ) ( )
( )
( ) ( ) ( ) , ,
M
nn m
S
m n n m m
'=
|e
' ' ' || = | | u = u | |


where m M e . The summation yields the product ( )
M
u = u

. Finally, we define the lifting of each function


: f M M' to the power series algebra by
( ) ( ) : .
M M
m M
f S m f m S
'
e
|e | e



The analogues of axioms
0
A to
4
A for the semiring S are:
0S
A :
M
S
M S _ A ,
1S
A :
S S
M M _ F A , where
S
M F denotes the family of functions : M S | with finite support,
2S
A : ,
S S
M M ' ' | | e || e A A ,
3S
A :
S S S
M M ue ue

A A A and
4S
A :
( )
S S
M f M' |e | e A A , where : M M' | is a monoid homomorphism.
Finally, we can expand the hierarchy by relaxing
1S
A to
1WS
A :
( )

S
m M m m M e q eA .
The weaker axiom
1WS
A yields a minimal natural family { }
:
S
M m m M e I .

The category
S
DA is then defined analogously by
S
A -additivity and
S
A -distributivity:
( )
( ) ( )
, D ' ' |e || = | |


respectively, where ,
S
D ' | | eA . Equivalently in place of the latter, we may adopt weak
S
A -distributivity

( )
( )

, , .
S
d d d d D d d D ' ' ' | = | |e e

A
Finally, an
S
A -morphism is defined by the condition that ( )
( )
f f | = |

, where
S
D |eA .

The natural dioid families are recovered as a special case =
2
A A obtained with the finite dioid { } 0,1 S = = 2 , by
treating
M
2 synonymously with M P . When we restrict S to quantales, the power series operations all become well-
defined and the analogue
M
S
M S = P to M P is defined. Similarly, if S is a semring closed under arbitrary sums, with
infinite associativity and distributivity, then the maximal element
S
M P may be defined.

5. Further Extensions: Natural Families for Semirings
The classification of natural families
S
A , for a given semiring S , satisfying axioms
0S
A to
4S
A has remained
unresolved in this work. In general, 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 M P yields a natural family, the analogue
M
S
M S = P need not be natural, unless the semiring S is closed
under arbitrary sums, with infinite associativity and distributivity, then the maximal element
S
M P may be defined.

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
S
A , satisfying axioms
0S
A to
4S
A . Nor is it clear whether the hierarchy even extends
beyond the family
S
F of power series with finite support. In particular, the question remains unanswered here as to
what conditions are required to define analogues
S
R ,
S
C ,
S
T (for Chomsky types 3, 2 and 0 respectively).

V: A Calculus for Context-Free Expressions and Translation Expressions
The foundation is laid out here for the generalization and expansion of the Kleene algebra of regular expressions to a
new calculus for context-free expressions and translation expressions. At the center of this development is a result,
which we establish here: an algebraic reformulation and generalization of the Chomsky-Schtzenberger Theorem, in
which the notion of tensor products plays a key role.

Note: Bear in mind that this section, which has not been completed, was originally written to be presented along with
parts III and IV at the RelMiCS2012 conference, which was held in Cambridge where Isaac Newton taught.

Note to Self: Add in the opening remarks of the 2009 CFE article.

Keywords:
Chomsky-Schtzenberger Theorem, Context-Free Expression, Translation Expression, Regular Expression, Polycyclic,
Tensor Product, Dyck Language

1. Algebra, Analysis and Calculus
In this section, we develop the framework for a representation, cast in the same mould as regular expressions, suitable
for context-free languages and transductions. For the following, we will adopt the notations and conventions developed
in section III and section IV, referring to their items by prefixing them respectively by III and IV (e.g. section III,
theorem 1 is theorem III.1). In particular, we adopt the notation established in appendix IV.A for the categorical
algebra of adjunctions.

However, before proceeding, we should clarify exactly what this development involves and what a framework for
context-free expressions actually entails.

Two broad categories of mathematical theories and structures may be distinguished: those expressed in first order
logic, and in second order logic. Any first order theory may be recast as a multi-sorted algebraic theory, if necessary,
by adding an equality predicate and a Boolean type to represent predicates as operators. Thus, we may classify these
theories under the name algebra. An example of this includes affine geometry, which we may represent as a 2-sorted
algebra containing a field F , and a set A equipped with ternary operators , , a b c A a b c A e + e and
( ) , , 1 a b A f F f a fb A e e + e that represent the affine equivalents of vector addition and vector multiplication
by a scalar. Another example of an algebraic structure is the theory of ordered fields; particularly the theory of real
closed fields and algebraically closed fields.

Second order theories, on the other hand, involve predicates, operations of functions that refer to sets, functions or
other predicates. Examples include the theory of real numbers (expressed as the theory of complete ordered fields),
arithmetic (via the Peano axioms), real affine geometry (as a two-sorted theory over the real numbers) and the theory of
real manifolds. In each case, contained in the formalism are one or more axioms that stand out from the others in being
a catch-all that make a broad assertion not about individual objects, but about properties or sets. For real numbers, real
affine spaces, or real manifolds, the extra axiom makes a statement about metric space completeness. For arithmetic,
the extra axiom is the axiom of induction. Such theories contain a seemingly transcendental element and may be
classified under the header analysis.

Historically, the question arose of whether a second order theory could be completely and consistently represented in
first order logic, the most prominent case historically
18
being differential and integral calculus. Is there any system of
rules that completely accounts for what an analyst does in calculus? Calculus was formalized with the limit concept in
the 1800s, about two centuries after its formulation by Newton, Leibnitz and their predecessors. This only shifted the
spotlight of the issue onto the completeness axiom of real number theory and, in turn, on second order logic. With the
perspective of history, we can more clearly see that the primary impetus behind the finitist programme
19
, that later
came in the 20
th
century, was simply to find a way of reducing analysis to algebra, and second order logic to first order
logic. The most important application of this programme would have been to somehow eliminate the transcendental
element from the differential and integral calculus and to reduce it to algebra.

We know today that this is not possible. A first order logic has a complete formalization. (Goedels Completeness
Theorem, [9, p. 128]). A second order theory containing the Peano axioms or any other content sufficiently powerful to
embody the Peano axioms can never be completely axiomatized in first order logic (Goedels Incompletness Theorem
[9, p. 229]). The simplest and clearest statement of these results is that there is no finite first order axiomatization of the
Peano axioms from second order logic. But its important to notice that the theorem does not place limitations on
mathematics, itself. Rather it drives a permanent wedge between first and second order logic, between the two major
branches of mathematics and the two forms of logic. Analysis is not algebra, and Calculus does not reduce to a system
of first order rules.

In 2008, in [15], [16], we established a framework for second order formalisms suitable for representing a hierarchy of
categories that contain the dioids (= idempotent semirings), *-continuous Kleene algebras, and unital quantales. Each

18
Whether the same things which are now done by infinities may not be done by finite quantities [1, Question 54].
19
Represented, for instance, by [29].
category DA is defined in terms of a functor that associates each monoid M with a distinguished family of subsets
M A . The objects in the category are called A -dioids. Each such algebra D has the structure of a partially ordered
monoid in which (a) every subset A D eA has a least upper bound A D e

, (b) distributivity holds between two


such subsets, ( )
( ) ( )
AA A A ' ' =

, for , A A D ' eA . The morphisms : f D D' of this category are order-
preserving morphisms that (c) are additive with respect to such subsets, ( )
( )
a A
f a f A
e
=

for all A D eA . The
result is a second order theory for the category DA containing three Peano-like axioms.

In some cases, we can reduce the theory to a first order formalism. Defining, M I and M F respectively as the families
of singleton and finite subsets of M , the categories DI and DF are respectively equivalent to the categories of
partially ordered monoids (with order-preserving morphisms) and dioids (with dioid morphisms). These formalisms are
completely expressible in first order logic. Corresponding to this are the formal language families that (for I )
comprise a single-element language and (for F ) a finite language.

For the rational subset family M R , the associated language family, of course, are the regular languages or type 3
in the Chomsky hierarchy, and the corresponding theory is the category of *-continuous Kleene algebras, We know
now that there is a first-order formalism [19] whose free algebras coincide with the free elements
*
X R of the category
DR the theory of Kleene algebras. But we also know there is no first order formalism that characterizes the
subcategory comprising the objects M R , because the conditional word problem is unsolvable for Kleene algebras
[18]
*
.

One can, in fact, go quite far with the rational subset families. For instance, let X be a finite set, let the family
*
X T of
type 0 languages be enumerated { }
0 1 2
, , , L L L , and let each language
*
i
L X _ for i ee also be enumerated
{ }
0 1 2
, , ,
i i i i
L w w w = , where
*
ij
w X e for , i j ee. Then defining { }

, , , X X p o O q = where , , , p o O q X e , we
may define a monoid
*

M X = , where is the following set of relations


{ }
: ,
i j
ij
pO o q w i j = ee . Within the
monoid M R are rational expressions
* i
i
pO o q L = that contain each type 0 language. In addition, the entire family
{ }
*
:
i
pO o q i M ee eRR is, itself, a rational family of rational subsets. Equivalence of Turing languages and of even
the subset
* *
X X _ C T , is undecidable (e.g. [30, Theorem 10.3.4], [6, section 6]). Therefore, M RR has an unsolvable
word problem and cannot be completely characterized by any finite first order axiom system.

For the context-free subset family M C , the category DC defines a variety we term the Chomsky-Schtzenberger
dioids (or CS-dioids), which in recent times has also been equivalently described as the -continuous Chomsky
algebras [13]. For the reasons just described, there can be no algebraic formalism suitable for serving as a basis for the
representation of context-free subsets in a manner analogous to the representation obtained with the Kleene algebra of
regular expressions. Therefore, in devising a representation powerful enough to have
*
X C as its free members, what
we are developing, of necessity, is not merely an algebraic theory but an algebraically-grounded framework for
analysis a calculus.

2. The Gruska-McWhirter-Yntema Approach
In the early 1970s, Gruska [14], McWhirter [25] and Yntema [31] devised essentially equivalent formalisms for
context-free languages. Each approach converged on the idea of the least fixed point operator. In the family M C , we
may define ( ) x f x as the least solution to the inequality ( ) x f x _ , where : f M M C C is a function expressible
in terms of a toolbox of algebraic primitives whose constituency was assumed to contain a minimum set of elements
(i.e. finite unions, products and finite subsets), but otherwise be open-ended
20
. The construction devised by Gruska was
given in our notation by

*
Or [19] or [20]. I lost the reference link.
20
The idea of inheriting a formalism, possibly yet-to-be developed, was built into [14, Theorem 2] and [14, Corollary 3].

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )
x f x f x f f x f f f x M =
Yntemas approach, on the other hand, started by defining the iterated substitution
( ) ( ) ( ) ( ) ( )
0 1
, ,
n n
f x x f x f f x n
+
= = ee
and expressed the fixed point operator as ( ) ( )
n
n
x f x f
ee
= C , this being called the cap expression. Finally,
McWhirters approach was a non-linear generalization of the Kleene star ( ) ( ) ( )
*
f y x f x y = , since this made
possible a more direct characterization of both the regular languages and linear languages.

It is possible to generalize these approaches by permitting multivariate functions :
n n
f M M C C and considering
simultaneous fixed points ( )
n
x M f x e C . This is the approach taken by sik and Leiss [12] in the more general
context of semiring theory: the formulation of a multivariate fixed-point calculus.

However, these attempts at constructing a representation for context free languages along these lines have failed to find
a representation as transparent and elegant as that used for regular expressions. As Gruska wrote in the introduction, in
anticipation of his own work and that of his contemporaries, one can hardly expect to get a characterization of CFLs
so elegant and simple as the one we have developed for regular expressions.

The approach based on fixed-point operators to solving systems of equations representing context free grammars was
analogous to the method for solving a division problem, such as 3 4 x = , by writing 4 3 x = . Whats missing is the
extra step that allows us to write 1.333 x = . For example, consider the language
{ }
: 0
n n
L u v n M = > eC , where
{ }
*
, M u v = . The solution analogous to writing 4 3 x = is { } { } { } ( )
1 L x M u x v = e C . Is there an extra step that
corresponds to writing 1.333 x = ?

As we will see, there is a formalism that fits the characterization offered by Gruska in denial. In fact, suppose that
instead of using the algebra M C , we start with the Kleene algebra M R . Add to this algebra a set of indeterminates
{ } , , , Y b d p q = and subject them to the relations xy yx = for x M e and y Y e , along with the relations 1 bd pq = =
and 0 bq pd = = . Then, we can write
{ } { } { } ( ) { } ( ) { } ( )
* *
1 . L x a x b b u p q v d = =
That is the extra step whose inclusion is the main topic of this paper.

3. Chomsky-Schtzenberger Theorem
3.1. The Semi-Classical Formulation
The operator algebra we made brief allusion to arises as a structure buried within the classical result known as the
Chomsky-Schtzenberger Theorem ([4], [6, section 5]). What the theorem asserts is that by adding an extra set of
parentheses and requiring that they be balanced, one may express a context-free language L in terms of a regular
language

L that we term its Chomsky-Schtzenberger kernel (or CS kernel). Here, we restate the classical result for
general monoids M , making use of the monoid product to simplify our construction referring to this as the semi-
classical formulation of the theorem.

We start by affixing a new monoid ( )
*
N P Q = , with a set of left brackets { }
0 1 1
, , ,
n
P p p p

= and matching right
brackets { }
0 1 1
, , ,
n
Q q q q

= . In this construction, it is not necessary for 2 n > . If we need 2 n > bracket pairs, we
can always encode the bracket pairs, e.g.
i
i
p bp = and
j
j
q q d = for 0 , 1 i j n s < and
1
1
n
n
p p

= ,
1
1
n
n
q q

= . With
this encoding, sequences formed from P Q form properly nested bracket sequences if and only if their encodings do.
The monoid N may be equipped with involution given by the following:
( )


1 1, , , .
i i i i
uv v u p q q p = = = =
for all , u v N e and 0 i n s < .

The way we attach the monoid N to M , however, is not by free extension. Had we done so, we would be speaking of
the classical formulation of the theorem. Instead, we shall combine the two monoids by taking their common extension
modulo commutativity. As described in section III, this is precisely what characterizes the product M N . The kernel
is therefore written as a rational subset ( )

L M N _ R . To impose the bracketing constraint we first require that the


elements of

L all have properly nested bracket sequences; that is, we take the intersection ( )

L M D , where D is
the Dyck language of all properly nested sequences of brackets taken from P Q ; i.e. the language given by the
grammar
( ) 1, 0 .
i i
D D p Dq D i n s <
Then to obtain the original language, we erase the bracket symbols, i.e. we apply the monoid homomorphism
( ) : , . m n M N m M t e e
If the kernel is chosen properly, the result is the language ( )
( )

L L M D = t . These observations lead to the version


Chomsky-Schtzenberger theorem, described in Section 3.3, which we term the semi-classical formulation.

Contained in this result, as we shall see, is the kernel
21
of a representation for context-free languages cut from the same
cloth as the regular expressions. Before going on, however, it is worth pointing out a few observations. The particular
representation we shall devise has the form ( )
0 0

L p q = where the subexpression ( ) contains no occurrences of


0 0
, p q , possibly other than in the combinations
0 0
q p . For such expressions, we can equivalently write
( ) ( ) ( ) ( )
* *

, . L M C L M D C DQ D PD =
Entirely absent from the classical formulation, the importance of C shall shortly become clear.

3.2. Canonical Ordering
As a preliminary result, we require an alternate means of expressing derivation sequences. In classical theory,
derivations can be reduced to left-most or right-most form. This requires the following strengthening of the separability
condition (section III).

Lemma 3.2. Let ( ) , , G Q S H = be an algebraic grammar. Then for each
n
o| there exists derivations
n
o
' o o
and
n
|
' | | such that n n n
o |
+ = and ' ' o | = .
Proof:
Suppose
n
o| . We argue inductively. If 0 n = , then = o| , and we choose ' o = o , ' | = | and 0 n n
o |
= = .
Otherwise 0 n > , we have
1 n
q

o| , ( ) , q H o e and o = . By inductive hypothesis, we have


n
o
' o o ,
n
|
' | | , 1 n n n
o |
+ = and q ' ' o | = . Since q Q e is prime in | | M Q then either q ' o = c and ' c| = or
q ' | = c and ' o c = . In the former case,
1 n
o
+
o oc by
R
H and
1 n n
o |
+ +
' o| oc| = o by C . In the latter
case,
1 n
|
+
| co by
R
H and
1 n n
o |
+ +
' o| o co = o by C .
QED

Using this result we have the following.

Theorem 3.3. Let ( ) , , G Q S H = be an algebraic grammar over a monoid M containing a generating subset X . Then
H
m M o e iff
L
H
m o iff
R
H
m o , where
{ } , L R
H
are the closures under C , R and T of the following sets
of one-step derivations:
(Shift)
L
H
x x
R
H
x x x X e
(Generate)
L
H
o |
R
H
o | ( ) , H o | e

21
Pun intended.
Proof:
One direction is immediate: if
{ } , L R
H
o| o then
H
o| o. For the converse, we may establish inductively that
from
n
H
m M o e follows
L
H
m m m ' ' o| | for all m M ' e and
| | M Q |e , with a similar argument applying to
show that
R
H
m mm ' ' |o | . For 0 n = , m o = and we use repeated applications of Shift. Otherwise, for 0 n > , we
have q o = , ( ) , q H e and
1 n
H
m

. By Lemma 3.2, we have


n
m

,
n
m

, m m m

= and
1 n n n

+ = . Then
L
H
m q m m q

' ' | |, by inductive hypothesis,


L
H
m m q m m

' ' | | by application of
Generate and
L
H
m m m m m

' ' | | again by inductive hypothesis.
QED

3.3. The Semi-Classical Chomsky-Schtzenberger Theorem
Theorem 3.3: Let M be a monoid. For each L M eC , there exists ( )

L M N e R such that ( )
( )

. L M D L t =
Proof:
Let ( ) , , , G Q X S H = be a context-free grammar over
*
X such that ( ) L L G = . Define { } 0 Z X Q = and associate
each z Z e with a pair of brackets ,
z z
p q . Extend this notation to , p q
o o
for
*
Z oe by setting 1 p
c
= , p p p
o| o |
=
and

q p
o o
= for
*
, Z o |e , where we use c to denote the empty word in
*
Z . Then the kernel is given directly in
terms of the grammar by

( )
( )
*
0 0
,

, , .
S x q
x X q H
L p p X H q X q x H q p
o
e o e
= = =



The algebraic nature of this result has apparently eluded notice up to now. To better understand what it is, note first
what the filtering operation is doing. The non-membership of a word v N e in C requires that v not be contained
inside any properly nested sequence of brackets. This may only occur if and only if v has an unbalanced subword; i.e.,
a subword of the form
i j
p dq , where d D e and i j = . Therefore, the operation

L N L _ , which yields subsets
of N that we called reduced, may be characterized by the removal of
i i
p q pairs and the elimination of anything that
involves clashing pair
i j
p q where i j = .

So, this is where the hidden algebraic structure emerges. Define the following reduction on { } N C I ,
{ }
i j ij
p q ~ o ,
where we introduce the Kronecker delta

{ } ( )
( )
1 ,
.
ij
i j
i j
=

o

C =


We extend this relation as a quantale congruence on N P by taking its closure under products and arbitrary unions. In
particular, since the reduction is length-reducing, each singleton { } n for n N e has a normal form n N e C I .
From this, we may define the normal form of a subset U N eP by
.
n U
U U n
e
~

Where do the normal forms of this reduction lie? First consider the regular set
* *
Q P and its complement
* *
. N Q P NPQN = Every singleton { } n taken from elements n NPQN e has a redex, while none of those from
* *
Q P do. As we shall see, the inverse image of { } 1 , under the reduction, is just D , itself, while that of
* *
Q P is C .
The compliment NPQN has, as its inverse image NPDQN . In particular, to
i j
Np q N corresponds
i j
Np Dq N , which
reduces to
ij
No . This leads to a partition of N into the union of subsets of the forms
{ } , q q p p DqD Dq DpD Dp D ' ' ' ' (


and the remaining subset

| | .
i j
i j
N C Np Dq N
=
C = =
We shall prove these points by establishing inductively (Lemma 3.4) that for every non-empty U D _ , { } 1 U ~ , while
(Lemma 3.5) the reduction
{ } { }
i j ij
np q n nn ' ' ~ o preserves the class membership of both the left-hand and right-hand
sides, where , n n N ' e . As a consequence, it follows that every U N eP is partitioned into equivalence classes through
which its normal form may be expressed as a binary idempotent power series:
{ } { }
* * * *
, , Q P Q P
U U U U U
C o| o|
oe |e oe |e
~ C o| = o|
where

{ } | | ( )
| | ( )
1 ,
.
z
U z
U
U z

= C

=

C = C


Note, in particular, that U U C = . The filtering operation of the Chomsky-Schtzenberger theorem is part of the
construction. Finally, we may extend the reduction and equivalence relation to M N by simply taking
{ } { } mn m n = , for m M e and n N e . Correspondingly, each subset T M N _ has an idempotent power series
(with coefficients in the quantale M P ) as a normal form:
{ } { } { }
* * * *
, , Q P Q P
T T T T T
C o| o|
oe |e oe |e
C o| = o|
where now { } ( )
z
T T M z = . By virtue of our construction, it follows that ( ) T T M C = . In addition, we
have ( ) ( ) ( )
T M D T M D = t .

So, now at last we come to the proof. Using Lemma 3.3, we may establish by induction over 0 p > that

( ) { }
0 0

: .
p
L p
H
p p X H mp p m
o |
+ = o |
Using *-continuity, we then have

( ) { }
*
*
0 0

:
L
H
p p X H mp p m
o |
+ = o |
and, upon application of
0
q to the right,

( ) { } { } | |
*
* *
0 0 0 0

: : .
L L
H H
p p X H q mp p q m m m
o |
+ = o | = o = o
Thus ( ) | | ( )

. L L G S L L C L D L D = = = = = = t
QED

3.4. The Algebraic Underpinning to the Chomsky-Schtzenberger Theorem
Lemma 3.4: For every non-empty U D _ , { } 1 U ~ .
Proof: By additivity, we are reduced to proving that { } { } 1 d ~ for each d D e . This is a trivial induction over the
defining grammar of D : either 1 d = , in which case the reduction becomes trivial, or
0 1 i i
d p d q d = , where
0 1
, d d D e ,
in which case we have by inductive hypothesis { } { } { }
0 1
1 d d ~ ~ . Then
{ } { }{ }{ }{ } { }{ }{ }{ } { } { }
0 `1
1 1 1 .
i i i i i i
d p d q d p q p q = ~ = ~
QED

As a consequence, we have the following reductions. For any u Dq q Dp p D ' ' e , we have a reduction of the form
{ } { } { } { } 1 1 1 . u dq q d p p d q q p p q q p p ' ' ' '' ' ' ' ' = ~ ~
Hence, each non-empty { } U ( _ o|

reduces as { } U ~ o| . Second, for any
i j
u Np Dq N e , where i j = , we have a
reduction of the form
{ } { } { }{ }{ } { } { } .
i j i j
u np dq n n p q n n n ' ' ' = ~ ~ C = C
Thus, each subset | | U _ C reduces as U C.

Lemma 3.6: If nn D ' e then { } ne o (

and
{ }

n
( ' e o

, for some
*
P oe .
Proof: We argue inductively over the length of elements nn' of D . In the trivial case, 1 nn' = , which yields the
unique factoring 1 n n' = = and correspondingly 1 o = . Otherwise, we have a reduction
0 1 i i
nn p d q d ' = for some i n e
and
0 1
, d d D e , which results in one of the factorings

0
0 1
0 0 0
0 1 1 1
0 1
1
: , : , : .
i
i i
i i
i
n p n
n n p d q n
n n d D
n p d q d n n d D
n n q d
=
= =
' = e
` ` `
' ' = = e
) )

' ' =
)
1 2 3
In case 1, we have { } 1 ne (

and { } 1 n D ' e = (

, so we may again choose 1 o = . In case 2, by inductive assumption,
we have { }
0 0
n ( e o

and
{ }

0 0
n
( ' e o

, for some
*
0
P o e . From this, it follows that
{ } { } { } { } { } { } { }

0 0 0 1 0 0
, 1 ,
i i i i i
n p n p n n q d q q ' ' = ~ o = ~ o = o
which yields the desired result with the choice
0 i
p o = o (and consequently,

0 i
q o = o ). Finally, for case 3, again by
inductive assumption, we have { }
1
n e o (

and
{ }
n
(
'
' e o
(

for a suitable choice of
*
P oe . Thus, it follows that
{ } { } { } { }
0 1
1
i i i i
n p d q n p q = ~ o ~ o
so that we may use the same o for the pair nn' as we do for the pair
1
n n' .
QED

Lemma 3.5: For each , n n N ' e , if { } | |
ij
nn z ' o e then
{ } | |
i j
np q n z ' e .
Proof: The case where i j = is trivial: for both sides of the equivalence z = C. Therefore, assume i j = . To complete
the proof, we use the decomposition property in Lemma 3.6, so that we may factor each | | nn' e o| , where
*
Q oe and
*
P |e must into one of the following two ways:
| |
{ } { }
{ } { }
*
*
, , , ,
, , , .
n n Q
nn
n n P
+
+

(
' ( e c e co| c e o = o


' e o|

(
' ( e oc e c o c e | = o


Similarly, using Lemma 3.6, we may factor each | | nn' e C in one of the following three ways:
| |
| |
{ } { } ( )
| |
*
, ,
, , ,
, .
i j
n N n
nn n N p n q N P i j
n n N
' e e C

(
' ' ( e o| e o e o oe =

' e C e



Note that since the Dyck language satisfies the identity DD D = , we have the following identities

{ } { } { } { } { } ( )
{ } { } ( )
* * * *
*
, , ,
1 .
Q Q P P
D Q
( ( ( ( ( o| = o| = o | oe |e e

(
( oo _ = oe



Therefore, from each of the factorings we may carry out the following constructions

{ } { } { }
{ } { } { }
{ } ,
i i
i i
i i
p q
np q n
p q
+ +
+ +

( (
( c co| _ c co| _ o|


' ( e = o|
`

( (
( oc c o _ occ o _ oo


)

and

{ } | | | |
{ } { } { } | |
| | { } | |
| |

.
k k
k k i k k j i j i j
k k
N p q N
np q n N p p q q N N p q N N p q N N N
p q N N

( C _ C



( ( (
' e o o _ oo _ _ C = C
`


( C _ C
)

QED

Since the only normal forms are | | C and { }
( o|

, for
*
Q oe and
*
P |e , then lemma 3.4 and lemma 3.5 together
show that N is covered by the equivalence classes given by these normal forms. To prove the covering is a partition
requires showing that none of the equivalence classes overlap and coincide. The relations | | { }
( C o| = C

are trivial.
To determine the intersections { } { }
' ' ( ( o| o |

, note that if
*
, Q ' o o e and
*
, P ' | | e and ' ' o | ~ o|, then it would
follow that

D ' ' o o | | ~ o o|| e , and therefore that

D ' ' o o | | e , from which it must follow that ' o = o and

' | = | for some


*
Q e . Similarly, wed have ' ' o = o and

' ' | = | for some


*
Q ' e , and therefore that
' o = o . This is not possible unless 1 ' = = . Therefore, ' ' o| = o | .

The role that subset ( ) ( )
* *
C DQ D PQ = plays throughout is that it is the language of subwords taken from D .
Similarly, as weve just seen, ( )
*
DQ D and ( )
*
D PQ respectively comprise the prefixes and suffices of words taken
from D .

The foregoing suggests the matrix interpretation of the elements of M N . Using the partition formula, we have
(with a slight abuse of notation, and a suitable extension of the Kronecker delta notation)

( )
( )
( )
* *
* *
* *
1
,
1
,
1 1
,
, , ,
, , ,
, , .
p
Q P
q
Q P
Q P
p p p p P
q q q q Q
m m m m m M
o| o| o |
oe |e
o| o| o |
oe |e
o| o| o |
oe |e
= o| = o o e
= o| = o o e
= o| = o o e


Matrix addition may be defined componentwise. However, the definition of the matrix product is not trivial. The
product o|o|, where
*
, Q o oe and
*
, P | |e , may decompose in one of three ways, based on the relation between |
and o . If

' | = | o , then the product is ' o| | . If

' o = | o , the product is ' oo | . Otherwise, if no such factoring


relations exist, the product is just C. Thus, we have the following reduction

( )
( )
( )
( ) ( )


, , ,
, , , , , ,
, , , , ,
.
UV U V
U V U V
U V U V
o|
o|
o | o |
o|
o| ' ' o | o | o |
' ' o | o | o | o |
' ' | | oo
| o
o| o| ' ' o | o | o |
o | ' ' | o | o o |
= o|o|
' ' = o | | + oo |
| |
| = o + o o|
|
\ .




Consequently, the formula for the product components ( ) UV
o|
is given by:
( )
( ) ( )

, , , ,
. UV U V U V
' ' | | oo
| o
o| o| o| ' ' o | o | o |
' ' | o | o o |
= o + o



The remaining sections, 3.5 and 3.6, have not yet been fully worked out.

3.5. The Algebraic Chomsky-Schtzenberger Theorem
Then, based on these considerations, we may write ( )

L M C L = , and
( )

L L = t . The inverse is given by


( ) { } ( )

,1 :
MN
L u u L L = e = , with ( ) ( ) MN
L L t = . Let _ o = denote the normal form quantale automorphism
on ( ) M N P .. Then, what we have proven is that ( ) ( ) ( )
MN
M M N _o C R , and ( ) ( ) ( )
M M N _ t o C R .

To capture this result algebraically, define the object
, n
C
A
in each category DA as the A -algebra generated from the
set P Q modulo the relations
i j ij
p q = o , where we define the Kronecker delta 1
ij
o = if i j = and 0
ij
o = if i j = .
Making use of our encoding, we may use the value 2 n = uniformly for all kernels

L . Denote the canonical R -


morphism for
2,
C
R
by
2,
: N C
R
R .

Using this, we may establish an isomorphism ( ) ( )
2,
M C M N ~ o
R R
R R . Through this, in turn, we obtain an
injection
2,
M M C Q
R
C R R
C R . This is what we shall prove. Then, we shall characterize the subalgebra using a
result analogous to the Schur Lemma.

Theorem 3.6. As a *-continuous Kleene algebra, the context-free subsets M C of a monoid M are mapped injectively
into the subalgebra
2,
M C
R R
R consisting of elements that commute with the elements of
2,
C
R
.

Finally, applying section III, we obtain a representation for the class of translation expressions corresponding to push
down transductions.

Corollary 3.7. As a *-continuous Kleene algebra, the push-down transductions ( ) M N C between monoids M and
N are mapped injectively into
2,
M M C
R R R
R R as the subalgebra of expressions that commute with the
elements of
2,
C
R
.

3.6. The Categorical Chomsky-Schtzenberger Theorem
At this point, the result obtained applies to the Kleisli subcategory of DC. We wish to extend this to the full category.
This requires first generalizing the way by which we obtain the completion of objects K M = R in the Kleisli
subcategory of DR to objects K M ' = C in the Kleisli subcategory of DC and in turn to the same object K M = Q
R
C
C ,
regarded as a member of DR . Noting that M M = Q
C
R
R C , we define K K ' = Q
C
R
and K K K ' = = Q Q Q
R R C
C C R
. Then,
the theorem we seek to establish is that K is mapped injectively into
2,
K C
R R
as the subalgebra of expressions that
commute with elements of
2,
C
R
.

To prove this requires establishing a normal form and calculus on
2,
K C
R R
o . We do this, making use of a
representation of this tensor product as idempotent power series over
2,
C
R
with coefficients in K .

4. Conclusions
As mentioned in the concluding section of [16] and the close of section II: classically, attempts at extending the process
of algebraization beyond the type 3 level in the Chomsky hierarchy (i.e. the regular languages and the corresponding
algebra of regular expressions) to the type 2 level did not yield a framework that found application as widespread as the
regular expressions did for instance, no context-free-expression version of GREP. The renewed progress weve
begun to see in more recent times in this direction [12], [13] was still built essentially on the same basis as the older
formalisms, although in the latter case [13], a second order algebraic formalism equivalent to the one presented in [15],
[16] was devised, but with a result weaker than that derived in [15]. In essence, the problem was solved in the same
way the division problem 4 3 is solved by decreeing the solution to be 4 3 . Although it is true we can formulate
axioms that pin down the behavior of this solution, e.g.
( ) ( ) 1 , 1, a a a a a c b c a b = = =
which is suitable for defining an inverse ( )
1
a a a a

= and (possibly non-commutative) product


1
ab a b

= of a
group; or
( ) ( ) ( ) , a a b b a b c c b a = =
which suffices for defining a commutative product of an Abelian group, and we can carry out a similar process (at least
in the framework of second order logic) for the type 2 level in the Chomsky hierarchy; it still fails to take the extra step
required to obtain the analogue of the result 4 3 1.333 = . The absence would have been just as acutely felt in the
case of division: wed be using pairs of integer numerals (or maybe finite sequences of integer-valued numerals for
prime exponents) instead of fixed point or floating point numerals for computer programming. Instead of FPU add-ons
to CPUs, wed have ZZPU add-ons (zwei zahlen co-processing units). By analogy, instead of a utility like CEX (for
doing pattern-matching on context-free expressions), wed have to content ourselves with much less powerful and
satisfactory utilities like REX (for regular expression matching) or an even less functional utility, like GREP
without even realizing how much were missing out on by living in a world without CEX.

However, as it turns out, a significant step in this direction had already been taken early on [6]: the Chomsky-
Schtzenberger theorem for context-free languages. Yet, no theory of context-free expressions arose from it, because
its algebraic underpinning largely eluded attention up to now. As we have seen here, there is indeed a representation
analogous to the regular expressions suitable for the context-free subsets of monoids. This includes not only free
monoids (i.e. context-free languages), but products of monoids (push down transductions). We have only touched on
the outlines of this representation. The full development of these ideas lies outside the scope of this paper, as does the
full realization of a world with CEX.

References
[1] Berkeley: The Analyst. In: Men of Mathematics, Volume 1, 288-293.
[2] J. Berstel, C. Reutenauer: Les Sries Rationelles et Leurs Langages. Masson (1984). English edition: Rational
Series and Their Languages. Springer-Verlag (1988).
[3] G. Birkhoff: Lattice Theory. American Mathematical Society (1967).
[4] N. Chomsky, Context-free grammars and pushdown storage, Quarterly Prog. Report No. 65, MIT Research
Lab. in Electronics, Cambridge, 187-194, (1962).
[5] N. Chomsky: Three Models for the Description of Language. IRE Transactions on Information Theory 2, 113-
124 (1956).
[6] N. Chomsky and M. P. Schtzenberger: The algebraic theory of context-free languages. In: P. Braffort and D.
Hirschberg (eds.): Computer Programming and Formal Systems, 118-161, North Holland, Amsterdam (1963).
[7] J. H. Conway: Regular Algebra and Finite Machines. Chapman and Hall, London (1971).
[8] B. A. Davey, H. A. Priestley: Introduction to Lattices and Order. Cambridge University Press (1990).
[9] H. B. Enderton: A Mathematical Introduction to Logic, Academic Press, New York and London (1972).
[10] Z. sik and M. Ito: Temporal logic with cyclic counting and the degree of aperiodicity of finite automata. Acta
Cybernetica 16, 1-28 (2003).
[11] Z. sik, W. Kuich: Rationally Additive Semirings. Journal of Computer Science 8, 173-183 (2002).
[12] Z. sik, H. Leiss: Algebraically complete semirings and Greibach normal form. Ann. Pure. Appl. Logic. 133,
173-203 (2005).
[13] N. Grathwohl, F. Henglein, D. Kozen, Infinitary Axiomatization of the Equational Theory of Context-Free
Languages, in D. Baelde and A. Carayol (Eds.): _Fixed Points in Computer Science_ 2013 (FICS 2013),
EPTCS ??, 2013 pp. 44-55
[14] J. Gruska: A Characterization of Context-Free Languages. Journal of Computer and System Sciences 5, 353-364
(1971).
[15] M. W. Hopkins: The Algebraic Approach I: The Algebraization of the Chomsky Hierarchy. RelMiCS/AKA
2008, LNCS 4988, 155-172 (2008).
[16] M. W. Hopkins: The Algebraic Approach II: Dioids, Quantales and Monads, RelMiCS/AKA 2008, LNCS 4988,
173-190 (2008).
[17] G. Huet: Logical Foundations of Functional Programming. Addison-Wesley (1990).
[18] D. Kozen, Automata and Computability, Springer-Verlag, 1997.
[19] D. Kozen: A Completeness Theorem for Kleene Algebras and the Algebra of Regular Events. Information and
Computation 110, 366-390 (1994).
[20] D. Kozen: On Kleene Algebras and Closed Semirings. In: Roval (ed.), Lecture Notes in Computer Science 452,
pp. 26-47, Springer (1990).
[21] W. Kuich, A. Salomaa: Semirings, Automata and Languages. Springer-Verlag, Berlin (1986).
[22] J. Lambek, P. J. Scott: Introduction to Higher Order Categorical Logic. Cambridge University Press (1986).
[23] S. MacLane: Categories for the Working Mathematician. Springer-Verlag (1971).
[24] S. MacLane: Natural associativity and commutativity. Rice Univ. Studies 49, 28-46 (1963).
[25] I. P. McWhirter: Substitution Expressions. Journal of Computer and System Sciences 5, 629-637 (1971).
[26] M. Mger: Tensor categories: A selective guided tour. arXiv: 0804.3587v3 [math.CT] (18 Jun 2010).
[27] H. Straubing: On logical descriptions of regular languages. LATIN 2002, LNCS 2286, 528-538 (2002).
[28] J. Von Neumann: The General and Logical Theory of Automata. In: J. R. Newman (ed.): The World of
Mathematics, Volume 4, Simon and Schuster, 2070-2098 (1956).
[29] A. N. Whitehead, B. Russell: Principia mathematica. Cambridge. I (2nd ed.) (1925), II, III (1927).
[30] D. Wood: The Theory of Computation. Harper and Row (1987).
[31] M. K. Yntema: Cap Expressions for Context-Free Languages. Information and Control 8, 311-318 (1971).

A. Adjunctions, Monads and Co-Monads
A.1. Adjunctions
A pair of functors, : E M D and : U D M between two categories M and D is adjoint when there is a natural
bijection between morphisms : f M D U and : F M D E . If the morphisms f F correspond in this way, we
write
*
F f = and
*
F f = . Note the identities
( )
*
*
f f = and
( )
*
*
F F = . For the bijection to be natural means that
there is consistency with the composition, i.e.

( ) ( )
( ) ( )
*
*
*
*
: , : ,
: , : .
g h g h g M D h M M
F G F G F D D G M D
' =
' =
E U
U E

Under these conditions, E is left-adjoint to U, which is right-adjoint to E, the pair is denoted ( ) , E U or | E U and
is referred to as an adjunction pair.

ADD
( ) , : c q E U

For a given adjunction, the unit ( )
*
1 :
M M
M M q = E T and co-unit ( )
*
1 :
D D
D D c U L respectively yield
natural transformations : q
M
1 T U E and : 1 c
D
L E U , by virtue of the identities
( ) ( )
*
*
, ,
M M D D
f f f F F F
' '
q = = q c = = c E T L U
where : f M M' and : F D D' . Conversely, the natural correspondence between : f M D U and
: M D F E can be recovered from the unit and co-unit by the identities

*
and .
D * M
f f F = F = c q E U
For this, one needs the co-unit equations or zig-zag equations:
1 and 1 .
M M M D D D
c q = c q =
E U
E E U U
The resulting adjunction is equivalently specified by the quadruple ( ) , , , q c E U and denoted ( ) , : | c q E U.

Conditions for adjointness can be stated for each functor without reference to the other. A functor : E M D is a left-
adjoint if to each De D can be assigned a terminal morphism
*
:
D
D D c E from some object
*
D e M . That is, all
morphisms of the form : f M D E factor through it, i.e.
*
D
f f = c E for some morphism
* *
: f M D . When a
right-adjoint U exists, it is uniquely specified (up to equivalence) as the functor for which
*
D D = U , with
D
c the
corresponding co-unit and
*
f the natural bijection.

Similarly, functor : U D M is a right-adjoint if to each M e M can be assigned an initial morphism
*
:
M
M M q U from some object
*
M e D . The defining condition is that every other morphism : F M D U
should factor into
* M
F F = q U . When a left-adjoint E exists, it is uniquely characterized (again, up to equivalence)
as the functor for which
*
M M = E , with
M
q becoming the unit, and
*
F the natural bijection.

A.2. Monads and Co-Monads
For the category M, a self-contained structure ( ) , , q T , called a monad, can be defined for the endofunctor
: T M M, with the introduction of the product ( )
*
1
M M M
= c
E
U T U . By the identity
( ) ( )
*
: ,
M M
f f f f M M
'
' = = TT U T T
this yields a natural transformation : T T T which also satisfies the two coherence conditions that play the
respective analogues to associativity and identity
( )
*
, 1 .
M M M M M M M M M M
(
= = q = = q

T T
T U T T
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
, ,
D D M M
o = c = c
U E
U T E L
and attempt to approximate the adjunction by trying to define natural transformations : 1 E
M
T and :1 A
D
L such
that
, .
D D M M
c = E q = A
U E
U E
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 constructing a minimal
adjunction from either the monad or co-monad.

A.3. Adjunctions from Monads and Co-Monads
A T-Algebra is constructed from the monad ( ) , , q T as a category
T
M whose objects are the morphisms
:
M
M M E T that satisfy
, 1 .
M M M M M M M
E = E E E q = T
The morphisms :
M M
F
'
E E are the subclass of morphisms : F M M' for which
M M
F F
'
E = E T . This is
enough information to define the functor E by
( ) ( ) , : .
M
M M f f f M M' = e = E M E T
In addition, the functor U may be defined by
( ) ( ) , : .
M M M
M M F F F
'
E = e = E E U M U
The natural operations are given by
( ) ( )
*
*
: , : .
M M M M
f f f M M F F F
' '
' = E = q E E T

These definitions suffice to recover an adjunction, the identity = T U E, and a co-monad structure given by
.
M M
M M E E
o = q c = E T
The category
T
M is referred to as an Eilenberg-Moore category of the monad ( ) , , q T , and its members as
Eilenberg-Moore algebras, or just T-Algebras. The full subcategory of free algebras
M
M M = TT T yields a
category
T
M called the Kleisli category of the monad ( ) , , q T . An adjunction that (up to equivalence) arises from a
T-algebra construction is referred to as monadic.

The analogous construction for a co-monad ( ) , , o c L is a category
L
D whose objects are the morphisms :
D
D D A L
satisfying
1 .
D D D D D D D
o A = A A c A = L
Its morphisms :
D D
f
'
A A are the morphisms : f D D' for which
D D
f f
'
A = A L . The functors are defined by

( ) ( )
( ) ( )
, : ,
, : .
D
D D D
D D F F F D D
D D f f f
'
' = o e =
A = e = A A
U D U L
E D E

The natural correspondences are given by
( ) ( )
*
*
: , : .
D D D D
f f f F F F D D
' '
' = c A A = A L
Finally, the corresponding monad operators are
, ,
D
D D
A
A A
= c q = A L
and we recover the factoring = L E U.

A.4. Natural Dioids and Natural Semirings
In section 2, we laid out the construction for natural dioid family A as an adjunction between = M Monoid and
= D DA , and actually as a T-algebra for M with functors = = E T A and

= U A . For the category M this led to the


following definitions
( ) ( ) ( ) ( ) { }
*
, , , , .
M M
M M M f f f f U f U m m = = = = = = q =

E T E T A Y Y
\For the category D the corresponding data were given by
( ) { } ( ) ( ) { } { } ( )
*
, , , : , .
D D
D D F F F F m F m U u u D U U = = = = o = e c =

U L U L

Properties
0
A ,
2
A and
4
A yield the functor T,
1
A the unit q, and
3
A the product . As we mentioned in section
4.3, one needs only the weaker property
1W
A to be able to define the unit morphisms. With this extension, the result is
a larger hierarchy that goes beyond the additively closed structure of dioids and includes the partially ordered monoids.
This construction generalizes to arbitrary semirings S , yielding a hierarchy of monads
S
A . The dioid hierarchy
corresponds to the special case =
2
A A constructed from the dioid 2 . In place of property
0
A , we assume
0S
A : that
M
S
M S _ A . The remaining properties
1WS
A ,
1S
A ,
2S
A ,
3S
A and
4S
A are then defined by analogy.

You might also like