Zulip Chat Archive
Stream: Is there code for X?
Topic: nat.succ as an embedding
Yakov Pechersky (Jul 06 2022 at 21:57):
Do we have nat.succ as an embedding? Probably as an order embedding, which I can then forget to just an embedding.
Eric Rodriguez (Jul 06 2022 at 22:03):
I'm surprised that there isn't any for docs#order.succ, actually... cc @Yaël Dillies
Yaël Dillies (Jul 06 2022 at 22:04):
That's very easy to write, actually.
Eric Rodriguez (Jul 06 2022 at 22:06):
all we need is a no_top_order, right?
Kyle Miller (Jul 06 2022 at 22:06):
I'm sort of surprised docs#function.injective.to_embedding doesn't exist.
Anyway, there's at least function.embedding.mk _ nat.succ_injective
for now.
Yaël Dillies (Jul 06 2022 at 22:08):
import order.succ_pred.basic
namespace order
variables {α : Type*} [partial_order α] [succ_order α] [no_max_order α]
/-- `order.succ` as an order embedding. -/
@[simps] def succ_embedding : α ↪o α := order_embedding.of_map_le_iff succ $ λ _ _, succ_le_succ_iff
end order
Yaël Dillies (Jul 06 2022 at 22:08):
Could hardly do shorter! :stuck_out_tongue:
Yaël Dillies (Jul 06 2022 at 22:09):
We also need antisymmetry because succ
is potentially misbehaved on indistinguishable points.
Yakov Pechersky (Jul 06 2022 at 22:14):
We have addition as an order embedding somewhere, so one could use that. Don't remember what it's called at the moment.
Eric Wieser (Jul 06 2022 at 23:52):
Yakov Pechersky (Jul 07 2022 at 01:30):
That's the plain embedding. We don't have that as the order one?
Violeta Hernández (Jul 07 2022 at 16:33):
There's already sections in the order/succ_pred/basic.lean
file that have these exact assumptions as variables
Violeta Hernández (Jul 07 2022 at 16:33):
So this definition should be PR'd at the end of said section
Violeta Hernández (Jul 07 2022 at 16:34):
Also, the analogous embedding for pred
should be PR'd too
Last updated: Dec 20 2023 at 11:08 UTC