Partially well-founded definitions in Lean

This is my first post about Lean on this blog :) It is meant as a response to Joachim’s post about extrinsic termination proofs . I want to show how a slight modification of his idea can be used to define partial function definitions using well-founded recursion. Background: structural vs. well-founded recursion Many recursive function definitions terminate on all inputs by an inductive argument.…