Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`grind`: stack overflow on a `match` given the cyclic hypothesis `as = a :: as`

Closed
#15,640 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
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
compilers

Research direction

The reproduction is a standalone Lean example using grind with a cyclic list equation and a match. Start by running the supplied example on the listed nightly version and inspect the grind implementation for stack overflow behavior on this case. Done means grind proves the goal or returns a regular failure without aborting the Lean process.

Written by the indexing model from the issue text.

Description

bug
Prerequisites
  • Check that your issue is not already filed: https://github.com/leanprover/lean4/issues
  • Reduce the issue to a minimal, self-contained, reproducible test case.
  • Test your test case against the latest nightly release.
Description

grind causes a stack overflow and aborts the Lean process when a match expression is combined with a cyclic constructor equation, as = a :: as.

Steps to Reproduce
example (a : Nat) (as : List Nat) (h : as = a :: as) :
    (match as with | 1 :: _ => 1 | _ => 2) > 0 := by
  grind

Expected behavior: A proof or a regular grind failure.

Actual behavior: Stack overflow detected. Aborting. The process exits with code 134.

Versions

version 4.36.0-nightly-2026-10-12

Additional Information

try grind does not catch it.

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

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.