Given a set , its diagonal is a subset of its cartesian square , often denoted , , or an obvious variation.
Specifically, the diagonal of consists of those pairs of the form for an element of :
The term “diagonal” arises because if we arrange the elements of in a matrix with the rows and columns labeled by elements of in the same order, then consists precisely of entries along the diagonal of the matrix.
When intepreted as a binary relation, is the equality relation on . This relation is both functional and entire; when interpreted as a function, it is the identity function on . Note that there is an obvious bijection from to ; thus, we can also interpret the diagonal as a function from to , called the diagonal function.
The concept can be generalised to any category in which the product exists; see diagonal subobject.
A topological space is Hausdorff if and only if its diagonal is a closed subspace of ; this fact can be generalised to other notions of space.