# Why does this function make it easy to prove continuity with sequences?

• mcastillo356
In summary: I cannot help thinking this exercise is some kind of fake.In summary, to calculate the limit of a function ##f## when ##x## tends to ##0##, we can use the definition of a limit using sequences. Specifically, we can show that if a sequence ##\{x_n\}_{n=1}^\infty## tends to ##0##, then the sequence ##f(x_n)=\begin{cases}{\left|{x_n}\right|}&\text{if}&x\in\mathbb{Q}\\0&\text{if}&x_n\not\in\mathbb{Q}\end{cases}$$clearly tends to ##0##, and therefore the limit of ## #### mcastillo356 Gold Member Homework Statement I've got a piecewise function, and wanted to demonstrate its continuity using sequences Relevant Equations ##f(x)=\begin{cases}{\left|{x}\right|}&\text{if}&x\in\mathbb{Q}\\0&\text{if}&x\not\in\mathbb{Q}\end{cases}## I've been given the proof, but don't understand; to calculate the limit of ##f## when ##x## tends to zero it's enough to see that if ##\{x_n\}_{n=1}^\infty## is a sequence that tends to ##0##, then$$f(x_n)=\begin{cases}{\left|{x_n}\right|}&\text{if}&x\in\mathbb{Q}\\0&\text{if}&x_n\not\in\mathbb{Q}\end{cases}$$clearly tends to ##0##. Hence, ##\lim_{x\to 0}f(x)=0## Question: why ##f(x_n)## tends clearly to zero?. I know I've already answered it on this post, but I don't understand. PS: If the place I've published is the wrong one, please move it. If it's not clear then prove it. Perhaps it will be clear then! FactChecker and mcastillo356 What is your definition of a convergent sequence? You should use that to prove that ##f(x_n) \rightarrow 0## as ##n \rightarrow \infty##. mcastillo356 Notice |x| itself is continuous. So it's sequentially continuous. Maybe you can use that? mcastillo356 PeroK said: If it's not clear then prove it. Perhaps it will be clear then! PeroK said: In fact, an alternative, equivalent definition of a limit uses sequences: The function ##f## has limit ##L## at the point ##a## iff for all sequences ##\{x_n\} \in D - \{a\}## (where ##D## is the domain of ##f##) with ##\lim_{n \to \infty} x_n = a## we have ##\lim_{n \to \infty} f(x_n) = L##. ##f(x)=\begin{cases}{\left |{x}\right |}&\text{if}& x \in \mathbb{Q}\\ 0 & \text{if}& x \not \in \mathbb{Q}\end{cases}## To evaluate the limit of ##f## when ##x## tends to ##0## just notice that if the sequence ##\{x_n\}_{n=1}^\infty## tends to ##0##, then ##f(x_n)=\begin{cases}{\left |{x_n}\right |}&\text{if}& x_n \in \mathbb{Q}\\ 0 & \text{if}& x_n \not \in \mathbb{Q}\end{cases}## This is not the proof. I've been searching for the way to calculate it, but haven't found anything. To prove that converges to zero, what do you have to prove? mcastillo356 Fine, got the path For a real proof, hand-waving will not do. Use the exact definitions and show, step-by-step, that the conditions of the definition are satisfied. Why don't you start by giving us the exact definitions of continuity and/or limits? mcastillo356 FactChecker said: For a real proof, hand-waving will not do. Use the exact definitions and show, step-by-step, that the conditions of the definition are satisfied. Why don't you start by giving us the exact definitions of continuity and/or limits? Good remark. My intention was to began proving that, as ##n\rightarrow{\infty}##, some ##\{a_n\}\rightarrow{0}##, and go pulling the thread. I suppose this is not the way. You mention to give the definition of continuity. At a point, or at an interval?. At an interior point ##c## of its domain, a function ##f## is continous if$$\lim_{x\rightarrow{c}}{f(x)=f(c)}$$FactChecker said: What is your definition of a convergent sequence? You should use that to prove that ##f(x_n) \rightarrow 0## as ##n \rightarrow \infty##. The limit of a sequence is the value that the terms of a sequence "tend to". If such a limit exists, the sequence is called convergent. Now, first step shouldn't be to establish when and why a sequence is convergent? "We call ##x## the limit of the sequence ##(x_n)## (...) if the following condition holds: For each real number ##\epsilon>0##, there exists a number ##N## such that, for every natural number ##n\geq{N}##, we have ##|x_n-x|<\epsilon##. In other words, for every measure of closeness ##\epsilon##, the sequence's terms are eventually that close to the limit. The sequence ##(x_n)## is said to converge to or tend to the limit ##x##." (Wikipedia) Now the task is to prove that ##f(x_n)\rightarrow 0## as ##n\rightarrow\infty##. Think so. FactChecker mcastillo356 said: "We call ##x## the limit of the sequence ##(x_n)## (...) if the following condition holds: For each real number ##\epsilon>0##, there exists a number ##N## such that, for every natural number ##n\geq{N}##, we have ##|x_n-x|<\epsilon##. In other words, for every measure of closeness ##\epsilon##, the sequence's terms are eventually that close to the limit. The sequence ##(x_n)## is said to converge to or tend to the limit ##x##." (Wikipedia) Now the task is to prove that ##f(x_n)\rightarrow 0## as ##n\rightarrow\infty##. Think so. Good. Now suppose we are given an arbitrary ##\epsilon \gt 0## and an arbitrary sequence, ##\{x_n\}_{n=1}^{\infty}## with a limit of ##0##. What ##N## would guarantee that ##|f(x_n) - f(0)|\lt\epsilon,\forall n \ge N##? mcastillo356 Hi, take this as something speculative, for I'm just guessing. Let ##\epsilon>0##. We choose ##N\in\mathbb{N}## such that ##N>\dfrac{1}{\epsilon}##. Such a choice is always possible by the Archimedean property. To verify that this choice of ##N## is appropiate, let ##n\in{\mathbb{N}}## satisfy ##n\geq{N}##. ##n\geq{N}## implies ##n>\dfrac{1}{\epsilon}##, which is equal to ##\dfrac{1}{n}=\Big| f(x_n)-f(0)\Big|<\epsilon##, proving that ##\{a_n\}_{n=1}^\infty## converges to zero by the definition of convergence. Last edited: mcastillo356 said: Hi, take this as something speculative, for I'm just guessing. Let ##\epsilon>0##. We choose ##N\in\mathbb{N}## such that ##N>\dfrac{1}{\epsilon}##. Such a choice is always possible by the Archimedean property. To verify that this choice of ##N## is appropiate, let ##n\in{\mathbb{N}}## satisfy ##n\geq{N}##. ##n\geq{N}## implies ##n>\dfrac{1}{\epsilon}##, which is equal to ##\dfrac{1}{n}=\Big|\f(x_n)-f(0)\Big|<\epsilon##, proving that ##\{a_n\}_{n=1}^\infty## converges to zero by the definition of convergence. View attachment 318612 Start this way: Let ##\epsilon \gt 0## and the sequence ##\{x_n\}^{\infty}_{n=1} \rightarrow 0##. Then there is an ##N \in\mathbb{N}## such that ##|x_n| \lt \epsilon, \forall n \gt N##. Continue from there. mcastillo356 Hi, @FactChecker, the given function is continous only at one point, at zero:$$f(x)=\begin{cases}{\left |{x}\right |}&\text{si}& x \in \mathbb{Q}\\ 0 & \text{si}& x \not \in \mathbb{Q}\end{cases}$$It is just to provide an example where to prove continuity with sequences. It is not ##f(x)=|x|##, ##x\in\mathbb{R}## If we take a sequence of rationals ##\{q_n\}_{n=1}^{+\infty}##, such that ##\displaystyle \lim_{ n \to +\infty} q_n = 0##, we get ##\displaystyle \lim_{n \to +\infty} f(q_n) = \lim_{n \to +\infty} |q_n| = 0##. If we take a sequence of irrationals, ##\{\alpha_n\}_{n=1}^{+\infty}## such that ##\displaystyle \lim_{n \to +\infty} \alpha_n = 0##, we obtain ##\displaystyle \lim_{n \to +\infty} f(\alpha_n) = \lim_{n \to +\infty} 0 = 0##(Actually, the image is always ##0##).. Then, taking a sequence ##\{x_n\}_{n=1}^{+\infty}## with limit zero, as the sequence is made of rationals or irrationals, the limit is zero. I can't help thinking this exercise is some kind of fake. Peace and Love. FactChecker mcastillo356 said: Hi, @FactChecker, the given function is continous only at one point, at zero: Yes. It is an unusual example. But there are stranger things in mathematics. :-) mcastillo356 mcastillo356 said: Hi, @FactChecker, the given function is continous only at one point, at zero:$$f(x)=\begin{cases}{\left |{x}\right |}&\text{si}& x \in \mathbb{Q}\\ 0 & \text{si}& x \not \in \mathbb{Q}\end{cases}$$It is just to provide an example where to prove continuity with sequences. It is not ##f(x)=|x|##, ##x\in\mathbb{R}## If we take a sequence of rationals ##\{q_n\}_{n=1}^{+\infty}##, such that ##\displaystyle \lim_{ n \to +\infty} q_n = 0##, we get ##\displaystyle \lim_{n \to +\infty} f(q_n) = \lim_{n \to +\infty} |q_n| = 0##. If we take a sequence of irrationals, ##\{\alpha_n\}_{n=1}^{+\infty}## such that ##\displaystyle \lim_{n \to +\infty} \alpha_n = 0##, we obtain ##\displaystyle \lim_{n \to +\infty} f(\alpha_n) = \lim_{n \to +\infty} 0 = 0##(Actually, the image is always ##0##).. Then, taking a sequence ##\{x_n\}_{n=1}^{+\infty}## with limit zero, as the sequence is made of rationals or irrationals, the limit is zero. I can't help thinking this exercise is some kind of fake. Peace and Love. Technically, you have to show this for any sequence. That said, if purely rational sequences and purely irrational sequences produce the same limit, then you can prove that is sufficient. A simpler approach was simply to note that:$$|f(x) - f(0)| = |f(x)| \le |x|$$mcastillo356 and FactChecker Attempt to understand this approach The distance between ##f(x)## minus ##\lim_{x\rightarrow{\infty}}{f(x)}=f(0)## is less or equal than that of the argument: hence, it shows a significant trend line of ##x## mcastillo356 said: Attempt to understand this approach The distance between ##f(x)## minus ##\lim_{x\rightarrow{\infty}}{f(x)}=f(0)## is less or equal than that of the argument: hence, it shows a significant trend line of ##x## Here, you are taking a step back to a hand-waving argument. That might be OK if you are not interested in learning how to do a formal proof. In post #15, you considered two cases where the sequence is all rational or all irrational. What about a mixed sequence? That is why in post #12 I recommended starting the proof with an arbitrary sequence. mcastillo356 FactChecker said: Here, you are taking a step back to a hand-waving argument. That might be OK if you are not interested in learning how to do a formal proof. In post #15, you considered two cases where the sequence is all rational or all irrational. What about a mixed sequence? That is why in post #12 I recommended starting the proof with an arbitrary sequence. All right, ##\Big\{x_k\Big\}_{k=1}^{\infty}## with ##x_{k}\in{\mathbb{R}}## for all ##k##, such that ##x_{k}\rightarrow{0}## might be, if (I wonder), ##k\in{\mathbb{R}}## (so some terms might be rationals, others not. FactChecker said: Start this way: Let ##\epsilon \gt 0## and the sequence ##\{x_n\}^{\infty}_{n=1} \rightarrow 0##. Then there is an ##N \in\mathbb{N}## such that ##|x_n| \lt \epsilon, \forall n \gt N##. Continue from there. If I would be right in my previous sentence...Am I? PD: PF, I've found where LaTeX was wrong, I guess. Last edited: Attempt (i) I'm dealing with a piecewise function. (ii) A piecewise function can be continuos if each function that makes it up is continous. FactChecker said: What is your definition of a convergent sequence? You should use that to prove that ##f(x_n) \rightarrow 0## as ##n \rightarrow \infty##. FactChecker said: Start this way: Let ##\epsilon \gt 0## and the sequence ##\{x_n\}^{\infty}_{n=1} \rightarrow 0##. Then there is an ##N \in\mathbb{N}## such that ##|x_n| \lt \epsilon, \forall n \gt N##. Continue from there. (iii) PeroK said: A simpler approach was simply to note that:$$|f(x) - f(0)| = |f(x)| \le |x|$$(iv) ##f(x)=\begin{cases}{\left |{x}\right |}&\text{if}& x \in \mathbb{Q}\\ 0 & \text{if}& x \not \in \mathbb{Q}\end{cases}## (v) - ##\big|x\big|## is continous for ##x\in{\mathbb{Q}}##; - ##0## is a whole number, thus, rational. (vi) an arbitrary sequence means an arbitrary ##N## (vii) ##|f(x) - f(0)| = |f(x)| \le |x|##; ##f(x_n)=f(0)=0## (viii) ##N## is given by virtue of convergence ##x_{n}\rightarrow{0}##; given ##\epsilon>0##, there exists ##n\in{\mathbb{N}}## such that whenever ##n\geq{N}, |x_n|<\epsilon##. Hence, for all ##n\geq{N}, |f(x)-f(x_n)|\leq{|x_n|}<\epsilon## I can't help thinking this is a mess; but if I'm given some more hints, I'll achieve. I perceive a lack in these speculations: no relationship found between ##\epsilon## and ##N##. Furthermore. I think avoiding ##\epsilon-\delta## proof is other failure. Last question: what is ##|x_n|##? mcastillo356 said: Attempt (i) I'm dealing with a piecewise function. This is not the same as what is usually referred to as a piecewise function. A piecewise function usually has a few sections that are defined separately. This has infinitely many transitions from one function to another. mcastillo356 said: (ii) A piecewise function can be continuos if each function that makes it up is continous. In order to say this, every transition from one piece to another must be shown to meet up continuously. mcastillo356 said: (iii) (iv) ##f(x)=\begin{cases}{\left |{x}\right |}&\text{if}& x \in \mathbb{Q}\\ 0 & \text{if}& x \not \in \mathbb{Q}\end{cases}## (v) - ##\big|x\big|## is continous for ##x\in{\mathbb{Q}}##; - ##0## is a whole number, thus, rational. (vi) an arbitrary sequence means an arbitrary ##N## A specific sequence with a limit guarantees the existence of N. Any counting number greater than that N would also work as well. mcastillo356 said: (vii) ##|f(x) - f(0)| = |f(x)| \le |x|##; ##f(x_n)=f(0)=0## (viii) ##N## is given by virtue of convergence ##x_{n}\rightarrow{0}##; given ##\epsilon>0##, there exists ##n\in{\mathbb{N}}## such that whenever ##n\geq{N}, |x_n|<\epsilon##. Hence, for all ##n\geq{N}, |f(x)-f(x_n)|\leq{|x_n|}<\epsilon## I can't help thinking this is a mess; but if I'm given some more hints, I'll achieve. I perceive a lack in these speculations: no relationship found between ##\epsilon## and ##N##. The definition of a limit guarantees you an N with specific properties. mcastillo356 said: Furthermore. I think avoiding ##\epsilon-\delta## proof is other failure. Last question: what is ##|x_n|##? It seems to me that you will just have to think about this some more to make it clear to you. mcastillo356 and PeroK mcastillo356 said: Attempt (i) I'm dealing with a piecewise function. A function that is defined piecewise. mcastillo356 said: (ii) A piecewise function can be continuos if each function that makes it up is continous. That's not relevant in this case. mcastillo356 said: (iv) ##f(x)=\begin{cases}{\left |{x}\right |}&\text{if}& x \in \mathbb{Q}\\ 0 & \text{if}& x \not \in \mathbb{Q}\end{cases}## That's the definition of ##f##. mcastillo356 said: (v) - ##\big|x\big|## is continous for ##x\in{\mathbb{Q}}##; - ##0## is a whole number, thus, rational. This seems like another irrelevant digression. mcastillo356 said: (vi) an arbitrary sequence means an arbitrary ##N## I've no idea what this means. mcastillo356 said: (vii) ##|f(x) - f(0)| = |f(x)| \le |x|##; Progress! Albeit provided by someone else. mcastillo356 said: ##f(x_n)=f(0)=0## I've no idea what this means. mcastillo356 said: (viii) ##N## is given by virtue of convergence ##x_{n}\rightarrow{0}##; given ##\epsilon>0##, there exists ##n\in{\mathbb{N}}## such that whenever ##n\geq{N}, |x_n|<\epsilon##. Hence, for all ##n\geq{N}, |f(x)-f(x_n)|\leq{|x_n|}<\epsilon## You should always start with "Let ##\epsilon>0##". I'm sure we've covered this before. Like a lot of students you get stuck quoting definitions and cannot transition to a proof. Logically better is: a) Let ##\epsilon>0##. b) Let ##x_{n}\rightarrow{0}##. c) There exists ##n\in{\mathbb{N}}## such that whenever ##n\geq{N}, |x_n|<\epsilon##. This follows from b) d) Note that for all ##x \in \mathbb R## we have ##|f(x) - f(0)| = |f(x)| \le |x|##. e) Hence, for all ##n\geq{N}, |f(x_n)-f(0)|\leq{|x_n|}<\epsilon##. This follows from c) and d). f) Hence ##f(x_{n}) \rightarrow{0}##. This follows from a) and e). g) Hence ##f## is continuous at ##x = 0##. This follows from b) and f). mcastillo356 said: I can't help thinking this is a mess; but if I'm given some more hints, I'll achieve. I perceive a lack in these speculations: no relationship found between ##\epsilon## and ##N##. Furthermore. I think avoiding ##\epsilon-\delta## proof is other failure. Last question: what is ##|x_n|##? Your main problem is that your proofs are more like random walks than logical constructions. I don't know what you can do except practice lots of real analysis problems and proofs. mcastillo356 and FactChecker PeroK said: I don't know what you can do except practice lots of real analysis problems and proofs. Good advice. And I would suggest that there should be enough practice with very simple examples so that the flow of an ##\epsilon, \delta## proof becomes second nature before attempting a harder example like this. mcastillo356 PeroK said: You should always start with "Let ##\epsilon>0##". I'm sure we've covered this before. Like a lot of students you get stuck quoting definitions and cannot transition to a proof. Logically better is: a) Let ##\epsilon>0##. b) Let ##x_{n}\rightarrow{0}##. c) There exists ##n\in{\mathbb{N}}## such that whenever ##n\geq{N}, |x_n|<\epsilon##. This follows from b) d) Note that for all ##x \in \mathbb R## we have ##|f(x) - f(0)| = |f(x)| \le |x|##. e) Hence, for all ##n\geq{N}, |f(x_n)-f(0)|\leq{|x_n|}<\epsilon##. This follows from c) and d). f) Hence ##f(x_{n}) \rightarrow{0}##. This follows from a) and e). g) Hence ##f## is continuous at ##x = 0##. This follows from b) and f).Your main problem is that your proofs are more like random walks than logical constructions. I don't know what you can do except practice lots of real analysis problems and proofs. Hi, PF, d) step is what we want to prove; it is a consequence of e) step; ##\xymatrix{ A=\mathbb{N}\ar[r]^{x_n} \ar[dr]_{f(x_n)} & x_{n\in\mathbb{N}}\subset \mathbb{R}\ar[d]^f \\ & \mathbb{R} }## I've been given the proof for an arbitrary sequence: Let ##\{x_n\}_{n=1}^{+\infty}## be an arbitrary sequence such that$$\displaystyle \lim_{n \to +\infty} x_n = 0$$Given an ##\epsilon > 0## exists ##n_{\epsilon} \in \mathbb{N}## such that, if ##n \geq n_{\epsilon}## then ##|x_n-0| = |x_n| < \epsilon## So if ##n \geq n_{\epsilon}## we have: If ##x_n## is rational ##f(x_n) = |x_n| < \epsilon## If ##x_n## is irrational ##f(x_n) = 0 < \epsilon## Well... FactChecker said: For a real proof, hand-waving will not do. Can't help thinking I'm hand-waving... Let's take this post like something speculative. PF, please, check the LaTeX. Peace, greetings! Last edited: mcastillo356 said: Can't help thinking I'm hand-waving... Let's take this post like something speculative. That is much better. I wouldn't call that "hand-waving" at all; it's a big step toward what is needed for a proof. You should mention the value that you want the function, ##f##, to approach and show that it is within ##\epsilon##. So your two last statements should be like: If ##x_n## is rational, ##|f(x_n)-f(0)| = |f(x_n)-0| = |x_n| \lt \epsilon## If ##x_n## is irrational, ##|f(x_n)-f(0)| = |0-0| = 0 \lt \epsilon## mcastillo356 mcastillo356 said: Hi, PF, d) step is what we want to prove; it is a consequence of e) step;$$\xymatrix{ A=\mathbb{N}\ar[r]^{x_n} \ar[dr]_{f(x_n)} & x_{n\in\mathbb{N}}\subset \mathbb{R}\ar[d]^f \\&\mathbb{R} }
The line above (with the \$ pairs removed) doesn't render correctly. I have no idea what you're trying to say in that line.

