Skip to content
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

Cannot rewrite using hypotheses with universal quantifiers #699

Open
oskgo opened this issue Jan 28, 2025 · 2 comments
Open

Cannot rewrite using hypotheses with universal quantifiers #699

oskgo opened this issue Jan 28, 2025 · 2 comments

Comments

@oskgo
Copy link
Contributor

oskgo commented Jan 28, 2025

The following example fails with nothing to rewrite, when the hypothesis is clearly matching the if conditional:

op P (x y: bool): bool.

lemma foo x: (forall y, P x y) => x = 
  if (forall y, P x y) then x else witness.
proof.
move => H. 
rewrite H.

There are multiple workarounds. In this simple example you can just use smt, but that requires the goal to be immediately solvable. One can also get around it by using pose to abstract away the conditional.

The simplest workaround I found that should usually work is using rewrite -eqT in H to get (forall y, P x y) = true instead.

@fdupress
Copy link
Member

I think this is a more general issue when rewriting any Boolean expression that is not an equality. It's just that it does exactly what the user intends in most cases.

But if we can narrow down which behaviour of matching is getting in the way, perhaps we can make it user-controllable?

@strub
Copy link
Member

strub commented Jan 28, 2025

Here, the system tries to rewrite P x _. A solution would be to support rewrite @H.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants