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
feat(tactic): generalize wlog to support multiple variables and cases… #135
Conversation
It looks pretty cool! Do you have a proof that you're using it for? Would it be possible to see it? My main use is in a package that is currently pretty broken. I'll still venture a thumbs up and come back and fix it if it ends up (re-) breaking my package. |
I want simplify this proof: |
What happened? I wanted to try this but the commits disappeared. |
Argh, I somehow rebased my mathlib repo to the wrong version. Should be fixed now. |
@PatrickMassot the commits are here again. |
Sorry I pushed only a old version, this doesn't yet include the discharger for the invariant goals. Sorry, the changes are on my laptop at home |
I just saw your last message after testing it. Indeed the current version is a regression compared to Simon's version in my use case. The magic is gone, I need two more |
With the discharger, you will still need one additional I see |
Why not trying |
We also don't call |
Ok, maybe |
I guess |
@johoelzl I see your point about making the tactic more specific rather than aggressive and it makes sense. I have a feeling that there is a number of cases that are very common and I'd love to make those shorter. How do you feel about making an aggressive version. For instance, we could call |
Also, when you talk about proofs of invariance, do you mean that you now give an obligation to prove an equivalence between various rewriting forms? I was quite happy to avoid those because the proof obligations I give discharged completely automatically. |
So what would The proof of invariance have the form |
While |
Ah! Excellent! What does it do when that implication fails? As I recall, I used to try |
Well, Simon's version is sophisticated and heuristic based. Somehow it may mean we really need two versions, as Simon suggests. |
Both In both cases if the invariant goal can not be solved, it is returned to the user (i.e.
It only tries |
So now the discharger for the invariance proofs is included. As discharger I also use now the SMT tactic, I think this should be slightly more powerful than just Also, one can use the |
This generalizes
wlog
to allow more than two variables, and hence also more then two permutations.The user can now provide a explicit rule which shows that all permutation are covered.
Another change is that
wlog
doesn't run the default discharger for the main goal or for the cases.@cipher1024 @PatrickMassot there are only tests in
mathlib
. Do you want to test this version if it works with our applications?I have at least one applications from Mason-Stother which might go into mathlib and require more than one variable. I will merge this if there are no problems.