leanprover-community / leanprover-community/lean

Printing of notation with @

Open
#333 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
434
Forks
79
PR merge metrics
No merged PRs in 30d

Description

Description

Printing of notation doesn't seem to work when the declaration used @.

Steps to Reproduce
-- uncomment one

notation A `⁻` := set.compl A -- prints & parses correctly
-- notation A `⁻` := @set.compl _ A -- parses correctly, doesn't print
-- notation A `⁻` := @set.compl A -- parses incorrectly (as expected), but still prints!

example (X : Type) (A : set X) : A ∪ A.compl = set.univ := by {  }
example (X : Type) (A : set X) : A ∪ (A⁻) = set.univ := by {  }

The original question was to get the following notation print correctly.

notation X `\` A := @has_neg.neg (set X) _ A
example (X : Type) (A : set X) : A ∪ (X \ A) = set.univ := by {  }

This bug probably applies, but maybe there is also something else going on because \ is overloaded. (in this example the goal is printed as A ∪ (λ (x_1 : Type), has_neg.neg) X A = set.univ, but if I replace \ by \\ everywhere, the goal is printed as A ∪ -A = set.univ)

Additional Information

https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Notation.20with.20implicit.20arguments.20.3F

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the provided Lean notation examples, comparing declarations that use set.compl directly with those using @set.compl and the overloaded \ notation. Trace the notation printer behavior for implicit arguments and confirm that the affected expressions print using their declared notation without changing parsing behavior.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.