You are on page 1of 25

Coequalizers and Tensor Products

for Continuous Idempotent Semirings

Mark Hopkins
UW-Milwaukee (Alumnus)
USA

Hans Leiß
Ludwig-Maximilians-Universität München (retired)
Germany

RAMiCS 2018, Groeningen, 29.10.–1.11.2018

1 / 25
Motivating question

The context-free languages CX ∗ over X can be obtained from the


regular languages R(X ∪ Y )∗ of an extended alphabet X ∪ Y :

Theorem (Chomsky/Schützenberger 1963)


˙ , where
Consider an alphabet X ∪Y
I Y = {b, d, p, q} consists of two pairs b, d and p, q of brackets,
I D ⊆ (X ∪ Y )∗ the Dyck-language of well-bracketed strings
I h : (X ∪ Y )∗ → X ∗ the bracket-erasing homomorphism.
Then CX ∗ = { h(R ∩ D) | R ∈ R(X ∪ Y )∗ }.
Thus, CX ∗ is an algebraic/set-theoretic function of R(X ∪ Y )∗ .
Question: Is CX ∗ a (algebraic?) function of RX ∗ alone?

2 / 25
Content

We provide some algebraic infrastructure to attack the question.

I Monadic operators A : Monoid → D := Dioid


I The subcategory DA of D of A-dioids and A-morphisms
I Congruences and coequalizers
I Tensor product
I Application to the motivating question

In the paper also:


I Coproduct
I Free extension

3 / 25
Monadic operators A : M → D
Let M be the category of monoids (M, ·, 1) and homomorphisms.
Let D be the category of idempotent semirings (dioids)
(D, +, ·, 0, 1) with semiring homomorphisms as morphisms.
Each dioid D implicitly has a partial order ≤ defined by

d ≤ d 0 ⇐⇒ d + d 0 = d 0 .

The power-set functor P : M → D assigns to a monoid M a dioid

PM = (|PM|, ∪, ·, ∅, {1}), where


A · B := { a · b | a ∈ A, b ∈ B },

and to each homomorphism f : M → N a dioid-homomorphism

Pf = λA { f (a) | a ∈ A } : PM → PN.

4 / 25
A monadic opertor A (Hopkins 2008) is a subfunctor of the
power-set functor P : M → D that satisfies, for each monoid M,
A0 AM is a set of subsets of M: AM ⊆ PM,
A1 AM contains each finite subset of M: FM ⊆ AM,
A2 AM is closed under product (hence a monoid),
A3 AM is closed under union of sets from AAM (hence a dioid),
A4 A preserves homomorphisms: if f : M → N is a homo-
morphism, so is Af := λU { f (u) | u ∈ U } : AM → AN.

Remark: Each monadic operator A : M → D is the left adjoint of


an adjunction between M and a subcategory DA of D.

5 / 25
Example
The power set operator P is monadic; DP is the category of
quantales with unit.
Let F assign to each monoid M its finite subsets. Then F is
monadic; DF is the category D of dioids.

Example
For infinite cardinal κ, Pκ M = { X | X ⊆ M, |X | ≤ κ } is a
monadic operator; DPℵ0 is the category of closed semirings.
For regular cardinal κ, Fκ M = { X | X ⊆ M, |X | < κ } is
monadic; (A3 ) corresponds to regularity.

6 / 25
Example
The sets RM, CM and T M of all regular, context-free and Turing
subsets of a monoid M can be defined via grammars.
For a grammar G = (Q, S, P) of type A ∈ {R, C, T } over X 1 ,
define L(G ) ⊆ X ∗ and

AX ∗ := { L(G ) | G is a grammar of type A over X }

as usual. With the canonical homomorphism h : M ∗ → M, put

AM := { h(L) | L ∈ AM ∗ }

Hopkins 2008: F ≤ R ≤ C ≤ T ≤ P are monadic operators.

1
with finite P ⊆ Q × (QX ∪ X ), Q × (Q ∪ X )∗ , Q + × (Q ∪ X )∗ , respectively
7 / 25
The category DA ⊆ D of A-dioids

An A-dioid is a partially ordered monoid M = (M, ·, 1, ≤) which is


P
I A-complete: every U ∈ AM has a supremum U ∈ M, and
P P P
I A-distributive: for all U, V ∈ AM, (UV ) = ( U)( V ).
A map f : M → N between partially ordered monoids is
A-continuous, if for all U ∈ AM and n > (Af )(U) there is some
m > U with n ≥ f (m), where x > X means that x is an upper
bound of X .
An A-morphism is an A-continuous monotone homomorphism.
Let DA be the category of A-dioids with A-morphisms.

8 / 25
Prop. (i) Every A-dioid (M, ·, 1, ≤) is a dioid (M, +, ·, 0, 1) via
X X
a + b := {a, b}, 0 := ∅.

(ii) For f : M → N between A-dioids M, N:


X X
f is A-continuous iff for all U ∈ AM: f ( U) = (Af )(U)

We treat A-dioids in the dioid-signature: D = (D, +, ·, 0, 1).

Prop. For monoids M, AM is the free A-dioid generated by M.

Theorem
Hopkins 2008: DR is the category of ∗ -continuous Kleene algebras.
Previous talk: DC is the category of µ-continuous Chomsky algebras.

9 / 25
A monadic operator A is the left adjoint of an adjunction
(A, A,
b η, ) : M → DA between M and DA, where

I Ab : DA → M is the forgetful functor, and if M ∈ M, D ∈ DA,


P
I ηM : M → AM is m 7→ {m}, D : AD → D is U 7→ U.

This adjunction gives rise to a monad TA = (Ab ◦ A, η, µ), an


endofunctor Ab ◦ A : M → M, where
I the unit η : I → A maps m ∈ M to {m} ∈ AM,
S
I the product µ : A ◦ A → A maps U ∈ AAM to U ∈ AM.
Ab is called a monadic functor in category theory.

10 / 25
The monad T = TA : M → M of the adjunction A : M  DA : Ab
gives rise to an Eilenberg-Moore category MT of T -algebras.
A T -algebra hM, hi consists of an object M and a morphism
h : TM → M of M such that

1M = h ◦ ηM : M → M, and h ◦ (Th) = h ◦ µM : TTM → M.

A T -algebra morphism f : hM, hi → hM 0 , h0 i is a morphism


f : M → M 0 in M such that

f ◦ h = h0 ◦ (Tf ) : TM → M 0 .

Theorem
The comparison functor K : DA → MT is an isomorphism, where
b P : TD
KD = hD, D
b → Di,
b K (f : D → D 0 ) = f : D c0
b →D

11 / 25
Coequalizers
For a dioid D and U, V ⊆ D, put U ' V : ⇐⇒ U ≤ = V ≤ , where

U ≤ := { d ∈ D | d ≤ u for some u ∈ U },

For a dioid-congruence ρ on D, the set D/ρ of congruence classes


is a dioid under the operations defined as expected.
An A-congruence on an A-dioid D is a dioid-congruence
P ρ 0s.th.
0 0
P
for all U, U ∈ AD, if U/ρ ' U /ρ, then ( U)/ρ = ( U )/ρ.

Lemma
Let q : D → Q be an A-morphism between A-dioids D, Q. Then

ker(q) := { (a, b) | q(a) = q(b), a, b ∈ D }

is an A-congruence on D.
For any E ⊆ D × D, there is a least A-congruence on D above E .
12 / 25
Prop. If D is an A-dioid and ρ an A-congruence on D, then D/ρ
is an A-dioid and the canonical map d 7→ d/ρ is an A-morphism.

Proof.
D/ρ is A-complete: Each U 0 ∈ A(D/ρ) is U/ρ for some U ∈ AD.
Since ρ is an A-congruence,
X X
U 0 := ( U)/ρ

is well-defined, and an upper bound of U 0 = U/ρ.


Let e/ρ be any upper bound of U 0 . As {U, {e}} ∈ F AD ⊆ AAD,
we have U ∪ {e} ∈ AD. By choice of e, (U ∪ {e})/ρ ' {e}/ρ, so
X X X
(e + U)/ρ = ( (U ∪ {e}))/ρ = ( {e})/ρ = e/ρ.
P 0
U is a least upper bound of U 0 .
P
Hence ( U)/ρ ≤ e/ρ, and

13 / 25
A coequalizer of two morphisms f , g : A → B is an object Q with a
morphism q : B → Q such that q ◦ f = q ◦ g , and every morphism
q 0 : B → Q 0 with q 0 ◦ f = q 0 ◦ g splits uniquely through q as shown:

f - q
A -B -Q
g @ ˙˙
@ ˙˙
˙h 0
˙˙˙ q
@
q 0 @@
R
@
˙˙?
Q0

In M, a coequalizer of f , g : N → M consists of the quotient


monoid M/≡f ,g with the canonical map m 7→ m/≡f ,g , where ≡f ,g
is the least congruence on M above { (f (n), g (n)) | n ∈ N }.

14 / 25
Theorem
DA has coequalizers. The coequalizer of f , g : A → B is the
canonical map q : B → Q, where Q = B/ρ and ρ is the least
A-congruence on B above E := { (f (a), g (a)) | a ∈ A }.

Proof.
Q is an A-dioid and q an A-morphism. Clearly, q ◦ f = q ◦ g .
Suppose q 0 : B → Q 0 be an A-morphism with q 0 ◦ f = q 0 ◦ g .
Define h : Q → Q 0 by h(b/ρ) := q 0 (b).
This is well-defined by the lemma, since E ⊆ ker(q 0 ). Clearly
q 0 = h ◦ q, and h is an A-morphism, because q 0 is: for U ∈ AB,
X X X X
h( (U/ρ)) = h(( U)/ρ) = q 0 ( U) = { h(b/ρ) | b ∈ U }.

As q : B → Q = B/ρ is surjective, h is unique.

15 / 25
Prop. If q : M → Q is a coequalizer of f , g : N → M in M, then
Aq : AM → AQ is a coequalizer of Af , Ag : AN → AM in DA.

Theorem
Let E be a congruence on the monoid M, AE the least
A-congruence on AM above { ({m}, {m0 }) | (m, m0 ) ∈ E }. Then
AM/AE ' A(M/E ).
Proof. In M, if E ⊆ M × M is a congruence on M, then
π1 ·/E
-
M1 × M2 ⊇ hE i -M - M/E
π2

is a coequalizer. One can show that ·/AE : AM → AM/AE is a


coequalizer of Aπ1 , Aπ2 : AhE i → AM in DA. By the uniqueness
of coequalizers and the above Prop., AM/AE ' A(M/E ).

16 / 25
Tensor Product
In M, two morphisms f : M1 → M ← M2 : g are relatively com-
muting, if for all m1 ∈ M1 , m2 ∈ M2 , f (m1 )g (m2 ) = g (m2 )f (m1 ).
In a category whose objects have a monoid structure, a tensor
product of two objects M1 and M2 is an object M1 ⊗ M2 with two
relatively commuting morphisms >1 : M1 → M1 ⊗ M2 ← M2 : >2
such that for any pair f : M1 → M ← M2 : g of relatively com-
muting morphisms the diagram

>1 >
M1 - M1 ⊗ M2  2 M2
@ ˙˙
@ ˙˙
˙h
˙˙˙ f ,g
@
f @@ g
˙
@ ˙˙?
R
M
can be uniquely completed as shown.
17 / 25
Intuitively, M1 ⊗ M2 is a free extension of both objects in which
elements of one commute with elements of the other.

Example
In M, the tensor product >1 : M1 → M1 ⊗ M2 ← M2 : >2 consists
of M1 ⊗ M2 := M1 × M2 with T1 (m) = (m, 1), T2 (m0 ) = (1, m0 ).

18 / 25
Theorem
In the category DA, the tensor product of A-dioids D1 , D2 is

>1 : D1 → D1 ⊗A D2 ← D2 : >2
ˆ k , where
with D1 ⊗A D2 := A(M1 ⊗ M2 )/≡ and >k = π ◦ η ◦ >
I ≡ is the least A-congruence on A(M1 ⊗ M2 ) above
X X
E := { ({( A, B)}, A × B) | A ∈ AM1 , B ∈ AM2 },

I ˆ 1 : M1 → M1 ⊗ M2 ← M2 : >
> ˆ 2 in M of Mk = AD
b k
I η : M1 ⊗ M2 → A(M1 ⊗ M2 ) is (m1 , m2 ) 7→ {(m1 , m2 )},
I π is the canonical map U 7→ U/≡ .
The induced map of f : D1 → D ← D2 : g is
X
hf ,g (U/≡ ) := { f (a)g (b) | (a, b) ∈ U }, U ∈ A(M1 × M2 ).

