# Modulus proof

1. Jun 29, 2008

### garyljc

hi all,
i was studying modulus when i came across this mod(xy) = modx mod y
we consider 3 cases
whereby both positive , both negative, or positive negative

it reads here if we consider x and y to be negative
it will be something like this

mod xy = xy = - mod x ( - mod y ) = mod x mod y
therefore proven

i do not understand why it is -mod x and -mod y
i know that it says that x and y has to be negative
but isnt -mod x different from mod x ? eg if x is 2 , -mod x will be -2 , and mod x will be 2
correct me if i'm wrong
i'm lost
thanks

2. Jun 29, 2008

### matt grime

If x is negative, then mod(x)=-x. So what you've got there is that we've noted

x = -(-x)
y = -(-y)

Hence

xy = (-(-x))(-(-y)) = (-mod x)(=mod y)

if x,y <0.

And, yes mod(x) and -mod(x) are obviously different, so you're correct there.

3. Jun 30, 2008

### garyljc

hey matt ,
but according to the proof
it's mod xy = xy = - mod x ( - mod y ) = mod x mod y

why can't it be
mod xy = xy = mod x mod y
why does it have to have an additional -mod x (-mod y) ?

4. Jun 30, 2008

### d_leet

Because both x and y are negative and not equal to mod x or mod y respectively, but to -mod x and -mod y.

5. Jun 30, 2008

### matt grime

Those equalities many (and indeed do) hold, but you want to *prove* that they do. So you have to use the *definition* of modulus for -ve numbers, rather than just writing what you want to be true, i.e. go the extra mile and make things explicit.

Think of it this way: you know that mod(x)=-x if x<0, now you want to show, using this knowledge, that if x,y<0, then mod(xy)=mod(x)mod(y).

Since x and y are less than 0, xy>0, so mod(xy)=xy.

Now, mod(x)=-x and mod(y)=-y, thus mod(x)mod(y)=(-x)(-y)=xy, so all is fine.

All the proof does is put those things together in one line.

6. Jun 30, 2008

### HallsofIvy

Staff Emeritus
What definition of "modulus" are you using?. It seems to me that to prove something that fundamental you would want to use the precise definition.