# Challenge VIII: Discontinuities of a function solved by Theorem.

1. Aug 8, 2013

### micromass

An open set in $\mathbb{R}$ is any set which can be written as the union of open intervals $(a,b)$ with $a<b$.

A subset of $\mathbb{R}$ is called a $G_\delta$ set if it is the countable intersection of open sets.

Prove that if a set $A\subseteq \mathbb{R}$ is a $G_\delta$ set then there exists a function $f:\mathbb{R}\rightarrow \mathbb{R}$ such that $f$ is continuous at all points of $A$ and discontinuous at all points of $\mathbb{R}\setminus A$.

The converse holds as well and has a very easy proof using the Baire Category theorem. This characterizes the continuity set of a function.

This is a classis analysis result, so it can be easily googled if you want to. But I trust you to play it fair :tongue:

2. Aug 9, 2013

### Theorem.

This looks like a good choice of problem! I'm going to take a look at it in the morning and see what I can up with

3. Aug 9, 2013

### pwsnafu

Heh, had this on my measure theory exam.

4. Aug 9, 2013

### Theorem.

Let $A\subseteq \mathbb{R}$ be a $G_\delta$ subset. Then there exists
a countable collection of open sets $\{U_i\}$ s.t. $$A=\cap_{i\in \mathbb{Z}_+}U_i$$

We can take the $U_i$ to be nested so that
$$\mathbb{R}=U_1\supset U_2\supset \cdots \supset U_n\supset \cdots$$

I want to create a disjoint collection of subsets that "separate" the $U_i$ so that we can get a well defined function. The natural thing to do is assign $W_k:=U_k-U_{k+1}$
Then we have the countable collection of disjoint sets $\{W_i\}$.

EDIT: So now define $V_n=W_n -(int(W_n)\cap \mathbb{Q})$

We get the well defined function:
$$f:\mathbb{R}\rightarrow [0,1],\quad x\mapsto \begin{cases} 1/n & \text{ if } x\in V_n\\ 0 & \text{ if } x\notin V_n \text{ for any } n \end{cases}$$

We want to show that $f$ is only continuous on $A$. Let $x\in A$. Then $x\in U_i$ for every i. Note then that every $U_i$ is an open neighborhood of x. x cannot belong to any $W_i$, since that would imply it is not in Some $U_k$, contradiction the definition of $A$. Thus $f(x)=0$

Let $\epsilon >0$ be given. We can choose some positive integer $N$ such that $\frac{1}{N}<\epsilon$. As we noticed earlier, $U_N$ is an open neighborhood of $x$, and for all $x'\in U_N$ we have
$$|f(x)-f(x')|=|f(x')|<1/N<\epsilon.$$. Thus $f$ is continuous on $A$.

We still have to show that $f$ is discontinuous on all of $\mathbb{R}-A$. This
is the part I haven't gotten yet.

Start by noting $\mathbb{R}-A=\cup_{i\in \mathbb{Z}_+} W_i$. Let $x\in \mathbb{R}-A$. $x\in W_k$ for exactly one $k$. There are two cases:

1. $x\in int(W_k)\cap \mathbb{Q}$: Then $x\notin V_k$ and so $f(x)=0$.Let $U_x$ be any open nbhd of $x$. By the density of the irrationals in $\mathbb{R}$, there are points in $U_x$ that are in $V_k$, and thus map to $1/k$. Thus $f$ is not continuous at $x$.

2. $x\in V_k$. $f(x)=1/k$ If $x\in int(W_K)\cap (\mathbb{R}-\mathbb(Q))$ then we use the same argument as in 1 this time using the density of the rationals in $\mathbb{R}$.
Otherwise $x$ belongs to the boundary of $W_k$ and thus by definition any open nbhd around the x will contain points not in $W_k$ and hence $V_k$. This will give us discontinuity of $f$ at x.

Last edited: Aug 9, 2013
5. Aug 9, 2013

### jgens

Hint: You have the right idea but you need to modify your construction of f. Consider making it positive on Q∩Wk and negative on (R-Q)∩Wk.

6. Aug 9, 2013

### Theorem.

