dsimp [get]
α : Type u
x : Subarray α
i j : Fin (size x)
k : Nat
hk : k < size (swap x i j)
⊢ get
      { as := Array.swap x.as (castIndex x i) (castIndex x j), start := x.start, stop := x.stop,
        h₁ := (_ : x.start ≤ x.stop),
        h₂ := (_ : x.stop ≤ Array.size (Array.swap x.as (castIndex x i) (castIndex x j))) }
      { val := k, isLt := hk } =
    if ↑j = k then get x { val := ↑i, isLt := (_ : ↑i < size x) }
    else if ↑i = k then get x { val := ↑j, isLt := (_ : ↑j < size x) } else get x { val := k, isLt := hk }
α : Type u
x : Subarray α
i j : Fin (size x)
k : Nat
hk : k < size (swap x i j)
⊢ (Array.swap x.as (castIndex x i) (castIndex x j))[x.start + k] =
    if ↑j = k then x.as[x.start + ↑i] else if ↑i = k then x.as[x.start + ↑j] else x.as[x.start + k]