grind builds a kernel-rejected proof if typeclass instantiation fails

Open
#16,899 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
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
testing

Research direction

Start by reproducing the provided Lean example with the reported nightly version and inspect the grind proof generation path where failed typeclass synthesis is handled. Trace how the generated proof is checked by the kernel. Done means the example reports the expected typeclass synthesis error without a kernel type mismatch.

Written by the indexing model from the issue text.

Description

bug
Prerequisites
Description

If we set up a proof with grind where typeclass instantiation fails (here ofNat), then we pass decide (42 = 42#64) = false → (42 = 42#64) = False to the kernel which is not reduced and therefore fails in the kernel.

Context

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

Steps to Reproduce
example (h : x = 42#64) : 0 >>> 0#64 <<< 1 = 84#64 := by grind

Expected behavior: failed to synthesize instance of type class error

Actual behavior: typeclass error followed by

bug.lean:1:57: error: (kernel) application type mismatch
  eq_false_of_decide (eagerReduce (Eq.refl false))
argument has type
  false = false
but function has type
  decide (42 = 42#64) = false → (42 = 42#64) = False
Versions

4.38.0-nightly-2026-11-30

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 Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.