The areas / V33. Data structures and computation
Mathlib.Data.List.Find
2 declarations. Mathlib docs · Source
theorem List.find?_eq_find?_of_perm E1 #
∀ {α : Type u_1} {p : α → Bool} {l₁ l₂ : List α},
l₁.Perm l₂ → {x | x ∈ l₁ ∧ p x = true}.Subsingleton → List.find? p l₁ = List.find? p l₂
If there is at most one element satisfying p, then find? agrees on permuted lists.
theorem List.find?_congr E1 #
∀ {α : Type u_1} {p₁ p₂ : α → Bool} {l l' : List α},
l = l' → (∀ x ∈ l, p₁ x = p₂ x) → List.find? p₁ l = List.find? p₂ l'
If two predicates agree on all the elements, so does find?.