There are multiple ways to compose relations
Last updated 10 months ago
Relation X Y R\textbf{Relation} \; X \; Y \; RRelationXYR
Relation Y Z S\textbf{Relation} \; Y \; Z \; SRelationYZS
Notation.
SubPrd X Y Z R S\textbf{SubPrd} \; X \; Y \; Z \; R \; SSubPrdXYZRS can be written SubPrd R S\textbf{SubPrd} \; R \; SSubPrdRS when XXX, YYY and ZZZ are clear from the context.
SubPrd R S\textbf{SubPrd} \; R \; SSubPrdRS can be written in symbols as R⊲SR \vartriangleleft SR⊲S.
fun SubPrd (X,Y,Z: set univ, R: X->Y, S: Y->Z) : X->Z { { x: X, z: Z | x.R in S.z } }
SupPrd X Y Z R S\textbf{SupPrd} \; X \; Y \; Z \; R \; SSupPrdXYZRS can be written SupPrd R S\textbf{SupPrd} \; R \; SSupPrdRS when XXX, YYY and ZZZ are clear from the context.
SupPrd R S\textbf{SupPrd} \; R \; SSupPrdRS can be written in symbols as R⊳SR \vartriangleright SR⊳S.
fun SupPrd (X,Y,Z: set univ, R: X->Y, S: Y->Z) : X->Z { { x: X, z: Z | S.z in x.R } }
SqrPrd X Y Z R S\textbf{SqrPrd} \; X \; Y \; Z \; R \; SSqrPrdXYZRS can be written SqrPrd R S\textbf{SqrPrd} \; R \; SSqrPrdRS when XXX, YYY and ZZZ are clear from the context.
SqrPrd R S\textbf{SqrPrd} \; R \; SSqrPrdRS can be written in symbols as R⋄SR \diamond SR⋄S.
fun SqrPrd(X,Y,Z: set univ, R: X->Y, S: Y->Z) : X->Z { { x: X, z: Z | x.R = S.z } }