AFTD Auto-Formalizing Theoretical Domains

alpha_later_local_blocker_inherits_earlier

theoremverified

Every blocker of a later locally admissible even move is also a blocker of an earlier even move, with the same suffix-index parity after accounting for the inserted or deleted cell.

Statement

theorem alpha_later_local_blocker_inherits_earlier (a : List ℕ) (i j k : ℕ) (ha : alpha_is_lexical a) (hi0 : 0 < i) (hi : i < a.length) (he : i % 2 = 0) (hij : i < j) (hj : j < a.length) (hje : j % 2 = 0) : let c := if 1 < a.getD i 0 then a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1) else a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1); let d := if 1 < a.getD j 0 then a.take j ++ [a.getD j 0 - 1, 1] ++ a.drop (j + 1) else a.take (j - 1) ++ [a.getD (j - 1) 0 + 1] ++ a.drop (j + 1); let bound := if 1 < a.getD j 0 then j + 1 else j - 1; (∀ s : ℕ, 0 < s → s < d.length → s ≤ bound → alpha_lexical_lt (d.drop s) d) → 0 < k → k < d.length → ¬ alpha_lexical_lt (d.drop k) d → let r := if 1 < a.getD j 0 then k - 1 else k + 1; let b := if 1 < a.getD i 0 then r + 1 else r - 1; j < r ∧ b < c.length ∧ b % 2 = k % 2 ∧ ¬ alpha_lexical_lt (c.drop b) c
Source
Blocking-suffix inheritance for OP-392, arXiv:2610.24758; alternating lexical order and moves as in arXiv:0810.5205.
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 6

The proof, explained

To show that any blocker k of a later locally admissible even move d induces a blocker b of an earlier even move c, the argument first observes that k must exceed the modification site of d, so the suffix d.drop k equals an untouched suffix a.drop r of the original sequence. Because the move producing c occurs even earlier, the corresponding suffix c.drop b matches the exact same tail a.drop r with the same index parity. Finally, because an earlier even move produces a strictly smaller sequence in the alternating lexical order (c < d), any validity c.drop b < c would imply d.drop k < d by transitivity, contradicting that k blocks d.

  1. For any index i ≥ a.length, the signed cell value at i is zero.

    Since i is out of bounds, a.getD i 0 returns 0. Both cases of the sign (+0 and -0) reduce to 0.

    lines 3–6

    uses List.getD_eq_default

      simp only [alpha_signed_cell]
      have : a.getD i 0 = 0 := List.getD_eq_default a 0 h
      rw [this]
      split_ifs <;> simp
  2. The alternating lexical order is transitive when the first difference index between x and y is strictly less than that between y and z.

    Since i < j, y and z agree at all indices up to j, so z agrees with y on the prefix up to i, giving x[k] = z[k] for all k < i and x[i] < z[i] in signed value.

    lines 11–27

    uses alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le, lt_trichotomy

      rcases hxy with ⟨i, hi, hxy_eq, hxy_lt⟩
      rcases hyz with ⟨j, hj, hyz_eq, hyz_lt⟩
      rcases lt_trichotomy i j with hij | hij | hji
      · refine ⟨i, ?_, ?_, ?_⟩
        · have hne : alpha_signed_cell x i ≠ alpha_signed_cell z i := by
            rw [← hyz_eq i hij]
            linarith
          by_contra! hle
          have hx : alpha_signed_cell x i = 0 :=
            alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le x i (by omega)
          have hz : alpha_signed_cell z i = 0 :=
            alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le z i (by omega)
          exact hne (hx.trans hz.symm)
        · intro k hk
          rw [hxy_eq k hk, hyz_eq k (by omega)]
        · rw [← hyz_eq i hij]
          exact hxy_lt
  3. The alternating lexical order is transitive when the first difference indices coincide (i = j).

    Both x and z agree with y on indices strictly before i, so they agree with each other; at index i, signed values satisfy x[i] < y[i] < z[i], whence x[i] < z[i].

    lines 28–39

    uses alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le

      · subst hij
        refine ⟨i, ?_, ?_, ?_⟩
        · have hne : alpha_signed_cell x i ≠ alpha_signed_cell z i := by linarith
          by_contra! hle
          have hx : alpha_signed_cell x i = 0 :=
            alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le x i (by omega)
          have hz : alpha_signed_cell z i = 0 :=
            alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le z i (by omega)
          exact hne (hx.trans hz.symm)
        · intro k hk
          rw [hxy_eq k hk, hyz_eq k hk]
        · linarith
  4. The alternating lexical order is transitive when the first difference index between y and z is strictly less than that between x and y.

    Symmetrically, since j < i, x and y agree up to i > j, so x agrees with y up to index j. Thus x and z agree on all indices before j, and x[j] = y[j] < z[j] in signed value.

    lines 40–53

    uses alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le

      · refine ⟨j, ?_, ?_, ?_⟩
        · have hne : alpha_signed_cell x j ≠ alpha_signed_cell z j := by
            rw [hxy_eq j hji]
            linarith
          by_contra! hle
          have hx : alpha_signed_cell x j = 0 :=
            alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le x j (by omega)
          have hz : alpha_signed_cell z j = 0 :=
            alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le z j (by omega)
          exact hne (hx.trans hz.symm)
        · intro k hk
          rw [hxy_eq k (by omega), hyz_eq k hk]
        · rw [hxy_eq j hji]
          exact hyz_lt
  5. When a[j] > 1, for any offset k > j + 1, the suffix d.drop k equals a.drop (k - 1), with j < k - 1 < a.length.

    Splitting cell j into [a[j]-1, 1] inserts an extra cell, shifting elements after index j by one position to the right. Since k ≥ j + 2, dropping k elements skips past the prefix and both replacement cells, leaving the tail a.drop (k - 1).

    lines 63–82

    uses List.drop_append, List.drop_drop, List.drop_eq_nil_of_le, List.length_append, List.length_drop, List.length_take, List.nil_append

      dsimp only
      split_ifs at hklen hbound ⊢ with hjc
      · have hlen : (a.take j ++ [a.getD j 0 - 1, 1] ++ a.drop (j + 1)).length = a.length + 1 := by
          rw [List.length_append, List.length_append, List.length_take, List.length_drop]; simp; omega
        have hk2 : j + 2 ≤ k := by omega
        have hr_lt : k - 1 < a.length := by omega
        have hr_gt : j < k - 1 := by omega
        refine ⟨hr_gt, hr_lt, ?_⟩
        rw [List.drop_append, List.drop_append]
        have h1 : (a.take j).length = j := by rw [List.length_take]; omega
        have h2 : (a.take j ++ [a.getD j 0 - 1, 1]).length = j + 2 := by
          rw [List.length_append, h1]; simp
        rw [h1, h2]
        have hd1 : List.drop k (a.take j) = [] := List.drop_eq_nil_of_le (by omega)
        rw [hd1, List.nil_append]
        have hd2 : List.drop (k - j) [a.getD j 0 - 1, 1] = [] := by
          apply List.drop_eq_nil_of_le; simp; omega
        rw [hd2, List.nil_append, List.drop_drop]
        congr 1
        omega
  6. When a[j] ≤ 1, for any offset k > j - 1, the suffix d.drop k equals a.drop (k + 1), with j < k + 1 < a.length.

    Merging cell j into cell j - 1 deletes one cell, shifting elements after index j by one position to the left. Since k ≥ j, dropping k elements leaves the tail a.drop (k + 1).

    lines 83–100

    uses List.drop_append, List.drop_drop, List.drop_eq_nil_of_le, List.length_append, List.length_drop, List.length_take, List.nil_append

      · have hlen : (a.take (j - 1) ++ [a.getD (j - 1) 0 + 1] ++ a.drop (j + 1)).length = a.length - 1 := by
          rw [List.length_append, List.length_append, List.length_take, List.length_drop]; simp; omega
        have hk2 : j ≤ k := by omega
        have hr_lt : k + 1 < a.length := by omega
        have hr_gt : j < k + 1 := by omega
        refine ⟨hr_gt, hr_lt, ?_⟩
        rw [List.drop_append, List.drop_append]
        have h1 : (a.take (j - 1)).length = j - 1 := by rw [List.length_take]; omega
        have h2 : (a.take (j - 1) ++ [a.getD (j - 1) 0 + 1]).length = j := by
          rw [List.length_append, h1]; simp; omega
        rw [h1, h2]
        have hd1 : List.drop k (a.take (j - 1)) = [] := List.drop_eq_nil_of_le (by omega)
        rw [hd1, List.nil_append]
        have hd2 : List.drop (k - (j - 1)) [a.getD (j - 1) 0 + 1] = [] := by
          apply List.drop_eq_nil_of_le; simp; omega
        rw [hd2, List.nil_append, List.drop_drop]
        congr 1
        omega
  7. When a[i] > 1, for any offset r > i + 1, the suffix c.drop (r + 1) equals a.drop r, with r + 1 < c.length.

    Splitting cell i shifts elements past i by +1; since r > i + 1, dropping r + 1 elements from c recovers the tail a.drop r.

    lines 108–125

    uses List.drop_append, List.drop_drop, List.drop_eq_nil_of_le, List.length_append, List.length_drop, List.length_take, List.nil_append

      dsimp only
      split_ifs with hic
      · have hlen : (a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1)).length = a.length + 1 := by
          rw [List.length_append, List.length_append, List.length_take, List.length_drop]; simp; omega
        have hb_lt : r + 1 < (a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1)).length := by omega
        refine ⟨hb_lt, ?_⟩
        rw [List.drop_append, List.drop_append]
        have h1 : (a.take i).length = i := by rw [List.length_take]; omega
        have h2 : (a.take i ++ [a.getD i 0 - 1, 1]).length = i + 2 := by
          rw [List.length_append, h1]; simp
        rw [h1, h2]
        have hd1 : List.drop (r + 1) (a.take i) = [] := List.drop_eq_nil_of_le (by omega)
        rw [hd1, List.nil_append]
        have hd2 : List.drop (r + 1 - i) [a.getD i 0 - 1, 1] = [] := by
          apply List.drop_eq_nil_of_le; simp; omega
        rw [hd2, List.nil_append, List.drop_drop]
        congr 1
        omega
  8. When a[i] ≤ 1, for any offset r > i + 1, the suffix c.drop (r - 1) equals a.drop r, with r - 1 < c.length.

    Merging cell i shifts elements past i by -1; since r > i + 1, dropping r - 1 elements from c recovers the tail a.drop r.

    lines 126–141

    uses List.drop_append, List.drop_drop, List.drop_eq_nil_of_le, List.length_append, List.length_drop, List.length_take, List.nil_append

      · have hlen : (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1)).length = a.length - 1 := by
          rw [List.length_append, List.length_append, List.length_take, List.length_drop]; simp; omega
        have hb_lt : r - 1 < (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1)).length := by omega
        refine ⟨hb_lt, ?_⟩
        rw [List.drop_append, List.drop_append]
        have h1 : (a.take (i - 1)).length = i - 1 := by rw [List.length_take]; omega
        have h2 : (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1]).length = i := by
          rw [List.length_append, h1]; simp; omega
        rw [h1, h2]
        have hd1 : List.drop (r - 1) (a.take (i - 1)) = [] := List.drop_eq_nil_of_le (by omega)
        rw [hd1, List.nil_append]
        have hd2 : List.drop (r - 1 - (i - 1)) [a.getD (i - 1) 0 + 1] = [] := by
          apply List.drop_eq_nil_of_le; simp; omega
        rw [hd2, List.nil_append, List.drop_drop]
        congr 1
        omega
  9. The sequence d resulting from an even move at j agrees with a at all positions m ≤ i < j.

    Since i and j are even and i < j, we have i + 2 ≤ j. The move at j alters indices at or after j - 1 ≥ i + 1, leaving the prefix up to index i completely unchanged.

    lines 147–159

    uses List.getD_append, List.getD_eq_getElem, List.getElem_take, List.length_append, List.length_take

      have hij2 : i + 2 ≤ j := by omega
      have hma : m < a.length := by omega
      split_ifs with hjc
      · have h1 : (a.take j).length = j := by rw [List.length_take]; omega
        rw [List.getD_append _ (a.drop (j + 1)) 0 m (by rw [List.length_append, h1]; simp; omega)]
        rw [List.getD_append (a.take j) _ 0 m (by omega)]
        rw [List.getD_eq_getElem _ 0 (by omega), List.getElem_take]
        exact (List.getD_eq_getElem a 0 hma).symm
      · have h1 : (a.take (j - 1)).length = j - 1 := by rw [List.length_take]; omega
        rw [List.getD_append _ (a.drop (j + 1)) 0 m (by rw [List.length_append, h1]; simp; omega)]
        rw [List.getD_append (a.take (j - 1)) _ 0 m (by omega)]
        rw [List.getD_eq_getElem _ 0 (by omega), List.getElem_take]
        exact (List.getD_eq_getElem a 0 hma).symm
  10. When cell i is split, the resulting sequence agrees with a at all indices m < i.

    The split replaces cell i while preserving the prefix a.take i unchanged, so any index m < i falls entirely within the preserved prefix.

    lines 163–167

    uses List.getD_append, List.getD_eq_getElem, List.getElem_take, List.length_append, List.length_take

      have h1 : (a.take i).length = i := by rw [List.length_take]; omega
      rw [List.getD_append _ (a.drop (i + 1)) 0 m (by rw [List.length_append, h1]; simp; omega)]
      rw [List.getD_append (a.take i) _ 0 m (by omega)]
      rw [List.getD_eq_getElem _ 0 (by omega), List.getElem_take]
      exact (List.getD_eq_getElem a 0 (by omega)).symm
  11. When cell i is merged, the resulting sequence agrees with a at all indices m < i - 1.

    The merge modifies cell i - 1 and deletes cell i, leaving a.take (i - 1) untouched, so any index m < i - 1 matches a.

    lines 171–175

    uses List.getD_append, List.getD_eq_getElem, List.getElem_take, List.length_append, List.length_take

      have h1 : (a.take (i - 1)).length = i - 1 := by rw [List.length_take]; omega
      rw [List.getD_append _ (a.drop (i + 1)) 0 m (by rw [List.length_append, h1]; simp; omega)]
      rw [List.getD_append (a.take (i - 1)) _ 0 m (by omega)]
      rw [List.getD_eq_getElem _ 0 (by omega), List.getElem_take]
      exact (List.getD_eq_getElem a 0 (by omega)).symm
  12. When cell i is split, the value at index i is a[i] - 1.

    The prefix a.take i has length i, so index i lands on the first element of the replacement pair [a[i] - 1, 1].

    lines 179–186

    uses List.getD_append, List.getD_append_right, List.length_append, List.length_take

      have h1 : (a.take i).length = i := by rw [List.length_take]; omega
      have h2 : (a.take i ++ [a.getD i 0 - 1, 1]).length = i + 2 := by
        rw [List.length_append, h1]; simp
      rw [List.getD_append _ (a.drop (i + 1)) 0 i (by omega)]
      rw [List.getD_append_right (a.take i) [a.getD i 0 - 1, 1] 0 i (by omega)]
      have : i - (a.take i).length = 0 := by omega
      rw [this]
      rfl
  13. When cell i is merged, the value at index i - 1 is a[i - 1] + 1.

    The prefix a.take (i - 1) has length i - 1, so index i - 1 lands on the singleton [a[i - 1] + 1].

    lines 190–196

    uses List.getD_append, List.getD_append_right, List.length_append, List.length_take

      have h1 : (a.take (i - 1)).length = i - 1 := by rw [List.length_take]; omega
      have h2 : (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1]).length = i := by
        rw [List.length_append, h1]; simp; omega
      rw [List.getD_append _ (a.drop (i + 1)) 0 (i - 1) (by omega)]
      rw [List.getD_append_right (a.take (i - 1)) [a.getD (i - 1) 0 + 1] 0 (i - 1) (by omega)]
      have : i - 1 - (a.take (i - 1)).length = 0 := by omega
      rw [this]
  14. When a[i] > 1, the earlier even move at i yields a sequence c strictly smaller in alternating lexical order than d.

    Sequences c and d agree with a on all indices m < i. At index i (which is even), c has value a[i] - 1 while d has value a[i], so c[i] < d[i] in signed value, giving c < d.

    lines 205–232

    uses alpha_later_local_blocker_inherits_earlier_c_split_getD_at_i, alpha_later_local_blocker_inherits_earlier_c_split_getD_eq_a, alpha_later_local_blocker_inherits_earlier_d_getD_eq_a, if_pos, le_max_left, List.length_append, List.length_drop, List.length_take, lt_of_lt_of_le

        alpha_lexical_lt c d := by
      intro c d
      have hd_eq : ∀ m ≤ i, d.getD m 0 = a.getD m 0 :=
        alpha_later_local_blocker_inherits_earlier_d_getD_eq_a a i j hi hij hj he hje
      by_cases hic : 1 < a.getD i 0
      · change alpha_lexical_lt c d
        have hc_def : c = a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1) := by
          change (if 1 < a.getD i 0 then _ else _) = _
          rw [if_pos hic]
        refine ⟨i, ?_, ?_, ?_⟩
        · have hclen : c.length = a.length + 1 := by
            rw [hc_def, List.length_append, List.length_append, List.length_take, List.length_drop]
            simp; omega
          have h1 : i < c.length := by rw [hclen]; omega
          exact lt_of_lt_of_le h1 (le_max_left c.length d.length)
        · intro m hm
          unfold alpha_signed_cell
          have : c.getD m 0 = a.getD m 0 := by
            rw [hc_def]
            exact alpha_later_local_blocker_inherits_earlier_c_split_getD_eq_a a i m hi hm
          rw [this, hd_eq m (by omega)]
        · unfold alpha_signed_cell
          rw [he, if_pos rfl, if_pos rfl]
          have : c.getD i 0 = a.getD i 0 - 1 := by
            rw [hc_def]
            exact alpha_later_local_blocker_inherits_earlier_c_split_getD_at_i a i hi
          rw [this, hd_eq i (by omega)]
          omega
  15. When a[i] ≤ 1, the earlier even move at i yields a sequence c strictly smaller in alternating lexical order than d.

    Sequences c and d agree with a on all indices m < i - 1. At index i - 1 (which is odd since i is even), c has value a[i - 1] + 1 while d has value a[i - 1]. At odd positions larger values correspond to more negative signed cells, so c[i - 1] < d[i - 1], giving c < d.

    lines 233–256

    uses alpha_later_local_blocker_inherits_earlier_c_conj_getD_at_sub, alpha_later_local_blocker_inherits_earlier_c_conj_getD_eq_a, alpha_later_local_blocker_inherits_earlier_d_getD_eq_a, if_neg, le_max_left, List.length_append, List.length_drop, List.length_take, lt_of_lt_of_le

      · change alpha_lexical_lt c d
        have hc_def : c = a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1) := by
          change (if 1 < a.getD i 0 then _ else _) = _
          rw [if_neg hic]
        refine ⟨i - 1, ?_, ?_, ?_⟩
        · have hclen : c.length = a.length - 1 := by
            rw [hc_def, List.length_append, List.length_append, List.length_take, List.length_drop]
            simp; omega
          have h1 : i - 1 < c.length := by rw [hclen]; omega
          exact lt_of_lt_of_le h1 (le_max_left c.length d.length)
        · intro m hm
          unfold alpha_signed_cell
          have : c.getD m 0 = a.getD m 0 := by
            rw [hc_def]
            exact alpha_later_local_blocker_inherits_earlier_c_conj_getD_eq_a a i m hi0 hi hm
          rw [this, hd_eq m (by omega)]
        · unfold alpha_signed_cell
          have hne : ¬ (i - 1) % 2 = 0 := by omega
          rw [if_neg hne, if_neg hne]
          have : c.getD (i - 1) 0 = a.getD (i - 1) 0 + 1 := by
            rw [hc_def]
            exact alpha_later_local_blocker_inherits_earlier_c_conj_getD_at_sub a i hi0 hi
          rw [this, hd_eq (i - 1) (by omega)]
          omega
  16. The blocker offset k of d lies strictly beyond the modification bound at j.

    By hypothesis d has no blockers at or before bound. Since k is a blocker of d, it must satisfy bound < k.

    lines 259–263

      intro c d bound hearly hk0 hklen hblock r b
      have hj0 : 0 < j := by omega
      have hbound : bound < k := by
        by_contra! hle
        exact hblock (hearly k hk0 hklen hle)
  17. The suffixes d.drop k and c.drop b both coincide with the suffix a.drop r of the original sequence.

    Because k > bound, the suffix d.drop k lies beyond the modification at j and matches a.drop r. Since i < j < r, this tail also lies beyond the earlier move at i, so c.drop b matches the same suffix a.drop r.

    lines 264–268

    uses alpha_later_local_blocker_inherits_earlier_drop_c_eq_a, alpha_later_local_blocker_inherits_earlier_drop_d_eq_a

      have hd_res := alpha_later_local_blocker_inherits_earlier_drop_d_eq_a a j k hj0 hj hklen hbound
      rcases hd_res with ⟨hjr, hr_len, hdrop_d⟩
      have hir : i + 1 < r := by omega
      have hc_res := alpha_later_local_blocker_inherits_earlier_drop_c_eq_a a i r hi0 hi hir hr_len
      rcases hc_res with ⟨hb_len, hdrop_c⟩
  18. The shifted index b preserves the parity of k: b % 2 = k % 2. automation

    Shifting from k to r adds or subtracts 1, and shifting from r to b adds or subtracts 1, so b differs from k by 0 or ±2, preserving parity.

    lines 269–274

      have hk_ge2 : 2 ≤ k := by
        dsimp [bound] at hbound
        split_ifs at hbound with hjc <;> omega
      have hparity : b % 2 = k % 2 := by
        dsimp [r, b]
        split_ifs <;> omega
  19. The offset b is a blocker of c, concluding the proof.

    If c.drop b were not a blocker, then c.drop b < c. But c.drop b = d.drop k, and an earlier even move is lexicographically smaller than a later one (c < d). By transitivity of the lexical order, this would force d.drop k < d, contradicting that k is a blocker of d.

    lines 275–285

    uses alpha_later_local_blocker_inherits_earlier_c_lt_d, alpha_later_local_blocker_inherits_earlier_lexical_lt_trans

      refine ⟨hjr, hb_len, hparity, ?_⟩
      intro hcb
      have hcd : alpha_lexical_lt c d :=
        alpha_later_local_blocker_inherits_earlier_c_lt_d a i j hi0 hi hij hj he hje
      have hdrop_eq : c.drop b = d.drop k := by
        rw [hdrop_c, hdrop_d]
      have hdk_lt_c : alpha_lexical_lt (d.drop k) c := by
        rwa [← hdrop_eq]
      have hdk_lt_d : alpha_lexical_lt (d.drop k) d :=
        alpha_later_local_blocker_inherits_earlier_lexical_lt_trans (d.drop k) c d hdk_lt_c hcd
      exact hblock hdk_lt_d
