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

destructProducts can add dependencies on implicit variables #104

Open
girving opened this issue Feb 10, 2024 · 1 comment
Open

destructProducts can add dependencies on implicit variables #104

girving opened this issue Feb 10, 2024 · 1 comment

Comments

@girving
Copy link

girving commented Feb 10, 2024

Here's (arguably) a bug which may be difficult to fix:

import Aesop
import Mathlib.Data.Nat.Basic

variable {bad : ℕ × ℕ}

set_option trace.aesop true in  -- Shows that `destructProducts` is the culprit
lemma unused {n : ℕ} {p q : ℕ → Prop} (pq : ∀ n, p n → q n) (pn : p n) : q n := by
  aesop (config := { enableSimp := false })  -- Ban `simp` so `destructProducts` has time to fire

#check unused  -- unused {bad : ℕ × ℕ} {n : ℕ} {p q : ℕ → Prop} (pq : ∀ (n : ℕ), p n → q n) (pn : p n) : q n

I'm using aesop close a lemma unused that makes no mention of bad, and bad doesn't occur in the final proof (at least in spirit). However, during aesop's search, it uses destructProducts to take bad apart into components, and 💥, now the first argument of unused is {bad : ℕ × ℕ}.

Zulip thread

@girving
Copy link
Author

girving commented Feb 11, 2024

Possibly this needs to wait on more general changes to implicit variables: leanprover/lean4#2452.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant