# Oscillation of the function at each point

I would like to find the oscillation of the function $$f:\Bbb R^2\to\Bbb R,$$ $$f(x,y)=\begin{cases}\sin\left(\frac1x\right)+\sin\left(\frac1y\right),&x,y\ne 0\\0, x,=0\text{ or } y=0.\end{cases}$$

This is our definition:

Let $$A\subset\Bbb R^2$$ and $$f:A\to\Bbb R$$ any function. Oscillation $$O(f,c)$$ of the function $$f$$ at the point $$c\in A$$ is defined as $$O(f,c)=\inf_{U\ni c\\ U\text{ open }}\sup_{x_1,x_2\in U\cap A}|f(x_1)-f(x_2)|.$$

And a lemma:

Function $$f:A\to\Bbb R$$ is continuous at $$c\in A$$ if and only if $$O(f,c)=0.$$

My attempt:

According to the lemma, since the given function is continuous on $$S:=\{(x,y)\in\Bbb R^2\mid xy\ne 0\},O(f,c)=0,\forall c\in S_1.$$

Now, suppose $$x_0\ne 0$$ and $$y_0=0.$$

For any $$\varepsilon>0,$$ there is $$n\in\Bbb N$$ s. t. $$\left(x_1,\frac{2\pi}{4n+1}\right),\left(x_2,\frac{2\pi}{4n+3}\right)\in B((x_0,0);\varepsilon)$$ for $$x_1,x_2$$ close enough to $$x_0$$ since $$x\mapsto\sin\left(\frac1x\right)$$ is uniformly continuous on segments not containing $$0$$.

Then $$f\left(x_1,\frac{2\pi}{4n+1}\right)-f\left(x_2,\frac{2n}{4n+3}\right)\to 2,$$

and I think this is the oscillation at such point, but I'm not sure if this is right. If $$x=y=0,$$ then we can consider expressions $$f\left(\frac{2\pi}{4n+1}, \frac{2\pi}{4n+1}\right)-f\left(\frac{2\pi}{4n+3}, \frac{2\pi}{4n+3}\right),$$ but $$|f(x_1,y_1)-f(x_2,y_2)|\le 4,\forall (x_1,y_1),(x_2,y_2)\in\Bbb R^2,$$ so I think this works.

Can somebody help me with the case of the axes?

Excellent attempt. Finishing off the continuity points was important , then dealing with $$(0,0)$$ separately was very good insight because you recognized the freedom that was available.

However, I am not fully sure that your expressions for the exact numbers are on point. For example, with $$\frac{2\pi}{4n+1}$$, the reciprocal is $$\frac{4n+1}{2 \pi}$$, and I'm not sure you intended the $$\pi$$ to go to the bottom , and probably preferred it to remain on top. Then your intentions were right, and you were likely very close to the candidate. However, you were unsure as to how you produced the optimal subsequence at each point, and this is where I'm going to share a lovely lemma.

We first start with the following result that immediately connects oscillations to the sequential definition of continuity. It's a long proof but very illustrative because it will help solve a lot of problems regarding oscillation.

Lemma : Suppose that $$f : \mathbb R^2 \to \mathbb R$$ and $$(x,y)$$ be a point such that there is some open set $$(x,y) \in V$$ with $$f(x)$$ bounded in $$V$$. Let $$S_{(x,y)} = \{L : \exists (x_n,y_n) \in \mathbb R^2, (x_n,y_n) \to (x,y), f(x_n,y_n) \to L\}$$ Then, $$Osc(f,(x,y)) = \sup S_{(x,y)} - \inf S_{(x,y)}$$ and both are finite quantities.

That is, if we take the set of all limits of $$f((x_n,y_n))$$ for every subsequence $$(x_n,y_n)$$ that converges to $$(x,y)$$ with $$f((x_n,y_n))$$ convergent, then the range of this set equals the oscillation of $$f$$, provided that $$f$$ is bounded on some neighbourhood $$V$$ of $$(x,)$$.

