Commit 2026-10-31 04:12 c1cc962a
View on Github →feat: use max/min for union/inter in Set, Finset, ZFSet, Class (#42316)
This lets us write ∪/∩ for sets while the underlying constant is max/min. This is a follow-up to #32983, which made the same change for ⊆, ⊂, ⊇ and ⊃. The implementation for ∪/∩ is analogous.
The first commit contains the implementation change, and all other commits are just adaptations.
Note that there are now two different special delaborators for max/min, because we already had the delaborator that chooses between max/min and ⊔/⊓. It is important that the one for ∪/∩ is tried first. There is no priority mechanism for delaborators: they are always executed newest to oldest. So, this PR adds a (redundant) import to ensure that this order is respected.
- I modified the delaborator for
⊔/⊓so that it doesn't fire ifLinearOrderisn't imported. Due to the extra redundant import, that is now a more common situation and I think in that situation it's better to printmax a binstead ofa ⊔ b. - It is now not anymore possible to write
simp [(· ∪ ·)]due to elaboration issues. The same also already applied tosimp [(· ⊆ ·)]. - Many
simpcalls had to be fixed because thesimpset formax/mincontains more lemmas than what we had forunion/inter. For example,compl_infandinf_of_le_left/inf_of_le_rightnow also apply to intersections. - In particular
inf_of_le_left/inf_of_le_rightare quite slow simp lemmas, which means that this PR gives a bit of slowdown. - A
grindcall had to be fixed because it timed out. Originally, thatgrindcall was already doing too much stuff, but it didn't quite reach its limits. - Many
@[simp]and some@[gcongr]tags could be removed because they are now subsumed by more general tags. - I removed
@[mfld_simp]frominter_subset_left, as it seemed a bit weird to have it there and not on its dual or its mirror lemma.