{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-modular-congruence-01",
  "mko_id": "mko-modular-congruence",
  "title": {
    "zh-Hant": "自然數模同餘：餘數定義、見證形式、運算保持與取消的限制",
    "en": "Congruence modulo a positive modulus: the remainder definition, the witness form, preservation by operations and the limits of cancellation"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-modular-congruence-01",
    "source": {
      "mko_id": "mko-modular-congruence",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "f2701dae3fc0037b15acf2146bea327e803c9f727d640db0a85d02de29f3f635",
      "english_sha256": "b1c4c24d7715216387b6c6d80d0393707e999f09f844c40b624b56ec79f8ec35"
    },
    "mode": "definition_walkthrough",
    "audience_prerequisites": [
      "division_algorithm",
      "distributive",
      "eq_refl_symm_trans",
      "numeric_evaluation"
    ],
    "goal": {
      "zh-Hant": "依 MKO 定義（n>0，a≡b (mod n) ⇔ a mod n=b mod n）：(1) 判定 100≡23 (mod 7)；(2) 證明它等價於見證形式「存在自然數 k、l 使 a+nk=b+nl」，並給出 100 與 23 的見證；(3) 說明同餘是等價關係；(4) 證明加法與乘法保持同餘，並由 15≡1 (mod 7) 得 115≡24、1500≡23 (mod 7)；(5) 以 2·3≡2·0 (mod 6) 說明不能無條件取消公因子；(6) 說明不同模數不能串接，並說明模數 0 被排除。",
      "en": "From the MKO's definition (n>0, a≡b (mod n) ⇔ a mod n=b mod n): (1) decide 100≡23 (mod 7); (2) prove that this is equivalent to the witness form 'there are naturals k, l with a+nk=b+nl', and give witnesses for 100 and 23; (3) explain why congruence is an equivalence relation; (4) prove that addition and multiplication preserve congruence, and from 15≡1 (mod 7) obtain 115≡24 and 1500≡23 (mod 7); (5) use 2·3≡2·0 (mod 6) to show that a common factor cannot be cancelled unconditionally; (6) explain why different moduli cannot be chained, and why the modulus 0 is excluded."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "a、b 是自然數，模數 n 是正自然數（MKO 假設 a1）；本條目排除 n=0（MKO 假設 a2）。",
          "en": "a and b are natural numbers and the modulus n is a positive natural (MKO assumption a1); this entry excludes n=0 (MKO assumption a2)."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "a mod n 是帶餘除法的餘數：唯一的 r 使 a=nq+r 且 0≤r<n；a 為自然數時商 q 也是自然數。",
          "en": "a mod n is the remainder of the division algorithm: the unique r with a=nq+r and 0≤r<n; for natural a the quotient q is natural too."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "例子：模 7 的 100、23、15、1；模 6 的 2·3 與 2·0；模 7 與模 3 的 100、23、5。",
          "en": "Examples: 100, 23, 15, 1 modulo 7; 2·3 and 2·0 modulo 6; 100, 23, 5 with moduli 7 and 3."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "G2",
          "mko_cong_def"
        ],
        "before_tex": "a\\equiv b\\pmod n",
        "after_tex": "a\\bmod n=b\\bmod n\\quad(n>0)",
        "relation": "definition",
        "rule": "mko_cong_def",
        "conditions": [
          "n>0"
        ],
        "explanation": {
          "zh-Hant": "依 MKO 的定義，同餘是在固定的同一個正模數下比較兩個餘數。它不是數值相等：兩數可以不同而同餘。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "mko_cong_def"
          ],
          "explanation": {
            "zh-Hant": "此步只展開定義；n>0 是餘數有定義所必需。",
            "en": "This step only unfolds the definition; n>0 is needed for the remainder to be defined."
          }
        },
        "leaf_basis": "mko_cong_def + def_unfold"
      },
      {
        "id": "S02",
        "uses": [
          "G2",
          "G3",
          "division_algorithm"
        ],
        "before_tex": "100",
        "after_tex": "100=7\\cdot 14+2,\\ 0\\le 2<7,\\ 100\\bmod 7=2",
        "relation": "implies",
        "rule": "division_algorithm",
        "conditions": [
          "7>0"
        ],
        "explanation": {
          "zh-Hant": "7·14=98，100−98=2，且 0≤2<7（N1、N2）。依帶餘除法的唯一性，100 mod 7=2。",
          "en": "7·14=98 and 100−98=2 with 0≤2<7 (N1, N2). By uniqueness in the division algorithm, 100 mod 7=2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "division_algorithm",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "餘數必須落在 0 到 6；這保證它是唯一的。",
            "en": "The remainder must lie in 0 to 6; this makes it unique."
          }
        },
        "leaf_basis": "division_algorithm + numeric_evaluation"
      },
      {
        "id": "S03",
        "uses": [
          "G2",
          "G3",
          "division_algorithm"
        ],
        "before_tex": "23",
        "after_tex": "23=7\\cdot 3+2,\\ 23\\bmod 7=2",
        "relation": "implies",
        "rule": "division_algorithm",
        "conditions": [
          "7>0"
        ],
        "explanation": {
          "zh-Hant": "7·3=21，23−21=2，0≤2<7（N3、N4），所以 23 mod 7=2。",
          "en": "7·3=21 and 23−21=2 with 0≤2<7 (N3, N4), so 23 mod 7=2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "division_algorithm",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "同 S02。",
            "en": "As in S02."
          }
        },
        "leaf_basis": "division_algorithm + numeric_evaluation"
      },
      {
        "id": "S04",
        "uses": [
          "S01",
          "S02",
          "S03"
        ],
        "before_tex": "100\\bmod 7=2=23\\bmod 7",
        "after_tex": "100\\equiv 23\\pmod 7",
        "relation": "equivalent",
        "rule": "mko_cong_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "兩個餘數都是 2，依定義 100≡23 (mod 7)，雖然 100≠23。",
          "en": "Both remainders are 2, so by the definition 100≡23 (mod 7), although 100≠23."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "mko_cong_def"
          ],
          "explanation": {
            "zh-Hant": "定義本身是雙向的：同餘恰好當餘數相等。",
            "en": "The definition is two-way: congruence holds exactly when the remainders are equal."
          }
        },
        "leaf_basis": "mko_cong_def + eq_refl_symm_trans"
      },
      {
        "id": "S05",
        "uses": [
          "G2",
          "L_shift"
        ],
        "before_tex": "(x+nm)\\bmod n",
        "after_tex": "x\\bmod n",
        "relation": "equivalent",
        "rule": "L_shift",
        "conditions": [
          "n>0"
        ],
        "explanation": {
          "zh-Hant": "加上 n 的自然數倍不改變餘數：依引理 L_shift（S05.1、S05.2 證明）。後面的等價與運算保持都靠它。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "L_shift"
          ],
          "explanation": {
            "zh-Hant": "兩邊是同一個數，等式雙向成立。",
            "en": "Both sides are the same number, so the equality holds both ways."
          }
        },
        "leaf_basis": "division_algorithm + distributive"
      },
      {
        "id": "S05.1",
        "uses": [
          "G2",
          "distributive"
        ],
        "before_tex": "x=nq+r,\\ 0\\le r<n",
        "after_tex": "x+nm=n(q+m)+r",
        "relation": "implies",
        "rule": "distributive",
        "conditions": [],
        "explanation": {
          "zh-Hant": "寫 x=nq+r（G2）。則 x+nm=nq+nm+r=n(q+m)+r，q+m 是自然數。",
          "en": "Write x=nq+r (G2). Then x+nm=nq+nm+r=n(q+m)+r, with q+m natural."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "distributive",
            "add_comm",
            "add_assoc"
          ],
          "explanation": {
            "zh-Hant": "只用分配律與加法律（N21 為格點恆等式核對）；沒有使用引理本身。",
            "en": "Only distributivity and the laws of addition are used (N21 is a grid identity check); the lemma itself is not used."
          }
        },
        "leaf_basis": "distributive + add_comm + add_assoc"
      },
      {
        "id": "S05.2",
        "uses": [
          "S05.1",
          "division_algorithm"
        ],
        "before_tex": "x+nm=n(q+m)+r,\\ 0\\le r<n",
        "after_tex": "(x+nm)\\bmod n=r=x\\bmod n",
        "relation": "implies",
        "rule": "division_algorithm",
        "conditions": [
          "n>0"
        ],
        "explanation": {
          "zh-Hant": "x+nm 已寫成 n·(自然數)+r 且 0≤r<n，依帶餘除法的唯一性，它的餘數就是 r，也就是 x mod n。S05.1 與 S05.2 合起來證得引理 L_shift。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "division_algorithm"
          ],
          "explanation": {
            "zh-Hant": "關鍵是唯一性與 0≤r<n；沒有使用引理本身。",
            "en": "The key is uniqueness together with 0≤r<n; the lemma itself is not used."
          }
        },
        "leaf_basis": "division_algorithm"
      },
      {
        "id": "S06",
        "uses": [
          "S01",
          "L_witness"
        ],
        "before_tex": "a\\bmod n=b\\bmod n",
        "after_tex": "\\exists k,l\\in\\mathbb{N}:\\ a+nk=b+nl",
        "relation": "equivalent",
        "rule": "L_witness",
        "conditions": [
          "n>0"
        ],
        "explanation": {
          "zh-Hant": "依引理 L_witness（S06.1、S06.2 證明），餘數定義與 MKO 的見證形式等價。見證形式的好處是全在自然數中，不必做減法。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "L_witness"
          ],
          "explanation": {
            "zh-Hant": "兩個方向分別在 S06.1、S06.2 證明。",
            "en": "The two directions are proved in S06.1 and S06.2."
          }
        },
        "leaf_basis": "division_algorithm + distributive + eq_refl_symm_trans"
      },
      {
        "id": "S06.1",
        "uses": [
          "G2",
          "distributive"
        ],
        "before_tex": "a=nq+r,\\ b=nq'+r",
        "after_tex": "a+nq'=b+nq",
        "relation": "implies",
        "rule": "distributive",
        "conditions": [],
        "explanation": {
          "zh-Hant": "（⇒ 方向）設共同餘數為 r：a=nq+r、b=nq′+r。則 a+nq′=nq+nq′+r=b+nq（N20 為恆等式核對）。取 k=q′、l=q，都是自然數。",
          "en": "(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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "distributive",
            "add_comm",
            "exists_intro"
          ],
          "explanation": {
            "zh-Hant": "只用加法交換、結合與見證引入；沒有使用引理本身。",
            "en": "Only commutativity and associativity of addition and ∃-introduction are used; the lemma itself is not used."
          }
        },
        "leaf_basis": "distributive + add_comm + add_assoc + exists_intro"
      },
      {
        "id": "S06.2",
        "uses": [
          "S05"
        ],
        "before_tex": "a+nk=b+nl",
        "after_tex": "a\\bmod n=(a+nk)\\bmod n=(b+nl)\\bmod n=b\\bmod n",
        "relation": "implies",
        "rule": "L_shift",
        "conditions": [
          "n>0"
        ],
        "explanation": {
          "zh-Hant": "（⇐ 方向）依 L_shift，a mod n=(a+nk) mod n；兩個相等的數有相同餘數；再依 L_shift，(b+nl) mod n=b mod n。S06.1 與 S06.2 合起來證得引理 L_witness。",
          "en": "(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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05",
            "eq_congruence"
          ],
          "explanation": {
            "zh-Hant": "用到的是已證的 L_shift，不是 L_witness 本身。",
            "en": "It uses the already proved L_shift, not L_witness itself."
          }
        },
        "leaf_basis": "eq_congruence + eq_refl_symm_trans + division_algorithm"
      },
      {
        "id": "S07",
        "uses": [
          "S02",
          "S03",
          "S06"
        ],
        "before_tex": "100=7\\cdot 14+2,\\ 23=7\\cdot 3+2",
        "after_tex": "100+7\\cdot 3=23+7\\cdot 14=121;\\quad 100+7\\cdot 0=23+7\\cdot 11",
        "relation": "implies",
        "rule": "exists_intro",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依 S06.1 的構造，k=3、l=14：100+21=121=23+98（N5）。另一組見證 k=0、l=11：100=23+77（N6）。見證不唯一。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S06",
            "exists_intro",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "存在性只需一組見證；這裡給兩組以示不唯一。",
            "en": "Existence needs only one pair; two are given to show non-uniqueness."
          }
        },
        "leaf_basis": "exists_intro + numeric_evaluation"
      },
      {
        "id": "S08",
        "uses": [
          "S01",
          "eq_refl_symm_trans"
        ],
        "before_tex": "\\equiv\\pmod n\\ \\text{for one fixed}\\ n",
        "after_tex": "\\text{reflexive, symmetric, transitive}",
        "relation": "implies",
        "rule": "eq_refl_symm_trans",
        "conditions": [
          "n\\ \\text{fixed}"
        ],
        "explanation": {
          "zh-Hant": "在固定的 n 下，a≡b 就是 a mod n=b mod n，是餘數之間的等式。等號的自反、對稱、遞移直接給出 a≡a；a≡b ⇒ b≡a；a≡b 且 b≡c ⇒ a≡c。所以同餘在 ℕ 上是等價關係（MKO 段落 0）。",
          "en": "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)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "eq_refl_symm_trans"
          ],
          "explanation": {
            "zh-Hant": "遞移性要求兩個同餘式用同一個 n；不同模數的餘數不是同一種量（S13）。",
            "en": "Transitivity requires the same n in both congruences; remainders for different moduli are not the same quantity (S13)."
          }
        },
        "leaf_basis": "eq_refl_symm_trans + def_unfold"
      },
      {
        "id": "S09",
        "uses": [
          "G3",
          "division_algorithm"
        ],
        "before_tex": "15=7\\cdot 2+1,\\ 1=7\\cdot 0+1",
        "after_tex": "15\\equiv 1\\pmod 7",
        "relation": "implies",
        "rule": "mko_cong_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "15 mod 7=1（N7），1 mod 7=1，所以 15≡1 (mod 7)。",
          "en": "15 mod 7=1 (N7) and 1 mod 7=1, so 15≡1 (mod 7)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "division_algorithm",
            "mko_cong_def"
          ],
          "explanation": {
            "zh-Hant": "兩個餘數直接計算。",
            "en": "Both remainders are computed directly."
          }
        },
        "leaf_basis": "division_algorithm + numeric_evaluation"
      },
      {
        "id": "S10",
        "uses": [
          "S05",
          "L_add_mul"
        ],
        "before_tex": "a\\equiv b,\\ c\\equiv d\\pmod n",
        "after_tex": "a+c\\equiv b+d,\\ ac\\equiv bd\\pmod n",
        "relation": "implies",
        "rule": "L_add_mul",
        "conditions": [
          "n>0"
        ],
        "explanation": {
          "zh-Hant": "依引理 L_add_mul（S10.1、S10.2 證明），加法與乘法保持同一模數下的同餘。",
          "en": "By Lemma L_add_mul (proved in S10.1 and S10.2), addition and multiplication preserve congruence for one modulus."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "L_add_mul"
          ],
          "explanation": {
            "zh-Hant": "不宣稱反向：由 ac≡bd 不能推出 a≡b 或 c≡d（S12）。",
            "en": "No converse is claimed: ac≡bd does not give a≡b or c≡d (S12)."
          }
        },
        "leaf_basis": "distributive + division_algorithm + eq_refl_symm_trans"
      },
      {
        "id": "S10.1",
        "uses": [
          "S05",
          "G2",
          "distributive"
        ],
        "before_tex": "a=nq_1+r,\\ b=nq_2+r,\\ c=nq_3+s,\\ d=nq_4+s",
        "after_tex": "(a+c)\\bmod n=(r+s)\\bmod n=(b+d)\\bmod n",
        "relation": "implies",
        "rule": "L_shift",
        "conditions": [],
        "explanation": {
          "zh-Hant": "設 a、b 的共同餘數為 r，c、d 的共同餘數為 s。則 a+c=n(q₁+q₃)+(r+s)、b+d=n(q₂+q₄)+(r+s)（N19）。依 L_shift，兩者的餘數都等於 (r+s) mod n，所以 a+c≡b+d。注意 r+s 可能 ≥n，所以要再取一次餘數，而不是直接說餘數是 r+s。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05",
            "distributive"
          ],
          "explanation": {
            "zh-Hant": "只用 L_shift 與分配律；沒有使用 L_add_mul 本身。",
            "en": "Only L_shift and distributivity are used; L_add_mul itself is not used."
          }
        },
        "leaf_basis": "distributive + add_comm + add_assoc + division_algorithm"
      },
      {
        "id": "S10.2",
        "uses": [
          "S05",
          "G2",
          "distributive"
        ],
        "before_tex": "ac=(nq_1+r)(nq_3+s)",
        "after_tex": "ac=n(nq_1q_3+q_1s+rq_3)+rs,\\ (ac)\\bmod n=(rs)\\bmod n=(bd)\\bmod n",
        "relation": "implies",
        "rule": "L_shift",
        "conditions": [],
        "explanation": {
          "zh-Hant": "展開：(nq₁+r)(nq₃+s)=n(nq₁q₃+q₁s+rq₃)+rs（N18）。同理 bd=n(nq₂q₄+q₂s+rq₄)+rs。依 L_shift，兩者的餘數都等於 (rs) mod n，所以 ac≡bd。S10.1 與 S10.2 合起來證得引理 L_add_mul。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05",
            "distributive"
          ],
          "explanation": {
            "zh-Hant": "只用分配律與 L_shift；沒有使用 L_add_mul 本身。",
            "en": "Only distributivity and L_shift are used; L_add_mul itself is not used."
          }
        },
        "leaf_basis": "distributive + mul_assoc + mul_comm + division_algorithm"
      },
      {
        "id": "S11",
        "uses": [
          "S04",
          "S09",
          "S10"
        ],
        "before_tex": "100\\equiv 23,\\ 15\\equiv 1\\pmod 7",
        "after_tex": "115\\equiv 24,\\quad 1500\\equiv 23\\pmod 7",
        "relation": "implies",
        "rule": "forall_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "套用 S10：100+15=115≡23+1=24，100·15=1500≡23·1=23 (mod 7)。逐項重算核對（MKO 段落 1）：115=7·16+3、24=7·3+3，餘數都是 3；1500=7·214+2、23 mod 7=2，餘數都是 2（N8 到 N11）。",
          "en": "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)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S10",
            "forall_elim",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "這是一般結果的實例；直接重算只是核對，不取代 S10 的證明。",
            "en": "An instance of the general result; the direct recomputation is a check and does not replace the proof of S10."
          }
        },
        "leaf_basis": "forall_elim + numeric_evaluation"
      },
      {
        "id": "S12",
        "uses": [
          "S01",
          "G3"
        ],
        "before_tex": "2\\cdot 3\\equiv 2\\cdot 0\\pmod 6",
        "after_tex": "3\\not\\equiv 0\\pmod 6",
        "relation": "implies",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "2·3=6，6 mod 6=0；2·0=0，0 mod 6=0，所以 2·3≡2·0 (mod 6)。但 3 mod 6=3≠0=0 mod 6，所以 3≢0 (mod 6)（N12、N13）。因此從 c·a≡c·b 直接取消 c 不合法；這裡 gcd(2,6)=2≠1（N14），正是 MKO 段落 2 所說要考慮 c 與 n 的最大公因數。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "一個反例足以否定「無條件取消」；本稿不證明 gcd(c,n)=1 時取消合法。",
            "en": "One counterexample refutes 'unconditional cancellation'; this guide does not prove that cancellation is valid when gcd(c,n)=1."
          }
        },
        "leaf_basis": "numeric_evaluation + mko_cong_def"
      },
      {
        "id": "S13",
        "uses": [
          "S04",
          "S08",
          "G3"
        ],
        "before_tex": "100\\equiv 23\\pmod 7,\\ 23\\equiv 5\\pmod 3",
        "after_tex": "100\\not\\equiv 5\\pmod 7,\\ 100\\not\\equiv 5\\pmod 3",
        "relation": "implies",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "23=3·7+2、5=3·1+2，所以 23≡5 (mod 3)（N15）。若誤把兩個不同模數的同餘串接，會得到 100≡5。但 100 mod 7=2≠5=5 mod 7（N17），100 mod 3=1≠2=5 mod 3（N16），兩個模數下都不成立。S08 的遞移性只對同一個 n 成立。",
          "en": "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."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S08",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "具體反例；說明遞移性的前提「同一模數」不能省。",
            "en": "A concrete counterexample showing that the premise 'same modulus' in transitivity cannot be dropped."
          }
        },
        "leaf_basis": "numeric_evaluation + mko_cong_def"
      }
    ],
    "result": {
      "zh-Hant": "100≡23 (mod 7)，因為兩者除以 7 都餘 2；餘數定義與見證形式等價，100 與 23 的見證可取 (k,l)=(3,14) 或 (0,11)。同餘在固定模數下是等價關係，並被加法與乘法保持：115≡24、1500≡23 (mod 7)。2·3≡2·0 (mod 6) 但 3≢0 (mod 6)，所以不能無條件取消公因子；不同模數的同餘不能串接；模數 0 被排除。",
      "en": "100≡23 (mod 7) because both leave remainder 2 on division by 7; the remainder definition and the witness form are equivalent, and witnesses for 100 and 23 are (k,l)=(3,14) or (0,11). For a fixed modulus congruence is an equivalence relation preserved by addition and multiplication: 115≡24 and 1500≡23 (mod 7). 2·3≡2·0 (mod 6) but 3≢0 (mod 6), so a common factor cannot be cancelled unconditionally; congruences with different moduli cannot be chained; the modulus 0 is excluded."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "由 2·3≡2·0 (mod 6) 兩邊消去 2，得 3≡0 (mod 6)",
          "en": "From 2·3≡2·0 (mod 6), cancelling 2 gives 3≡0 (mod 6)"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "3 mod 6=3≠0；gcd(2,6)=2≠1。",
          "en": "3 mod 6=3≠0; gcd(2,6)=2≠1."
        }
      },
      {
        "claim": {
          "zh-Hant": "100≡23 (mod 7) 且 23≡5 (mod 3)，所以 100≡5 (mod 7)",
          "en": "100≡23 (mod 7) and 23≡5 (mod 3), so 100≡5 (mod 7)"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "100 mod 7=2，5 mod 7=5；遞移性只對同一模數成立。",
          "en": "100 mod 7=2 and 5 mod 7=5; transitivity holds only for the same modulus."
        }
      },
      {
        "claim": {
          "zh-Hant": "依某些程式語言的慣例 7 mod 0=7，所以可在本條目中判定 7≡7 (mod 0)",
          "en": "Since some programming conventions give 7 mod 0=7, this entry can decide 7≡7 (mod 0)"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "本條目要求 n 為正自然數，n=0 被刻意排除。",
          "en": "This entry requires n to be a positive natural; n=0 is deliberately excluded."
        }
      },
      {
        "claim": {
          "zh-Hant": "100≡23 (mod 7)，所以 100=23",
          "en": "100≡23 (mod 7), so 100=23"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "同餘只表示餘數相等；100≠23。",
          "en": "Congruence only means equal remainders; 100≠23."
        }
      },
      {
        "claim": {
          "zh-Hant": "100≡23 (mod 7) 的見證 (k,l) 唯一",
          "en": "The witness (k,l) for 100≡23 (mod 7) is unique"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "(3,14) 與 (0,11) 都可以。",
          "en": "Both (3,14) and (0,11) work."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "division_algorithm",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "帶餘除法：對整數 a 與正整數 b，存在唯一的整數 q、r 使 a=bq+r 且 0≤r<b。",
          "en": "Division algorithm: for an integer a and a positive integer b there are unique integers q, r with a=bq+r and 0≤r<b."
        }
      },
      {
        "id": "distributive",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "分配律：u(v+w)=uv+uw；配合乘法交換律也有 (v+w)u=vu+wu。",
          "en": "Distributivity: u(v+w)=uv+uw; with commutativity also (v+w)u=vu+wu."
        }
      },
      {
        "id": "eq_refl_symm_trans",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "等號的性質：u=u；若 u=v 則 v=u；若 u=v 且 v=w 則 u=w。",
          "en": "Properties of equality: u=u; if u=v then v=u; if u=v and v=w then u=w."
        }
      },
      {
        "id": "numeric_evaluation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "明確整數或有理數算式的精確求值；可以獨立重算。",
          "en": "Exact evaluation of an explicit integer or rational expression; independently recomputable."
        }
      },
      {
        "id": "def_unfold",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "展開定義：把一個已定義的詞換成它的定義內容（或反向收回），命題的真假不變。",
          "en": "Unfolding a definition: replacing a defined term by its definition (or folding it back) does not change whether a statement is true."
        }
      },
      {
        "id": "add_comm",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "加法交換律：u+v=v+u。",
          "en": "Commutativity of addition: u+v=v+u."
        }
      },
      {
        "id": "add_assoc",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "加法結合律：(u+v)+w=u+(v+w)。",
          "en": "Associativity of addition: (u+v)+w=u+(v+w)."
        }
      },
      {
        "id": "exists_intro",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "∃引入：若找到 a∈D 使 P(a) 成立，則 ∃x∈D, P(x)。",
          "en": "∃-introduction: if some a∈D satisfies P(a), then ∃x∈D, P(x)."
        }
      },
      {
        "id": "eq_congruence",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "等式同用：若 u=v，對兩邊做同一個有定義的運算 f，得 f(u)=f(v)。只對一邊做運算不屬於此規則。",
          "en": "Congruence of equality: if u=v, applying the same defined operation f to both sides gives f(u)=f(v). Operating on one side only is not an instance of this rule."
        }
      },
      {
        "id": "mul_assoc",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘法結合律：(uv)w=u(vw)。",
          "en": "Associativity of multiplication: (uv)w=u(vw)."
        }
      },
      {
        "id": "mul_comm",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘法交換律：uv=vu（在交換的數系中，例如 ℤ、ℚ、ℝ、ℂ）。",
          "en": "Commutativity of multiplication: uv=vu (in commutative number systems such as ℤ, ℚ, ℝ, ℂ)."
        }
      },
      {
        "id": "forall_elim",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "∀消去（代入特例）：若 ∀x∈D, P(x) 成立且 a∈D，則 P(a) 成立。",
          "en": "∀-elimination (instantiation): if ∀x∈D, P(x) holds and a∈D, then P(a) holds."
        }
      },
      {
        "id": "mko_cong_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-modular-congruence",
          "sha256": "f2701dae3fc0037b15acf2146bea327e803c9f727d640db0a85d02de29f3f635",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "對自然數 a、b 與正自然數 n，a≡b (mod n) 當且僅當 a mod n=b mod n；等價地，存在自然數 k、l 使 a+n·k=b+n·l。",
          "en": "For natural numbers a, b and a positive natural n, a≡b (mod n) exactly when a mod n=b mod n. Equivalently, there are natural k, l with a+n·k=b+n·l."
        }
      },
      {
        "id": "L_shift",
        "kind": "lemma",
        "proved_in": [
          "S05.1",
          "S05.2"
        ],
        "statement": {
          "zh-Hant": "對 n>0 與自然數 x、m：(x+n·m) mod n=x mod n。",
          "en": "For n>0 and naturals x, m: (x+n·m) mod n=x mod n."
        }
      },
      {
        "id": "L_witness",
        "kind": "lemma",
        "proved_in": [
          "S06.1",
          "S06.2"
        ],
        "statement": {
          "zh-Hant": "對 n>0 與自然數 a、b：a mod n=b mod n ⇔ 存在自然數 k、l 使 a+nk=b+nl。",
          "en": "For n>0 and naturals a, b: a mod n=b mod n ⇔ there are naturals k, l with a+nk=b+nl."
        }
      },
      {
        "id": "L_add_mul",
        "kind": "lemma",
        "proved_in": [
          "S10.1",
          "S10.2"
        ],
        "statement": {
          "zh-Hant": "若 a≡b (mod n) 且 c≡d (mod n)，則 a+c≡b+d (mod n) 且 ac≡bd (mod n)。",
          "en": "If a≡b (mod n) and c≡d (mod n), then a+c≡b+d (mod n) and ac≡bd (mod n)."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S02",
        "lhs": "7*14+2",
        "rhs": "100"
      },
      {
        "id": "N2",
        "step": "S02",
        "lhs": "100 % 7",
        "rhs": "2"
      },
      {
        "id": "N3",
        "step": "S03",
        "lhs": "7*3+2",
        "rhs": "23"
      },
      {
        "id": "N4",
        "step": "S03",
        "lhs": "23 % 7",
        "rhs": "2"
      },
      {
        "id": "N5",
        "step": "S07",
        "lhs": "100+7*3",
        "rhs": "23+7*14"
      },
      {
        "id": "N6",
        "step": "S07",
        "lhs": "100+7*0",
        "rhs": "23+7*11"
      },
      {
        "id": "N7",
        "step": "S09",
        "lhs": "7*2+1",
        "rhs": "15"
      },
      {
        "id": "N8",
        "step": "S11",
        "lhs": "7*16+3",
        "rhs": "115"
      },
      {
        "id": "N9",
        "step": "S11",
        "lhs": "115 % 7",
        "rhs": "24 % 7"
      },
      {
        "id": "N10",
        "step": "S11",
        "lhs": "7*214+2",
        "rhs": "1500"
      },
      {
        "id": "N11",
        "step": "S11",
        "lhs": "1500 % 7",
        "rhs": "23 % 7"
      },
      {
        "id": "N12",
        "step": "S12",
        "lhs": "(2*3) % 6",
        "rhs": "(2*0) % 6"
      },
      {
        "id": "N13",
        "step": "S12",
        "lhs": "3 % 6",
        "relation": "!=",
        "rhs": "0 % 6"
      },
      {
        "id": "N14",
        "step": "S12",
        "lhs": "gcd(2,6)",
        "rhs": "2"
      },
      {
        "id": "N15",
        "step": "S13",
        "lhs": "23 % 3",
        "rhs": "5 % 3"
      },
      {
        "id": "N16",
        "step": "S13",
        "lhs": "100 % 3",
        "relation": "!=",
        "rhs": "5 % 3"
      },
      {
        "id": "N17",
        "step": "S13",
        "lhs": "100 % 7",
        "relation": "!=",
        "rhs": "5 % 7"
      },
      {
        "id": "N18",
        "step": "S10.2",
        "vars": [
          "n",
          "q1",
          "q3",
          "r",
          "s"
        ],
        "degree": 2,
        "lhs": "(n*q1+r)*(n*q3+s)",
        "rhs": "n*(n*q1*q3+q1*s+r*q3)+r*s"
      },
      {
        "id": "N19",
        "step": "S10.1",
        "vars": [
          "n",
          "q1",
          "q3",
          "r",
          "s"
        ],
        "degree": 1,
        "lhs": "(n*q1+r)+(n*q3+s)",
        "rhs": "n*(q1+q3)+(r+s)"
      },
      {
        "id": "N20",
        "step": "S06.1",
        "vars": [
          "n",
          "q",
          "qq",
          "r"
        ],
        "degree": 1,
        "lhs": "(n*q+r)+n*qq",
        "rhs": "(n*qq+r)+n*q"
      },
      {
        "id": "N21",
        "step": "S05.1",
        "vars": [
          "n",
          "q",
          "m",
          "r"
        ],
        "degree": 1,
        "lhs": "(n*q+r)+n*m",
        "rhs": "n*(q+m)+r"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "只處理自然數 a、b 與正模數 n（MKO 假設 a1、a2）；餘數由帶餘除法定義。證明兩種定義等價、同餘是等價關係、加法與乘法保持同餘。取消律在 gcd(c,n)=1 時成立這一正面結果不在本稿證明。不處理負整數或模數 0；不改動 canonical MKO 或英文 edition。",
      "en": "Treats natural a, b and a positive modulus n only (MKO assumptions a1 and a2); remainders are defined by the division algorithm. Proves that the two definitions agree, that congruence is an equivalence relation, and that addition and multiplication preserve it. The positive result that cancellation is valid when gcd(c,n)=1 is not proved here. Negative integers and the modulus 0 are not treated; the canonical MKO and its English edition are not changed."
    },
    "md_symbols": [
      [
        "a\\equiv b\\pmod n",
        "a 與 b 模 n 同餘",
        "a is congruent to b modulo n"
      ],
      [
        "a\\bmod n",
        "a 除以 n 的餘數，0≤a mod n<n",
        "the remainder of a on division by n, 0≤a mod n<n"
      ],
      [
        "k,\\ l",
        "見證形式中的自然數",
        "the naturals in the witness form"
      ],
      [
        "n",
        "正模數",
        "the positive modulus"
      ]
    ],
    "md_error_controls": [
      {
        "title": "不能混用模數 / Do not mix moduli",
        "zh": "MKO 指出的誤解之一：混用不同模數。100≡23 (mod 7) 與 23≡5 (mod 3) 不能串成 100≡5；事實上在兩個模數下都不成立（S13）。",
        "en": "One misconception the MKO names: mixing moduli. 100≡23 (mod 7) and 23≡5 (mod 3) cannot be chained into 100≡5; in fact it fails for both moduli (S13)."
      },
      {
        "title": "不得無條件取消公因子 / No unconditional cancellation",
        "zh": "MKO 指出的另一個誤解：在同餘式兩側無條件取消共同因子。2·3≡2·0 (mod 6) 但 3≢0 (mod 6)（S12）。取消需要考慮 c 與 n 的最大公因數；本稿不證明正面的條件。",
        "en": "Another misconception the MKO names: cancelling a common factor from both sides unconditionally. 2·3≡2·0 (mod 6) but 3≢0 (mod 6) (S12). Cancellation requires considering the gcd of c and n; this guide does not prove the positive condition."
      },
      {
        "title": "模數 0 被排除 / The modulus 0 is excluded",
        "zh": "MKO 指出的第三個誤解：允許零模數。帶餘除法需要正除數，a mod 0 在本條目中沒有定義；各程式語言對 x mod 0 的處理不一（有的報錯），本條目刻意不採用這些慣例（MKO 假設 a2）。",
        "en": "The third misconception the MKO names: allowing a zero modulus. The division algorithm needs a positive divisor, so a mod 0 is undefined in this entry; programming languages treat x mod 0 in different ways (some raise an error), and this entry deliberately adopts none of them (MKO assumption a2)."
      },
      {
        "title": "同餘不是數值相等 / Congruence is not numerical equality",
        "zh": "100≡23 (mod 7) 而 100≠23。同餘比較的是固定模數下的餘數（MKO 段落 0）。",
        "en": "100≡23 (mod 7) while 100≠23. Congruence compares remainders for a fixed modulus (MKO paragraph 0)."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "取消律的正面結果（gcd(c,n)=1 時 ca≡cb ⇒ a≡b）不在本稿證明。",
        "en": "The positive cancellation result (if gcd(c,n)=1 then ca≡cb ⇒ a≡b) is not proved here."
      },
      {
        "zh-Hant": "帶餘除法（含唯一性）作為前置規則引用；自然數 a 的商為自然數，其理由見自然數整除的教學稿。",
        "en": "The division algorithm (with uniqueness) is cited as a prerequisite; that the quotient of a natural a is natural is shown in the natural-divisibility guide."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "2e962d623d84262cb743a552037824dee16a1980f16f38b26d7bf9aeaa025587",
    "original_source_sha256": "2e962d623d84262cb743a552037824dee16a1980f16f38b26d7bf9aeaa025587",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "independent_AI_concurrence": "NOT_MEASURED",
    "issue_ids": [],
    "scope": "Owner-adopted natural-language teaching guide; not a formal proof, canonical MKO rewrite or evidence-status promotion."
  }
}
