This PR makes the generation of functional induction principles more robust when the user `let`-binds a variable that is then `match`'ed on. Fixes #10132.