Exact expanded PA statement
forall p n i. p = S n -> ((~(p = 1) /\ forall wip_prime_left_exists_prime wip_prime_right_exists_prime. p = wip_prime_left_exists_prime * wip_prime_right_exists_prime -> wip_prime_left_exists_prime = 1 \/ wip_prime_right_exists_prime = 1)) -> (exists wip_strict_gap_exists_index_bound. wip_strict_gap_exists_index_bound + S i = n) -> exists j. (((exists wip_strict_gap_exists_result_left_bound. wip_strict_gap_exists_result_left_bound + S i = n) /\ ((exists wip_strict_gap_exists_result_right_bound. wip_strict_gap_exists_result_right_bound + S j = n) /\ (exists wip_mod_left_exists_result_inverse wip_mod_right_exists_result_inverse. (S i) * S j + p * wip_mod_left_exists_result_inverse = 1 + p * wip_mod_right_exists_result_inverse))))Structural proof guide
Generated structural guide
Every nonzero prime residue index has a bounded inverse index.
Use the direct prerequisites succ_ne_zero, succ_le_succ, prime_bounded_nonzero_mod_inverse, nonzero_is_succ, le_of_succ_le_succ as previously established PA formulas.
The proof proceeds by case analysis (4), intermediate claims (5), equality transport (4).
Referenced ingredients
Proof neighborhood
Direct dependencies
PA0005 succ_ne_zero PA002K succ_le_succ PA0063 prime_bounded_nonzero_mod_inverse PA001V nonzero_is_succ PA000V le_of_succ_le_succDirect 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 n - 0003
intro i - 0004
intro hpn - 0005
intro hp - 0006
intro hi - 0007
have hsi0 : ~(S i = 0) - 0008
specialize succ_ne_zero i - 0009
exact succ_ne_zero - 0010
have hsip : exists wip_successor_gap_exists_residue_bound. wip_successor_gap_exists_residue_bound + S (S i) = p - 0011
rewrite hpn - 0012
specialize succ_le_succ (S i) - 0013
specialize succ_le_succ n - 0014
apply succ_le_succ - 0015
exact hi - 0016
have hinv : exists wip_inverse_exists_raw. (~(wip_inverse_exists_raw = 0) /\ ((exists wip_strict_gap_exists_raw_bound. wip_strict_gap_exists_raw_bound + S wip_inverse_exists_raw = p) /\ (exists wip_mod_left_exists_raw_congruence wip_mod_right_exists_raw_congruence. (S i) * wip_inverse_exists_raw + p * wip_mod_left_exists_raw_congruence = 1 + p * wip_mod_right_exists_raw_congruence))) - 0017
specialize prime_bounded_nonzero_mod_inverse p - 0018
specialize prime_bounded_nonzero_mod_inverse (S i) - 0019
apply prime_bounded_nonzero_mod_inverse - 0020
exact hp - 0021
exact hsi0 - 0022
exact hsip - 0023
cases hinv - 0024
cases hinv_witness - 0025
cases hinv_witness_right - 0026
have hpred : exists j. x = S j - 0027
specialize nonzero_is_succ x - 0028
apply nonzero_is_succ - 0029
exact hinv_witness_left - 0030
cases hpred - 0031
have hjn : exists wip_strict_gap_exists_output_bound. wip_strict_gap_exists_output_bound + S x1 = n - 0032
specialize le_of_succ_le_succ (S x1) - 0033
specialize le_of_succ_le_succ n - 0034
apply le_of_succ_le_succ - 0035
rewrite <- hpred_witness - 0036
rewrite <- hpn - 0037
exact hinv_witness_right_left - 0038
exists x1 - 0039
split - 0040
exact hi - 0041
split - 0042
exact hjn - 0043
rewrite hpred_witness at hinv_witness_right_right - 0044
exact hinv_witness_right_right