∀ (omitTopForall : Bool) (f x : Lean.Expr),
  (invImage
        (fun x =>
          PSum.casesOn x (fun _x => PSigma.casesOn _x fun e omitTopForall => (sizeOf e, 1)) fun _x =>
            PSigma.casesOn _x fun e omitTopForall => (sizeOf e, 0))
        Prod.instWellFoundedRelation).1
    (PSum.inl ⟨f, false⟩) (PSum.inr ⟨f.app x, omitTopForall⟩)