# Strange behaviour of Reduce for Mod[x,1]

For every integer $x$ the equation Mod[x, 1] == 0 holds. While

Simplify[Mod[x, 1] == 0, Element[x,Integers]]


gives True,

Reduce[Mod[x, 1] == 0, x, Integers]


gives False. Why?

• Welcome to Mathematica @ StackExchange! Please consider registering your account so that any upvotes you get on this question are added to those you might get on future questions and answers. That way, over time you will be able to do more on the site (post graphics, edit things, etc). Also, I have formatted your code to make it easier to read. This link will show you how it's done for next time. And welcome again! Aug 16, 2012 at 23:14
• @NasserM.Abbasi I think this is because the documentation is usually written by the same person that coded the functionality. While an economical approach, it's not necessarily the best for expository value: the author will already have internalized the purpose and semantics of the code, so describing it to others in an unbiased way is that much harder for them. I don't blame the developers for that, of course--I'm a terrible example of this myself. Aug 17, 2012 at 1:03
• @OleksandrR. I think you just described my papers :D
– rm -rf
Aug 17, 2012 at 4:14

Reduce works fine for a slightly more sophisticated expression, e.g. :

Reduce[ ForAll[ x, x ∈ Integers, Mod[ x, 1] == 0], x]

True


however there is a bug in Solve :

Solve[ Mod[x, 1] == 0, x, Integers]

{}


therefore it is not surprising we have an analogical issue in Reduce :

Reduce[ Mod[x, 1] == 0, x, Integers]

False


Seemingly there has not been much clamor therefore it has not been a high priority to improve it.

One can work around these problems :

Reduce[ Mod[ a x, a] == 0 && a == 1, x, Integers]

C ∈ Integers && a == 1 && x == C


or simply

Reduce[ Mod[ x, 1] == a, x, Integers]

C ∈ Integers && a == 0 && x == C

Solve[ Mod[ x, 1] == a, x, Integers]

{{x -> ConditionalExpression[C, C ∈ Integers && a == 0]}}


## Edit

The above problems with Reduce and Solve were found in Mathematica 8. Before there had been :

ver. 7

Solve[ Mod[x, 1] == 0, x, Integers]

Solve::ifun: Inverse functions are being used by Solve, so some solutions may not
be found; use Reduce for complete solution information. >>

{{x -> InverseFunction[Mod, 1, 2][0, 1]}}

Reduce[ Mod[x, 1] == 0, x, Integers]

False


Now these bugs have been fixed :

ver. 9

Solve[ Mod[x, 1] == 0, x, Integers]

{{x -> ConditionalExpression[C, C ∈ Integers]}}

Reduce[ Mod[x, 1] == 0, x, Integers]

C ∈ Integers && x == C

• Congrats on 10k! Aug 17, 2012 at 4:23
• Worth noting that this issue has been fixed in Mathematica 9, where Solve now gives the correct result. Dec 9, 2012 at 18:00
• @OleksandrR. Thanks, updated. Dec 10, 2012 at 2:18