{
  "id": "total-order",
  "title": "Total Order",
  "lang": "en",
  "source_lang": "en",
  "summary": "A total order is a relation that consistently compares every pair of elements, placing them in a single linear arrangement.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Linear order",
    "Simple order",
    "Connex order"
  ],
  "generated_at": "2026-11-06",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/total-order/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/total-order/",
      "json": "https://aiwiki.page/zh/total-order.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A total order on a set is a binary relation that is reflexive, antisymmetric, transitive, and makes every pair of elements comparable. It formalizes the idea of arranging objects along a line: for any two objects, one precedes the other or they are equal. A set equipped with a total order is called a totally ordered set or linearly ordered set. Total orders are special cases of partial orders, distinguished by the absence of incomparable pairs."
    },
    {
      "heading": "Definition",
      "text": "Let \\(X\\) be a set and let \\(\\leq\\) be a relation on \\(X\\). The pair \\((X,\\leq)\\) is a totally ordered set if the following conditions hold for all \\(a,b,c\\in X\\):\n\n- Reflexivity: \\(a\\leq a\\).\n- Antisymmetry: if \\(a\\leq b\\) and \\(b\\leq a\\), then \\(a=b\\).\n- Transitivity: if \\(a\\leq b\\) and \\(b\\leq c\\), then \\(a\\leq c\\).\n- Totality, also called comparability or connexity: \\(a\\leq b\\) or \\(b\\leq a\\).\n\nThe first three conditions define a partial order. Totality supplies the additional requirement that every pair can be compared. When totality is stated for all pairs, including \\(a=b\\), it already implies reflexivity; the four-condition formulation nevertheless makes the relationship with partial orders explicit.\n\nThe order is part of the structure, not a property of the underlying set alone. The same set may support many different total orders.\n\nStrict formulation\n\nA total order can equivalently be expressed using a strict relation \\(<\\), defined by\n\n\\[a<b \\quad\\Longleftrightarrow\\quad a\\leq b\\ \\text{and}\\ a\\ne b.\\]\n\nThe strict relation is transitive and satisfies trichotomy: exactly one of\n\n\\[a<b,\\qquad a=b,\\qquad b<a\\]\n\nholds. In particular, it is irreflexive: \\(a<a\\) never holds.\n\nConversely, a transitive strict relation satisfying trichotomy determines a non-strict total order by\n\n\\[a\\leq b \\quad\\Longleftrightarrow\\quad a<b\\ \\text{or}\\ a=b.\\]\n\nDefinitions must distinguish these conventions: antisymmetry is a property of the non-strict relation, whereas asymmetry—\\(a<b\\) implies that \\(b<a\\) is false—is a property of the strict relation."
    },
    {
      "heading": "Examples and nonexamples",
      "text": "The familiar numerical orders on the natural numbers, integers, rational numbers, and real numbers are total orders. Every subset inherits a total order by restricting the relation to its elements.\n\nOther constructions illustrate that total ordering need not be numerical:\n\n- Finite lists. Any listing of distinct elements \\(x_1,\\ldots,x_n\\) defines an order by \\(x_i\\leq x_j\\) exactly when \\(i\\leq j\\).\n- Reverse order. Given a total order \\(\\leq\\), defining \\(a\\leq_{\\mathrm{rev}}b\\) when \\(b\\leq a\\) produces another total order.\n- Lexicographic order. Ordered pairs can be compared by their first coordinates and, when these agree, by their second coordinates. This is a lexicographic order.\n- Empty and singleton sets. Both admit total orders. On the empty set the axioms hold vacuously.\n\nMany natural relations are not total. Inclusion on the power set of \\(\\{1,2\\}\\) is a partial order, but neither \\(\\{1\\}\\subseteq\\{2\\}\\) nor \\(\\{2\\}\\subseteq\\{1\\}\\). Divisibility on the positive integers is also a partial order rather than a total order: neither \\(2\\) divides \\(3\\) nor \\(3\\) divides \\(2\\).\n\nThe complex numbers can be totally ordered as a set, for example by lexicographically ordering their real and imaginary parts. However, no total order makes them an ordered field compatible with their usual addition and multiplication. In an ordered field every nonzero square is positive, which conflicts with \\(i^2=-1\\)."
    },
    {
      "heading": "Structure and comparison of orders",
      "text": "Least, greatest, minimal, and maximal elements\n\nAn element \\(m\\) is the least element of a subset \\(A\\) if \\(m\\in A\\) and \\(m\\leq a\\) for every \\(a\\in A\\). Greatest elements are defined dually.\n\nIn a partial order, a minimal element need only have no strictly smaller element within the subset; it need not be comparable with every other element. In a total order, comparability removes this distinction: every minimal element is least, and every maximal element is greatest.\n\nEvery nonempty finite totally ordered set has a unique least element and a unique greatest element. Infinite totally ordered sets need not have either. The integers have neither, while the natural numbers have a least element but no greatest element.\n\nFor any two elements of a totally ordered set, their minimum and maximum exist. This does not imply that arbitrary infinite subsets have minima, maxima, or least upper bounds.\n\nOrder isomorphism and order type\n\nTwo totally ordered sets \\((X,\\leq_X)\\) and \\((Y,\\leq_Y)\\) are order-isomorphic if there is a bijection \\(f:X\\to Y\\) such that\n\n\\[a\\leq_X b \\quad\\Longleftrightarrow\\quad f(a)\\leq_Y f(b).\\]\n\nThis is an isomorphism of their order structures. The particular names of the elements do not matter; only their relative positions do. The resulting structural pattern is called an order type.\n\nAll totally ordered sets with the same finite number of elements are order-isomorphic. Infinite sets behave differently. The natural numbers and integers have equal cardinality, but they are not order-isomorphic under their usual orders because one has a least element and the other does not.\n\nChains and linear extensions\n\nA chain in a partially ordered set is a subset whose inherited order is total. The whole partially ordered set need not be a chain.\n\nA linear extension of a partial order is a total order on the same set that preserves every existing comparison. The order-extension theorem, also called the Szpilrajn extension theorem, states that every partial order has a linear extension. The theorem holds in the usual framework of Zermelo–Fraenkel set theory with the axiom of choice; its unrestricted form is not provable in Zermelo–Fraenkel set theory alone.\n\nFor a finite partial order, a linear extension can be obtained by repeatedly selecting a minimal remaining element. In graph terms, this corresponds to arranging the vertices of a finite directed acyclic graph in an order consistent with its edges."
    },
    {
      "heading": "Well-ordering, density, and completeness",
      "text": "Totality determines whether elements are comparable, but it says little about gaps, endpoints, or infinite subsets.\n\nWell-orders\n\nA well-order is a total order in which every nonempty subset has a least element. The usual order on the natural numbers is a well-order; the usual order on the integers is not.\n\nEvery well-order has the order type of a unique ordinal number. These ideas became central to the study of infinite sets through the work of Georg Cantor in the late nineteenth century.\n\nThe well-ordering theorem states that every set can be well-ordered and is equivalent to the axiom of choice. A set's ability to admit some well-order does not mean that a particular familiar order on it is a well-order. The real numbers, for example, are not well-ordered by their usual order.\n\nDense orders\n\nA total order is dense if, whenever \\(a<b\\), there is an element \\(c\\) such that\n\n\\[a<c<b.\\]\n\nThe rational and real orders are dense; the integer order is not, since no integer lies strictly between \\(n\\) and \\(n+1\\).\n\nA classical classification theorem states that every countably infinite dense total order without a least or greatest element is order-isomorphic to the rationals with their usual order. Density alone does not characterize the real numbers.\n\nDedekind completeness\n\nA total order is Dedekind complete, in the least-upper-bound sense, if every nonempty subset that is bounded above has a least upper bound in the ordered set.\n\nThe real numbers have this property. The rationals do not: the set\n\n\\[A=\\{q\\in\\mathbb{Q}:q\\geq 0,\\ q^2<2\\}\\]\n\nis nonempty and bounded above in \\(\\mathbb{Q}\\), but it has no rational least upper bound.\n\nOrder completeness is distinct from metric completeness. One concerns bounds and order; the other concerns convergence of Cauchy sequences with respect to a metric. They are closely related for the usual real number system but are not interchangeable definitions for arbitrary structures."
    },
    {
      "heading": "Order topology",
      "text": "A total order determines a natural topology, called the order topology. It is generated by open rays of the forms\n\n\\[\\{x:x<a\\} \\qquad\\text{and}\\qquad \\{x:a<x\\}.\\]\n\nTheir finite intersections include open intervals\n\n\\[(a,b)=\\{x:a<x<b\\}.\\]\n\nThe order topology on the real numbers is their usual topology. On the integers, it is discrete: every singleton is open because\n\n\\[\\{n\\}=(n-1,n+1).\\]\n\nEvery linearly ordered set with its order topology is a Hausdorff space. Nevertheless, order structure and topological structure retain different information. For example, distinct non-isomorphic orders can induce homeomorphic topological spaces."
    },
    {
      "heading": "Applications and related comparison relations",
      "text": "Total orders underlie sorting, ordered indexes, range queries, and search procedures. A consistent comparison rule allows an algorithm to place data in a linear sequence. Lexicographic orders extend this principle to records with several fields.\n\nA comparison based on only one attribute may produce ties between distinct objects. For example, comparing people solely by height can place two different people in the same position. The resulting non-strict relation may be a total preorder: it is reflexive, transitive, and total, but not necessarily antisymmetric.\n\nFor a total preorder \\(\\preceq\\), define\n\n\\[a\\sim b \\quad\\Longleftrightarrow\\quad a\\preceq b\\ \\text{and}\\ b\\preceq a.\\]\n\nThis is an equivalence relation, and the resulting equivalence classes carry an induced total order. Adding a unique tie-breaking key instead produces a total order on the original objects.\n\nProgramming comparison rules require particular care. A sorting routine may require a strict weak order rather than a total order, allowing distinct objects to be equivalent for sorting purposes. Standard numerical comparisons in floating-point arithmetic also fail to provide a total order over all floating-point values when NaNs are included: comparisons involving a NaN do not obey trichotomy. A separately specified total-ordering convention can handle such values.\n\nIn ranking and preference models, totality is a substantive assumption rather than a consequence of consistency. It requires every pair to be comparable, even when the available information supports only a partial order."
    }
  ],
  "links": [
    "binary-relation",
    "partial-order",
    "natural-number",
    "integer",
    "rational-number",
    "real-number",
    "power-set",
    "complex-number",
    "bijective-function",
    "isomorphism",
    "cardinality",
    "zermelo-fraenkel-set-theory",
    "axiom-of-choice",
    "directed-acyclic-graph",
    "well-order",
    "ordinal-number",
    "georg-cantor",
    "complete-metric-space",
    "topology",
    "hausdorff-space",
    "algorithm",
    "equivalence-relation",
    "equivalence-class",
    "floating-point-arithmetic"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}