mcastillo356 said:
I tried, but I don't know what you're trying to say.

mcastillo356

Hi, PF, @Mark44, I wanted to explore every step carefully. The goal was to ensure that we have a composition of functions of the real numbers in the real numbers and eventually ensure the prevalence of step D over E.

mcastillo356 said:
View attachment 319813
Hi, PF, @Mark44, I wanted to explore every step carefully. The goal was to ensure that we have a composition of functions of the real numbers in the real numbers and eventually ensure the prevalence of step D over E.
This doesn't make any sense to me. I think you are making this all more abstract than it should be.
mcastillo356 said:
Hi, PF, d) step is what we want to prove; it is a consequence of e) step;
I don't think so. (d) can be established simply by the function definition for any ##x \in \mathbb{R}## without any reference to a sequence.

mcastillo356 and PeroK
FactChecker said:
This doesn't make any sense to me. I think you are making this all more abstract than it should be.
This...

FactChecker said:
This doesn't make any sense to me. I think you are making this all more abstract than it should be.

I don't think so. (d) can be established simply by the function definition for any ##x \in \mathbb{R}## without any reference to a sequence.
Hi, isn't this the function?
$$f(x)=\begin{cases}{\left|{x}\right|}&\text{if}&x\in\mathbb{Q}\\0&\text{if}&x\not\in\mathbb{Q}\end{cases}$$
FCh, which is the function?

