Exact expanded PA statement
forall r s u v b c z d w e n i m x y. (((exists ff_h_align_swap_map_i. ff_h_align_swap_map_i + S (m) = S ((S (i)) * v)) /\ exists ff_q_align_swap_map_i. u = ff_q_align_swap_map_i * S ((S (i)) * v) + (m))) -> (((exists ff_h_align_swap_map_n. ff_h_align_swap_map_n + S (n) = S ((S (n)) * v)) /\ exists ff_q_align_swap_map_n. u = ff_q_align_swap_map_n * S ((S (n)) * v) + (n))) -> (forall k j. (exists h. h + S k = S n) -> ~(k = i) -> ~(k = n) -> (((exists ff_h_align_swap_map_old. ff_h_align_swap_map_old + S (j) = S ((S (k)) * s)) /\ exists ff_q_align_swap_map_old. r = ff_q_align_swap_map_old * S ((S (k)) * s) + (j))) -> (((exists ff_h_align_swap_map_new. ff_h_align_swap_map_new + S (j) = S ((S (k)) * v)) /\ exists ff_q_align_swap_map_new. u = ff_q_align_swap_map_new * S ((S (k)) * v) + (j)))) -> (((exists ff_h_align_swap_source_m. ff_h_align_swap_source_m + S (y) = S ((S (m)) * c)) /\ exists ff_q_align_swap_source_m. b = ff_q_align_swap_source_m * S ((S (m)) * c) + (y))) -> (((exists ff_h_align_swap_source_n. ff_h_align_swap_source_n + S (x) = S ((S (n)) * c)) /\ exists ff_q_align_swap_source_n. b = ff_q_align_swap_source_n * S ((S (n)) * c) + (x))) -> (((exists ff_h_align_swap_target_i. ff_h_align_swap_target_i + S (y) = S ((S (i)) * e)) /\ exists ff_q_align_swap_target_i. w = ff_q_align_swap_target_i * S ((S (i)) * e) + (y))) -> (((exists ff_h_align_swap_target_n. ff_h_align_swap_target_n + S (x) = S ((S (n)) * e)) /\ exists ff_q_align_swap_target_n. w = ff_q_align_swap_target_n * S ((S (n)) * e) + (x))) -> (forall k a. (exists h. h + S k = S n) -> ~(k = i) -> ~(k = n) -> (((exists ff_h_align_swap_target_old. ff_h_align_swap_target_old + S (a) = S ((S (k)) * d)) /\ exists ff_q_align_swap_target_old. z = ff_q_align_swap_target_old * S ((S (k)) * d) + (a))) -> (((exists ff_h_align_swap_target_new. ff_h_align_swap_target_new + S (a) = S ((S (k)) * e)) /\ exists ff_q_align_swap_target_new. w = ff_q_align_swap_target_new * S ((S (k)) * e) + (a)))) -> (forall fpr_i_align_swap_old fpr_j_align_swap_old fpr_x_align_swap_old. (exists fpr_h_align_swap_old. fpr_h_align_swap_old + S fpr_i_align_swap_old = S n) -> (((exists ff_h_align_swap_old_map. ff_h_align_swap_old_map + S (fpr_j_align_swap_old) = S ((S (fpr_i_align_swap_old)) * s)) /\ exists ff_q_align_swap_old_map. r = ff_q_align_swap_old_map * S ((S (fpr_i_align_swap_old)) * s) + (fpr_j_align_swap_old))) -> (((exists ff_h_align_swap_old_source. ff_h_align_swap_old_source + S (fpr_x_align_swap_old) = S ((S (fpr_j_align_swap_old)) * c)) /\ exists ff_q_align_swap_old_source. b = ff_q_align_swap_old_source * S ((S (fpr_j_align_swap_old)) * c) + (fpr_x_align_swap_old))) -> (((exists ff_h_align_swap_old_target. ff_h_align_swap_old_target + S (fpr_x_align_swap_old) = S ((S (fpr_i_align_swap_old)) * d)) /\ exists ff_q_align_swap_old_target. z = ff_q_align_swap_old_target * S ((S (fpr_i_align_swap_old)) * d) + (fpr_x_align_swap_old)))) -> (forall fpr_i_align_swap_new fpr_j_align_swap_new fpr_x_align_swap_new. (exists fpr_h_align_swap_new. fpr_h_align_swap_new + S fpr_i_align_swap_new = S n) -> (((exists ff_h_align_swap_new_map. ff_h_align_swap_new_map + S (fpr_j_align_swap_new) = S ((S (fpr_i_align_swap_new)) * v)) /\ exists ff_q_align_swap_new_map. u = ff_q_align_swap_new_map * S ((S (fpr_i_align_swap_new)) * v) + (fpr_j_align_swap_new))) -> (((exists ff_h_align_swap_new_source. ff_h_align_swap_new_source + S (fpr_x_align_swap_new) = S ((S (fpr_j_align_swap_new)) * c)) /\ exists ff_q_align_swap_new_source. b = ff_q_align_swap_new_source * S ((S (fpr_j_align_swap_new)) * c) + (fpr_x_align_swap_new))) -> (((exists ff_h_align_swap_new_target. ff_h_align_swap_new_target + S (fpr_x_align_swap_new) = S ((S (fpr_i_align_swap_new)) * e)) /\ exists ff_q_align_swap_new_target. w = ff_q_align_swap_new_target * S ((S (fpr_i_align_swap_new)) * e) + (fpr_x_align_swap_new))))Structural proof guide
Generated structural guide
Simultaneous interior/final swaps of an index code and target factors preserve alignment.
Use the direct prerequisites beta_prefix_swap_last_reflect, beta_at_unique as previously established PA formulas.
The proof proceeds by case analysis (6), intermediate claims (5), equality transport (12).
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 r - 0002
intro s - 0003
intro u - 0004
intro v - 0005
intro b - 0006
intro c - 0007
intro z - 0008
intro d - 0009
intro w - 0010
intro e - 0011
intro n - 0012
intro i - 0013
intro m - 0014
intro x - 0015
intro y - 0016
intro hmap_i - 0017
intro hmap_n - 0018
intro hmap_preserve - 0019
intro hsource_m - 0020
intro hsource_n - 0021
intro htarget_i - 0022
intro htarget_n - 0023
intro htarget_preserve - 0024
intro haligned - 0025
have hreflect : forall k j. (exists h. h + S k = S n) -> ((exists h. h + S j = S ((S k) * v)) /\ exists q. u = q * S ((S k) * v) + j) -> (k = i /\ j = m) \/ ((k = n /\ j = n) \/ (~(k = i) /\ (~(k = n) /\ ((exists h. h + S j = S ((S k) * s)) /\ exists q. r = q * S ((S k) * s) + j)))) - 0026
specialize beta_prefix_swap_last_reflect r - 0027
specialize beta_prefix_swap_last_reflect s - 0028
specialize beta_prefix_swap_last_reflect u - 0029
specialize beta_prefix_swap_last_reflect v - 0030
specialize beta_prefix_swap_last_reflect n - 0031
specialize beta_prefix_swap_last_reflect i - 0032
specialize beta_prefix_swap_last_reflect n - 0033
specialize beta_prefix_swap_last_reflect m - 0034
apply beta_prefix_swap_last_reflect - 0035
exact hmap_i - 0036
exact hmap_n - 0037
exact hmap_preserve - 0038
intro k - 0039
intro j - 0040
intro a - 0041
intro hk - 0042
intro hmap - 0043
intro hsource - 0044
specialize hreflect k - 0045
specialize hreflect j - 0046
have hcases : (k = i /\ j = m) \/ ((k = n /\ j = n) \/ (~(k = i) /\ (~(k = n) /\ ((exists h. h + S j = S ((S k) * s)) /\ exists q. r = q * S ((S k) * s) + j)))) - 0047
apply hreflect - 0048
exact hk - 0049
exact hmap - 0050
cases hcases - 0051
cases hcases_left - 0052
have hay : a = y - 0053
specialize beta_at_unique b - 0054
specialize beta_at_unique c - 0055
specialize beta_at_unique m - 0056
specialize beta_at_unique a - 0057
specialize beta_at_unique y - 0058
apply beta_at_unique - 0059
rewrite hcases_left_right at hsource - 0060
rewrite hcases_left_right at hsource - 0061
exact hsource - 0062
exact hsource_m - 0063
rewrite hcases_left_left - 0064
rewrite hcases_left_left - 0065
rewrite hay - 0066
rewrite hay - 0067
exact htarget_i - 0068
cases hcases_right - 0069
cases hcases_right_left - 0070
have hax : a = x - 0071
specialize beta_at_unique b - 0072
specialize beta_at_unique c - 0073
specialize beta_at_unique n - 0074
specialize beta_at_unique a - 0075
specialize beta_at_unique x - 0076
apply beta_at_unique - 0077
rewrite hcases_right_left_right at hsource - 0078
rewrite hcases_right_left_right at hsource - 0079
exact hsource - 0080
exact hsource_n - 0081
rewrite hcases_right_left_left - 0082
rewrite hcases_right_left_left - 0083
rewrite hax - 0084
rewrite hax - 0085
exact htarget_n - 0086
cases hcases_right_right - 0087
cases hcases_right_right_right - 0088
have hold_target : ((exists h. h + S a = S ((S k) * d)) /\ exists q. z = q * S ((S k) * d) + a) - 0089
specialize haligned k - 0090
specialize haligned j - 0091
specialize haligned a - 0092
apply haligned - 0093
exact hk - 0094
exact hcases_right_right_right_right - 0095
exact hsource - 0096
specialize htarget_preserve k - 0097
specialize htarget_preserve a - 0098
apply htarget_preserve - 0099
exact hk - 0100
exact hcases_right_right_left - 0101
exact hcases_right_right_right_left - 0102
exact hold_target