Main derivation
S01 · definition
Before
a\equiv b\pmod n
After
a\bmod n=b\bmod n\quad(n>0)
Conditions: n>0
Rule: mko_cong_def · Uses: G1, G2, mko_cong_def
Leaf basis: mko_cong_def + def_unfold
By the MKO's definition, congruence compares two remainders for one fixed positive modulus. It is not numerical equality: two different numbers can be congruent.
S02 · implies
Before
100
After
100=7\cdot 14+2,\ 0\le 2<7,\ 100\bmod 7=2
Conditions: 7>0
Rule: division_algorithm · Uses: G2, G3, division_algorithm
Leaf basis: division_algorithm + numeric_evaluation
7·14=98 and 100−98=2 with 0≤2<7 (N1, N2). By uniqueness in the division algorithm, 100 mod 7=2.
S03 · implies
Before
23
After
23=7\cdot 3+2,\ 23\bmod 7=2
Conditions: 7>0
Rule: division_algorithm · Uses: G2, G3, division_algorithm
Leaf basis: division_algorithm + numeric_evaluation
7·3=21 and 23−21=2 with 0≤2<7 (N3, N4), so 23 mod 7=2.
S04 · equivalent
Before
100\bmod 7=2=23\bmod 7
After
100\equiv 23\pmod 7
Conditions: none
Rule: mko_cong_def · Uses: S01, S02, S03
Leaf basis: mko_cong_def + eq_refl_symm_trans
Both remainders are 2, so by the definition 100≡23 (mod 7), although 100≠23.
S05 · equivalent
Before
(x+nm)\bmod n
After
x\bmod n
Conditions: n>0
Rule: L_shift · Uses: G2, L_shift
Leaf basis: division_algorithm + distributive
Adding a natural multiple of n does not change the remainder, by Lemma L_shift (proved in S05.1 and S05.2). The later equivalence and preservation results all rely on it.
S06 · equivalent
Before
a\bmod n=b\bmod n
After
\exists k,l\in\mathbb{N}:\ a+nk=b+nlConditions: n>0
Rule: L_witness · Uses: S01, L_witness
Leaf basis: division_algorithm + distributive + eq_refl_symm_trans
By Lemma L_witness (proved in S06.1 and S06.2), the remainder definition and the MKO's witness form are equivalent. The witness form stays entirely within the naturals and needs no subtraction.
S07 · implies
Before
100=7\cdot 14+2,\ 23=7\cdot 3+2
After
100+7\cdot 3=23+7\cdot 14=121;\quad 100+7\cdot 0=23+7\cdot 11
Conditions: none
Rule: exists_intro · Uses: S02, S03, S06
Leaf basis: exists_intro + numeric_evaluation
By the construction of S06.1, k=3 and l=14: 100+21=121=23+98 (N5). Another pair is k=0, l=11: 100=23+77 (N6). The witnesses are not unique.
S08 · implies
Before
\equiv\pmod n\ \text{for one fixed}\ nAfter
\text{reflexive, symmetric, transitive}Conditions: n\ \text{fixed}
Rule: eq_refl_symm_trans · Uses: S01, eq_refl_symm_trans
Leaf basis: eq_refl_symm_trans + def_unfold
For fixed n, a≡b is the equation a mod n=b mod n between remainders. Reflexivity, symmetry and transitivity of equality give a≡a; a≡b ⇒ b≡a; a≡b and b≡c ⇒ a≡c. So congruence is an equivalence relation on ℕ (MKO paragraph 0).
S09 · implies
Before
15=7\cdot 2+1,\ 1=7\cdot 0+1
After
15\equiv 1\pmod 7
Conditions: none
Rule: mko_cong_def · Uses: G3, division_algorithm
Leaf basis: division_algorithm + numeric_evaluation
15 mod 7=1 (N7) and 1 mod 7=1, so 15≡1 (mod 7).
S10 · implies
Before
a\equiv b,\ c\equiv d\pmod n
After
a+c\equiv b+d,\ ac\equiv bd\pmod n
Conditions: n>0
Rule: L_add_mul · Uses: S05, L_add_mul
Leaf basis: distributive + division_algorithm + eq_refl_symm_trans
By Lemma L_add_mul (proved in S10.1 and S10.2), addition and multiplication preserve congruence for one modulus.
S11 · implies
Before
100\equiv 23,\ 15\equiv 1\pmod 7
After
115\equiv 24,\quad 1500\equiv 23\pmod 7
Conditions: none
Rule: forall_elim · Uses: S04, S09, S10
Leaf basis: forall_elim + numeric_evaluation
Apply S10: 100+15=115≡23+1=24 and 100·15=1500≡23·1=23 (mod 7). Recompute each remainder as a check (MKO paragraph 1): 115=7·16+3 and 24=7·3+3, both remainder 3; 1500=7·214+2 and 23 mod 7=2, both remainder 2 (N8 to N11).
S12 · implies
Before
2\cdot 3\equiv 2\cdot 0\pmod 6
After
3\not\equiv 0\pmod 6
Conditions: none
Rule: numeric_evaluation · Uses: S01, G3
Leaf basis: numeric_evaluation + mko_cong_def
2·3=6 and 6 mod 6=0; 2·0=0 and 0 mod 6=0, so 2·3≡2·0 (mod 6). But 3 mod 6=3≠0=0 mod 6, so 3≢0 (mod 6) (N12, N13). Hence cancelling c from c·a≡c·b is not valid in general; here gcd(2,6)=2≠1 (N14), which is exactly the gcd of c and n that MKO paragraph 2 says must be considered.
S13 · implies
Before
100\equiv 23\pmod 7,\ 23\equiv 5\pmod 3
After
100\not\equiv 5\pmod 7,\ 100\not\equiv 5\pmod 3
Conditions: none
Rule: numeric_evaluation · Uses: S04, S08, G3
Leaf basis: numeric_evaluation + mko_cong_def
23=3·7+2 and 5=3·1+2, so 23≡5 (mod 3) (N15). Wrongly chaining congruences with two different moduli would give 100≡5. But 100 mod 7=2≠5=5 mod 7 (N17) and 100 mod 3=1≠2=5 mod 3 (N16), so it fails for both moduli. The transitivity of S08 holds only for one fixed n.
Substeps and lemmas
S05.1 · implies
Before
x=nq+r,\ 0\le r<n
After
x+nm=n(q+m)+r
Conditions: none
Rule: distributive · Uses: G2, distributive
Leaf basis: distributive + add_comm + add_assoc
Write x=nq+r (G2). Then x+nm=nq+nm+r=n(q+m)+r, with q+m natural.
S05.2 · implies
Before
x+nm=n(q+m)+r,\ 0\le r<n
After
(x+nm)\bmod n=r=x\bmod n
Conditions: n>0
Rule: division_algorithm · Uses: S05.1, division_algorithm
Leaf basis: division_algorithm
x+nm is written as n·(a natural)+r with 0≤r<n, so by uniqueness in the division algorithm its remainder is r, which is x mod n. S05.1 and S05.2 together prove Lemma L_shift.
S06.1 · implies
Before
a=nq+r,\ b=nq'+r
After
a+nq'=b+nq
Conditions: none
Rule: distributive · Uses: G2, distributive
Leaf basis: distributive + add_comm + add_assoc + exists_intro
(The ⇒ direction) Let the common remainder be r: a=nq+r and b=nq′+r. Then a+nq′=nq+nq′+r=b+nq (N20 checks the identity). Take k=q′ and l=q, both natural.
S06.2 · implies
Before
a+nk=b+nl
After
a\bmod n=(a+nk)\bmod n=(b+nl)\bmod n=b\bmod n
Conditions: n>0
Rule: L_shift · Uses: S05
Leaf basis: eq_congruence + eq_refl_symm_trans + division_algorithm
(The ⇐ direction) By L_shift, a mod n=(a+nk) mod n; equal numbers have equal remainders; and by L_shift again (b+nl) mod n=b mod n. S06.1 and S06.2 together prove Lemma L_witness.
S10.1 · implies
Before
a=nq_1+r,\ b=nq_2+r,\ c=nq_3+s,\ d=nq_4+s
After
(a+c)\bmod n=(r+s)\bmod n=(b+d)\bmod n
Conditions: none
Rule: L_shift · Uses: S05, G2, distributive
Leaf basis: distributive + add_comm + add_assoc + division_algorithm
Let r be the common remainder of a and b, and s that of c and d. Then a+c=n(q₁+q₃)+(r+s) and b+d=n(q₂+q₄)+(r+s) (N19). By L_shift both have remainder (r+s) mod n, so a+c≡b+d. Note that r+s may be ≥n, so one more remainder is taken rather than claiming the remainder is r+s.
S10.2 · implies
Before
ac=(nq_1+r)(nq_3+s)
After
ac=n(nq_1q_3+q_1s+rq_3)+rs,\ (ac)\bmod n=(rs)\bmod n=(bd)\bmod n
Conditions: none
Rule: L_shift · Uses: S05, G2, distributive
Leaf basis: distributive + mul_assoc + mul_comm + division_algorithm
Expand: (nq₁+r)(nq₃+s)=n(nq₁q₃+q₁s+rq₃)+rs (N18). Likewise bd=n(nq₂q₄+q₂s+rq₄)+rs. By L_shift both have remainder (rs) mod n, so ac≡bd. S10.1 and S10.2 together prove Lemma L_add_mul.