hcju/proofwikiqa huggingface dataset:
We prove its existence thus: $a b \ne 0 \implies \size {a b} \ne 0$ Also $\size {a b} = \pm a b = a \paren {\pm b} = \paren {\pm a} b$. So it definitely exists, and we can say that: :$0 < \lcm \set {a, b} \le \size {a b}$ Now we prove it is the lowest. That is: :$a \divides n \land b \divides n \implies \lcm \set {a, b} \divides n$ Let $a, b \in \Z: a b \ne 0, m = \lcm \set {a, b}$. Let $n \in \Z: a \divides n \land b \divides n$. We have: : $n = x_1 a = y_1 b$ : $m = x_2 a = y_2 b$ As $m > 0$, we have: {{begin-eqn}} {{eqn | l = n       | r = m q + r: 0 \le r < \size m = m       | c =  }} {{eqn | lll=\leadsto       | l = r       | r = n - m q       | c = }} {{eqn | r = 1 \times n + \paren {-q} \times m       | c = }} {{eqn | lll=\leadsto       | l = r       | r = x_1 a + \paren {-q} x_2 a       | c = }} {{eqn | r = y_1 b + \paren {-q} y_2 b       | c = }} {{eqn | lll=\leadsto       | l = a       | o = \divides       | r = r       | c = }} {{eqn | ll= \land       | l = b       | o = \divides       | r = r       | c =  }} {{end-eqn}} Since $r < m$, and $m$ is the smallest ''positive'' common multiple of $a$ and $b$, it follows that $r = 0$. So: : $\forall n \in \Z: a \divides n \land b \divides n: \lcm \set {a, b} \divides n$ That is, $\lcm \set {a, b}$ divides any common multiple of $a$ and $b$. {{qed}}
Either $a$ and $b$ are coprime or they are not. Let: :$a \perp b$ where $a \perp b$ denotes that $a$ and $b$ are coprime. Let $a b = c$. Then: :$a \divides c, b \divides c$ where $a \divides c$ denotes that $a$ is a divisor of $c$. Suppose both $a \divides d, b \divides d$ for some $d \in \N_{> 0}: d < c$. Then: :$\exists e \in \N_{> 0}: a e = d$ :$\exists f \in \N_{> 0}: b f = d$ Therefore: :$a e = b f$ and from {{EuclidPropLink|book = VII|prop = 19|title = Relation of Ratios to Products}}: :$a : b = f : e$ But $a$ and $b$ are coprime. From: :{{EuclidPropLink|prop = 21|title = Coprime Numbers form Fraction in Lowest Terms}} and: :{{EuclidPropLink|prop = 20|title = Ratios of Fractions in Lowest Terms}} it follows that $b \divides e$ Since: :$a b = c$ and: :$a e = d$ it follows from {{EuclidPropLink|prop = 17|title = Multiples of Ratios of Numbers}} that: :$b : e = c : d$ But $b \divides e$ and therefore: :$c \divides d$ But $c > d$ which is impossible. Therefore $a$ and $b$ are both the divisor of no number less than $c$. Now suppose $a$ and $b$ are not coprime. Let $f$ and $e$ be the least numbers of those which have the same ratio with $a$ and $b$. Then from {{EuclidPropLink|prop = 19|title = Relation of Ratios to Products}}: :$a e = b f$ Let $a e = c$. Then $b f = c$. Hence: :$a \divides c$ :$b \divides c$ Suppose $a$ and $b$ are both the divisor of some number $d$ which is less than $c$. Let: :$a g = d$ and: :$b h = d$ Therefore: :$a g = b h$ and so by {{EuclidPropLink|prop = 19|title = Relation of Ratios to Products}}: :$a : b = f : e$ Also: :$f : e = h : g$ But $f, e$ are the least such. From {{EuclidPropLink|prop = 20|title = Ratios of Fractions in Lowest Terms}}: :$e \divides g$ Since $a e = c$ and $a g = d$, from {{EuclidPropLink|prop = 17|title = Multiples of Ratios of Numbers}}: :$e : g = c : d$ But: :$e \divides g$ So $c \divides d$ But $c > d$ which is impossible. Therefore $a$ and $b$ are both the divisor of no number less than $c$. {{qed}}
It is sufficient to prove that $\lcm \set {a, b} \times \gcd \set {a, b} = a b$, where $a, b \in \Z_{>0}$. {{begin-eqn}} {{eqn | l = d        | r = \gcd \set {a, b}       | c =  }} {{eqn | ll= \leadsto       | l = d       | o = \divides       | r = a b       | c =  }} {{eqn | ll= \leadsto       | lo= \exists n \in \Z_{>0}:       | l = a b       | r = d n       | c= }} {{end-eqn}} {{begin-eqn}} {{eqn | l = d \divides a       | o = \land       | r = d \divides b       | c =  }} {{eqn | ll= \leadsto       | lo= \exists u, v \in \Z:       | l = a = d u       | o = \land       | r = b = d v       | c =  }} {{eqn | ll= \leadsto       | l = d u b = d n       | o = \land       | r = a d v = d n       | c =  }} {{eqn | ll= \leadsto       | l = n = b u       | o = \land       | r = n = a v       | c =  }} {{eqn | ll= \leadsto       | l = a \divides n       | o = \land       | r = b \divides n       | c =  }} {{end-eqn}} Now we have $a \divides m \land b \divides m \implies m = a r = b s$. Also, by Bézout's Lemma we have $d = a x + b y$. So: {{begin-eqn}} {{eqn | l = m d       | r = a x m + b y m       | c =  }} {{eqn | r = b s a x + a r b y       | c =  }} {{eqn | r = a b \paren {s x + r y}       | c =  }} {{eqn | r = d n \paren {s x + r y}       | c =  }} {{end-eqn}} So: :$m = n \paren {s x + r y}$ Thus: :$n \divides m \implies n \le \size m$ while: :$a b = d n = \gcd \set {a, b} \times \lcm \set {a, b}$ as required. {{qed}}
Let $a = g m$ and $b = g n$, where $g = \gcd \set {a, b}$ and $m$ and $n$ are coprime. The existence of $m$ and $n$ are proved by Integers Divided by GCD are Coprime. Since $a = g m \divides g m n$ and $b = g n \divides g m n$, $g m n$ is the LCM of $a$ and $b$. {{explain|why?}} Then it follows that: :$\lcm \set {a, b} \times \gcd \set {a, b} = g m n \times g = g m \times g n = \size {a b}$ {{qed}}
Let $d := \gcd \set {a, b}$.  Then by definition of the GCD, there exist $j_1, j_2 \in \Z$ such that $a = d j_1$ and $b = d j_2$. Because $d$ divides both $a$ and $b$, it must divide their product: :$\exists l \in \Z$ such that $a b = d l$ Then we have:  {{begin-eqn}} {{eqn | l = d l       | m = \paren {d j_1} b       | mo= =       | r = a \paren {d j_2} }} {{eqn | ll= \leadsto       | l = l       | m = j_1 b       | mo= =       | r = a j_2 }} {{end-eqn}} showing that $a \divides l$ and $b \divides l$. That is, $l$ is a common multiple of $a$ and $b$. Now it must be shown that $l$ is the least such number. Let $m$ be any common multiple of $a$ and $b$. Then there exist $k_1, k_2 \in \Z$ such that $m = a k_1 = b k_2$. By Bézout's Lemma: :$\exists x, y \in \Z: d = a x + b y$ So: {{begin-eqn}} {{eqn | l = m d       | r = m a x + m b y }} {{eqn | r = \paren {b k_2} a x + \paren {a k_1} b y }} {{eqn | r = a b \paren {b k_2 + a k_1} }} {{eqn | r = d l \paren {b k_2 + a k_1} }} {{end-eqn}} Thus: :$m = l \paren {b k_2 + a k_1}$ that is, $l \divides m$. Hence by definition of the LCM: :$\lcm \set {a, b} = l$ In conclusion: :$a b = d l = \gcd \set {a, b} \cdot \lcm \set {a, b}$ {{qed}}
Let: {{begin-eqn}} {{eqn | l = m       | r = {p_1}^{k_1} {p_2}^{k_2} \dotsm {p_r}^{k_r} }} {{eqn | l = n       | r = {p_1}^{l_1} {p_2}^{l_2} \dotsm {p_r}r^{l_r}       | c =  }} {{end-eqn}} From LCM from Prime Decomposition: :$\lcm \set {m, n} = p_1^{\max \set {k_1, l_1} } p_2^{\max \set {k_2, l_2} } \dotsm p_r^{\max \set {k_r, l_r} }$ From GCD from Prime Decomposition: :$\gcd \set {m, n} = p_1^{\min \set {k_1, l_1} } p_2^{\min \set {k_2, l_2} } \dotsm p_r^{\min \set {k_r, l_r} }$ From Sum of Maximum and Minimum, for all $i \in \set {1, 2, \ldots, r}$: :$\min \set {k_i, l_i} + \max \set {k_i, l_i} = k_i + l_i$ Hence: {{begin-eqn}} {{eqn | l = \gcd \set {m, n} \times \lcm \set {m, n}       | r = p_1^{k_1 + l_1} p_2^{k_2 + l_2} \dotsm p_r^{k_r + l_r}       | c =  }} {{eqn | r = p_1^{k_1} p_1^{l_1} p_2^{k_2} p_2^{l_2} \dotsm p_r^{k_r} p_r^{l_r}       | c =  }} {{eqn | r = p_1^{k_1} p_2^{k_2} \dotsm p_r^{k_r} \times p_1^{l_1} p_2^{l_2} \dotsm p_r^{l_r}       | c =  }} {{eqn | r = m n       | c =  }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \exists k \in \Z: a       | r = k z       | c =  }} {{eqn | ll= \leadstoandfrom       | l = \exists k \in \Z: a       | r = 0 + k z       | c =  }} {{end-eqn}} Thus by definition of congruence, $a \equiv 0 \pmod z$ and the result is proved. If $z$ is an integer, then by definition of divisor: :$z \divides a \iff \exists k \in \Z: a = k z$ Hence the result for integer $z$. {{qed}} Category:Modulo Arithmetic 87apiiualuplsor2u54hkqv8t4i4x69
Let $a$ have a remainder $r$ on division by $m$. Then: : $\exists q \in \Z: a = q m + r$ Hence by definition of congruence modulo $m$: :$a \equiv r \pmod m$ {{qed}}
=== Proof of Existence === Let $a \in \Z$. Then from the Division Theorem: $\exists r \in \set {0, 1, \ldots, m - 1}: a \equiv r \pmod m$. === Proof of Uniqueness === Suppose that: :$\exists r_1, r_2 \in \set {0, 1, \ldots, m - 1}: a \equiv r_1 \pmod m \land a \equiv r_2 \pmod m$ Then: :$\exists r_1, r_2 \in \Z: a = q_1 m + r_1 = q_2 m + r_2$ This contradicts the uniqueness clause in the Division Theorem. {{qed}}
The equivalence class $\eqclass a m$ is defined as: :$\eqclass a m = \set {x \in \Z: x = a + k m: k \in \Z}$ That is, the set of all integers which differ from $a$ by an integer multiple of $m$. Thus the notation for addition of two set of integers modulo $m$ is not usually $\eqclass a m +_m \eqclass b m$. What is more normally seen is $a + b \pmod m$. Using this notation: {{begin-eqn}} {{eqn | l = a       | o = \equiv       | r = b       | rr= \pmod m       | c = }} {{eqn | lo= \land       | l = c       | o = \equiv       | r = d       | rr= \pmod m       | c = }} {{eqn | ll= \leadsto       | l = a \bmod m       | r = b \bmod m       | c = {{Defof|Congruence Modulo Integer}} }} {{eqn | lo= \land       | l = c \bmod m       | r = d \bmod m       | c =  }} {{eqn | ll= \leadsto       | l = a       | r = b + k_1 m       | c = for some $k_1 \in \Z$ }} {{eqn | lo= \land       | l = c       | r = d + k_2 m       | c = for some $k_2 \in \Z$ }} {{eqn | ll= \leadsto       | l = a + c       | r = b + d + \paren {k_1 + k_2} m       | c = {{Defof|Integer Addition}} }} {{eqn | ll= \leadsto       | l = a + c       | o = \equiv       | r = b + d       | rr= \pmod m       | c = {{Defof|Modulo Addition}} }} {{end-eqn}} {{qed}}
We need to show that if: :$\eqclass {x'} m = \eqclass x m$ :$\eqclass {y'} m = \eqclass y m$ then: :$\eqclass {x' + y'} m = \eqclass {x + y} m$ Since: :$\eqclass {x'} m = \eqclass x m$ and: :$\eqclass {y'} m = \eqclass y m$ it follows from the definition of set of integers modulo $m$ that: :$x \equiv x' \pmod m$ and: :$y \equiv y' \pmod m$ By definition, we have: :$x \equiv x' \pmod m \implies \exists k_1 \in \Z: x = x' + k_1 m$ :$y \equiv y' \pmod m \implies \exists k_2 \in \Z: y = y' + k_2 m$ which gives us: :$x + y = x' + k_1 m + y' + k_2 m = x' + y' + \left({k_1 + k_2}\right) m$ As $k_1 + k_2$ is an integer, it follows that, by definition: :$x + y \equiv \left({x' + y'}\right) \pmod m$ Therefore, by the definition of integers modulo $m$: :$\eqclass {x' + y'} m = \eqclass {x + y} m$ {{qed}}
We need to show that if: :$\eqclass {x'} m = \eqclass x m$ and: :$\eqclass {y'} m = \eqclass y m$ then: :$\eqclass {x' y'} m = \eqclass {x y} m$ We have that: :$\eqclass {x'} m = \eqclass x m$ and: :$\eqclass {y'} m = \eqclass y m$ It follows from the definition of residue class modulo $m$ that: :$x \equiv x' \pmod m$ and: :$y \equiv y' \pmod m$ By definition, we have: :$x \equiv x' \pmod m \implies \exists k_1 \in \Z: x = x' + k_1 m$ :$y \equiv y' \pmod m \implies \exists k_2 \in \Z: y = y' + k_2 m$ which gives us: :$x y = \paren {x' + k_1 m} \paren {y' + k_2 m} = x' y' + \paren {x' k_2 + y' k_1} m + k_1 k_2 m^2$ Thus by definition: :$x y \equiv \paren {x' y'} \pmod m$ Therefore, by the definition of residue class modulo $m$: :$\eqclass {x' y'} m = \eqclass {x y} m$ {{qed}}
The equivalence class $\eqclass a m$ is defined as: :$\eqclass a m = \set {x \in \Z: x = a + k m: k \in \Z}$ that is, the set of all integers which differ from $a$ by an integer multiple of $m$. Thus the notation for addition of two residue classes modulo $z$ is not usually $\eqclass a m +_m \eqclass b m$. What is more normally seen is: : $a b \pmod m$ Using this notation: {{begin-eqn}} {{eqn | l = a       | o = \equiv       | r = b       | rr= \pmod m       | c =  }} {{eqn | lo= \land       | l = c       | o = \equiv       | r = d       | rr= \pmod m       | c =  }} {{eqn | ll= \leadsto       | l = a \bmod m       | r = b \bmod m       | c = {{Defof|Congruence Modulo Integer}} }} {{eqn | lo= \land       | l = c \bmod m       | r = d \bmod m       | c =  }} {{eqn | ll= \leadsto       | l = a       | r = b + k_1 m       | c = for some $k_1 \in \Z$ }} {{eqn | lo= \land       | l = c       | r = d + k_2 m       | c = for some $k_2 \in \Z$ }} {{eqn | ll= \leadsto       | l = a c       | r = \paren {b + k_1 m} \paren {d + k_2 m}       | c = {{Defof|Multiplication}} }} {{eqn | r = b d + b k_2 m + d k_1 m + k_1 k_2 m^2       | c = Integer Multiplication Distributes over Addition }} {{eqn | r = b d + \paren {b k_2 + d k_1 + k_1 k_2 m} m       | c =  }} {{eqn | ll= \leadsto       | l = a c       | o = \equiv       | r = b d       | rr= \pmod m       | c = {{Defof|Modulo Multiplication}} }} {{end-eqn}} {{qed}}
Let $m \in \Z$ and $a \equiv b \pmod z$. Suppose $m = 0$. Then the {{RHS}} of the assertion degenerates to $0 \equiv 0 \pmod z$ which is trivially true. Otherwise, from Congruence by Product of Moduli, we have: :$a \equiv b \iff m a \equiv m b \pmod z$ As $m \in \Z$, it follows that $m z$ is an integer multiple of $z$. Hence from Congruence by Divisor of Modulus, it follows that: :$m a \equiv m b \implies m a \equiv m b \pmod z$ {{qed}}
Proof by induction: For all $n \in \Z_{\ge 0}$, let $\map P n$ be the proposition: :$a \equiv b \implies a^k \equiv b^k \pmod m$ $\map P 0$ is trivially true, as $a^0 = b^0 = 1$. $\map P 1$ is true, as this just says: :$a \equiv b \pmod m$ === Basis for the Induction === $\map P 2$ is the case: :$a^2 \equiv b^2 \pmod m$ which follows directly from the fact that Modulo Multiplication is Well-Defined. This is our basis for the induction. === Induction Hypothesis === Now we need to show that, if $\map P k$ is true, where $k \ge 2$, then it logically follows that $\map P {k + 1}$ is true. So this is our induction hypothesis: :$a \equiv b \implies a^k \equiv b^k \pmod m$ Then we need to show: :$a \equiv b \implies a^{k + 1} \equiv b^{k + 1} \pmod m$ === Induction Step === This is our induction step: Suppose $a^k \equiv b^k \pmod m$. Then $a^k a \equiv b^k b \pmod m$ by definition of modulo multiplication. Thus $a^{k + 1} \equiv b^{k + 1} \pmod m$. So $\map P k \implies \map P {k + 1}$ and the result follows by the Principle of Mathematical Induction. Therefore: :$\forall n \in \Z_+: a \equiv b \implies a^n \equiv b^n \pmod m$ {{qed}}
{{begin-eqn}} {{eqn | l = \paren {\eqclass x m +_m \eqclass y m} +_m \eqclass z m       | r = \eqclass {x + y} m +_m \eqclass z m       | c = {{Defof|Modulo Addition}} }} {{eqn | r = \eqclass {\paren {x + y} + z} m       | c = {{Defof|Modulo Addition}} }} {{eqn | r = \eqclass {x + \paren {y + z} } m       | c = Associative Law of Addition }} {{eqn | r = \eqclass x m +_m \eqclass {y + z} m       | c = {{Defof|Modulo Addition}} }} {{eqn | r = \eqclass x m +_m \paren {\eqclass y m +_m \eqclass z m}       | c = {{Defof|Modulo Addition}} }} {{end-eqn}} {{qed}}
From the definition of modulo addition, this is also written: :$\forall m \in \Z: \forall \eqclass x m, \eqclass y m \in \Z_m: \eqclass x m +_m \eqclass y m = \eqclass y m +_m \eqclass x m$ Hence: {{begin-eqn}} {{eqn | l = \eqclass x m +_m \eqclass y m       | r = \eqclass {x + y} m       | c = {{Defof|Modulo Addition}} }} {{eqn | r = \eqclass {y + x} m       | c = Commutative Law of Addition }} {{eqn | r = \eqclass y m +_m \eqclass x m       | c = {{Defof|Modulo Addition}} }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \eqclass x m +_m \eqclass 0 m       | r = \eqclass {x + 0} m       | c = {{Defof|Modulo Addition}} }} {{eqn | r = \eqclass x m       | c =  }} {{eqn | r = \eqclass {0 + x} m       | c =  }} {{eqn | r = \eqclass 0 m +_m \eqclass x m       | c = {{Defof|Modulo Addition}} }} {{end-eqn}} Thus $\eqclass 0 m$ is the identity for addition modulo $m$. {{Qed}}
{{begin-eqn}} {{eqn | l = \eqclass x m +_m \eqclass {-x} m       | r = \eqclass {x + \paren {-x} } m       | c = {{Defof|Modulo Addition}} }} {{eqn | r = \eqclass 0 m       | c =  }} {{eqn | r = \eqclass {\paren {-x} + x} m       | c =  }} {{eqn | r = \eqclass {-x} m +_m \eqclass x m       | c = {{Defof|Modulo Addition}} }} {{end-eqn}} As $-x$ is a perfectly good integer, $\eqclass {-x} m \in \Z_m$, whatever $x$ may be. {{qed}}
From the definition of multiplication modulo $m$, we have: :$\eqclass x m \times_m \eqclass y m = \eqclass {x y} m$ By the Division Theorem: :$x y = q m + r$ where $0 \le r < m$ Therefore for all $0 \le r < m$: :$\eqclass {x y} m = \eqclass r m$ Therefore from the definition of integers modulo $m$: :$\eqclass {x y} m \in \Z_m$ {{qed}}
{{begin-eqn}} {{eqn | l = \paren {\eqclass x m \times_m \eqclass y m} \times_m \eqclass z m       | r = \eqclass {x y} m \times_m \eqclass z m       | c = {{Defof|Modulo Multiplication}} }} {{eqn | r = \eqclass {\paren {x y} z} m       | c = {{Defof|Modulo Multiplication}} }} {{eqn | r = \eqclass {x \paren {y z} } m       | c = Integer Multiplication is Associative }} {{eqn | r = \eqclass x m \times_m \eqclass {y z} m       | c = {{Defof|Modulo Multiplication}} }} {{eqn | r = \eqclass x m \times_m \paren {\eqclass y m \times_m \eqclass z m}       | c = {{Defof|Modulo Multiplication}} }} {{end-eqn}} {{qed}}
Let $j$ be the largest integer such that: :$j m \le x y$ Let $p$ be the largest integer such that: :$p m \le y z$ By definition of multiplication modulo $m$: :$x \cdot_m y = x y - j m$ :$y \cdot_m z = y z - p m$ Let $k$ be the largest integer such that: :$k m \le \paren {x y - j m} z$ Let $q$ be the largest integer such that: :$q m \le x \paren {y z - p m}$ Then: :$\paren {j z + k} m \le \paren {x y} z$ :$\paren {q + x p} m \le x \paren {y z}$ Thus: {{begin-eqn}} {{eqn | l = \paren {x \cdot_m y} \cdot_m z       | r = \paren {x y - j m} z - k m       | c = {{Defof|Modulo Multiplication}} }} {{eqn | l = x \cdot_m \paren {y \cdot_m z}       | r = x \left({y z - p m}\right) - q m       | c = {{Defof|Modulo Multiplication}} }} {{end-eqn}} But suppose that there exists an integer $s$ such that: :$s m \le \paren {x y} z$ and: :$j z + k < s$ Then: :$\paren {j z + k + 1} m \le \paren {x y} z$ from which: :$\paren {k + 1} m \le \paren {x y - j m} z$ But this contradicts the definition of $k$. Thus $j z + k$ is the largest of those integers $i$ such that $i m \le \paren {x y} z$. Similarly, $q + x p$ is the largest of those integers $i$ such that $i m \le x \paren {y z}$. From Integer Multiplication is Associative: :$\paren {x y} z = x \paren {y z}$ Thus $j z + k = q + x p$ and so: {{begin-eqn}} {{eqn | l = \paren {x \cdot_m y} \cdot_m z       | r = \paren {x y - j m} z - k m       | c = {{Defof|Modulo Multiplication}} }} {{eqn | r = x y z - \paren {j z + k} m       | c =  }} {{eqn | r = x y z - \paren {q + x p} m       | c =  }} {{eqn | r = x \paren {y z - p m} - q m       | c =  }} {{eqn | r = x \cdot_m \paren {y \cdot_m z}       | c = {{Defof|Modulo Multiplication}} }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \eqclass x m \times_m \eqclass y m       | r = \eqclass {x y} m       | c = {{Defof|Modulo Multiplication}} }} {{eqn | r = \eqclass {y x} m       | c = Integer Multiplication is Commutative }} {{eqn | r = \eqclass y m \times_m \eqclass x m       | c = {{Defof|Modulo Multiplication}} }} {{end-eqn}} {{qed}}
Follows directly from the definition of multiplication modulo $m$: {{begin-eqn}} {{eqn | l = \eqclass x m \times_m \eqclass 1 m       | r = \eqclass {x \times 1} m       | c =  }} {{eqn | r = \eqclass x m       | c =  }} {{eqn | r = \eqclass {1 \times x} m       | c =  }} {{eqn | r = \eqclass 1 m \times_m \eqclass x m       | c =  }} {{end-eqn}} Thus $\eqclass 1 m$ is the identity for multiplication modulo $m$. {{qed}}
Follows directly from the definition of multiplication modulo $m$ and addition modulo $m$: {{begin-eqn}} {{eqn | l = \eqclass x m \times_m \paren {\eqclass y m +_m \eqclass z m}       | r = \eqclass x m \times_m \eqclass {y + z} m       | c =  }} {{eqn | r = \eqclass {x \paren {y + z} } m       | c =  }} {{eqn | r = \eqclass {\paren {x y} + \paren {x z} } m       | c =  }} {{eqn | r = \eqclass {x y} m +_m \eqclass {x z} m       | c =  }} {{eqn | r = \paren {\eqclass x m \times_m \eqclass y m} +_m \paren {\eqclass x m \times_m \eqclass z m}       | c =  }} {{end-eqn}} And the second is like it, namely this: {{begin-eqn}} {{eqn | l = \paren {\eqclass x m +_m \eqclass y m} \times_m \eqclass z m       | r = \eqclass {x + y} m \times_m \eqclass z m       | c =  }} {{eqn | r = \eqclass {\paren {x + y} z} m       | c =  }} {{eqn | r = \eqclass {\paren {x z} + \paren {y z} } m       | c =  }} {{eqn | r = \eqclass {x z} m +_m \eqclass {y z} m       | c =  }} {{eqn | r = \paren {\eqclass x m \times_m \eqclass z m} +_m \paren {\eqclass y m \times_m \eqclass z m}       | c =  }} {{end-eqn}} {{qed}}
Let $\tuple {a, b} \in \mathcal R_m \cap \mathcal R_n$. That is, let $\tuple {a, b} \in \mathcal R_m$ and $\tuple {a, b} \in \mathcal R_n$. That means, by definition of congruence: :$a \equiv b \pmod m$ :$a \equiv b \pmod n$ Thus by definition of congruence: :$\exists r, s \in \Z: a - b = r m, a - b = s n$ Let $d = \gcd \set {m, n}$ so that $m = d m', n = d n', m' \perp n'$. Substituting for $m$ and $n$: :$r d m' = s d n'$ and so $r m' = s n'$. So $n' \divides r m'$ and $m' \perp n'$ so by Euclid's Lemma $n' \divides r$. So we can put $r = k n'$ and get: :$a - b = r m = k m n' = k m \dfrac n d = k \dfrac {m n} d$ But: :$\dfrac {m n} d = \dfrac {m n} {\gcd \set {m, n} }$ So by Product of GCD and LCM: :$a - b = k \lcm \set {m, n}$ So: :$a \equiv b \pmod {\lcm \set {m, n} }$ and hence the result. {{qed}}
For $\phi$ to be well defined, we require that: :$\forall x, y \in \Z_m: \eqclass x m = \eqclass y m \implies \map \phi {\eqclass x m} = \map \phi {\eqclass y m}$ Now: :$\eqclass x m = \eqclass y m \implies x - y \divides m$ For $\map \phi {\eqclass x m} = \map \phi {\eqclass y m}$ we require that: :$\eqclass x n = \eqclass y n \implies x - y \divides n$ Thus $\phi$ is well defined {{iff}}: :$x - y \divides m \implies x - y \divides n$ That is, {{iff}} $m \divides n$. {{qed}}
We have: :$a \equiv b \pmod m \implies \exists k \in \Z: a = b + k m$ Thus: :$a = b + k m$ and the result follows directly from GCD with Remainder. {{qed}}
=== Necessary Condition === Let $p$ be a prime number from the definition that $p$ has exactly $2$ divisors which are positive integers. From One Divides all Integers and Integer Divides Itself those positive integers are $1$ and $p$. Also, we have $-1 \divides p$ and $-p \divides p$ from One Divides all Integers and Integer Divides its Negative. {{AimForCont}}: : $\exists x < 0: x \divides p$ where $x \ne -1$ and $x \ne -p$. Then: : $\size x \divides x \divides p$ and so $\size x$ is therefore a positive integer other than $1$ and $p$ that divides $p$. This is a contradiction of the condition for $p$ to be prime. So $-1$ and $-p$ are the only negative integers that divide $p$. It follows that $p$ has exactly those four divisors. {{qed|lemma}} === Sufficient Condition === Suppose $p$ has the divisors $1, -1, p, -p$. It follows that $1$ and $p$ are the only positive integers that divide $p$. Thus $p$ has exactly two divisors which are positive integers. {{qed}}
Let $p \in \Bbb P, p \nmid a$. We need to show that $\gcd \set {a, p} = 1$. Let $\gcd \set {a, p} = d$. As $d \divides p$, we must have $d = 1$ or $d = p$ by GCD with Prime. But if $d = p$, then $p \divides a$ by definition of greatest common divisor. So $d \ne p$ and therefore $d = 1$. {{qed}}
Let $p$ be a prime number. Let $a \in \Z$ be such that $p$ is not a divisor of $a$. {{AimForCont}} $p$ and $a$ are not coprime. Then: :$\exists c \in \Z_{>1}: c \divides p, c \divides a$ where $\divides$ denotes divisibility. But then by definition of prime: :$c = p$ Thus: :$p \divides a$ The result follows by Proof by Contradiction. {{qed}}