Thanks! I am going to look at it in a bit something else I considered is
letting $V_n=W_n-(int (W_n) \cap \mathbb{Q})$ and carrying out the definition of $f$ on $V_n$ instead of $W_n$ (which is basically what you just said). This might work but I wont have time till a bit later.

7. Aug 9, 2013

### Theorem.

Okay I think I got it using the above. Ill post it in a few minutes once i Tidy it up
EDIT: okay I re-added everything to my original post. I didn't include all the details in the last part but I think the idea should be clear enough.

Last edited: Aug 9, 2013
8. Aug 11, 2013

### verty

This question is heavy on terminology. But let me see what I can come up with.

The first obvious question to ask is, what does A look like? Given that A is the intersection of a countable family of open sets, we should start with open sets.

Open sets are made up of an arbitrary number of open intervals, possibly including those of the form (a,∞) or (-∞,a). In particular, these intervals may be separated by a single point, for example: (0,1) $\cup$ (1,2) or by infinitely many points: (0,1) $\cup$ (2,3).

Taking intersections, consider these examples:
#1. (0, 2), (1/2, 2), (3/4, 2), (7/8, 2), ...
#2. (0, 2), (0, 3/2), (0, 5/4), (0, 9/8), ...
#3. (0, 2), (1/2, 3/2), (3/4, 5/4), (7/8, 9/8), ...

The intersection of #1 is [1, 2), the intersection of #2 is (0, 1], the intersection of #3 is [1], just the point x = 1. We could also have closed intervals of the form [a, b]. We see that A consists of open intervals, half open intervals and closed intervals. Call these the components of A.

A pertinent question is, how are these components separated from each other? Let's investigate this. In the interval (a,b], call a an open boundary point and b a closed boundary point. Then closed intervals have only closed boundary points, etc. Any closed boundary point must be adjacent, on at least one side, to an open ball disjoint from A, this is evident from the examples above. Any gap between components of A that contains only a single point is surrounded by open boundary points of A. So we can now speak of components and gaps knowing that if a gap is a single point, the boundary points are open.

Call any gap that not just a single point a wide gap. Define the width of a wide gap as the difference between the boundaries of the gap. That is, suppose we have the gap "α)...[β", then the gap width = β-α. Henceforth, let α, β signify the left and right boundaries of a wide gap.

I define here the following rules. M means middle, L means left and R means right:

Rule M(a,b): For a ≤ x ≤ b, let f(x) = 1 if x is rational, and f(x) = 0 if x is irrational.
Rule L(a,b): For a < x < b, let f(x) = x-a if x is rational, and f(x) = 0 if x is irrational.
Rule R(a,b): For a < x < b, let f(x) = b-x if x is rational, and f(x) = 0 if x is irrational.

Define the function f by this schema:

#1. For every x $\in$ A, let f(x) = 0.
#2. For every single-point gap x between components of A, let f(x) = 1.
#3. For each wide gap:
#3.1. If α and β are open, apply M(α, β).
#3.2. If α is closed and β is open, choose an α < α' < β such that α' < α + 1. Apply rules L(α, α') and M(α', β).
#3.3. If α is open and β is closed, choose an α < β' < β such that β' + 1 > β. Apply rules M(α, β') and R(β', β).
#3.4. If α is closed and β is closed, choose α < α' < β' < β such that α' < α + 1 and β' + 1 > β. Apply the rules L(α, α'), M(α', β'), R(β', β).

Notice:

#A: The function f so defined is continuous on all points of A that are not boundary points.
#B: The function f is discontinuous at the points covered by #2.
#C: The function f is discontinuous at all points covered by rule M (by an ε-δ argument). Corollary: This together with #B implies that f is discontinuous at all open boundary points.
#D.1: At points covered by rule L(a, b), f is discontinuous at points a < x ≤ b.
#D.2: At points covered by rule R(a,b), f is discontinuous at points a ≤ x < b. Corollary: #D.1, #D.2 and #C's corollary together imply that f is discontinuous at all points not in A.

Two cases remain, closed boundary points on the left or right of a gap.

