Skip to content

conv in can unexpectedly fail with unknown metavariable error #11877

@vlad902

Description

@vlad902

Prerequisites

Description

conv in pat is supposed to pattern match on the pattern pat. The following reproducer below fails unexpectedly with a unknown metavariable '?_uniq.301' error. The following minimized reproducer shows that the failure has to do with a lemma with a @congr annotation.

Context

This issue was minimized from this Zulip discussion.

Steps to Reproduce

def sum (_ : Nat → Nat) : Nat := 0

@[congr]
theorem sum_congr {f g} : (∀ x, f x = g x) → sum f = sum g := by sorry

theorem repro : (sum fun i ↦ sum fun j : Nat ↦ i + 1) = 0 := by
  conv in (fun j : Nat ↦ _ + 1) => simp
  sorry

Expected behavior: conv in correctly matches the sub-expression, or at the very least fails with a meaningful error message.

Actual behavior: Fails with an RPC error, unknown metavariable '?_uniq.301'

Versions

Lean 4.28.0-nightly-2026-01-02
Target: x86_64-unknown-linux-gnu

(Taken from lean-live)

Impact

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions