Exact expanded PA statement
forall k b c z d i x y p q. (exists h. h + S i = k) -> (((exists ff_h_balance_old_i. ff_h_balance_old_i + S (x) = S ((S (i)) * c)) /\ exists ff_q_balance_old_i. b = ff_q_balance_old_i * S ((S (i)) * c) + (x))) -> (((exists ff_h_balance_new_i. ff_h_balance_new_i + S (y) = S ((S (i)) * d)) /\ exists ff_q_balance_new_i. z = ff_q_balance_new_i * S ((S (i)) * d) + (y))) -> (forall j a. (exists h. h + S j = k) -> ~(j = i) -> (((exists ff_h_balance_old_j. ff_h_balance_old_j + S (a) = S ((S (j)) * c)) /\ exists ff_q_balance_old_j. b = ff_q_balance_old_j * S ((S (j)) * c) + (a))) -> (((exists ff_h_balance_new_j. ff_h_balance_new_j + S (a) = S ((S (j)) * d)) /\ exists ff_q_balance_new_j. z = ff_q_balance_new_j * S ((S (j)) * d) + (a)))) -> (exists ff_u_balance_old ff_v_balance_old. ((((exists ff_h_balance_old_start. ff_h_balance_old_start + S (0) = S ((S (0)) * ff_v_balance_old)) /\ exists ff_q_balance_old_start. ff_u_balance_old = ff_q_balance_old_start * S ((S (0)) * ff_v_balance_old) + (0))) /\ ((((exists ff_h_balance_old_terminal. ff_h_balance_old_terminal + S (p) = S ((S (k)) * ff_v_balance_old)) /\ exists ff_q_balance_old_terminal. ff_u_balance_old = ff_q_balance_old_terminal * S ((S (k)) * ff_v_balance_old) + (p))) /\ forall ff_i_balance_old. (exists ff_lt_balance_old_bound. ff_lt_balance_old_bound + S ff_i_balance_old = k) -> exists ff_a_balance_old ff_r_balance_old ff_s_balance_old. ((((exists ff_h_balance_old_summand. ff_h_balance_old_summand + S (ff_a_balance_old) = S ((S (ff_i_balance_old)) * c)) /\ exists ff_q_balance_old_summand. b = ff_q_balance_old_summand * S ((S (ff_i_balance_old)) * c) + (ff_a_balance_old))) /\ ((((exists ff_h_balance_old_partial. ff_h_balance_old_partial + S (ff_r_balance_old) = S ((S (ff_i_balance_old)) * ff_v_balance_old)) /\ exists ff_q_balance_old_partial. ff_u_balance_old = ff_q_balance_old_partial * S ((S (ff_i_balance_old)) * ff_v_balance_old) + (ff_r_balance_old))) /\ ((((exists ff_h_balance_old_successor. ff_h_balance_old_successor + S (ff_s_balance_old) = S ((S (S ff_i_balance_old)) * ff_v_balance_old)) /\ exists ff_q_balance_old_successor. ff_u_balance_old = ff_q_balance_old_successor * S ((S (S ff_i_balance_old)) * ff_v_balance_old) + (ff_s_balance_old))) /\ ff_s_balance_old = ff_r_balance_old + ff_a_balance_old)))))) -> (exists ff_u_balance_new ff_v_balance_new. ((((exists ff_h_balance_new_start. ff_h_balance_new_start + S (0) = S ((S (0)) * ff_v_balance_new)) /\ exists ff_q_balance_new_start. ff_u_balance_new = ff_q_balance_new_start * S ((S (0)) * ff_v_balance_new) + (0))) /\ ((((exists ff_h_balance_new_terminal. ff_h_balance_new_terminal + S (q) = S ((S (k)) * ff_v_balance_new)) /\ exists ff_q_balance_new_terminal. ff_u_balance_new = ff_q_balance_new_terminal * S ((S (k)) * ff_v_balance_new) + (q))) /\ forall ff_i_balance_new. (exists ff_lt_balance_new_bound. ff_lt_balance_new_bound + S ff_i_balance_new = k) -> exists ff_a_balance_new ff_r_balance_new ff_s_balance_new. ((((exists ff_h_balance_new_summand. ff_h_balance_new_summand + S (ff_a_balance_new) = S ((S (ff_i_balance_new)) * d)) /\ exists ff_q_balance_new_summand. z = ff_q_balance_new_summand * S ((S (ff_i_balance_new)) * d) + (ff_a_balance_new))) /\ ((((exists ff_h_balance_new_partial. ff_h_balance_new_partial + S (ff_r_balance_new) = S ((S (ff_i_balance_new)) * ff_v_balance_new)) /\ exists ff_q_balance_new_partial. ff_u_balance_new = ff_q_balance_new_partial * S ((S (ff_i_balance_new)) * ff_v_balance_new) + (ff_r_balance_new))) /\ ((((exists ff_h_balance_new_successor. ff_h_balance_new_successor + S (ff_s_balance_new) = S ((S (S ff_i_balance_new)) * ff_v_balance_new)) /\ exists ff_q_balance_new_successor. ff_u_balance_new = ff_q_balance_new_successor * S ((S (S ff_i_balance_new)) * ff_v_balance_new) + (ff_s_balance_new))) /\ ff_s_balance_new = ff_r_balance_new + ff_a_balance_new)))))) -> q + x = p + yStructural proof guide
Generated structural guide
Replacing one summand balances the old and new finite sums by the exchanged values.
Use the direct prerequisites add_eq_zero_right, succ_ne_zero, finite_lt_succ_eq_or_lt, beta_sum_succ_decompose, beta_sum_transport_prefix, beta_sum_trace_functional, beta_at_unique, add_assoc, add_comm, le_succ, le_refl, lt_irrefl_expanded as previously established PA formulas.
The proof proceeds by structural induction (1), case analysis (14), intermediate claims (12), equality transport (15), certified simplification (3).
Referenced ingredients
Proof neighborhood
Direct dependencies
PA0004 add_eq_zero_right PA0005 succ_ne_zero PA003D finite_lt_succ_eq_or_lt PA003Y beta_sum_succ_decompose PA00CT beta_sum_transport_prefix PA006K beta_sum_trace_functional PA002F beta_at_unique PA0009 add_assoc PA000F add_comm 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 Alpha-v16 checked-use theorem is independently kernel-checked when replayed; it is not a Stable theorem.
- 0001
induction k - 0002
intro b - 0003
intro c - 0004
intro z - 0005
intro d - 0006
intro i - 0007
intro x - 0008
intro y - 0009
intro p - 0010
intro q - 0011
intro hi - 0012
exfalso - 0013
cases hi - 0014
have hsi : S i = 0 - 0015
specialize add_eq_zero_right x1 - 0016
specialize add_eq_zero_right (S i) - 0017
apply add_eq_zero_right - 0018
exact hi_witness - 0019
specialize succ_ne_zero i - 0020
apply succ_ne_zero - 0021
exact hsi - 0022
intro b - 0023
intro c - 0024
intro z - 0025
intro d - 0026
intro i - 0027
intro x - 0028
intro y - 0029
intro p - 0030
intro q - 0031
intro hi - 0032
intro hold_i - 0033
intro hnew_i - 0034
intro hpreserve - 0035
intro hproduct_old - 0036
intro hproduct_new - 0037
have hisplit : i = k \/ exists h. h + S i = k - 0038
specialize finite_lt_succ_eq_or_lt k - 0039
specialize finite_lt_succ_eq_or_lt i - 0040
apply finite_lt_succ_eq_or_lt - 0041
exact hi - 0042
have hold_decomp : exists a r. (((exists ff_h_balance_old_last. ff_h_balance_old_last + S (a) = S ((S (k)) * c)) /\ exists ff_q_balance_old_last. b = ff_q_balance_old_last * S ((S (k)) * c) + (a))) /\ ((exists ff_u_balance_old_prefix ff_v_balance_old_prefix. ((((exists ff_h_balance_old_prefix_start. ff_h_balance_old_prefix_start + S (0) = S ((S (0)) * ff_v_balance_old_prefix)) /\ exists ff_q_balance_old_prefix_start. ff_u_balance_old_prefix = ff_q_balance_old_prefix_start * S ((S (0)) * ff_v_balance_old_prefix) + (0))) /\ ((((exists ff_h_balance_old_prefix_terminal. ff_h_balance_old_prefix_terminal + S (r) = S ((S (k)) * ff_v_balance_old_prefix)) /\ exists ff_q_balance_old_prefix_terminal. ff_u_balance_old_prefix = ff_q_balance_old_prefix_terminal * S ((S (k)) * ff_v_balance_old_prefix) + (r))) /\ forall ff_i_balance_old_prefix. (exists ff_lt_balance_old_prefix_bound. ff_lt_balance_old_prefix_bound + S ff_i_balance_old_prefix = k) -> exists ff_a_balance_old_prefix ff_r_balance_old_prefix ff_s_balance_old_prefix. ((((exists ff_h_balance_old_prefix_summand. ff_h_balance_old_prefix_summand + S (ff_a_balance_old_prefix) = S ((S (ff_i_balance_old_prefix)) * c)) /\ exists ff_q_balance_old_prefix_summand. b = ff_q_balance_old_prefix_summand * S ((S (ff_i_balance_old_prefix)) * c) + (ff_a_balance_old_prefix))) /\ ((((exists ff_h_balance_old_prefix_partial. ff_h_balance_old_prefix_partial + S (ff_r_balance_old_prefix) = S ((S (ff_i_balance_old_prefix)) * ff_v_balance_old_prefix)) /\ exists ff_q_balance_old_prefix_partial. ff_u_balance_old_prefix = ff_q_balance_old_prefix_partial * S ((S (ff_i_balance_old_prefix)) * ff_v_balance_old_prefix) + (ff_r_balance_old_prefix))) /\ ((((exists ff_h_balance_old_prefix_successor. ff_h_balance_old_prefix_successor + S (ff_s_balance_old_prefix) = S ((S (S ff_i_balance_old_prefix)) * ff_v_balance_old_prefix)) /\ exists ff_q_balance_old_prefix_successor. ff_u_balance_old_prefix = ff_q_balance_old_prefix_successor * S ((S (S ff_i_balance_old_prefix)) * ff_v_balance_old_prefix) + (ff_s_balance_old_prefix))) /\ ff_s_balance_old_prefix = ff_r_balance_old_prefix + ff_a_balance_old_prefix)))))) /\ p = r + a) - 0043
specialize beta_sum_succ_decompose b - 0044
specialize beta_sum_succ_decompose c - 0045
specialize beta_sum_succ_decompose k - 0046
specialize beta_sum_succ_decompose p - 0047
apply beta_sum_succ_decompose - 0048
exact hproduct_old - 0049
have hnew_decomp : exists a r. (((exists ff_h_balance_new_last. ff_h_balance_new_last + S (a) = S ((S (k)) * d)) /\ exists ff_q_balance_new_last. z = ff_q_balance_new_last * S ((S (k)) * d) + (a))) /\ ((exists ff_u_balance_new_prefix ff_v_balance_new_prefix. ((((exists ff_h_balance_new_prefix_start. ff_h_balance_new_prefix_start + S (0) = S ((S (0)) * ff_v_balance_new_prefix)) /\ exists ff_q_balance_new_prefix_start. ff_u_balance_new_prefix = ff_q_balance_new_prefix_start * S ((S (0)) * ff_v_balance_new_prefix) + (0))) /\ ((((exists ff_h_balance_new_prefix_terminal. ff_h_balance_new_prefix_terminal + S (r) = S ((S (k)) * ff_v_balance_new_prefix)) /\ exists ff_q_balance_new_prefix_terminal. ff_u_balance_new_prefix = ff_q_balance_new_prefix_terminal * S ((S (k)) * ff_v_balance_new_prefix) + (r))) /\ forall ff_i_balance_new_prefix. (exists ff_lt_balance_new_prefix_bound. ff_lt_balance_new_prefix_bound + S ff_i_balance_new_prefix = k) -> exists ff_a_balance_new_prefix ff_r_balance_new_prefix ff_s_balance_new_prefix. ((((exists ff_h_balance_new_prefix_summand. ff_h_balance_new_prefix_summand + S (ff_a_balance_new_prefix) = S ((S (ff_i_balance_new_prefix)) * d)) /\ exists ff_q_balance_new_prefix_summand. z = ff_q_balance_new_prefix_summand * S ((S (ff_i_balance_new_prefix)) * d) + (ff_a_balance_new_prefix))) /\ ((((exists ff_h_balance_new_prefix_partial. ff_h_balance_new_prefix_partial + S (ff_r_balance_new_prefix) = S ((S (ff_i_balance_new_prefix)) * ff_v_balance_new_prefix)) /\ exists ff_q_balance_new_prefix_partial. ff_u_balance_new_prefix = ff_q_balance_new_prefix_partial * S ((S (ff_i_balance_new_prefix)) * ff_v_balance_new_prefix) + (ff_r_balance_new_prefix))) /\ ((((exists ff_h_balance_new_prefix_successor. ff_h_balance_new_prefix_successor + S (ff_s_balance_new_prefix) = S ((S (S ff_i_balance_new_prefix)) * ff_v_balance_new_prefix)) /\ exists ff_q_balance_new_prefix_successor. ff_u_balance_new_prefix = ff_q_balance_new_prefix_successor * S ((S (S ff_i_balance_new_prefix)) * ff_v_balance_new_prefix) + (ff_s_balance_new_prefix))) /\ ff_s_balance_new_prefix = ff_r_balance_new_prefix + ff_a_balance_new_prefix)))))) /\ q = r + a) - 0050
specialize beta_sum_succ_decompose z - 0051
specialize beta_sum_succ_decompose d - 0052
specialize beta_sum_succ_decompose k - 0053
specialize beta_sum_succ_decompose q - 0054
apply beta_sum_succ_decompose - 0055
exact hproduct_new - 0056
cases hold_decomp - 0057
cases hold_decomp_witness - 0058
cases hold_decomp_witness_witness - 0059
cases hold_decomp_witness_witness_right - 0060
cases hnew_decomp - 0061
cases hnew_decomp_witness - 0062
cases hnew_decomp_witness_witness - 0063
cases hnew_decomp_witness_witness_right - 0064
cases hisplit - 0065
have hax : x1 = x - 0066
specialize beta_at_unique b - 0067
specialize beta_at_unique c - 0068
specialize beta_at_unique k - 0069
specialize beta_at_unique x1 - 0070
specialize beta_at_unique x - 0071
apply beta_at_unique - 0072
exact hold_decomp_witness_witness_left - 0073
rewrite hisplit_left at hold_i - 0074
rewrite hisplit_left at hold_i - 0075
exact hold_i - 0076
have hby : x3 = y - 0077
specialize beta_at_unique z - 0078
specialize beta_at_unique d - 0079
specialize beta_at_unique k - 0080
specialize beta_at_unique x3 - 0081
specialize beta_at_unique y - 0082
apply beta_at_unique - 0083
exact hnew_decomp_witness_witness_left - 0084
rewrite hisplit_left at hnew_i - 0085
rewrite hisplit_left at hnew_i - 0086
exact hnew_i - 0087
have hprefix_transport : exists ff_u_balance_transported_prefix ff_v_balance_transported_prefix. ((((exists ff_h_balance_transported_prefix_start. ff_h_balance_transported_prefix_start + S (0) = S ((S (0)) * ff_v_balance_transported_prefix)) /\ exists ff_q_balance_transported_prefix_start. ff_u_balance_transported_prefix = ff_q_balance_transported_prefix_start * S ((S (0)) * ff_v_balance_transported_prefix) + (0))) /\ ((((exists ff_h_balance_transported_prefix_terminal. ff_h_balance_transported_prefix_terminal + S (x2) = S ((S (k)) * ff_v_balance_transported_prefix)) /\ exists ff_q_balance_transported_prefix_terminal. ff_u_balance_transported_prefix = ff_q_balance_transported_prefix_terminal * S ((S (k)) * ff_v_balance_transported_prefix) + (x2))) /\ forall ff_i_balance_transported_prefix. (exists ff_lt_balance_transported_prefix_bound. ff_lt_balance_transported_prefix_bound + S ff_i_balance_transported_prefix = k) -> exists ff_a_balance_transported_prefix ff_r_balance_transported_prefix ff_s_balance_transported_prefix. ((((exists ff_h_balance_transported_prefix_summand. ff_h_balance_transported_prefix_summand + S (ff_a_balance_transported_prefix) = S ((S (ff_i_balance_transported_prefix)) * d)) /\ exists ff_q_balance_transported_prefix_summand. z = ff_q_balance_transported_prefix_summand * S ((S (ff_i_balance_transported_prefix)) * d) + (ff_a_balance_transported_prefix))) /\ ((((exists ff_h_balance_transported_prefix_partial. ff_h_balance_transported_prefix_partial + S (ff_r_balance_transported_prefix) = S ((S (ff_i_balance_transported_prefix)) * ff_v_balance_transported_prefix)) /\ exists ff_q_balance_transported_prefix_partial. ff_u_balance_transported_prefix = ff_q_balance_transported_prefix_partial * S ((S (ff_i_balance_transported_prefix)) * ff_v_balance_transported_prefix) + (ff_r_balance_transported_prefix))) /\ ((((exists ff_h_balance_transported_prefix_successor. ff_h_balance_transported_prefix_successor + S (ff_s_balance_transported_prefix) = S ((S (S ff_i_balance_transported_prefix)) * ff_v_balance_transported_prefix)) /\ exists ff_q_balance_transported_prefix_successor. ff_u_balance_transported_prefix = ff_q_balance_transported_prefix_successor * S ((S (S ff_i_balance_transported_prefix)) * ff_v_balance_transported_prefix) + (ff_s_balance_transported_prefix))) /\ ff_s_balance_transported_prefix = ff_r_balance_transported_prefix + ff_a_balance_transported_prefix))))) - 0088
specialize beta_sum_transport_prefix b - 0089
specialize beta_sum_transport_prefix c - 0090
specialize beta_sum_transport_prefix z - 0091
specialize beta_sum_transport_prefix d - 0092
specialize beta_sum_transport_prefix k - 0093
specialize beta_sum_transport_prefix x2 - 0094
apply beta_sum_transport_prefix - 0095
exact hold_decomp_witness_witness_right_left - 0096
intro j - 0097
intro a - 0098
intro hj - 0099
intro hold - 0100
specialize hpreserve j - 0101
specialize hpreserve a - 0102
apply hpreserve - 0103
specialize le_succ (S j) - 0104
specialize le_succ k - 0105
apply le_succ - 0106
exact hj - 0107
intro hjk - 0108
specialize lt_irrefl_expanded k - 0109
apply lt_irrefl_expanded - 0110
rewrite hjk at hj - 0111
rewrite hisplit_left at hj - 0112
exact hj - 0113
exact hold - 0114
cases hprefix_transport - 0115
cases hprefix_transport_witness - 0116
cases hnew_decomp_witness_witness_right_left - 0117
cases hnew_decomp_witness_witness_right_left_witness - 0118
rewrite hold_decomp_witness_witness_right_right - 0119
rewrite hnew_decomp_witness_witness_right_right - 0120
rewrite hax - 0121
rewrite hby - 0122
trans (x4 + x) + y - 0123
simp [add_assoc, add_comm] - 0124
congr - 0125
congr - 0126
symm - 0127
specialize beta_sum_trace_functional z - 0128
specialize beta_sum_trace_functional d - 0129
specialize beta_sum_trace_functional k - 0130
specialize beta_sum_trace_functional x2 - 0131
specialize beta_sum_trace_functional x5 - 0132
specialize beta_sum_trace_functional x6 - 0133
specialize beta_sum_trace_functional x4 - 0134
specialize beta_sum_trace_functional x7 - 0135
specialize beta_sum_trace_functional x8 - 0136
apply beta_sum_trace_functional - 0137
exact hprefix_transport_witness_witness - 0138
exact hnew_decomp_witness_witness_right_left_witness_witness - 0139
refl - 0140
refl - 0141
have hki : ~(k = i) - 0142
intro hki_eq - 0143
specialize lt_irrefl_expanded k - 0144
apply lt_irrefl_expanded - 0145
rewrite <- hki_eq at hisplit_right - 0146
exact hisplit_right - 0147
have hlast_new : ((exists h. h + S x1 = S ((S k) * d)) /\ exists w. z = w * S ((S k) * d) + x1) - 0148
specialize hpreserve k - 0149
specialize hpreserve x1 - 0150
apply hpreserve - 0151
specialize le_refl (S k) - 0152
exact le_refl - 0153
exact hki - 0154
exact hold_decomp_witness_witness_left - 0155
have hlast_eq : x3 = x1 - 0156
specialize beta_at_unique z - 0157
specialize beta_at_unique d - 0158
specialize beta_at_unique k - 0159
specialize beta_at_unique x3 - 0160
specialize beta_at_unique x1 - 0161
apply beta_at_unique - 0162
exact hnew_decomp_witness_witness_left - 0163
exact hlast_new - 0164
have hprefix_preserve : forall j a. (exists h. h + S j = k) -> ~(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) - 0165
intro j - 0166
intro a - 0167
intro hj - 0168
intro hji - 0169
intro hold - 0170
specialize hpreserve j - 0171
specialize hpreserve a - 0172
apply hpreserve - 0173
specialize le_succ (S j) - 0174
specialize le_succ k - 0175
apply le_succ - 0176
exact hj - 0177
exact hji - 0178
exact hold - 0179
have hbalance : x4 + x = x2 + y - 0180
specialize IH b - 0181
specialize IH c - 0182
specialize IH z - 0183
specialize IH d - 0184
specialize IH i - 0185
specialize IH x - 0186
specialize IH y - 0187
specialize IH x2 - 0188
specialize IH x4 - 0189
apply IH - 0190
exact hisplit_right - 0191
exact hold_i - 0192
exact hnew_i - 0193
exact hprefix_preserve - 0194
exact hold_decomp_witness_witness_right_left - 0195
exact hnew_decomp_witness_witness_right_left - 0196
rewrite hold_decomp_witness_witness_right_right - 0197
rewrite hnew_decomp_witness_witness_right_right - 0198
rewrite hlast_eq - 0199
trans (x4 + x) + x1 - 0200
simp [add_assoc, add_comm] - 0201
rewrite hbalance - 0202
simp [add_assoc, add_comm]