PA0054

beta_reindex_alignment_swap_last

Stable checked-use theorem · independently closed

Simultaneous interior/final swaps of an index code and target factors preserve alignment.

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.

  1. 0001intro r
  2. 0002intro s
  3. 0003intro u
  4. 0004intro v
  5. 0005intro b
  6. 0006intro c
  7. 0007intro z
  8. 0008intro d
  9. 0009intro w
  10. 0010intro e
  11. 0011intro n
  12. 0012intro i
  13. 0013intro m
  14. 0014intro x
  15. 0015intro y
  16. 0016intro hmap_i
  17. 0017intro hmap_n
  18. 0018intro hmap_preserve
  19. 0019intro hsource_m
  20. 0020intro hsource_n
  21. 0021intro htarget_i
  22. 0022intro htarget_n
  23. 0023intro htarget_preserve
  24. 0024intro haligned
  25. 0025have 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))))
  26. 0026specialize beta_prefix_swap_last_reflect r
  27. 0027specialize beta_prefix_swap_last_reflect s
  28. 0028specialize beta_prefix_swap_last_reflect u
  29. 0029specialize beta_prefix_swap_last_reflect v
  30. 0030specialize beta_prefix_swap_last_reflect n
  31. 0031specialize beta_prefix_swap_last_reflect i
  32. 0032specialize beta_prefix_swap_last_reflect n
  33. 0033specialize beta_prefix_swap_last_reflect m
  34. 0034apply beta_prefix_swap_last_reflect
  35. 0035exact hmap_i
  36. 0036exact hmap_n
  37. 0037exact hmap_preserve
  38. 0038intro k
  39. 0039intro j
  40. 0040intro a
  41. 0041intro hk
  42. 0042intro hmap
  43. 0043intro hsource
  44. 0044specialize hreflect k
  45. 0045specialize hreflect j
  46. 0046have 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))))
  47. 0047apply hreflect
  48. 0048exact hk
  49. 0049exact hmap
  50. 0050cases hcases
  51. 0051cases hcases_left
  52. 0052have hay : a = y
  53. 0053specialize beta_at_unique b
  54. 0054specialize beta_at_unique c
  55. 0055specialize beta_at_unique m
  56. 0056specialize beta_at_unique a
  57. 0057specialize beta_at_unique y
  58. 0058apply beta_at_unique
  59. 0059rewrite hcases_left_right at hsource
  60. 0060rewrite hcases_left_right at hsource
  61. 0061exact hsource
  62. 0062exact hsource_m
  63. 0063rewrite hcases_left_left
  64. 0064rewrite hcases_left_left
  65. 0065rewrite hay
  66. 0066rewrite hay
  67. 0067exact htarget_i
  68. 0068cases hcases_right
  69. 0069cases hcases_right_left
  70. 0070have hax : a = x
  71. 0071specialize beta_at_unique b
  72. 0072specialize beta_at_unique c
  73. 0073specialize beta_at_unique n
  74. 0074specialize beta_at_unique a
  75. 0075specialize beta_at_unique x
  76. 0076apply beta_at_unique
  77. 0077rewrite hcases_right_left_right at hsource
  78. 0078rewrite hcases_right_left_right at hsource
  79. 0079exact hsource
  80. 0080exact hsource_n
  81. 0081rewrite hcases_right_left_left
  82. 0082rewrite hcases_right_left_left
  83. 0083rewrite hax
  84. 0084rewrite hax
  85. 0085exact htarget_n
  86. 0086cases hcases_right_right
  87. 0087cases hcases_right_right_right
  88. 0088have hold_target : ((exists h. h + S a = S ((S k) * d)) /\ exists q. z = q * S ((S k) * d) + a)
  89. 0089specialize haligned k
  90. 0090specialize haligned j
  91. 0091specialize haligned a
  92. 0092apply haligned
  93. 0093exact hk
  94. 0094exact hcases_right_right_right_right
  95. 0095exact hsource
  96. 0096specialize htarget_preserve k
  97. 0097specialize htarget_preserve a
  98. 0098apply htarget_preserve
  99. 0099exact hk
  100. 0100exact hcases_right_right_left
  101. 0101exact hcases_right_right_right_left
  102. 0102exact hold_target