PA007X

beta_product_permutation_invariant

Alpha v16 checked-use theorem · independently closed; not Stable

A bounded injective beta-coded reindexing preserves the exact finite product.

Exact expanded PA statement

forall l r s b c z d p q. (forall fp_i_reindex_bounded. (exists fp_gap_reindex_bounded_index. fp_gap_reindex_bounded_index + S fp_i_reindex_bounded = l) -> exists fp_value_reindex_bounded. ((((exists ff_h_reindex_bounded_entry. ff_h_reindex_bounded_entry + S (fp_value_reindex_bounded) = S ((S (fp_i_reindex_bounded)) * s)) /\ exists ff_q_reindex_bounded_entry. r = ff_q_reindex_bounded_entry * S ((S (fp_i_reindex_bounded)) * s) + (fp_value_reindex_bounded))) /\ (exists fp_gap_reindex_bounded_value. fp_gap_reindex_bounded_value + S fp_value_reindex_bounded = l))) -> (forall fp_i_reindex_injective fp_j_reindex_injective fp_value_reindex_injective. (exists fp_gap_reindex_injective_i. fp_gap_reindex_injective_i + S fp_i_reindex_injective = l) -> (exists fp_gap_reindex_injective_j. fp_gap_reindex_injective_j + S fp_j_reindex_injective = l) -> (((exists ff_h_reindex_injective_left. ff_h_reindex_injective_left + S (fp_value_reindex_injective) = S ((S (fp_i_reindex_injective)) * s)) /\ exists ff_q_reindex_injective_left. r = ff_q_reindex_injective_left * S ((S (fp_i_reindex_injective)) * s) + (fp_value_reindex_injective))) -> (((exists ff_h_reindex_injective_right. ff_h_reindex_injective_right + S (fp_value_reindex_injective) = S ((S (fp_j_reindex_injective)) * s)) /\ exists ff_q_reindex_injective_right. r = ff_q_reindex_injective_right * S ((S (fp_j_reindex_injective)) * s) + (fp_value_reindex_injective))) -> fp_i_reindex_injective = fp_j_reindex_injective) -> (forall fpr_i_reindex_aligned fpr_j_reindex_aligned fpr_x_reindex_aligned. (exists fpr_h_reindex_aligned. fpr_h_reindex_aligned + S fpr_i_reindex_aligned = l) -> (((exists ff_h_reindex_aligned_map. ff_h_reindex_aligned_map + S (fpr_j_reindex_aligned) = S ((S (fpr_i_reindex_aligned)) * s)) /\ exists ff_q_reindex_aligned_map. r = ff_q_reindex_aligned_map * S ((S (fpr_i_reindex_aligned)) * s) + (fpr_j_reindex_aligned))) -> (((exists ff_h_reindex_aligned_source. ff_h_reindex_aligned_source + S (fpr_x_reindex_aligned) = S ((S (fpr_j_reindex_aligned)) * c)) /\ exists ff_q_reindex_aligned_source. b = ff_q_reindex_aligned_source * S ((S (fpr_j_reindex_aligned)) * c) + (fpr_x_reindex_aligned))) -> (((exists ff_h_reindex_aligned_target. ff_h_reindex_aligned_target + S (fpr_x_reindex_aligned) = S ((S (fpr_i_reindex_aligned)) * d)) /\ exists ff_q_reindex_aligned_target. z = ff_q_reindex_aligned_target * S ((S (fpr_i_reindex_aligned)) * d) + (fpr_x_reindex_aligned)))) -> (exists ff_u_reindex_source_product ff_v_reindex_source_product. ((((exists ff_h_reindex_source_product_start. ff_h_reindex_source_product_start + S (1) = S ((S (0)) * ff_v_reindex_source_product)) /\ exists ff_q_reindex_source_product_start. ff_u_reindex_source_product = ff_q_reindex_source_product_start * S ((S (0)) * ff_v_reindex_source_product) + (1))) /\ ((((exists ff_h_reindex_source_product_terminal. ff_h_reindex_source_product_terminal + S (p) = S ((S (l)) * ff_v_reindex_source_product)) /\ exists ff_q_reindex_source_product_terminal. ff_u_reindex_source_product = ff_q_reindex_source_product_terminal * S ((S (l)) * ff_v_reindex_source_product) + (p))) /\ forall ff_i_reindex_source_product. (exists ff_lt_reindex_source_product_bound. ff_lt_reindex_source_product_bound + S ff_i_reindex_source_product = l) -> exists ff_p_reindex_source_product ff_r_reindex_source_product ff_s_reindex_source_product. ((((exists ff_h_reindex_source_product_factor. ff_h_reindex_source_product_factor + S (ff_p_reindex_source_product) = S ((S (ff_i_reindex_source_product)) * c)) /\ exists ff_q_reindex_source_product_factor. b = ff_q_reindex_source_product_factor * S ((S (ff_i_reindex_source_product)) * c) + (ff_p_reindex_source_product))) /\ ((((exists ff_h_reindex_source_product_partial. ff_h_reindex_source_product_partial + S (ff_r_reindex_source_product) = S ((S (ff_i_reindex_source_product)) * ff_v_reindex_source_product)) /\ exists ff_q_reindex_source_product_partial. ff_u_reindex_source_product = ff_q_reindex_source_product_partial * S ((S (ff_i_reindex_source_product)) * ff_v_reindex_source_product) + (ff_r_reindex_source_product))) /\ ((((exists ff_h_reindex_source_product_successor. ff_h_reindex_source_product_successor + S (ff_s_reindex_source_product) = S ((S (S ff_i_reindex_source_product)) * ff_v_reindex_source_product)) /\ exists ff_q_reindex_source_product_successor. ff_u_reindex_source_product = ff_q_reindex_source_product_successor * S ((S (S ff_i_reindex_source_product)) * ff_v_reindex_source_product) + (ff_s_reindex_source_product))) /\ ff_s_reindex_source_product = ff_r_reindex_source_product * ff_p_reindex_source_product)))))) -> (exists ff_u_reindex_target_product ff_v_reindex_target_product. ((((exists ff_h_reindex_target_product_start. ff_h_reindex_target_product_start + S (1) = S ((S (0)) * ff_v_reindex_target_product)) /\ exists ff_q_reindex_target_product_start. ff_u_reindex_target_product = ff_q_reindex_target_product_start * S ((S (0)) * ff_v_reindex_target_product) + (1))) /\ ((((exists ff_h_reindex_target_product_terminal. ff_h_reindex_target_product_terminal + S (q) = S ((S (l)) * ff_v_reindex_target_product)) /\ exists ff_q_reindex_target_product_terminal. ff_u_reindex_target_product = ff_q_reindex_target_product_terminal * S ((S (l)) * ff_v_reindex_target_product) + (q))) /\ forall ff_i_reindex_target_product. (exists ff_lt_reindex_target_product_bound. ff_lt_reindex_target_product_bound + S ff_i_reindex_target_product = l) -> exists ff_p_reindex_target_product ff_r_reindex_target_product ff_s_reindex_target_product. ((((exists ff_h_reindex_target_product_factor. ff_h_reindex_target_product_factor + S (ff_p_reindex_target_product) = S ((S (ff_i_reindex_target_product)) * d)) /\ exists ff_q_reindex_target_product_factor. z = ff_q_reindex_target_product_factor * S ((S (ff_i_reindex_target_product)) * d) + (ff_p_reindex_target_product))) /\ ((((exists ff_h_reindex_target_product_partial. ff_h_reindex_target_product_partial + S (ff_r_reindex_target_product) = S ((S (ff_i_reindex_target_product)) * ff_v_reindex_target_product)) /\ exists ff_q_reindex_target_product_partial. ff_u_reindex_target_product = ff_q_reindex_target_product_partial * S ((S (ff_i_reindex_target_product)) * ff_v_reindex_target_product) + (ff_r_reindex_target_product))) /\ ((((exists ff_h_reindex_target_product_successor. ff_h_reindex_target_product_successor + S (ff_s_reindex_target_product) = S ((S (S ff_i_reindex_target_product)) * ff_v_reindex_target_product)) /\ exists ff_q_reindex_target_product_successor. ff_u_reindex_target_product = ff_q_reindex_target_product_successor * S ((S (S ff_i_reindex_target_product)) * ff_v_reindex_target_product) + (ff_s_reindex_target_product))) /\ ff_s_reindex_target_product = ff_r_reindex_target_product * ff_p_reindex_target_product)))))) -> p = q

