复合(关系)

来自GSXAB的知识库
(重定向自复合关系
复合
术语名称 复合
英语名称 composition

关系的复合(composition of relations)指两个或多个关系依次首尾相接构成的关系。

定义

复合
运算名称 复合
运算符号 [math]\displaystyle{ \circ }[/math]
Latex
\circ
运算对象 关系
运算元数 2
运算结果 关系
定义域 [math]\displaystyle{ \mathcal{P}(X \times Y) \times \mathcal{P}(Y \times Z) }[/math]
陪域 [math]\displaystyle{ \mathcal{P}(X \times Z) }[/math]

对集合 [math]\displaystyle{ X }[/math][math]\displaystyle{ Y }[/math] 的关系 [math]\displaystyle{ R }[/math][math]\displaystyle{ Y }[/math][math]\displaystyle{ Z }[/math] 的关系 [math]\displaystyle{ S }[/math] ,记 [math]\displaystyle{ RS = \left\{ \langle x,z \rangle \mid \exists y (\langle x,y \rangle \in R \land \langle y,z \rangle \in S) \right\} = \left\{ \langle x,z \rangle \mid \exists y (x R y \land y S z) \right\} }[/math] ,称为 [math]\displaystyle{ S }[/math][math]\displaystyle{ R }[/math]复合(composition),记作 [math]\displaystyle{ S\circ R }[/math]。也称为 [math]\displaystyle{ R }[/math][math]\displaystyle{ S }[/math]逆序复合或右复合,记作 [math]\displaystyle{ RS }[/math]

有人也记作 [math]\displaystyle{ R\circ S }[/math] ,先应用左边再应用右边,称为“右复合”,和函数的复合 [math]\displaystyle{ f\circ g }[/math] 等先应用右边再应用左边的记号刚好顺序相反,被称为“左复合”。[1]国内一般函数总是使用左复合,关系两种都有,但现行教材用右复合较多。由于左右不统一会产生对记号 [math]\displaystyle{ \circ }[/math] 的额外理解成本,不指出时本 wiki 使用左复合以减少混淆。此外,也有人对关系使用 [math]\displaystyle{ R ; S }[/math] 来区分右复合记号。[2]

字符
Unicode码位 U+2218 Ring Operator [3]


性质

两个关系的复合的关系矩阵是两个关系矩阵的积,其中矩阵乘法中元素的加法和乘法对应替换为逻辑或(逻辑加法)和逻辑与(逻辑乘法)。

  • 结合性: [math]\displaystyle{ T \circ (S \circ R) = (T \circ S) \circ R }[/math]
  • [math]\displaystyle{ X }[/math] 上的关系是幺半群
    • [math]\displaystyle{ R \circ \varnothing = \varnothing }[/math][math]\displaystyle{ \varnothing \circ R = \varnothing }[/math]
      • 空关系是复合运算的零元。
      • 一般地,在非齐次的情况下,也有类似性质,只是两侧空关系可能不是相同集合上的。
    • [math]\displaystyle{ R \circ I = R }[/math][math]\displaystyle{ I \circ R = R }[/math]
      • 恒等关系是复合运算的单位元。
      • 一般地,在非齐次的情况下,也有类似性质,只是两侧单位关系不同,需要按照所相关的集合调整。
    • [math]\displaystyle{ R \circ I = R }[/math][math]\displaystyle{ I \circ R = R }[/math]
    • 对应地,同一关系的复合被定义为关系的
  • 如果两个关系都是左全、右全、左唯一或右唯一的,则复合后的关系也具有对应性质。


关系/二元关系
定义属性 前域、后域、定义域 [math]\displaystyle{ \operatorname{dom} }[/math]、值域 [math]\displaystyle{ \operatorname{ran} }[/math]、域 [math]\displaystyle{ \operatorname{fld} }[/math]
特殊关系 空关系 [math]\displaystyle{ \varnothing }[/math]恒等关系 [math]\displaystyle{ I }[/math]全关系 [math]\displaystyle{ A\times B }[/math]
类型 自反反自反对称反对称传递
运算 基础运算 [math]\displaystyle{ \cap }[/math][math]\displaystyle{ \cup }[/math][math]\displaystyle{ \bar{\bullet} }[/math][math]\displaystyle{ \setminus }[/math]
函数性运算 对偶(转置、逆) [math]\displaystyle{ \bullet^\mathrm{T}/\bullet^{-1} }[/math]复合 [math]\displaystyle{ \circ }[/math][math]\displaystyle{ \bullet^n }[/math])、限制 [math]\displaystyle{ \bullet_{|\bullet} }[/math]

参考资料

  1. https://en.wikipedia.org/wiki/Composition_of_relations