Commit 2024-08-16 01:08 925a304c
View on Github →feat: Finset builder notation (#11582)
Define elaborators (but no delaborators) to elaborate the following notations to a Finset:
In Data.Finset.Basic,
{x ∈ s | p x}InData.Fintype.Basic,{x | p x}{x : α | p x}{x ∉ s | p x}{x ≠ a | p x}InOrder.Interval.Finset.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 aSetorFinsetis:- Check whether the expected type is
Finset ?α.- If it is, elaborate as a
Finset. - If it isn't, check whether the expected type of
sin the notation isFinset ?α.- If it is, elaborate as a
Finset. - If it isn't or there is no
sin the notation, elaborate as aSet. There is currently a gotcha that elaboration toSetis highly preferred because we can't postpone metavariable and override the set elaborator without breaking many existing uses of set builder notation. See Zulip.
- If it is, elaborate as a
- If it is, elaborate as a