5 ms·
The Weierstrass function is cool but the undisputed champion of calculus counterexamples has to be the Dirichlet function[1] f(x) = 1 if x is rational, 0 other
by seanhunter 2y ago
The Weierstrass function is cool but the undisputed champion of calculus counterexamples has to be the Dirichlet function[1]
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 https://mathworld.wolfram.com/DirichletFunction.html
- philomath_mn 2y agoNice. Reminds me of the discrete metric in my Real Analysis course: distance is 0 if it is the same point, 1 otherwise. We used to joke that it was the perfect metric for finding weird counter examples
- unkulunkulu 2y agothere 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.
- JJMcJ 2y agoAlso "Counterexamples In Topology" - same but for topology.
- shwouchk 2y agoI 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
- dgoldstein0 2y agoyup, 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.
- pfdietz 2y agoA related weird function is Thomae's Function, also known as the Popcorn Function. https://en.wikipedia.org/wiki/Thomae%27s_function https://en.wikipedia.org/wiki/Thomae%27s_function It is discontinuous at every rational number, but continuous at every irrational number.
- seanhunter 2y agoThat function is very beautiful. I love John Conway’s name for it “Stars over Babylon”.
- shoo 2y ago> 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
- rq1 2y agoNo mention of the Cantor set (and its variants) indicator functions?
- seanhunter 2y agoWell 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.
- ccppurcell 2y agoThe cantor set has a simple statement. It's just the numbers in the unit interval without a 1 in their ternary representation.
- hansbo 2y agoIt 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.
- tromp 2y agoDense means arbitrarily close together, which is what rationals i/n and (i+1)/n are.
- seanhunter 2y agoI 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.
- tromp 2y agoYes, that's the more formal equivalent formulation. For n > 1/(y-x), the sequence of rationals ... ,i/n, (i+1)/n, ... must land in (x,y).
- trhway 2y ago> why the rational numbers are dense in the reals the reals are defined as limits of the sequences of rationals, and thus the rationals are dense in reals by that definition. >since rational numbers are countably infinite while the set of all the infinite convergent series of rationals happens to be strongly larger than countably infinite.
- deleted 2y ago[deleted]
- omgwtfbyobbq 2y agoI 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.
- 2y ago
- n4r9 2y agoI vaguely remember studying these as well as one that was something like: h(a/b) = b for rationals a/b (in smallest terms), 0 otherwise This one has the properties you mention of the Dirichlet function whilst also being unbounded in every non-empty interval of the reals.
- x3n0ph3n3 2y agoBecause 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?
- btilly 2y agoNo, those are unrelated concepts.
- roserevealed 2y agoThat 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.
- pfdietz 2y agoNot 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).
- frotaur 2y agoSorry, but I find it much easier to find a function with your property, compared to the continuous everywhere but differentiable nowhere functions. In fact, here is an uncountable family of them : f(x) = x^2 * rand(0,1) Where rand(0,1) is a uniform number between 0 and 1, sampled for every x.
- seanhunter 2y agoIntroducing 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.
- Someone 2y agoSome 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?
- JJMcJ 2y agog(x) is mind-bending. I can write out a proof that it is continuous at 0 and nowhere else, but it still barely makes sense. I can understand the reactions of the late 19th Century mathematicians, though I suspect much of it was exaggerated rhetoric, not real horror.
- dhosek 2y agoIf it were the Pythagoreans, they’d’ve thrown him out of a boat.
- xigoi 2y agoEven 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). https://en.wikipedia.org/wiki/Conway_base_13_function https://en.wikipedia.org/wiki/Conway_base_13_function
- seanhunter 2y agoJohn 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 https://youtu.be/S75VTAGKQpk?si=IW791RaeCsXSOrrK “This is an important theorem and a discovery that I’m very proud of”.
- seanhunter 2y agoReply 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.
- youoy 2y agoThank you for the 91 proof! I didnt know about that
- dhosek 2y agoI always have to check which John Conway this is. Thankfully John H. and John B. had different middle initials even if they didn’t use them.