The basic idea is the following: every open set $$U'$$ containing $$(x_n,y_n)$$, also contains some ball around $$(x_n,y_n)$$. That ball, is an open set which contains $$(x_n,y_n)$$ but the supremum of $$|f(x_1)-f(x_2)|$$ is obviously smaller over that ball , than over $$U'$$. Therefore, it's enough to consider a supremum over open sets which are balls around the point : and there, one profits from having structure on the reducing balls.

Proof : We begin by showing that if $$f$$ is bounded on $$V$$ then both quantities are finite. Let $$|f(t)| on $$V$$ : then $$\sup_{t,s \in V}|f(t)-f(s)| < 2M$$ therefore $$Osc(f,(x,y)) < 2M$$. On the other hand, let $$(x_n,y_n) \to (x,y)$$ with $$f(x_n,y_n)$$ convergent to a point $$L$$. By definition, there exists $$N$$ such that $$n>N$$ implies $$(x_n,y_n) \in V$$ , which implies that $$|f(x_n,y_n)| < M$$. Consequently, $$|L| and $$\inf S_{(x,y)}- \sup S_{(x,y)} < 2M$$. Finiteness of both quantities are proved.

Note that $$f$$ being continuous at $$(x,y)$$ is equivalent to both $$Osc(f,(x,y))=0$$ and $$S_{(x,y)} = \{f(x,y)\}$$ by the sequential definition of continuity. In this case the equality is obvious. Therefore, we will now assume that both are positive finite quantities and prove that both are greater than or equal to the other.

We will first assume that $$\sup S_{(x,y)} = X$$ and $$\inf S_{(x,y)} = Y$$. Let $$X-Y>\epsilon>0$$ be arbitrary. There exist $$X',Y' \in S_{(x,y)}$$ with $$X-X'<\frac \epsilon 4, Y'-Y< \frac\epsilon 4$$. In particular, by the triangle inequality, $$|X'-Y'| > X-Y - \frac \epsilon 2$$.

Now, let $$X_{1n}, X_{2n}$$ be two sequences that help in satisfying the $$S_{(x,y)}$$ membership for $$X',Y'$$ : that is, $$X_{1n} \to (x,y)$$, $$X_{2n}\to (x,y)$$, with $$f(X_{1n}) \to X', f(X_{2n}) \to Y'$$. Let's now note that $$f(X_{1n}) - f(X_{2n}) \to X'-Y'$$, so that by the $$\epsilon-N$$ criterion, there exists $$N$$ such that $$n>N$$ implies $$|f(X_{1n})- f(X_{2n})| > X'-Y'-\frac \epsilon 2 > X-Y-\epsilon$$.

Let $$U$$ be any open set around $$(x,y)$$, and let $$R$$ be such that the ball around $$(x,y)$$ of radius $$R$$ is contained in $$U$$. There exists $$M$$ such that for $$m>M$$, $$X_{1m} , X_{2m}$$ will also lie in that ball. Now, for $$m>\max \{M,N\}$$, we have $$X_{1m},X_{2m} \in U$$ and $$|f(X_{1m})-f(X_{2m})| > X-Y-\epsilon$$. In particular, for every $$U$$, $$\sup_{x_1,x_2 \in U} |f(x_1)-f(x_2)| \geq |f(X_{1m})-f(X_{2m})| > X-Y-\epsilon$$

for all $$U$$ open sets containing $$x$$. Taking the infimum over all $$U$$ , $$\inf_{(x,y) \in U, U \text{ open}} \sup_{x_1,x_2 \in U} |f(x_1)-f(x_2)| \geq X-Y-\epsilon$$

for all $$\epsilon>0$$. Taking $$\epsilon \to 0$$ gives $$\inf_{(x,y) \in U, U \text{ open}} \sup_{x_1,x_2 \in U} |f(x_1)-f(x_2)| \geq X-Y$$

