# Transitive closure

In mathematics, the transitive closure of a binary relation R on a set X is the smallest transitive relation on X that contains R.

For any relation R the transitive closure of R always exists. To see this note that the intersection of any family of transitive relations is again transitive. Furthermore, there exists at least one transitive relation containing R, namely the trivial one: X × X. The transitive closure of R is then given by the intersection of all transitive relations containing R.

We can describe the transitive closure of R in more concrete terms as follows. Define a relation T on X by saying xTy iff there exists a finite sequence of elements (xi) such that x = x0 and

x0Rx1, x1Rx2, …, xn−1Rxn, and xnRy
Formal notation: [itex]R^+ = \bigcup_{i\in\mathbb{N}} R^i[itex]

It is easy to check that the relation T is transitive and contains R. Furthermore, any transitive relation containing R must also contain T, so T is the transitive closure of R.

 Contents

## Demonstration that T is the smallest transitive relationship containing R

Let A be any set of elements.

Supposition: [itex]\exists[itex]GA transitive relationship [itex]\left / \right .[itex] RA[itex]\subseteq[itex]GA [itex]\wedge[itex] TA[itex]\not\subseteq[itex]GA. So, [itex]\exists[itex](a,b)[itex]\not\in[itex]GA. So, that particular (a,b)[itex]\not\in[itex]RA.

Now, by definition of T, we know that [itex]\exists[itex]n[itex]\in \mathbb{N} \left / \right .[itex] (a,b)[itex]\in[itex]RnA. Then, [itex]\forall[itex]i[itex]\in \mathbb{N}[itex], i[itex]<[itex]n [itex]\Rightarrow[itex] ei[itex]\in[itex]A. So, there is a path from a to b like this: aRAe1RA...RAe(n-1)RAb.

But, by transitivity of GA on RA, [itex]\forall[itex]i[itex]\in \mathbb{N}[itex], i[itex]<[itex]n [itex]\Rightarrow[itex] (a,ei)[itex]\in[itex]GA, so (a,e(n-1))[itex]\in[itex]GA [itex]\wedge[itex] (e(n-1),b)[itex]\in[itex]GA, so by transitivity of GA, we get (a,b)[itex]\in[itex]GA. Absurd

Therefore, [itex]\forall[itex](a,b)[itex]\in[itex]A[itex]\times[itex]A, (a,b)[itex]\in[itex]TA [itex]\Rightarrow[itex] (a,b)[itex]\in[itex]GA. This means that T[itex]\subseteq[itex]G, for any transitive G containing R. So, T is the smallest transitive relationship containing R.

### Corollary

If R is transitive, then R = T.

## Examples

• If X is the set of humans (alive or dead) and R is the relation 'parent of', then the transitive closure of R is the relation "x is an ancestor of y."
• If X is a set of airports and xRy means "there is a direct flight from airport x to airport y", then the transitive closure of R is the relation "it is possible to fly from x to y in one or more flights."

## Uses

Note that the union of two transitive relations need not be transitive. In order to preserve transitivity one must take the transitive closure. This occurs, for example, when taking the union of two equivalence relations or two preorders. In order to obtain a new equivalence relation or preorder one must take the transitive closure (reflexivity and symmetry—in the case of equivalence relations—are automatic).

## Relationship to complexity

In computational complexity theory, the complexity class NL corresponds precisely to the set of logical sentences expressible using first order logic together with transitive closure. This is because the transitive closure property has a close relationship with the NL-complete problem STCON for finding directed paths in a graph. Similarly, the class L is first order logic with the commutative, transitive closure. When transitive closure is added to second order logic instead, we obtain PSPACE.de:Transitive Hülle

• Art and Cultures
• Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
• Space and Astronomy