[Math] Well defined Functions on Congruence classes

congruencesfunctionsproof-writing

Could someone please confirm my logic or point me in the right direction? Thank you.

1) Is the function $f : [\mathbb{Z}]_p \to [\mathbb{Z}]_p$ given by $f([n]_p) = [n^2]_p$ well defined?

2) Is the function $g : [\mathbb{Z}]_6 \to [\mathbb{Z}]_{12}$ given by $g([n]_6) = [n^2]_{12}$ well defined?

3) Is the function $h : [\mathbb{Z}]_6 \to [\mathbb{Z}]_{12}$ given by $h([n]_6) = [n^3]_{12}$ well defined?

1) I believe that this is well defined because if we let $p = 5$, $f(2) \to f(4)$ and $f(7) \to f(4)$. However, is there a way to prove this more formally?

EDIT:

For function g:

So, I'm currently having a little trouble going from mod 6 to mod 12. Here's what I have:

$m \sim n$

$6k = m – n$. Then I multiply both sides by $(m + n)$.

$6k(m + n) = m – n(m + n)$.

$6k(m + n) = (m^2 – n^2)$.

I think this would have been sufficient if $g$ mapped to mod 6 instead of mod 12. I'm not sure how to switch to mod 12. (this is actually what I did to prove (1) but for p instead of 6 and $m^2 – n^2$. I know that I have to show that two equivalent elements map to equivalent elements. So, since 7 and 13 are equivalent mod 6, their squared values must be equivalent mod 12 (121 – 49) | 12 = 6. So, I'm thinking I just start with $6 | a – b$ and somehow end up with $12 | m^2 – n^2$.

Continuing from above:

$2 * 6k(m + n) = 2 * (m^2 – n^2)$.

$12k(m + n) = 2*(m^2 – n^2)$.

$12 | 2(m^2 – n^2)$.

And I'm not really sure how to get rid of the 2 on the right-hand side so that I can conclude that $m^2 \cong n^2 (mod 12)$

H is NOT well defined. Checking 3 and 9 mod 6, they are not equivalent when cubed under the mod 12 equivalence relation. (9 – 3) / 6 = 1. (729 – 27) / 12 = 58.5

Best Answer

First of all, you need to be aware what it means for a function to be well-defined. In this case, since you are mapping equivalence classes to equivalence classes, you need to prove that it does not matter which element from any equivalence class you choose to apply your function on, the image must be the same (talking of classes, talking of elements they must be equivalent to each other).

For instance, if we had a map where $1\to 5, 4\to 4$ and we are in $\mathbb{Z}_3$, seeing as $4\equiv 1$ we would have $f(1)=5$ as well as $f(1)=4$, thus we don't actually have a map.

So in our first case we need to prove that, if $n\equiv m \mod p$, then $n^2\equiv m^2 \mod p$.

Seeing as $n^2\equiv m^2 \mod p\Leftrightarrow p|(n^2-m^2)=(n-m)(n+m)$, you might be able to figure out pretty quickly that this is indeed always the case.

For the others you need to do the same - you take two elements that are in the same equivalence class, take their images and either show that they are equivalent or find a counter-example where they are not.

Are you able to take it from here?

Edit: A bit of the second part.

We have $f:\mathbb{Z}_6\to\mathbb{Z}_{12}: [x]\to [x^3]$.

What does it mean that $a\sim b$? In this case, it means that $6|(a-b)$.

What is the question? Whether we can conclude that $a^3\sim b^3 \iff 12|(a^3-b^3)$.

Now, since $a^3-b^3=(a-b)(a^2+ab+b^2)$, this reduces to $6|(a^2+ab+b^2)$..

We also know that certainly $6|(a-b)^2$, hence the above is the same as $6|3ab \Leftrightarrow 2|ab$.

Now, for you to think about, does that hold for all $a\equiv b\mod 6$? If yes, why? If no, can you find a counterexample?

Edit: Now, for the third one.

Basically, what you did seems correct, but I get the slight impression that you do not have as clearly in mind what is given and what you want to prove as you possibly could, leading to a bit of confusion.

So, again: What is our assumption? Our assumption is merely that $a\equiv b\mod 6 \iff 6|(a-b)$.

What do we want to prove/decide? Whether this is enough to tell us that $a^2\equiv b^2\mod 12 \iff 12|(a^2-b^2)$.

Now the next step would be taking what you know and transform it in a way that leads you closer to your goal. In a way, I think that's what you tried to do, but got lost somewhere along the road.

I'll give you two ways to do this, one following what you did more closely and one how I'd have approached this.

1) You arrived at $6k(a+b)=a^2-b^2$.

In a way, you were almost done here, and then started to do, well, stuff. Which I'm not entirely sure helps you anymore.

Now, we want our expressions to be divisible by $12$. So we need to be able to write it as $12\cdot n$, $n\in\mathbb{Z}$. So we have $6k(a+b)=12n \Leftrightarrow k(a+b)=2n$, where $k,n$ are arbitrary integers and $a-b$ is divisible by $6$. Now, since $k$ is arbitrary, this can only be true if $a+b$ is even. Do we have a reason to think that $a+b$ is even? Well, try the Euclidean algorithm: we know $GCD(a+b,2)=GCD(a+b-(a-b),2)=GCD(2b,2)=2$. To put it differently, if the difference of two integers is even, then their sum is also even. So we know that $a+b$ must be even, hence all the above is true and we are well defined.

2) We want $12|(a^2-b^2)=(a+b)(a-b)$.

Inserting our condition $a\equiv b \mod 6$ leaves us with the sufficient condition (only sufficient because, well, $12$ could already be a divisor of $a-b$, but, generally, it won't be). So we need to concentrate on the second factor.

$2|(a+b)$.

Now, as above. Since $2|6$, we know that $2|(a-b) \Rightarrow 2|(a-b)+2b=a+b$,

and we are done.

You could, of course, also break it down into prime factors. This is sometimes useful (since you have all those nice properties of prime numbers, say if $p|ab$ then $p|a$ or $p|b$), but not necessary here:

We have $3|(a-b)\wedge 2|(a-b)$ and need $3\cdot 2^2|(a-b)(a+b)$, where you can work off all the primes you need one by one. It is basically the same as above but, when in doubt and doing number theory, prime numbers never hurt.

(I am aware that I skipped quite a few steps transforming all those expressions, but either they are standard operations where you say Well, duh, of course that's true, or I believe it would pay off for you to do these by hand. Annoying as it might be, there's not much beating good old practice...)

Related Question