Skip to content

Conversation

@alok
Copy link
Contributor

@alok alok commented Dec 9, 2025

This PR fixes goto-definition for binary relation operators (, , <, >, =, ==).

Problem: Goto-def on navigated to the macro_rules instead of GE.ge.

Cause: The "uncomparable types" path in elabBinRelCore called elabAppArgs directly without withTermInfoContext', unlike binop% which creates nested TermInfo via toExprCore.

Fix: Wrap with withTermInfoContext' to match binop% behavior.

Note: Initially tried resolveId? stx[1] (withInfo := true), but that creates TermInfo with the unapplied type ({α : Type} → [LE α] → ...) rather than the instantiated type (Nat → Nat → Prop).

🤖 Generated with Claude Code

This PR fixes goto-definition for binary relation operators.

**Problem:** Goto-def on `≥` went to the macro rule instead of `GE.ge`.

**Root cause:** In `elabBinRelCore`, the "uncomparable types" path (line 536)
called `elabAppArgs` directly without wrapping in `withTermInfoContext'`,
unlike `binop%` which goes through `toExprCore` that creates nested TermInfo.

**Fix:** Wrap the `elabAppArgs` call with `withTermInfoContext'` to match
`binop%` behavior.

**Note:** Initially tried adding `withInfo := true` to `resolveId? stx[1]`,
but that creates TermInfo with the unapplied type `{α : Type} → [LE α] → ...`
rather than the concrete instantiated type like `Nat → Nat → Prop`.
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Dec 9, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries CI can not be attempted yet, as the nightly-testing-2025-12-09 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Batteries CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2025-12-09 09:20:48)

@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-12-09 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2025-12-09 09:20:49)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants