Bijections $f: \mathcal{P}(S) \to \{0,1\}^S$

functionssolution-verification

I'm trying to understand my professor's lecture notes, but I can't tell whether he's defining two bijective functions in both directions or two injective maps and invoking Shroder Bernstein.

Let $S$ be a set, $\mathcal{P}(S)$ its power set, and $\{0,1\}^S$ the set of functions from $S \to \{0,1\}$. Define two maps:
\begin{align*}
& f \colon \mathcal{P}(S) \to \{0,1\}^S, \; A \mapsto I_A \\
& g \colon \{0,1\}^S \to \mathcal{P}(S), \; f \to f^{-1} (1),
\end{align*}

where $I_A$ is the indicator function that sends $x \in A$ to $1$ and $x \not \in A$ to $0$. I believe both $f$ and $g$ are bijective.

We show $f$ is bijective. Given a function, call it $h: S \to \{0,1\}$. define $A = h^{-1} (1)$. It's clear that $h = I_A$; indeed, for $x \in S$, we have $h(x) = I_A (x) = 1$ and for $x \not \in S$, we have $h(x) = I_A (x) = 0$, so $h(x) = I_A (x)$ for all $x \in S$, so $f$ is surjective. Second, given $A,B$ for which $f(A) = f(B)$, we have $I_A = I_B$. I claim $A = B$. If $x \in A$, then we have $I_A (x) = I_B (x) = 1$, so $x \in B$. Similarly, if $x \in B$, we have $I_A (x) = I_B (x) = 1$, so $x \in A$, so $A = B$. So $f$ is injective, and hence bijective.

Now for $g$.

We show that $g$ is bijective. Let $A \in \mathcal{P}(S)$. Then $g\left(I_A\right) = A$, so $g$ is surjective. If $f,g \in \{0,1\}^S$ have the property that $f^{-1} (1) = g^{-1} (1)$, then $f^{-1} (0) = g^{-1} (0)$ since the domain of $f,g$ is $\{0,1\}$, so $f = g$, so $g$ is bijective.

I can't tell if $f$ and $g$ are inverses of each other, though they both seem to be bijective.

Best Answer

In the first proof you showed that for any $h \in \{0,1\}^S$ we have $$h = I_{h^{-1}(1)} = f(h^{-1}(1)) = f(g(h)) = (f \circ g)(h)$$ that is, you showed that $f \circ g = \operatorname{id}_{\{0,1\}^S}$. In the second proof, you showed that for any $A \in \mathcal P(S)$, $$A = g(I_A) = g(f(A)) = (g \circ f)(A)$$ in other words, $g \circ f = \operatorname{id}_{\mathcal P(S)}$.