Exact expanded PA statement
forall b c n i x y. (exists h. h + S i = n) -> (((exists ff_h_swap_old_i. ff_h_swap_old_i + S (x) = S ((S (i)) * c)) /\ exists ff_q_swap_old_i. b = ff_q_swap_old_i * S ((S (i)) * c) + (x))) -> (((exists ff_h_swap_old_n. ff_h_swap_old_n + S (y) = S ((S (n)) * c)) /\ exists ff_q_swap_old_n. b = ff_q_swap_old_n * S ((S (n)) * c) + (y))) -> exists z d. ((((exists ff_h_swap_new_i. ff_h_swap_new_i + S (y) = S ((S (i)) * d)) /\ exists ff_q_swap_new_i. z = ff_q_swap_new_i * S ((S (i)) * d) + (y))) /\ ((((exists ff_h_swap_new_n. ff_h_swap_new_n + S (x) = S ((S (n)) * d)) /\ exists ff_q_swap_new_n. z = ff_q_swap_new_n * S ((S (n)) * d) + (x))) /\ forall j a. (exists h. h + S j = S n) -> ~(j = i) -> ~(j = n) -> (((exists ff_h_swap_old_j. ff_h_swap_old_j + S (a) = S ((S (j)) * c)) /\ exists ff_q_swap_old_j. b = ff_q_swap_old_j * S ((S (j)) * c) + (a))) -> (((exists ff_h_swap_new_j. ff_h_swap_new_j + S (a) = S ((S (j)) * d)) /\ exists ff_q_swap_new_j. z = ff_q_swap_new_j * S ((S (j)) * d) + (a)))))Structural proof guide
Generated structural guide
Swap a chosen interior beta entry with the last entry, given both decoded values.
Use the direct prerequisites beta_prefix_replace_exists, le_succ, le_refl, lt_irrefl_expanded as previously established PA formulas.
The proof proceeds by case analysis (6), intermediate claims (8), equality transport (1).
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 b - 0002
intro c - 0003
intro n - 0004
intro i - 0005
intro x - 0006
intro y - 0007
intro hi - 0008
intro hxi - 0009
intro hyn - 0010
have hisn : exists h. h + S i = S n - 0011
specialize le_succ (S i) - 0012
specialize le_succ n - 0013
apply le_succ - 0014
exact hi - 0015
have hnsn : exists h. h + S n = S n - 0016
specialize le_refl (S n) - 0017
exact le_refl - 0018
have hin : ~(i = n) - 0019
intro hin_eq - 0020
specialize lt_irrefl_expanded n - 0021
apply lt_irrefl_expanded - 0022
rewrite hin_eq at hi - 0023
exact hi - 0024
have hni : ~(n = i) - 0025
intro hni_eq - 0026
apply hin - 0027
symm - 0028
exact hni_eq - 0029
have hfirst : exists z d. (((exists h. h + S y = S ((S i) * d)) /\ exists q. z = q * S ((S i) * d) + y) /\ forall j a. (exists h. h + S j = S n) -> ~(j = i) -> ((exists h. h + S a = S ((S j) * c)) /\ exists q. b = q * S ((S j) * c) + a) -> ((exists h. h + S a = S ((S j) * d)) /\ exists q. z = q * S ((S j) * d) + a)) - 0030
specialize beta_prefix_replace_exists b - 0031
specialize beta_prefix_replace_exists c - 0032
specialize beta_prefix_replace_exists i - 0033
specialize beta_prefix_replace_exists y - 0034
specialize beta_prefix_replace_exists (S n) - 0035
apply beta_prefix_replace_exists - 0036
exact hisn - 0037
cases hfirst - 0038
cases hfirst_witness - 0039
cases hfirst_witness_witness - 0040
have hfirst_n : ((exists h. h + S y = S ((S n) * x2)) /\ exists q. x1 = q * S ((S n) * x2) + y) - 0041
specialize hfirst_witness_witness_right n - 0042
specialize hfirst_witness_witness_right y - 0043
apply hfirst_witness_witness_right - 0044
exact hnsn - 0045
exact hni - 0046
exact hyn - 0047
have hsecond : exists z d. (((exists h. h + S x = S ((S n) * d)) /\ exists q. z = q * S ((S n) * d) + x) /\ forall j a. (exists h. h + S j = S n) -> ~(j = n) -> ((exists h. h + S a = S ((S j) * x2)) /\ exists q. x1 = q * S ((S j) * x2) + a) -> ((exists h. h + S a = S ((S j) * d)) /\ exists q. z = q * S ((S j) * d) + a)) - 0048
specialize beta_prefix_replace_exists x1 - 0049
specialize beta_prefix_replace_exists x2 - 0050
specialize beta_prefix_replace_exists n - 0051
specialize beta_prefix_replace_exists x - 0052
specialize beta_prefix_replace_exists (S n) - 0053
apply beta_prefix_replace_exists - 0054
exact hnsn - 0055
cases hsecond - 0056
cases hsecond_witness - 0057
cases hsecond_witness_witness - 0058
exists x3 - 0059
exists x4 - 0060
split - 0061
specialize hsecond_witness_witness_right i - 0062
specialize hsecond_witness_witness_right y - 0063
apply hsecond_witness_witness_right - 0064
exact hisn - 0065
exact hin - 0066
exact hfirst_witness_witness_left - 0067
split - 0068
exact hsecond_witness_witness_left - 0069
intro j - 0070
intro a - 0071
intro hj - 0072
intro hji - 0073
intro hjn - 0074
intro hold - 0075
have hmiddle : ((exists h. h + S a = S ((S j) * x2)) /\ exists q. x1 = q * S ((S j) * x2) + a) - 0076
specialize hfirst_witness_witness_right j - 0077
specialize hfirst_witness_witness_right a - 0078
apply hfirst_witness_witness_right - 0079
exact hj - 0080
exact hji - 0081
exact hold - 0082
specialize hsecond_witness_witness_right j - 0083
specialize hsecond_witness_witness_right a - 0084
apply hsecond_witness_witness_right - 0085
exact hj - 0086
exact hjn - 0087
exact hmiddle