Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite fails to disambiguate when only one option is valid #2849

Open
1 task done
b-mehta opened this issue Nov 9, 2023 · 0 comments
Open
1 task done

Rewrite fails to disambiguate when only one option is valid #2849

b-mehta opened this issue Nov 9, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@b-mehta
Copy link
Contributor

b-mehta commented Nov 9, 2023

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Check that your issue is not already filed.
    • Reduce the issue to a minimal, self-contained, reproducible test case. Avoid dependencies to mathlib4 or std4.

Description

Rewrite fails to disambiguate when only one option is valid

Context

theorem add_succ : true = true := rfl

open Nat

#check add_succ -- Nat.add_succ
#check (add_succ : true = true) -- _root_.add_succ

example (x y : Nat) : x + (y + 1) = (x + y) + 1 := by
  rw [add_succ]
  /-
  ambiguous, possible interpretations
  _root_.add_succ : true = true

  Nat.add_succ : ∀ (n m : Nat), n + succ m = succ (n + m)
  -/

Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/ambiguous.20rewrite.20when.20only.20one.20is.20valid. The equivalent in Lean 3 succeeds. Thanks to @kmill for minimising. This showed up in porting the exponential-ramsey project.

Steps to Reproduce

Code as above.

Expected behavior: The rewrite succeeds and closes the goal.

Actual behavior: The rewrite fails.

Versions

Lean (version 4.3.0-rc1, commit baa4b68, Release)
MacOS

Additional Information

None

Impact

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant