Zulip Chat Archive

Stream: Is there code for X?

Topic: criterion for equality in WithTop


David Loeffler (Apr 18 2025 at 09:30):

The following API lemma – characterizing an element of WithTop M by which elements of M are ≤ to it – would be helpful to have. Do we already have it under some other name? I didn't find it with a search.

variable {M : Type*} [PartialOrder M] [NoMaxOrder M]

lemma eq_of_forall_coe_le_iff {m m' : WithTop M} (hm :  n : M, n  m  n  m') : m = m' := sorry

David Loeffler (Apr 18 2025 at 10:02):

I made #24165 for this (I can always close the PR if it turns out the functionality already exists)

Aaron Liu (Apr 18 2025 at 14:16):

Is there a reason why we can't have this in an arbitrary partial order?

Aaron Liu (Apr 18 2025 at 14:17):

Is this is just docs#eq_of_forall_le_iff (it's not, since you're quantifying over M instead of WithTop M)

David Loeffler (Apr 18 2025 at 14:20):

No, this is not eq_of_forall_le_iff because n varies over M, not over WithTop M.

Yaël Dillies (Apr 18 2025 at 14:37):

No we're missing this, thanks for spotting! PR reviewed

Eric Wieser (Apr 18 2025 at 17:30):

Presumably there could be a version with IsMax?

David Loeffler (Apr 19 2025 at 07:21):

Not sure what you’re after there. WithTop for orders that already have a max element is not well behaved (the old and new top elements are order-indistinguishable) and it’s not clear why it would be useful anyway.

Eric Wieser (Apr 19 2025 at 07:25):

I mean for IsMax instead of WithTop

David Loeffler (Apr 19 2025 at 07:28):

But then it’s just docs#eq_of_forall_le_iff.

Eric Wieser (Apr 19 2025 at 07:29):

I was imagining that with an extra condition that c is not top

Eric Wieser (Apr 19 2025 at 07:30):

But either way the version you asked for is worth having


Last updated: May 02 2025 at 03:31 UTC