In mathematics, a ternary relation or triadic relation is a finitary relation in which the number of places in the relation is three. relations may also be referred to as 3-adic, 3-ary, 3-dimensional, or 3-place.
Just as a binary relation is formally defined as a set of pairs, i.e. a subset of the Cartesian product of some sets A and B, so a ternary relation is a set of triples, forming a subset of the Cartesian product of three sets A, B and C.
An example of a ternary relation in elementary geometry involves triples of points. In this case, a triple (A,B,C) is in the relation if the three points are collinearâÂÂthat is, they lie on the same straight line. Another geometric example of a ternary relation considers triples consisting of two points and a line. Here, a triple (A,B,âÂÂ) belongs to the relation if the line â passes through both points A and B; in other words, if the two points determine or are incident with the line.
A function in two variables, mapping two values from sets A and B, respectively, to a value in C associates to every pair (a,b) in an element f(a, b) in C. Therefore, its graph consists of pairs of the form . Such pairs in which the first element is itself a pair are often identified with triples. This makes the graph of f a ternary relation between A, B and C, consisting of all triples , satisfying , , and
Given any set A whose elements are arranged on a circle, one can define a ternary relation R on A, i.e. a subset of , by stipulating that holds if and only if the elements a, b and c are pairwise different and when going from a to c in a clockwise direction one passes through b. For example, if represents the hours on a clock face, then holds and does not hold.
The ordinary congruence of arithmetics
which holds for three integers a, b, and m if and only if m divides , formally may be considered as a ternary relation. However, usually, this instead is considered as a family of binary relations between the a and the b, indexed by the modulus m. For each fixed m, indeed this binary relation has some natural properties, like being an equivalence relation; while the combined ternary relation in general is not studied as one relation.
A typing relation indicates that e is a term of type ÃÂ in context ÃÂ, and is thus a ternary relation between contexts, terms and types.
Given homogeneous relations A, B, and C on a set, a ternary relation can be defined using composition of relations AB and inclusion . Within the calculus of relations each relation A has a converse relation A<sup>T</sup> and a complement relation . Using these involutions, Augustus De Morgan and Ernst Schröder showed that is equivalent to and also equivalent to . The mutual equivalences of these forms, constructed from the ternary relation are called the Schröder rules.