That is, we've shown that the LHS is bigger than or equal to the RHS.

Now, let's go the other way. Let's prove something intermediate : if $$r_n$$ is a sequence of positive reals decreasing to $$0$$, and $$B_{r_n} = \{t : \|t - (x,y)\| < r_n\}$$ then $$Osc(f,(x,y)) = \lim_{n \to \infty} \sup_{t,s \in B_{r_n}} |f(t)-f(s)|$$. The limit exists as the limit of a decreasing sequence bounded below by $$0$$, and consists of finite quantities for $$n>N$$ where $$B_{r_N} \subset V$$.

To prove this note that $$\sup_{t,s \in B_{r_n}} |f(t)-f(s)| \geq Osc(f,(x,y))$$ by definition, so taking $$n \to \infty$$ gives RHS $$\geq$$ LHS above. For the other way, if $$U$$ is any open set, there is some $$N$$ such that $$n>N$$ implies $$B_{r_n} \subset U$$. Therefore, $$\sup_{t,s \in U} |f(t)-f(s)| \geq \sup_{t,s \in B_{r_n}} |f(t)-f(s)|$$ for all $$n>N$$, and taking the limit, $$\sup_{t,s \in U} |f(t)-f(s)| \geq \lim_{n \to \infty}\sup_{t,s \in B_{r_n}} |f(t)-f(s)|$$. Taking the infimum over $$U$$ on the LHS finishes the proof that LHS $$\geq$$ RHS, as desired.

Armed with this, we now proceed to show our result. Let $$Osc(f,(x,y))>\epsilon>0$$. Let $$r_n$$ be a sequence of positive reals decreasing to $$0$$. For every $$n$$, pick $$x_{1n},x_{2n} \in B_{r_n}$$ such that $$\sup_{t,s \in B_{r_n}} |f(t)-f(s)| < |f(x_{1n})- f(x_{2n})| + \epsilon$$

Now, $$x_{1n},x_{2n} \to (x,y)$$ because they belong in balls around $$(x,y)$$ of progressively smaller radius. Note that $$f(x_{1n}), f(x_{2n})$$ need not be convergent : but here, we play the subsequence trick. Indeed, pick $$N$$ with $$B_{r_N} \subset U$$.

Note that $$f(x_{1n})$$ is bounded for $$n>N$$. Therefore, it has a convergent subsequence , say $$f(x_{1n_k}) \to L_1$$, by the Bolzano-Weierstrass theorem. Now, note that $$f(x_{2n_k})$$ is bounded for $$k>K$$, so it has a convergent subsequence, say $$f(x_{2n_{k_l}}) \to L_2$$, and of course $$f(x_{1n_{k_l}}) \to L_1$$. For this subsequence $$n_{k_l}$$ we have :

$$\sup_{t,s \in B_{r_{n_{k_l}}}} |f(t)-f(s)| < |f(x_{1n_{k_l}})- f(x_{2n_{k_l}})| + \epsilon$$

Let $$l \to \infty$$ and use the intermediate result along with the limits and continuity of $$|\cdot|$$ to see that $$Osc(f,(x,y)) \leq |L_1-L_2| + \epsilon \leq \sup S_{(x,y)} - \inf S_{(x,y)} + \epsilon$$ Letting $$\epsilon \to 0$$ completes the proof of the other side. $$\blacksquare$$

With the lemma, let's solve this question. The first point to note is that it can be applied since $$f(x,y) \leq 2$$ everywhere. Of course, $$f$$ is continuous on $$xy \neq 0$$ so here the oscillation is zero.

