Definition:Characteristic Function (Set Theory)

Set
Let $E \subseteq S$.

The characteristic function of $E \ $ is the function $\chi_E: S \to \left\{{0, 1}\right\}$ defined as:
 * $\chi_E \left({x}\right) = \begin{cases}

1 & : x \in E  \\ 0 & : x \notin E \end{cases}$

Alternatively, and equivalently, it can be written as:
 * $\chi_E \left({x}\right) = \begin{cases}

1 & : x \in E  \\ 0 & : x \in \complement_S \left({E}\right) \end{cases}$

It can be expressed in Iverson bracket notation as:
 * $\chi_E \left({x}\right) = \left[{x \in E}\right]$

Relation
Let $\mathcal R \subseteq S \times T$ be a relation.

The characteristic function of $\mathcal R$ is the function $\chi_{\mathcal R}: S \times T \to \left\{{0, 1}\right\}$ defined as:
 * $\chi_{\mathcal R} \left({x, y}\right) = \begin{cases}

1 & : \left({x, y}\right) \in \mathcal R \\ 0 & : \left({x, y}\right) \notin \mathcal R \end{cases}$

It can be expressed in Iverson bracket notation as:
 * $\chi_{\mathcal R} \left({x, y}\right) = \left[{\left({x, y}\right) \in \mathcal R}\right]$

More generally, let $\mathbb S = \prod_{i=1}^n S_i = S_1 \times S_2 \times \ldots \times S_n$ be the cartesian product of $n$ sets $S_1, S_2, \ldots, S_n$.

Let $\mathcal R \subseteq \mathbb S$ be an $n$-ary relation on $\mathbb S$.

The characteristic function of $\mathcal R$ is the function $\chi_{\mathcal R}: \mathbb S \to \left\{{0, 1}\right\}$ defined as:
 * $\chi_{\mathcal R} \left({s_1, s_2, \ldots, s_n}\right) = \begin{cases}

1 & : \left({s_1, s_2, \ldots, s_n}\right) \in \mathcal R \\ 0 & : \left({s_1, s_2, \ldots, s_n}\right) \notin \mathcal R \end{cases}$

It can be expressed in Iverson bracket notation as:
 * $\chi_{\mathcal R} \left({s_1, s_2, \ldots, s_n}\right) = \left[{\left({s_1, s_2, \ldots, s_n}\right) \in \mathcal R}\right]$

Also known as
It is also known as the indicator function, and $\chi_E \left({x}\right)$ denoted $\mathbf 1_E \left({x}\right)$.