simp
case succ
n : Nat
x : Permutation n
iv : Inversion x
i j : Fin n
hlt : i < j
hinv : x[↑i] > x[↑j]
⊢ ∀ (i_1 : Nat) (hi : i_1 < n) (a : Array (Inversion x)),
    (fun k ivs => ↑j < k → { fst := i, snd := j, lt := hlt, inverted := hinv } ∈ ivs) i_1 a →
      (fun k ivs => ↑j < k → { fst := i, snd := j, lt := hlt, inverted := hinv } ∈ ivs) (i_1 + 1)
        (Nat.fold' (↑{ val := i_1, isLt := hi })
          (fun i ivs =>
            if h : x[↑i] > x[↑{ val := i_1, isLt := hi }] then
              Array.push ivs
                { fst := Fin.castLE (_ : ↑{ val := i_1, isLt := hi } ≤ n) i, snd := { val := i_1, isLt := hi },
                  lt := (_ : ↑i < ↑{ val := i_1, isLt := hi }), inverted := h }
            else ivs)
          a)
case succ
n : Nat
x : Permutation n
iv : Inversion x
i j : Fin n
hlt : i < j
hinv : x[↑i] > x[↑j]
⊢ ∀ (i_1 : Nat) (hi : i_1 < n) (a : Array (Inversion x)),
    (↑j < i_1 → { fst := i, snd := j, lt := hlt, inverted := hinv } ∈ a) →
      ↑j < i_1 + 1 →
        { fst := i, snd := j, lt := hlt, inverted := hinv } ∈
          Nat.fold' i_1
            (fun i ivs =>
              if h : x[↑i] > x[i_1] then
                Array.push ivs
                  { fst := Fin.castLE (_ : ↑{ val := i_1, isLt := hi } ≤ n) i, snd := { val := i_1, isLt := hi },
                    lt := (_ : ↑i < ↑{ val := i_1, isLt := hi }), inverted := h }
              else ivs)
            a