# Union and intersection of functions

Please who can explain why $$f(A \cup B) = f(A) \cup f(B)$$ (And I know how to prove it using set theory symbols ) But $$f(A \cap B) \subseteq f(A) \cap f(B)$$

And the equality arises if and only if $f$ is injective.

• Use element chasing. Suppose $y\in f(A\cup B)$. What does that mean by the definition of what $f(A\cup B)$ is in the first place? It means that there must be some $x\in A\cup B$ such that $f(x)=y$. Now... since $x\in A\cup B$ there are two (not exclusive) possibilities, we either have $x\in A$ or we have $x\in B$. In the first case it follows that $y\in f(A)$ and so $y\in f(A)\cup f(B)$. In the second case, similar things occur. That shows $f(A\cup B)\subseteq f(A)\cup f(B)$. Now, do the same thing but in reverse to show the opposite inclusion and therefore equality. Jan 1, 2018 at 16:40
• OK thanks I'll do just that Jan 1, 2018 at 18:36
• Example. Suppose $a\ne b$ and $f(a)=f(b)$. Let $A=\{a\}$ and $B=\{b\}.$ Jan 1, 2018 at 18:38

$f(A \cap B) \subseteq f(A) \cap f(B)$

$x\in A\cap B \implies x\in A$ and $x\in B \implies f(x) \in$ $f(A)\cap f(B)$.

converse need not be true. Consider $f(x)=\sin x, A=[0,\frac{\pi}{2}]$, $B=[\frac{\pi}{2},\pi]$, $f(B)=f(A)=[0,1]$.

Suppose $f$ is injective, $y \in f(A)\cap f(B)$. That is $y=f(a), a \in A$ and $y=f(b), b \in B$. $\because f$ is injective $\implies$ $a=b$ $\implies$ $y\in f(A\cap B).$

• @JoseCarlosSantos Thank you sir
– user464147
Jan 1, 2018 at 18:12

First we show $$f(A \cup B) = f(A) \cup f(B)$$ which is easier to explain.If $$y\in f(A\cup B)$$ then $y=f(x)$ for some $x\in A\cup B.$ That is $x\in A$ or $x\in B$.Therefore $f(x)\in f(A)$ or $f(x)\in f(b)$ that is $$y=f(x)\in f(A)\cup f(B).$$ On the other hand if $$y\in f(A)\cup f(B).$$then $y\in f(A)$ or $y\in f(B)$. If $y\in f(A)$, there exists an $x\in A$ such that $f(x)=y$ and if $y\in f(B)$then there exists an $x\in B$ such that $f(x)=y$. In either case $x\in A\cup B$ which implies $$y=f(x)\in f(A\cup B).$$ Now we get to the $$f(A \cap B) \subseteq f(A) \cap f(B)$$If $$y\in f(A\cap B)$$then $y=f(x)$ for some $x\in (A\cap B).$ That is $x\in A$ and $x\in B$.Therefore$f(x)\in f(A)$ and $f(x)\in f(b)$ that is $$y=f(x)\in f(A)\cap f(B).$$ Now we get to the tricky part. If $$y=f(x)\in f(A)\cap f(B).$$ then $y\in f(A)$ and $y\in f(B)$ That is for some $x_1$ in $A$ we have $f(x_1)=y$ and for some $x_2\in B$ we have $f(x_2)=y.$ Since $x_1=x_2$ if and only if $f$ is injective, we can not include that $y\in f(A\cap B)$ unless $f$ is injective.

An element of $$f(A) \cap f(B)$$ can come from a single element in $$A \cap B$$ or two distinct elements in $$A \cap B$$. An element of $$f(A \cap B)$$ can only come from one distinct element in $$A \cap B$$.

This can be shown using the logic of set membership and intersections.

For a function $$f:X \to Y$$, the set membership logic for an element $$y \in Y$$ is:

$$\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space y \in f(X) \iff y = f(x)$$ for some $$x \in X$$

From here on, "for some $$x \in X$$" (or $$a \in A$$, etc), will be implied when $$f(x)$$ (or $$f(a)$$, etc) appears, to make reading easier. The logic of intersections is: $$x \in A \cap B \iff (x \in A) \wedge (x\in B)$$

Then for a function $$f:(A \cup B) \to X$$, the intersection of the images is: $$x \in f(A) \cap f(B) \iff (x \in f(A)) \wedge (x \in f(B))$$

$$\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\iff (x = f(a)) \wedge (x = f(b))$$

Note that this carries the implications $$f(a) = f(b) = x$$ and $$a,b \in A \cap B$$, but does not require that $$a = b$$. So any pair of points $$(a,b)$$ in $$A \cap B$$ such that $$f(a) = f(b)$$, distinct or not, corresponds to an element $$x$$ in $$f(A) \cap f(B)$$. But if we take the image of the intersection, we get:

$$\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space x \in f(A \cap B) \iff x = f(c)$$ for some $$c \in A \cap B$$

$$\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\iff (x = f(a)) \wedge (x=f(b)) \wedge (a=b)$$

$$\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\iff (x \in f(A) \cap f(B)) \wedge (a=b)$$

... And we see that the image of the intersection is the intersection of the images with the restriction that only single points in $$A \cap B$$ (as opposed to pairs of points) correspond to the members of $$f(A) \cap f(B)$$. Therefore, $$x \in f(A \cap B) \to x \in f(A) \cap f(B)$$, which in terms of sets defines $$f(A \cap B) \subseteq f(A) \cap f(B)$$.

However if $$f$$ is an injection, then $$f(a) = f(b) \to a = b$$, and then $$x \in f(A) \cap f(B) \iff x \in f(A \cap B)$$, which in terms of sets defines the equality $$f(A) \cap f(B) = f(A \cap B)$$.

To show that $$f(A) \cap f(B) = f(A \cap B)$$ implies $$f$$ is an injection, we noted that in logical terms this equality means that for all $$x \in X$$: $$x \in f(A) \cap f(B) \iff x \in f(A \cap B)$$ $$\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space(x = f(a)) \wedge (x=f(b)) \iff (x = f(a)) \wedge (x=f(b)) \wedge (a=b)$$

Again, since both sides imply $$a,b \in A \cap B$$, we have for all $$a$$ and $$b$$ in $$A \cap B$$: $$(f(a) = f(b)) \iff (f(a) = f(b)) \wedge (a = b)$$

which means $$(f(a) = f(b)) \to (a = b)$$ (you can check that $$(P \iff P \wedge Q) \to (P \to Q)$$ is a tautology). This is the contrapositive equivalent of the condition for an injection, which is $$a \neq b \to f(a) \neq f(b)$$