# The complete nonzero square table modulo 7

[← Guide index](https://ocme.evemisslab.com/en/derivations/) · [Original MKO](https://ocme.evemisslab.com/en/mko/mko-quadratic-residue/)

This is an owner-adopted natural-language teaching guide. Finite/arithmetic checks are not universal proofs; no Lean was run, and review scope is recorded per revision. Original source status labels are retained as historical data. Formulas retain exact TeX; no new semantic AST is invented.

derivation-mko-quadratic-residue-01 · ocme-new142-reader-adoption-20261021



## Goal and scope

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.

Bounded odd prime 7 with the entire nonzero square table; no Euler criterion or Legendre symbol.





## Givens and symbols


- calc


- G1 — p=7, candidates a=-5 and 3; nonzero root representatives are exactly 1,2,3,4,5,6.


- Q_7,N_7 — nonzero square and nonsquare classes
- p — qualified odd prime





## Rules and sources


- calc · prerequisite — 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.
- mko_definition · cited — 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. · mko-quadratic-residue





## Main derivation

S01 · impliesBefore

p=7

After

7>2,\quad2\nmid7,\quad\sqrt7<3\Rightarrow7\text{ odd prime}

Conditions: none

Rule: calc · Uses: G1

Leaf basis: calc

The only prime candidate below the square-root bound is 2, which does not divide 7, qualifying the domain.



S02 · impliesBefore

a=-5

After

a\equiv2\pmod7,\quad0<2<7

Conditions: none

Rule: calc · Uses: G1, S01

Leaf basis: calc

Normalize the negative integer first to nonzero class 2.



S03 · impliesBefore

x=1,2,3

After

1^2\equiv1,\quad2^2\equiv4,\quad3^2\equiv2\pmod7

Conditions: none

Rule: calc · Uses: G1, S01

Leaf basis: calc

The first half of the table computes to 1,4,2.



S04 · impliesBefore

x=4,5,6

After

\begin{array}{c|rrrrrr}x&1&2&3&4&5&6\\\hline x^2\bmod7&1&4&2&2&4&1\end{array}

Conditions: none

Rule: calc · Uses: G1, S03

Leaf basis: calc

The remaining squares 16,25,36 have residues 2,4,1, completing all six entries.



S05 · impliesBefore

\begin{array}{c|rrrrrr}x&1&2&3&4&5&6\\\hline x^2\bmod7&1&4&2&2&4&1\end{array}

After

Q_7=\{1,2,4\},\quad N_7=\{3,5,6\}

Conditions: none

Rule: calc · Uses: G1, S04

Leaf basis: calc

Deduplicating square values gives all residues, and the remaining nonzero classes are nonresidues.



S06 · impliesBefore

a\equiv2\pmod7

After

\operatorname{roots}(2)=\{3,4\},\quad\operatorname{roots}(1)=\{1,6\},\quad\operatorname{roots}(4)=\{2,5\}

Conditions: none

Rule: calc · Uses: G1, S02, S05

Leaf basis: calc

The full table gives both roots of each square class, paired as x and -x.



S07 · impliesBefore

a=3,\quad3\notin\{1,2,4\}

After

x^2\not\equiv3\pmod7\text{ for every }x\in\mathbb Z

Conditions: none

Rule: mko_definition · Uses: G1, S04, S05

Leaf basis: mko_definition

Every nonzero root class is listed, and zero squares to 0, so no integer root exists.



S08 · impliesBefore

p=2\text{ or }m=8

After

\operatorname{roots}_{2}(1)=\{1\};\quad\operatorname{roots}_{8}(1)=\{1,3,5,7\}

Conditions: none

Rule: calc · Uses: G1, S01, S06

Leaf basis: calc

The even prime has one root, while composite 8 has four, making the odd-prime boundary explicit.







## Substeps and lemmas

No substeps in this guide.





## Reverse audits


- S08 · premise_audit · G1, S01, S06 — All four odd classes modulo 8 square to 1; this introduces no Legendre symbol or Euler criterion.
- S07 · premise_audit · G1, S04, S05 — Nonexistence follows from the complete residue table, not a bounded integer search.
- S06 · premise_audit · G1, S02, S05 — The paired roots are distinct: nonzero x modulo odd prime 7 cannot satisfy 2x=0.
- S05 · premise_audit · G1, S04 — Neither Q7 nor N7 contains zero; they partition only the nonzero carrier.
- S04 · premise_audit · G1, S03 — Zero is omitted because this is the nonzero-square classification; zero is a separate case.
- S03 · premise_audit · G1, S01 — 3^2=9 has residue 2, not integer 9.
- S02 · premise_audit · G1, S01 — -5 is valid; normalization changes the representative, not the residue class.
- S01 · premise_audit · G1 — The two-root conclusion cannot be transferred to composite moduli.





## Error controls and negative controls

Zero classNormalize first and handle zero separately from nonzero residue/nonresidue classes.

Complete root tableList every x from 1 to 6 before asserting absence.


- Zero is a nonzero quadratic residue here. → reject — Zero is separate and outside nonzero Q7.
- 3 is a square mod 7 because 3^2=9. → reject — 9 is 2, not 3, modulo 7, and the full table omits 3.
- 1 modulo 8 also has exactly two roots. → reject — 1,3,5,7 are four distinct roots.





## Result and limitations

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.







## Verification and source binding

2 declared checks for this guide; only the listed expressions are covered.


- source commit: b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f
- adopted source SHA-256: 384acd699a63eb402427b8835c9873f84548e160871fa06b63517b0138ea17d3
- original source SHA-256: d000894426cdf201a44c3ff9da8d4a815803ac12c4d484007b9cbefb594772c4
- Lean: NOT_RUN · independent AI: SCOPED_LEAD_AND_BILINGUAL_CONTEXT_REVIEW

[Same-source full JSON (formulas, ASTs, controls and revision log)](https://ocme.evemisslab.com/data/derivations/coverage-20261021/guides/derivation-mko-quadratic-residue-01.json)




