omega does not look through abbreviations in types
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
I would expect this to work
example (x : Fin 3) : x ≠ x + 1 := by omega
abbrev Foo := Fin 3
/--
error: omega could not prove the goal:
No usable constraints found. You may need to unfold definitions so `omega` can see linear arithmetic facts about `Nat` and `Int`, which may also involve multiplication, division, and modular remainder by constants.
-/
#guard_msgs in
example (x : Foo) : x ≠ x + 1 := by omega
without this, I get penalized for introducing nice names for some of my abstractions. Most other parts of the system can look through abbreviations (e.g. name resolution, type class inference), so omega should maybe too.
Probably just a matter of calling whnfR in the right place.
Versions
"4.12.0-nightly-2024-10-15"
Additional Information
Wanted to use this in https://github.com/teorth/equational_theories/pull/599.
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the omega tactic and run the reproducer in the issue, comparing the direct Fin 3 example with the Foo abbreviation example. Investigate the mentioned whnfR path for type handling. Done means omega proves the abbreviated-type goal while preserving the existing direct example behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100