I was once told that one must have a notion of the reals to take limits of functions. I don’t see how this is true since it can be written for all functions from the rationals to the rationals, which I will denote f, that

\forall L,a,x:(L,a,x\in\mathbb{Q})\forall \epsilon:(\epsilon>0)\space \exists\delta:(\delta>0)

\lim_{x\rightarrow a}f(x)=L\leftrightarrow(\mid x-a\mid<\epsilon\leftrightarrow\mid f(x)-L\mid<\delta)

Since, as far as I know, functions like \mid x\mid and relations like < can be defined on the rationals. Is it true you couldn't do calculus on just the rational numbers? At the moment I can't think of any rational functions that differentiate to real functions. If it's true that it isn't formally constructible on the rationals, what about the algebraic numbers?

EditThanks for all the help, but I haven't seen anyone explicitly address whether or not we could construct integrals with only algebraic numbers. Thanks in advance to anyone who explains why or why not this is possible.

**Answer**

\newcommand{\QQ}{\mathbb{Q}}

Derivatives don't really go wrong, it's antiderivatives.

(EDIT: Actually, the more I think about it, this is just a symptom. The underlying cause is that continuity on the rationals is a much weaker notion than continuity on the reals.)

Consider the function f : \QQ \to \QQ given by

f(x) = \begin{cases} 0 & x < \pi \\ 1 & x > \pi \end{cases}

This function is continuous and differentiable everywhere in its domain. If x < \pi, then there's a neighborhood of x in which f is a constant 0, and so it's continuous there, and f'(x) = 0. But if x > \pi, there's a neighborhood of x in which f is a constant 1, so it's continuous there too, and f'(x) = 0 again.

So the antiderivatives of 0 can look rather messy. By adding functions like this, you can construct arbitrarily "jagged" functions with zero derivative. As you can imagine, this completely destroys the Fundamental Theorem of Calculus, and any results that follow from it.

This can happen in the real line to some extent, but it's not nearly as bad. The traditional antiderivative of 1/x is \ln|x| + C. But so is the following function:

g(x) = \begin{cases} \ln x + C_1 & x > 0 \\ \ln(-x) + C_2 & x < 0 \end{cases}

By changing C_1 and C_2, we can push the two halves of the real line around completely independently. This is only possible because 1/x isn't defined at 0, and so we've "broken" the real line at that point.

If you like dumb physical metaphors, here's one:

The real line is kind of like an infinite stick. If you wiggle a section of it, the whole thing must move.

With the 1/x example, you've made a cut at x = 0, and now you have two half-sticks. They can be wiggled independently, but each half must still move as a unit.

The rational numbers are more like a line of sawdust. You can't really move one grain by itself, but you can certainly take an interval and move it around independent of its neighbors.

By completing the rationals, you're adding all the glue between the grains to form a stick again. (I hope no one from diy.stackexchange is reading this...)

**Attribution***Source : Link , Question Author : Praise Existence , Answer Author : Henry Swanson*