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: Finset builder notation #11582

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

feat: Finset builder notation #11582

wants to merge 4 commits into from

Conversation

YaelDillies
Copy link
Collaborator

@YaelDillies YaelDillies commented Mar 22, 2024

Define elaborators (but no delaborators) to elaborate the following notations to a Finset:

In Data.Finset.Basic,

  • {x ∈ s | p x}

In Data.Fintype.Basic,

  • {x | p x}
  • {x : α | p x}
  • {x ∉ s | p x}
  • {x ≠ a | p x}

In Order.LocallyFinite.Basic,

  • {x ≤ a | p x}
  • {x ≥ a | p x}
  • {x < a | p x}
  • {x > a | p x}

The general heuristic for deciding whether to elaborate a given notation as a Set or Finset is:

  • Check whether the expected type is Finset ?α.
    • If it is, elaborate as a Finset.
    • If it isn't, check whether the expected type of s in the notation is Finset ?α.
      • If it is, elaborate as a Finset.
      • If it isn't or there is no s in the notation, elaborate as a Set.

There is currently a gotcha that elaboration to Set is highly preferred because we can't postpone metavariable and override the set elaborator without breaking many existing uses of set builder notation. See Zulip.


Open in Gitpod

@YaelDillies YaelDillies added WIP Work in progress t-meta Tactics, attributes or user commands labels Mar 22, 2024
@YaelDillies YaelDillies force-pushed the finset_builder branch 2 times, most recently from 777235c to d9f35cb Compare March 25, 2024 06:34
@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR and removed WIP Work in progress 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 Mar 26, 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 21, 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 7, 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 May 27, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label May 27, 2024
@YaelDillies YaelDillies changed the title Feat: Finset builder notation feat: Finset builder notation May 27, 2024
@Vierkantor Vierkantor added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels May 29, 2024
@YaelDillies
Copy link
Collaborator Author

The new notations here intersect a lot with the notations introduced by #6795, so I'm thinking I should be creating a new syntax category setBinder instead of reusing the existing binderPred.

@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 30, 2024
Copy link

github-actions bot commented Jun 11, 2024

PR summary a0b1d241ee

Import changes

No significant changes to the import graph


Declarations diff

+ elabFinsetBuilderIxx
+ elabFinsetBuilderSep
+ elabFinsetBuilderSetOf
+ elabSetBuilder
+ knownToBeFinsetNotSet

You can run this locally as follows
## summary with just the declaration names:
./scripts/no_lost_declarations.sh short <optional_commit>

## more verbose report:
./scripts/no_lost_declarations.sh <optional_commit>

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jun 11, 2024
@YaelDillies
Copy link
Collaborator Author

The new notations here intersect a lot with the notations introduced by #6795, so I'm thinking I should be creating a new syntax category setBinder instead of reusing the existing binderPred.

Given that this is completely orthogonal to the current PR, I will do that in a later PR.

@YaelDillies YaelDillies removed the awaiting-author A reviewer has asked the author a question or requested changes label Jun 11, 2024
@YaelDillies YaelDillies added the awaiting-review The author would like community review of the PR label Jun 11, 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 Jun 24, 2024
YaelDillies and others added 4 commits June 25, 2024 14:50
nolint

`setOf.unexpander` docstring

Std to Batteries rename

revert accidental diff
typo

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review The author would like community review of the PR t-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants