-
Notifications
You must be signed in to change notification settings - Fork 112
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: add support for Fin
to omega
#517
Conversation
awaiting-review |
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.
Thinking about this some more, I'm unconvinced we're ready to add support for Fin
.
The current PR doesn't support having goals in Fin
, e.g. even
example (i j : Fin n) (w : i < j) : i < j := by omega
would fail. That itself is easy to fix; I have it locally.
However if a user sees that working I think they would expect also to be able to use arithmetic operations in Fin
, e.g.
example (i j : Fin n) (w : i.succ < j.succ) : i < j := by omega
example (i j : Fin n) (w : i + i < j) : i < j := by omega
However it would be a fair bit more work to support this. (e.g. addition in Fin
is saturating, so involves a case split).
I'd prefer to not scope keep until we can provide a good experience with Fin
!
Can you show me where you wanted to use omega
that prompted this PR?
I considered also making it work for arithmetic operations on I'm currently working on a project that involves vectors of type Regarding the "proper" way to handle this eventually, I think it would be worth thinking about a way to make it extensible to be able to support types that are not in Std, like e.g. |
I think the right strategy might just be some preprocessing tactics that are not part of |
I pushed some changes, but I'm not happy yet. :-) |
Fair enough. I've been experimenting some more with the aesop approach for preprocessing, and that seems to work well enough. In any case, feel free to either adopt this PR or close it entirely. |
@dupuisf, I've moved this to Lean: leanprover/lean4#3427 It seems to work quite well now. |
I just noticed this with the announcement today, somehow I had missed this message -- very nice! :-) |
With this PR, omega can handle equalities and inequalities about variables in
Fin n
. Fori : Fin n
it will add both(i : Int) + 1 ≤ n
and0 ≤ i
to the facts that are processed.