{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-euler-criterion-quadratic-residue-01",
  "mko_id": "mko-euler-criterion-quadratic-residue",
  "title": {
    "zh-Hant": "兩條獨立路徑核Euler判準",
    "en": "Two independent routes for Euler's criterion"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-euler-criterion-quadratic-residue-01",
    "source": {
      "mko_id": "mko-euler-criterion-quadratic-residue",
      "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
      "sha256": "da968b0cd6fc238e595782d4d9588d4c8089b176b4d05fc3d1c01eccdb99ce68",
      "english_sha256": "6a1e1a855e1affb5b9eb585fa4ab2173f81281b4327bc8b562d2b308ee6bc99c"
    },
    "mode": "worked_example",
    "audience_prerequisites": [
      "calc"
    ],
    "goal": {
      "zh-Hant": "p=7,a=−4時Legendre值−1且a³≡6≡−1 mod7；2則給+1。",
      "en": "For p=7,a=-4 the Legendre value is -1 and a^3=6=-1 mod 7; 2 gives +1."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "p=7，a=−4；先規範a≡3 mod7，再獨立計Legendre值與a^{(p−1)/2}。",
          "en": "p=7,a=-4; normalize to 3 modulo 7, then independently compute the Legendre value and a^((p-1)/2)."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1"
        ],
        "before_tex": "p=7,\\quad a=-4",
        "after_tex": "7\\text{ odd prime},\\quad a\\equiv3\\ne0\\pmod7,\\quad(p-1)/2=3",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "2不整除7且3²>7，prime domain通過；指數3為整數。",
          "en": "2 does not divide 7 and 3^2>7, qualifying the odd-prime domain; the exponent is integer 3."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1"
          ],
          "explanation": {
            "zh-Hant": "zero類不在本定理domain，不可只看prime條件。",
            "en": "The zero class is outside the theorem domain; primality alone is insufficient."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S02",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "x=1,2,3,4,5,6",
        "after_tex": "\\begin{array}{c|rrrrrr}x&1&2&3&4&5&6\\\\\\hline x^2\\bmod7&1&4&2&2&4&1\\end{array}",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "全部非零平方直接由六次乘法取得，完全不用half-power公式。",
          "en": "All nonzero squares are obtained directly from six multiplications, without any half-power formula."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "這條路徑提供獨立Legendre分類基礎。",
            "en": "This route independently establishes the Legendre classification."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S03",
        "uses": [
          "G1",
          "S02"
        ],
        "before_tex": "\\begin{array}{c|rrrrrr}x&1&2&3&4&5&6\\\\\\hline x^2\\bmod7&1&4&2&2&4&1\\end{array}",
        "after_tex": "Q_7=\\{1,2,4\\},\\quad(3/7)=-1,\\quad(2/7)=1",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "3不在完整平方值中，2有根3；因此兩個符號獨立定義。",
          "en": "3 is absent from the full square values while 2 has root 3, independently defining both symbols."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S02"
          ],
          "explanation": {
            "zh-Hant": "沒有從a³結果反過來定義符號。",
            "en": "The symbol is not defined backward from the a^3 result."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S04",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "a\\equiv3\\pmod7",
        "after_tex": "3^2=9\\equiv2\\pmod7",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "模冪路徑先平方base，僅用整數取餘。",
          "en": "The power route first squares the base using exact integer remainders only."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "此計算未讀Q₇分類，與平方根表的用途不同。",
            "en": "This calculation does not use Q7 membership and has a different role from the root table."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S05",
        "uses": [
          "G1",
          "S04"
        ],
        "before_tex": "3^2\\equiv2\\pmod7",
        "after_tex": "3^3\\equiv2\\cdot3=6\\equiv-1\\pmod7",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "再乘一次base得到half-power6，正規化餘數6對應signed−1。",
          "en": "One further multiplication gives half-power residue 6, interpreted as signed -1."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S04"
          ],
          "explanation": {
            "zh-Hant": "不能把餘數6當Legendre的第4種值；符號值仍是−1。",
            "en": "Residue 6 is not a fourth Legendre value; the signed value remains -1."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S06",
        "uses": [
          "G1",
          "S01",
          "S03",
          "S05"
        ],
        "before_tex": "(a/7)=-1,\\quad a^3\\equiv6\\pmod7",
        "after_tex": "a^{(7-1)/2}\\equiv(a/7)\\pmod7",
        "relation": "implies",
        "rule": "mko_definition",
        "conditions": [],
        "explanation": {
          "zh-Hant": "兩條獨立證書在同一a、p上相符，核此nonresidue實例。",
          "en": "The independent certificates agree for the same a,p, verifying this nonsquare instance."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01",
            "S03",
            "S05"
          ],
          "explanation": {
            "zh-Hant": "必保留模7：整數6不等於−1，只有同餘。",
            "en": "Retain modulo 7: integers 6 and -1 are unequal but congruent."
          }
        },
        "leaf_basis": "mko_definition"
      },
      {
        "id": "S07",
        "uses": [
          "G1",
          "S03"
        ],
        "before_tex": "b=2,\\quad(2/7)=1",
        "after_tex": "2^2\\equiv4,\\quad2^3\\equiv4\\cdot2\\equiv1\\pmod7",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "獨立模冪也核residue分支+1，而非只測一種符號。",
          "en": "Independent powers also check the residue branch +1 rather than only one sign."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S03"
          ],
          "explanation": {
            "zh-Hant": "root witness3²≡2來自S02，非從本冪結果推出。",
            "en": "The root witness 3^2=2 comes from S02, not inferred from this power result."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S08",
        "uses": [
          "G1",
          "S02",
          "S03",
          "S04",
          "S05",
          "S07"
        ],
        "before_tex": "a=1,2,3,4,5,6",
        "after_tex": "a^3\\bmod7=1,1,6,1,6,6;\\quad(a/7)=1,1,-1,1,-1,-1",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "逐個平方再乘base得到完整六項對照表，核指定prime7全部非零類。",
          "en": "Squaring then multiplying each base gives the complete six-entry comparison, checking all nonzero classes for prime 7."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S02",
            "S03",
            "S04",
            "S05",
            "S07"
          ],
          "explanation": {
            "zh-Hant": "完整表仍只涵蓋p=7，不證所有奇prime的抽象定理。",
            "en": "Even a complete table covers p=7 only, not the theorem for every odd prime."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S09",
        "uses": [
          "G1",
          "S01",
          "S06",
          "S08"
        ],
        "before_tex": "a\\equiv0\\pmod7\\text{ or }p=2\\text{ or }p\\text{ composite}",
        "after_tex": "\\text{outside this criterion's qualified domain}",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "三個界線先擋住；例如zero的half-power0不是+1或−1。",
          "en": "Keep all three boundaries outside this criterion; the zero half-power is 0, not +1 or -1."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01",
            "S06",
            "S08"
          ],
          "explanation": {
            "zh-Hant": "未擴張成Jacobi、quadratic reciprocity或合數平方根算法。",
            "en": "No Jacobi symbol, reciprocity or composite square-root algorithm is inferred."
          }
        },
        "leaf_basis": "calc"
      }
    ],
    "result": {
      "zh-Hant": "p=7,a=−4時Legendre值−1且a³≡6≡−1 mod7；2則給+1。",
      "en": "For p=7,a=-4 the Legendre value is -1 and a^3=6=-1 mod 7; 2 gives +1."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "模7的zero類應輸出+1。",
          "en": "The zero class modulo 7 should give +1."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "0³=0且本判準要求非零。",
          "en": "0^3=0 and this criterion requires nonzero input."
        }
      },
      {
        "claim": {
          "zh-Hant": "Legendre值就是整數6。",
          "en": "The Legendre value is integer 6."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "6是−1的mod7代表，符號值是−1。",
          "en": "6 represents -1 modulo 7; the symbol value is -1."
        }
      },
      {
        "claim": {
          "zh-Hant": "這個有限表證所有odd primes。",
          "en": "This finite table proves the theorem for all odd primes."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "表格只含p=7，各prime尚有獨立全稱責任。",
          "en": "The table contains only p=7 and does not cover all primes."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "calc",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "假設精確整數算術、帶餘除法、整除與gcd的定義；同餘等式始終綁定明示模數。假設平方根trial division的prime判準；Legendre三值依zero及完整nonzero square table定義。",
          "en": "Assume exact integer arithmetic, division with remainder, and definitions of divisibility and gcd; every congruence has an explicit modulus. Assume the square-root trial-division primality criterion; define Legendre values by zero and the complete nonzero square table."
        }
      },
      {
        "id": "mko_definition",
        "kind": "cited",
        "statement": {
          "zh-Hant": "domain先要求odd prime p及a mod p非零。Legendre值必須由完整nonzero square table獨立重算；modular exponent以repeated squaring獨立計算，再把p-1解讀為-1。residue case輸出+1，nonresidue輸出-1。完整有限square table只核指定p與a，不能取代全體奇質數上的一般定理證明。p=2、composite modulus與a≡0 mod p不屬本定理domain；不得反過來用Euler criterion定義Legendre symbol，composite modulus也無此一般converse。",
          "en": "Require odd primality and a normalized nonzero class first. Compute the Legendre value independently from the complete nonzero square table, and the modular half power by repeated squaring; interpret p−1 as signed−1. Residues give +1 and nonresidues−1. A finite table checks its specific p,a, not the theorem for every odd prime. Modulus2, composite moduli and the zero class are outside this node domain. Do not circularly define Legendre by this criterion or infer a general composite-modulus converse."
        },
        "source": {
          "mko_id": "mko-euler-criterion-quadratic-residue",
          "sha256": "da968b0cd6fc238e595782d4d9588d4c8089b176b4d05fc3d1c01eccdb99ce68",
          "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f"
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "negative_base",
        "lhs": "(-4)%7",
        "rhs": "3",
        "step": "S01"
      },
      {
        "id": "half_power",
        "lhs": "3**3%7",
        "rhs": "6",
        "step": "S05"
      },
      {
        "id": "residue_power",
        "lhs": "2**3%7",
        "rhs": "1",
        "step": "S07"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "完整square-table與獨立repeated-squaring路徑，只認證p=7實例。",
      "en": "A complete square table and independent repeated-squaring route, certifying p=7 instances only."
    },
    "md_symbols": [
      [
        "Q_7",
        "完整nonzero squares",
        "complete nonzero squares"
      ],
      [
        "(a/7)",
        "signed Legendre值",
        "signed Legendre value"
      ]
    ],
    "md_error_controls": [
      {
        "title": "兩路徑 / Two routes",
        "zh": "先從完整squares定Legendre，另以平方乘法計half-power。",
        "en": "Define Legendre from all squares, then compute the half-power independently."
      },
      {
        "title": "符號與residue / Sign and residue",
        "zh": "mod7的6對signed−1，不是整數相等。",
        "en": "Residue 6 modulo 7 corresponds to signed -1, not integer equality."
      }
    ],
    "md_open_items": []
  },
  "revision": {
    "id": "ocme-new142-reader-adoption-20261021",
    "collection": "coverage-20261021",
    "source_commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
    "adopted_source_sha256": "bfc2a00296ec4845bb2bac52d8d35b1658baa23430ee96f708f9268d434e17b8",
    "original_source_sha256": "2f805577c16cb2f7cbc2ff07f2140cb59c25f78198341aa58674efdb3cd73780",
    "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-S191"
    ],
    "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."
  }
}
