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_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) -> (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
Every square witness has an equivalent canonical bounded root.
Use the direct prerequisites division_remainder_exists, square_residue_witness, remainder_decomposition_to_mod_eq, mod_eq_symm, mod_eq_trans, mul_comm, zero_add as previously established PA formulas.
The proof proceeds by case analysis (7), intermediate claims (6), certified simplification (1).
Referenced ingredients
Proof neighborhood
Direct dependencies
PA001D division_remainder_exists PA005Q square_residue_witness PA003C remainder_decomposition_to_mod_eq PA003L mod_eq_symm PA0024 mod_eq_trans PA000H mul_comm PA0001 zero_addDirect 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
split - 0005
intro hunbounded - 0006
cases hunbounded - 0007
have hdivision : exists q r. x = p * q + r /\ exists h. h + S r = p - 0008
specialize division_remainder_exists p - 0009
specialize division_remainder_exists x - 0010
apply division_remainder_exists - 0011
exact hp - 0012
cases hdivision - 0013
cases hdivision_witness - 0014
cases hdivision_witness_witness - 0015
have hsquare : exists w. x * x = p * w + x2 * x2 - 0016
specialize square_residue_witness p - 0017
specialize square_residue_witness x - 0018
specialize square_residue_witness x1 - 0019
specialize square_residue_witness x2 - 0020
specialize square_residue_witness 0 - 0021
specialize square_residue_witness (x2 * x2) - 0022
apply square_residue_witness - 0023
exact hdivision_witness_witness_left - 0024
simp - 0025
specialize zero_add (x2 * x2) - 0026
symm - 0027
exact zero_add - 0028
cases hsquare - 0029
have hdecomp : x * x = x3 * p + x2 * x2 - 0030
trans p * x3 + x2 * x2 - 0031
exact hsquare_witness - 0032
congr - 0033
apply mul_comm - 0034
refl - 0035
have hxr : exists u v. x * x + p * u = x2 * x2 + p * v - 0036
specialize remainder_decomposition_to_mod_eq p - 0037
specialize remainder_decomposition_to_mod_eq (x * x) - 0038
specialize remainder_decomposition_to_mod_eq x3 - 0039
specialize remainder_decomposition_to_mod_eq (x2 * x2) - 0040
apply remainder_decomposition_to_mod_eq - 0041
exact hdecomp - 0042
have hrx : exists u v. x2 * x2 + p * u = x * x + p * v - 0043
specialize mod_eq_symm p - 0044
specialize mod_eq_symm (x * x) - 0045
specialize mod_eq_symm (x2 * x2) - 0046
apply mod_eq_symm - 0047
exact hxr - 0048
have hra : exists u v. x2 * x2 + p * u = a + p * v - 0049
specialize mod_eq_trans p - 0050
specialize mod_eq_trans (x2 * x2) - 0051
specialize mod_eq_trans (x * x) - 0052
specialize mod_eq_trans a - 0053
apply mod_eq_trans - 0054
exact hrx - 0055
exact hunbounded_witness - 0056
exists x2 - 0057
split - 0058
exact hdivision_witness_witness_right - 0059
exact hra - 0060
intro hbounded - 0061
cases hbounded - 0062
cases hbounded_witness - 0063
exists x - 0064
exact hbounded_witness_right