grind builds a proof rejected by the kernel for an overlapping match on Bool

Open
#16,902 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
43/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
compilers

Research direction

Start with the minimal Lean example in the issue and reproduce the kernel rejection using the stated nightly version. Then investigate grind’s handling of overlapping matches on Bool, using #16168 as related context. Done means grind produces a proof the kernel accepts for this example.

Written by the indexing model from the issue text.

Description

bug
Prerequisites
Description

grind closes the goal below without errors, but produces a wrong proof which leads to the rejection by the kernel. The goal is true, so this is a "completeness bug" in grind.

Context

Discovered whilst random testing (initial input was fuzzer generated and then manually reduced).

Steps to Reproduce
example (a b : Bool)
    (h : match a, b with
      | false, false => a = b
      | true, true => True
      | _, _ => False) :
    match a, b with
    | false, false => True
    | true, true => True
    | _, _ => a = a := by
  grind

Expected behavior: grind closes the goal and the kernel checks it to be correct

Actual behavior:

bug.lean:10:2: error: (kernel) application type mismatch
  ‹false = false›
argument has type
  x_0 = false
but function has type
  ∀ {h : false = false}, false = false
Versions
4.38.0-nightly-2026-11-30
Additional Information

Looks similar to #16168

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
10.5k
Forks
1.2k
Avg merge
19h 36m
Merged PRs (30d)
323

Getting set up

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.

More from leanprover/lean4

All issues in leanprover/lean4

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.