How is "$f(x)$ is the set of all children of $x$" a function? How is this a function?
$f(x)$ is the set of all children of $x$
On my slides it says that:

Though this f is a function, it is NOT a $H \to H$ function, because each person is associated with a set of people rather than one person. (This $f$ is a $H \to P(H)$ function.)

I have some questions

*

*I thought a function associates each element from the domain to exactly one element in the codomain but I have never seen this kind of function where each element in the domain is mapped to a set of elements. How is this a function? How would that work? If someone could show me visually through a diagram that would be fantastic


*Some people don't have children, so that means elements in the domain wouldn't be mapped, so how would this be a function?


*How is the power set of $H$ going to be the set of children? Why are we using the domain elements to create the codomain (since we're taking the power set of $H$...our domain)?
Thanks in advance
 A: I assume $H$ is the set of all humans. The power set $P(H)$ is a set of sets: that is, an element of $P(H)$ is precisely a subset of $H$. By convention, this includes the empty set $\emptyset$ with no elements, which is considered a subset of $H$.
To address your questions:

*

*You are exactly correct that an object maps each element of the domain to an element of the codomain. Since this function $f$ does not map a human to another human, it's not a function $H\to H$ as you correctly observed. However, it is a function $H\to P(H)$, because it maps each element of $H$, a human, to an element of $P(H)$, a set of humans.

*Yes, some people don't have children, but they are still mapped by the function $f$. In particular, they are mapped to the empty set $\emptyset$, which is an element of the codomain $P(H)$.

*The power set $P(H)$ is not the set of children in any sense. It is the collection of all sets of humans. The image of any human $h\in H$ under the function $f$ represents the set of children of $h$. This is an important difference. Furthermore, when defining functions we are allowed to take any sets as domain and codomain. The fact that the codomain here is the power set of the domain is not so important and isn't anything special at all, and we are not using the domain to "create the codomain".

A: A concrete example may be revealing.

*

*"A set of element" can be an element of some (other) set.  Consider
the map $f:\{0,1,2,3,4\}\to\{\{2,3\},\emptyset\}$ with $$
f(0)=\{2,3\},\quad f(1)=\{2,3\},\quad f(2)=f(3)=f(4)=\emptyset $$
Note that the set $\{0,1\}$ is a set of elements in the domain of
$f$; it is also an element of the codomain.


*Consider $f(2)$ above.


*Again consider the example in 1.
