{
  "$schema": "../../../schemas/mko-v0.4.schema.json",
  "schema_version": "mko-v0.4",
  "id": "mko-legendre-symbol",
  "semantic_family_id": "sf-legendre-symbol",
  "type": "definition",
  "version": "0.10.0",
  "language": "zh-Hant",
  "titles": {
    "zh-Hant": "Legendre符號"
  },
  "summary": {
    "zh-Hant": "對奇質數p，Legendre符號以0、1、-1分別編碼zero class、nonzero quadratic residue與nonresidue。"
  },
  "statement": {
    "zh-Hant": "先把a normalize modulo odd prime p。若p|a則(a/p)=0；若a是nonzero quadratic residue則為1；否則為-1。Classification由完整nonzero square table或root witness取得，不提前使用Euler criterion。p=2與composite modulus不在本節點domain；少量multiplicativity samples也不構成一般證明。"
  },
  "formula": {
    "tex": "L(a,p)=s",
    "mathml": "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mrow><mrow><mi>L</mi><mo>(</mo><mi>a</mi><mo>,</mo><mi>p</mi><mo>)</mo></mrow><mo>=</mo><mi>s</mi></mrow></math>",
    "semantic_ast": {
      "type": "equation",
      "lhs": {
        "type": "function_call",
        "callee": {
          "type": "symbol",
          "name": "L",
          "glyph": "L"
        },
        "arguments": [
          {
            "type": "symbol",
            "name": "a",
            "glyph": "a"
          },
          {
            "type": "symbol",
            "name": "p",
            "glyph": "p"
          }
        ]
      },
      "rhs": {
        "type": "symbol",
        "name": "s",
        "glyph": "s"
      }
    },
    "compiler": {
      "id": "ocme-formula-core",
      "version": "0.4.0",
      "source_sha256": "9766fb46de6880276ebeafc22eb5445c49cfa7d3c061ec7ab2bfec7a96a87bc5"
    }
  },
  "assumptions": [
    {
      "id": "a1",
      "zh-Hant": "正向families對bounded odd prime完整枚舉1,...,p-1的squares。"
    },
    {
      "id": "a2",
      "zh-Hant": "zero class獨立輸出0；residue/nonresidue只在normalized nonzero class中判定。"
    }
  ],
  "symbols": [
    {
      "token": "L",
      "role": "legendre_symbol",
      "role_zh": "Legendre符號",
      "scope": "representative_formula"
    },
    {
      "token": "a",
      "role": "integer_argument",
      "role_zh": "整數參數",
      "scope": "representative_formula"
    },
    {
      "token": "p",
      "role": "odd_prime_modulus",
      "role_zh": "奇質數模數",
      "scope": "representative_formula"
    },
    {
      "token": "s",
      "role": "three_valued_classification",
      "role_zh": "0或正負1分類",
      "scope": "representative_formula"
    }
  ],
  "dependencies": [
    {
      "id": "mko-quadratic-residue",
      "title_zh": "二次剩餘",
      "reason_zh": "nonzero square classification。"
    },
    {
      "id": "mko-function-mapping",
      "title_zh": "函數映射",
      "reason_zh": "固定p下的三值函數。"
    }
  ],
  "explanation": {
    "paragraphs_zh": [
      "normalize後zero class優先於residue分類。",
      "complete square table可同時給root witness與nonresidue absence certificate。",
      "Euler criterion屬後續定理，不得循環用來定義本符號。"
    ],
    "common_misconception_zh": "把zero class標成1、對composite modulus沿用Legendre notation，或以Euler criterion預先證自身定義。"
  },
  "proofs": [],
  "computational_companions": [],
  "verification": {
    "computational_status": "not_evaluated_no_computational_claim",
    "warning_zh": "本輪不使用Euler criterion，也不將Legendre符號擴張為Jacobi符號。",
    "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二次剩餘判準。"
  },
  "provenance": {
    "origin": "ocme_local_ai_materialization_candidate",
    "note_zh": "依 research/atlas-legendre-symbol.md 整理；2026-10-14 脈衝 R06（使用者手動接續 2026-11-12 工作序列；實際日期仍為 2026-10-14），英文及 Lean 依使用者指示延後。",
    "content_license": "CC-BY-SA-4.0",
    "code_license": "MIT",
    "created_at": "2026-10-14"
  }
}