We know that $$Osc(f,(0,0)) \leq 4$$ since any function values cannot exceed $$2$$. However, consider the sequences $$x_n = y_n = \frac 1{2n\pi + \frac \pi 2} \\ x'_n = y'_n = \frac{1}{2n\pi + 3\frac \pi 2}$$ then $$(x_n,y_n) \to (0,0), (x_n',y_n') \to (0,0)$$ and yet $$f(x_n,y_n) = 2, f(x'_n,y'_n) =-2$$ so it's obvious that the respective limits are $$2$$ and $$-2$$, whose difference is $$4$$. It follows that $$Osc(f,(0,0)) = 4$$.

Now, suppose that $$x=0,y \neq 0$$. Let's take any sequence $$(x_n,y_n)$$ converging to $$(0,y)$$. The point is, this implies $$y_n \to y$$, and therefore by continuity at non-zero $$y$$, $$\sin \frac 1{y_n} \to \sin \frac 1y$$. Therefore, in particular, if $$(x_n,y_n)$$ and $$(x'_n,y'_n)$$ both converge to $$(0,y)$$ and both $$\lim_{n \to \infty} f(x_n,y_n), \lim_{n \to \infty} f(x'_n,y'_n)$$ exist, we must have that the limit of their difference exists. However, $$f(x_n,y_n) - f(x'_n,y'_n) = \sin\frac 1{x_n} - \sin \frac 1{x'_n} + \left(\sin \frac 1{y_n} - \sin \frac 1{y'_n}\right)$$

and as you take the limit, it follows that $$\sin \frac 1{y_n} - \sin \frac 1{y'_n} \to 0$$, therefore the difference between the limits is at most $$2$$. Therefore, it follows that $$Osc(f,(0,y)) \leq 2$$.

However, you can once again consider two subsequences : $$x_n = \frac 1{2\pi n + \frac \pi 2}, y_n = y$$ and $$x'_n = \frac 1{2 \pi n + \frac {3 \pi}2} , y_n = y$$ then both $$(x_n,y_n)$$ and $$(x'_n,y_n)$$ converge to $$(0,y)$$. However, note that $$f(x_n,y_n) = 1+\sin \frac 1y$$ and $$f(x'_n,y_n) = -1 + \sin \frac 1y$$ for all $$n$$. It follows that the subsequential limits are also $$1+\sin\frac 1y$$ and $$-1 + \sin \frac 1y$$ : their difference is $$2$$. It follows from the lemma that $$Osc(f,(0,y)) \geq 2$$. Therefore, the oscillation equals $$2$$.

At points $$(x,0)$$ with $$x \neq 0$$, the same argument applies symmetrically to show that the oscillation equals $$2$$. In total, you get the function $$Osc(f,(x,y)) = \begin{cases} 0 & xy=0\\ 4 & x=y=0 \\ 2 & \text{ otherwise} \end{cases}$$

• There is some open set $(x,y) \in V$..? Do you mean $V$ is the openset? Mar 20 at 0:59
• @Dolphin Indeed, thanks for pointing it out. I'll edit it. Mar 20 at 10:11
• @Dolphin Corrected, thanks. I also corrected some other typos along the way. The reason why I was so confused was because, while writing this answer, I thought of using $X_{1m}$ as both elements of $\mathbb R^2$ as well as elements of the form $f(x)$ for some $x$ i.e. as elements of $\mathbb R$. That confusion went right through the first part of the answer , which I spent some time rectifying. The second part should be clearer (although some subsequence explanation may be required , so I may have gone a little too fast in some places). Mar 20 at 10:30
• I agree I didn't make the mentions very explicit @Buraian, but whenever I said something like "let $U$ be an open set and let $R$ be such that $B_R$ is contained in $U$" I reduced the problem to balls of radius $R$. I did this once in the first part. In the second part, the intermediate-result I showed very precisely says that it's enough to look at oscillations in small enough balls around $(x,y)$, rather then every possible open set containing $(x,y)$. The proof is for the quoted text : only the last section uses the lemma in that quoted text to find the answer. Mar 20 at 11:23
• That's right @Dolphin , that particular norm is convenient in this case, and your justification is reasonable. Apr 20 at 13:32