Zulip Chat Archive
Stream: Is there code for X?
Topic: proof that i ≤ i+1 in Fin n
Emily Riehl (Aug 17 2024 at 20:25):
For i in Fin n, it should always be the case that i ≤ i+1 in the ordered set Fin (n+1) (for instance because such inequalities coincide with corresponding ones in nat). But I can't find the name for this proof. Please help!
Ruben Van de Velde (Aug 17 2024 at 20:28):
Is it true? For i = n-1, is i + 1 not zero?
Yaël Dillies (Aug 17 2024 at 20:39):
It would be true if Fin addition was saturating. (un)fortunately (depending on who you ask), it is looping around. x + y : Fin n
means ⟨(x + y : ℕ) % n, Nat.mod_lt _ _⟩
Violeta Hernández (Aug 17 2024 at 22:29):
Does docs#Order.le_succ work?
Violeta Hernández (Aug 18 2024 at 00:50):
Oh oops, I missed the thing about saturating addition
Violeta Hernández (Aug 18 2024 at 00:50):
I think succ i
should be what you want though
Yakov Pechersky (Aug 18 2024 at 01:39):
I think I have the relevant lemma in a PR, but in the meantime, you can use the contrapositive of docs#Fin.add_one_lt_iff
Emily Riehl (Aug 18 2024 at 13:08):
Ruben Van de Velde said:
Is it true? For i = n-1, is i + 1 not zero?
Thanks, I made a mistake in the statement (...though not in the code I copied the statement from). I meant to say for i in Fin n but the inequality in Fin n+1.
Emily Riehl (Aug 18 2024 at 13:09):
Yakov Pechersky said:
I think I have the relevant lemma in a PR, but in the meantime, you can use the contrapositive of docs#Fin.add_one_lt_iff
Thanks @Yakov Pechersky. Will you ping me once it's merged?
Yaël Dillies (Aug 18 2024 at 13:12):
Your statement should then be ∀ i : Fin n, i.castSucc ≤ i.succ
, which you can prove using docs#Fin.castSucc_lt_succ_iff and docs#le_rfl
Emily Riehl (Aug 18 2024 at 14:04):
Thanks! In parallel, I discovered that this also works for me:
theorem Fin.le_succ {n} (i : Fin n) : i.castSucc ≤ i.succ := Nat.le_succ i
def Fin.hom_succ {n} (i : Fin n) : i.castSucc ⟶ i.succ := homOfLE (Fin.le_succ i)
Last updated: May 02 2025 at 03:31 UTC