leanprover-community / leanprover-community/leanprover-community.github.io
notation docs
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 84
- Forks
- 190
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 12
Description
A first start provided by @Vierkantor :
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/big.20ops/near/195941698
when deciding how to pretty-print an expression,
Lean looks up the notations associated to the head of the expression (e.g. `finset.sum`).
It tries them one by one, until it finds a notation that matches the expression,
then uses that to pretty-print.
The order in which they are tried is the order in which they are stored in the environment structure,
which in this case is the order in which they are defined.
Apparently the priority information is thrown away
(typically it would be highest-priority first, then by order of definition).
This is why the order matters.
A notation definition is associated to the head of the expression it expands to, so
```lean
notation ∑ binders , r:(scoped f, finset.sum finset.univ f) := r
```
is associated to the head of the expansion of `r`,
which is the head of `finset.sum finset.univ f`, which is `finset.sum`.
But `finset.univ.sum` doesn't get expanded to `finset.sum finset.univ` at that point,
so you have to write `finset.sum finset.univ` instead of `finset.univ.sum`.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the issue's notation explanation and the linked Zulip discussion first; the payload does not identify a documentation file or entry point. Document how notation lookup order, priorities, expression heads, and the finset.sum versus finset.univ.sum example work, with the issue's behavior accurately reflected in the site's documentation.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100