English
Membership into the finite set finset f x is equivalent to either the last element or the existence of a prior index i with x constrained by f(i).castSucc.
Русский
Принадлежность Fin-пусти в finset f x эквивалентна либо последнему элементу, либо существованию индекса i, для которого x ограничено (с помощью castSucc) через f(i).
LaTeX
$$$i \in finset\ f\ x \iff i = \mathrm{Fin.last}\ _ \lor \exists h, x \le (f (i.castPred h)).castSucc.$$$
Lean4
@[simp]
theorem last_mem_finset (f : Fin (n + 1) →o Fin (m + 1)) (x : Fin (m + 2)) : Fin.last _ ∈ finset f x := by
simp [mem_finset_iff]