Documentation

CslibFrontier.Foundations.Data.List.IdxOf

First indices under injective maps #

Mapping a list through an injective function does not move the first occurrence of any element.

Main results #

theorem List.idxOf_map_of_injective {α : Type u_1} {β : Type u_2} [BEq α] [LawfulBEq α] [BEq β] [LawfulBEq β] {f : α → β} (hf : Function.Injective f) (l : List α) (a : α) :
idxOf (f a) (map f l) = idxOf a l

Mapping a list through an injective function preserves the first index of every element.