Exact expanded PA statement
forall p h n q r m s. p = 2 * h + 1 -> n = p * q + r -> (exists gsp_lt_gap_gsd_r_below_p. gsp_lt_gap_gsd_r_below_p + S r = p) -> (exists gsp_lt_gap_gsd_m_positive. gsp_lt_gap_gsd_m_positive + S 0 = m) -> (exists gsp_le_gap_gsd_m_le_h. gsp_le_gap_gsd_m_le_h + m = h) -> (((s = 0 /\ (exists wpp_mod_left_gsd_n_mod_m wpp_mod_right_gsd_n_mod_m. (n) + p * wpp_mod_left_gsd_n_mod_m = (m) + p * wpp_mod_right_gsd_n_mod_m)) \/ (s = 1 /\ (exists wpp_mod_left_gsd_n_mod_reflected wpp_mod_right_gsd_n_mod_reflected. (n) + p * wpp_mod_left_gsd_n_mod_reflected = ((2 * h) * m) + p * wpp_mod_right_gsd_n_mod_reflected)))) -> (((s = 0 /\ r = m) \/ (s = 1 /\ r + m = p)))Structural proof guide
Generated structural guide
A Gauss signed congruence determines the exact canonical lower/reflected remainder branch.
Use the direct prerequisites odd_half_strictly_below_modulus, lt_of_le_of_lt, odd_half_positive_complement_exists, predecessor_multiple_mod_complement, canonical_remainder_from_mod, mod_eq_trans as previously established PA formulas.
The proof proceeds by case analysis (5), intermediate claims (7), certified simplification (1).
Referenced ingredients
Proof neighborhood
Direct dependencies
PA00C2 odd_half_strictly_below_modulus PA0033 lt_of_le_of_lt PA00C3 odd_half_positive_complement_exists PA00C4 predecessor_multiple_mod_complement PA00C5 canonical_remainder_from_mod PA0024 mod_eq_transDirect dependents
Formal native tactic body
Dependencies are introduced as named hypotheses before line 1. Linked names are exact direct references. This Alpha-v16 checked-use theorem is independently kernel-checked when replayed; it is not a Stable theorem.
- 0001
intro p - 0002
intro h - 0003
intro n - 0004
intro q - 0005
intro r - 0006
intro m - 0007
intro s - 0008
intro hp - 0009
intro hdivision - 0010
intro hrbelow - 0011
intro hmpositive - 0012
intro hmle - 0013
intro hsigned - 0014
have hhalfbelow : exists d. d + S h = p - 0015
specialize odd_half_strictly_below_modulus p - 0016
specialize odd_half_strictly_below_modulus h - 0017
apply odd_half_strictly_below_modulus - 0018
exact hp - 0019
have hmbelow : exists gsp_lt_gap_gsd_m_below_p. gsp_lt_gap_gsd_m_below_p + S m = p - 0020
specialize lt_of_le_of_lt m - 0021
specialize lt_of_le_of_lt h - 0022
specialize lt_of_le_of_lt p - 0023
apply lt_of_le_of_lt - 0024
exact hmle - 0025
exact hhalfbelow - 0026
cases hsigned - 0027
cases hsigned_left - 0028
left - 0029
split - 0030
exact hsigned_left_left - 0031
specialize canonical_remainder_from_mod p - 0032
specialize canonical_remainder_from_mod n - 0033
specialize canonical_remainder_from_mod q - 0034
specialize canonical_remainder_from_mod r - 0035
specialize canonical_remainder_from_mod m - 0036
apply canonical_remainder_from_mod - 0037
exact hdivision - 0038
exact hrbelow - 0039
exact hmbelow - 0040
exact hsigned_left_right - 0041
cases hsigned_right - 0042
have hcomplement : exists t. (exists gsp_lt_gap_gsd_t_below_p. gsp_lt_gap_gsd_t_below_p + S t = p) /\ t + m = p - 0043
specialize odd_half_positive_complement_exists p - 0044
specialize odd_half_positive_complement_exists h - 0045
specialize odd_half_positive_complement_exists m - 0046
apply odd_half_positive_complement_exists - 0047
exact hp - 0048
exact hmpositive - 0049
exact hmle - 0050
cases hcomplement - 0051
cases hcomplement_witness - 0052
have hpsucc : p = S (2 * h) - 0053
trans 2 * h + 1 - 0054
exact hp - 0055
simp - 0056
have hkmodt : exists wpp_mod_left_gsd_local_predecessor_mod wpp_mod_right_gsd_local_predecessor_mod. ((2 * h) * m) + p * wpp_mod_left_gsd_local_predecessor_mod = (x) + p * wpp_mod_right_gsd_local_predecessor_mod - 0057
specialize predecessor_multiple_mod_complement p - 0058
specialize predecessor_multiple_mod_complement (2 * h) - 0059
specialize predecessor_multiple_mod_complement m - 0060
specialize predecessor_multiple_mod_complement x - 0061
apply predecessor_multiple_mod_complement - 0062
exact hpsucc - 0063
exact hcomplement_witness_right - 0064
have hnlocalt : exists wpp_mod_left_gsd_local_n_mod_t wpp_mod_right_gsd_local_n_mod_t. (n) + p * wpp_mod_left_gsd_local_n_mod_t = (x) + p * wpp_mod_right_gsd_local_n_mod_t - 0065
specialize mod_eq_trans p - 0066
specialize mod_eq_trans n - 0067
specialize mod_eq_trans ((2 * h) * m) - 0068
specialize mod_eq_trans x - 0069
apply mod_eq_trans - 0070
exact hsigned_right_right - 0071
exact hkmodt - 0072
have hrt : r = x - 0073
specialize canonical_remainder_from_mod p - 0074
specialize canonical_remainder_from_mod n - 0075
specialize canonical_remainder_from_mod q - 0076
specialize canonical_remainder_from_mod r - 0077
specialize canonical_remainder_from_mod x - 0078
apply canonical_remainder_from_mod - 0079
exact hdivision - 0080
exact hrbelow - 0081
exact hcomplement_witness_left - 0082
exact hnlocalt - 0083
right - 0084
split - 0085
exact hsigned_right_left - 0086
trans x + m - 0087
congr - 0088
exact hrt - 0089
refl - 0090
exact hcomplement_witness_right