Zulip Chat Archive

Stream: maths

Topic: complex order


Yury G. Kudryashov (Sep 28 2021 at 00:02):

I've just realized that assumption h₂ : 0 < (f x).re ∨ (f x).im ≠ 0 of docs#has_deriv_at.clog and a bunch of similar lemmas can be formulated as ¬ (f x ≤ 0) in locale complex_order, see docs#complex.complex_partial_order and its redefinition in #9420. Why not make it an instance?

Johan Commelin (Sep 28 2021 at 00:08):

I think it was/is controversial to make that order an instance on , because it is pretty non-canonical.

Johan Commelin (Sep 28 2021 at 00:08):

We should probably add some comments about the pros and cons to one of those files.

Yury G. Kudryashov (Sep 28 2021 at 00:30):

Another solution: define it as an instance, add a library note, and mention it in the docstring of every lemma that depends on complex.partial_order.

Yury G. Kudryashov (Sep 28 2021 at 00:30):

I guess, we can have a linter for the docstring requirement.

Johan Commelin (Sep 28 2021 at 00:30):

I think @Scott Morrison was one of the proponents of making this an instance. But maybe I don't remember correctly.

Scott Morrison (Sep 28 2021 at 02:04):

In any Banach algebra, there's the cone of positive elements. Everyone would be pretty happy saying that there is a partial order on the self-adjoint elements, given by x >= y iff x - y is positive. Of course, you can extend that definition to the whole Banach algebra if you like: x and y will never be comparable if their difference is not self-adjoint. Is that a useful thing to do? Not obvious. Yury is observing that it's ever so slightly useful for stating some hypotheses concisely.

I'm still in favour of making it an instance, on the general theme that we like to make our functions "total", and so we might as well extend the partial order of self-adjoint elements to a partial order on everything, using "the default value" of "incomparable". But I agree that not everyone is going to like that -7 + 7i < 1 + 7i.

Johan Commelin (Sep 28 2021 at 04:22):

I'm complex-partial-order-agnostic.

Scott Morrison (Sep 28 2021 at 04:35):

Yury has a PR that puts the instances in a locale complex_order, which seems a good middle path.

Kevin Buzzard (Sep 28 2021 at 06:31):

0<re or im!=0 is instantly comprehensible to any reader, whereas not z<=0 is instantly confusing

Kevin Buzzard (Sep 28 2021 at 06:36):

I should add that it's not just experts who read mathlib. I sometimes link to mathlib code on Twitter for example as part of my evangelism attempts

Yury G. Kudryashov (Sep 28 2021 at 11:23):

They were already in this locale. I'm changing the definition from ∃ x : real, 0 ≤ x ∧ z + x = w to something about re and im.


Last updated: Dec 20 2023 at 11:08 UTC