intro l hl invs' IH' hil
case succ.refine_2
n : Nat
x : Permutation n
iv : Inversion x
i j : Fin n
hlt : i < j
hinv : x[↑i] > x[↑j]
k : Nat
hk : k < n
invs : Array (Inversion x)
IH : ↑j < k → { fst := i, snd := j, lt := hlt, inverted := hinv } ∈ invs
hjk : ↑j < k + 1
this : ↑i < k
⊢ ∀ (i_1 : Nat) (hi : i_1 < k) (a : Array (Inversion x)),
    (↑i < i_1 ∨ ↑j < k → { fst := i, snd := j, lt := hlt, inverted := hinv } ∈ a) →
      ↑i < i_1 + 1 ∨ ↑j < k →
        { fst := i, snd := j, lt := hlt, inverted := hinv } ∈
          if h : x[i_1] > x[k] then
            Array.push a
              { fst := { val := i_1, isLt := (_ : i_1 < n) }, snd := { val := k, isLt := hk },
                lt := (_ : { val := i_1, isLt := (_ : i_1 < n) } < { val := k, isLt := hk }),
                inverted := (_ : x[↑{ val := i_1, isLt := (_ : i_1 < n) }] > x[↑{ val := k, isLt := hk }]) }
          else a
case succ.refine_2
n : Nat
x : Permutation n
iv : Inversion x
i j : Fin n
hlt : i < j
hinv : x[↑i] > x[↑j]
k : Nat
hk : k < n
invs : Array (Inversion x)
IH : ↑j < k → { fst := i, snd := j, lt := hlt, inverted := hinv } ∈ invs
hjk : ↑j < k + 1
this : ↑i < k
l : Nat
hl : l < k
invs' : Array (Inversion x)
IH' : ↑i < l ∨ ↑j < k → { fst := i, snd := j, lt := hlt, inverted := hinv } ∈ invs'
hil : ↑i < l + 1 ∨ ↑j < k
⊢ { fst := i, snd := j, lt := hlt, inverted := hinv } ∈
    if h : x[l] > x[k] then
      Array.push invs'
        { fst := { val := l, isLt := (_ : l < n) }, snd := { val := k, isLt := hk },
          lt := (_ : { val := l, isLt := (_ : l < n) } < { val := k, isLt := hk }),
          inverted := (_ : x[↑{ val := l, isLt := (_ : l < n) }] > x[↑{ val := k, isLt := hk }]) }
    else invs'