{
  "$schema": "../../../schemas/mko-v0.4.schema.json",
  "schema_version": "mko-v0.4",
  "id": "mko-multiplicative-order-mod-n",
  "semantic_family_id": "sf-multiplicative-order-mod-n",
  "type": "definition",
  "version": "0.10.0",
  "language": "zh-Hant",
  "titles": {
    "zh-Hant": "模n乘法階"
  },
  "summary": {
    "zh-Hant": "gcd(a,n)=1時，ord_n(a)是a^k≡1 mod n的最小正整數k。"
  },
  "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。"
  },
  "formula": {
    "tex": "M(a,n)=k",
    "mathml": "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mrow><mrow><mi>M</mi><mo>(</mo><mi>a</mi><mo>,</mo><mi>n</mi><mo>)</mo></mrow><mo>=</mo><mi>k</mi></mrow></math>",
    "semantic_ast": {
      "type": "equation",
      "lhs": {
        "type": "function_call",
        "callee": {
          "type": "symbol",
          "name": "M",
          "glyph": "M"
        },
        "arguments": [
          {
            "type": "symbol",
            "name": "a",
            "glyph": "a"
          },
          {
            "type": "symbol",
            "name": "n",
            "glyph": "n"
          }
        ]
      },
      "rhs": {
        "type": "symbol",
        "name": "k",
        "glyph": "k"
      }
    },
    "compiler": {
      "id": "ocme-formula-core",
      "version": "0.4.0",
      "source_sha256": "8935de0331f7dc42429f252fc7bf05470f741878605598655cdc8cdc7825e00b"
    }
  },
  "assumptions": [
    {
      "id": "a1",
      "zh-Hant": "n與search範圍bounded exact integers。"
    },
    {
      "id": "a2",
      "zh-Hant": "Euler theorem保證coprime case於phi(n)前回到1。"
    }
  ],
  "symbols": [
    {
      "token": "M",
      "role": "multiplicative_order_operator",
      "role_zh": "乘法階算子",
      "scope": "representative_formula"
    },
    {
      "token": "a",
      "role": "integer_residue",
      "role_zh": "整數剩餘類",
      "scope": "representative_formula"
    },
    {
      "token": "n",
      "role": "modulus",
      "role_zh": "模數",
      "scope": "representative_formula"
    },
    {
      "token": "k",
      "role": "least_positive_return",
      "role_zh": "最小正回返指數",
      "scope": "representative_formula"
    }
  ],
  "dependencies": [
    {
      "id": "mko-modular-inverse",
      "title_zh": "模反元素",
      "reason_zh": "unit qualification。"
    },
    {
      "id": "mko-gcd-coprime",
      "title_zh": "最大公因數與互質",
      "reason_zh": "domain。"
    },
    {
      "id": "mko-natural-divisibility",
      "title_zh": "自然數整除",
      "reason_zh": "order divides phi。"
    },
    {
      "id": "mko-euler-theorem-number-theory",
      "title_zh": "Euler定理",
      "reason_zh": "return bound。"
    }
  ],
  "explanation": {
    "paragraphs_zh": [
      "normalize與coprime資格先行。",
      "power table由k=1找到first return。",
      "phi divisibility與undefined boundaries分開。"
    ],
    "common_misconception_zh": "看到某次a^k=1就把k稱order，或對nonunit定義multiplicative order。"
  },
  "proofs": [],
  "computational_companions": [],
  "verification": {
    "computational_status": "not_evaluated_no_computational_claim",
    "warning_zh": "不推出primitive root或order=phi。",
    "evidence_refs": [],
    "producers": [
      {
        "id": "lean-mathlib",
        "adapter": "formal_system",
        "config_path": "formal/lean/lakefile.toml",
        "status": "configured"
      }
    ]
  },
  "formalization": {
    "status": "not_formalized",
    "target_systems": [
      "Lean 4",
      "Mathlib"
    ],
    "next_obligation_zh": "加入primitive roots與cyclic unit groups。"
  },
  "provenance": {
    "origin": "ocme_local_ai_materialization_candidate",
    "note_zh": "依 research/atlas-multiplicative-order-mod-n.md 整理；2026-10-15 脈衝 R07（使用者手動接續 2026-11-16 工作序列；實際日期仍為 2026-10-15），英文及 Lean 依使用者指示延後。",
    "content_license": "CC-BY-SA-4.0",
    "code_license": "MIT",
    "created_at": "2026-10-15"
  }
}
