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

feat: ∑ hi : i ∈ s, f i hi syntax for big operators #11563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YaelDillies
Copy link
Collaborator

@YaelDillies YaelDillies commented Mar 21, 2024

Define new notation for Finset.sum/Finset.prod. The main changes are

  • ∑ hi : i ∈ s, f i hi as notation for ∑ i : s, f i.1 i.2
  • ∑ hi : i ∈ s with p i, f i hi as notation for ∑ i : s.filter p, f i.1 (mem_filter.1 i.2).1
  • ∑ i ∈ s with hpi : p i, f i hpi as notation for ∑ i : s.filter p, f i.1 (mem_filter.1 i.2).2
  • ∑ hi : i ∈ s with hpi : p i, f i hi hpi as notation for ∑ i : s.filter p, f i.1 (mem_filter.1 i.2).1 (mem_filter.1 i.2).2

Open in Gitpod

@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR t-meta Tactics, attributes or user commands t-algebra Algebra (groups, rings, fields etc) WIP Work in progress blocked-by-other-PR This PR depends on another PR to Mathlib and removed awaiting-review The author would like community review of the PR labels Mar 21, 2024
@YaelDillies YaelDillies changed the title feat: Extensible syntax for big operators feat: ∑ hi : i ∈ s, f i hi syntax for big operators Mar 22, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. labels Mar 25, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. labels Apr 9, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Apr 21, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the blocked-by-other-PR This PR depends on another PR to Mathlib label Apr 30, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. labels Apr 30, 2024
@eric-wieser
Copy link
Member

eric-wieser commented May 26, 2024

I am very much not a fan of ∑ hi : i ∈ s, f i hi syntax, as it means something completely different from ∑ᶠ hi : i ∈ s, f i hi or ⨅ hi : i ∈ s, f i hi, which don't quantify over i at all.

@YaelDillies
Copy link
Collaborator Author

I am aware of this potential confusion, but consider the number of people wondering how to get access to hi : i ∈ s inside the sum. Zulip is full of such questions. I believe it's easier to explain a posteriori why ∑ᶠ hi : i ∈ s, f i hi means something different than why we can't do the same thing as for if i ∈ s then a else b.

Or maybe you would be happier with ∑ (hi : i ∈ s), f i hi?

@eric-wieser
Copy link
Member

∑ i (hi : i ∈ s), f i hi (allowing type info on the i) would be ok with me, as this is similar enough to the behavior of binders in iInf, even if it doesn't actually generate nested sums.

@YaelDillies
Copy link
Collaborator Author

But iInf binders would rather be \iInf (hi : i \in s), ...?

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label May 28, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflict The PR has a merge conflict with master, and needs manual merging. t-algebra Algebra (groups, rings, fields etc) t-meta Tactics, attributes or user commands WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants