perf: skip alternatives with a different literal when generating equations (#16526)

This PR makes the generation of equation lemmas faster for a function
defined by `match` on many literals. The `big_match_string` benchmark
with 128 alternatives is about 12% faster (#16313).

To rewrite a matcher application, the equation compiler tries the
congruence equation of each alternative in order. It now skips an
alternative when a discriminant and the pattern are different literals
and the local context has no hypotheses, because the attempt cannot
succeed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
3 files changed