Exact expanded PA statement
forall b c z d n i x y p q. (exists h. h + S i = n) -> (((exists ff_h_product_swap_old_i. ff_h_product_swap_old_i + S (x) = S ((S (i)) * c)) /\ exists ff_q_product_swap_old_i. b = ff_q_product_swap_old_i * S ((S (i)) * c) + (x))) -> (((exists ff_h_product_swap_old_n. ff_h_product_swap_old_n + S (y) = S ((S (n)) * c)) /\ exists ff_q_product_swap_old_n. b = ff_q_product_swap_old_n * S ((S (n)) * c) + (y))) -> (((exists ff_h_product_swap_new_i. ff_h_product_swap_new_i + S (y) = S ((S (i)) * d)) /\ exists ff_q_product_swap_new_i. z = ff_q_product_swap_new_i * S ((S (i)) * d) + (y))) -> (((exists ff_h_product_swap_new_n. ff_h_product_swap_new_n + S (x) = S ((S (n)) * d)) /\ exists ff_q_product_swap_new_n. z = ff_q_product_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_product_swap_old_j. ff_h_product_swap_old_j + S (a) = S ((S (j)) * c)) /\ exists ff_q_product_swap_old_j. b = ff_q_product_swap_old_j * S ((S (j)) * c) + (a))) -> (((exists ff_h_product_swap_new_j. ff_h_product_swap_new_j + S (a) = S ((S (j)) * d)) /\ exists ff_q_product_swap_new_j. z = ff_q_product_swap_new_j * S ((S (j)) * d) + (a)))) -> (exists ff_u_product_swap_old ff_v_product_swap_old. ((((exists ff_h_product_swap_old_start. ff_h_product_swap_old_start + S (1) = S ((S (0)) * ff_v_product_swap_old)) /\ exists ff_q_product_swap_old_start. ff_u_product_swap_old = ff_q_product_swap_old_start * S ((S (0)) * ff_v_product_swap_old) + (1))) /\ ((((exists ff_h_product_swap_old_terminal. ff_h_product_swap_old_terminal + S (p) = S ((S (S n)) * ff_v_product_swap_old)) /\ exists ff_q_product_swap_old_terminal. ff_u_product_swap_old = ff_q_product_swap_old_terminal * S ((S (S n)) * ff_v_product_swap_old) + (p))) /\ forall ff_i_product_swap_old. (exists ff_lt_product_swap_old_bound. ff_lt_product_swap_old_bound + S ff_i_product_swap_old = S n) -> exists ff_p_product_swap_old ff_r_product_swap_old ff_s_product_swap_old. ((((exists ff_h_product_swap_old_factor. ff_h_product_swap_old_factor + S (ff_p_product_swap_old) = S ((S (ff_i_product_swap_old)) * c)) /\ exists ff_q_product_swap_old_factor. b = ff_q_product_swap_old_factor * S ((S (ff_i_product_swap_old)) * c) + (ff_p_product_swap_old))) /\ ((((exists ff_h_product_swap_old_partial. ff_h_product_swap_old_partial + S (ff_r_product_swap_old) = S ((S (ff_i_product_swap_old)) * ff_v_product_swap_old)) /\ exists ff_q_product_swap_old_partial. ff_u_product_swap_old = ff_q_product_swap_old_partial * S ((S (ff_i_product_swap_old)) * ff_v_product_swap_old) + (ff_r_product_swap_old))) /\ ((((exists ff_h_product_swap_old_successor. ff_h_product_swap_old_successor + S (ff_s_product_swap_old) = S ((S (S ff_i_product_swap_old)) * ff_v_product_swap_old)) /\ exists ff_q_product_swap_old_successor. ff_u_product_swap_old = ff_q_product_swap_old_successor * S ((S (S ff_i_product_swap_old)) * ff_v_product_swap_old) + (ff_s_product_swap_old))) /\ ff_s_product_swap_old = ff_r_product_swap_old * ff_p_product_swap_old)))))) -> (exists ff_u_product_swap_new ff_v_product_swap_new. ((((exists ff_h_product_swap_new_start. ff_h_product_swap_new_start + S (1) = S ((S (0)) * ff_v_product_swap_new)) /\ exists ff_q_product_swap_new_start. ff_u_product_swap_new = ff_q_product_swap_new_start * S ((S (0)) * ff_v_product_swap_new) + (1))) /\ ((((exists ff_h_product_swap_new_terminal. ff_h_product_swap_new_terminal + S (q) = S ((S (S n)) * ff_v_product_swap_new)) /\ exists ff_q_product_swap_new_terminal. ff_u_product_swap_new = ff_q_product_swap_new_terminal * S ((S (S n)) * ff_v_product_swap_new) + (q))) /\ forall ff_i_product_swap_new. (exists ff_lt_product_swap_new_bound. ff_lt_product_swap_new_bound + S ff_i_product_swap_new = S n) -> exists ff_p_product_swap_new ff_r_product_swap_new ff_s_product_swap_new. ((((exists ff_h_product_swap_new_factor. ff_h_product_swap_new_factor + S (ff_p_product_swap_new) = S ((S (ff_i_product_swap_new)) * d)) /\ exists ff_q_product_swap_new_factor. z = ff_q_product_swap_new_factor * S ((S (ff_i_product_swap_new)) * d) + (ff_p_product_swap_new))) /\ ((((exists ff_h_product_swap_new_partial. ff_h_product_swap_new_partial + S (ff_r_product_swap_new) = S ((S (ff_i_product_swap_new)) * ff_v_product_swap_new)) /\ exists ff_q_product_swap_new_partial. ff_u_product_swap_new = ff_q_product_swap_new_partial * S ((S (ff_i_product_swap_new)) * ff_v_product_swap_new) + (ff_r_product_swap_new))) /\ ((((exists ff_h_product_swap_new_successor. ff_h_product_swap_new_successor + S (ff_s_product_swap_new) = S ((S (S ff_i_product_swap_new)) * ff_v_product_swap_new)) /\ exists ff_q_product_swap_new_successor. ff_u_product_swap_new = ff_q_product_swap_new_successor * S ((S (S ff_i_product_swap_new)) * ff_v_product_swap_new) + (ff_s_product_swap_new))) /\ ff_s_product_swap_new = ff_r_product_swap_new * ff_p_product_swap_new)))))) -> p = qStructural proof guide
Generated structural guide
Swapping an interior beta-coded factor with the last factor preserves the exact finite product.
Use the direct prerequisites beta_product_replace_balance, beta_product_succ_decompose, beta_at_unique, le_succ, le_refl, lt_irrefl_expanded as previously established PA formulas.
The proof proceeds by case analysis (8), intermediate claims (6), equality transport (5).
Referenced ingredients
Proof neighborhood
Direct dependencies
PA0052 beta_product_replace_balance PA004A beta_product_succ_decompose PA002F beta_at_unique PA002O le_succ PA001A le_refl PA0010 lt_irrefl_expandedDirect 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 z - 0004
intro d - 0005
intro n - 0006
intro i - 0007
intro x - 0008
intro y - 0009
intro p - 0010
intro q - 0011
intro hi - 0012
intro hold_i - 0013
intro hold_n - 0014
intro hnew_i - 0015
intro hnew_n - 0016
intro hpreserve - 0017
intro hproduct_old - 0018
intro hproduct_new - 0019
have hold_decomp : exists a r. (((exists ff_h_swap_old_last. ff_h_swap_old_last + S (a) = S ((S (n)) * c)) /\ exists ff_q_swap_old_last. b = ff_q_swap_old_last * S ((S (n)) * c) + (a))) /\ ((exists ff_u_swap_old_prefix ff_v_swap_old_prefix. ((((exists ff_h_swap_old_prefix_start. ff_h_swap_old_prefix_start + S (1) = S ((S (0)) * ff_v_swap_old_prefix)) /\ exists ff_q_swap_old_prefix_start. ff_u_swap_old_prefix = ff_q_swap_old_prefix_start * S ((S (0)) * ff_v_swap_old_prefix) + (1))) /\ ((((exists ff_h_swap_old_prefix_terminal. ff_h_swap_old_prefix_terminal + S (r) = S ((S (n)) * ff_v_swap_old_prefix)) /\ exists ff_q_swap_old_prefix_terminal. ff_u_swap_old_prefix = ff_q_swap_old_prefix_terminal * S ((S (n)) * ff_v_swap_old_prefix) + (r))) /\ forall ff_i_swap_old_prefix. (exists ff_lt_swap_old_prefix_bound. ff_lt_swap_old_prefix_bound + S ff_i_swap_old_prefix = n) -> exists ff_p_swap_old_prefix ff_r_swap_old_prefix ff_s_swap_old_prefix. ((((exists ff_h_swap_old_prefix_factor. ff_h_swap_old_prefix_factor + S (ff_p_swap_old_prefix) = S ((S (ff_i_swap_old_prefix)) * c)) /\ exists ff_q_swap_old_prefix_factor. b = ff_q_swap_old_prefix_factor * S ((S (ff_i_swap_old_prefix)) * c) + (ff_p_swap_old_prefix))) /\ ((((exists ff_h_swap_old_prefix_partial. ff_h_swap_old_prefix_partial + S (ff_r_swap_old_prefix) = S ((S (ff_i_swap_old_prefix)) * ff_v_swap_old_prefix)) /\ exists ff_q_swap_old_prefix_partial. ff_u_swap_old_prefix = ff_q_swap_old_prefix_partial * S ((S (ff_i_swap_old_prefix)) * ff_v_swap_old_prefix) + (ff_r_swap_old_prefix))) /\ ((((exists ff_h_swap_old_prefix_successor. ff_h_swap_old_prefix_successor + S (ff_s_swap_old_prefix) = S ((S (S ff_i_swap_old_prefix)) * ff_v_swap_old_prefix)) /\ exists ff_q_swap_old_prefix_successor. ff_u_swap_old_prefix = ff_q_swap_old_prefix_successor * S ((S (S ff_i_swap_old_prefix)) * ff_v_swap_old_prefix) + (ff_s_swap_old_prefix))) /\ ff_s_swap_old_prefix = ff_r_swap_old_prefix * ff_p_swap_old_prefix)))))) /\ p = r * a) - 0020
specialize beta_product_succ_decompose b - 0021
specialize beta_product_succ_decompose c - 0022
specialize beta_product_succ_decompose n - 0023
specialize beta_product_succ_decompose p - 0024
apply beta_product_succ_decompose - 0025
exact hproduct_old - 0026
have hnew_decomp : exists a r. (((exists ff_h_swap_new_last. ff_h_swap_new_last + S (a) = S ((S (n)) * d)) /\ exists ff_q_swap_new_last. z = ff_q_swap_new_last * S ((S (n)) * d) + (a))) /\ ((exists ff_u_swap_new_prefix ff_v_swap_new_prefix. ((((exists ff_h_swap_new_prefix_start. ff_h_swap_new_prefix_start + S (1) = S ((S (0)) * ff_v_swap_new_prefix)) /\ exists ff_q_swap_new_prefix_start. ff_u_swap_new_prefix = ff_q_swap_new_prefix_start * S ((S (0)) * ff_v_swap_new_prefix) + (1))) /\ ((((exists ff_h_swap_new_prefix_terminal. ff_h_swap_new_prefix_terminal + S (r) = S ((S (n)) * ff_v_swap_new_prefix)) /\ exists ff_q_swap_new_prefix_terminal. ff_u_swap_new_prefix = ff_q_swap_new_prefix_terminal * S ((S (n)) * ff_v_swap_new_prefix) + (r))) /\ forall ff_i_swap_new_prefix. (exists ff_lt_swap_new_prefix_bound. ff_lt_swap_new_prefix_bound + S ff_i_swap_new_prefix = n) -> exists ff_p_swap_new_prefix ff_r_swap_new_prefix ff_s_swap_new_prefix. ((((exists ff_h_swap_new_prefix_factor. ff_h_swap_new_prefix_factor + S (ff_p_swap_new_prefix) = S ((S (ff_i_swap_new_prefix)) * d)) /\ exists ff_q_swap_new_prefix_factor. z = ff_q_swap_new_prefix_factor * S ((S (ff_i_swap_new_prefix)) * d) + (ff_p_swap_new_prefix))) /\ ((((exists ff_h_swap_new_prefix_partial. ff_h_swap_new_prefix_partial + S (ff_r_swap_new_prefix) = S ((S (ff_i_swap_new_prefix)) * ff_v_swap_new_prefix)) /\ exists ff_q_swap_new_prefix_partial. ff_u_swap_new_prefix = ff_q_swap_new_prefix_partial * S ((S (ff_i_swap_new_prefix)) * ff_v_swap_new_prefix) + (ff_r_swap_new_prefix))) /\ ((((exists ff_h_swap_new_prefix_successor. ff_h_swap_new_prefix_successor + S (ff_s_swap_new_prefix) = S ((S (S ff_i_swap_new_prefix)) * ff_v_swap_new_prefix)) /\ exists ff_q_swap_new_prefix_successor. ff_u_swap_new_prefix = ff_q_swap_new_prefix_successor * S ((S (S ff_i_swap_new_prefix)) * ff_v_swap_new_prefix) + (ff_s_swap_new_prefix))) /\ ff_s_swap_new_prefix = ff_r_swap_new_prefix * ff_p_swap_new_prefix)))))) /\ q = r * a) - 0027
specialize beta_product_succ_decompose z - 0028
specialize beta_product_succ_decompose d - 0029
specialize beta_product_succ_decompose n - 0030
specialize beta_product_succ_decompose q - 0031
apply beta_product_succ_decompose - 0032
exact hproduct_new - 0033
cases hold_decomp - 0034
cases hold_decomp_witness - 0035
cases hold_decomp_witness_witness - 0036
cases hold_decomp_witness_witness_right - 0037
cases hnew_decomp - 0038
cases hnew_decomp_witness - 0039
cases hnew_decomp_witness_witness - 0040
cases hnew_decomp_witness_witness_right - 0041
have hold_last : x1 = y - 0042
specialize beta_at_unique b - 0043
specialize beta_at_unique c - 0044
specialize beta_at_unique n - 0045
specialize beta_at_unique x1 - 0046
specialize beta_at_unique y - 0047
apply beta_at_unique - 0048
exact hold_decomp_witness_witness_left - 0049
exact hold_n - 0050
have hnew_last : x3 = x - 0051
specialize beta_at_unique z - 0052
specialize beta_at_unique d - 0053
specialize beta_at_unique n - 0054
specialize beta_at_unique x3 - 0055
specialize beta_at_unique x - 0056
apply beta_at_unique - 0057
exact hnew_decomp_witness_witness_left - 0058
exact hnew_n - 0059
have hprefix_preserve : forall j a. (exists h. h + S j = n) -> ~(j = i) -> ((exists h. h + S a = S ((S j) * c)) /\ exists w. b = w * S ((S j) * c) + a) -> ((exists h. h + S a = S ((S j) * d)) /\ exists w. z = w * S ((S j) * d) + a) - 0060
intro j - 0061
intro a - 0062
intro hj - 0063
intro hji - 0064
intro hold - 0065
specialize hpreserve j - 0066
specialize hpreserve a - 0067
apply hpreserve - 0068
specialize le_succ (S j) - 0069
specialize le_succ n - 0070
apply le_succ - 0071
exact hj - 0072
exact hji - 0073
intro hjn - 0074
specialize lt_irrefl_expanded n - 0075
apply lt_irrefl_expanded - 0076
rewrite hjn at hj - 0077
exact hj - 0078
exact hold - 0079
have hbalance : x4 * x = x2 * y - 0080
specialize beta_product_replace_balance n - 0081
specialize beta_product_replace_balance b - 0082
specialize beta_product_replace_balance c - 0083
specialize beta_product_replace_balance z - 0084
specialize beta_product_replace_balance d - 0085
specialize beta_product_replace_balance i - 0086
specialize beta_product_replace_balance x - 0087
specialize beta_product_replace_balance y - 0088
specialize beta_product_replace_balance x2 - 0089
specialize beta_product_replace_balance x4 - 0090
apply beta_product_replace_balance - 0091
exact hi - 0092
exact hold_i - 0093
exact hnew_i - 0094
exact hprefix_preserve - 0095
exact hold_decomp_witness_witness_right_left - 0096
exact hnew_decomp_witness_witness_right_left - 0097
rewrite hold_decomp_witness_witness_right_right - 0098
rewrite hnew_decomp_witness_witness_right_right - 0099
rewrite hold_last - 0100
rewrite hnew_last - 0101
symm - 0102
exact hbalance