simp [*]
case case1
α : Type
inst✝ : Ord α
n : Nat
first✝ i✝ j✝ : Fin n
arr : Vec α n
first i j : Fin n
fi : first ≤ i
ij : i ≤ j
lt : first < i
jl : ↑first ≤ ↑i - 1
h : arr[i] < arr[first]
prev : ↑i - 1 ≤ ↑j
ih : Nonempty (permuted n (↑first) (↑j) arr (partitionImpl arr first i.prev j jl prev).snd)
⊢ Nonempty
    (permuted n (↑first) (↑j) arr
      (if h : first < i then
          let_fun this := ⋯;
          if arr[i] < arr[first] then
            let_fun this_1 := ⋯;
            partitionImpl arr first i.prev j this this_1
          else
            let arr := (dbgTraceIfShared "swap1" arr).swap i j;
            match partitionImpl arr first i.prev j.prev this ⋯ with
            | (⟨mid, hm⟩, arr) => (⟨mid, ⋯⟩, arr)
        else (⟨j, ⋯⟩, arr)).snd)
no goals