Zulip Chat Archive
Stream: Is there code for X?
Topic: Silly Nat/Fin identity
Phillip Harris (Jul 24 2025 at 05:26):
I find myself stuck on proving ↑(↑n + 1) = n + 1, where n is a Nat and the arrows are converting to and from a Fin (n+2). This should be true right?
Aaron Liu (Jul 24 2025 at 05:32):
This is true
Aaron Liu (Jul 24 2025 at 05:33):
But they removed the Nat -> Fin coercion
Aaron Liu (Jul 24 2025 at 05:34):
You should use Fin.last instead
Phillip Harris (Jul 24 2025 at 05:44):
Sorry I'm not sure what you mean. The identity was generated as a result of trying to unify some types. I didn't type the coercions.
Yaël Dillies (Jul 24 2025 at 06:09):
Can you provide a #mwe ?
Kenny Lau (Jul 24 2025 at 06:37):
are you stuck on an older version of mathlib?
suhr (Jul 24 2025 at 11:30):
example {n: Nat}: Fin.ofNat (n+2) n + Fin.ofNat (n+2) 1 = n + 1 :=
by simp [Nat.lt_add_right]
suhr (Jul 24 2025 at 11:31):
Note that coercion Fin → Nat still works.
Robin Arnez (Jul 24 2025 at 12:28):
This is probably what you're working with, right?
example {n : Nat} : (Fin.ofNat (n+2) n + 1).val = n + 1 := by
simp [Fin.val_add]
so Fin.val_add should help
Last updated: Dec 20 2025 at 21:32 UTC