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

lift tries to clear variables even where they are still used #19160

Open
YaelDillies opened this issue Nov 17, 2024 · 0 comments
Open

lift tries to clear variables even where they are still used #19160

YaelDillies opened this issue Nov 17, 2024 · 0 comments
Labels
bug Something isn't working t-meta Tactics, attributes or user commands

Comments

@YaelDillies
Copy link
Collaborator

When one provides a variable in the using clause of lift, lift tries to clear that variable regardless of whether it is still used in the context or not.

Here is a MWE

import Mathlib.Tactic.Lift

set_option linter.unusedVariables false in
def foo (n : Int) (hn : 0 ≤ n) : Int := n

example (n : Int) (hn : 0 ≤ n) : foo n hn = n := by
  lift n to Nat using hn
/-
tactic 'clear' failed, target depends on 'hn'
case intro
n : Nat
hn : 0 ≤ ↑n
⊢ foo (↑n) hn = ↑n
-/

example (n : Int) (hn : 0 ≤ n) : foo n hn = n := by
  lift n to Nat using id hn -- This works because `id hn` is not a variable
  sorry
@YaelDillies YaelDillies added bug Something isn't working t-meta Tactics, attributes or user commands labels Nov 17, 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 t-meta Tactics, attributes or user commands
Projects
None yet
Development

No branches or pull requests

1 participant