-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: construct .eq_def
before .eq_n
#5669
base: master
Are you sure you want to change the base?
Conversation
Mathlib CI status (docs):
|
This adds a new simp configuration flag: `underLambda`, on by default. Turning this off will make `simp` not rewrite under lambdas (and not in the branches of an `if-then-else`). This can can be useful when one wants to simplify in a way that more closely matches call-by-value execution, and can help with `simp [f]` where `f` is a function defined by well-founded recursion, and where without the flag the simplifier would go into a loop or produce huge proof terms. Preventing simplification under lambda is straight-forward (in `simpLambda`. Recognizing all the places where we might descent into the branches of if-then-else is a bit more work.
.eq_def
before .eq_n
.eq_def
before .eq_n
…lean4 into joachim/issue5667
I gave this another shot, storing some of my observations here. I figured it might be more robust to prove the equational theorems if we had an unfolding lemma for
The First big question: Can we write metaprogram that generate all these definitions and proofs, even for much more complex data types. (Especially With that, it seems we can prove unfolding lemmas a bit more easily:
Anyways, it's clearly not a simple option to go that route, so shelving that idea here. |
ca8ae18
to
f325ac7
Compare
I have a theory that we’d get less “failed to generate equational theorem” like in #5667 if we first generate the
.unfold
theorem (a bit easier, no hypotheses to consider), and then use that to define the.eq_n
that don't hold byrfl
anyways.This (stashed, partial) work explores that direction, and shows that indeed it fixes #5667.
But of course plenty of other programs break. This
brecOn
business is not so easy!