PA005S

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.

Exact expanded 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)

Structural proof guide

Generated structural guide

Quadratic residuosity is constructively decidable at nonzero modulus.

Use the direct prerequisites quadratic_residue_bounded_decidable_nonzero, quadratic_residue_bounded_equiv as previously established PA formulas.

The proof proceeds by case analysis (2), intermediate claims (2).

Referenced ingredients

Proof neighborhood

Direct dependencies

Direct dependents

Formal native tactic body

Dependencies are introduced as named hypotheses before line 1. Linked names are exact direct references. This Stable checked-use theorem is independently kernel-checked when replayed.

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.

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 : (((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)))
  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 : (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)
  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 exact command ledger · 23 lines
  1. 0001intro p
  2. 0002intro a
  3. 0003intro hp
  4. 0004have 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 : (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