Infinite intersection and union, less than or equal to and less than

Can anyone show me why these sets are equal?

$$\{f \leq a \} = \bigcap_{k=1}^{\infty}\{f<a + \frac{1}{k}\}$$

$$\{f < a \} = \bigcup_{k=1}^{\infty}\{f \leq a - \frac{1}{k}\}$$

$f(x)$ is a function that can take on values over the extended real line, and $x$ is a point in n-dimensional Euclidean space. $a$ is a member of the extended real line.

-
By $\{f\le a\}$ you mean $\{x; f(x)\le a\}$, right? (To me, a more natural interpretation of $\{f\le a\}$, at least without more context, would be the set of all functions which are below the constant function $a$. Depending on which of these two interpretations you have in mind, the solution will be different.) – Martin Sleziak Aug 24 '12 at 5:51
By $\{f \leq a\}$ I mean $\{ x;f(x) \leq a\}$ – ncRubert Aug 24 '12 at 15:03

If $x \in \{f \leq a\}$, you have that $f(x) \leq a$. So $f(x) \leq a + \frac{1}{k}$ for all $k$. It has been shown that $\{f \leq a\} \subset \bigcap_{k = 1}^\infty \{f < a + \frac{1}{k}\}$.

If $x \in \bigcap_{k = 1}^\infty \{f < a + \frac{1}{k}\}$. Then $f(x) < a + \frac{1}{k}$ for all $k$. This can only happen if $f(x) \leq a$. So $\{f \leq a\} \supset \bigcap_{k = 1}^\infty \{f < a + \frac{1}{k}\}$

The first equality of sets has been shown.

The second is similar.

If $x \in \{f < a\}$, then $a - f(x) > 0$. Choose a $k$ such that $\frac{1}{k} \leq a - f(x)$. Then $f(x) \leq a - \frac{1}{k}$. Hence $x \in \{f \leq a - \frac{1}{k} \}$. Thus, $x \in \bigcup_{k = 1}^\infty \{f \leq a - \frac{1}{k}\}$.

Suppose $x \in \bigcup_{k = 1}^\infty \{f \leq a - \frac{1}{k}\}$. This means that $f(x) \leq a - \frac{1}{k}$ for some $k$. So $f(x) < a$. $x \in \{f < a\}$.

Equality of the two sets has been shown.

-
I think I'm still unclear on this part: if $x \epsilon \cap_{k=1}^{\infty}\{f<a + \frac{1}{k}\}$ then $f(x) \leq a +\frac{1}{k}$ for all $k$. Why is it not if $x \epsilon \cap_{k=1}^{\infty}\{f<a + \frac{1}{k}\}$ then $f(x) < a +\frac{1}{k}$ for all $k$? – ncRubert Aug 24 '12 at 4:24
@ncRubert If $x \in \bigcap_{k = 1}^\infty \{f < a + \frac{1}{k}\}$, by defintion of intersection $x \in \{f < a + \frac{1}{k}\}$ for all $k$. So $f(x) < a + \frac{1}{k}$ for all $k$. – William Aug 24 '12 at 4:28
@ncRubert Nevermind, that was a typo. – William Aug 24 '12 at 4:29
If $f(x) < a + \frac{1}{k}$ for all $k$ its obvious $f(x) < a$. I'm not clear on why you can write $f(x) \leq a < a + \frac{1}{k}$ for all $k$. I'm getting this out of the second line of your proof. Maybe there is something in an undergrad. text book I need to read? – ncRubert Aug 24 '12 at 15:13
@ncRubert Ask yourself, if $f(x) < a + \frac{1}{k}$ for all $k$, can it be possible that $f(x) = a$? This is true since $a < a + \frac{1}{k}$ for all $k$. Also convince yourself that if $f(x) > a$, then there exists a $k$ such that $a + \frac{1}{k} \leq f(x)$. – William Aug 24 '12 at 15:30

The second equation can also be proved by using the first one: Let $g = -f$. Then the first equation applied to $g$ and $-a$ is

$$\{g \le -a\} = \bigcap_{k=1}^\infty \left\{g < -a + \frac 1k\right\}.$$

Take the complement on both sides:

$$\{g > -a\} = \bigcup_{k=1}^\infty \left\{g \ge -a + \frac 1k\right\}.$$

Substitute $f$ in for $-g$:

$$\{f < a\} = \bigcup_{k=1}^\infty \left\{f \le a - \frac 1k\right\}.$$

-