mcastillo356 said:
Hi, isn't this the function?
$$f(x)=\begin{cases}{\left|{x}\right|}&\text{if}&x\in\mathbb{Q}\\0&\text{if}&x\not\in\mathbb{Q}\end{cases}$$
FCh, which is the function?
Yes.
Now you can fill in to prove (d):
If ##x## is rational, ##|f(x)-f(0)| = ||x|-0| = |x| \le |x|##
If ##x## is irrational, ##|f(x)-f(0)| = |0-0|=0 \le |x|##
It's as simple and basic as that.

mcastillo356 and Mark44
I thought the goal was showing continuity using ##[x_n \rightarrow x ]\rightarrow [f(x_n) \rightarrow x] ##

FactChecker said:
It's as simple and basic as that.
Furthermore, it's the real thing
PeroK said:
A simpler approach was simply to note that:
$$|f(x) - f(0)| = |f(x)| \le |x|$$
Definitively, compañero.
WWGD said:
I thought the goal was showing continuity using ##[x_n \rightarrow x ]\rightarrow [f(x_n) \rightarrow x] ##
Yes.
Mark44 said:
This...
This... Was as simple as @PeroK knew; as hard as I turned it.
A thousand thanks, milesker, bihotzez.
HNY, PF!

mcastillo356 said:
A thousand thanks, milesker, bihotzez.
Are the last two words Basque? I definitely don't recognize them as Spanish.

J
Mark44 said:
Are the last two words Basque? I definitely don't recognize them as Spanish.
Just basqueing in the glory of Spanish regional languages.

mcastillo356
In Basque, yes, "a thousand thanks, from the heart".
PD @FactChecker, I feel I should have written a few more about #30, but I've plunged headlong into the next chapter, integration.
Love, greetings, PF.

PeroK