{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-gcd-coprime-01",
  "mko_id": "mko-gcd-coprime",
  "title": {
    "zh-Hant": "最大公因數與互質：以整除刻畫驗證歐幾里得算法",
    "en": "Greatest common divisor and coprimality: checking Euclid's algorithm against the divisibility characterization"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-gcd-coprime-01",
    "source": {
      "mko_id": "mko-gcd-coprime",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "a8f5934d6354ea07a83057c61f045034e2d964850bed4759aedd8721848b3b9b",
      "english_sha256": "9a16e24c872347b1ca2aff7ffd64e3465452e78b46eabfda5a844f785741500e"
    },
    "mode": "algorithm_trace",
    "audience_prerequisites": [
      "division_algorithm",
      "order_basics",
      "distributive",
      "well_ordering",
      "numeric_evaluation"
    ],
    "goal": {
      "zh-Hant": "依 MKO 的整除刻畫（d∣a、d∣b，且每個公因數 c 都整除 d）：(1) 證明滿足刻畫的 d 至多一個；(2) 證明歐幾里得算法每一步保持公因數集合且必會停止，並以它算出 gcd(84,36)=12，再直接驗證 12 滿足刻畫；(3) 說明公因數 6 不是 gcd；(4) 算出 gcd(8,15)=1，說明 8 與 15 互質但都不是質數；(5) 處理含 0 的情形 gcd(0,1)=1、gcd(0,6)=6、gcd(0,0)=0。",
      "en": "From the MKO's divisibility characterization (d∣a, d∣b, and every common divisor c divides d): (1) prove that at most one d satisfies it; (2) prove that each step of Euclid's algorithm preserves the set of common divisors and that the algorithm stops, use it to compute gcd(84,36)=12, and verify directly that 12 satisfies the characterization; (3) explain why the common divisor 6 is not the gcd; (4) compute gcd(8,15)=1 and explain that 8 and 15 are coprime although neither is prime; (5) treat the zero cases gcd(0,1)=1, gcd(0,6)=6 and gcd(0,0)=0."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "a、b 是自然數，可以為 0（MKO 假設 a1）；整除依 MKO 自然數整除的定義，見證須為自然數。",
          "en": "a and b are natural numbers and may be 0 (MKO assumption a1); divisibility follows the natural-divisibility MKO, with natural witnesses."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "歐幾里得算法（MKO 段落 0）：當 y≠0 時，把 (x,y) 換成 (y, x mod y)；y=0 時輸出 x。(0,0) 依約定輸出 0。",
          "en": "Euclid's algorithm (MKO paragraph 0): while y≠0, replace (x,y) by (y, x mod y); when y=0, output x. For (0,0) the convention outputs 0."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "輸入：(84,36)、(8,15)、(0,1)、(0,6)、(0,0)。",
          "en": "Inputs: (84,36), (8,15), (0,1), (0,6), (0,0)."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "mko_gcd_def"
        ],
        "before_tex": "d=\\gcd(a,b)",
        "after_tex": "d\\mid a\\ \\land\\ d\\mid b\\ \\land\\ \\forall c\\in\\mathbb{N}\\,(c\\mid a\\land c\\mid b\\Rightarrow c\\mid d)",
        "relation": "definition",
        "rule": "mko_gcd_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依 MKO，gcd 由兩部分刻畫：d 是公因數；每個公因數都整除 d。「最大」是以整除關係表達，不是以數值大小。互質表示 gcd=1。",
          "en": "By the MKO, the gcd is characterized in two parts: d is a common divisor, and every common divisor divides d. 'Greatest' is expressed by divisibility, not by numerical size. Coprime means gcd=1."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "mko_gcd_def"
          ],
          "explanation": {
            "zh-Hant": "此步只展開定義；驗證候選 d 時兩部分都要檢查（MKO 段落 1）。",
            "en": "This step only unfolds the definition; checking a candidate d requires both parts (MKO paragraph 1)."
          }
        },
        "leaf_basis": "mko_gcd_def + def_unfold"
      },
      {
        "id": "S02",
        "uses": [
          "S01",
          "L_dvd_antisymm"
        ],
        "before_tex": "d,\\ d'\\ \\text{both satisfy S01 for}\\ (a,b)",
        "after_tex": "d=d'",
        "relation": "implies",
        "rule": "L_dvd_antisymm",
        "conditions": [],
        "explanation": {
          "zh-Hant": "d′ 是公因數，而 d 的刻畫說每個公因數都整除 d，所以 d′∣d；對稱地 d∣d′。依引理 L_dvd_antisymm（S02.1、S02.2 證明），d=d′。所以只要存在，gcd 就唯一，可以稱為「the」gcd。",
          "en": "d′ is a common divisor, and the characterization of d says every common divisor divides d, so d′∣d; symmetrically d∣d′. By Lemma L_dvd_antisymm (proved in S02.1 and S02.2), d=d′. So whenever it exists, the gcd is unique and may be called 'the' gcd."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "L_dvd_antisymm"
          ],
          "explanation": {
            "zh-Hant": "只用兩個候選各自的刻畫；存在性另由算法給出（S08）。",
            "en": "Only the characterizations of the two candidates are used; existence comes separately from the algorithm (S08)."
          }
        },
        "leaf_basis": "mko_dvd_def + exists_elim + order_basics"
      },
      {
        "id": "S02.1",
        "uses": [
          "mko_dvd_def",
          "mul_zero"
        ],
        "before_tex": "e=dk,\\ d=el,\\ d=0",
        "after_tex": "e=0=d",
        "relation": "case_split",
        "rule": "mul_zero",
        "conditions": [
          "d=0"
        ],
        "explanation": {
          "zh-Hant": "由 d∣e 與 e∣d 取見證：e=dk、d=el。情況 d=0：e=0·k=0=d。",
          "en": "From d∣e and e∣d take witnesses: e=dk and d=el. Case d=0: e=0·k=0=d."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "mko_dvd_def",
            "mul_zero"
          ],
          "explanation": {
            "zh-Hant": "只用乘以零；沒有使用引理本身。",
            "en": "Only multiplication by zero is used; the lemma itself is not used."
          }
        },
        "leaf_basis": "mul_zero + exists_elim"
      },
      {
        "id": "S02.2",
        "uses": [
          "mko_dvd_def",
          "order_basics"
        ],
        "before_tex": "d=el=d(kl),\\ d>0",
        "after_tex": "kl=1,\\ k=1,\\ e=d",
        "relation": "case_split",
        "rule": "order_basics",
        "conditions": [
          "d>0"
        ],
        "explanation": {
          "zh-Hant": "情況 d>0：代入得 d=(dk)l=d(kl)=d·1。若 kl≠1，則 kl<1 或 kl>1，因 d>0 分別得 d(kl)<d 或 d(kl)>d，都矛盾；所以 kl=1。自然數 k、l 的積為 1，則 k≠0；若 k≥2，則 kl≥2l，而 l≥1（因 kl≠0），得 kl≥2，矛盾；故 k=1，e=d·1=d。S02.1 與 S02.2 合起來證得引理 L_dvd_antisymm。",
          "en": "Case d>0: substituting gives d=(dk)l=d(kl)=d·1. If kl≠1, then kl<1 or kl>1, and d>0 gives d(kl)<d or d(kl)>d, both contradictions; so kl=1. For naturals k, l with product 1, k≠0; if k≥2 then kl≥2l with l≥1 (since kl≠0), so kl≥2, a contradiction; hence k=1 and e=d·1=d. S02.1 and S02.2 together prove Lemma L_dvd_antisymm."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "order_basics",
            "mul_assoc",
            "case_analysis"
          ],
          "explanation": {
            "zh-Hant": "兩種情況 d=0、d>0 涵蓋所有自然數 d；沒有使用引理本身。",
            "en": "The cases d=0 and d>0 cover every natural d; the lemma itself is not used."
          }
        },
        "leaf_basis": "order_basics + mul_assoc + case_analysis + contradiction"
      },
      {
        "id": "S03",
        "uses": [
          "S01",
          "dvd_basic"
        ],
        "before_tex": "(x,0)",
        "after_tex": "x\\ \\text{satisfies S01 for}\\ (x,0),\\ \\text{so}\\ \\gcd(x,0)=x",
        "relation": "implies",
        "rule": "dvd_basic",
        "conditions": [],
        "explanation": {
          "zh-Hant": "x∣x 且 x∣0（dvd_basic），所以 x 是公因數；若 c∣x 且 c∣0，當然 c∣x。所以 x 滿足刻畫，依 S02 它就是 gcd(x,0)。這包括 x=0：0 滿足 (0,0) 的刻畫，所以 MKO 的約定 gcd(0,0)=0 與刻畫一致。",
          "en": "x∣x and x∣0 (dvd_basic), so x is a common divisor; if c∣x and c∣0, then certainly c∣x. So x satisfies the characterization, and by S02 it is gcd(x,0). This includes x=0: 0 satisfies the characterization for (0,0), so the MKO's convention gcd(0,0)=0 agrees with the characterization."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "S02",
            "dvd_basic"
          ],
          "explanation": {
            "zh-Hant": "兩部分刻畫都已檢查；唯一性來自 S02。",
            "en": "Both parts of the characterization are checked; uniqueness comes from S02."
          }
        },
        "leaf_basis": "dvd_basic + and_intro_elim"
      },
      {
        "id": "S04",
        "uses": [
          "mko_dvd_def",
          "L_cd_step"
        ],
        "before_tex": "x=yq+r,\\ y>0",
        "after_tex": "c\\mid x\\land c\\mid y\\iff c\\mid y\\land c\\mid r",
        "relation": "equivalent",
        "rule": "L_cd_step",
        "conditions": [
          "y>0"
        ],
        "explanation": {
          "zh-Hant": "依引理 L_cd_step（S04.1、S04.2 證明），算法的一步不改變公因數集合：CD(x,y)=CD(y,r)。",
          "en": "By Lemma L_cd_step (proved in S04.1 and S04.2), one step of the algorithm does not change the set of common divisors: CD(x,y)=CD(y,r)."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "L_cd_step"
          ],
          "explanation": {
            "zh-Hant": "引理的兩個方向分別在 S04.1、S04.2 證明。",
            "en": "The two directions of the lemma are proved in S04.1 and S04.2."
          }
        },
        "leaf_basis": "distributive + order_basics + exists_intro"
      },
      {
        "id": "S04.1",
        "uses": [
          "mko_dvd_def",
          "distributive"
        ],
        "before_tex": "y=cu,\\ r=cv",
        "after_tex": "x=c(uq+v),\\ \\text{so}\\ c\\mid x",
        "relation": "implies",
        "rule": "distributive",
        "conditions": [],
        "explanation": {
          "zh-Hant": "（⇐ 方向）由 c∣y、c∣r 取見證 y=cu、r=cv。則 x=yq+r=cuq+cv=c(uq+v)，uq+v 是自然數，所以 c∣x；而 c∣y 已知。",
          "en": "(The ⇐ direction) From c∣y and c∣r take witnesses y=cu and r=cv. Then x=yq+r=cuq+cv=c(uq+v), and uq+v is natural, so c∣x; c∣y is given."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "distributive",
            "mul_assoc",
            "exists_intro"
          ],
          "explanation": {
            "zh-Hant": "只用分配律與 ℕ 對加法、乘法封閉；沒有使用引理本身。",
            "en": "Only distributivity and closure of ℕ under addition and multiplication are used; the lemma itself is not used."
          }
        },
        "leaf_basis": "distributive + mul_assoc + exists_intro"
      },
      {
        "id": "S04.2",
        "uses": [
          "mko_dvd_def",
          "order_basics"
        ],
        "before_tex": "x=cs,\\ y=cu,\\ y>0",
        "after_tex": "r=c(s-uq),\\ s-uq\\in\\mathbb{N},\\ \\text{so}\\ c\\mid r",
        "relation": "implies",
        "rule": "order_basics",
        "conditions": [
          "y>0"
        ],
        "explanation": {
          "zh-Hant": "（⇒ 方向）由 c∣x、c∣y 取見證 x=cs、y=cu。因 y>0，c≠0，即 c>0。又 cs=x=yq+r≥yq=c(uq)；若 s<uq，則 cs<c(uq)，矛盾；所以 s≥uq，t=s−uq 是自然數。於是 x=c(uq)+ct=yq+ct，與 x=yq+r 比較得 r=ct，所以 c∣r。S04.1 與 S04.2 合起來證得引理 L_cd_step。",
          "en": "(The ⇒ direction) From c∣x and c∣y take witnesses x=cs and y=cu. Since y>0, c≠0, so c>0. Also cs=x=yq+r≥yq=c(uq); if s<uq then cs<c(uq), a contradiction; so s≥uq and t=s−uq is natural. Then x=c(uq)+ct=yq+ct, and comparing with x=yq+r gives r=ct, so c∣r. S04.1 and S04.2 together prove Lemma L_cd_step."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "order_basics",
            "distributive",
            "contradiction"
          ],
          "explanation": {
            "zh-Hant": "自然數減法 s−uq 只有在 s≥uq 時才是自然數，所以先證 s≥uq；這需要 c>0，由 y>0 保證。沒有使用引理本身。",
            "en": "The natural subtraction s−uq is natural only when s≥uq, so s≥uq is proved first; this needs c>0, which y>0 guarantees. The lemma itself is not used."
          }
        },
        "leaf_basis": "order_basics + distributive + contradiction + exists_intro"
      },
      {
        "id": "S05",
        "uses": [
          "S01",
          "S04"
        ],
        "before_tex": "x=yq+r,\\ y>0",
        "after_tex": "d\\ \\text{satisfies S01 for}\\ (x,y)\\iff d\\ \\text{satisfies S01 for}\\ (y,r)",
        "relation": "equivalent",
        "rule": "set_extensionality",
        "conditions": [
          "y>0"
        ],
        "explanation": {
          "zh-Hant": "S01 的刻畫只透過公因數集合依賴輸入：「d∈CD 且 CD 中每個 c 都整除 d」。S04 說 CD(x,y)=CD(y,r)，所以兩個刻畫完全相同。因此 gcd(x,y)=gcd(y, x mod y)。",
          "en": "The characterization S01 depends on the inputs only through the set of common divisors: 'd∈CD and every c in CD divides d'. S04 says CD(x,y)=CD(y,r), so the two characterizations are identical. Hence gcd(x,y)=gcd(y, x mod y)."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "S04",
            "set_extensionality"
          ],
          "explanation": {
            "zh-Hant": "集合相等是雙向的，所以刻畫的等價也是雙向的。",
            "en": "Equality of sets is two-way, so the equivalence of the characterizations is two-way."
          }
        },
        "leaf_basis": "set_extensionality + eq_replace"
      },
      {
        "id": "S06",
        "uses": [
          "G2",
          "G3",
          "division_algorithm"
        ],
        "before_tex": "(84,36)",
        "after_tex": "84=36\\cdot 2+12,\\ 0\\le 12<36;\\ (84,36)\\mapsto(36,12)",
        "relation": "implies",
        "rule": "division_algorithm",
        "conditions": [
          "36>0"
        ],
        "explanation": {
          "zh-Hant": "第一步：36≠0，84 除以 36 得商 2、餘數 12（N1、N2），所以 (84,36) 換成 (36,12)。",
          "en": "First step: 36≠0, and 84 divided by 36 gives quotient 2 and remainder 12 (N1, N2), so (84,36) becomes (36,12)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "division_algorithm",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "需要 0≤12<36，這使 12 是唯一的餘數。",
            "en": "It needs 0≤12<36, which makes 12 the unique remainder."
          }
        },
        "leaf_basis": "division_algorithm + numeric_evaluation"
      },
      {
        "id": "S07",
        "uses": [
          "S06",
          "division_algorithm"
        ],
        "before_tex": "(36,12)",
        "after_tex": "36=12\\cdot 3+0;\\ (36,12)\\mapsto(12,0)",
        "relation": "implies",
        "rule": "division_algorithm",
        "conditions": [
          "12>0"
        ],
        "explanation": {
          "zh-Hant": "第二步：12≠0，36=12·3+0（N3），所以 (36,12) 換成 (12,0)。第二個數為 0，算法停止，輸出 12。",
          "en": "Second step: 12≠0 and 36=12·3+0 (N3), so (36,12) becomes (12,0). The second entry is 0, so the algorithm stops and outputs 12."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "division_algorithm",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "餘數 0 滿足 0≤0<12。",
            "en": "The remainder 0 satisfies 0≤0<12."
          }
        },
        "leaf_basis": "division_algorithm + numeric_evaluation"
      },
      {
        "id": "S08",
        "uses": [
          "S03",
          "S05",
          "S06",
          "S07"
        ],
        "before_tex": "\\gcd(12,0)=12",
        "after_tex": "\\gcd(84,36)=\\gcd(36,12)=\\gcd(12,0)=12",
        "relation": "implies",
        "rule": "logic_chain",
        "conditions": [],
        "explanation": {
          "zh-Hant": "由 S03，12 是 gcd(12,0)。S05 用於 S07 的一步（36=12·3+0）得 12 也滿足 (36,12) 的刻畫；再用於 S06 的一步（84=36·2+12）得 12 滿足 (84,36) 的刻畫。所以 gcd(84,36)=12（N4 為獨立重算）。",
          "en": "By S03, 12 is gcd(12,0). S05 applied to the step of S07 (36=12·3+0) shows 12 also satisfies the characterization for (36,12); applied again to the step of S06 (84=36·2+12) it shows 12 satisfies the characterization for (84,36). So gcd(84,36)=12 (N4 is an independent recomputation)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "S05",
            "S06",
            "S07",
            "logic_chain"
          ],
          "explanation": {
            "zh-Hant": "從算法終點往回套用 S05；每一步的前提 y>0 都已確認（36>0、12>0）。",
            "en": "S05 is applied backwards from the end of the run; each step's premise y>0 was confirmed (36>0, 12>0)."
          }
        },
        "leaf_basis": "logic_chain + eq_refl_symm_trans"
      },
      {
        "id": "S09",
        "uses": [
          "G2",
          "division_algorithm",
          "well_ordering"
        ],
        "before_tex": "(x,y)\\mapsto(y,\\,x\\bmod y),\\ y>0",
        "after_tex": "\\text{the algorithm stops after finitely many steps}",
        "relation": "implies",
        "rule": "well_ordering",
        "conditions": [],
        "explanation": {
          "zh-Hant": "每一步把第二個數 y 換成餘數 r，且 0≤r<y。若算法永不停止，第二個數會形成一個無窮嚴格遞減的自然數列；它的值集合非空，卻沒有最小元素（每個值之後都有更小的值），與良序原理矛盾。所以算法必在有限步後到達第二個數為 0，步數不超過起始的 y。本例的第二個數 36、12、0 嚴格遞減。",
          "en": "Each step replaces the second entry y by the remainder r with 0≤r<y. If the algorithm never stopped, the second entries would form an infinite strictly decreasing sequence of naturals; its set of values is nonempty but has no least element (every value is followed by a smaller one), contradicting well-ordering. So the algorithm reaches second entry 0 after finitely many steps, at most the initial y of them. Here the second entries 36, 12, 0 decrease strictly."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "division_algorithm",
            "well_ordering",
            "contradiction"
          ],
          "explanation": {
            "zh-Hant": "停止性只需 r<y 與良序原理；它保證 S08 的回推從有限的終點開始。",
            "en": "Termination needs only r<y and well-ordering; it ensures that the backward argument of S08 starts from a finite end point."
          }
        },
        "leaf_basis": "well_ordering + division_algorithm + contradiction"
      },
      {
        "id": "S10",
        "uses": [
          "S04",
          "S06",
          "S08"
        ],
        "before_tex": "d=12",
        "after_tex": "12\\mid 84,\\ 12\\mid 36,\\ (c\\mid 84\\land c\\mid 36\\Rightarrow c\\mid 12)",
        "relation": "implies",
        "rule": "mko_gcd_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "直接驗證刻畫的兩部分：84=12·7、36=12·3（N5、N6），所以 12 是公因數；任一公因數 c，依 S04 的 ⇒ 方向（x=84、y=36、q=2、r=12）得 c∣12。例如 84 與 36 的公因數 1、2、3、4、6、12 都整除 12。",
          "en": "Verify both parts of the characterization directly: 84=12·7 and 36=12·3 (N5, N6), so 12 is a common divisor; for any common divisor c, the ⇒ direction of S04 (x=84, y=36, q=2, r=12) gives c∣12. For example the common divisors 1, 2, 3, 4, 6, 12 of 84 and 36 all divide 12."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "S06",
            "mko_gcd_def"
          ],
          "explanation": {
            "zh-Hant": "第二部分是對所有公因數的一般論證，不是只看列出的六個；列出的只是例子。",
            "en": "The second part is a general argument for every common divisor, not just the six listed; the list is only an illustration."
          }
        },
        "leaf_basis": "mko_gcd_def + exists_intro + numeric_evaluation"
      },
      {
        "id": "S11",
        "uses": [
          "S01",
          "S10"
        ],
        "before_tex": "6\\mid 84,\\ 6\\mid 36",
        "after_tex": "12\\nmid 6,\\ \\text{so}\\ 6\\neq\\gcd(84,36)",
        "relation": "implies",
        "rule": "mko_gcd_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "84=6·14、36=6·6，所以 6 是公因數。但 12 也是公因數，而 12∤6：6=12·k 時，k=0 給 0、k≥1 給至少 12，都不是 6。刻畫的第二部分失敗，所以 6 不是 gcd。這正是 MKO 提醒的誤解：把任一共同因數稱為最大公因數。",
          "en": "84=6·14 and 36=6·6, so 6 is a common divisor. But 12 is also a common divisor and 12∤6: in 6=12·k, k=0 gives 0 and k≥1 gives at least 12, neither equal to 6. The second part of the characterization fails, so 6 is not the gcd. This is the misconception the MKO warns about: calling any common divisor the greatest one."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "S10",
            "order_basics"
          ],
          "explanation": {
            "zh-Hant": "否定只需一個不整除 6 的公因數（12）。",
            "en": "Refutation needs only one common divisor that does not divide 6 (namely 12)."
          }
        },
        "leaf_basis": "mko_gcd_def + order_basics + numeric_evaluation"
      },
      {
        "id": "S12",
        "uses": [
          "G2",
          "G3",
          "S03",
          "S05"
        ],
        "before_tex": "(8,15)",
        "after_tex": "(8,15)\\mapsto(15,8)\\mapsto(8,7)\\mapsto(7,1)\\mapsto(1,0);\\ \\gcd(8,15)=1",
        "relation": "implies",
        "rule": "division_algorithm",
        "conditions": [],
        "explanation": {
          "zh-Hant": "逐步：8=15·0+8 →(15,8)；15=8·1+7 →(8,7)；8=7·1+1 →(7,1)；7=1·7+0 →(1,0)（N10 到 N13）。每步除數都大於 0。由 S03，gcd(1,0)=1，再依 S05 逐步回推，gcd(8,15)=1（N14 為獨立重算）。第一步只是交換次序，因為 8<15。",
          "en": "Step by step: 8=15·0+8 →(15,8); 15=8·1+7 →(8,7); 8=7·1+1 →(7,1); 7=1·7+0 →(1,0) (N10 to N13). Every divisor used is positive. By S03, gcd(1,0)=1, and applying S05 backwards step by step, gcd(8,15)=1 (N14 is an independent recomputation). The first step only swaps the order, since 8<15."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "S05",
            "division_algorithm"
          ],
          "explanation": {
            "zh-Hant": "與 S06 到 S08 相同的結構；每一步的餘數都滿足 0≤r<y。",
            "en": "The same structure as S06 to S08; each remainder satisfies 0≤r<y."
          }
        },
        "leaf_basis": "division_algorithm + logic_chain + numeric_evaluation"
      },
      {
        "id": "S13",
        "uses": [
          "S12",
          "mko_gcd_def"
        ],
        "before_tex": "\\gcd(8,15)=1,\\ 8=2\\cdot 4,\\ 15=3\\cdot 5",
        "after_tex": "8,15\\ \\text{coprime, neither prime}",
        "relation": "implies",
        "rule": "mko_gcd_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依定義，gcd=1 即互質。8 有因數 2（2≠1、2≠8），15 有因數 3（3≠1、3≠15），所以兩者都不是質數。互質是兩數之間的關係，不要求兩數本身是質數（MKO 段落 2）。",
          "en": "By the definition, gcd=1 means coprime. 8 has the divisor 2 (2≠1, 2≠8) and 15 has the divisor 3 (3≠1, 3≠15), so neither is prime. Coprimality is a relation between two numbers and does not require either to be prime (MKO paragraph 2)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S12",
            "mko_gcd_def"
          ],
          "explanation": {
            "zh-Hant": "只用互質的定義與兩個非平凡因數見證。",
            "en": "Only the definition of coprime and two nontrivial divisor witnesses are used."
          }
        },
        "leaf_basis": "mko_gcd_def + exists_intro + numeric_evaluation"
      },
      {
        "id": "S14",
        "uses": [
          "G2",
          "G3",
          "S03",
          "S05"
        ],
        "before_tex": "(0,1),\\ (0,6),\\ (0,0)",
        "after_tex": "\\gcd(0,1)=1,\\ \\gcd(0,6)=6,\\ \\gcd(0,0)=0",
        "relation": "implies",
        "rule": "logic_chain",
        "conditions": [],
        "explanation": {
          "zh-Hant": "(0,1)：0=1·0+0 →(1,0)，gcd=1，所以 0 與 1 互質。(0,6)：0=6·0+0 →(6,0)，gcd=6≠1，不互質（2 同時整除 0 與 6）。(0,0)：由 S03，0 滿足刻畫，與約定一致；注意每個自然數都整除 0，所以 (0,0) 沒有「數值上最大」的公因數，整除刻畫正是讓 0 成為自然答案的方式。",
          "en": "(0,1): 0=1·0+0 →(1,0), gcd=1, so 0 and 1 are coprime. (0,6): 0=6·0+0 →(6,0), gcd=6≠1, not coprime (2 divides both 0 and 6). (0,0): by S03, 0 satisfies the characterization, agreeing with the convention; note that every natural divides 0, so (0,0) has no numerically largest common divisor, and the divisibility characterization is what makes 0 the natural answer."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "S05",
            "dvd_basic"
          ],
          "explanation": {
            "zh-Hant": "(0,1) 與 (0,6) 用算法一步加 S03、S05；(0,0) 直接用 S03。",
            "en": "(0,1) and (0,6) use one algorithm step with S03 and S05; (0,0) uses S03 directly."
          }
        },
        "leaf_basis": "logic_chain + dvd_basic + numeric_evaluation"
      }
    ],
    "result": {
      "zh-Hant": "滿足整除刻畫的 gcd 至多一個；歐幾里得算法每步保持公因數集合且必停止。gcd(84,36)=12（84→36→12→0），12 直接滿足刻畫；公因數 6 不是 gcd，因為 12∤6。gcd(8,15)=1，所以 8 與 15 互質，雖然兩者都不是質數。gcd(0,1)=1（互質）、gcd(0,6)=6（不互質）、gcd(0,0)=0（與刻畫一致）。",
      "en": "At most one d satisfies the divisibility characterization; each step of Euclid's algorithm preserves the set of common divisors and the algorithm stops. gcd(84,36)=12 (84→36→12→0), and 12 satisfies the characterization directly; the common divisor 6 is not the gcd because 12∤6. gcd(8,15)=1, so 8 and 15 are coprime although neither is prime. gcd(0,1)=1 (coprime), gcd(0,6)=6 (not coprime), gcd(0,0)=0 (consistent with the characterization)."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "6 是 84 與 36 的最大公因數，因為 6 同時整除兩者",
          "en": "6 is the greatest common divisor of 84 and 36 because it divides both"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "公因數 12 不整除 6；gcd(84,36)=12。",
          "en": "The common divisor 12 does not divide 6; gcd(84,36)=12."
        }
      },
      {
        "claim": {
          "zh-Hant": "8 與 15 不互質，因為兩者都不是質數",
          "en": "8 and 15 are not coprime because neither is prime"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "gcd(8,15)=1，所以互質。",
          "en": "gcd(8,15)=1, so they are coprime."
        }
      },
      {
        "claim": {
          "zh-Hant": "0 與 6 互質",
          "en": "0 and 6 are coprime"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "gcd(0,6)=6≠1；2 同時整除 0 與 6。",
          "en": "gcd(0,6)=6≠1; 2 divides both 0 and 6."
        }
      },
      {
        "claim": {
          "zh-Hant": "gcd(0,0) 不存在，因為每個數都整除 0",
          "en": "gcd(0,0) does not exist because every number divides 0"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "依整除刻畫，0 是公因數且每個公因數都整除 0，所以 gcd(0,0)=0，與 MKO 約定一致。",
          "en": "Under the divisibility characterization, 0 is a common divisor and every common divisor divides 0, so gcd(0,0)=0, in agreement with the MKO's convention."
        }
      }
    ],
    "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": "order_basics",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "實數的序：任兩數恰有 u<v、u=v、u>v 之一；u<v 且 v<w 推出 u<w；u<v 推出 u+w<v+w；u<v 且 w>0 推出 uw<vw；u<v 且 w<0 推出 uw>vw。",
          "en": "Order of the reals: exactly one of u<v, u=v, u>v holds; u<v and v<w give u<w; u<v gives u+w<v+w; u<v and w>0 give uw<vw; u<v and w<0 give uw>vw."
        }
      },
      {
        "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": "well_ordering",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "良序原理：ℕ 的每個非空子集都有最小元素。",
          "en": "Well-ordering principle: every nonempty subset of ℕ has a least element."
        }
      },
      {
        "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": "exists_elim",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "∃消去：由 ∃x∈D, P(x)，可取一個新名字 a 表示某個滿足 P(a) 的元素；只要最後結論不含 a，就可用 a 推理。",
          "en": "∃-elimination: from ∃x∈D, P(x) we may name some element a with P(a) by a fresh name; reasoning with a is allowed as long as the final conclusion does not mention a."
        }
      },
      {
        "id": "mul_zero",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘以零：u·0=0。理由：u·0=u·(0+0)=u·0+u·0，兩邊同減 u·0 得 0=u·0。",
          "en": "Multiplying by zero: u·0=0. Reason: u·0=u·(0+0)=u·0+u·0; subtracting u·0 from both sides gives 0=u·0."
        }
      },
      {
        "id": "mul_assoc",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘法結合律：(uv)w=u(vw)。",
          "en": "Associativity of multiplication: (uv)w=u(vw)."
        }
      },
      {
        "id": "case_analysis",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "分情況論證：若 P∨Q 成立，且 P⇒R、Q⇒R 都已證，則 R 成立。所有情況必須涵蓋全部可能。",
          "en": "Proof by cases: if P∨Q holds and both P⇒R and Q⇒R are proved, then R holds. The cases must cover every possibility."
        }
      },
      {
        "id": "contradiction",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "反證法：若假設 ¬P 推出矛盾（某命題與其否定同時成立），則 P 成立。",
          "en": "Proof by contradiction: if assuming ¬P leads to a contradiction (a statement and its negation both hold), then P holds."
        }
      },
      {
        "id": "and_intro_elim",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "合取：由 P 與 Q 得 P∧Q；由 P∧Q 可分別得 P 與 Q。",
          "en": "Conjunction: from P and Q infer P∧Q; from P∧Q infer P and infer Q."
        }
      },
      {
        "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": "set_extensionality",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "集合相等：A=B 當且僅當 A⊆B 且 B⊆A，即兩者有相同元素。",
          "en": "Set equality: A=B if and only if A⊆B and B⊆A, i.e. they have the same elements."
        }
      },
      {
        "id": "eq_replace",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "等值代換：命題中的一個式子可換成與它相等的式子，命題的真假不變。",
          "en": "Replacement of equals: an expression inside a statement may be replaced by an equal expression without changing whether the statement is true."
        }
      },
      {
        "id": "logic_chain",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "推論的傳遞：由 P⇒Q 與 Q⇒R 得 P⇒R；⇔ 同理。",
          "en": "Chaining: from P⇒Q and Q⇒R infer P⇒R; likewise for ⇔."
        }
      },
      {
        "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": "mko_gcd_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-gcd-coprime",
          "sha256": "a8f5934d6354ea07a83057c61f045034e2d964850bed4759aedd8721848b3b9b",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "自然數 d=gcd(a,b) 由 d∣a、d∣b，且每個同時整除 a、b 的自然數 c 都滿足 c∣d 刻畫。採 gcd(0,0)=0；a、b 互質表示 gcd(a,b)=1。",
          "en": "The natural number d=gcd(a,b) is characterized by d∣a and d∣b, with c∣d for every natural c that divides both a and b. Adopt gcd(0,0)=0. The inputs a and b are coprime exactly when gcd(a,b)=1."
        }
      },
      {
        "id": "mko_dvd_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-natural-divisibility",
          "sha256": "2e5d00faa3ae3031b2cb2a650b12db0ab8e8aa1b59a7ea6b2350f49a792758d7",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "對自然數 a、b，a∣b 當且僅當存在自然數 k 使 b=a·k。",
          "en": "For natural numbers a and b, a∣b exactly when there is a natural number k such that b=a·k."
        }
      },
      {
        "id": "dvd_basic",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "自然數整除的基本事實：a∣a（a=a·1）；a∣0（0=a·0）；a>0 時 a∣b ⇔ b 除以 a 的餘數為 0。",
          "en": "Basic facts of natural divisibility: a∣a (a=a·1); a∣0 (0=a·0); for a>0, a∣b ⇔ b leaves remainder 0 on division by a."
        }
      },
      {
        "id": "L_dvd_antisymm",
        "kind": "lemma",
        "proved_in": [
          "S02.1",
          "S02.2"
        ],
        "statement": {
          "zh-Hant": "對自然數 d、e：若 d∣e 且 e∣d，則 d=e。",
          "en": "For naturals d and e: if d∣e and e∣d, then d=e."
        }
      },
      {
        "id": "L_cd_step",
        "kind": "lemma",
        "proved_in": [
          "S04.1",
          "S04.2"
        ],
        "statement": {
          "zh-Hant": "對自然數 x、y、q、r，若 y>0 且 x=yq+r，則每個自然數 c 都有 (c∣x 且 c∣y) ⇔ (c∣y 且 c∣r)。",
          "en": "For naturals x, y, q, r with y>0 and x=yq+r, every natural c satisfies (c∣x and c∣y) ⇔ (c∣y and c∣r)."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S06",
        "lhs": "36*2+12",
        "rhs": "84"
      },
      {
        "id": "N2",
        "step": "S06",
        "lhs": "84 % 36",
        "rhs": "12"
      },
      {
        "id": "N3",
        "step": "S07",
        "lhs": "12*3+0",
        "rhs": "36"
      },
      {
        "id": "N4",
        "step": "S08",
        "lhs": "gcd(84,36)",
        "rhs": "12"
      },
      {
        "id": "N5",
        "step": "S10",
        "lhs": "12*7",
        "rhs": "84"
      },
      {
        "id": "N6",
        "step": "S10",
        "lhs": "12*3",
        "rhs": "36"
      },
      {
        "id": "N7",
        "step": "S11",
        "lhs": "6*14",
        "rhs": "84"
      },
      {
        "id": "N8",
        "step": "S11",
        "lhs": "6*6",
        "rhs": "36"
      },
      {
        "id": "N9",
        "step": "S11",
        "lhs": "6 % 12",
        "relation": "!=",
        "rhs": "0"
      },
      {
        "id": "N10",
        "step": "S12",
        "lhs": "15*0+8",
        "rhs": "8"
      },
      {
        "id": "N11",
        "step": "S12",
        "lhs": "8*1+7",
        "rhs": "15"
      },
      {
        "id": "N12",
        "step": "S12",
        "lhs": "7*1+1",
        "rhs": "8"
      },
      {
        "id": "N13",
        "step": "S12",
        "lhs": "1*7+0",
        "rhs": "7"
      },
      {
        "id": "N14",
        "step": "S12",
        "lhs": "gcd(8,15)",
        "rhs": "1"
      },
      {
        "id": "N15",
        "step": "S13",
        "lhs": "2*4",
        "rhs": "8"
      },
      {
        "id": "N16",
        "step": "S13",
        "lhs": "3*5",
        "rhs": "15"
      },
      {
        "id": "N17",
        "step": "S14",
        "lhs": "gcd(0,6)",
        "rhs": "6"
      },
      {
        "id": "N18",
        "step": "S14",
        "lhs": "gcd(0,1)",
        "rhs": "1"
      },
      {
        "id": "N19",
        "step": "S10",
        "lhs": "84 % 12 + 36 % 12",
        "rhs": "0"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "在包含 0 的自然數中，以整除刻畫定義 gcd（MKO 假設 a1、a2）。歐幾里得算法的正確性由「每步保持公因數集合」與「gcd(x,0)=x」兩個事實推出，停止性由良序原理推出。不處理 Bézout 等式、負整數或多個數的 gcd；不改動 canonical MKO 或英文 edition。",
      "en": "Defines the gcd by the divisibility characterization in the naturals including 0 (MKO assumptions a1 and a2). Correctness of Euclid's algorithm is derived from two facts, 'each step preserves the set of common divisors' and 'gcd(x,0)=x', and termination from well-ordering. Bézout's identity, negative integers and gcds of more than two numbers are not treated; the canonical MKO and its English edition are not changed."
    },
    "md_symbols": [
      [
        "\\gcd(a,b)",
        "最大公因數（整除刻畫）",
        "greatest common divisor (divisibility characterization)"
      ],
      [
        "\\mathrm{CD}(a,b)",
        "a、b 的公因數集合",
        "the set of common divisors of a and b"
      ],
      [
        "(x,y)\\mapsto(y,\\,x\\bmod y)",
        "歐幾里得算法的一步（y>0）",
        "one step of Euclid's algorithm (y>0)"
      ],
      [
        "c\\mid x",
        "c 整除 x",
        "c divides x"
      ]
    ],
    "md_error_controls": [
      {
        "title": "公因數不一定是最大公因數 / A common divisor need not be the greatest common divisor",
        "zh": "MKO 指出的誤解：把任何共同因數稱為最大公因數。6 同時整除 84 與 36，但公因數 12 不整除 6，刻畫第二部分失敗（S11）。驗證候選時必須檢查所有公因數都整除它，只找到一個大的公因數不夠。",
        "en": "The misconception the MKO names: calling any common divisor the greatest one. 6 divides both 84 and 36, but the common divisor 12 does not divide 6, so the second part of the characterization fails (S11). Checking a candidate requires that every common divisor divide it; finding one large common divisor is not enough."
      },
      {
        "title": "互質不要求兩數是質數 / Coprime does not require primes",
        "zh": "MKO 指出的另一個誤解：以為互質的兩數都必須是質數。8 與 15 都不是質數，卻互質；0 與 1 也互質（S13、S14）。",
        "en": "The other misconception the MKO names: thinking that coprime numbers must both be prime. 8 and 15 are not prime yet coprime; 0 and 1 are coprime too (S13, S14)."
      },
      {
        "title": "自然數減法要先確認不為負 / Justify natural subtraction first",
        "zh": "S04.2 中 r=c(s−uq) 必須先證 s≥uq，s−uq 才是自然數，見證才合法；這一步用到 c>0，而 c>0 來自 y>0。",
        "en": "In S04.2, r=c(s−uq) requires first proving s≥uq so that s−uq is natural and the witness is legitimate; this uses c>0, which comes from y>0."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "Bézout 等式（gcd 可寫成兩數的整數線性組合）不在本稿處理。",
        "en": "Bézout's identity (the gcd as an integer linear combination of the inputs) is not treated here."
      },
      {
        "zh-Hant": "dvd_basic 與帶餘除法作為前置規則使用；前者的證明見自然數整除的教學稿，本稿不重證。",
        "en": "dvd_basic and the division algorithm are used as prerequisites; the former is proved in the natural-divisibility guide and not re-proved here."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "f39e3c663a8c3440ba12db2b5c23ca110fbd1985af55bf32133cce444b5f2c07",
    "original_source_sha256": "f39e3c663a8c3440ba12db2b5c23ca110fbd1985af55bf32133cce444b5f2c07",
    "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."
  }
}
