{
  "$schema": "../../../schemas/mko-v0.5.schema.json",
  "schema_version": "mko-v0.5",
  "id": "mko-fermat-little-theorem",
  "semantic_family_id": "sf-fermat-little-theorem",
  "type": "theorem",
  "version": "0.10.0",
  "language": "zh-Hant",
  "titles": {
    "zh-Hant": "Fermat小定理"
  },
  "summary": {
    "zh-Hant": "p為質數時a^p同餘a；若p不整除a則可化為a^(p-1)同餘1，逆命題不成立。"
  },
  "statement": {
    "zh-Hant": "模數p須明示為prime且p>=2。coprime版本僅在p不整除a時使用；p整除a仍可用all-integer版本但不得消去a。exact modular exponentiation正規化負底數，並以561等合數邊界展示Fermat test converse失敗。"
  },
  "formula": {
    "tex": "a^p\\equiv a\\pmod{p}",
    "mathml": "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mrow><msup><mi>a</mi><mi>p</mi></msup><mo>≡</mo><mi>a</mi><mo>(</mo><mi mathvariant=\"normal\">mod</mi><mi>p</mi><mo>)</mo></mrow></math>",
    "semantic_ast": {
      "type": "congruence",
      "lhs": {
        "type": "power",
        "base": {
          "type": "symbol",
          "name": "a",
          "glyph": "a"
        },
        "exponent": {
          "type": "symbol",
          "name": "p",
          "glyph": "p"
        }
      },
      "rhs": {
        "type": "symbol",
        "name": "a",
        "glyph": "a"
      },
      "modulus": {
        "type": "symbol",
        "name": "p",
        "glyph": "p"
      }
    },
    "compiler": {
      "id": "ocme-formula-source13",
      "version": "0.5.0",
      "source_sha256": "4f62287849e3e47b937683ab763a51798d505dfae2064cb55c7e5f073ec32486"
    }
  },
  "assumptions": [
    {
      "id": "a1",
      "zh-Hant": "定理題的modulus經exact primality核對。"
    },
    {
      "id": "a2",
      "zh-Hant": "所有modular powers用整數平方乘法，不展開成浮點冪。"
    }
  ],
  "symbols": [
    {
      "token": "p",
      "role": "prime_modulus",
      "role_zh": "質數模數",
      "scope": "representative_formula"
    },
    {
      "token": "a",
      "role": "integer_base",
      "role_zh": "整數底數",
      "scope": "representative_formula"
    }
  ],
  "dependencies": [
    {
      "id": "mko-prime-number",
      "title_zh": "自然數質數",
      "reason_zh": "prime hypothesis。"
    },
    {
      "id": "mko-modular-congruence",
      "title_zh": "自然數模同餘",
      "reason_zh": "結論語義。"
    },
    {
      "id": "mko-power-root",
      "title_zh": "自然數冪與主平方根",
      "reason_zh": "整數冪。"
    }
  ],
  "explanation": {
    "paragraphs_zh": [
      "coprime form與all-integer form的假設不同。",
      "不可在a不可逆時消去a。",
      "通過Fermat test不證modulus為prime。",
      "記號對齊候選：a^p 與 a 的差可被質數 p 整除；這是模 p 同餘，不是整數恆等式。含 p 整除 a 的情況，不附加不必要的互質限制；合數通過測試仍不證質數。"
    ],
    "common_misconception_zh": "由a^(n-1)同餘1直接判n為質數，或在n整除a時套coprime版本。"
  },
  "proofs": [],
  "computational_companions": [],
  "verification": {
    "computational_status": "not_evaluated_no_computational_claim",
    "warning_zh": "本輪只核Fermat congruences；不把它當確定性primality test。",
    "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": "加入Euler theorem、Carmichael function與Miller-Rabin。"
  },
  "provenance": {
    "origin": "ocme_local_ai_materialization_candidate",
    "note_zh": "依 research/atlas-fermat-little-theorem.md 整理；2026-10-14 脈衝 R05（使用者手動接續 2026-11-06 工作序列；實際日期仍為 2026-10-14），英文及 Lean 依使用者指示延後。",
    "content_license": "CC-BY-SA-4.0",
    "code_license": "MIT",
    "created_at": "2026-10-14"
  }
}
