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

simp unfolds local def through projection #4585

Closed
lecopivo opened this issue Jun 28, 2024 · 0 comments · Fixed by #6384
Closed

simp unfolds local def through projection #4585

lecopivo opened this issue Jun 28, 2024 · 0 comments · Fixed by #6384
Labels
bug Something isn't working P-medium We may work on this issue if we find the time

Comments

@lecopivo
Copy link

lecopivo commented Jun 28, 2024

Simp unfolds local definition with zetaDelta := false if the value of local definition can be reduced with a projection.

Actual behavior:
Here is a simple example

example (x y : Nat) : let a := (x,y); a.2 = 0 := by
  intro a
  simp (config := {zetaDelta:=false})

before simp the state is:

x y: Nat
a: Nat × Nat := (x, y)
⊢ a.snd = 0

and after simp the state is:

x y: Nat
a: Nat × Nat := (x, y)
⊢ y = 0

Expected behavior:
I'm expecting for simp not to reduce a.snd to y.

Cause:
I did some digging and found out that the issue is with the calls to reduceProj? in simp which calls whnf with default settings i.e. zetaDelta := true.

Lean version: v4.9.0-rc2

@lecopivo lecopivo added the bug Something isn't working label Jun 28, 2024
@leanprover-bot leanprover-bot added the P-medium We may work on this issue if we find the time label Aug 2, 2024
leodemoura added a commit that referenced this issue Dec 14, 2024
This issue has been fixed by #6123

closes #4585
github-merge-queue bot pushed a commit that referenced this issue Dec 14, 2024
This issue has been fixed by #6123

closes #4585
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-medium We may work on this issue if we find the time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants