5

"By contradiction" or "of negation" is an old chestnut of constructive dispute.

But taking apartness as primitive instead of equality yields a definition of irrationality without negation, making rationality a derived notion.

So can we give a neat constructive proof of $\forall p q.\sqrt2 \neq p/q$ by induction on $p,q:\mathbb N$ with $q\neq 0$?

To do this properly would require first re-formulating the axioms of arithmetic with apartness instead of equality.

There is no doubt that this is true, although it is perhaps less appreciated than it should be that the standard result from Euclid or before uses induction.

(cf David Fowler, Could the Greeks have used Mathematical Induction? Did they use it?, Physis 31 (1994) 252--265.)

Then if the standard proof is classical, I believe that some easy proof theory make it constructive.

But the reason for asking the question is to see whether some logical or constructive insight can be gained from re-thinking the proof using $\neq$, $\forall$ and $\lor$ instead of $=$, $\exists$ and $\land$.

Maybe (probably?) not, but it's worth a try.

Paul Taylor
  • 7,996
  • 18
    Well, the usual elementary purely arithmetical proof shows $2q^2\ne p^2$, thus $|2-p^2/q^2|\ge1/q^2$, thus something like $|\sqrt2-p/q|\ge1/(2\sqrt2q^2)$ or so. – Emil Jeřábek Jan 11 '24 at 20:20
  • 1
    @PaulTaylor: What's the motivation for requiring that the proof proceed "by induction on $p$ and $q$"? Does Emil's comment satisfy you (it can easily be modified to give an elementary proof that uses only basic arithmetic and does not mention any absolute values and fractions)? – Andrej Bauer Jan 14 '24 at 20:41
  • @AndrejBauer: See the linked post for the "motivation": to investigate a contrary position to the one you and I would naturally take regarding whether the usual proof of irrationality of $\sqrt 2$ is one "of negation" or "by contradiction". In the usual definition, rationality (defined using $=$ and $\exists$) is the primitive property and irrationality is its negation. I was wondering whether one could do it the other way round. I can't face re-formulating integer arithmetic using $\neq$ instead of $=$, but you might be able to do it. But the answer to my "wondering" seems be no. – Paul Taylor Jan 14 '24 at 21:02
  • 4
    The comment by @EmilJeřábek should really be an answer and, furthermore, I think it should be the approved answer. It certainly generalizes (by adapting Liouville's standard inequality based on the mean value theorem) to show constructively that any algebraic number that is not rational (in the sense $\neg(\alpha\in\mathbb{Q})$) is apart from every rational (in the sense $|\alpha - p/q| > 0$). – Gro-Tsen Jan 14 '24 at 21:08
  • Equality between two rational numbers is decidable (i.e., Boolean-valued), even in constructive/intuitionistic logic, so perhaps there is not much distinction between a proof of negation establishing "For all p and q, (p/q)^2 is not equal to 2" and a proof of apartness establishing "For all p and q, (p/q)^2 is apart from 2". And perhaps there is furthermore not much distinction between "For all p and q, (p/q)^2 is apart from 2" and "For all p and q, (p/q) is apart from $\sqrt{2}$". – Sridhar Ramesh Jan 14 '24 at 21:08
  • @SridharRamesh But for an arbitrary real number $x$, the statements “$\forall r\in\mathbb{Q}.\neg(x=r)$” and “$\forall r\in\mathbb{Q}.(|x-r|>0)$” need not be equivalent (the latter is stronger), so it makes sense to wonder how the latter arises. (But as I point out in my previous comment, for algebraic $x$, they are equivalent.) – Gro-Tsen Jan 14 '24 at 21:15
  • Sure. I'm just saying, we don't even need to think about Liouville's inequality to note the equivalence of negation and apartness statements in this particular case. (Actually, at the time I was typing my comment, yours had not yet been posted. It seems we were typing at the same time.) – Sridhar Ramesh Jan 14 '24 at 21:19
  • Ok, let me see if I can make Paul's question explicit: "Is there a nice proof by contradiction of the fact that $\sqrt{2}$ is apart from every rational?" Is that the question? – Andrej Bauer Jan 14 '24 at 21:45
  • 3
    One can show apartness by induction: $|p^2-2q^2|=|(2q-p)^2-2(p-q)^2|$. Note that here $(2q-p)+(p-q)=q$ is smaller than $p+q$. – GH from MO Jan 14 '24 at 22:36
  • 3
    Note: the standard notation for apartness is #, not ≠. Two slashes, not one. – Christopher King Jan 15 '24 at 16:44
  • @EmilJeřábek The correct lower bound for $|\sqrt{2}-p/q|$ is $c/q^2$, where $c=2/(3+2\sqrt{2})$, and this constant is sharp. See the "Added 2" section in my post. – GH from MO Jan 15 '24 at 20:37
  • 1
    @GHfromMO Sure, I know. I was just too lazy to do the computation in the initial comment. – Emil Jeřábek Jan 16 '24 at 06:56
  • @EmilJeřábek Anyways, this problem has been studied in the context of the Markov spectrum. That is, we know precisely which numbers $\xi\in\mathbb{R}$ satisfy $\inf q|q\xi|>1/3$, where the infimum is over the positive integers, and we also know the corresponding values $\inf q|q\xi|$. Note that Markov considered $\liminf q|q\xi|$ instead of $\inf q|q\xi|$. In particular, $\liminf q|q\sqrt{2}|=1/(2\sqrt{2})$ while $\inf q|q\sqrt{2}|=2/(3+2\sqrt{2})$. – GH from MO Jan 16 '24 at 13:33
  • I'm sure this discussion is great number theory, but I (intentionally) tagged the question as constructive mathematics, to understand the distinction between $\lnot(\exists =)$ and $\forall\neq$ (or $\forall#$ if you prefer). – Paul Taylor Jan 16 '24 at 13:48
  • @PaulTaylor To most mathematicians (including me) there is no difference between $\lnot(\exists =)$ and $\forall\neq$. Is constructive mathematics a branch of mathematics or philosophy? – GH from MO Jan 16 '24 at 15:59
  • @GHfromMO: that's why the question was addressed to constructivists, not to "most mathematicians". – Paul Taylor Jan 16 '24 at 17:08
  • OK, but is there a mathematical question here? And if yes, what is it? Mathematics is done by first order logic and certain recursive systems of axioms. In first order logic, $\lnot(\exists =)$ is identical to $\forall\neq$ by definition. What are the rules of constructive mathematics, and what are the axioms? I am asking this, because it is not clear to me what kind of answer you expect. – GH from MO Jan 16 '24 at 18:23
  • 1
    @GHfromMO. For an introduction to the constuctive point of view, start with Andrej Bauer's famous Five Stages. To a number theorist I would say that excluded middle is a "fact" just like unique factorisation and characteristic zero are "facts": constructivists work without one because there is interesting mathematics, just as number theorists work without the others because there is interesting mathematics. There are deeper reasons arising from the analogy with computation. – Paul Taylor Jan 16 '24 at 20:04
  • Very interesting, thank you. Which logic do you prefer to use in your proofs: minimal, or intuitionistic, or something else? – GH from MO Jan 16 '24 at 23:17
  • @GHfromMO: Andrej's paper and blog have lots of pointers to the constructive communities (plural). If you'd like to have a 1--1 discussion, email is much better than MO comments. – Paul Taylor Jan 17 '24 at 08:49
  • You misunderstood. My question is connected to your very question. If we don't know which logical calculus we are supposed to use, then the question is not well-posed. You want a proof of a certain statement, but it is not clear which steps are allowed in this proof - because there are many constructive worlds. – GH from MO Jan 17 '24 at 19:59
  • @GHfromMO "To most mathematicians (including me) there is no difference between ¬(∃=) and ∀≠. Is constructive mathematics a branch of mathematics or philosophy?" Constructive math use a different set of axioms. And generally it's not just the logical axioms; the mathematical axioms are a bit different too. (Constructive math is also a branch of mathematical philosophy, but you can use the set of axioms without subscribing to the philosophy.) – Christopher King Jan 18 '24 at 14:47
  • @ChristopherKing Thank you. I see a bit more clearly now thanks to the valuable responses here, and also because I have done some reading and thinking. – GH from MO Jan 18 '24 at 15:29
  • The degree of constructivity that was needed in this particular question was merely the one that FORTRAN programmers use. What has emerged from the discussion is that apartness-from-rationals is equivalent to having an infinite continued fraction. I think this is something that number theorists have known for a long time. So we are talking about the same phenomenon, but with different names. Both arguments about $\sqrt 2$ go back to Euclid, but the geometrical one gives a constructively stronger notion than the arithmetical one. Also, embedding Baire space as the irrationals is not so weird. – Paul Taylor Jan 18 '24 at 17:43
  • Reposting a link mentioned in the post so that the associated question appears in the "Linked" questions list: Quinn Culver's answer to "An example of a beautiful proof that would be accessible at the high school level?" – The Amplitwist Feb 16 '24 at 12:48

3 Answers3

15

Every positive rational number has a finite continued fraction expansion. This one can prove by induction. On the other hand, $\sqrt{2}$ has an infinite continued fraction expansion.

Added 1. Another way of telling the proof is as follows. If $\sqrt 2=p/q$, then also $\sqrt 2=(2q-p)/(p-q)$. Hence one can induct on the sum $p+q$ to show that $\sqrt 2\neq p/q$. By the way, this was probably the original proof as one can tell it in purely geometric language, starting from the side and diagonal of a square. The point is that the Euclidean algorithm does not terminate for the side and diagonal of a square, hence they are not proportional. All this was well-known to ancient Greek mathematicians.

Added 2. Yet another variant of the proof is based on the identity $$|p^2-2q^2|=|(2q-p)^2-2(p-q)^2|.$$ Using this identity, it follows by induction that $|p^2-2q^2|\geq 1$. In turn, this lower bound implies that $$|\sqrt{2} - p/q|\geq c/q^2\qquad\text{with}\qquad c=2/(3+2\sqrt{2}),$$ and this is sharp for $p/q=3/2$. Indeed, we have that $$|\sqrt{2} - p/q|=\frac{|p^2-2q^2|}{q^2|\sqrt{2} + p/q|}\geq\frac{1}{q^2|\sqrt{2} + p/q|},$$ hence the claim is clear when $p/q\leq 3/2$. For $p/q>3/2$ and $q\geq 2$ we can argue as follows: $$|\sqrt{2} - p/q|>3/2-\sqrt{2}=c/4\geq c/q^2.$$ Finally, for $p/q>3/2$ and $q=1$ we have that $$|\sqrt{2} - p/q|\geq 2-\sqrt{2}>c=c/q^2.$$ For a more general result, see Theorem 2 in this summary.

GH from MO
  • 98,751
  • That's a very heavy proof! I was looking for something as simple as the original one. Maybe it's not really any different from the original one, but the discussion following the linked Answer shows how I cam to ask this. – Paul Taylor Jan 11 '24 at 20:04
  • 10
    It's not nearly as heavy as you think. It's basically the Euclidean algorithm. – Noam D. Elkies Jan 11 '24 at 20:25
  • 1
    Then: can all this be done in the setting of the OP? For example, can "infinite" be formulated without negation? Does $\sqrt{2}$ have a unique continued fraction? (Can uniqueness be formulated without negation?) – Gerald Edgar Jan 11 '24 at 21:11
  • 1
    @GeraldEdgar, re, "there exists a unique $x$ such that $P(x)$" is "$(\exists x.P(x)) \land (\forall x, y.(P(x) \land P(y)) \implies x = y)$." Since inequality for integers is fine, I think it's totally reasonable to say that a continued-fraction expansion $[a_0; a_1, \dotsc]$ is non-terminating if $\forall N\exists n > N.a_n \ne 0$. – LSpice Jan 11 '24 at 23:36
  • 1
    @PaulTaylor See my "Added" section. – GH from MO Jan 12 '24 at 05:22
  • @GeraldEdgar See my "Added" section. – GH from MO Jan 12 '24 at 06:55
  • 2
    @LSpice Zeroes can’t occur in a continued fraction expansion besides $a_0$, and even if they could, this would give something rather different from terminating continued fractions. A terminating continued fraction has, literally, only finitely many terms $[a_0;a_1,\dots,a_n]$. If you tried to continue it past this point, the next term would have to be $\infty$ rather than $0$. – Emil Jeřábek Jan 12 '24 at 10:36
  • @EmilJeřábek, re, thanks, of course you are right. I was writing quickly, and obviously not carefully. – LSpice Jan 12 '24 at 15:43
  • The question is not asking to show $\sqrt{2} \neq p/q$ but rather $|\sqrt{2} - p/q| > 0$ (see apartness). – Andrej Bauer Jan 14 '24 at 21:44
  • @AndrejBauer The proof I indicated yields the inequality version as well, because $|p^2-2q^2|=|(2q-p)^2-2(p-q)^2|$. – GH from MO Jan 14 '24 at 22:31
  • @GHfromMO: Would you kindly write an explicitly by what amount $|\sqrt{2} - p/q|$ is bounded away from $0$? In constructive math there is no shame in being explicit. – Andrej Bauer Jan 15 '24 at 15:03
  • 1
    @AndrejBauer See the "Added 2" section in my post. – GH from MO Jan 15 '24 at 20:37
  • The sharp bound is nice, but a rational lower bound (say $2/7q^2$) feels more aesthetically pleasing. – David Roberts Jan 17 '24 at 10:31
  • @DavidRoberts "aesthetically pleasing" is subjective. For $\xi\in\mathbb{R}$ let us write $\chi(\xi)=\inf q|q\xi|$. There are countably many $\xi$'s with $\chi(\xi)>1/3$, and continuum many $\xi$'s with $\chi(\xi)=1/3$. The two largest values of this function are $\chi((1+\sqrt{5})/2)=2/(3+\sqrt{5})$ and $\chi(\sqrt{2})=2/(3+\sqrt{8})$. Every value of $\chi(\xi)$ exceeding $1/3$ is of the shape $2/(3+\sqrt{9-4m^{-2}})$, where $m$ is a so-called Markov number (cf. Markov spectrum). Moreover, if $\chi(\xi)$ is such a value, then $q|q\xi|=\chi(\xi)$ has precisely one solution, namely $q=m$. – GH from MO Jan 17 '24 at 20:12
  • 1
    Sure. But one can look for a rational with lowest denominator or height or whatever. My rationale (not explained above, due to being on mobile at the time) is that if one wants to be extremely constructive, one might want to have the witness for apartness to be a rational number, not another real number. Especially using $\sqrt{2}$ in the witness for apartness from $\sqrt{2}$ feels mildly circular, even though it is not. As I said, getting the tight bound is nice, I'm not opposed to it. – David Roberts Jan 17 '24 at 23:13
  • 1
    See eg the comment here: https://math.stackexchange.com/questions/4496744/constructively-under-what-conditions-is-x-y-vee-y-x-an-apartness-relatio "if one defines two real numbers to be constructively apart when there exists a rational number strictly between them" (this definition or equivalent is given on Wikipedia, PlanetMath). If I consult Bishop and Bridges, two numbers $x,y$ are "unequal" (i.e. apart in the current sense) if $|x-y|\gt 0$, that is, $|x-y|$ is bounded away from 0 by $1/N$. – David Roberts Jan 17 '24 at 23:37
  • @DavidRoberts OK, I understand. I need to get used to the constructive world. – GH from MO Jan 18 '24 at 00:02
  • Not a problem! I'm not sure it's what @Paul wanted, but it's what stood out to me. I notice he has the condition $|x-p/q| > 1/m$ in his answer (more or less). – David Roberts Jan 18 '24 at 04:51
2

Let $\nu_2(x)$ be the $2$-adic order of rational number $x$.

[EDIT] Note that this is completely elementary. It doesn't even require unique factorization. Thus for a nonzero integer $k$, $\nu_2(k) = m$ where $k$ is divisible by $2^m$ but not by $2^{m+1}$. Or if you prefer, it is the number of trailing $0$'s when $|k|$ is written in base $2$. For nonzero integers $p$ and $q$, $\nu_2(p/q) = \nu_2(p) - \nu_2(q)$. It is easy to show that this is well-defined, i.e. if $p/q = r/s$, then $ps = rq$ and $$\nu_2(ps) = \nu_2(p) + \nu_2(s) = \nu_2(rq) = \nu_2(r) + \nu_2(q)$$ so $\nu_2(p) - \nu_2(q) = \nu_2(r) - \nu_2(s)$.

Then $\nu_2((p/q)^2) = 2 \nu_2(p/q)$ is an even integer, but $\nu_2(2) = 1$ is odd, therefore $(p/q)^2 \ne 2$.

Robert Israel
  • 53,594
  • An even heavier proof than the other one, and still not in the spirit of the question. – Paul Taylor Jan 14 '24 at 10:35
  • 3
    How is this heavy? Note that $\nu_2$ is completely elementary: it really has nothing to do with $p$-adic numbers except terminology (maybe I should mention that in the answer). – Robert Israel Jan 14 '24 at 19:56
  • 1
    The question is not about $(p/q)^2 \neq 2$ but about $|(p/q)^2 - 2| > 0$, i.e., the difference between inequality and apartness. – Andrej Bauer Jan 14 '24 at 21:42
  • @PaulTaylor $p^2 = 2q^2$ is impossible for odd $p$. Then we can use induction by the maximum power of 2 that divides $p$. – Denis Shatrov Jan 14 '24 at 21:49
  • @DenisShatrov: more simply, every integer is either odd or even (by induction) and use induction again for the "impossibility". That's why I have described various arguments as "heavy". But this is just another repackaging of the classic proof. – Paul Taylor Jan 14 '24 at 22:33
  • OK, if $\nu_2((p/q)^2)$ is even and $\nu_2(2) = 1$ , then $|(p/q)^2 - 2| \ge 1$. – Robert Israel Jan 15 '24 at 17:32
  • @RobertIsrael, if I understand the claim correctly, then that is not true. For example, $\nu_2((7/5)^2)$ is even (and $\nu_2(2) = 1$), but $\lvert(7/5)^2 - 2\rvert < 1$. – LSpice Jan 15 '24 at 18:33
  • OK, I should have said "if $(p/q)^2$ is an integer and $\nu_2((p/q)^2)$ is even .." – Robert Israel Jan 16 '24 at 05:47
2

I asked this question because I was wondering whether considering a positive definition of irrationality could yield any constructive enlightenment, rather than re-packaging the traditional proof of irrationality of $\sqrt 2$.

@Gro-Tsen, @EmilJeřábek and @GHfromMO have convinced me (contrary to my initial thoughts) that continued fractions do this.

There is a classical result that the irrationals are homeomorphic to Baire space. The positive definition, apartness-from-rationals, makes this constructive.

Classically, there is a floor function ${\mathbb R}\to{\mathbb Z}$, given by $$\lfloor x\rfloor\equiv\max\{n\in{\mathbb Z}:n\leq x\}.$$ However, this is not continuous (since $\mathbb R$ is connected) and so not constructive (since $n\leq x$ is not decidable).

The standard constructive solution to this difficulty is the express the Archimedean axiom as $$ \exists n\in{\mathbb Z}.\quad n-1 < x < n+1, $$ so $x$ might miss the "exact" floor by 1.

However, this problem goes away if $x$ is apart-from-rational, which we can write explicitly as $$ \forall q\in{\mathbb Q}.\exists m\in{\mathbb N}^+.\quad (x < q-\frac{1}{m}) \quad\lor\quad (q+\frac{1}{m} < x), $$ in which the decidable disjunction corrects the ambiguity in the constructive Archimedean axiom.

Not only does this give a constructive definition of $\lfloor x\rfloor$, but also of the reciprocal $1/(x-{\lfloor x\rfloor})$, for which $m$ is an upper bound (cf the Archimedean axiom again). It's these points that convince me that continued fractions answer my philosophical question.

Writing $A\subset{\mathbb R}$ for the subspace of apart-from-rational numbers, we then have a homeomorphism $$ A\ \cong\ {\mathbb Z}\times A, $$ and therefore a continuous map $A\to{\mathbb Z}^{\mathbb N}$. In fact the sequence consists of positive integers, apart from the first.

(For categorists, $A$ is a coalgebra for the functor ${\mathbb N}\times({-})$ and Baire space is the final coalgebra.)

Conversely, any continued fraction gives a pair of recurrence relations for the fraction in standard form, which is automatically in lowest terms. Therefore the denominators increase without bound and (I think) it follows that the limit is apart-from-rational.

Moreover, this defines a continuous map from Baire space ${\mathbb Z}\times{\mathbb N}^{\mathbb N}\to A\subset{\mathbb R}$ that is inverse to the one before.

Paul Taylor
  • 7,996