Exact expanded PA statement
forall p a b. ~(p = 0) -> (exists qr_u_dec_yes qr_v_dec_yes. a + p * qr_u_dec_yes = b + p * qr_v_dec_yes) \/ ~(exists qr_u_dec_no qr_v_dec_no. a + p * qr_u_dec_no = b + p * qr_v_dec_no)Structural proof guide
Generated structural guide
Balanced congruence is constructively decidable at nonzero modulus.
Use the direct prerequisites division_remainder_exists, mul_comm, mod_eq_decidable_from_remainders as previously established PA formulas.
The proof proceeds by case analysis (6), intermediate claims (4).
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 b - 0004
intro hp - 0005
have hda : exists qa ra. a = p * qa + ra /\ exists ha. ha + S ra = p - 0006
specialize division_remainder_exists p - 0007
specialize division_remainder_exists a - 0008
apply division_remainder_exists - 0009
exact hp - 0010
cases hda - 0011
cases hda_witness - 0012
cases hda_witness_witness - 0013
have hdb : exists qb rb. b = p * qb + rb /\ exists hb. hb + S rb = p - 0014
specialize division_remainder_exists p - 0015
specialize division_remainder_exists b - 0016
apply division_remainder_exists - 0017
exact hp - 0018
cases hdb - 0019
cases hdb_witness - 0020
cases hdb_witness_witness - 0021
have ha_comm : a = x * p + x1 - 0022
trans p * x + x1 - 0023
exact hda_witness_witness_left - 0024
congr - 0025
apply mul_comm - 0026
refl - 0027
have hb_comm : b = x2 * p + x3 - 0028
trans p * x2 + x3 - 0029
exact hdb_witness_witness_left - 0030
congr - 0031
apply mul_comm - 0032
refl - 0033
specialize mod_eq_decidable_from_remainders p - 0034
specialize mod_eq_decidable_from_remainders a - 0035
specialize mod_eq_decidable_from_remainders b - 0036
specialize mod_eq_decidable_from_remainders x - 0037
specialize mod_eq_decidable_from_remainders x1 - 0038
specialize mod_eq_decidable_from_remainders x2 - 0039
specialize mod_eq_decidable_from_remainders x3 - 0040
apply mod_eq_decidable_from_remainders - 0041
exact ha_comm - 0042
exact hda_witness_witness_right - 0043
exact hb_comm - 0044
exact hdb_witness_witness_right