Exact expanded PA statement
forall p a. ~(p = 0) -> (exists qr_x_bounded. (exists qr_h_bounded. qr_h_bounded + S qr_x_bounded = p) /\ exists qr_u_bounded qr_v_bounded. qr_x_bounded * qr_x_bounded + p * qr_u_bounded = a + p * qr_v_bounded) \/ ~(exists qr_x_bounded. (exists qr_h_bounded. qr_h_bounded + S qr_x_bounded = p) /\ exists qr_u_bounded qr_v_bounded. qr_x_bounded * qr_x_bounded + p * qr_u_bounded = a + p * qr_v_bounded)Structural proof guide
Generated structural guide
A nonzero modulus admits a finite constructive residue search.
Use the direct prerequisites nonzero_is_succ, quadratic_residue_search_up_to as previously established PA formulas.
The proof proceeds by case analysis (8), 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 hs : exists B. p = S B - 0005
specialize nonzero_is_succ p - 0006
apply nonzero_is_succ - 0007
exact hp - 0008
cases hs - 0009
have hsearch : (exists r. (exists h. h + r = x) /\ exists u v. r * r + p * u = a + p * v) \/ (forall r. (exists h. h + r = x) -> ~(exists u v. r * r + p * u = a + p * v)) - 0010
specialize quadratic_residue_search_up_to x - 0011
specialize quadratic_residue_search_up_to p - 0012
specialize quadratic_residue_search_up_to a - 0013
apply quadratic_residue_search_up_to - 0014
exact hp - 0015
cases hsearch - 0016
left - 0017
cases hsearch_left - 0018
cases hsearch_left_witness - 0019
exists x1 - 0020
split - 0021
cases hsearch_left_witness_left - 0022
exists x2 - 0023
trans S (x2 + x1) - 0024
apply PA4 - 0025
trans S x - 0026
congr - 0027
exact hsearch_left_witness_left_witness - 0028
symm - 0029
exact hs_witness - 0030
exact hsearch_left_witness_right - 0031
right - 0032
intro hbounded - 0033
cases hbounded - 0034
cases hbounded_witness - 0035
specialize hsearch_right x1 - 0036
apply hsearch_right - 0037
cases hbounded_witness_left - 0038
exists x2 - 0039
apply PA2 - 0040
trans x2 + S x1 - 0041
symm - 0042
apply PA4 - 0043
trans p - 0044
exact hbounded_witness_left_witness - 0045
exact hs_witness - 0046
exact hbounded_witness_right