PA005S · theorem

quadratic_residue_decidable_nonzero

Stable checked-use theorem · independently closed

Quadratic residuosity is constructively decidable at nonzero modulus.

Current library: Alpha v34, 4,223 checked-use theorems; Stable remains 432. Historical first admissions, original proof editions, and non-admitted aliases are preserved. Exact original first-admission records.

Statement with defined notation

∀ p. ∀ a. ¬p = 0 → QRes(p,a) ∨ ¬QRes(p,a)

Every purple notation token opens its conservative definition. This is a reading surface; the compiler expands the statement before the unchanged kernel checks it.

Definitions used by this theorem

In the theorem statement

2 occurrences

In local proof propositions

6 occurrences

Exact expanded native-PA statement
forall p a. ~(p = 0) -> (exists qr_x_unbounded. exists qr_u_unbounded qr_v_unbounded. qr_x_unbounded * qr_x_unbounded + p * qr_u_unbounded = a + p * qr_v_unbounded) \/ ~(exists qr_x_unbounded. exists qr_u_unbounded qr_v_unbounded. qr_x_unbounded * qr_x_unbounded + p * qr_u_unbounded = a + p * qr_v_unbounded)

Proof neighborhood

Direct theorem prerequisites

Direct theorem dependents

Definition-aware tactic body

Only local propositions introduced by have or suffices are compacted. The untrusted compiler re-expands each one before the original tactic script is replayed; defined notation is never accepted by the kernel. Open the exact replay line beneath every changed command.

Read the argument

Proof checkpoints

23 script commands · 9 reading checkpoints · 2 local claims

This is a reading aid, not a new proof or a proof-tree certificate. Checkpoint groups are consecutive commands, not inferred branch boundaries. Every step links to the preserved script.

Definition notation is shown below. Open the paired exact edition for the original native formulas. Source pairing is not a new equivalence certificate.

Named ingredients (2)
01Fix variables and assumptionsL1–3

Work with arbitrary variables or the premises of the current implication.

  1. L1
    intro p
  2. L2
    intro a
  3. L3
    intro hp
02Establish hequivL4–8

Establish this local claim before using it. It is not an additional assumption. The following proof commands apply quadratic residue bounded equiv.

  1. L4
    have hequiv : (QRes(p,a) → BoundedQRes(p,a)) ∧ (BoundedQRes(p,a) → QRes(p,a))Definitions: QRes(p,a)BoundedQRes(p,a)Original native command in the exact edition
  2. L5
    specialize quadratic_residue_bounded_equiv p
  3. L6
    specialize quadratic_residue_bounded_equiv a
  4. L7
    apply quadratic_residue_bounded_equiv
  5. L8
    exact hp
03Separate the logical casesL9–9

Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.

  1. L9
    cases hequiv
04Establish hdecL10–14

Establish this local claim before using it. It is not an additional assumption. The following proof commands apply quadratic residue bounded decidable nonzero.

  1. L10
    have hdec : BoundedQRes(p,a) ∨ ¬BoundedQRes(p,a)Definitions: BoundedQRes(p,a)Original native command in the exact edition
  2. L11
    specialize quadratic_residue_bounded_decidable_nonzero p
  3. L12
    specialize quadratic_residue_bounded_decidable_nonzero a
  4. L13
    apply quadratic_residue_bounded_decidable_nonzero
  5. L14
    exact hp
05Separate the logical casesL15–16

Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.

  1. L15
    cases hdec
  2. L16
    left
06Use earlier factsL17–18

Instantiate or apply named facts and discharge the corresponding proof obligations.

  1. L17
    apply hequiv_right
  2. L18
    exact hdec_left
07Separate the logical casesL19–19

Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.

  1. L19
    right
08Fix variables and assumptionsL20–20

Work with arbitrary variables or the premises of the current implication.

  1. L20
    intro hunbounded
09Use earlier factsL21–23

Instantiate or apply named facts and discharge the corresponding proof obligations.

  1. L21
    apply hdec_right
  2. L22
    apply hequiv_left
  3. L23
    exact hunbounded

Library-wide reading audit

Original defined command ledger · 23 lines
  1. 0001intro p
  2. 0002intro a
  3. 0003intro hp
  4. 0004have hequiv : (QRes(p,a)BoundedQRes(p,a)) ∧ (BoundedQRes(p,a)QRes(p,a))
    Exact native replay linehave hequiv : (((exists x. exists u v. x * x + p * u = a + p * v) -> (exists r. (exists h. h + S r = p) /\ exists u v. r * r + p * u = a + p * v)) /\ ((exists r. (exists h. h + S r = p) /\ exists u v. r * r + p * u = a + p * v) -> (exists x. exists u v. x * x + p * u = a + p * v)))
  5. 0005specialize quadratic_residue_bounded_equiv p
  6. 0006specialize quadratic_residue_bounded_equiv a
  7. 0007apply quadratic_residue_bounded_equiv
  8. 0008exact hp
  9. 0009cases hequiv
  10. 0010have hdec : BoundedQRes(p,a) ∨ ¬BoundedQRes(p,a)
    Exact native replay linehave hdec : (exists r. (exists h. h + S r = p) /\ exists u v. r * r + p * u = a + p * v) \/ ~(exists r. (exists h. h + S r = p) /\ exists u v. r * r + p * u = a + p * v)
  11. 0011specialize quadratic_residue_bounded_decidable_nonzero p
  12. 0012specialize quadratic_residue_bounded_decidable_nonzero a
  13. 0013apply quadratic_residue_bounded_decidable_nonzero
  14. 0014exact hp
  15. 0015cases hdec
  16. 0016left
  17. 0017apply hequiv_right
  18. 0018exact hdec_left
  19. 0019right
  20. 0020intro hunbounded
  21. 0021apply hdec_right
  22. 0022apply hequiv_left
  23. 0023exact hunbounded