A proof for modular arithmetic theorem

In summary: I'm stuck. I don't know how to use the info. I know a little bit about proofs but I've never done an "if and only if" proof. In summary, for integers a and b and a positive integer m, the statement "a ≡ b (mod m) if and only if a mod m = b mod m" can be proved by showing that if a ≡ b (mod m), then a mod m = b mod m, and if a mod m = b mod m, then a ≡ b (mod m). To prove the first implication, assume a ≡ b (mod m) and use the definition of congruence to show that a mod m = b
  • #1
r0bHadz
194
17

Homework Statement


Let a and b be integers, and let m be a positive integer. Then a ≡ b (mod m) if and only
if a mod m = b mod m.

Homework Equations

The Attempt at a Solution


By definition a ≡ b (mod m) => m| (a-b)

mx = a -b => mx + b = a => b = a mod m

b = a - mx => b = m(-x) + a => a = b mod m

a = (a mod m) mod m = a mod m => a=b => a mod m = b mod m

does this seem right?
 
  • Like
Likes YoungPhysicist
Physics news on Phys.org
  • #2
r0bHadz said:

Homework Statement


Let a and b be integers, and let m be a positive integer. Then a ≡ b (mod m) if and only
if a mod m = b mod m.

Homework Equations

The Attempt at a Solution


By definition a ≡ b (mod m) => m| (a-b)

mx = a -b => mx + b = a => b = a mod m

b = a - mx => b = m(-x) + a => a = b mod m

a = (a mod m) mod m = a mod m => a=b => a mod m = b mod m

does this seem right?

I'm sorry to say this is not a valid proof. First, note the difference between ##\equiv## and ##=## in this context. Note also that ##a \ mod \ m## is a non-negative integer in the range ##0## to ##m-1##.

In your proof, you have:

r0bHadz said:
b = a mod m

But, ##b## could be any integer and we could have ##b > m##, hence equality with ##a \ mod \ m## is impossible. Also, ##b## could be negative etc.

Also, a proof of an "if and only if" needs to be structured something like:

Let ##a \equiv b \ mod \ m \ \dots##.

Finally, you must be precise. You introduced ##x## without saying what ##x## was. Is it a real number, an integer, a positive integer?

In general, pure mathematics isn't about putting a few calculations together, it's about a precise, logical flow. This is something you need to try to develop.
 
  • #3
r0bHadz said:

Homework Statement


Let a and b be integers, and let m be a positive integer. Then a ≡ b (mod m) if and only
if a mod m = b mod m.

I suggest you do the following implication first. Show that:

if a mod m = b mod m then a ≡ b (mod m)

Post that and then once you have done this, you can try the converse.
 
  • #4
Pero what you wrote made a lot of sense, I've started the proof over again and this is what I got.

Let a ≡ b(mod m ) => m| (a-b) => a-b = mx for x ∈ ℤ

=> a = mx + b

*** if m|a and m|b => a = mp and b = mo for p,o∈ℤ then m| a-b so from m|(a-b) we know m|b

so b = mo + r
a = mx + b can be written as a = mx + (mo + r) => a = m(x+o) + r so

r = a mod m

Now I need to show that r = b mod m correct? Also is my proof starting to look at least a little better
 
  • #5
r0bHadz said:
Pero what you wrote made a lot of sense, I've started the proof over again and this is what I got.

Let a ≡ b(mod m ) => m| (a-b) => a-b = mx for x ∈ ℤ

=> a = mx + b

*** if m|a and m|b => a = mp and b = mo for p,o∈ℤ then m| a-b so from m|(a-b) we know m|b

so b = mo + r
a = mx + b can be written as a = mx + (mo + r) => a = m(x+o) + r so

r = a mod m

Now I need to show that r = b mod m correct? Also is my proof starting to look at least a little better

Yes, this is looking better. You don't need to do the case where ##a, b \equiv 0 \ mod \ m## separately. But, you do need to specify that ##0 \le r < m##. And that, by definition, means that ##r = b \ mod \ m##.

If you tidy that up, you have the first implication. The converse should be simpler.

Note that this proof is a little bit more difficult than expected.
 
  • #6
a≡b(mod m) => m | a-b => mx = a-b for x ∈ℤ

b = my + r and 0≤r<m by definition, so b mod m = r by definition

mx = a- (my + r) => mx + my + r = a => m(x+y) + r = a so by definition a mod m = r as wellConverse:

a mod m = b mod m => a = mx + r and b = my + r 0≤r<m

=> a-b = mx + r - my - r => a-b = m(x-y)

=> m | a-b which is equivalent to a ≡ b(mod m)
 
  • #7
This proof was difficult but I think I'm done proving it now. I'm reading Rosens discrete math book rn. Do you recommend giving a proof for every theorem even if I'm not asked to do so?
 
  • #8
r0bHadz said:
This proof was difficult but I think I'm done proving it now. I'm reading Rosens discrete math book rn. Do you recommend giving a proof for every theorem even if I'm not asked to do so?

Yes, the proof looks correct.

I don't know Rosen's book, so I'm not sure. Generally, you should do at most what the book asks. Anything extra might be useful, but it also takes more time.
 
  • Like
Likes r0bHadz

Related to A proof for modular arithmetic theorem

What is modular arithmetic?

Modular arithmetic is a branch of mathematics that deals with the properties and behavior of numbers when they are divided by a certain number, called the modulus. It is commonly used for solving problems involving remainders, cycles, and patterns.

What is the modular arithmetic theorem?

The modular arithmetic theorem, also known as the division algorithm, states that given two integers a and b, there exists unique integers q and r such that a = bq + r, where 0 ≤ r < b. This theorem is the basis for many important concepts in modular arithmetic.

Why is the modular arithmetic theorem important?

The modular arithmetic theorem is important because it allows us to solve problems involving remainders and cycles, which are common in real-world applications. It also serves as the foundation for other important theorems and concepts in modular arithmetic.

How is the modular arithmetic theorem used in cryptography?

In cryptography, modular arithmetic is used to encrypt and decrypt messages. The modulus serves as the key, and the division algorithm ensures that the encrypted message can only be decrypted with the correct key. This makes modular arithmetic a crucial tool in keeping information secure.

Can the modular arithmetic theorem be proven?

Yes, the modular arithmetic theorem can be proven using mathematical induction. The proof involves showing that the theorem holds true for a base case, and then assuming it holds true for any given integer n and proving that it also holds true for n+1. This process is repeated until the theorem is proven for all integers.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
1
Views
651
Replies
11
Views
542
  • Linear and Abstract Algebra
Replies
11
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
903
  • Precalculus Mathematics Homework Help
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
1K
  • Precalculus Mathematics Homework Help
2
Replies
40
Views
4K
  • Precalculus Mathematics Homework Help
Replies
5
Views
947
  • Precalculus Mathematics Homework Help
Replies
4
Views
4K
  • Precalculus Mathematics Homework Help
Replies
7
Views
910
Back
Top