leanprover / leanprover/lean4

`whnf` generates raw Nat literal, `omega` doesn't understand it

Open
#8,548 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-low
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Description

omega is not able to discharge 6 < 10 when 6 : Nat is represented by a raw literal.
Such a raw literal can be produced with whnf as follows:

example : [1,2,3].sum < 10 := by
  conv in List.sum _ => whnf
  -- simp only
  omega

(live link)

Steps to Reproduce

Check the program above

Expected behavior: omega succeeds

Actual behavior: omega fails

Including the simp only rewrites the raw Nat literal to ofNat; then omega succeeds.

Versions

Lean 4.20.0-rc5
Target: x86_64-unknown-linux-gnu

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided reproducer, focusing on the interaction between whnf and omega and the raw Nat literal produced by whnf. Confirm that adding simp only makes omega succeed; done means omega can discharge 6 < 10 directly after whnf without that workaround.

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
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.