TITLE: how to prove $f^{-1}(B_1 \cap B_2) = f^{-1}(B_1) \cap f^{-1}(B_2)$
QUESTION [11 upvotes]: I am given this equation: 
$f^{-1}(B_1 \cap B_2) = f^{-1}(B_1) \cap f^{-1}(B_2)$
I want to prove it: what i did is
I take any $a \in f^{-1}(B_1 \cap B_2)$, then there is $b \in (B_1 \cap B_2)$ so that $f(a)=b$. Because of $b \in (B_1 \cap B_2)$, it is true that $b \in B_1$ and $b \in B_2$, so $a \in f^{-1}(B_1)$ and $a \in f^{-1}(B_2)$.  
this means $f^{-1}(B_1 \cap B_2) \subseteq f^{-1}(B_1) \cap f^{-1}(B_2)$. 
is it ok?

REPLY [8 votes]: Here is essentially the first answer, written out a bit more formally.
Let's start with the basic property of $\;f^{-1}[\cdot]\;$:
$$
a \in f^{-1}[B] \;\equiv\; f(a) \in B
$$
for any $\;a,B\;$.  Using this, we can simply calculate
\begin{align}
& a \in f^{-1}[B_1 \cap B_2] \\
\equiv & \;\;\;\;\;\text{"the above basic property"} \\
& f(a) \in B_1 \cap B_2 \\
\equiv & \;\;\;\;\;\text{"definition of $\;\cap\;$"} \\
& f(a) \in B_1 \;\land\; f(a) \in B_2 \\
\equiv & \;\;\;\;\;\text{"the above basic property, twice"} \\
& a \in f^{-1}[B_1] \;\land\; a \in f^{-1}[B_2] \\
\equiv & \;\;\;\;\;\text{"reintroduce $\;\cap\;$ using its definition"} \\
& a \in f^{-1}[B_1] \cap f^{-1}[B_2] \\
\end{align}
By set extensionality, the statement in question follows.