# 全序

全序是集合上的一种二元关系，它具有自反性、传递性、反对称性和全性，也就是说任意一对元素都是可比较的：对任意元素 a 和 b，或者 a ≤ b，或者 b ≤ a。<sup>[1](https://xlinux.nist.gov/dads/HTML/totalorder.html)</sup> 全序也称为线性序，配备全序的集合称为全序集、线性序集或链。<sup>[2](https://encyclopediaofmath.org/wiki/Order_%28on_a_set%29)</sup><sup> • </sup><sup>[3](https://mathworld.wolfram.com/TotallyOrderedSet.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 公理 | 自反性、反对称性、传递性（偏序公理）加上可比性<sup>[3](https://mathworld.wolfram.com/TotallyOrderedSet.html)</sup> |
| 其他名称 | 线性序；带全序的集合称为链或全（线性）序集<sup>[2](https://encyclopediaofmath.org/wiki/Order_%28on_a_set%29)</sup> |
| 标准例子 | 通常的序 ≤ 在 ℕ、ℤ、ℚ 和 ℝ 上是全序；幂集上的子集包含除非底层集合至多有一个元素，否则不是全序<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup> |
| 有限情形 | 有限集合上的偏序是全序，当且仅当其哈斯图是一条竖直直线<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup> |
| 扩展定理 | 每个偏序都有线性扩展（斯皮尔拉因定理，1930）<sup>[5](https://impan.pl/pl/wydawnictwa/czasopisma-i-serie-wydawnicze/fundamenta-mathematicae/all/16/0/92870/sur-l-extension-de-l-ordre-partiel)</sup><sup> • </sup><sup>[6](https://encyclopediaofmath.org/wiki/Extension_of_an_order)</sup> |
| 计数代价 | 计算有限偏序集的线性扩展数是 #P完全的<sup>[7](https://arxiv.org/abs/2506.14725)</sup> |

## 定义与严格形式

对于集合 S 上的关系 ≤，四条定义性质是：<sup>[3](https://mathworld.wolfram.com/TotallyOrderedSet.html)</sup>

1. 自反性：对 S 中所有 a，a ≤ a。
2. 反对称性：若 a ≤ b 且 b ≤ a，则 a = b。
3. 传递性：若 a ≤ b 且 b ≤ c，则 a ≤ c。
4. 可比性：对 S 中任意 a、b，或者 a ≤ b，或者 b ≤ a。

前三条正是偏序的公理；加上可比性便得到全序。<sup>[3](https://mathworld.wolfram.com/TotallyOrderedSet.html)</sup> 由全序可导出相伴的严格序 <：当 a ≤ b 且 a ≠ b 时，令 a < b；严格序则刻画为传递性再加上 a < b 与 b < a 不能同时成立这一条件。<sup>[2](https://encyclopediaofmath.org/wiki/Order_%28on_a_set%29)</sup> 更弱的结构就在近旁：只具有自反性和传递性的关系是预序或拟序；拟序在其相伴等价关系所给出的商上诱导出一个序。<sup>[2](https://encyclopediaofmath.org/wiki/Order_%28on_a_set%29)</sup>

## 例子与非例子

最熟悉的全序是数系上的通常序：≤ 在 ℕ、ℤ、ℚ 和 ℝ 上都是全序。<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup> 在实数上，这个序具有更强的性质：对任意 a 和 b，a < b、a = b、a > b 中恰有一个成立，并且还有传递性。<sup>[8](https://encyclopediaofmath.org/wiki/Real_number)</sup>

**子集包含是标准的非例子。** 对于全集 U，幂集 𝒫(U) 上的包含序 ⊆ 除非 |U| ≤ 1，否则不是全序：对 U 中互不相同的 x、y，单元素集 {x} 与 {y} 不可比较，因为二者互不包含。<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup><sup> • </sup><sup>[1](https://xlinux.nist.gov/dads/HTML/totalorder.html)</sup> 不可比较并不要求不交；只要两个子集各自含有对方所缺的一个元素，它们在 ⊆ 下就不可比较。<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup>

全序也可通过构造产生。若 ⪯ 是字母表 Σ 上的全序，则字典序 ⪯* 是该字母表上所有词构成的集合 Σ* 上的全序。<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup> 通过单射把全序拉回保持全性：若 B 是全序集，且 f: A → B 是单射，则用 f(a) ≤ f(b) 定义 a ≤ b，便得到 A 上的全序。将此应用于双射 ℕ → A，便可知每个可数无限集合都容许一个全序，即把其元素列成一个序列 a₀ ≤ a₁ ≤ a₂ ≤ ⋯ 而得到。<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup>

## 有限全序

在有限集合上，全序无非就是元素的一个列举：列表 a₀, a₁, …, aₙ 变成序 a₀ ≤ a₁ ≤ ⋯ ≤ aₙ，反之亦然。<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup> 用图形表示时，有限集合上的偏序是全序，当且仅当其哈斯图——即画出该序、在相差一步的元素之间连边的图——构成一条竖直直线。<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)</sup>

由此可得两个结构事实。每个有限全序集都是良序的，也就是说每个非空子集都有最小元。<sup>[3](https://mathworld.wolfram.com/TotallyOrderedSet.html)</sup> 并且，对非负整数 k，任意两个有 k 个元素的全序集都序同构，因此它们共有同一个序型，即一个序数；每个大小的有限集合本质上只有一个全序。<sup>[3](https://mathworld.wolfram.com/TotallyOrderedSet.html)</sup>

## 偏序的线性扩展

当 P 中的 a ≤ b 蕴含 L 中的 a ≤ b 时，称全序 L 扩展偏序 P；这样的 L 称为 P 的线性扩展。<sup>[6](https://encyclopediaofmath.org/wiki/Extension_of_an_order)</sup> 斯皮尔拉因定理指出，每个偏序都有线性扩展；该结果发表于爱德华·斯皮尔拉因（Edward Szpilrajn）的论文《论偏序的扩展》（"Sur l'extension de l'ordre partiel"），载于《数学基础》（Fundamenta Mathematicae）第 16 卷（1930 年），第 386–389 页。<sup>[5](https://impan.pl/pl/wydawnictwa/czasopisma-i-serie-wydawnicze/fundamenta-mathematicae/all/16/0/92870/sur-l-extension-de-l-ordre-partiel)</sup><sup> • </sup><sup>[6](https://encyclopediaofmath.org/wiki/Extension_of_an_order)</sup> 该定理被描述为偏序理论中的核心结果，并且它支撑了诸如偏序的维数这一定义，即交集能还原该偏序的最小线性序族的大小。<sup>[9](https://math.uchicago.edu/~drh/Papers/linext.html)</sup><sup> • </sup><sup>[6](https://encyclopediaofmath.org/wiki/Extension_of_an_order)</sup> 在一个集合上所有序关系构成的族中，按扩展排序，极小元是相等关系，极大元是线性序。<sup>[6](https://encyclopediaofmath.org/wiki/Extension_of_an_order)</sup>

线性扩展有实际解读：带有优先约束的任务偏序可以补成一个一致的全序，任务按此全序执行。<sup>[10](https://informatika.stei.itb.ac.id/~rinaldi.munir/Matdis/ln3.pdf)</sup> 若 P 已经是全序，则它就是自身的线性扩展。<sup>[11](https://www.voutsadakis.com/TEACH/LECTURES/DISCRETE/Chapter10.pdf)</sup>

## 集合论强度

序扩展原则，即每个偏序都能扩展为线性序，弱于完整的选择公理。它不蕴含布尔素理想定理，即每个布尔代数都有素理想这一命题；其独立性是通过证明 BPIT 不能由 OE 推出而得到证明的。<sup>[12](https://doi.org/10.2307/2586759)</sup> 在另一端，良序定理，即每个集合都能被某个全序良序化、其中每个非空子集都有最小元，等价于选择公理；策梅洛（Zermelo）于 1904 年从 AC 证明了该定理，这一等价性很快得到承认。<sup>[13](https://plato.stanford.edu/entries/axiom-choice/)</sup>

有效版本的行为不同。斯皮尔拉因定理若干变体的可计算类似物不成立，反推数学分析利用这些失败来确定该定理的证明论强度；例如，良偏序的最大线性扩展定理在基础系统 RCA₀ 上等价于 ATR₀。<sup>[9](https://math.uchicago.edu/~drh/Papers/linext.html)</sup><sup> • </sup><sup>[14](https://arxiv.org/abs/1009.1528)</sup>

## 计算

排序算法预设键上有一个序。比较排序只利用键之间的比较，把条目排成预定的顺序。<sup>[15](https://xlinux.nist.gov/dads/HTML/comparisnsrt.html)</sup> 实践中的比较器要求弱于全序：C++ 标准要求比较器诱导一个严格弱序，在此序下，当两个元素互不小于对方时它们等价，而在等价类上诱导出的关系是严格全序。<sup>[16](https://eel.is/c%2B%2Bdraft/alg.sorting.general)</sup> 若比较器是循环的而非传递的——不一致的比较逻辑可能造成这种情况——则会产生无意义的排序。<sup>[1](https://xlinux.nist.gov/dads/HTML/totalorder.html)</sup>

对有限偏序集，线性扩展就是与之相容的全序，而计算它们的数目在计算上是困难的：该计数问题是 #P完全的，甚至对高度为 2 的偏序集等受限类也仍是 #P完全的。<sup>[7](https://arxiv.org/abs/2506.14725)</sup> 均匀随机生成线性扩展也得到了研究：2025 年，从事概率与计算方法研究的数学家马克·胡伯（Mark Huber）提出一种算法，平均最多使用 2.75 n³ ln(n) 次运算和 1.83 n³ ln(n) 个独立公平随机比特生成一个均匀线性扩展，改进了此前最佳方法中 16/π ≈ 5.093 次运算的常数。<sup>[7](https://arxiv.org/abs/2506.14725)</sup>

## References

1. [Paul E. Black and Paul J. Tanenbaum, "total order", NIST Dictionary of Algorithms and Data Structures](https://xlinux.nist.gov/dads/HTML/totalorder.html)
2. ["Order (on a set)", Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Order_%28on_a_set%29)
3. [Eric W. Weisstein, "Totally Ordered Set", Wolfram MathWorld](https://mathworld.wolfram.com/TotallyOrderedSet.html)
4. [Jeremy Sylvestre, "19.4: Total Orders", Elementary Foundations, Mathematics LibreTexts](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/19%3A_Partially_ordered_sets/19.04%3A_Total_Orders)
5. [Edward Szpilrajn, "Sur l'extension de l'ordre partiel", Fundamenta Mathematicae 16 (1930), 386–389, IMPAN](https://impan.pl/pl/wydawnictwa/czasopisma-i-serie-wydawnicze/fundamenta-mathematicae/all/16/0/92870/sur-l-extension-de-l-ordre-partiel)
6. ["Extension of an order", Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Extension_of_an_order)
7. [Mark Huber, "Generating uniform linear extensions using few random bits", arXiv:2506.14725](https://arxiv.org/abs/2506.14725)
8. ["Real number", Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Real_number)
9. [Rodney G. Downey, Denis R. Hirschfeldt, Steffen Lempp, and Reed Solomon, "Computability-Theoretic and Proof-Theoretic Aspects of Partial and Linear Orderings", Israel Journal of Mathematics 138 (2003), 271–290](https://math.uchicago.edu/~drh/Papers/linext.html)
10. [Rinaldi Munir, "Course Notes 3: Relations"](https://informatika.stei.itb.ac.id/~rinaldi.munir/Matdis/ln3.pdf)
11. ["Linear Extension of a Partial Order on a Finite Set", lecture notes of Costas Voutsadakis](https://www.voutsadakis.com/TEACH/LECTURES/DISCRETE/Chapter10.pdf)
12. ["The independence of the Prime Ideal Theorem from the Order-Extension Principle", Journal of Symbolic Logic](https://doi.org/10.2307/2586759)
13. ["The Axiom of Choice", Stanford Encyclopedia of Philosophy](https://plato.stanford.edu/entries/axiom-choice/)
14. ["The maximal linear extension theorem in second order arithmetic", arXiv:1009.1528](https://arxiv.org/abs/1009.1528)
15. ["comparison sort", NIST Dictionary of Algorithms and Data Structures](https://xlinux.nist.gov/dads/HTML/comparisnsrt.html)
16. ["[alg.sorting.general]", C++ working draft](https://eel.is/c%2B%2Bdraft/alg.sorting.general)

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

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Discrete mathematics

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/total-order

English original: https://www.edgepedia.org/total-order
