{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-quadratic-residue-01",
  "mko_id": "mko-quadratic-residue",
  "title": {
    "zh-Hant": "完整模7平方表",
    "en": "The complete nonzero square table modulo 7"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-quadratic-residue-01",
    "source": {
      "mko_id": "mko-quadratic-residue",
      "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
      "sha256": "c93521b58b1876da85beb3308b403a1cd27209001660dfc6c04815276f035e21",
      "english_sha256": "2b942134468bcf2df5c61739cc29561a0f40e3257048b11a8bc08a60de227a4d"
    },
    "mode": "worked_example",
    "audience_prerequisites": [
      "calc"
    ],
    "goal": {
      "zh-Hant": "模7非零平方剩餘為{1,2,4}；−5≡2有根3、4，3無根。",
      "en": "Modulo 7, the nonzero quadratic residues are {1,2,4}; the class of -5 equals the class of 2 and has root classes 3 and 4, while 3 has no square root modulo 7."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "p=7，候選a=−5與3；非零根代表恰為1、2、3、4、5、6。",
          "en": "p=7, candidates a=-5 and 3; nonzero root representatives are exactly 1,2,3,4,5,6."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1"
        ],
        "before_tex": "p=7",
        "after_tex": "7>2,\\quad2\\nmid7,\\quad\\sqrt7<3\\Rightarrow7\\text{ odd prime}",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "平方根以下唯一prime候選2不整除7，認證domain。",
          "en": "The only prime candidate below the square-root bound is 2, which does not divide 7, qualifying the domain."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1"
          ],
          "explanation": {
            "zh-Hant": "不得在合數模數沿用後面的兩根結論。",
            "en": "The two-root conclusion cannot be transferred to composite moduli."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S02",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "a=-5",
        "after_tex": "a\\equiv2\\pmod7,\\quad0<2<7",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "先正規化負數，候選是非零類2。",
          "en": "Normalize the negative integer first to nonzero class 2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "−5不是無效輸入；同餘只改代表不改類。",
            "en": "-5 is valid; normalization changes the representative, not the residue class."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S03",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "x=1,2,3",
        "after_tex": "1^2\\equiv1,\\quad2^2\\equiv4,\\quad3^2\\equiv2\\pmod7",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "平方表前半完整計算為1、4、2。",
          "en": "The first half of the table computes to 1,4,2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "3²=9的餘數是2，不是整數9。",
            "en": "3^2=9 has residue 2, not integer 9."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S04",
        "uses": [
          "G1",
          "S03"
        ],
        "before_tex": "x=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": "後半16、25、36餘數為2、4、1，合成完整六項表。",
          "en": "The remaining squares 16,25,36 have residues 2,4,1, completing all six entries."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S03"
          ],
          "explanation": {
            "zh-Hant": "未列x=0是因目前分類非零平方；零另分支。",
            "en": "Zero is omitted because this is the nonzero-square classification; zero is a separate case."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S05",
        "uses": [
          "G1",
          "S04"
        ],
        "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 N_7=\\{3,5,6\\}",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "去除重複平方值得到全部residues，剩餘非零類便是nonresidues。",
          "en": "Deduplicating square values gives all residues, and the remaining nonzero classes are nonresidues."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S04"
          ],
          "explanation": {
            "zh-Hant": "Q₇不含0，N₇也不含0；兩者只partition非零載體。",
            "en": "Neither Q7 nor N7 contains zero; they partition only the nonzero carrier."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S06",
        "uses": [
          "G1",
          "S02",
          "S05"
        ],
        "before_tex": "a\\equiv2\\pmod7",
        "after_tex": "\\operatorname{roots}(2)=\\{3,4\\},\\quad\\operatorname{roots}(1)=\\{1,6\\},\\quad\\operatorname{roots}(4)=\\{2,5\\}",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "完整表給每個平方類全部兩根，成x與−x配對。",
          "en": "The full table gives both roots of each square class, paired as x and -x."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S02",
            "S05"
          ],
          "explanation": {
            "zh-Hant": "每對不同，因非零x且奇prime7不允許2x=0。",
            "en": "The paired roots are distinct: nonzero x modulo odd prime 7 cannot satisfy 2x=0."
          }
        },
        "leaf_basis": "calc"
      },
      {
        "id": "S07",
        "uses": [
          "G1",
          "S04",
          "S05"
        ],
        "before_tex": "a=3,\\quad3\\notin\\{1,2,4\\}",
        "after_tex": "x^2\\not\\equiv3\\pmod7\\text{ for every }x\\in\\mathbb Z",
        "relation": "implies",
        "rule": "mko_definition",
        "conditions": [],
        "explanation": {
          "zh-Hant": "全部非零根類已列，零平方亦為0非3，所以全整數均無根。",
          "en": "Every nonzero root class is listed, and zero squares to 0, so no integer root exists."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S04",
            "S05"
          ],
          "explanation": {
            "zh-Hant": "無根由完整residue表而非有界整數搜尋推得。",
            "en": "Nonexistence follows from the complete residue table, not a bounded integer search."
          }
        },
        "leaf_basis": "mko_definition"
      },
      {
        "id": "S08",
        "uses": [
          "G1",
          "S01",
          "S06"
        ],
        "before_tex": "p=2\\text{ or }m=8",
        "after_tex": "\\operatorname{roots}_{2}(1)=\\{1\\};\\quad\\operatorname{roots}_{8}(1)=\\{1,3,5,7\\}",
        "relation": "implies",
        "rule": "calc",
        "conditions": [],
        "explanation": {
          "zh-Hant": "偶prime只有一根；合數8有四根，明示odd-prime兩根責任不能偷換。",
          "en": "The even prime has one root, while composite 8 has four, making the odd-prime boundary explicit."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01",
            "S06"
          ],
          "explanation": {
            "zh-Hant": "模8四奇數的平方均1，無其他類；此表不定義Legendre或Euler。",
            "en": "All four odd classes modulo 8 square to 1; this introduces no Legendre symbol or Euler criterion."
          }
        },
        "leaf_basis": "calc"
      }
    ],
    "result": {
      "zh-Hant": "模7非零平方剩餘為{1,2,4}；−5≡2有根3、4，3無根。",
      "en": "Modulo 7, the nonzero quadratic residues are {1,2,4}; the class of -5 equals the class of 2 and has root classes 3 and 4, while 3 has no square root modulo 7."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "0是本節非零平方剩餘。",
          "en": "Zero is a nonzero quadratic residue here."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "0類另列，不在非零集合Q₇。",
          "en": "Zero is separate and outside nonzero Q7."
        }
      },
      {
        "claim": {
          "zh-Hant": "模7的3有根因3²=9。",
          "en": "3 is a square mod 7 because 3^2=9."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "9≡2，不是3；完整表無3。",
          "en": "9 is 2, not 3, modulo 7, and the full table omits 3."
        }
      },
      {
        "claim": {
          "zh-Hant": "模8的1也恰兩根。",
          "en": "1 modulo 8 also has exactly two roots."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "1、3、5、7四根皆成立。",
          "en": "1,3,5,7 are four distinct roots."
        }
      }
    ],
    "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到平方根可判質數。",
          "en": "Assume exact integer arithmetic, division with remainder, and definitions of divisibility and gcd; every congruence has an explicit modulus. Assume complete trial division to the square root decides primality."
        }
      },
      {
        "id": "mko_definition",
        "kind": "cited",
        "statement": {
          "zh-Hant": "奇質數p下，先正規化a；完整枚舉全部非零平方決定非零平方剩餘，零、p=2與合數模數分開。此處不用Euler判準或Legendre符號。",
          "en": "For odd prime p normalize a, then enumerate every nonzero square to decide nonzero quadratic-residue membership. Separate zero, p=2 and composite moduli; no Euler criterion or Legendre symbol is used here."
        },
        "source": {
          "mko_id": "mko-quadratic-residue",
          "sha256": "c93521b58b1876da85beb3308b403a1cd27209001660dfc6c04815276f035e21",
          "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f"
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "square3",
        "lhs": "3**2%7",
        "rhs": "2",
        "step": "S03"
      },
      {
        "id": "square4",
        "lhs": "4**2%7",
        "rhs": "2",
        "step": "S04"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "bounded odd prime7，完整非零平方表；不用Euler或Legendre。",
      "en": "Bounded odd prime 7 with the entire nonzero square table; no Euler criterion or Legendre symbol."
    },
    "md_symbols": [
      [
        "Q_7,N_7",
        "非零平方與非平方類",
        "nonzero square and nonsquare classes"
      ],
      [
        "p",
        "已核odd prime",
        "qualified odd prime"
      ]
    ],
    "md_error_controls": [
      {
        "title": "零類 / Zero class",
        "zh": "候選先normalize，0獨立於非零residue/nonresidue。",
        "en": "Normalize first and handle zero separately from nonzero residue/nonresidue classes."
      },
      {
        "title": "完整根表 / Complete root table",
        "zh": "x=1至6全部列出才可證absence。",
        "en": "List every x from 1 to 6 before asserting absence."
      }
    ],
    "md_open_items": []
  },
  "revision": {
    "id": "ocme-new142-reader-adoption-20261021",
    "collection": "coverage-20261021",
    "source_commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
    "adopted_source_sha256": "384acd699a63eb402427b8835c9873f84548e160871fa06b63517b0138ea17d3",
    "original_source_sha256": "d000894426cdf201a44c3ff9da8d4a815803ac12c4d484007b9cbefb594772c4",
    "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": [],
    "independent_AI_concurrence": "SCOPED_LEAD_AND_BILINGUAL_CONTEXT_REVIEW",
    "issue_ids": [
      "BR142-P056",
      "BR142-P057"
    ],
    "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."
  }
}
