Skip to content

fix(safe): rebind inner annotations under eta expansion - #1667

Closed
oxura wants to merge 1 commit into
bendlang:mainfrom
oxura:fix/1665-eta-annotation-levels-20261017
Closed

oxura wants to merge 1 commit into
bendlang:mainfrom
oxura:fix/1665-eta-annotation-levels-20261017

Conversation

@oxura

@oxura oxura commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

eta adds a lambda around an argument, but annotations inside that argument can still contain fixed levels from before the new binder. In the report, the inner Nat annotation ends up pointing at the new Bool variable.

Reopen the argument with the existing subst helper before wrapping it, preserving variables from the surrounding scope. The three eta callers now pass their current depth. The emitted annotation refers to x2 again, and the reported program passes --verdict. Neither bend.ts nor the Lean kernel changes.

Added the reported program as a proof regression. Checked it with both --check-only and --verdict, plus five existing eta/dependent-function files with --verdict; all passed with Lean 4.34.0. The kernel matches the base byte for byte (SHA-256 cc78aa9ff3491ff1b788797bdcab4cb98107dcb1730ed99834f6933b11d88335). The repository gate passes without changing caps; the related comments and verdict paragraph are shorter.

Fixes #1665.

@oxura

oxura commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

I missed #1666, which opened while I was working on the report. We reached the same subst-based fix, so I’m closing this duplicate in favor of that PR.

@oxura oxura closed this Oct 17, 2026
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

Successfully merging this pull request may close these issues.

--verdict mismatch: an η-expanded argument keeps old binder levels in its inner annotations (Bool where Nat is expected)

1 participant