alpha_later_local_blocker_inherits_earlier_c_lt_d
An earlier even move at position i produces a sequence c that is strictly smaller in alternating lexical order than the sequence d produced by a later even move at position j.
alpha_later_local_blocker_inherits_earlier_c_conj_getD_at_sub
When cell i is merged, the element at index i - 1 is a[i - 1] + 1.
alpha_later_local_blocker_inherits_earlier_c_conj_getD_eq_a
When cell i is merged, the resulting sequence agrees with a at all indices m < i - 1.
alpha_later_local_blocker_inherits_earlier_c_split_getD_at_i
When cell i is split, the element at index i is a[i] - 1.
alpha_later_local_blocker_inherits_earlier_c_split_getD_eq_a
When cell i is split, the resulting sequence agrees with a at all indices m < i.
alpha_later_local_blocker_inherits_earlier_d_getD_eq_a
The sequence d resulting from an even move at j agrees with a at all indices m ≤ i < j.
alpha_later_local_blocker_inherits_earlier_drop_c_eq_a
For an even move at position i and an offset r > i + 1, the suffix c.drop b equals a.drop r (where b = r + 1 if a[i] > 1 and b = r - 1 otherwise), with b < c.length.
alpha_later_local_blocker_inherits_earlier_drop_d_eq_a
For an even move at position j and an offset k beyond the local modification bound, the suffix d.drop k equals a.drop r (where r = k - 1 if a[j] > 1 and r = k + 1 otherwise), with j < r < a.length.
alpha_later_local_blocker_inherits_earlier_lexical_lt_trans
The alternating lexical order is transitive: if x < y and y < z, then x < z.
alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le
For any sequence a and any index i ≥ a.length, the signed cell value alpha_signed_cell a i is 0.
if_neg
If condition c is false, then (if c then t else e) = e.
if_pos
If condition c is true, then (if c then t else e) = t.
le_max_left
For any a and b in a linear order, a ≤ max a b.
List.drop_append
Dropping i elements from the concatenation l₁ ++ l₂ equals List.drop i l₁ ++ List.drop (i - l₁.length) l₂.
List.drop_drop
Dropping i elements from a list after already dropping j elements is equivalent to dropping j + i elements.
List.drop_eq_nil_of_le
Dropping i elements from a list of length at most i yields the empty list.
List.getD_append
For n < l.length, the element at index n in l ++ l' equals that in l.
List.getD_append_right
For n ≥ l.length, the element at index n in l ++ l' equals the element at index n - l.length in l'.
List.getD_eq_default
For an out-of-bounds index n ≥ l.length, l.getD n d returns the default value d.
List.getD_eq_getElem
For an in-bounds index n < l.length, l.getD n d equals the index projection l[n].
List.getElem_take
Taking j elements preserves indices i < j: (List.take j xs)[i] = xs[i].
List.length_append
The length of the concatenation as ++ bs is as.length + bs.length.
List.length_drop
The length of List.drop i l is l.length - i.
List.length_take
The length of List.take i l is min i l.length.
List.nil_append
Prepending the empty list to as yields as.
lt_of_lt_of_le
If a < b and b ≤ c in a preorder, then a < c.
lt_trichotomy
In any linear order, exactly one of a < b, a = b, or b < a holds.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le (a : List ℕ) (i : ℕ) (h : a.length ≤ i) :    alpha_signed_cell a i = 0 := by  simp only [alpha_signed_cell]  have : a.getD i 0 = 0 := List.getD_eq_default a 0 h  rw [this]  split_ifs <;> simptheorem alpha_later_local_blocker_inherits_earlier_lexical_lt_trans (x y z : List ℕ)    (hxy : alpha_lexical_lt x y) (hyz : alpha_lexical_lt y z) :    alpha_lexical_lt x z := by  rcases hxy with ⟨i, hi, hxy_eq, hxy_lt⟩  rcases hyz with ⟨j, hj, hyz_eq, hyz_lt⟩  rcases lt_trichotomy i j with hij | hij | hji  · refine ⟨i, ?_, ?_, ?_⟩    · have hne : alpha_signed_cell x i ≠ alpha_signed_cell z i := by        rw [← hyz_eq i hij]        linarith      by_contra! hle      have hx : alpha_signed_cell x i = 0 :=        alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le x i (by omega)      have hz : alpha_signed_cell z i = 0 :=        alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le z i (by omega)      exact hne (hx.trans hz.symm)    · intro k hk      rw [hxy_eq k hk, hyz_eq k (by omega)]    · rw [← hyz_eq i hij]      exact hxy_lt  · subst hij    refine ⟨i, ?_, ?_, ?_⟩    · have hne : alpha_signed_cell x i ≠ alpha_signed_cell z i := by linarith      by_contra! hle      have hx : alpha_signed_cell x i = 0 :=        alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le x i (by omega)      have hz : alpha_signed_cell z i = 0 :=        alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le z i (by omega)      exact hne (hx.trans hz.symm)    · intro k hk      rw [hxy_eq k hk, hyz_eq k hk]    · linarith  · refine ⟨j, ?_, ?_, ?_⟩    · have hne : alpha_signed_cell x j ≠ alpha_signed_cell z j := by        rw [hxy_eq j hji]        linarith      by_contra! hle      have hx : alpha_signed_cell x j = 0 :=        alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le x j (by omega)      have hz : alpha_signed_cell z j = 0 :=        alpha_later_local_blocker_inherits_earlier_signed_cell_eq_zero_of_length_le z j (by omega)      exact hne (hx.trans hz.symm)    · intro k hk      rw [hxy_eq k (by omega), hyz_eq k hk]    · rw [hxy_eq j hji]      exact hyz_lttheorem alpha_later_local_blocker_inherits_earlier_drop_d_eq_a (a : List ℕ) (j k : ℕ) (hj0 : 0 < j) (hj : j < a.length)    (hklen : k < (if 1 < a.getD j 0 then a.take j ++ [a.getD j 0 - 1, 1] ++ a.drop (j + 1)                  else a.take (j - 1) ++ [a.getD (j - 1) 0 + 1] ++ a.drop (j + 1)).length)    (hbound : (if 1 < a.getD j 0 then j + 1 else j - 1) < k) :    let d := if 1 < a.getD j 0 then a.take j ++ [a.getD j 0 - 1, 1] ++ a.drop (j + 1)             else a.take (j - 1) ++ [a.getD (j - 1) 0 + 1] ++ a.drop (j + 1)    let r := if 1 < a.getD j 0 then k - 1 else k + 1    j < r ∧ r < a.length ∧ d.drop k = a.drop r := by  dsimp only  split_ifs at hklen hbound ⊢ with hjc  · have hlen : (a.take j ++ [a.getD j 0 - 1, 1] ++ a.drop (j + 1)).length = a.length + 1 := by      rw [List.length_append, List.length_append, List.length_take, List.length_drop]; simp; omega    have hk2 : j + 2 ≤ k := by omega    have hr_lt : k - 1 < a.length := by omega    have hr_gt : j < k - 1 := by omega    refine ⟨hr_gt, hr_lt, ?_⟩    rw [List.drop_append, List.drop_append]    have h1 : (a.take j).length = j := by rw [List.length_take]; omega    have h2 : (a.take j ++ [a.getD j 0 - 1, 1]).length = j + 2 := by      rw [List.length_append, h1]; simp    rw [h1, h2]    have hd1 : List.drop k (a.take j) = [] := List.drop_eq_nil_of_le (by omega)    rw [hd1, List.nil_append]    have hd2 : List.drop (k - j) [a.getD j 0 - 1, 1] = [] := by      apply List.drop_eq_nil_of_le; simp; omega    rw [hd2, List.nil_append, List.drop_drop]    congr 1    omega  · have hlen : (a.take (j - 1) ++ [a.getD (j - 1) 0 + 1] ++ a.drop (j + 1)).length = a.length - 1 := by      rw [List.length_append, List.length_append, List.length_take, List.length_drop]; simp; omega    have hk2 : j ≤ k := by omega    have hr_lt : k + 1 < a.length := by omega    have hr_gt : j < k + 1 := by omega    refine ⟨hr_gt, hr_lt, ?_⟩    rw [List.drop_append, List.drop_append]    have h1 : (a.take (j - 1)).length = j - 1 := by rw [List.length_take]; omega    have h2 : (a.take (j - 1) ++ [a.getD (j - 1) 0 + 1]).length = j := by      rw [List.length_append, h1]; simp; omega    rw [h1, h2]    have hd1 : List.drop k (a.take (j - 1)) = [] := List.drop_eq_nil_of_le (by omega)    rw [hd1, List.nil_append]    have hd2 : List.drop (k - (j - 1)) [a.getD (j - 1) 0 + 1] = [] := by      apply List.drop_eq_nil_of_le; simp; omega    rw [hd2, List.nil_append, List.drop_drop]    congr 1    omegatheorem alpha_later_local_blocker_inherits_earlier_drop_c_eq_a (a : List ℕ) (i r : ℕ) (hi0 : 0 < i) (hi : i < a.length)    (hir : i + 1 < r) (hr : r < a.length) :    let c := if 1 < a.getD i 0 then a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1)             else a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1)    let b := if 1 < a.getD i 0 then r + 1 else r - 1    b < c.length ∧ c.drop b = a.drop r := by  dsimp only  split_ifs with hic  · have hlen : (a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1)).length = a.length + 1 := by      rw [List.length_append, List.length_append, List.length_take, List.length_drop]; simp; omega    have hb_lt : r + 1 < (a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1)).length := by omega    refine ⟨hb_lt, ?_⟩    rw [List.drop_append, List.drop_append]    have h1 : (a.take i).length = i := by rw [List.length_take]; omega    have h2 : (a.take i ++ [a.getD i 0 - 1, 1]).length = i + 2 := by      rw [List.length_append, h1]; simp    rw [h1, h2]    have hd1 : List.drop (r + 1) (a.take i) = [] := List.drop_eq_nil_of_le (by omega)    rw [hd1, List.nil_append]    have hd2 : List.drop (r + 1 - i) [a.getD i 0 - 1, 1] = [] := by      apply List.drop_eq_nil_of_le; simp; omega    rw [hd2, List.nil_append, List.drop_drop]    congr 1    omega  · have hlen : (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1)).length = a.length - 1 := by      rw [List.length_append, List.length_append, List.length_take, List.length_drop]; simp; omega    have hb_lt : r - 1 < (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1)).length := by omega    refine ⟨hb_lt, ?_⟩    rw [List.drop_append, List.drop_append]    have h1 : (a.take (i - 1)).length = i - 1 := by rw [List.length_take]; omega    have h2 : (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1]).length = i := by      rw [List.length_append, h1]; simp; omega    rw [h1, h2]    have hd1 : List.drop (r - 1) (a.take (i - 1)) = [] := List.drop_eq_nil_of_le (by omega)    rw [hd1, List.nil_append]    have hd2 : List.drop (r - 1 - (i - 1)) [a.getD (i - 1) 0 + 1] = [] := by      apply List.drop_eq_nil_of_le; simp; omega    rw [hd2, List.nil_append, List.drop_drop]    congr 1    omegatheorem alpha_later_local_blocker_inherits_earlier_d_getD_eq_a (a : List ℕ) (i j : ℕ) (_hi : i < a.length) (hij : i < j) (hj : j < a.length)    (he : i % 2 = 0) (hje : j % 2 = 0) (m : ℕ) (hm : m ≤ i) :    (if 1 < a.getD j 0 then a.take j ++ [a.getD j 0 - 1, 1] ++ a.drop (j + 1)     else a.take (j - 1) ++ [a.getD (j - 1) 0 + 1] ++ a.drop (j + 1)).getD m 0 = a.getD m 0 := by  have hij2 : i + 2 ≤ j := by omega  have hma : m < a.length := by omega  split_ifs with hjc  · have h1 : (a.take j).length = j := by rw [List.length_take]; omega    rw [List.getD_append _ (a.drop (j + 1)) 0 m (by rw [List.length_append, h1]; simp; omega)]    rw [List.getD_append (a.take j) _ 0 m (by omega)]    rw [List.getD_eq_getElem _ 0 (by omega), List.getElem_take]    exact (List.getD_eq_getElem a 0 hma).symm  · have h1 : (a.take (j - 1)).length = j - 1 := by rw [List.length_take]; omega    rw [List.getD_append _ (a.drop (j + 1)) 0 m (by rw [List.length_append, h1]; simp; omega)]    rw [List.getD_append (a.take (j - 1)) _ 0 m (by omega)]    rw [List.getD_eq_getElem _ 0 (by omega), List.getElem_take]    exact (List.getD_eq_getElem a 0 hma).symmtheorem alpha_later_local_blocker_inherits_earlier_c_split_getD_eq_a (a : List ℕ) (i m : ℕ) (hi : i < a.length) (hm : m < i) :    (a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1)).getD m 0 = a.getD m 0 := by  have h1 : (a.take i).length = i := by rw [List.length_take]; omega  rw [List.getD_append _ (a.drop (i + 1)) 0 m (by rw [List.length_append, h1]; simp; omega)]  rw [List.getD_append (a.take i) _ 0 m (by omega)]  rw [List.getD_eq_getElem _ 0 (by omega), List.getElem_take]  exact (List.getD_eq_getElem a 0 (by omega)).symmtheorem alpha_later_local_blocker_inherits_earlier_c_conj_getD_eq_a (a : List ℕ) (i m : ℕ) (hi0 : 0 < i) (hi : i < a.length) (hm : m < i - 1) :    (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1)).getD m 0 = a.getD m 0 := by  have h1 : (a.take (i - 1)).length = i - 1 := by rw [List.length_take]; omega  rw [List.getD_append _ (a.drop (i + 1)) 0 m (by rw [List.length_append, h1]; simp; omega)]  rw [List.getD_append (a.take (i - 1)) _ 0 m (by omega)]  rw [List.getD_eq_getElem _ 0 (by omega), List.getElem_take]  exact (List.getD_eq_getElem a 0 (by omega)).symmtheorem alpha_later_local_blocker_inherits_earlier_c_split_getD_at_i (a : List ℕ) (i : ℕ) (hi : i < a.length) :    (a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1)).getD i 0 = a.getD i 0 - 1 := by  have h1 : (a.take i).length = i := by rw [List.length_take]; omega  have h2 : (a.take i ++ [a.getD i 0 - 1, 1]).length = i + 2 := by    rw [List.length_append, h1]; simp  rw [List.getD_append _ (a.drop (i + 1)) 0 i (by omega)]  rw [List.getD_append_right (a.take i) [a.getD i 0 - 1, 1] 0 i (by omega)]  have : i - (a.take i).length = 0 := by omega  rw [this]  rfltheorem alpha_later_local_blocker_inherits_earlier_c_conj_getD_at_sub (a : List ℕ) (i : ℕ) (hi0 : 0 < i) (hi : i < a.length) :    (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1)).getD (i - 1) 0 = a.getD (i - 1) 0 + 1 := by  have h1 : (a.take (i - 1)).length = i - 1 := by rw [List.length_take]; omega  have h2 : (a.take (i - 1) ++ [a.getD (i - 1) 0 + 1]).length = i := by    rw [List.length_append, h1]; simp; omega  rw [List.getD_append _ (a.drop (i + 1)) 0 (i - 1) (by omega)]  rw [List.getD_append_right (a.take (i - 1)) [a.getD (i - 1) 0 + 1] 0 (i - 1) (by omega)]  have : i - 1 - (a.take (i - 1)).length = 0 := by omega  rw [this]  rfltheorem alpha_later_local_blocker_inherits_earlier_c_lt_d (a : List ℕ) (i j : ℕ) (hi0 : 0 < i) (hi : i < a.length)    (hij : i < j) (hj : j < a.length) (he : i % 2 = 0) (hje : j % 2 = 0) :    let c := if 1 < a.getD i 0 then a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1)             else a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1)    let d := if 1 < a.getD j 0 then a.take j ++ [a.getD j 0 - 1, 1] ++ a.drop (j + 1)             else a.take (j - 1) ++ [a.getD (j - 1) 0 + 1] ++ a.drop (j + 1)    alpha_lexical_lt c d := by  intro c d  have hd_eq : ∀ m ≤ i, d.getD m 0 = a.getD m 0 :=    alpha_later_local_blocker_inherits_earlier_d_getD_eq_a a i j hi hij hj he hje  by_cases hic : 1 < a.getD i 0  · change alpha_lexical_lt c d    have hc_def : c = a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1) := by      change (if 1 < a.getD i 0 then _ else _) = _      rw [if_pos hic]    refine ⟨i, ?_, ?_, ?_⟩    · have hclen : c.length = a.length + 1 := by        rw [hc_def, List.length_append, List.length_append, List.length_take, List.length_drop]        simp; omega      have h1 : i < c.length := by rw [hclen]; omega      exact lt_of_lt_of_le h1 (le_max_left c.length d.length)    · intro m hm      unfold alpha_signed_cell      have : c.getD m 0 = a.getD m 0 := by        rw [hc_def]        exact alpha_later_local_blocker_inherits_earlier_c_split_getD_eq_a a i m hi hm      rw [this, hd_eq m (by omega)]    · unfold alpha_signed_cell      rw [he, if_pos rfl, if_pos rfl]      have : c.getD i 0 = a.getD i 0 - 1 := by        rw [hc_def]        exact alpha_later_local_blocker_inherits_earlier_c_split_getD_at_i a i hi      rw [this, hd_eq i (by omega)]      omega  · change alpha_lexical_lt c d    have hc_def : c = a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1) := by      change (if 1 < a.getD i 0 then _ else _) = _      rw [if_neg hic]    refine ⟨i - 1, ?_, ?_, ?_⟩    · have hclen : c.length = a.length - 1 := by        rw [hc_def, List.length_append, List.length_append, List.length_take, List.length_drop]        simp; omega      have h1 : i - 1 < c.length := by rw [hclen]; omega      exact lt_of_lt_of_le h1 (le_max_left c.length d.length)    · intro m hm      unfold alpha_signed_cell      have : c.getD m 0 = a.getD m 0 := by        rw [hc_def]        exact alpha_later_local_blocker_inherits_earlier_c_conj_getD_eq_a a i m hi0 hi hm      rw [this, hd_eq m (by omega)]    · unfold alpha_signed_cell      have hne : ¬ (i - 1) % 2 = 0 := by omega      rw [if_neg hne, if_neg hne]      have : c.getD (i - 1) 0 = a.getD (i - 1) 0 + 1 := by        rw [hc_def]        exact alpha_later_local_blocker_inherits_earlier_c_conj_getD_at_sub a i hi0 hi      rw [this, hd_eq (i - 1) (by omega)]      omegatheorem alpha_later_local_blocker_inherits_earlier (a : List ℕ) (i j k : ℕ) (ha : alpha_is_lexical a) (hi0 : 0 < i) (hi : i < a.length) (he : i % 2 = 0) (hij : i < j) (hj : j < a.length) (hje : j % 2 = 0) : let c := if 1 < a.getD i 0 then a.take i ++ [a.getD i 0 - 1, 1] ++ a.drop (i + 1) else a.take (i - 1) ++ [a.getD (i - 1) 0 + 1] ++ a.drop (i + 1); let d := if 1 < a.getD j 0 then a.take j ++ [a.getD j 0 - 1, 1] ++ a.drop (j + 1) else a.take (j - 1) ++ [a.getD (j - 1) 0 + 1] ++ a.drop (j + 1); let bound := if 1 < a.getD j 0 then j + 1 else j - 1; (∀ s : ℕ, 0 < s → s < d.length → s ≤ bound → alpha_lexical_lt (d.drop s) d) → 0 < k → k < d.length → ¬ alpha_lexical_lt (d.drop k) d → let r := if 1 < a.getD j 0 then k - 1 else k + 1; let b := if 1 < a.getD i 0 then r + 1 else r - 1; j < r ∧ b < c.length ∧ b % 2 = k % 2 ∧ ¬ alpha_lexical_lt (c.drop b) c := by  intro c d bound hearly hk0 hklen hblock r b  have hj0 : 0 < j := by omega  have hbound : bound < k := by    by_contra! hle    exact hblock (hearly k hk0 hklen hle)  have hd_res := alpha_later_local_blocker_inherits_earlier_drop_d_eq_a a j k hj0 hj hklen hbound  rcases hd_res with ⟨hjr, hr_len, hdrop_d⟩  have hir : i + 1 < r := by omega  have hc_res := alpha_later_local_blocker_inherits_earlier_drop_c_eq_a a i r hi0 hi hir hr_len  rcases hc_res with ⟨hb_len, hdrop_c⟩  have hk_ge2 : 2 ≤ k := by    dsimp [bound] at hbound    split_ifs at hbound with hjc <;> omega  have hparity : b % 2 = k % 2 := by    dsimp [r, b]    split_ifs <;> omega  refine ⟨hjr, hb_len, hparity, ?_⟩  intro hcb  have hcd : alpha_lexical_lt c d :=    alpha_later_local_blocker_inherits_earlier_c_lt_d a i j hi0 hi hij hj he hje  have hdrop_eq : c.drop b = d.drop k := by    rw [hdrop_c, hdrop_d]  have hdk_lt_c : alpha_lexical_lt (d.drop k) c := by    rwa [← hdrop_eq]  have hdk_lt_d : alpha_lexical_lt (d.drop k) d :=    alpha_later_local_blocker_inherits_earlier_lexical_lt_trans (d.drop k) c d hdk_lt_c hcd  exact hblock hdk_lt_d
See it in the graphDiscuss this resultChallenge it