MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Does Mathematica think Sqrt[2] is rational?

  • To: mathgroup at
  • Subject: [mg86680] Re: Does Mathematica think Sqrt[2] is rational?
  • From: Sebastian Meznaric <meznaric at>
  • Date: Tue, 18 Mar 2008 04:49:42 -0500 (EST)
  • References: <frkv66$109$>

On Mar 17, 5:22 am, magma <mader... at> wrote:
> This might be already well known, but...
> Consider the following expression
> expr = ForAll[{x, y}, x^2 != 2 y^2]
> If we test it over the Reals, it should be false, since x=Sqrt[2] and
> y=1 falsify it.
> Mathematica agrees with us
> Reduce[expr, {x, y}, Reals]
> However if we test it over the Integers or the Rationals it should be
> true, as a demonstration that Sqrt[2] is not rational.
> Mathematica , unfortunately,  does not agree with us
> Reduce[expr, {x, y}, Integers]
> Reduce[expr, {x, y}, Rationals]
> So it appears that Mathematica thinks that there are 2 integers x, y
> such that x^2 = 2 y^2.
> Let's consider the negation of the previous expression
> expr2 = Exists[{x, y}, x^2 == 2 y^2]
> Mathematica correctly finds out that expr is true over the reals
> Reduce[expr2, {x, y}, Reals]
> But gives a wrong answer over the integers or the rationals
> Reduce[expr2, {x, y}, Integers]
> Reduce[expr2, {x, y}, Rationals]
> Finally, if we try the inequality without the quantifiers, the results
> are not very illuminating with the Reals, but still correct
> Reduce[x^2 != 2 y^2, {x, y}, Reals]
> While with Integers Mathematica misses the point entirely
> Reduce[x^2 != 2 y^2, {x, y}, Integers]
> Conclusion : Mathematica does not seem to realize that Sqrt[2] is
> irrational.
> Am I missing something or WRI has been infiltrated by
> Pythagoreans :-)  ?

That's very strange. I tried this
expr=Exists[{x, y}, x/y == Sqrt[2] ]

Reduce[expr,Reals] gives True.

For Reduce[expr,Integers]  or over Rationals I get
Reduce::nsmet: This system cannot be solved with the methods \
available to Reduce.

Looks like for your particular definition it breaks. On my system
Reduce[Exists[{x, y}, x^2 == 2 y^2], {x, y}, Integers]


x \[Element] Integers && y \[Element] Integers

which is of course ridiculous since it does not hold for all integer x
and y.

  • Prev by Date: Compiled function slowdown
  • Next by Date: Re: Does Mathematica think Sqrt[2] is rational?
  • Previous by thread: Re: Does Mathematica think Sqrt[2] is rational?
  • Next by thread: Re: Does Mathematica think Sqrt[2] is rational?