Structural proof guide

Generated structural guide

A bounded injective beta-coded reindexing preserves the exact finite product.

Use the direct prerequisites finite_bounded_injective_surjective, finite_lt_succ_eq_or_lt, finite_fixed_last_prefix_bounded, finite_injective_prefix_succ, beta_prefix_swap_last_from_entries, finite_swap_last_bounded, finite_swap_last_injective, beta_product_swap_last_invariant, beta_product_zero, beta_product_exists, beta_at_exists, beta_at_unique, beta_reindex_alignment_swap_last, beta_product_reindex_fixed_last, le_refl, le_succ as previously established PA formulas.

The proof proceeds by structural induction (1), case analysis (16), intermediate claims (30), equality transport (4).

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 Alpha-v16 checked-use theorem is independently kernel-checked when replayed; it is not a Stable theorem.

  1. 0001induction l
  2. 0002intro r
  3. 0003intro s
  4. 0004intro b
  5. 0005intro c
  6. 0006intro z
  7. 0007intro d
  8. 0008intro p
  9. 0009intro q
  10. 0010intro hbounded
  11. 0011intro hinjective
  12. 0012intro haligned
  13. 0013intro hsource_product
  14. 0014intro htarget_product
  15. 0015have hp : p = 1
  16. 0016specialize beta_product_zero b
  17. 0017specialize beta_product_zero c
  18. 0018specialize beta_product_zero p
  19. 0019apply beta_product_zero
  20. 0020exact hsource_product
  21. 0021have hq : q = 1
  22. 0022specialize beta_product_zero z
  23. 0023specialize beta_product_zero d
  24. 0024specialize beta_product_zero q
  25. 0025apply beta_product_zero
  26. 0026exact htarget_product
  27. 0027trans 1
  28. 0028exact hp
  29. 0029symm
  30. 0030exact hq
  31. 0031intro r
  32. 0032intro s
  33. 0033intro b
  34. 0034intro c
  35. 0035intro z
  36. 0036intro d
  37. 0037intro p
  38. 0038intro q
  39. 0039intro hbounded
  40. 0040intro hinjective
  41. 0041intro haligned
  42. 0042intro hsource_product
  43. 0043intro htarget_product
  44. 0044have hsurjective : forall fp_value_reindex_surjective_succ. (exists fp_gap_reindex_surjective_succ_value. fp_gap_reindex_surjective_succ_value + S fp_value_reindex_surjective_succ = S l) -> exists fp_i_reindex_surjective_succ. ((exists fp_gap_reindex_surjective_succ_index. fp_gap_reindex_surjective_succ_index + S fp_i_reindex_surjective_succ = S l) /\ (((exists ff_h_reindex_surjective_succ_entry. ff_h_reindex_surjective_succ_entry + S (fp_value_reindex_surjective_succ) = S ((S (fp_i_reindex_surjective_succ)) * s)) /\ exists ff_q_reindex_surjective_succ_entry. r = ff_q_reindex_surjective_succ_entry * S ((S (fp_i_reindex_surjective_succ)) * s) + (fp_value_reindex_surjective_succ))))
  45. 0045specialize finite_bounded_injective_surjective (S l)
  46. 0046specialize finite_bounded_injective_surjective r
  47. 0047specialize finite_bounded_injective_surjective s
  48. 0048apply finite_bounded_injective_surjective
  49. 0049exact hbounded
  50. 0050exact hinjective
  51. 0051have hlast_bound : exists h. h + S l = S l
  52. 0052specialize le_refl (S l)
  53. 0053exact le_refl
  54. 0054have hpreimage : exists k. ((exists h. h + S k = S l) /\ (((exists ff_h_reindex_map_preimage. ff_h_reindex_map_preimage + S (l) = S ((S (k)) * s)) /\ exists ff_q_reindex_map_preimage. r = ff_q_reindex_map_preimage * S ((S (k)) * s) + (l))))
  55. 0055specialize hsurjective l
  56. 0056apply hsurjective
  57. 0057exact hlast_bound
  58. 0058cases hpreimage
  59. 0059cases hpreimage_witness
  60. 0060have hsource_last : exists a. (((exists ff_h_reindex_source_last. ff_h_reindex_source_last + S (a) = S ((S (l)) * c)) /\ exists ff_q_reindex_source_last. b = ff_q_reindex_source_last * S ((S (l)) * c) + (a)))
  61. 0061specialize beta_at_exists b
  62. 0062specialize beta_at_exists c
  63. 0063specialize beta_at_exists l
  64. 0064exact beta_at_exists
  65. 0065cases hsource_last
  66. 0066have htarget_at_preimage : ((exists ff_h_reindex_target_preimage. ff_h_reindex_target_preimage + S (x1) = S ((S (x)) * d)) /\ exists ff_q_reindex_target_preimage. z = ff_q_reindex_target_preimage * S ((S (x)) * d) + (x1))
  67. 0067specialize haligned x
  68. 0068specialize haligned l
  69. 0069specialize haligned x1
  70. 0070apply haligned
  71. 0071exact hpreimage_witness_left
  72. 0072exact hpreimage_witness_right
  73. 0073exact hsource_last_witness
  74. 0074have hsplit : x = l \/ exists h. h + S x = l
  75. 0075specialize finite_lt_succ_eq_or_lt l
  76. 0076specialize finite_lt_succ_eq_or_lt x
  77. 0077apply finite_lt_succ_eq_or_lt
  78. 0078exact hpreimage_witness_left
  79. 0079cases hsplit
  80. 0080have hmap_last : ((exists ff_h_reindex_map_last. ff_h_reindex_map_last + S (l) = S ((S (l)) * s)) /\ exists ff_q_reindex_map_last. r = ff_q_reindex_map_last * S ((S (l)) * s) + (l))
  81. 0081rewrite hsplit_left at hpreimage_witness_right
  82. 0082rewrite hsplit_left at hpreimage_witness_right
  83. 0083exact hpreimage_witness_right
  84. 0084have hbounded_prefix : forall fp_i_reindex_bounded_prefix. (exists fp_gap_reindex_bounded_prefix_index. fp_gap_reindex_bounded_prefix_index + S fp_i_reindex_bounded_prefix = l) -> exists fp_value_reindex_bounded_prefix. ((((exists ff_h_reindex_bounded_prefix_entry. ff_h_reindex_bounded_prefix_entry + S (fp_value_reindex_bounded_prefix) = S ((S (fp_i_reindex_bounded_prefix)) * s)) /\ exists ff_q_reindex_bounded_prefix_entry. r = ff_q_reindex_bounded_prefix_entry * S ((S (fp_i_reindex_bounded_prefix)) * s) + (fp_value_reindex_bounded_prefix))) /\ (exists fp_gap_reindex_bounded_prefix_value. fp_gap_reindex_bounded_prefix_value + S fp_value_reindex_bounded_prefix = l))
  85. 0085specialize finite_fixed_last_prefix_bounded r
  86. 0086specialize finite_fixed_last_prefix_bounded s
  87. 0087specialize finite_fixed_last_prefix_bounded l
  88. 0088apply finite_fixed_last_prefix_bounded
  89. 0089exact hbounded
  90. 0090exact hinjective
  91. 0091exact hmap_last
  92. 0092have hinjective_prefix : forall fp_i_reindex_injective_prefix fp_j_reindex_injective_prefix fp_value_reindex_injective_prefix. (exists fp_gap_reindex_injective_prefix_i. fp_gap_reindex_injective_prefix_i + S fp_i_reindex_injective_prefix = l) -> (exists fp_gap_reindex_injective_prefix_j. fp_gap_reindex_injective_prefix_j + S fp_j_reindex_injective_prefix = l) -> (((exists ff_h_reindex_injective_prefix_left. ff_h_reindex_injective_prefix_left + S (fp_value_reindex_injective_prefix) = S ((S (fp_i_reindex_injective_prefix)) * s)) /\ exists ff_q_reindex_injective_prefix_left. r = ff_q_reindex_injective_prefix_left * S ((S (fp_i_reindex_injective_prefix)) * s) + (fp_value_reindex_injective_prefix))) -> (((exists ff_h_reindex_injective_prefix_right. ff_h_reindex_injective_prefix_right + S (fp_value_reindex_injective_prefix) = S ((S (fp_j_reindex_injective_prefix)) * s)) /\ exists ff_q_reindex_injective_prefix_right. r = ff_q_reindex_injective_prefix_right * S ((S (fp_j_reindex_injective_prefix)) * s) + (fp_value_reindex_injective_prefix))) -> fp_i_reindex_injective_prefix = fp_j_reindex_injective_prefix
  93. 0093specialize finite_injective_prefix_succ r
  94. 0094specialize finite_injective_prefix_succ s
  95. 0095specialize finite_injective_prefix_succ l
  96. 0096specialize finite_injective_prefix_succ (S l)
  97. 0097apply finite_injective_prefix_succ
  98. 0098refl
  99. 0099exact hinjective
  100. 0100have haligned_prefix : forall fpr_i_reindex_aligned_prefix fpr_j_reindex_aligned_prefix fpr_x_reindex_aligned_prefix. (exists fpr_h_reindex_aligned_prefix. fpr_h_reindex_aligned_prefix + S fpr_i_reindex_aligned_prefix = l) -> (((exists ff_h_reindex_aligned_prefix_map. ff_h_reindex_aligned_prefix_map + S (fpr_j_reindex_aligned_prefix) = S ((S (fpr_i_reindex_aligned_prefix)) * s)) /\ exists ff_q_reindex_aligned_prefix_map. r = ff_q_reindex_aligned_prefix_map * S ((S (fpr_i_reindex_aligned_prefix)) * s) + (fpr_j_reindex_aligned_prefix))) -> (((exists ff_h_reindex_aligned_prefix_source. ff_h_reindex_aligned_prefix_source + S (fpr_x_reindex_aligned_prefix) = S ((S (fpr_j_reindex_aligned_prefix)) * c)) /\ exists ff_q_reindex_aligned_prefix_source. b = ff_q_reindex_aligned_prefix_source * S ((S (fpr_j_reindex_aligned_prefix)) * c) + (fpr_x_reindex_aligned_prefix))) -> (((exists ff_h_reindex_aligned_prefix_target. ff_h_reindex_aligned_prefix_target + S (fpr_x_reindex_aligned_prefix) = S ((S (fpr_i_reindex_aligned_prefix)) * d)) /\ exists ff_q_reindex_aligned_prefix_target. z = ff_q_reindex_aligned_prefix_target * S ((S (fpr_i_reindex_aligned_prefix)) * d) + (fpr_x_reindex_aligned_prefix)))
  101. 0101intro i
  102. 0102intro j
  103. 0103intro a
  104. 0104intro hi
  105. 0105intro hmap
  106. 0106intro hsource
  107. 0107specialize haligned i
  108. 0108specialize haligned j
  109. 0109specialize haligned a
  110. 0110apply haligned
  111. 0111specialize le_succ (S i)
  112. 0112specialize le_succ l
  113. 0113apply le_succ
  114. 0114exact hi
  115. 0115exact hmap
  116. 0116exact hsource
  117. 0117have hprefix_products_equal : forall u v. (exists ff_u_reindex_source_prefix_product ff_v_reindex_source_prefix_product. ((((exists ff_h_reindex_source_prefix_product_start. ff_h_reindex_source_prefix_product_start + S (1) = S ((S (0)) * ff_v_reindex_source_prefix_product)) /\ exists ff_q_reindex_source_prefix_product_start. ff_u_reindex_source_prefix_product = ff_q_reindex_source_prefix_product_start * S ((S (0)) * ff_v_reindex_source_prefix_product) + (1))) /\ ((((exists ff_h_reindex_source_prefix_product_terminal. ff_h_reindex_source_prefix_product_terminal + S (u) = S ((S (l)) * ff_v_reindex_source_prefix_product)) /\ exists ff_q_reindex_source_prefix_product_terminal. ff_u_reindex_source_prefix_product = ff_q_reindex_source_prefix_product_terminal * S ((S (l)) * ff_v_reindex_source_prefix_product) + (u))) /\ forall ff_i_reindex_source_prefix_product. (exists ff_lt_reindex_source_prefix_product_bound. ff_lt_reindex_source_prefix_product_bound + S ff_i_reindex_source_prefix_product = l) -> exists ff_p_reindex_source_prefix_product ff_r_reindex_source_prefix_product ff_s_reindex_source_prefix_product. ((((exists ff_h_reindex_source_prefix_product_factor. ff_h_reindex_source_prefix_product_factor + S (ff_p_reindex_source_prefix_product) = S ((S (ff_i_reindex_source_prefix_product)) * c)) /\ exists ff_q_reindex_source_prefix_product_factor. b = ff_q_reindex_source_prefix_product_factor * S ((S (ff_i_reindex_source_prefix_product)) * c) + (ff_p_reindex_source_prefix_product))) /\ ((((exists ff_h_reindex_source_prefix_product_partial. ff_h_reindex_source_prefix_product_partial + S (ff_r_reindex_source_prefix_product) = S ((S (ff_i_reindex_source_prefix_product)) * ff_v_reindex_source_prefix_product)) /\ exists ff_q_reindex_source_prefix_product_partial. ff_u_reindex_source_prefix_product = ff_q_reindex_source_prefix_product_partial * S ((S (ff_i_reindex_source_prefix_product)) * ff_v_reindex_source_prefix_product) + (ff_r_reindex_source_prefix_product))) /\ ((((exists ff_h_reindex_source_prefix_product_successor. ff_h_reindex_source_prefix_product_successor + S (ff_s_reindex_source_prefix_product) = S ((S (S ff_i_reindex_source_prefix_product)) * ff_v_reindex_source_prefix_product)) /\ exists ff_q_reindex_source_prefix_product_successor. ff_u_reindex_source_prefix_product = ff_q_reindex_source_prefix_product_successor * S ((S (S ff_i_reindex_source_prefix_product)) * ff_v_reindex_source_prefix_product) + (ff_s_reindex_source_prefix_product))) /\ ff_s_reindex_source_prefix_product = ff_r_reindex_source_prefix_product * ff_p_reindex_source_prefix_product)))))) -> (exists ff_u_reindex_target_prefix_product ff_v_reindex_target_prefix_product. ((((exists ff_h_reindex_target_prefix_product_start. ff_h_reindex_target_prefix_product_start + S (1) = S ((S (0)) * ff_v_reindex_target_prefix_product)) /\ exists ff_q_reindex_target_prefix_product_start. ff_u_reindex_target_prefix_product = ff_q_reindex_target_prefix_product_start * S ((S (0)) * ff_v_reindex_target_prefix_product) + (1))) /\ ((((exists ff_h_reindex_target_prefix_product_terminal. ff_h_reindex_target_prefix_product_terminal + S (v) = S ((S (l)) * ff_v_reindex_target_prefix_product)) /\ exists ff_q_reindex_target_prefix_product_terminal. ff_u_reindex_target_prefix_product = ff_q_reindex_target_prefix_product_terminal * S ((S (l)) * ff_v_reindex_target_prefix_product) + (v))) /\ forall ff_i_reindex_target_prefix_product. (exists ff_lt_reindex_target_prefix_product_bound. ff_lt_reindex_target_prefix_product_bound + S ff_i_reindex_target_prefix_product = l) -> exists ff_p_reindex_target_prefix_product ff_r_reindex_target_prefix_product ff_s_reindex_target_prefix_product. ((((exists ff_h_reindex_target_prefix_product_factor. ff_h_reindex_target_prefix_product_factor + S (ff_p_reindex_target_prefix_product) = S ((S (ff_i_reindex_target_prefix_product)) * d)) /\ exists ff_q_reindex_target_prefix_product_factor. z = ff_q_reindex_target_prefix_product_factor * S ((S (ff_i_reindex_target_prefix_product)) * d) + (ff_p_reindex_target_prefix_product))) /\ ((((exists ff_h_reindex_target_prefix_product_partial. ff_h_reindex_target_prefix_product_partial + S (ff_r_reindex_target_prefix_product) = S ((S (ff_i_reindex_target_prefix_product)) * ff_v_reindex_target_prefix_product)) /\ exists ff_q_reindex_target_prefix_product_partial. ff_u_reindex_target_prefix_product = ff_q_reindex_target_prefix_product_partial * S ((S (ff_i_reindex_target_prefix_product)) * ff_v_reindex_target_prefix_product) + (ff_r_reindex_target_prefix_product))) /\ ((((exists ff_h_reindex_target_prefix_product_successor. ff_h_reindex_target_prefix_product_successor + S (ff_s_reindex_target_prefix_product) = S ((S (S ff_i_reindex_target_prefix_product)) * ff_v_reindex_target_prefix_product)) /\ exists ff_q_reindex_target_prefix_product_successor. ff_u_reindex_target_prefix_product = ff_q_reindex_target_prefix_product_successor * S ((S (S ff_i_reindex_target_prefix_product)) * ff_v_reindex_target_prefix_product) + (ff_s_reindex_target_prefix_product))) /\ ff_s_reindex_target_prefix_product = ff_r_reindex_target_prefix_product * ff_p_reindex_target_prefix_product)))))) -> u = v
  118. 0118intro u
  119. 0119intro v
  120. 0120intro hsource_prefix_product
  121. 0121intro htarget_prefix_product
  122. 0122specialize IH r
  123. 0123specialize IH s
  124. 0124specialize IH b
  125. 0125specialize IH c
  126. 0126specialize IH z
  127. 0127specialize IH d
  128. 0128specialize IH u
  129. 0129specialize IH v
  130. 0130apply IH
  131. 0131exact hbounded_prefix
  132. 0132exact hinjective_prefix
  133. 0133exact haligned_prefix
  134. 0134exact hsource_prefix_product
  135. 0135exact htarget_prefix_product
  136. 0136specialize beta_product_reindex_fixed_last r
  137. 0137specialize beta_product_reindex_fixed_last s
  138. 0138specialize beta_product_reindex_fixed_last b
  139. 0139specialize beta_product_reindex_fixed_last c
  140. 0140specialize beta_product_reindex_fixed_last z
  141. 0141specialize beta_product_reindex_fixed_last d
  142. 0142specialize beta_product_reindex_fixed_last l
  143. 0143specialize beta_product_reindex_fixed_last p
  144. 0144specialize beta_product_reindex_fixed_last q
  145. 0145apply beta_product_reindex_fixed_last
  146. 0146exact haligned
  147. 0147exact hmap_last
  148. 0148exact hsource_product
  149. 0149exact htarget_product
  150. 0150exact hprefix_products_equal
  151. 0151have hmap_last_decoded : exists m. (((exists ff_h_reindex_map_decoded_last. ff_h_reindex_map_decoded_last + S (m) = S ((S (l)) * s)) /\ exists ff_q_reindex_map_decoded_last. r = ff_q_reindex_map_decoded_last * S ((S (l)) * s) + (m)))
  152. 0152specialize beta_at_exists r
  153. 0153specialize beta_at_exists s
  154. 0154specialize beta_at_exists l
  155. 0155exact beta_at_exists
  156. 0156cases hmap_last_decoded
  157. 0157have htarget_last_decoded : exists w. (((exists ff_h_reindex_target_decoded_last. ff_h_reindex_target_decoded_last + S (w) = S ((S (l)) * d)) /\ exists ff_q_reindex_target_decoded_last. z = ff_q_reindex_target_decoded_last * S ((S (l)) * d) + (w)))
  158. 0158specialize beta_at_exists z
  159. 0159specialize beta_at_exists d
  160. 0160specialize beta_at_exists l
  161. 0161exact beta_at_exists
  162. 0162cases htarget_last_decoded
  163. 0163have hmap_swap : exists rm sm. (((exists ff_h_reindex_map_swap_i. ff_h_reindex_map_swap_i + S (x2) = S ((S (x)) * sm)) /\ exists ff_q_reindex_map_swap_i. rm = ff_q_reindex_map_swap_i * S ((S (x)) * sm) + (x2))) /\ ((((exists ff_h_reindex_map_swap_last. ff_h_reindex_map_swap_last + S (l) = S ((S (l)) * sm)) /\ exists ff_q_reindex_map_swap_last. rm = ff_q_reindex_map_swap_last * S ((S (l)) * sm) + (l))) /\ forall j a. (exists h. h + S j = S l) -> ~(j = x) -> ~(j = l) -> (((exists ff_h_reindex_map_swap_old. ff_h_reindex_map_swap_old + S (a) = S ((S (j)) * s)) /\ exists ff_q_reindex_map_swap_old. r = ff_q_reindex_map_swap_old * S ((S (j)) * s) + (a))) -> (((exists ff_h_reindex_map_swap_new. ff_h_reindex_map_swap_new + S (a) = S ((S (j)) * sm)) /\ exists ff_q_reindex_map_swap_new. rm = ff_q_reindex_map_swap_new * S ((S (j)) * sm) + (a))))
  164. 0164specialize beta_prefix_swap_last_from_entries r
  165. 0165specialize beta_prefix_swap_last_from_entries s
  166. 0166specialize beta_prefix_swap_last_from_entries l
  167. 0167specialize beta_prefix_swap_last_from_entries x
  168. 0168specialize beta_prefix_swap_last_from_entries l
  169. 0169specialize beta_prefix_swap_last_from_entries x2
  170. 0170apply beta_prefix_swap_last_from_entries
  171. 0171exact hsplit_right
  172. 0172exact hpreimage_witness_right
  173. 0173exact hmap_last_decoded_witness
  174. 0174cases hmap_swap
  175. 0175cases hmap_swap_witness
  176. 0176cases hmap_swap_witness_witness
  177. 0177cases hmap_swap_witness_witness_right
  178. 0178have htarget_swap : exists tz td. (((exists ff_h_reindex_target_swap_i. ff_h_reindex_target_swap_i + S (x3) = S ((S (x)) * td)) /\ exists ff_q_reindex_target_swap_i. tz = ff_q_reindex_target_swap_i * S ((S (x)) * td) + (x3))) /\ ((((exists ff_h_reindex_target_swap_last. ff_h_reindex_target_swap_last + S (x1) = S ((S (l)) * td)) /\ exists ff_q_reindex_target_swap_last. tz = ff_q_reindex_target_swap_last * S ((S (l)) * td) + (x1))) /\ forall j a. (exists h. h + S j = S l) -> ~(j = x) -> ~(j = l) -> (((exists ff_h_reindex_target_swap_old. ff_h_reindex_target_swap_old + S (a) = S ((S (j)) * d)) /\ exists ff_q_reindex_target_swap_old. z = ff_q_reindex_target_swap_old * S ((S (j)) * d) + (a))) -> (((exists ff_h_reindex_target_swap_new. ff_h_reindex_target_swap_new + S (a) = S ((S (j)) * td)) /\ exists ff_q_reindex_target_swap_new. tz = ff_q_reindex_target_swap_new * S ((S (j)) * td) + (a))))
  179. 0179specialize beta_prefix_swap_last_from_entries z
  180. 0180specialize beta_prefix_swap_last_from_entries d
  181. 0181specialize beta_prefix_swap_last_from_entries l
  182. 0182specialize beta_prefix_swap_last_from_entries x
  183. 0183specialize beta_prefix_swap_last_from_entries x1
  184. 0184specialize beta_prefix_swap_last_from_entries x3
  185. 0185apply beta_prefix_swap_last_from_entries
  186. 0186exact hsplit_right
  187. 0187exact htarget_at_preimage
  188. 0188exact htarget_last_decoded_witness
  189. 0189cases htarget_swap
  190. 0190cases htarget_swap_witness
  191. 0191cases htarget_swap_witness_witness
  192. 0192cases htarget_swap_witness_witness_right
  193. 0193have hswapped_bounded : forall fp_i_reindex_swapped_bounded. (exists fp_gap_reindex_swapped_bounded_index. fp_gap_reindex_swapped_bounded_index + S fp_i_reindex_swapped_bounded = S l) -> exists fp_value_reindex_swapped_bounded. ((((exists ff_h_reindex_swapped_bounded_entry. ff_h_reindex_swapped_bounded_entry + S (fp_value_reindex_swapped_bounded) = S ((S (fp_i_reindex_swapped_bounded)) * x5)) /\ exists ff_q_reindex_swapped_bounded_entry. x4 = ff_q_reindex_swapped_bounded_entry * S ((S (fp_i_reindex_swapped_bounded)) * x5) + (fp_value_reindex_swapped_bounded))) /\ (exists fp_gap_reindex_swapped_bounded_value. fp_gap_reindex_swapped_bounded_value + S fp_value_reindex_swapped_bounded = S l))
  194. 0194specialize finite_swap_last_bounded r
  195. 0195specialize finite_swap_last_bounded s
  196. 0196specialize finite_swap_last_bounded x4
  197. 0197specialize finite_swap_last_bounded x5
  198. 0198specialize finite_swap_last_bounded l
  199. 0199specialize finite_swap_last_bounded (S l)
  200. 0200specialize finite_swap_last_bounded x
  201. 0201specialize finite_swap_last_bounded l
  202. 0202specialize finite_swap_last_bounded x2
  203. 0203apply finite_swap_last_bounded
  204. 0204refl
  205. 0205exact hsplit_right
  206. 0206exact hbounded
  207. 0207exact hpreimage_witness_right
  208. 0208exact hmap_last_decoded_witness
  209. 0209exact hmap_swap_witness_witness_left
  210. 0210exact hmap_swap_witness_witness_right_left
  211. 0211exact hmap_swap_witness_witness_right_right
  212. 0212have hswapped_injective : forall fp_i_reindex_swapped_injective fp_j_reindex_swapped_injective fp_value_reindex_swapped_injective. (exists fp_gap_reindex_swapped_injective_i. fp_gap_reindex_swapped_injective_i + S fp_i_reindex_swapped_injective = S l) -> (exists fp_gap_reindex_swapped_injective_j. fp_gap_reindex_swapped_injective_j + S fp_j_reindex_swapped_injective = S l) -> (((exists ff_h_reindex_swapped_injective_left. ff_h_reindex_swapped_injective_left + S (fp_value_reindex_swapped_injective) = S ((S (fp_i_reindex_swapped_injective)) * x5)) /\ exists ff_q_reindex_swapped_injective_left. x4 = ff_q_reindex_swapped_injective_left * S ((S (fp_i_reindex_swapped_injective)) * x5) + (fp_value_reindex_swapped_injective))) -> (((exists ff_h_reindex_swapped_injective_right. ff_h_reindex_swapped_injective_right + S (fp_value_reindex_swapped_injective) = S ((S (fp_j_reindex_swapped_injective)) * x5)) /\ exists ff_q_reindex_swapped_injective_right. x4 = ff_q_reindex_swapped_injective_right * S ((S (fp_j_reindex_swapped_injective)) * x5) + (fp_value_reindex_swapped_injective))) -> fp_i_reindex_swapped_injective = fp_j_reindex_swapped_injective
  213. 0213specialize finite_swap_last_injective r
  214. 0214specialize finite_swap_last_injective s
  215. 0215specialize finite_swap_last_injective x4
  216. 0216specialize finite_swap_last_injective x5
  217. 0217specialize finite_swap_last_injective l
  218. 0218specialize finite_swap_last_injective (S l)
  219. 0219specialize finite_swap_last_injective x
  220. 0220specialize finite_swap_last_injective l
  221. 0221specialize finite_swap_last_injective x2
  222. 0222apply finite_swap_last_injective
  223. 0223refl
  224. 0224exact hsplit_right
  225. 0225exact hinjective
  226. 0226exact hpreimage_witness_right
  227. 0227exact hmap_last_decoded_witness
  228. 0228exact hmap_swap_witness_witness_left
  229. 0229exact hmap_swap_witness_witness_right_left
  230. 0230exact hmap_swap_witness_witness_right_right
  231. 0231have hswapped_target_product_exists : exists t. (exists ff_u_reindex_swapped_target_exists ff_v_reindex_swapped_target_exists. ((((exists ff_h_reindex_swapped_target_exists_start. ff_h_reindex_swapped_target_exists_start + S (1) = S ((S (0)) * ff_v_reindex_swapped_target_exists)) /\ exists ff_q_reindex_swapped_target_exists_start. ff_u_reindex_swapped_target_exists = ff_q_reindex_swapped_target_exists_start * S ((S (0)) * ff_v_reindex_swapped_target_exists) + (1))) /\ ((((exists ff_h_reindex_swapped_target_exists_terminal. ff_h_reindex_swapped_target_exists_terminal + S (t) = S ((S (S l)) * ff_v_reindex_swapped_target_exists)) /\ exists ff_q_reindex_swapped_target_exists_terminal. ff_u_reindex_swapped_target_exists = ff_q_reindex_swapped_target_exists_terminal * S ((S (S l)) * ff_v_reindex_swapped_target_exists) + (t))) /\ forall ff_i_reindex_swapped_target_exists. (exists ff_lt_reindex_swapped_target_exists_bound. ff_lt_reindex_swapped_target_exists_bound + S ff_i_reindex_swapped_target_exists = S l) -> exists ff_p_reindex_swapped_target_exists ff_r_reindex_swapped_target_exists ff_s_reindex_swapped_target_exists. ((((exists ff_h_reindex_swapped_target_exists_factor. ff_h_reindex_swapped_target_exists_factor + S (ff_p_reindex_swapped_target_exists) = S ((S (ff_i_reindex_swapped_target_exists)) * x7)) /\ exists ff_q_reindex_swapped_target_exists_factor. x6 = ff_q_reindex_swapped_target_exists_factor * S ((S (ff_i_reindex_swapped_target_exists)) * x7) + (ff_p_reindex_swapped_target_exists))) /\ ((((exists ff_h_reindex_swapped_target_exists_partial. ff_h_reindex_swapped_target_exists_partial + S (ff_r_reindex_swapped_target_exists) = S ((S (ff_i_reindex_swapped_target_exists)) * ff_v_reindex_swapped_target_exists)) /\ exists ff_q_reindex_swapped_target_exists_partial. ff_u_reindex_swapped_target_exists = ff_q_reindex_swapped_target_exists_partial * S ((S (ff_i_reindex_swapped_target_exists)) * ff_v_reindex_swapped_target_exists) + (ff_r_reindex_swapped_target_exists))) /\ ((((exists ff_h_reindex_swapped_target_exists_successor. ff_h_reindex_swapped_target_exists_successor + S (ff_s_reindex_swapped_target_exists) = S ((S (S ff_i_reindex_swapped_target_exists)) * ff_v_reindex_swapped_target_exists)) /\ exists ff_q_reindex_swapped_target_exists_successor. ff_u_reindex_swapped_target_exists = ff_q_reindex_swapped_target_exists_successor * S ((S (S ff_i_reindex_swapped_target_exists)) * ff_v_reindex_swapped_target_exists) + (ff_s_reindex_swapped_target_exists))) /\ ff_s_reindex_swapped_target_exists = ff_r_reindex_swapped_target_exists * ff_p_reindex_swapped_target_exists))))))
  232. 0232specialize beta_product_exists x6
  233. 0233specialize beta_product_exists x7
  234. 0234specialize beta_product_exists (S l)
  235. 0235exact beta_product_exists
  236. 0236cases hswapped_target_product_exists
  237. 0237have htarget_product_swap : q = x8
  238. 0238specialize beta_product_swap_last_invariant z
  239. 0239specialize beta_product_swap_last_invariant d
  240. 0240specialize beta_product_swap_last_invariant x6
  241. 0241specialize beta_product_swap_last_invariant x7
  242. 0242specialize beta_product_swap_last_invariant l
  243. 0243specialize beta_product_swap_last_invariant x
  244. 0244specialize beta_product_swap_last_invariant x1
  245. 0245specialize beta_product_swap_last_invariant x3
  246. 0246specialize beta_product_swap_last_invariant q
  247. 0247specialize beta_product_swap_last_invariant x8
  248. 0248apply beta_product_swap_last_invariant
  249. 0249exact hsplit_right
  250. 0250exact htarget_at_preimage
  251. 0251exact htarget_last_decoded_witness
  252. 0252exact htarget_swap_witness_witness_left
  253. 0253exact htarget_swap_witness_witness_right_left
  254. 0254exact htarget_swap_witness_witness_right_right
  255. 0255exact htarget_product
  256. 0256exact hswapped_target_product_exists_witness
  257. 0257have hsource_at_map_last : ((exists ff_h_reindex_source_at_map_last. ff_h_reindex_source_at_map_last + S (x3) = S ((S (x2)) * c)) /\ exists ff_q_reindex_source_at_map_last. b = ff_q_reindex_source_at_map_last * S ((S (x2)) * c) + (x3))
  258. 0258specialize beta_at_exists b
  259. 0259specialize beta_at_exists c
  260. 0260specialize beta_at_exists x2
  261. 0261cases beta_at_exists
  262. 0262have htarget_from_map_last : ((exists ff_h_reindex_target_from_map_last. ff_h_reindex_target_from_map_last + S (x9) = S ((S (l)) * d)) /\ exists ff_q_reindex_target_from_map_last. z = ff_q_reindex_target_from_map_last * S ((S (l)) * d) + (x9))
  263. 0263specialize haligned l
  264. 0264specialize haligned x2
  265. 0265specialize haligned x9
  266. 0266apply haligned
  267. 0267exact hlast_bound
  268. 0268exact hmap_last_decoded_witness
  269. 0269exact beta_at_exists_witness
  270. 0270have hmap_last_value : x9 = x3
  271. 0271specialize beta_at_unique z
  272. 0272specialize beta_at_unique d
  273. 0273specialize beta_at_unique l
  274. 0274specialize beta_at_unique x9
  275. 0275specialize beta_at_unique x3
  276. 0276apply beta_at_unique
  277. 0277exact htarget_from_map_last
  278. 0278exact htarget_last_decoded_witness
  279. 0279rewrite hmap_last_value at beta_at_exists_witness
  280. 0280rewrite hmap_last_value at beta_at_exists_witness
  281. 0281exact beta_at_exists_witness
  282. 0282have hswapped_aligned : forall fpr_i_reindex_swapped_aligned fpr_j_reindex_swapped_aligned fpr_x_reindex_swapped_aligned. (exists fpr_h_reindex_swapped_aligned. fpr_h_reindex_swapped_aligned + S fpr_i_reindex_swapped_aligned = S l) -> (((exists ff_h_reindex_swapped_aligned_map. ff_h_reindex_swapped_aligned_map + S (fpr_j_reindex_swapped_aligned) = S ((S (fpr_i_reindex_swapped_aligned)) * x5)) /\ exists ff_q_reindex_swapped_aligned_map. x4 = ff_q_reindex_swapped_aligned_map * S ((S (fpr_i_reindex_swapped_aligned)) * x5) + (fpr_j_reindex_swapped_aligned))) -> (((exists ff_h_reindex_swapped_aligned_source. ff_h_reindex_swapped_aligned_source + S (fpr_x_reindex_swapped_aligned) = S ((S (fpr_j_reindex_swapped_aligned)) * c)) /\ exists ff_q_reindex_swapped_aligned_source. b = ff_q_reindex_swapped_aligned_source * S ((S (fpr_j_reindex_swapped_aligned)) * c) + (fpr_x_reindex_swapped_aligned))) -> (((exists ff_h_reindex_swapped_aligned_target. ff_h_reindex_swapped_aligned_target + S (fpr_x_reindex_swapped_aligned) = S ((S (fpr_i_reindex_swapped_aligned)) * x7)) /\ exists ff_q_reindex_swapped_aligned_target. x6 = ff_q_reindex_swapped_aligned_target * S ((S (fpr_i_reindex_swapped_aligned)) * x7) + (fpr_x_reindex_swapped_aligned)))
  283. 0283specialize beta_reindex_alignment_swap_last r
  284. 0284specialize beta_reindex_alignment_swap_last s
  285. 0285specialize beta_reindex_alignment_swap_last x4
  286. 0286specialize beta_reindex_alignment_swap_last x5
  287. 0287specialize beta_reindex_alignment_swap_last b
  288. 0288specialize beta_reindex_alignment_swap_last c
  289. 0289specialize beta_reindex_alignment_swap_last z
  290. 0290specialize beta_reindex_alignment_swap_last d
  291. 0291specialize beta_reindex_alignment_swap_last x6
  292. 0292specialize beta_reindex_alignment_swap_last x7
  293. 0293specialize beta_reindex_alignment_swap_last l
  294. 0294specialize beta_reindex_alignment_swap_last x
  295. 0295specialize beta_reindex_alignment_swap_last x2
  296. 0296specialize beta_reindex_alignment_swap_last x1
  297. 0297specialize beta_reindex_alignment_swap_last x3
  298. 0298apply beta_reindex_alignment_swap_last
  299. 0299exact hmap_swap_witness_witness_left
  300. 0300exact hmap_swap_witness_witness_right_left
  301. 0301exact hmap_swap_witness_witness_right_right
  302. 0302exact hsource_at_map_last
  303. 0303exact hsource_last_witness
  304. 0304exact htarget_swap_witness_witness_left
  305. 0305exact htarget_swap_witness_witness_right_left
  306. 0306exact htarget_swap_witness_witness_right_right
  307. 0307exact haligned
  308. 0308have hswapped_bounded_prefix : forall fp_i_reindex_swapped_bounded_prefix. (exists fp_gap_reindex_swapped_bounded_prefix_index. fp_gap_reindex_swapped_bounded_prefix_index + S fp_i_reindex_swapped_bounded_prefix = l) -> exists fp_value_reindex_swapped_bounded_prefix. ((((exists ff_h_reindex_swapped_bounded_prefix_entry. ff_h_reindex_swapped_bounded_prefix_entry + S (fp_value_reindex_swapped_bounded_prefix) = S ((S (fp_i_reindex_swapped_bounded_prefix)) * x5)) /\ exists ff_q_reindex_swapped_bounded_prefix_entry. x4 = ff_q_reindex_swapped_bounded_prefix_entry * S ((S (fp_i_reindex_swapped_bounded_prefix)) * x5) + (fp_value_reindex_swapped_bounded_prefix))) /\ (exists fp_gap_reindex_swapped_bounded_prefix_value. fp_gap_reindex_swapped_bounded_prefix_value + S fp_value_reindex_swapped_bounded_prefix = l))
  309. 0309specialize finite_fixed_last_prefix_bounded x4
  310. 0310specialize finite_fixed_last_prefix_bounded x5
  311. 0311specialize finite_fixed_last_prefix_bounded l
  312. 0312apply finite_fixed_last_prefix_bounded
  313. 0313exact hswapped_bounded
  314. 0314exact hswapped_injective
  315. 0315exact hmap_swap_witness_witness_right_left
  316. 0316have hswapped_injective_prefix : forall fp_i_reindex_swapped_injective_prefix fp_j_reindex_swapped_injective_prefix fp_value_reindex_swapped_injective_prefix. (exists fp_gap_reindex_swapped_injective_prefix_i. fp_gap_reindex_swapped_injective_prefix_i + S fp_i_reindex_swapped_injective_prefix = l) -> (exists fp_gap_reindex_swapped_injective_prefix_j. fp_gap_reindex_swapped_injective_prefix_j + S fp_j_reindex_swapped_injective_prefix = l) -> (((exists ff_h_reindex_swapped_injective_prefix_left. ff_h_reindex_swapped_injective_prefix_left + S (fp_value_reindex_swapped_injective_prefix) = S ((S (fp_i_reindex_swapped_injective_prefix)) * x5)) /\ exists ff_q_reindex_swapped_injective_prefix_left. x4 = ff_q_reindex_swapped_injective_prefix_left * S ((S (fp_i_reindex_swapped_injective_prefix)) * x5) + (fp_value_reindex_swapped_injective_prefix))) -> (((exists ff_h_reindex_swapped_injective_prefix_right. ff_h_reindex_swapped_injective_prefix_right + S (fp_value_reindex_swapped_injective_prefix) = S ((S (fp_j_reindex_swapped_injective_prefix)) * x5)) /\ exists ff_q_reindex_swapped_injective_prefix_right. x4 = ff_q_reindex_swapped_injective_prefix_right * S ((S (fp_j_reindex_swapped_injective_prefix)) * x5) + (fp_value_reindex_swapped_injective_prefix))) -> fp_i_reindex_swapped_injective_prefix = fp_j_reindex_swapped_injective_prefix
  317. 0317specialize finite_injective_prefix_succ x4
  318. 0318specialize finite_injective_prefix_succ x5
  319. 0319specialize finite_injective_prefix_succ l
  320. 0320specialize finite_injective_prefix_succ (S l)
  321. 0321apply finite_injective_prefix_succ
  322. 0322refl
  323. 0323exact hswapped_injective
  324. 0324have hswapped_aligned_prefix : forall fpr_i_reindex_swapped_aligned_prefix fpr_j_reindex_swapped_aligned_prefix fpr_x_reindex_swapped_aligned_prefix. (exists fpr_h_reindex_swapped_aligned_prefix. fpr_h_reindex_swapped_aligned_prefix + S fpr_i_reindex_swapped_aligned_prefix = l) -> (((exists ff_h_reindex_swapped_aligned_prefix_map. ff_h_reindex_swapped_aligned_prefix_map + S (fpr_j_reindex_swapped_aligned_prefix) = S ((S (fpr_i_reindex_swapped_aligned_prefix)) * x5)) /\ exists ff_q_reindex_swapped_aligned_prefix_map. x4 = ff_q_reindex_swapped_aligned_prefix_map * S ((S (fpr_i_reindex_swapped_aligned_prefix)) * x5) + (fpr_j_reindex_swapped_aligned_prefix))) -> (((exists ff_h_reindex_swapped_aligned_prefix_source. ff_h_reindex_swapped_aligned_prefix_source + S (fpr_x_reindex_swapped_aligned_prefix) = S ((S (fpr_j_reindex_swapped_aligned_prefix)) * c)) /\ exists ff_q_reindex_swapped_aligned_prefix_source. b = ff_q_reindex_swapped_aligned_prefix_source * S ((S (fpr_j_reindex_swapped_aligned_prefix)) * c) + (fpr_x_reindex_swapped_aligned_prefix))) -> (((exists ff_h_reindex_swapped_aligned_prefix_target. ff_h_reindex_swapped_aligned_prefix_target + S (fpr_x_reindex_swapped_aligned_prefix) = S ((S (fpr_i_reindex_swapped_aligned_prefix)) * x7)) /\ exists ff_q_reindex_swapped_aligned_prefix_target. x6 = ff_q_reindex_swapped_aligned_prefix_target * S ((S (fpr_i_reindex_swapped_aligned_prefix)) * x7) + (fpr_x_reindex_swapped_aligned_prefix)))
  325. 0325intro i
  326. 0326intro j
  327. 0327intro a
  328. 0328intro hi
  329. 0329intro hmap
  330. 0330intro hsource
  331. 0331specialize hswapped_aligned i
  332. 0332specialize hswapped_aligned j
  333. 0333specialize hswapped_aligned a
  334. 0334apply hswapped_aligned
  335. 0335specialize le_succ (S i)
  336. 0336specialize le_succ l
  337. 0337apply le_succ
  338. 0338exact hi
  339. 0339exact hmap
  340. 0340exact hsource
  341. 0341have hswapped_prefix_products_equal : forall u v. (exists ff_u_reindex_source_prefix_product ff_v_reindex_source_prefix_product. ((((exists ff_h_reindex_source_prefix_product_start. ff_h_reindex_source_prefix_product_start + S (1) = S ((S (0)) * ff_v_reindex_source_prefix_product)) /\ exists ff_q_reindex_source_prefix_product_start. ff_u_reindex_source_prefix_product = ff_q_reindex_source_prefix_product_start * S ((S (0)) * ff_v_reindex_source_prefix_product) + (1))) /\ ((((exists ff_h_reindex_source_prefix_product_terminal. ff_h_reindex_source_prefix_product_terminal + S (u) = S ((S (l)) * ff_v_reindex_source_prefix_product)) /\ exists ff_q_reindex_source_prefix_product_terminal. ff_u_reindex_source_prefix_product = ff_q_reindex_source_prefix_product_terminal * S ((S (l)) * ff_v_reindex_source_prefix_product) + (u))) /\ forall ff_i_reindex_source_prefix_product. (exists ff_lt_reindex_source_prefix_product_bound. ff_lt_reindex_source_prefix_product_bound + S ff_i_reindex_source_prefix_product = l) -> exists ff_p_reindex_source_prefix_product ff_r_reindex_source_prefix_product ff_s_reindex_source_prefix_product. ((((exists ff_h_reindex_source_prefix_product_factor. ff_h_reindex_source_prefix_product_factor + S (ff_p_reindex_source_prefix_product) = S ((S (ff_i_reindex_source_prefix_product)) * c)) /\ exists ff_q_reindex_source_prefix_product_factor. b = ff_q_reindex_source_prefix_product_factor * S ((S (ff_i_reindex_source_prefix_product)) * c) + (ff_p_reindex_source_prefix_product))) /\ ((((exists ff_h_reindex_source_prefix_product_partial. ff_h_reindex_source_prefix_product_partial + S (ff_r_reindex_source_prefix_product) = S ((S (ff_i_reindex_source_prefix_product)) * ff_v_reindex_source_prefix_product)) /\ exists ff_q_reindex_source_prefix_product_partial. ff_u_reindex_source_prefix_product = ff_q_reindex_source_prefix_product_partial * S ((S (ff_i_reindex_source_prefix_product)) * ff_v_reindex_source_prefix_product) + (ff_r_reindex_source_prefix_product))) /\ ((((exists ff_h_reindex_source_prefix_product_successor. ff_h_reindex_source_prefix_product_successor + S (ff_s_reindex_source_prefix_product) = S ((S (S ff_i_reindex_source_prefix_product)) * ff_v_reindex_source_prefix_product)) /\ exists ff_q_reindex_source_prefix_product_successor. ff_u_reindex_source_prefix_product = ff_q_reindex_source_prefix_product_successor * S ((S (S ff_i_reindex_source_prefix_product)) * ff_v_reindex_source_prefix_product) + (ff_s_reindex_source_prefix_product))) /\ ff_s_reindex_source_prefix_product = ff_r_reindex_source_prefix_product * ff_p_reindex_source_prefix_product)))))) -> (exists ff_u_reindex_swapped_target_prefix_product ff_v_reindex_swapped_target_prefix_product. ((((exists ff_h_reindex_swapped_target_prefix_product_start. ff_h_reindex_swapped_target_prefix_product_start + S (1) = S ((S (0)) * ff_v_reindex_swapped_target_prefix_product)) /\ exists ff_q_reindex_swapped_target_prefix_product_start. ff_u_reindex_swapped_target_prefix_product = ff_q_reindex_swapped_target_prefix_product_start * S ((S (0)) * ff_v_reindex_swapped_target_prefix_product) + (1))) /\ ((((exists ff_h_reindex_swapped_target_prefix_product_terminal. ff_h_reindex_swapped_target_prefix_product_terminal + S (v) = S ((S (l)) * ff_v_reindex_swapped_target_prefix_product)) /\ exists ff_q_reindex_swapped_target_prefix_product_terminal. ff_u_reindex_swapped_target_prefix_product = ff_q_reindex_swapped_target_prefix_product_terminal * S ((S (l)) * ff_v_reindex_swapped_target_prefix_product) + (v))) /\ forall ff_i_reindex_swapped_target_prefix_product. (exists ff_lt_reindex_swapped_target_prefix_product_bound. ff_lt_reindex_swapped_target_prefix_product_bound + S ff_i_reindex_swapped_target_prefix_product = l) -> exists ff_p_reindex_swapped_target_prefix_product ff_r_reindex_swapped_target_prefix_product ff_s_reindex_swapped_target_prefix_product. ((((exists ff_h_reindex_swapped_target_prefix_product_factor. ff_h_reindex_swapped_target_prefix_product_factor + S (ff_p_reindex_swapped_target_prefix_product) = S ((S (ff_i_reindex_swapped_target_prefix_product)) * x7)) /\ exists ff_q_reindex_swapped_target_prefix_product_factor. x6 = ff_q_reindex_swapped_target_prefix_product_factor * S ((S (ff_i_reindex_swapped_target_prefix_product)) * x7) + (ff_p_reindex_swapped_target_prefix_product))) /\ ((((exists ff_h_reindex_swapped_target_prefix_product_partial. ff_h_reindex_swapped_target_prefix_product_partial + S (ff_r_reindex_swapped_target_prefix_product) = S ((S (ff_i_reindex_swapped_target_prefix_product)) * ff_v_reindex_swapped_target_prefix_product)) /\ exists ff_q_reindex_swapped_target_prefix_product_partial. ff_u_reindex_swapped_target_prefix_product = ff_q_reindex_swapped_target_prefix_product_partial * S ((S (ff_i_reindex_swapped_target_prefix_product)) * ff_v_reindex_swapped_target_prefix_product) + (ff_r_reindex_swapped_target_prefix_product))) /\ ((((exists ff_h_reindex_swapped_target_prefix_product_successor. ff_h_reindex_swapped_target_prefix_product_successor + S (ff_s_reindex_swapped_target_prefix_product) = S ((S (S ff_i_reindex_swapped_target_prefix_product)) * ff_v_reindex_swapped_target_prefix_product)) /\ exists ff_q_reindex_swapped_target_prefix_product_successor. ff_u_reindex_swapped_target_prefix_product = ff_q_reindex_swapped_target_prefix_product_successor * S ((S (S ff_i_reindex_swapped_target_prefix_product)) * ff_v_reindex_swapped_target_prefix_product) + (ff_s_reindex_swapped_target_prefix_product))) /\ ff_s_reindex_swapped_target_prefix_product = ff_r_reindex_swapped_target_prefix_product * ff_p_reindex_swapped_target_prefix_product)))))) -> u = v
  342. 0342intro u
  343. 0343intro v
  344. 0344intro hsource_prefix_product
  345. 0345intro htarget_prefix_product
  346. 0346specialize IH x4
  347. 0347specialize IH x5
  348. 0348specialize IH b
  349. 0349specialize IH c
  350. 0350specialize IH x6
  351. 0351specialize IH x7
  352. 0352specialize IH u
  353. 0353specialize IH v
  354. 0354apply IH
  355. 0355exact hswapped_bounded_prefix
  356. 0356exact hswapped_injective_prefix
  357. 0357exact hswapped_aligned_prefix
  358. 0358exact hsource_prefix_product
  359. 0359exact htarget_prefix_product
  360. 0360have hproduct_swapped : p = x8
  361. 0361specialize beta_product_reindex_fixed_last x4
  362. 0362specialize beta_product_reindex_fixed_last x5
  363. 0363specialize beta_product_reindex_fixed_last b
  364. 0364specialize beta_product_reindex_fixed_last c
  365. 0365specialize beta_product_reindex_fixed_last x6
  366. 0366specialize beta_product_reindex_fixed_last x7
  367. 0367specialize beta_product_reindex_fixed_last l
  368. 0368specialize beta_product_reindex_fixed_last p
  369. 0369specialize beta_product_reindex_fixed_last x8
  370. 0370apply beta_product_reindex_fixed_last
  371. 0371exact hswapped_aligned
  372. 0372exact hmap_swap_witness_witness_right_left
  373. 0373exact hsource_product
  374. 0374exact hswapped_target_product_exists_witness
  375. 0375exact hswapped_prefix_products_equal
  376. 0376trans x8
  377. 0377exact hproduct_swapped
  378. 0378symm
  379. 0379exact htarget_product_swap