Binary Relations in Set Theory and Binary Matrices

This article explores the mathematical definition of binary relations in formal set theory and explains their direct structural correspondence to binary matrices (matrices consisting entirely of 0s and 1s). It details how subsets of Cartesian products map directly to two-dimensional grids of bits, and demonstrates how fundamental relational operations—such as composition, union, intersection, and transposition—align seamlessly with Boolean matrix algebra.

Formal Definition of a Binary Relation

In formal set theory, a binary relation \(R\) between two sets \(A\) and \(B\) is defined as a subset of their Cartesian product, \(A \times B\). The Cartesian product represents the set of all ordered pairs \((a, b)\) such that \(a \in A\) and \(b \in B\):

\[R \subseteq A \times B = \{(a, b) \mid a \in A \text{ and } b \in B\}\]

If \((a, b) \in R\), we say that \(a\) is related to \(b\) by \(R\), often written as \(aRb\). When \(A = B\), \(R\) is referred to as a homogeneous binary relation on \(A\).

The Binary Matrix Representation

When sets \(A\) and \(B\) are finite, a binary relation can be represented as a logical or binary matrix, often called an adjacency or relation matrix.

Let \(A = \{a_1, a_2, \dots, a_m\}\) and \(B = \{b_1, b_2, \dots, b_n\}\) be finite sets with fixed orderings. The relation \(R \subseteq A \times B\) corresponds to an \(m \times n\) matrix \(M_R\), whose entries are elements of the binary domain \(\{0, 1\}\):

\[M_R(i, j) = \begin{cases} 1 & \text{if } (a_i, b_j) \in R \\ 0 & \text{if } (a_i, b_j) \notin R \end{cases}\]

Here, the row index \(i\) corresponds to the element \(a_i \in A\), the column index \(j\) corresponds to the element \(b_j \in B\), and the value indicates the presence (\(1\)) or absence (\(0\)) of the relation.

Operational Correspondence

The algebraic operations performed on relations correspond directly to operations on binary matrices using Boolean arithmetic (where addition corresponds to logical OR \(\lor\), and multiplication corresponds to logical AND \(\land\)):

Mapping Relation Properties to Matrix Properties

For homogeneous relations on a single set \(A\) (represented by an \(n \times n\) square binary matrix \(M\)), fundamental properties are easily verified through matrix structure:

This isomorphism allows computer systems to store, manipulate, and query abstract mathematical relations efficiently using compact bit arrays and standard matrix operations.