关系

来自GSXAB的知识库
关系
术语名称 关系
英语名称 relation

关系(relation)是描述两个或多个集合中元素之间的关联的数学对象。 不特殊说明的情况下,关系指两个集合之间的关系。

定义

[math]\displaystyle{ n }[/math] 个集合 [math]\displaystyle{ A_1, A_2, \dots, A_n }[/math] 有笛卡尔积 [math]\displaystyle{ A_1 \times A_2 \times \dots \times A_n }[/math] ,则其子集 [math]\displaystyle{ R \subseteq A_1 \times A_2 \times \dots \times A_n }[/math] 称为 [math]\displaystyle{ A_1, A_2, \dots, A_n }[/math] 上的一个 [math]\displaystyle{ n }[/math] 元关系(n-ary relation)。也就是说,关系 [math]\displaystyle{ R }[/math][math]\displaystyle{ n }[/math] 元组 [math]\displaystyle{ (a_1, a_2, \dots, a_n) }[/math] 的集合,其中 [math]\displaystyle{ a_i \in A_i }[/math]

关系一般用R、S、……表示。

通常,如果不特别指出元数,关系是指二元关系。

二元关系

对集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math] 有笛卡尔积 [math]\displaystyle{ A \times B }[/math] ,则其子集 [math]\displaystyle{ R \subseteq A \times B }[/math] 称为 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math] 上的一个 二元关系(binary relation),简称关系(relation)。 也就是说,关系 [math]\displaystyle{ R }[/math] 是有序对 [math]\displaystyle{ \langle a, b \rangle }[/math] 的集合,其中 [math]\displaystyle{ a \in A, b \in B }[/math]

两个集合上的关系也称为从 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math] 的二元关系。 反过来,对从 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math] 的二元关系 [math]\displaystyle{ R }[/math][math]\displaystyle{ A }[/math] 称为二元关系 [math]\displaystyle{ R }[/math]前域(domain)或出发域(set of departure), [math]\displaystyle{ B }[/math] 称为二元关系 [math]\displaystyle{ R }[/math]后域(codomain)或到达域(set of destination)。[1]

[math]\displaystyle{ A=B }[/math]的情况也称为齐次关系(homogeneous relationendorelation),与之相对的是非齐次关系(heterogeneous relation)。[2]

[math]\displaystyle{ A }[/math][math]\displaystyle{ A }[/math] 的二元关系也称为 [math]\displaystyle{ A }[/math] 上的二元关系。

表示

关系有以下几种表示方法:

  1. 集合的描述法:[math]\displaystyle{ \left\{ \langle x, y \rangle \mid x = y - 1 \right\} }[/math]
  2. 集合的列举法:[math]\displaystyle{ \left\{ \langle 1,2 \rangle,\langle 2,3 \rangle, \langle 3,4 \rangle \right\} }[/math]
  3. 关系图
  4. 关系矩阵

关系图

关系图
术语名称 关系图
英语名称 arrow diagram

对于两个集合,可以通过分别画出前后域、分别列出所有元素并使用从前域到后域的箭头来表示关系。对于前后域相同的情况,可以通过列出域中所有元素,并通过由元素指向另一个元素(或自身)的箭头表示关系中的有序对。这样的图表称为关系图(arrow diagram)。

对集合 [math]\displaystyle{ A }[/math] 上的关系 [math]\displaystyle{ R }[/math] ,图 [math]\displaystyle{ \langle A, R \rangle }[/math] 称为 [math]\displaystyle{ R }[/math] 的图示,简称关系图,记作 [math]\displaystyle{ G_R }[/math]

对集合 [math]\displaystyle{ A }[/math][math]\displaystyle{ B }[/math] 上的关系 [math]\displaystyle{ R }[/math],顶点集为 [math]\displaystyle{ V = A \sqcup B = \left\{ a_A | a \in A \right\} \cup \left\{ b_B \mid b \in B \right\} }[/math] 、边集 [math]\displaystyle{ E = \left\{ \langle a_A, b_B \rangle \mid \langle a, b \rangle \in R \right\} }[/math] 的图 [math]\displaystyle{ \langle V, E \rangle }[/math][math]\displaystyle{ R }[/math] 的关系图。

前后域相同的关系图是一种有向图,前后域不同的关系图是一种有向二部图。有时也用这个类型来区分。

关系矩阵

关系矩阵
术语名称 关系矩阵
英语名称 relation matrix
别名 logical matrix

对集合 [math]\displaystyle{ A = \{ a_1, a_2, \dots , a_n \} }[/math][math]\displaystyle{ B = \{ b_1, b_2, \dots , b_n \} }[/math] 上的关系 [math]\displaystyle{ R }[/math] ,记矩阵 [math]\displaystyle{ M_R = \left( r_{ij} \right)_{m \times n} }[/math] ,其中 [math]\displaystyle{ r_{ij} = \begin{cases} 1, & a_i R b_j \\ 0, & a_i \not R b_j \end{cases} }[/math],称为 [math]\displaystyle{ R }[/math]关系矩阵(relation matrix)。

关系矩阵是一种布尔矩阵。有时也直接将关系矩阵叫做关系的'布尔矩阵(logical matrix)。

有关系

[math]\displaystyle{ X }[/math][math]\displaystyle{ Y }[/math] 的关系 [math]\displaystyle{ R }[/math][math]\displaystyle{ x \in X, y\in Y }[/math]

[math]\displaystyle{ \langle x,y \rangle \in R }[/math] ,称 [math]\displaystyle{ x }[/math][math]\displaystyle{ y }[/math] 有关系 [math]\displaystyle{ R }[/math] ([math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] are [math]\displaystyle{ R }[/math]-related / [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] are related by [math]\displaystyle{ R }[/math] / [math]\displaystyle{ x }[/math] is [math]\displaystyle{ R }[/math]-related to [math]\displaystyle{ y }[/math]),记作 [math]\displaystyle{ xRy }[/math]

相反,若 [math]\displaystyle{ \langle x,y \rangle \notin R }[/math] ,称 [math]\displaystyle{ x }[/math][math]\displaystyle{ y }[/math] 没有关系 [math]\displaystyle{ R }[/math] ([math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] are not [math]\displaystyle{ R }[/math]-related / [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] are not related by [math]\displaystyle{ R }[/math] / [math]\displaystyle{ x }[/math] is not [math]\displaystyle{ R }[/math]-related to [math]\displaystyle{ y }[/math]),记作 [math]\displaystyle{ x \not R y }[/math][math]\displaystyle{ x \lnot R y }[/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. domain 和 codomain 在函数相关经常译为 “定义域”“陪域”,但关系的 domain 和 domain of definition 不同,一般要做区别。
  2. 这里应该按本意译为“同质关系”“异质关系”。中文语境使用不多,而且基本都是齐次和非齐次。