∀ {s : String} (it : s.Pos) (min : ℕ) (h : ¬it.IsAtEnd),
  (invImage
        (fun x =>
          PSum.casesOn x (fun _x => PSigma.casesOn _x fun it curr => PSigma.casesOn curr fun curr min => it) fun _x =>
            PSigma.casesOn _x fun it min => it)
        String.Pos.instWellFoundedRelation).1
    (PSum.inr ⟨it.next h, min⟩) (PSum.inr ⟨it, min⟩)