Commit 2022-11-12 02:18 6ca1a09b
View on Github →refactor(order/bounded_order): relax typeclass requirements on disjoint and codisjoint (#16434)
Currently we have two different notions of finset disjointness:
- ∀ a ∈ s, a ∉ t, used by- finset.disj_unionand- finset.disj_Union
- disjoint s t(- s ⊓ t ≤ ⊥), used by almost everything else The second spelling uses- finset.has_infwhich requires decidable equality to compute the intersection. Of course, we don't need to compute the intersection, we just need to say that no element can belong to it. More precisely, decidability of equality is only needed for decidability of disjointness, not to state disjointness in the first place. If were were to change- finset.disj_unionto take a- disjointargument, then either:
- It would need to be a weird @disjointterm with a classical decidable instance. reducing the generality of the lemma.
- it would need to gain a decidable_eqargument; thus losing much of the benefit it provides overfinset.has_union! Instead, this PR opts for redefiningdisjoint s tto not requirehas_inf, as∀ ⦃x⦄, x ≤ s → x ≤ t → x ≤ ⊥. The analogous change is made tocodisjoint s tfor consistency. As a bonus, the new definition works in cases where there is no unique infimum. The changes in this PR are largely either:
- Adjustments to the disjointAPI to handle the extra generality
- Adjustments to proofs that relied on the definitional equality of disjointto usedisjoint.le_botordisjoint_left
- Reordering of finset lemmas to move statements about disjointness earlier in the file where no decidable_eqhypothesis is present.