TITLE: Counterexample, union of intersections, intersection of unions
QUESTION [5 upvotes]: I am looking for an example which illustrates that the following doesn't have to be an equality:
$$\bigcup _{i \in I} \bigcap _{k \in K} A_{ik} \subset \bigcap _{k \in K} \bigcup _{i \in I} A_{ik} $$.
It is quite easy to prove the inclusion: $x \in \bigcup _{i \in I} \bigcap _{k \in K} A_{ik}  \iff \exists i \in I : \ \forall k \in K \ : \  x \in A_{ik} \implies \forall k \in K: \ \exists i \in  I : x \in A_{ik}$
We generally have that $$\exists x  : \ \forall y \ : \phi(x, y) \implies \forall y: \ \exists x : \phi(x, y)$$ and here the counterexample for the reverse implication is taking $\phi(x, y)$ to be the relation $x<y, \ x, y \in \mathbb{R}$.
But taking the set $A_{ik} = \{ i \in \mathbb{R}  \ : \ i<k\}$ doesn't work here:
$$\bigcap_{k \in K} A_{ik} = \bigcap_{k \in K} \{ i \in \mathbb{R}    \ : \ i<k\} = \emptyset \ \ \  \text{as} \ \ \  k \to - \infty.$$
And if we take the union  $$\bigcup_{i \in I} A_{ik} = \bigcup_{i \in I} \{ i \in \mathbb{R}    \ : \ i<k\} $$ we don't get anything new, we just get $A_{ik}$.
Am I doing something wrong? Could you please point that mistake out for me?

REPLY [5 votes]: $\forall k\in K\exists i\in I\; x\in A_{ik}$ does not guarantee
that some $i\in I$ exists with $\forall k\in K\; x\in A_{ik}$.
Note especially that for every $k$ the $i$ with $x\in A_{ik}$ somehow depends on $k$.

Counterexample:
Let $K=I=\left\{ 1,2\right\} $. 
Let $A_{11}=A_{22}=\{0\}$ and let $A_{12}$ and $A_{21}$ both be sets that do not contain $0$ as element. 
You could go for $A_{12}=A_{21}=\varnothing$. 
Then $0$ is element of RHS, but not of LHS.

REPLY [5 votes]: For integers $i, k \ge 0$, let $A_{ik} = [\frac {k+1} {i+k+1}, 1]$.
Then for fixed $i$, $\bigcap_k A_{ik} = \{1\}$, so $$\bigcup_i \bigcap_k A_{ik} = \{1\}. \tag{UI}$$
However, for fixed $k$, $\bigcup_i A_{ik} = (0,1]$, so $$\bigcap_k \bigcup_i A_{ik} = (0,1]. \tag{IU}$$
Thus (UI) is strictly included in (IU).