In mathematics, a relation is an abstract way to describe how elements of one or more sets correspond to one another. Formally, an n-ary relation on sets S1, S2, …, Sn is any subset of the Cartesian product S1 × S2 × … × Sn. The most commonly studied case is the binary relation, a set of ordered pairs drawn from A × B. When the same set appears in every position (A × A for binary relations), the relation is called homogeneous; otherwise it is heterogeneous.
Basic concepts and notation
Key notions attached to a relation R ⊆ A × B include the domain (elements of A that occur in some pair), the range or image (elements of B that appear), the inverse relation R^{-1} ⊆ B × A, and the composition of relations when chaining correspondences. A function is a special kind of binary relation that pairs each element of its domain with exactly one element of the codomain.
Common properties of binary relations
Binary relations on a single set are classified by a small set of familiar properties. These help describe orders and equivalences:
- Reflexive: every element is related to itself; see reflexive.
- Symmetric: xRy implies yRx.
- Antisymmetric: xRy and yRx together imply x = y.
- Transitive: xRy and yRz imply xRz; see transitive.
- Irreflexive: no element is related to itself.
Combinations of these properties define structures such as equivalence relations (reflexive, symmetric, transitive) and partial orders (reflexive, antisymmetric, transitive). A total or linear order adds comparability for every pair of distinct elements.
Examples and concrete instances
Simple examples clarify the idea: equality on any set is an equivalence relation; the “less than” relation on numbers is a strict total order; divisibility on the positive integers is a partial order. Geometric examples include any curve in the plane as a subset of R × R. Relations also model connections in graphs: the adjacency relation of a graph relates vertices that share an edge.
Operations, logic, and databases
Because relations are sets, standard set operations (union, intersection, complement) apply. Additional relation-specific operations include projection (selecting some coordinates), selection (filtering tuples by a condition), join (combining relations by matching components), inversion, and composition. These operations appear both in the semantics of predicate logic—where n-ary relations interpret predicates—and in relational database theory, where tables are treated as relations and manipulated by relational algebra operators such as projection and join.
Historical notes and significance
The abstract treatment of relations became prominent alongside 19th- and early 20th-century developments in set theory and symbolic logic. Relations are central in many areas of mathematics and computer science: they organize order theory, equivalence and classification problems, the semantics of languages, the design of query languages for databases, and the modeling of networks. Their flexibility—able to describe correspondence, constraints, and interaction—makes them a foundational concept across disciplines.
Distinctions and useful remarks
It is important to distinguish relations from functions: every function is a relation, but most relations are not functions because they may associate an element with many partners. Binary relations are often studied for global properties, while n-ary relations naturally express multi-place predicates and database records. Understanding domain, range, inverse, composition and the listed properties gives a compact toolbox for analyzing and applying relations in theory and practice.
For further formal development and examples consult standard texts on set theory, discrete mathematics, or database systems; introductory treatments emphasize both the axiomatic definitions and the many practical instantiations of relations.







