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

opening a namespace can affect elaboration #776

Open
alexjbest opened this issue Oct 26, 2022 · 0 comments
Open

opening a namespace can affect elaboration #776

alexjbest opened this issue Oct 26, 2022 · 0 comments

Comments

@alexjbest
Copy link
Member

alexjbest commented Oct 26, 2022

As reported by @b-mehta on Zulip in https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/.60open.20finset.60.20changes.20truth.20of.20goal/near/304982461
it is possible that simply opening a namespace which contains overloaded function names can cause the argument types to be elaborated differently, even if the overloaded function does not apply

def foo1.bar (x y : ℤ) := x ≠ y
def foo2.bar (x y : ℕ) := true

open foo1
def my_statement1 (k : ℕ) := bar (0 : ℤ) (k - 0)
open foo2

def my_statement (k : ℕ) := bar (0 : ℤ) (k - 0)

set_option pp.all true
#print my_statement1
#print my_statement
example : my_statement 1 :=
begin
  rw [my_statement],
  simp only [foo1.bar, int.coe_nat_one],
  intro h,
  cases h,
end

example : ¬ my_statement 1 :=
begin
  rw [my_statement],
  simp [foo1.bar, int.coe_nat_zero],
end
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