-
Notifications
You must be signed in to change notification settings - Fork 840
[Merged by Bors] - feat(Tactic/Simproc): nested quantifiers in existsAndEq
#26843
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
[Merged by Bors] - feat(Tactic/Simproc): nested quantifiers in existsAndEq
#26843
Conversation
Comments from Original PR #23365This section contains 8 comment(s) from the original PR, excluding bot comments. @JovanGerb (2025-03-30 23:56 UTC):
Style
Code simplifications
@JovanGerb (2025-03-31 00:19 UTC): Faster failure:
Faster proof generation:
@vasnesterov (2025-04-02 11:47 UTC):
I don’t mind, but I was taught the opposite in another review.
I actually tried to distinguish between cases where everything works correctly but the simproc is not applicable (
I don’t think I understand.
I think the performance benefits here are too minor to justify complicating the code. @JovanGerb (2025-04-02 12:23 UTC):
@JovanGerb (2025-04-02 22:10 UTC): @JovanGerb (2025-04-07 22:03 UTC): @JovanGerb (2025-04-08 05:43 UTC): @grunweg (2025-05-23 09:57 UTC): |
This pull request has conflicts, please merge |
What is the state of this PR now? From what I remember, I approved it, but it was then also suggested that it should be upstreamed to core (so it should be refactored without Qq). |
I thought it may be easier to review the code with Qq, and then refactor it in a separate PR. I'm ready to do it here though. |
I personally think that But my opinion may be irrelevant here, as I don't speak enough metaprogramming (at the moment) to review this PR anyway. |
@grunweg I totally agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but: are you also planning to do the equivalent rules for forall
s? Rewriting ∀ x, x = a -> P x
to P a
.
return q(Exists.elim $h $pf2) | ||
|
||
/-- When `P = ∃ f₁ ... fₙ, body`, where `exs = [f₁, ..., fₙ]`, this function takes | ||
`act : body` and proves `P` using `Exists.intro`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly that exs
are used as the witnesses? Maybe in the example disambiguate between the bound variables in ∃ c b
and the free variables in exs = [b, c]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, body
depends on free variables f₁, ..., fₙ
and in that function we substitute exactly these variables as the witnesses.
This is done by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for all your work! Let's get this merged 🎉
bors d+
✌️ vasnesterov can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
Generalize the `existsAndEq` simproc to nested existential quantifiers. For example `∃ a, p a ∧ ∃ b, a = f b ∧ q b` now simplifies to `∃ b, p (f b) ∧ q b`. Co-authored-by: Jovan Gerbscheid <jovan.gerbscheid@gmail.com>
Pull request successfully merged into master. Build succeeded: |
existsAndEq
existsAndEq
Generalize the
existsAndEq
simproc to nested existential quantifiers.For example
∃ a, p a ∧ ∃ b, a = f b ∧ q b
now simplifies to∃ b, p (f b) ∧ q b
.This PR continues the work from #23365.
Original PR: #23365