Set Theory: Proof of existence of surjection As part of a larger proof, I have to show that there does not exist a surjection $\pi: A \rightarrow P(A)$, where $P(A)$ is the power set of the set $A$.
I am having a problem with the proof given in the book. It is given as follows:
Assume towards a contradiction that there exists a surjection $\pi: A \rightarrow P(A)$ and define $$ B = \{x \in A | x \notin \pi (x)\}.$$
Then $x \in B$ $\iff$  $x\notin \pi(x)$.  $B$ is a subset of $A$, and since $\pi$ is a surjection, there exists $b \in A$ such that $B = \pi(b)$.
Then we have that $b \in B$ $\iff$ $b \notin \pi(b) = B$.  Contradiction.
My question is: how can it be fine to define B in the first place?  I feel like saying there exists such a set is based on the assumption that $\pi$ is not a surjection.  If there was a surjection, then B would be empty.  Am I missing something here?  
Thanks in advance for any help.
 A: There are two points here:


*

*If $B$ is empty it's fine. Because $\varnothing\in\mathcal P(A)$, so it is a valid candidate for being in the range of $\pi$.

*There is no need to assume that $\pi$ is a surjection. Just take any function $\pi\colon A\to\mathcal P(A)$, and define $B$ as in the proof, then $B$ is not in the range of $\pi$ (in particular, it means $\pi$ cannot be surjective).
What is imperative to remember here is that $B$ depends on $\pi$. So different functions define different $B$'s. But the definition is fine because $\pi$ is given, and we can always determine whether or not $a\in\pi(a)$, so we can always determine if $a\in B$ or not.
A: $B$ is defined to be the set of all elements in $A$ that are not mapped to a set containing themselves by $\pi$. As $\pi$ is a surjection by assumption all this means is that any $x  \in B$ contained in any set $S$ in $P(A)$ requires that $S$ is the mapping of some $y \in \{ z \in A:z \neq x \} $ under $\pi$. I.e $S=\pi (y)$.
A: For each $x$ in $A$, $π(x)$ is a subset of A.  So either $x$ is in $π(x)$ or it isn't.  We are letting $B$ be the set of $x$'s for which it isn't. 
We could also give a name such as $C$ to the set of $x$'s for which it is true that $x$ is in $π(x)$.  If we did, then $B$ and $C$ would partition $A$.  
Since $B$ is a subset of $A$ and $π$ is surjective, then there is some element, call it $b$, that $π$ maps to $B$.  The contradiction comes from considering whether or not $b$ is an element of $B$.  That is, whether $b$ is in $B$ or $C$.  If we assume $b$ is in $B$, then we can argue that it is in $C$ and vice versa.  However, $B$ and $C$ are disjoint giving us the contradiction.
