if hjk : j.1 = k then
  cases hjk; simp only [if_pos]
else
  have : x[j.1].1 ≠ x[k].1 :=
    fun h => hjk <| x.get_inj _ _ (Fin.eq_of_val_eq h)
  simp only [hjk, this, if_neg]
  if hik : i.1 = k then
    cases hik; simp only [if_pos]
  else
    have : x[i.1].1 ≠ x[k].1 :=
      fun h => hik <| x.get_inj _ _ (Fin.eq_of_val_eq h)
    simp only [hik, this, if_neg]
n : Nat
i j : Fin n
x : Permutation n
k : Nat
hk : k < n
⊢ x[↑(if ↑j = k then i else if ↑i = k then j else { val := k, isLt := hk })] =
    if ↑x[↑j] = ↑x[k] then x[↑i] else if ↑x[↑i] = ↑x[k] then x[↑j] else { val := ↑x[k], isLt := (_ : ↑x[k] < n) }
no goals