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

change _ at h fails #4885

Closed
3 tasks done
sven-manthe opened this issue Jul 31, 2024 · 1 comment
Closed
3 tasks done

change _ at h fails #4885

sven-manthe opened this issue Jul 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sven-manthe
Copy link

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

When rewriting creates a metavariable, this leads to unexpected type mismatches with later metavariables, even in expressions like change _ at h

Context

See https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/change.20_.20at.20h.20fails

Steps to Reproduce

def g (_ : Nat) : Nat := 0
theorem iff (a : Nat) :
  0 = g 0 ↔ 0 = a := by sorry
theorem test
  (T : Unit)
  (h : 0 = g 0)
  (ih : T = T) --removing this, or even swapping it with h, parameter makes change succeed below
  : 0 = g 0 := by
  rw [iff] at h
  change _ at h --fails with type mismatch
  /-
  type mismatch
    this
  has type
    ?m.158 : Sort ?u.157
  but is expected to have type
    0 = ?m.129 : Prop
  -/

Expected behavior:

change succeeds and does nothing

Actual behavior:

change fails with type mismatch

Versions

Lean 4.10.0 (also earlier)

Impact

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

@sven-manthe sven-manthe added the bug Something isn't working label Jul 31, 2024
@Kha
Copy link
Member

Kha commented Aug 2, 2024

Unfortunately, as described at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/change.20_.20at.20h.20fails/near/445730313, there is nothing to fix here - this is just how mvars (must) work

@Kha Kha closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
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

2 participants