19 / 25
Proof.
Let f : D1 → D ← D2 : g be relatively commuting A-morphisms.
The homomorphism ĥf ,g : M1 × M2 → D with f = ĥf ,g ◦ > ˆ 1 and
ˆ 2 , i.e. ĥf ,g (a, b) = f (a)g (b), extends uniquely to an
g = ĥf ,g ◦ >
A-morphism ĥf∗,g : A(M1 × M2 ) → D with ĥf ,g = ĥf∗,g ◦ η, by
X
ĥf∗,g (U) = { ĥf ,g (a, b) | (a, b) ∈ U }.

We have E ⊆ ker(ĥf∗,g ), hence ≡ ⊆ ker(ĥf∗,g ), so

hf ,g (U/≡ ) := ĥf∗,g (U), for U ∈ A(M1 × M2 ),

well-defines hf ,g : D1 ⊗A D2 → D.
ˆ k.
The needed properties of hf ,g ,>k follow from those of ĥf ,g ,>

20 / 25
Prop. AM1 ⊗A AM2 ' A(M1 ⊗ M2 ) for monoids M1 , M2 .

Proof (Sketch) Recall M1 ⊗ M2 = M1 × M2 and use


P P
U/≡ 7→ { ( A, B) | (A, B) ∈ U }, U ∈ A(AM1 × AM2 )
V 7→ { ({a}, {b}) | (a, b) ∈ V }/≡ , V ∈ A(M1 × M2 ).

It is known that D n×n ∈ DA for A ∈ {F, R, C, P}.


Prop. If D n×n ∈ DA, then D n×n ' D ⊗A Bn×n .

21 / 25
Return to the question: Is CX ∗ a function of RX ∗ alone?
The ρ be the R-congruence on RY ∗ generated by the equations2

bd = 1, pq = 1, bq = 0, pd = 0

Then C = RY ∗ /ρ is an R-dioid, the polycyclic R-dioid.


In C , every w ∈ Y ∗ \ {d, q}∗ {b, p}∗ is equivalent to 0 or 1.

Identify w ∈ X ∗ , z ∈ Y ∗ with their images >1 ({w }), >2 ({z}/ρ ) in


the tensor product >1 : RX ∗ → RX ∗ ⊗R C ← C : >2 .

Theorem
CX ∗ ⊆ RX ∗ ⊗R C , in the sense that for each L ∈ CX ∗ ,
X X
L= { >1 ({w }) | w ∈ L } ∈ RX ∗ ⊗R C .

2
as usual, w ∈ Y ∗ stands for {w } ∈ RY ∗
22 / 25
Corollary
Every context-free language L ⊆ X ∗ is denoted by a regular
expression over X ∪ Y in K := RX ∗ ⊗R C .

Example
For L = { u n v n | n ∈ N } ∈ CX ∗ , L = b(up)∗ (qv )∗ d ∈ K :
P

Since K is ∗ -continuous and x ∈ X commutes with y ∈ Y in K ,


X X
K 3 b(up)∗ (qv )∗ d = b( (up)n )( (qv )m )d
n m
X
n m n m
= u v bp q d
n,m
X X
= un v n = L.
n

This has implications for recognition/parsing/transduction!


23 / 25
Adding db + qp ≤ 1 to ρ in C = RY ∗ /ρ, one can show:

Theorem (Hopkins, in preparation)

I For any monoid M,

CM = { r ∈ RM ⊗R C | r commutes with each c ∈ C }.

I There is an adjuction Q : DR  DC : Q
b such that

Q D = { r ∈ D ⊗R C | r commutes with each c ∈ C }

is the “fixed-point closure” of the ∗ -continuous Kleene algebra.

24 / 25
Conclusion

We have provided some universal-algebraic infrastructure for


classes of idempotent semirings D with subset families AD where
P
I ≤ is A-complete: each A ∈ AD has a supremum A ∈ D,
P P P
I · is A-distributive: (AB) = ( A)( B) for all A, B ∈ AD.
Open questions
1. Do the results follow from known results in category theory?
2. Our A : M → D use A1 : “F ≤ A” and involve semirings. A
T -algebra construction as for DA ' MT only needs
A−1 : “I ≤ A” for IM := { {m} | m ∈ M } and also works if
D is replaced by M≤ , the partially ordered monoids. Which of
the results hold for the subcategories M≤ A of M≤ ?
3. For A-dioid D, is D n×n an A-dioid?

25 / 25

You might also like