{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-multiplicative-order-mod-n-01",
  "mko_id": "mko-multiplicative-order-mod-n",
  "title": {
    "zh-Hant": "第一個回到1的冪",
    "en": "The first power returning to one"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-multiplicative-order-mod-n-01",
    "source": {
      "mko_id": "mko-multiplicative-order-mod-n",
      "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
      "sha256": "70fb02dd0cfb34ce7cc4a848496bc4599fe6b0d22028bb31d567c1c29e501ec3",
      "english_sha256": "f483395f63a625c33cb8d24ecdc29750ab5bf5a3547024df4c65a99269a1616e"
    },
    "mode": "worked_example",
    "audience_prerequisites": [
      "calc"
    ],
    "goal": {
      "zh-Hant": "ord₈(−5)=ord₈(3)=2，φ(8)=4且2整除4，但order不等φ。",
      "en": "ord_8(-5)=ord_8(3)=2, with phi(8)=4 and 2 dividing 4 but not equal to it."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "n=8，a=−5，使用乘法階的最小正回返定義。",
          "en": "n=8,a=-5, using multiplicative order as the least positive return to 1."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1"
        ],
        "before_tex": "n=8,\\quad a=-5",
        "after_tex": "a\\equiv3\\pmod8,\\quad\\gcd(3,8)=1,\\quad n\\ge2",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "先正規化且核unit，Euclid8=2·3+2、3=2+1給gcd1。",
          "en": "Normalize and qualify the unit first; 8=2*3+2,3=2+1 give gcd 1."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1"
          ],
          "explanation": {
            "zh-Hant": "非unit不啟動此order搜尋。",
            "en": "A nonunit does not start this order search."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S02",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "k=1",
        "after_tex": "3^1\\equiv3\\not\\equiv1\\pmod8",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "從k=1而非k=0開始，第一個正冪未回返。",
          "en": "Start at k=1, not k=0; the first positive power has not returned."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "a⁰=1不能被誤報order0。",
            "en": "a^0=1 cannot be misreported as order zero."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S03",
        "uses": [
          "G1",
          "S02"
        ],
        "before_tex": "k=2",
        "after_tex": "3^2=9\\equiv1\\pmod8",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "下一冪回到1，結合前步排除所有較小正指數。",
          "en": "The next power returns to 1, and S02 excludes every smaller positive exponent."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S02"
          ],
          "explanation": {
            "zh-Hant": "這裡完整較小指數集合只有{1}，無漏檢。",
            "en": "The complete smaller-positive-exponent set is {1}, with no omission."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S04",
        "uses": [
          "G1",
          "S01",
          "S02",
          "S03"
        ],
        "before_tex": "3^1\\ne1,\\quad3^2=1\\quad(\\bmod8)",
        "after_tex": "\\operatorname{ord}_8(3)=2=\\operatorname{ord}_8(-5)",
        "relation": "implies",
        "rule": "mko_definition",
        "conditions": [],
        "explanation": {
          "zh-Hant": "首回返證書確定最小值2，而不是任意後續回返4。",
          "en": "The first-return certificate determines least value 2, not later return 4."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01",
            "S02",
            "S03"
          ],
          "explanation": {
            "zh-Hant": "負base與3同類，order只依類。",
            "en": "The negative representative shares class 3, and order depends on the class."
          }
        },
        "leaf_basis": "mko_definition"
      },
      {
        "id": "S05",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "k=1,2,3,4,5,6,7,8",
        "after_tex": "\\gcd(k,8)=1,2,1,4,1,2,1,8;\\quad U_8=\\{1,3,5,7\\},\\ \\varphi(8)=4",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "完整八項gcd清單確定φ4，不由order猜測。",
          "en": "The complete eight-entry gcd list determines phi 4 without guessing from the order."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "4只是unit個數，不必等於此base的最小回返。",
            "en": "4 counts units and need not equal this base's least return."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S06",
        "uses": [
          "G1",
          "S04",
          "S05"
        ],
        "before_tex": "m=\\operatorname{ord}_n(a),\\quad a^k\\equiv1,\\quad k=qm+r,\\ 0\\le r<m",
        "after_tex": "1\\equiv a^k\\equiv(a^m)^qa^r\\equiv a^r\\Rightarrow r=0\\Rightarrow m\\mid k",
        "relation": "implies",
        "rule": "calc",
        "conditions": [
          "a is a unit",
          "m is the least positive return",
          "k is a positive return"
        ],
        "explanation": {
          "zh-Hant": "帶餘除法與最小性證任何回返指數皆被order整除；本例k=φ8=4為回返。",
          "en": "Division with remainder and minimality show order divides every return exponent; here k=phi(8)=4 is a return."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S04",
            "S05"
          ],
          "explanation": {
            "zh-Hant": "q≥0且r=0可成立；若r>0會與首回返最小性矛盾。",
            "en": "q is nonnegative; r>0 would contradict first-return minimality."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S07",
        "uses": [
          "G1",
          "S03",
          "S05",
          "S06"
        ],
        "before_tex": "m=2,\\quad\\varphi(8)=4",
        "after_tex": "2\\mid4,\\quad2<4,\\quad3^4\\equiv1\\pmod8",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "完整核divisibility但不相等；後續回返4不能替換order2。",
          "en": "Check divisibility but strict inequality; later return 4 cannot replace order 2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S03",
            "S05",
            "S06"
          ],
          "explanation": {
            "zh-Hant": "本例不自動宣稱primitive root或最大階。",
            "en": "This example makes no automatic primitive-root or maximal-order claim."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S08",
        "uses": [
          "G1",
          "S01",
          "S04",
          "S07"
        ],
        "before_tex": "a\\equiv1\\pmod8;\\quad a=2\\text{ or }n=1",
        "after_tex": "\\operatorname{ord}_8(1)=1;\\quad\\operatorname{ord}_8(2),\\ \\operatorname{ord}_1(a)\\text{ undefined here}",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "1的第一正冪已回返故order1；非unit2及n<2不在本定義域。",
          "en": "Residue 1 returns at its first positive power, giving order 1; nonunit 2 and n<2 are outside this domain."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01",
            "S04",
            "S07"
          ],
          "explanation": {
            "zh-Hant": "undefined不是order0，也不混用模8的加法階。",
            "en": "Undefined is not order zero, nor is it additive order modulo 8."
          }
        },
        "leaf_basis": "calc"
      }
    ],
    "result": {
      "zh-Hant": "ord₈(−5)=ord₈(3)=2，φ(8)=4且2整除4，但order不等φ。",
      "en": "ord_8(-5)=ord_8(3)=2, with phi(8)=4 and 2 dividing 4 but not equal to it."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "ord₈(3)=4因3⁴≡1。",
          "en": "ord_8(3)=4 because 3^4=1."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "3²已回返，4不是最小。",
          "en": "3^2 already returns, so 4 is not least."
        }
      },
      {
        "claim": {
          "zh-Hant": "每個unit階都等於φ(n)。",
          "en": "Every unit order equals phi(n)."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "本例2<4。",
          "en": "Here 2<4."
        }
      },
      {
        "claim": {
          "zh-Hant": "ord₈(2)=0。",
          "en": "ord_8(2)=0."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "2不是unit，本稿定義undefined。",
          "en": "2 is not a unit, so this order is undefined here."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "calc",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "假設精確整數算術、帶餘除法、整除與gcd的定義；同餘等式始終綁定明示模數。",
          "en": "Assume exact integer arithmetic, division with remainder, and definitions of divisibility and gcd; every congruence has an explicit modulus."
        }
      },
      {
        "id": "mko_definition",
        "kind": "cited",
        "statement": {
          "zh-Hant": "先核n≥2並normalize a mod n，gcd(a,n)=1。從k=1逐次建立完整power table到first return 1，禁止把任意return exponent當order。以完整residue enumeration計phi(n)，驗ord_n(a)|phi(n)。noncoprime與n<2時undefined；a≡1有order1，negative a先normalize。不自動宣稱order=phi、primitive root或混同additive order。",
          "en": "Require n≥2, normalize a modulo n and check coprimality first. Starting at exponent1 build every power through its first return to 1; an arbitrary later return is not the order. Count phi(n) by complete residue enumeration and verify the order divides phi(n). Noncoprime residues and n<2 have undefined order here. Residue1 has order1, and a negative integer representative is normalized first. Do not infer order=phi(n), a primitive root or additive order."
        },
        "source": {
          "mko_id": "mko-multiplicative-order-mod-n",
          "sha256": "70fb02dd0cfb34ce7cc4a848496bc4599fe6b0d22028bb31d567c1c29e501ec3",
          "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f"
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "first_power",
        "lhs": "3%8",
        "rhs": "1",
        "step": "S02",
        "relation": "!="
      },
      {
        "id": "return",
        "lhs": "3**2%8",
        "rhs": "1",
        "step": "S03"
      },
      {
        "id": "divides",
        "lhs": "4%2",
        "rhs": "0",
        "step": "S07"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "bounded modulus8的完整首回返與unit枚舉，另列undefined與order1。",
      "en": "Complete first-return and unit enumeration at bounded modulus 8, with undefined and order-one boundaries."
    },
    "md_symbols": [
      [
        "m",
        "最小正回返指數",
        "least positive return exponent"
      ],
      [
        "U_8",
        "完整units",
        "complete units"
      ]
    ],
    "md_error_controls": [
      {
        "title": "首回返 / First return",
        "zh": "從正指數1開始，列出到首個1前全部冪。",
        "en": "Start at exponent 1 and retain all powers through the first 1."
      },
      {
        "title": "乘法非加法 / Multiplicative not additive",
        "zh": "模8加法下3的階是8，但乘法階2，運算不可混淆。",
        "en": "3 has additive order 8 modulo 8 but multiplicative order 2; keep operations distinct."
      }
    ],
    "md_open_items": []
  },
  "revision": {
    "id": "ocme-new142-reader-adoption-20261021",
    "collection": "coverage-20261021",
    "source_commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
    "adopted_source_sha256": "ce541cbfb8a5edcfd8f8ac31cb69007abb271f7722aee1a86a2a3de8d979582d",
    "original_source_sha256": "a7c2b4919c706f641010eca03abbb0ccf5ca4a241cd70ff96070b6ead7244523",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "reader_review": "142_of_142_source_bound",
    "wording_review": "original_Lead_decisions_resolved",
    "glossary_reader_paraphrases": [
      "mko_definition"
    ],
    "independent_AI_concurrence": "SCOPED_LEAD_AND_BILINGUAL_CONTEXT_REVIEW",
    "issue_ids": [
      "BR142-S229"
    ],
    "parent_manifest_sha256": "d29f4cae8229ebd24f60d496cb1d3cd4ad8c0a4dca9d44daab0c3245c544283a",
    "scope": "Owner-adopted reader revision. Lead and bilingual review concern the recorded text and premises; no new universal or Lean proof, canonical promotion or historical-label rewrite.",
    "english_binding_revision": {
      "id": "edition-symbol-bindings-20261101",
      "path": "content/edition-symbol-bindings-20261101/revision.json",
      "sha256": "e9b4c69f2c4732074c37abb624c8ab8a70afc3645c12bf9df2268ef650ad7b6c"
    }
  }
}
