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.
- 0001
intro p - 0002
intro a - 0003
intro hp - 0004
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))) - 0005
specialize quadratic_residue_bounded_equiv p - 0006
specialize quadratic_residue_bounded_equiv a - 0007
apply quadratic_residue_bounded_equiv - 0008
exact hp - 0009
cases hequiv - 0010
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) - 0011
specialize quadratic_residue_bounded_decidable_nonzero p - 0012
specialize quadratic_residue_bounded_decidable_nonzero a - 0013
apply quadratic_residue_bounded_decidable_nonzero - 0014
exact hp - 0015
cases hdec - 0016
left - 0017
apply hequiv_right - 0018
exact hdec_left - 0019
right - 0020
intro hunbounded - 0021
apply hdec_right - 0022
apply hequiv_left - 0023
exact hunbounded