C AHIERS DE
TOPOLOGIE ET GÉOMÉTRIE DIFFÉRENTIELLE CATÉGORIQUES
Y OSHIHIRO M IZOGUCHI
A graph structure over the category of sets and partial functions
Cahiers de topologie et géométrie différentielle catégoriques, tome 34, n
o1 (1993), p. 2-12
<http://www.numdam.org/item?id=CTGDC_1993__34_1_2_0>
© Andrée C. Ehresmann et les auteurs, 1993, tous droits réservés.
L’accès aux archives de la revue « Cahiers de topologie et géométrie différentielle catégoriques » implique l’accord avec les conditions générales d’utilisation (http://www.numdam.org/conditions). Toute utilisation commerciale ou impression systématique est constitutive d’une infraction pénale. Toute copie ou impression de ce fichier doit contenir la présente mention de copyright.
A GRAPH STRUCTURE OVER THE CATEGORY OF SETS AND PARTIAL FUNCTIONS
by
Yoshihiro MIZOGUCHICAHIERS DE TOPOLOGIE ET GÉOMÉTRIE DIFFÉRENTIELLE
CATÉGORIQUES
VOL. XXXIV-1 (1993)
R6sum6. En 1984 Raoult a
propose
une formulation des r64critures desgraphes
utilisant des sommes fibr6es dans lacat6gorie
desgraphes
et des fonctionspartielles.
Cette notegeneralise
sa m4thode et propose une structurealg4brique
degraphe
pour introduire un cadreplus general
pour les r66critures degraphes
et donner une demonstrationsimple
du th6or6med’existence de sommes fibr6es a 1’aide du calcul relationnel.
1 Introduction
There are many researches about
graph
grammars andgraph rewritings
us-ing
thecategory theory.
The structure of a directedgraph
is a functionfrom the set E of
edges
to theproduct
set V x V of the source vertices setand destination vertices set.
Ehrig[4]
characterized thegraph
grammar andrewriting
rulesusing
twopushout
squares andpushout complements
in thecategory
ofgraphs.
As thecategory
ofgraphs
is considered as a functorcategory
over thecategory
of sets andfunctions,
it becomes atopos
and has various usefulproperties.
The existence theorem ofpushout comple-
ments in a
topos including
thecategory
ofgraph
wasgenerally proved by Kawahara[7].
L6we and
Ehrig[3, 11]
also formulatedgraph rewritings using
asingle pushout
in thecategory
ofgraphs
based on sets andpartial
functions.Raoult and
Kennaway’s approach[13, 9]
was different fromEhrig’s
for-malization of
graph rewritings.
Thegraph
structure in[13]
is a functionfrom a vertex set V to the set V* of finite
strings
of vertices and Raoult definedgraph rewritings by
asingle pushout
squareusing partial
functions.This paper
generalizes
Raoult’s method. For an endofunctor on the cat- egory Pfn of sets andpartial
functions we consider agraph
structure as afunction V -> TV from a vertex set V to
TV,
where T is an endofunctoron Pfn. That
is,
we treat thecoalgebras
over Pfn. In the case TV = V*the structure is the same as Raoult’s one. We prove an existence theorem
of
pushouts
in ourgeneral settings avoiding
many kind of conditional checks and case divisionsby using
the relational calculus. The relational calcu-lus,
atheory
ofbinary relations,
has beenoriginally applied
to the area oftopology
andhomological algebra[l, 2, 5]. Recently
it has been used in thearea of
computer
science forrepresenting
the notion of nondeterminism in automatatheory [6],
thetheory
of assertion semantics ofprograms[8]
andcharacterization
ofpushouts
in thetheory
ofgraph grammars[7].
Our main result on the existence theorem of
pushouts produces
a mod-ification of Raoult’s result
[13, Proposition 5]
which lacked a condition. A counterexample
to his result isgiven.
2 Preliminary
In this
section,
we recall some relational notations andproperties
of the category Pfn of sets andpartial
functions.Let
A,
B and C be sets. When a is a subset of A XB,
we call a a relationfrom A to B and denote it
by
a : A -> B. For relations a : A - B andB :
B -C,
we define acomposite
relationa(3 :
A -> Cby a B = {(a, c)
EA X
Cl(a, b)
Ea, (b, c)
E(3
for some b EB}.
For relation a : A -B,
we define the inverse relationab #:
B - Aby ab
=((b, a)
E B xAl (a, b)
Ea}.
We
identify
a functionf :
A - B with a relation((a, f(a))
E A xBla
EA}
(the graph
off).
Theunique
function from a set X to onepoint
set 1 ={*}
is denoted
by HX :
X - 1. We define a subsetdom(a)
of A for a relationa : i A - B
by dom(a) = {a
EAl(a, *)
EaHA}
and a relationd(a) :
A - Aby d( f )
=((a, a)
E A XAla
Edom(a)}.
For two relationsa,(3 :
A -B,
a
U (3
and a n(3
denote the set union andintersection, respectively.
A
partial function
is a relationf :
A 2013Bsatisfying f # f
CidB
anddenote it
by f :
A -B,
whereidB :
B - B is aidentity
function of B. Apartial
functionf :
A - B is a(total) function
if it satisfiesidA
Cf f #.
Lemma 2.1 Let
a, a’ :
A -B,
and(3, (3’ :
B - C be relations.Lemma 2.2 Let
f :
A -B,
g : A -B,
h : B - C bepartial functions.
(1) f
is a totalfunction if
andonly if filB = QA -
Proposition
2.3(Law
ofPuppe-Calenko) If
a : A -B, B :
B - Cand q :
A - C arerelations,
thena B
n y Ca(Q
na#y).
Fact 2.4 The
category
Pfn haspushouts.
Let
be a
pushout
square in Pfn. For anyfunctions
x : B -S,
y : C -> Ssatisfying f x =
gy, there exists aunique function
t : D - S such that ht = x and ht = y, where t =hüx
ukÜy.
Lemma 2.5 For the
pushout
square in Fact2.4,
3 Graphs
overPfn
In this
section,
we introduce an abstract definition of acategory
which rep-resents
graphs
andgraph homomorphisms. Graph rewritings
aredefined by using
asingle pushout
in thecategory.
We prove a necessary and suffi- cient condition for existence ofpushouts.
Some concretecategories
ofgraphs including Raoult’s[13]
definition are shown.Let T : Pfn -> Pfn be an endofunctor. A
graph
constructedby
T is apair (A, a)
of a set A and a total function a : A -> T A. Agraph morphism
f : (A, a)
->(B, b)
is apartial
functionf : A -
Bsatisfying f b
=d( f )aT f .
The
graph category G(T)
is thecategory
ofgraphs
andgraph morphisms
associated with T.
Lemma 3.1 Let T : Pfn -> Pfn be a
functor,
a : A ->T A,
b : B -> T B and c : C -> TC totalfunctions
andf :
A - B and g : B -> Cpartial functions. If fb= d( f )aT f
and gc =d(g)bTg
thenfgc
=d(fg)aT(fg).
That is
G(T)
is infact
acategory.
Proof.
It follows from asimple
relationalcomputation:
Choosing
a suitable functorT,
we consider the several kinds ofgraph
structures.
Example
3.2(Kleene functor)
We define the Kleene functor * : Pfn ->Pfn as follows. Let
A, B
be setsand f :
A -> B apartial
function. *A = A*is the set of finite
strings
over A. We define* f (= f* ) :
A* -> B* as follows:An
object
ofG(*)
can be seen as a kind of directedgraph
and amorphism
of
G(*)
is anode-mapping
which preservesout-edges
but notin-edges.
Thecategory G(* )
isequivalent
to what is consideredby Raoult[13].
Example
3.3( Powerset functor)
We define the power set functor P : Pfn -> Pfn as follows. LetA,
B be sets andf :
A -> B apartial
function.P(A)
is the set of all subsets of A andP f : P(A) -> P(B)
is definedby P f (X ) - f (X ),
for all X C A. Anobject
ofG(P)
is a kind of directedgraph
in which theout-edges
of a node are not orderd and there cannot bemultiple edges
between the same nodes.Example
3.4 A setNA
of functions from A to the set N ={o, 1,...}
of natural numbers is defined
by NA
={f :
A ->NlExEAf(a)
isfinite.}.
We define the functor W : Set Set as follows. Let
A, B
be sets andf : A -
B apartial
function.W(A)
=NA
andW f : NA -> NB
is definedas
Wf (a)(y) -> E{a(x)lf(x)
= y, x EA}, (a
ENA, y E B).
Anobjects
ofG(W)
are a type ofedge-weighted
directedgraph.
We can treat labeled
graph
structurechoosing
a functor like next twoexamples.
Example
3.5(L-labeled
Kleenefunctor)
We fix a set L of labels foredges.
Wedefine
a functor(L
x-)* :
Pfn -> Pfn as follows. For a setA, (L
xA)*
is the set of finitestrings
ofpairs
of a label and an element ofA. Other definition of the functor is similar to
Example
3.2. Anobject
ofG((L x -)*)
is similar to the closed termhypergraph
ofKennaway [10].
Example
3.6(L-labeled powerset functor)
Wesimilarly
define a func-tor
P(L x -) :
Pfn - Pfn likeExample
3.3 andExample
3.5.Theorem 3.7 Let
f : (A, a)
-(B, b) and g : (A, a)
->(C, c) be morphisms in G(T). If the
square fis a
pushout
inPfn,
then there exists aunique-partial function
such that hd =
d(h)bTh,
kd =d(k)cTk.
When that is so, the square(2)
is a
pushout
inG(T) if
andonly if
b =(hObTh)
u(k#cTk)
and b is a totalfunction.
Proof.
We first showf d(h)bT h
=gd(k)cTk.
Since the square
(1)
is apushout
inPfn,
there exist aunique partial
functiond : D -> TD such that hd =
d(h)bTh
and hd -d(k)cTk,
where d =(hObTh)
u(k#cTk), by
Fact 2.4. Assume the square(2)
is apushout. Graph morphisms h and k satisfys
hb =d(h)bT h
and hb =d(k)cTk.
Sinceh#d(h)=
ha, k#d(k) = k#
and(h#hUk#k)
=idD,
we have b =(h#hUk#k)d = (hUbTh)U (kbcTkl. Conversely,
assume 6 =(hObTh)
U(k#cTk). is
a total function. Let(S, s)
be anobject
inG(T),
andx: B -> S, y : C -> S morphisms
inG(T) satisfying f x
= gy. Since the square(1)
is apushout
inPfn,
there exista
unique partial
function t : D -> S such that ht = x and ht = y, where t =hUx U kUy, by
Fact 2.4. Weonly
need to show that t is agraph morphism.
Since
h#xHs = hOd(h)d(x)flB
=h#d(x)hHD
andk#yHs
=k#d(y)kHD,
wehave
d(t)
=hod(x)h
Ukld(y)k.
Sinceand
k’d(y)k6Tt
=koys,
we obtaind(t)btt
=hoxs
uk#ys
= ts. That is t isa
graph morphism.
So the square(2)
is apushout
inG(T).
Corollary
3.8 Letf : ( A, a)
->(B, b) and g : (A, a)
-(C, c)
bemorphisms
in
G(T). If
the square fis a
pushout
inPfn,
then thefollowing
conditions areequivalent:
is a total
function.
if and
only
ifkf2D
CcTkf2TD-
So we have shown that(2)
and(3)
areequivalent.
Next we show the
equivalence
of(3)
and(1).
AssumehQD
CbThS2TD
and
kf2D
CcTkHTD.
Sincehbh
Uk#k
=idD by
Lemma2.5,
we havef2D
C
(hOhS2D)
U(kOkS2D)
C(h#bThHTD)
u(k#cTkHTD)
Cdf2TD.
This meansd is a total function.
Conversely,
assume d is a total function. Since hd =d(h)bTh
meansd(h)
=d(h)
nd(bTh),
we haved(h)
Cd(bTh). Similaly
d(k)
Cd(cTk).
We note that if T=P,T=W and T=P(Lx-), then Tf
:TA->TB is a total function for anypartial
functionf :
A -> B. This property is very convenient for existence ofpushouts.
Corollary
3.9 Thecategories G(P), G(W)
andG(P(L x- ))
havepushouts.
4 Observations
In this
section,
weprovide
theproof
of Raoult’sProposition
5 in a viewpoint
of our framework.Let
f :
A -> B and g : A -> C bepartial
functions. We define a relationr(f,g) : A ->
1by r(f,g)
=ula :
A -11ffüa
= a andgg0a
=a},
that isr(f,g)
is the maximum relationsatisfying f f#r(f,g) = r(f,g)
andgg#r(f,g)
=r(f,g).
be a
pushout
in (Proof.
It is obviousff#fhHD = fhHD
andgg0f hf2D
=f hf2D.
Asuume arelation a : A -> 1 satisfies
ff# a
= a andgg0a
= a . Sincef0a :
B -> 1 andgaa :
C -> 1 arepartial
functions and D is apushout,
there exist aunique
function
B :
D -> 1 such thathB
=f#a
andk# = g"a
hold. We obtainfhHD D ff# a
= a. SofhHD
is the maximum relation.Lemma 4.2 Under the situation
of
Theorem 3.7, consider thefunctor
T =* . Then
following five
conditions areequivalent:
where
Proof.
Sinced( f )aT f
=f b
andd(f)f
=f ,
we haveb# f#fhHB = (Tf)#a#
fhHB.
This meansb( f (A’))
=T f (a(A’)).
So(1)
and(3)
areequivalent. (3)
and
(5)
areequivalent by (Tf)-1(dom(h)*) = (A’)*. Similarly, (2),(4)
and(5)
areequivalent,
because ofr(f,g)
=gkHD.
Using
the lastlemma,
condition(2)
inCorollary
3.8 isreplaced
to theform in the next
proposition.
The nextproposition
which wasoriginally proved by
Raoult[13, Proposition 5]
is aspecial
case of Theorem 3.7.Proposition
4.3 Let the squareis a
pushout
in Pfn. A commutativediagram
in
G(*)
is apushout
inG(*) if
andonly if
thefollowing
conditions(1), (2)
and
(3)
hold:and
where
The next
example
is a counterexample
of Raoult’sProposition 5[13]
which lack a condition
(3)
ofProposition
4.3.Example
4.4 Let A ={x1 -> x2, x3}, B
={y1
-y2}
and C =fz,
-z2}
be
graphs.
Definegraph morphisms f : A -
B and g : A -> Cby f (x1 )
= yl,f (x2)
=f (x3) -
y2,g(x1)
= zi and9(X2)
= z2. The value of9(X3)
isundefined(cf. Figure 1).
It is easy to check A’ ={x1}.
and the condition inProposition 4.3(3)
does not hold. Consider thepushout
in the
category
Pfn. Since D is a onepoint set, h and k
are notgraph
morphisms.
Acknowledgments
The author would like to thank Professor Yasuo Kawahara for the valuable
suggestions
andencouragement during
the course of thisstudy.
The authorwishes to thank a referee for his constructive comments to
improve
thismanuscript.
References
[1]
M.S. Calenko. The structures ofcorrespondence categories.
SovietMath.
Dokl., 18(1977),
1498-1502.[2]
M.S.Calenko,
V.B.Gisin,
and D.A. Raikov. Orderedcategories
withinvolution. Dissertations
Mathematics, 227(1984).
[3]
H.Ehrig,
M.Korff,
and M. Löwe. Tutorial introduction to thealgebraic approach
ofgraph
grammars based on double andsingle pushouts.
Lec-ture Notes in
Computer Science, 532(1990),
24-37.[4]
H.Ehrig,
M.Nagl,
G.Rozenberg,
and A.Rosenfeld,
editors.Graph-
grammars and their
application to computer science,
volume 291 of Lec-ture Notes in
Computer
Science.Springer-Verlag,
1986.[5]
Y. Kawahara. Relations incategories
withpullbacks.
Mem. Fac. Sci.Kyushu University, Ser.A27(1973),
149-173.[6]
Y. Kawahara.Applications
of relational calculus tocomputer
mathe- matics. Bull.of Informatics
andCybernetics, 23(1988),
67-78.[7]
Y. Kawahara.Pushout-complements
and basic concepts of grammars intoposes.
TheoreticalComputer Science, 77(1990),
267-289.[8]
Y. Kawahara and Y.Mizoguchi. Categorical
assertion semantics in toposes. AdvancesSoftw.
Sci. andTech.,
in press.[9]
R.Kennaway.
On "Ongraph rewritings".
TheoreticalComputer
Sci-ence,
52(1987),
37-58.[10]
R.Kennaway. Graph rewriting
in somecategories
ofpartial morphisms.
Lecture Notes in
Computer Science, 532(1990),
490-504.[11]
M. Löwe and H.Ehrig. Algebraic approach
tograph
transformation based onsingle pushout
derivations. Lecture Notes inComputer Science, 484(1990),
338-353.[12]
Y.Mizoguchi
and Y. Kawahara.Graph rewritings
withoutgluing
con-ditions. RIFIS Tech.
Report CS-42, Kyushu University,
1991.[13]
J.C. Raoult. Ongraph rewritings.
TheoreticalComputer Science,
32(1984), 1-24.
Yoshihiro
Mizoguchi
Department
ofControl Engineering
and ScienceKyushu
Institute ofTechnology
lizuka
820,
JAPANEmail: