stylistic:tone, information:classification
Complementary relation

A binary relation R {\displaystyle R} is defined as a subset of a product of sets X × Y. {\displaystyle X\times Y.} The complementary relation R ¯ {\displaystyle {\bar {R}}} is the set complement of R {\displaystyle R} in X × Y. {\displaystyle X\times Y.} The complement of relation R {\displaystyle R} can be written R ¯ = (X × Y) ∖ R. {\displaystyle {\bar {R}}\ =\ (X\times Y)\setminus R.} Here, R {\displaystyle R} is often viewed as a logical matrix with rows representing the elements of X, {\displaystyle X,} and columns elements of Y. {\displaystyle Y.} The truth of a R b {\displaystyle aRb} corresponds to 1 in row a, {\displaystyle a,} column b. {\displaystyle b.} Producing the complementary relation to R {\displaystyle R} then corresponds to switching all 1s to 0s, and 0s to 1s for the logical matrix of the complement.

Together with composition of relations and converse relations, complementary relations and the algebra of sets are the elementary operations of the calculus of relations.