# Is this function injective / surjective?

A question regarding set theory.

Let $g\colon P(\mathbb R)\to P(\mathbb R)$, $g(X)=(X \cap \mathbb N^c)\cup(\mathbb N \cap X^c)$

that is, the symmetric difference between $X$ and the natural numbers.

We are asked to show if this function is injective, surjective, or both.

I tried using different values of $X$ to show that it is injective, and indeed it would seem that it is, I can't find $X$ and $Y$ such that $g(X)=g(Y)$ and $g(X) \neq g(Y)$ but how do I know for sure? How do I formalize a proof for it?

Regarding surjective: I think that it is.

We can take $X=\mathbb R - \mathbb N$ and we get that $g(X)=\mathbb R$

What do I do about the injective part?

-
are you able to express in formula what injective or surjective means? –  Robert.Sie Nov 28 '13 at 14:14

Hint:

$$g\circ g = \mathrm{id}_{\mathcal{P}(\mathbb{R})}, \quad \text{ that is, } \quad \forall X \in \mathcal{P}(\mathbb{R}).\ g(g(X)) = X.$$

I hope this helps $\ddot\smile$

-

We can view subsets of $X$ as functions $X \to \{0,1\}$: 0 if the point is not in the set, It is commonly very useful to rewrite questions about subsets as questions about functions.

What form does $g$ take if we do this rewrite?

Terminology wise, if $S \subseteq X$, then $\chi_S$ is the function described above:

$$\chi_S(x) = \begin{cases} 0 & x \notin S \\ 1 & x \in S \end{cases}$$

It is called the characteristic function of $S$.

-
0 if $a \in X\cap \mathbb N$, 1 otherwise –  Oria Gruber Nov 28 '13 at 14:19
That's not right. To be more clear, $g(\chi_S)$ is a function. To describe this function, we could do so by writing down the equation that says what its value at a point $x$ is: i.e. what is $g(\chi_S)(x)$? –  Hurkyl Nov 28 '13 at 14:22

HINT: Recall that symmetric difference is associative and for every set $B$, $B\triangle B=\varnothing$.

-
And why was this downvoted? –  Asaf Karagila Nov 28 '13 at 22:04