Even weirder is the Conway base 13 function, which not only is discontinuous everywhere, but its range when restricted to any interval is the entire set of real numbers (so its graph “fills up” the entire plane).
John Conway was amazing. Such a loss that he died of COVID.
As well as the game of life, surreal numbers and other famous things, he also produced one of my favourite lesser-known proofs ever - the proof that 91 is the smallest number that looks prime, but isn’t https://youtu.be/S75VTAGKQpk?si=IW791RaeCsXSOrrK “This is an important theorem and a discovery that I’m very proud of”.
Reply to add: Reading about that function it really breaks my brain. It’s incredibly strange to think a function could satisfy the intermediate value property on every interval and yet not be continuous. That really doesn’t feel like it should be possible.
there is a whole book “counterexamples in analysis”, basically for each theorem they find why every condition is required. these functions and ideas based on them are indispensable.
this weierstrass function is definitely a mind bender I remember from high school.
I don’t know if they are the same books as the names are quite generic, but i picked up both this one and the topology book sibling suggested at the library during my undergrad, and read both cover to cover. Both slim books and very clear.
My favorite counterexamples in analysis were based on the cantor set as it allowed counerexamples for many different scenarios while still producing functions that were “nice” in other respects
yup, that's a standard example / counterexample. Called the discrete metric. If you are trying to prove something about metric spaces, you should try your statement on that metric. A lot of things that seem true because they intuitively sound right with Euclidean distance break with the discrete metric.
Because there is no bijection between the rationals and the reals, wouldn't that imply that there are some irrational reals with no rational between them, allowing this function to be continuous, at least in places we can't actually compute?
That doesn't actually follow- even though the reals are uncountable, they're what's called "separable", which means that there is a countable set which is "arbitrarily good at approximating them", basically- the rationals!
So even though there are uncountable reals, for any real number, you can find rational numbers that get arbitrarily close. You can actually see this pretty easily if you think of reals in decimal notation- sqrt(2) is irrational, but
1.4, 1.41, 1.414, 1.4142, 1.41421, 1.414123, ... etc are all rational numbers that get closer and closer to sqrt(2).
So you should think of real numbers as uncountable, but nonetheless surrounded by rationals no matter how close you zoom in.
Not even the rationals are needed here. Just the rationals whose denominators are powers of two, for example, will do it (these have binary representations with a finite number of digits).
Any two real numbers x and y are either equal or have an infinite number of reals between them don’t they? If your real numbers are x and y, then (x+y)/2 for example. The density of the rationals in the reals means that one of the numbers between them is provably a rational number.
I'm a bit late to see this comment, but it was disappointing that none of the replies so far show why this is not true.
Take any irrational numbers x and y, and suppose for convenience that x < y.
Let d = y-x i.e. the length of the interval between x and y.
Let b be an integer so large that 1/b is less than d.
Consider fractions of the form a/b. As a increases, a/b will eventually (strictly) exceed the value of x. Suppose we fix a to be the smallest such value, i.e. (a-1)/b < x < a/b.
Adding d to both sides we get:
a/b - 1/b + d < x + d
Using the fact that 1/b < d and x + d = y, we get a/b < y.
> continuous at exactly one place (0) and nowhere else
after a bit of thought, less surprising if we regard g(x) as a function that is defined pointwise as either i(x) = x or z(x) = 0 depending on some highly discontinuous property of x
z(x) = 0 is a pretty good approximation of i(x) = x at x=0
It is unintuitive to me why the rational numbers are dense in the reals, since rational numbers are countably infinite, as opposed to the reals. I think infinity is hard to grasp.
It’s because for every pair of irrational numbers, there is a first place in their decimal representation where their digits differ, which means you can construct a number with finite decimal representation that fits between the two, which thus is rational.
In other words, it’s because while there are uncountably many irrational numbers, their representation is still only countably infinite each.
Or in yet other words, uncountable infinity is only a teensy bit larger than countable infinity, not that much larger. Consider that every prefix of an irrational number is a rational number. ;)
In decimal form, almost every real number between 0 and 1 is zero-point followed by an infinite sequence of random digits. No computer in the universe has enough hard drive space to store an arbitrary fixed real number between 0 and 1. This is of course not true for rationals: any rational number can be saved on a big enough hard drive. In particular, given unbounded resources, we can build a computer that approximates (0,1) by storing a finite set of rational numbers, and reaches a given real number x with arbitrary nonzero error. But we will never get zero error on a physical computer.
The tough part with analogies like this is there are obviously rationals too large for any computer in the universe as well and anything which fixes that portion goes back to needing to reckon about the different types of infinities involved in the original problem.
I don't think that's the case here unless you are referring to a busy beaver thing I don't understand :)
If you are referring to the observable universe being finite, then that's not relevant for the discussion: I am just putting a few more grounded terms on the theorem that computable reals (including rationals) are a countable set. The point is that "for every integer n you can get n+1" is unphysical, yet "grokkable" symbolically, so it works well within a conceptual mathematical universe (regardless of what the physical universe has to say about it). Within this math universe we build an abstract computer that can hold an arbitrary rational/computable number, but only a countable subset of the real numbers, since almost all real numbers cannot be described by any "physical" program, even if that program is larger than the entire universe.
I wish I understood the busy beaver problem / connections to Ramsey theory / etc. However for this intuitive discussion it seems like a serious digression.
This is what I mean in that it only appears more grounded if you already understand why a countable set has a different type of infinity than an uncountable set in the first place and what type of universe that implies. Otherwise you're left wondering what type of universe is needed and why it is that type of universe can account for some infinities but not others. The latter part is just the answer to the original question of what the difference between a countable and uncountable set is again so if you can answer that you didn't have the question to start with!
I think you are getting away from the actual original question, which is why (intuitively) the rationals are dense in the reals despite being a different form of infinity. The confusion wasn't about different forms of infinity, it was really about the topology of R with respect to Q - why is Q "big enough" yet Z "too small" despite the sets having the same cardinality? And that is intimately related to any fixed real number having a computable/rational approximation up to any accuracy, yet most real numbers not actually being computable.
I think precisely the rationals being dense in the reals means that for any two real numbers x and y where x < y there exists a rational number m/n (m and n being integers) such that x < m/n < y.
Rationals are also dense in the p-adic numbers, which you can think of as the other way to form their completion, if I understand correctly (with a different notion of absolute value.)
I always thought using countable and uncountable was a little confusing and that introducing aleph/beth numbers would have made things clearer when those ideas were introduced.
Introducing a stochastic function is cheating. You expect calculus to break if you just throw in stochastic functions willy-nilly, so that doesn’t challenge my intuition at all.
Some of those are continuous and differentiable everywhere. Examples:
f(x) = 0
f(x) = ½ x²
Also: doesn’t the claim that you can pick such a function require an extreme version of the axiom of choice, where you claim you can pick an element of each set in a set of sets that has uncountably many items?
Well yes. The thing I particularly like about the Dirichlet function is it’s so simple to state and yet just completely breaks my intuition about so many things.
f(x) = 1 if x is rational, 0 otherwise.
It is defined over all real numbers but continuous nowhere. Also if you take the Dirichlet function and multiply it by x so you get
g(x) = x if x is rational, 0 otherwise
…then you have something that is continuous at exactly one place (0) and nowhere else, which also is pretty spectacular.
[1] https://mathworld.wolfram.com/DirichletFunction.html