# 传递关系

**传递关系**是集合 \( A \) 上的二元关系 \( R \)，具有如下性质：只要对元素 \( a, b, c \in A \) 有 \( aRb \) 和 \( bRc \) 成立，则 \( aRc \) 也成立。等价地，\( R \) 与自身的复合包含于 \( R \)，记作 \( R \circ R \subseteq R \)。<sup>[1](https://encyclopediaofmath.org/wiki/Transitive_relation)</sup> 传递性是等价关系和序关系的定义性质之一，而这两者是数学中最常用的结构中的两种。<sup>[1](https://encyclopediaofmath.org/wiki/Transitive_relation)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | 对所有 \( a, b, c \in A \)：\( aRb \) 且 \( bRc \) 蕴含 \( aRc \)；等价地 \( R \circ R \subseteq R \)<sup>[1](https://encyclopediaofmath.org/wiki/Transitive_relation)</sup> |
| 平凡例子 | 全关系、相等关系和空关系都是传递的<sup>[1](https://encyclopediaofmath.org/wiki/Transitive_relation)</sup> |
| 闭包性质 | 集合上传递关系的交集仍是传递的<sup>[1](https://encyclopediaofmath.org/wiki/Transitive_relation)</sup> |
| 传递闭包 | 包含 \( R \) 的最小传递关系，通过连接有限 \( R \)-链得到<sup>[1](https://encyclopediaofmath.org/wiki/Transitive_relation)</sup> |
| 标准组合 | 等价关系：自反、对称、传递；偏序：自反、反对称、传递<sup>[2](https://plato.stanford.edu/entries/set-theory/basic-set-theory.html)</sup> |
| 计算 | 沃歇尔算法计算布尔矩阵的传递闭包（《ACM杂志》，1962）<sup>[3](https://sigmod.org/publications/dblp/db/journals/jacm/Warshall62.html)</sup> |

## 定义的实际运用

该条件对所有元素三元组进行量化，因此只要有一个形如 \( aRb \)、\( bRc \) 但并非 \( aRc \) 的反例，就足以表明一个关系不是传递的。数上的“相差不超过 3”关系，即当 \( |a - b| \le 3 \) 时 \( a \) 与 \( b \) 相关，就是这样失败的：1 与 3 相差不超过 3，3 与 5 相差不超过 3，但 \( |1 - 5| = 4 \)，所以 1 与 5 相差不超过 3 不成立。<sup>[4](https://discrete.openmathbooks.org/dmoi4/sec_gt-relations.html)</sup>

复合表述 \( R \circ R \subseteq R \) 给出一个实用检验：将 \( R \) 与自身复合，如果结果包含于 \( R \)，则该关系是传递的。<sup>[5](https://www.sw.it.aoyama.ac.jp/2022/Math1/lecture10.html)</sup> 在有向图上，传递性意味着只要有一条从 \( v \) 到 \( u \) 的箭头，随后有一条从 \( u \) 到 \( w \) 的箭头，也就有一条从 \( v \) 到 \( w \) 的箭头。<sup>[6](https://runestone.academy/ns/books/published/DiscreteMathText/rstrelations8-2.html)</sup>

一个有用的微妙之处是，当不存在合适的链时，定义会被空真地满足。单元素关系 \( \{(a, b)\} \) 且 \( a \neq b \) 是传递的，因为没有元素 \( c \) 满足 \( bRc \)，所以蕴含式的前提从未成立。同样的推理使空关系成为传递关系。<sup>[1](https://encyclopediaofmath.org/wiki/Transitive_relation)</sup>

## 例子

熟悉的序关系和比较关系都是传递的。在实数上，\( \le \) 是自反、反对称和传递的；\( < \) 是反对称和传递的，但既不自反也不对称；相等关系是自反、对称和传递的。相比之下，\( \neq \) 是对称的，但不自反、不反对称，也不传递。<sup>[7](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65662)</sup> 其他传递关系包括后代关系、祖先关系和整除关系。<sup>[5](https://www.sw.it.aoyama.ac.jp/2022/Math1/lecture10.html)</sup>

一个带有算术结构的详细例子是模 \( n \) 同余。对整数 \( n \ge 2 \)，在整数上定义 \( aRb \) 为 \( a - b \) 是 \( n \) 的倍数。如果 \( aRb \) 且 \( bRc \)，则存在整数 \( k \) 和 \( l \) 使 \( a - b = kn \) 且 \( b - c = ln \)，于是 \( a - c = (a - b) + (b - c) = (k + l)n \)，这仍是 \( n \) 的倍数。因此该关系是传递的，而且事实上也是自反和对称的，从而构成等价关系。<sup>[7](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65662)</sup>

## 与其他性质的关系

传递性在逻辑上独立于自反性、对称性和反对称性：这些性质中没有哪一个可以从另一个推出，每一个都必须根据其自身定义单独检验。<sup>[8](https://university.kurz.fyi/computer-science/foundations/discrete-math-logic/relations-and-their-properties)</sup> 两种经典配对将传递性与其他条件结合起来，定义了数学的核心结构：

- **等价关系**是自反、对称和传递的；它的行为像相等关系，其等价类划分底层集合。<sup>[2](https://plato.stanford.edu/entries/set-theory/basic-set-theory.html)</sup>
- **偏序**是自反、反对称和传递的，像 \( \le \) 一样；任意集合族上的子集关系 \( \subseteq \) 就是一个例子。从偏序中删去所有对 \( (a, a) \)，得到严格偏序，例如 \( < \)。<sup>[2](https://plato.stanford.edu/entries/set-theory/basic-set-theory.html)</sup>
- **预序**是自反和传递的。<sup>[9](https://www.cs.unibo.it/~sacerdot/logica/lucidi_vecchi/libro_open_logic.pdf)</sup>

与复合还有直接联系：满足 \( R \circ R = R \) 的关系称为幂等的，每个幂等关系都是传递的。反过来，每个既自反又传递的关系都是幂等的，尽管有些幂等关系不是自反的。<sup>[5](https://www.sw.it.aoyama.ac.jp/2022/Math1/lecture10.html)</sup>

## 传递闭包

许多自然出现的关系，例如图的边关系或“是……的父母”关系，并不是传递的，而通常有用的是对它们取闭包。\( R \) 的**传递闭包** \( R^* \) 是包含 \( R \) 的最小传递关系；等价地，它是所有包含 \( R \) 的传递关系的交集，而这样的关系至少存在一个，即全关系。具体地说，\( aR^*b \) 成立，当且仅当存在有限链 \( a = a_0, a_1, \ldots, a_n = b \)，使得对每个 \( i \) 都有 \( a_{i-1} R a_i \)。<sup>[1](https://encyclopediaofmath.org/wiki/Transitive_relation)</sup> 算法上，闭包是反复将 \( R \) 与自身复合直到结果不再变化所得的结果。<sup>[5](https://www.sw.it.aoyama.ac.jp/2022/Math1/lecture10.html)</sup>

举一个小例子，取 \( R = \{(1, 2), (3, 2), (4, 1), (4, 3)\} \)。为使该关系传递而必须添加的唯一对是 \( (4, 2) \)，它通过链 \( 4 \to 1 \to 2 \) 到达，所以 \( R^* = \{(1, 2), (3, 2), (4, 1), (4, 3), (4, 2)\} \)。<sup>[6](https://runestone.academy/ns/books/published/DiscreteMathText/rstrelations8-2.html)</sup>

**计算闭包。** 标准方法是沃歇尔算法，由斯蒂芬·沃歇尔（Stephen Warshall）在论文《布尔矩阵的一个定理》（《ACM杂志》9(1): 11–12, 1962）中发表；他是一位以编程语言理论与系统方面工作闻名的计算机科学家。<sup>[3](https://sigmod.org/publications/dblp/db/journals/jacm/Warshall62.html)</sup> 该算法从图的邻接矩阵计算其传递闭包矩阵，其公式与布尔矩阵乘法密切相关，只是把算术加法替换为逻辑或。<sup>[10](https://arxiv.org/abs/1705.08743)</sup> 大量数据库研究扩展了这一起点，包括传递闭包算法的性能研究和基于图遍历的方法。<sup>[3](https://sigmod.org/publications/dblp/db/journals/jacm/Warshall62.html)</sup>

传递闭包也作为查询语言中的算子出现。图查询语言标准 GQL 大体上可以用带传递闭包算子的关系演算扩展来表达，这一片段记作 FO[TC]。<sup>[11](https://arxiv.org/abs/2407.06766)</sup> 在 SPARQL（RDF 数据的查询语言）中，属性路径表达式让查询能够匹配图中任意长度的路径，从而实现可达性，即传递闭包在图上的形式。<sup>[12](https://www.w3.org/TR/sparql11-property-paths/)</sup>

## 历史与抽象背景

对关系性质的系统研究可追溯到十九世纪的逻辑代数。奥古斯都·德摩根（Augustus De Morgan）尤其对可转换关系或传递关系感兴趣，但他是在传统三段论的模式内工作。是美国哲学家和逻辑学家查尔斯·桑德斯·皮尔士（Charles Sanders Peirce）成功地形式化了关系逻辑，使用布尔代数记号；他在《量的逻辑》（The Logic of Quantity，1893）等论文中形式地表达了传递关系的性质。恩斯特·施罗德（Ernst Schröder）随后在《逻辑代数讲义》（*Vorlesungen über die Algebra der Logik*，1890–1905）中扩展了这项工作，其第三卷专门讨论关系逻辑。<sup>[13](https://plato.stanford.edu/entries/peirce-logic/)</sup>

在现代范畴论中，集合 \( A \) 上的传递关系可以看作一个半范畴（没有恒等箭头的范畴），其中对任意两个对象 \( a \) 和 \( b \)，至多有一个定义域为 \( a \)、陪域为 \( b \) 的态射；在集合与关系构成的 2-偏序集 \( \mathrm{Rel} \) 中，\( R \) 是传递的，当且仅当它包含自身与自身的复合。<sup>[14](https://ncatlab.org/nlab/show/transitive%2Brelation)</sup>

## References

1. [Transitive relation, Encyclopedia of Mathematics (originator T.S. Fofanova)](https://encyclopediaofmath.org/wiki/Transitive_relation)
2. [Set Theory > Basic Set Theory, Stanford Encyclopedia of Philosophy](https://plato.stanford.edu/entries/set-theory/basic-set-theory.html)
3. [Stephen Warshall: A Theorem on Boolean Matrices, J. ACM 9(1): 11-12 (1962), SIGMOD bibliography](https://sigmod.org/publications/dblp/db/journals/jacm/Warshall62.html)
4. [Relations and Graphs, Discrete Mathematics (OpenMathBooks)](https://discrete.openmathbooks.org/dmoi4/sec_gt-relations.html)
5. [Discrete Math I: Application of Relations, Aoyama Gakuin University](https://www.sw.it.aoyama.ac.jp/2022/Math1/lecture10.html)
6. [Reflexive, Symmetric, Transitive Properties, Runestone Discrete Mathematics](https://runestone.academy/ns/books/published/DiscreteMathText/rstrelations8-2.html)
7. [Introduction to University Mathematics (2025-26): 2 Relations, Mathematical Institute, University of Oxford](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65662)
8. [Relations and Their Properties, Discrete Mathematics & Logic](https://university.kurz.fyi/computer-science/foundations/discrete-math-logic/relations-and-their-properties)
9. [Sets, Logic, Computation (Open Logic text), University of Bologna course text](https://www.cs.unibo.it/~sacerdot/logica/lucidi_vecchi/libro_open_logic.pdf)
10. [Fast algorithms for anti-distance matrices as a generalization of Boolean matrices, arXiv:1705.08743](https://arxiv.org/abs/1705.08743)
11. [Relational Perspective on Graph Query Languages, arXiv:2407.06766](https://arxiv.org/abs/2407.06766)
12. [SPARQL 1.1 Property Paths, W3C Recommendation](https://www.w3.org/TR/sparql11-property-paths/)
13. [Peirce's Deductive Logic, Stanford Encyclopedia of Philosophy](https://plato.stanford.edu/entries/peirce-logic/)
14. [Transitive relation, nLab](https://ncatlab.org/nlab/show/transitive%2Brelation)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › Formal logic and foundations › Set theory › Elementary set theory

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/transitive-relation

English original: https://www.edgepedia.org/transitive-relation
