43. Predicates determine functions

43.1 Definition: characteristic function

Let $A$ be a set. Any subset $B$ of $A$ determines a characteristic function $\chi ^{A}_{B}\colon A \to \{\mathrm{TRUE},\mathrm{FALSE}\}$ defined by requiring that $\chi ^{A}_{B}(x) = \mathrm{TRUE}$ if $x \in B$ and $\chi ^{A}_{B}(x) = \mathrm{FALSE}$ if $x \notin B$.

43.1.1 Example If $A = \{ 1, 2, 3, 4\}$ and $B = \{ 1, 4\}$ then $\chi ^{A}_{B}(1) = \mathrm{TRUE}$ and $\chi ^{A}_{B}(2) = \mathrm{FALSE}$.

43.1.2 Fact $\chi ^{A}_{\emptyset}$ is the constant function which is always FALSE, and $\chi ^{A}_{A}$ is the constant TRUE.

43.1.3 Predicates as characteristic functions Since the extension of a predicate is a subset of its data type, the truth value of a predicate is the characteristic function of its extension. For example, the statement “$n$ is even” (about integers) is TRUE if $n$ is even and FALSE otherwise, so that the value of the characteristic function of the subset $E$ of $\mathrm{Z}$ consisting of the even integers is the truth value of the predicate “$n$ is even”.

Predicates with more than one variable similarly correspond to characteristic functions of subsets of Cartesian products. Thus the truth value of the statement “$m < n$” (about integers) is the characteristic function of the subset

$$\left\{ \langle m,n\rangle \mid m < n \right\}$$

of $\mathrm{Z}$ $\times$ $\mathrm{Z}$.

43.1.4 Exercise Give the graphs of these functions. $A = \{ 1, 2, 3\}$, $B = \{ 2, 3\}$.

a) $\chi ^{A}_{B}\colon A \to \{\mathrm{TRUE},\mathrm{FALSE}\}$.

b) The predicate “$n$ is odd” where $n$ is an element of $A$, regarded as a function to $\{\mathrm{TRUE},\mathrm{FALSE}\}$.

c) $+ \colon B \times B \to$ $\mathrm{Z}$. (Answer on page 245.)

43.1.5 Exercise Suppose that a predicate $P$ regarded as the characteristic function of its extension is a constant function. What can you say about $P$?

Pages 65–66 of the book (PDF).