`cbv` computes `List.maxOn?` as the minimum
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- tooling
Research direction
Start by comparing cbv and decide_cbv evaluation of [1, 3, 2].maxOn? id with decide and #eval, using the reproducer in the issue. Trace how cbv handles List.maxOn? and the proof terms for its comparisons; the issue gives no source file or test path. Done means both tactics prove the stated equality and their results agree with decide and #eval.
Written by the indexing model from the issue text.
Description
Prerequisites
- Check that your issue is not already filed (closest: #13544, see below).
- Reduce the issue to a minimal, self-contained, reproducible test case.
- Test your test case against the latest nightly release.
Description
cbv computes the minimum instead of the maximum for List.maxOn?: it evaluates [1, 3, 2].maxOn? id to
some 1 instead of some 3. The proof it builds is rejected by the kernel, and decide_cbv reports the
true proposition [1, 3, 2].maxOn? id = some 3 as false.
Steps to Reproduce
example : [1, 3, 2].maxOn? id = some 3 := by decide -- ok
example : [1, 3, 2].maxOn? id = some 3 := by cbv -- error (see below)
example : [1, 3, 2].maxOn? id = some 3 := by decide_cbv -- error: the proposition evaluates to `false`
Expected behavior: cbv and decide_cbv prove the goal (decide, decide +kernel and #eval agree on
some 3).
Actual behavior:
error: unsolved goals
⊢ some 1 = some 3
error: (kernel) application type mismatch
Eq.trans (congr (congrArg LE.le (id.eq_1 1)) (id.eq_1 3)) (Lean.Sym.Nat.le_eq_true 1 3 (eagerReduce (Eq.refl true)))
argument has type
(1 ≤ 3) = True
but function has type
(1 ≤ 3) = True → (id 1 ≤ id 3) = True
...
error: `decide_cbv` failed: the proposition evaluates to `false`
Versions
version 4.36.0-nightly-2026-10-11
Additional Information
NA
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
- Dominant language
- Lean
- Stars
- 9.7k
- Forks
- 1.1k
- Avg merge
- 20h 22m
- Merged PRs (30d)
- 298
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from leanprover/lean4
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
leanprover/lean4#15925 ·
Maintainers usually reply within 1 day
-
`IO.appPath` fails when `/proc` belongs to another PID namespacePossibly taken @treiher claimed this 7 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
leanprover/lean4#15692 · 3 reactions ·
Maintainers usually reply within 1 day
-
`IO.FS.realPath` reports every failure as `noFileOrDirectory` instead of classifying by `errno`Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
leanprover/lean4#15683 ·
Maintainers usually reply within 1 day
-
`Child.pid` leaks the `Child` and its pipe file descriptors (owned argument treated as borrowed)Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
leanprover/lean4#15681 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
leanprover/lean4#15677 ·
Maintainers usually reply within 1 day
All issues in leanprover/lean4
Similar issues
-
area: cli difficulty: easy first-timers-only good first issue help wanted mentor available
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hayagrivai-labs/phantom#121 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
alunduil/alunduil-chezmoi#1041 ·
Maintainers usually reply within 1 day
-
category/ui priority/P3 roadmap/session-management scope/session-management scope/web-shell type/feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
QwenLM/qwen-code#15678 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
fossasia/scrum_helper#949 ·
Maintainers usually reply within 2 days
-
good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 85/100