There are multiple ways to compose relations
Last updated 8 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 } }