Consider this function:
$$P: X\to \{true, false\}.$$
There's nothing in that expression that says when $X$ is true and when it is not true. How do these work?
$\endgroup$1 Answer
$\begingroup$Consider the expression $n < 3$. It can either true or false, depending on $n$.
Now put it into a function: $f(x) = (x < 3)$.
It takes $x$ and yields true or false! You can put a logical statement into a function and refer to it as $f(x)$.