next h =>
  rw [eqNdrec_symm] at h
  rw [h, val_ndrec, val_tail, val_tail, ih]
case h_2
α : Type u_1
s : Setoid α
inst✝ : DecidableRel Setoid.r
xs✝ : List α
x : α
xs : List α
ih : ∀ (i : (List.dedup s xs).Index), (undedup s i).val = i.val
i : (List.dedup s (x :: xs)).Index
ha : ¬Logic.Any (List.map (Setoid.r x) xs)
x✝ : (x :: List.dedup s xs).Index
i✝ : (List.dedup s xs).Index
heq✝ : ⋯ ▸ i = i✝.tail
⊢ (undedup s i✝).tail.val = i.val
no goals