复合(关系)
复合 | |
---|---|
术语名称 | 复合 |
英语名称 | 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{ R \circ \varnothing = \varnothing }[/math], [math]\displaystyle{ \varnothing \circ R = \varnothing }[/math]
- 如果两个关系都是左全、右全、左唯一或右唯一的,则复合后的关系也具有对应性质。
参考资料
- ↑ https://zhidao.baidu.com/question/131575826.html
- ↑ https://en.wikipedia.org/wiki/Composition_of_relations
- ↑ 有别名Composite Function、APL jot。