限制(关系)
| 限制 | |
|---|---|
| 术语名称 | 限制 |
| 英语名称 | restriction |
限制(restriction)指对一个关系,取其在自身前域、后域的子集上构成的子关系。
定义
| 限制 | |
|---|---|
| 运算名称 | 限制 |
| 运算符号 | [math]\displaystyle{ \bullet_{| \bullet} }[/math],[math]\displaystyle{ \bullet\big|_\bullet }[/math],[math]\displaystyle{ \bullet\restriction_\bullet }[/math] |
| Latex | _{\vert}, \big\vert_, \restriction_
|
| 运算对象 | 关系 |
| 运算元数 | 2 |
| 运算结果 | 关系
|
齐次关系的限制
对集合 [math]\displaystyle{ X }[/math] 上的关系 [math]\displaystyle{ R }[/math] 与子集 [math]\displaystyle{ A \subseteq X }[/math],定义: [math]\displaystyle{ R_{| A} = \{ (x, y) \in R \mid x, y \in A \} }[/math] 称为 [math]\displaystyle{ R }[/math] 在 [math]\displaystyle{ A }[/math] 上的限制,也记作 [math]\displaystyle{ R\big|_A }[/math] ,有时也直接记作 [math]\displaystyle{ R|A }[/math]。
非齐次关系的限制
对集合 [math]\displaystyle{ X }[/math] 到 [math]\displaystyle{ Y }[/math] 的关系 [math]\displaystyle{ R }[/math]:
- 对前域的限制:若 [math]\displaystyle{ A \subseteq X }[/math],则 [math]\displaystyle{ R_{|A} = \{ (x, y) \in R \mid x \in A \} }[/math] ,也记作 [math]\displaystyle{ R\big|_A }[/math] 。
- 对后域的限制:若 [math]\displaystyle{ B \subseteq Y }[/math],则 [math]\displaystyle{ R^{|B} = \{ (x, y) \in R \mid y \in B \} }[/math] ,也记作 [math]\displaystyle{ R\big|^B }[/math] 。
- 同时对前后域的限制:若 [math]\displaystyle{ A \subseteq X, B \subseteq Y }[/math],则 [math]\displaystyle{ R_{|A}^{|B} = \{ (x, y) \in R \mid x \in A, y \in B \} }[/math] ,也记作 [math]\displaystyle{ R\big|_A^B }[/math] 。
性质
- 基本性质:
- [math]\displaystyle{ R_{|A} \subseteq R }[/math]
- [math]\displaystyle{ (R_{|A})_{|B} = R_{| A \cap B} }[/math]
- 若 [math]\displaystyle{ A \subseteq B }[/math],则 [math]\displaystyle{ R_{|A} \subseteq R_{|B} }[/math]
- 与运算的关系:
- [math]\displaystyle{ (R \cup S)_{|A} = (R_{|A}) \cup (S_{|A}) }[/math]
- [math]\displaystyle{ (R \cap S)_{|A} = (R_{|A}) \cap (S_{|A}) }[/math]
- 关系矩阵表示:
- 齐次关系限制的关系矩阵是原矩阵对应的主子矩阵
- 非齐次关系限制的关系矩阵是原矩阵去掉对应行或列的子矩阵