#1. When L(α,β) was applied, for any ε let 0 < x-α < min(ε,β), then |f(x) - f(α)| = |f(x)| ≤ x-α ≤ ε. That is, the limit from the right at α = 0 = f(α).
#2. By a similar argument, when R(α, β) was applied, the limit from the left at β = 0 = f(β).
#3. By #1 and #2, any discrete point of A has equal limits from the left and right. Therefore f is continuous at all such points.
#4. If α in #1 is not a discrete point, it is the right boundary of an open (sorry, closed) or half-open interval in A on which f vanishes. Therefore the limit from the left = 0 and f is continuous at α.
#5. Similarly for β in #2, the limit from the right = 0 and f is continuous at β.

All points on the real line have been covered and f so defined satisfies the claim.

PS. I knew from reading Spivak of the existence of a function continuous at a single point. I built this proof using that idea together with a characterization of what A would look like, using terminology I knew like open ball and boundary.

Last edited: Aug 11, 2013
9. Aug 11, 2013

### Theorem.

That looks good to me verty and haven't found any problems in the proof up to this point. Good work :)

10. Aug 11, 2013

### verty

Thank you. There was a slight error though, I wrote open instead of closed. But conceptually it seems sound.

About your proof, did you take into account that $U_1$ may have gaps? I think these gaps appear in no $V_n$ but are not a part of A.

Hmm, am I allowed to say this? Perhaps not in a challenge thread, I don't know. But we are all friends, I think.

11. Aug 11, 2013

### Theorem.

I am pretty sure it is sound but I will double check the proof when im not at work, its been a few days so I might have missed something

12. Aug 12, 2013

### Theorem.

I am not sure what you mean by gaps here: $U_1=\mathbb{R}$ by definition (I have used the fact that you can take the collection of open sets to be nested), and if you look at the definition of $W_i$ it isn't too hard to see $\mathbb{R}-A=\cup_{i\in \mathbb{Z}_+}W_i$. Can you be more specific?

13. Aug 12, 2013

### verty

I didn't realise that U_1 = R, I missed that. There may be an issue with a < that should be ≤.

14. Aug 12, 2013

### economicsnerd

Attempting to generalize the raindrop function, I think the following works.

There is some increasing sequence $(F_n)_{n=1}^\infty$ of closed sets such that $A = \mathbb R \backslash \bigcup_n F_n$. Let $F_0:=\emptyset$, and define the map $f:\mathbb R\to [0,2]$ via $$f|_{F_n\backslash F_{n-1}} = 3^{-n}\left(1 + 1\wedge d(\cdot, \mathbb R \backslash F_n)\chi_{\mathbb Q}\right) \enspace \forall n\in\mathbb N; \enspace f|_A=0.$$

- Continuity at $a\in A$:
For any $n \in \mathbb N,$ there exists some neighbourhood $U$ of $a$ with $U \subseteq \mathbb R \backslash F_n$, which implies $f(U)\subseteq \left[0,\frac{2}{3^n}\right].$ Continuity then follows from $f(a)=0$.

- Discontinuity at $x \in \text{int}(F_n)$:
Notice that $\frac2{3^n}\chi_{\mathbb Q}\leq f \leq 2\chi_{\mathbb Q}$ in a neighbourhood of $x$; discontinuity readily follows. [This is the part that doesn't show up when we study the raindrop function, as $\frac1n\mathbb Z$ has empty interior.]

- Discontinuity at $x \in \partial F_n:$
Notice that $f_{\mathbb R \backslash F_n} \leq \frac{2}{3^{n+1}} = \frac23 3^{-n}$, but $f(x) \geq 3^{-n} > \frac23 3^{-n}$.

15. Aug 12, 2013

### Theorem.

This is more or less the same idea as the proof I did. the idea definitely makes sense although there are lots of details I haven't been able to check with your proof

16. Aug 12, 2013

### economicsnerd

It looks similar.

I must confess, I didn't thoroughly read all responses yet, so I wasn't sure if it'd been fully solved on the thread.

Is there any step that's not clear? It's possible there's a hole...

17. Aug 12, 2013

### Theorem.

It looks good : ) maybe someone else will spot something but there is no obvious flaws I have noted. I'll go through it in detail in a bit

18. Aug 15, 2013

### micromass

Congratulations to Theorem. for solving the challenge. And congratulations to verty and economicsnerd as well. Well done!