# Inverse image of $Y$ and cardinality.

I need to solve the following exercise.

Let $$X$$ be a non empty set and $$P_2$$ the set whose elements are all the subsets of $$X$$ that have $$1$$ or $$2$$ elements.

We have $$f : X^2 \rightarrow P_2$$, $$(x, y) \mapsto \{x, y\}$$

Let $$Y\in P_2$$. Determine $$f^{-1}(\left\{{Y}\right\})$$ and find its cardinality depending on the cardinality of $$Y$$.

The only things that I've managed to figure out is that $$f$$ is surjective and that $$\text{card}(Y) = 1$$ or $$\text{card}(Y) = 2$$.

## 1 Answer

If $$card(Y)=1$$ then it means $$Y$$ has only one element $$x$$. Thus $$f^{-1}(\left\{{Y}\right\})=\left\{{(x,x)}\right\}$$.

If $$card(Y)=2$$ then $$Y=\left\{{x,y}\right\}$$ for some $$x,y \in$$ X. Thus $$f^{-1}(\left\{{Y}\right\})=\left\{{{(x,y)},{(y,x)}}\right\}$$

• Wouldn't $f^{-1}(Y)=\{(x,y);(y, x) \}$? Oct 9, 2021 at 16:19
• Yes, indeed @intheshadow Oct 9, 2021 at 16:25