{
  "id": "transitive-relation",
  "title": "Transitive Relation",
  "lang": "en",
  "source_lang": "en",
  "summary": "A transitive relation is a binary relation in which a relation from one element to a second and from the second to a third implies the same relation from the first to the third.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Transitive binary relation"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/transitive-relation/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/transitive-relation/",
      "json": "https://aiwiki.page/zh/transitive-relation.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A transitive relation is a binary relation \\(R\\) on a set \\(A\\) such that, whenever \\(aRb\\) and \\(bRc\\), it follows that \\(aRc\\). Here \\(aRb\\) means that the ordered pair \\((a,b)\\) belongs to \\(R\\). Transitivity is a defining property of order relations and equivalence relations, and it underlies reasoning about chains of comparisons, implications, and reachability."
    },
    {
      "heading": "Definition",
      "text": "Formally, a relation \\(R\\subseteq A\\times A\\), where \\(A\\times A\\) is the Cartesian product of \\(A\\) with itself, is transitive if\n\n\\[\\forall a,b,c\\in A,\\qquad (aRb\\land bRc)\\Longrightarrow aRc.\\]\n\nThis is a universally quantified condition in first-order logic. It must hold for every choice of \\(a,b,c\\); these elements need not be distinct.\n\nTransitivity can also be expressed using the composition of relations. Define\n\n\\[R\\circ R = \\{(a,c)\\in A\\times A: \\text{there exists }b\\in A \\text{ with }aRb\\text{ and }bRc\\}.\\]\n\nThen\n\n\\[R\\text{ is transitive} \\quad\\Longleftrightarrow\\quad R\\circ R\\subseteq R.\\]\n\nThe inclusion need not be an equality. For example, the relation \\(R=\\{(a,b)\\}\\) on two distinct elements is transitive, but \\(R\\circ R\\) is empty."
    },
    {
      "heading": "Examples and counterexamples",
      "text": "Several familiar mathematical relations are transitive:\n\n- Equality: if \\(a=b\\) and \\(b=c\\), then \\(a=c\\).\n- Numerical order: both \\(<\\) and \\(\\leq\\) on the real numbers are transitive.\n- Set inclusion: if \\(A\\subseteq B\\) and \\(B\\subseteq C\\), then \\(A\\subseteq C\\). Thus inclusion defines a transitive relation on any collection of sets.\n- Divisibility: on the positive integers, if \\(a\\mid b\\) and \\(b\\mid c\\), then \\(a\\mid c\\). Indeed, writing \\(b=ak\\) and \\(c=b\\ell\\) gives \\(c=a(k\\ell)\\).\n- Congruence: for a fixed positive integer \\(n\\), if \\(a\\equiv b\\pmod n\\) and \\(b\\equiv c\\pmod n\\), then \\(a\\equiv c\\pmod n\\). This is a basic relation in modular arithmetic.\n\nMany other relations are not transitive:\n\n- Inequality: \\(1\\ne2\\) and \\(2\\ne1\\), but \\(1\\ne1\\) is false. This illustrates why repeated elements must be considered when checking the definition.\n- Being a parent of: a parent of a parent is not thereby a parent of the same person. By contrast, the relation “is an ancestor of” is transitive.\n- Being within a fixed distance: on the real line, define \\(xRy\\) by \\(|x-y|<1\\). Then \\(0R0.75\\) and \\(0.75R1.5\\), but \\(0R1.5\\) is false.\n- Having a common member: two sets may intersect, and the second may intersect a third, without the first and third intersecting.\n\nTo disprove transitivity, it is enough to exhibit a single triple satisfying \\(aRb\\) and \\(bRc\\) but not \\(aRc\\)."
    },
    {
      "heading": "Vacuous transitivity and intransitivity",
      "text": "A relation can be transitive even when it contains no chain of two consecutive related pairs. In that case, the premise \\(aRb\\land bRc\\) is never true, so the defining implication holds vacuously. The empty relation is therefore transitive on every set.\n\nA distinction is needed between a relation that is not transitive and one that is antitransitive. Antitransitivity means\n\n\\[\\forall a,b,c\\in A,\\qquad (aRb\\land bRc)\\Longrightarrow \\neg aRc.\\]\n\nFailure of transitivity requires at least one counterexample; antitransitivity forbids the conclusion for every two-step chain. A relation may contain some chains whose endpoints are related and others whose endpoints are not, making it neither transitive nor antitransitive.\n\nThe term intransitive is sometimes used for failure of transitivity and sometimes for the stronger antitransitive condition, so its intended meaning must be checked. Vacuously, a relation with no two-step chains is both transitive and antitransitive."
    },
    {
      "heading": "Connection with other relation properties",
      "text": "Transitivity is distinct from reflexivity, symmetry, and antisymmetry:\n\n- Reflexivity: \\(aRa\\) for every \\(a\\).\n- Symmetry: \\(aRb\\) implies \\(bRa\\).\n- Antisymmetry: \\(aRb\\) and \\(bRa\\) together imply \\(a=b\\).\n- Irreflexivity: \\(aRa\\) holds for no \\(a\\).\n\nDifferent combinations define important classes of relations.\n\nEquivalence relations\n\nAn equivalence relation is reflexive, symmetric, and transitive. Transitivity ensures that elements linked through an intermediate equivalent element are themselves equivalent. Together, these properties organize a set into disjoint equivalence classes.\n\nSymmetry and transitivity alone do not imply reflexivity on the entire underlying set. They do, however, imply \\(aRa\\) for any element \\(a\\) participating in a related pair: from \\(aRb\\), symmetry gives \\(bRa\\), and transitivity then gives \\(aRa\\).\n\nOrders and preorders\n\nA partial order is reflexive, antisymmetric, and transitive. Set inclusion and divisibility on positive integers are standard examples.\n\nA preorder is reflexive and transitive, without necessarily being antisymmetric. For a preorder \\(R\\), define\n\n\\[a\\sim b \\quad\\Longleftrightarrow\\quad aRb\\text{ and }bRa.\\]\n\nThen \\(\\sim\\) is an equivalence relation. The rule\n\n\\[[a]\\preceq[b] \\quad\\Longleftrightarrow\\quad aRb\\]\n\ndefines a well-defined partial order on its equivalence classes.\n\nA strict partial order is irreflexive and transitive. These properties imply asymmetry: if both \\(aRb\\) and \\(bRa\\) held, transitivity would give \\(aRa\\), contradicting irreflexivity."
    },
    {
      "heading": "Chains and directed graphs",
      "text": "Repeated application of transitivity extends the two-step condition to every finite chain. If \\(R\\) is transitive and\n\n\\[a_0Ra_1,\\quad a_1Ra_2,\\quad \\ldots,\\quad a_{n-1}Ra_n,\\]\n\nwhere \\(n\\geq1\\), then \\(a_0Ra_n\\). This follows by mathematical induction.\n\nIn graph theory, a relation can be represented by a directed graph whose vertices are elements of \\(A\\), with an edge from \\(a\\) to \\(b\\) whenever \\(aRb\\). The relation is transitive precisely when every directed walk of length two has a direct edge joining its starting vertex to its ending vertex. Equivalently, every finite directed walk of positive length has such an edge.\n\nConsequently, a transitive relation containing a directed cycle must contain loops at the vertices of that cycle. An irreflexive transitive relation cannot contain a directed cycle."
    },
    {
      "heading": "Transitive closure",
      "text": "The transitive closure of \\(R\\), commonly denoted \\(R^+\\), is the smallest transitive relation containing \\(R\\). Define \\(R^1=R\\) and let \\(R^n\\) consist of pairs connected by a chain of exactly \\(n\\) steps. Then\n\n\\[R^+=\\bigcup_{n=1}^{\\infty}R^n.\\]\n\nThus \\(aR^+b\\) means that \\(b\\) is reachable from \\(a\\) by a finite, positive number of \\(R\\)-steps.\n\nThe reflexive transitive closure additionally includes every identity pair:\n\n\\[R^*=I_A\\cup R^+, \\qquad I_A=\\{(a,a):a\\in A\\}.\\]\n\nIt permits paths of length zero, whereas \\(R^+\\) does not. Nevertheless, \\(R^+\\) may contain identity pairs when \\(R\\) has cycles.\n\nFor example, if\n\n\\[R=\\{(a,b),(b,c)\\},\\]\n\nthen\n\n\\[R^+=\\{(a,b),(b,c),(a,c)\\}.\\]\n\nTransitive closure is used to compute reachability, indirect dependencies, and the consequences of repeatedly applying a relation."
    },
    {
      "heading": "Matrix representation and computation",
      "text": "For a finite set \\(A=\\{a_1,\\ldots,a_n\\}\\), represent \\(R\\) by its adjacency matrix \\(M\\), where \\(M_{ij}=1\\) when \\(a_iRa_j\\), and \\(M_{ij}=0\\) otherwise.\n\nUsing Boolean matrix multiplication, define\n\n\\[(M\\odot M)_{ij} = \\bigvee_{k=1}^{n} (M_{ik}\\land M_{kj}).\\]\n\nThe entry is \\(1\\) exactly when a two-step path exists from \\(a_i\\) to \\(a_j\\). Therefore,\n\n\\[R\\text{ is transitive} \\quad\\Longleftrightarrow\\quad M\\odot M\\leq M,\\]\n\nwhere the inequality is entrywise.\n\nA direct test examines all triples and takes \\(O(n^3)\\) time, using big-O notation. Warshall’s algorithm also computes transitive closure in \\(O(n^3)\\) time by successively allowing each vertex as an intermediate point."
    },
    {
      "heading": "Preservation properties",
      "text": "Several operations preserve transitivity:\n\n- Intersections: any nonempty intersection of transitive relations on the same set is transitive.\n- Converse: if \\(R\\) is transitive, its converse \\(R^{-1}\\), defined by \\(aR^{-1}b\\) exactly when \\(bRa\\), is transitive.\n- Restriction: if \\(B\\subseteq A\\), then \\(R\\cap(B\\times B)\\) is transitive whenever \\(R\\) is transitive.\n\nUnions do not generally preserve transitivity. For distinct \\(a,b,c\\), both \\(\\{(a,b)\\}\\) and \\(\\{(b,c)\\}\\) are transitive, but their union is not, because it omits \\((a,c)\\). Arbitrarily deleting pairs can likewise destroy transitivity: removing \\((a,c)\\) while retaining \\((a,b)\\) and \\((b,c)\\) creates a counterexample."
    }
  ],
  "links": [
    "binary-relation",
    "cartesian-product",
    "first-order-logic",
    "real-number",
    "integer",
    "modular-arithmetic",
    "empty-set",
    "equivalence-relation",
    "equivalence-class",
    "partial-order",
    "mathematical-induction",
    "graph-theory",
    "directed-graph",
    "transitive-closure",
    "adjacency-matrix",
    "matrix-multiplication",
    "big-o-notation"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}