Given a set , its diagonal function is a function from to its cartesian square , often denoted , , or an obvious variation.
Specifically, the diagonal function of maps an element of to the pair :
Note that this map is an injection, so it defines a subset of , also called the diagonal of ; this is the origin of the term.
The concept can be generalised to any category in which the product exists; see diagonal morphism.
A topological space is Hausdorff if and only if its diagonal function is a closed map; this fact can be generalised to other notions of space.