mathlib4
mathlib4 copied to clipboard
feat(Order/FunLike): define `PointwiseLE`
- introduce a mixin class
DFunLike.PointwiseLE, use it to defineDFunLike.instPartialOrder; - add a generic
DFunLike.orderEmbeddingCoe - add
DFunLike.PointwiseLEinstances here and there.
With this refactor and #13022, I'm going to generalize lemmas like MeasureTheory.ae_mono to OuterMeasureClass.
- [x] depends on: #12983
I've been working on removing the analogous generic instances for SetLike. What's your motivation here?
What's your motivation? Do you have examples of fun like / set like types where this is not the right order?
I'm going to migrate measures to fun like and some lemmas can be generalized to OuterMeasureClass if the order is given by this definition.
Yes, the typical examples are UpperSet and Filter.
This instance scares me a bit. One example where this is the wrong order is linear maps from E →L[ℂ] E to E →L[ℂ] E, where we often want to say that f ≤ g if g - f is completely positive.
@YaelDillies @dupuisf I updated this PR to use a mixin instead.
@YaelDillies @dupuisf I updated this PR to use a mixin instead.
And now I updated commit message.
This PR/issue depends on:
- ~~leanprover-community/mathlib4#12983~~ By Dependent Issues (🤖). Happy coding!
Can you summarise your motivation in the PR description? You're not making anything shorter here, so the motivation can't be "Abstract away some boiler-plate". Do you have the need to reason about several pointwise ordered fun-like types at once?
Okay, I now understand your motivation.
Why can you not make PointwiseLE (+ whatever things you need to hold pointwise) part of OuterMeasureClass?
- We can drop some lemmas like
coe_le_coe,coe_lt_coe, as well asPartialOrderinstances. I don't do it in this PR to minimizediff. - I plan to add
PointwiseOne,PointwiseMuletc, as well asPointwiseSupetc and use them to prove generic algebraic instances,SMul/MulAction/... instances, and*Latticeinstances. - No other
*Classinstances assume additional structure on the type. I don't want to break it for one class.
I'm not fully convinced you're not overengineering the solution
Resumed a relevant thread at Zulip