Finding subsingleton elements within multisets #
This module provides Multiset.find? s p ⋯, which lifts List.find? to multisets.
s.find? p ⋯ finds the subsingleton element of s satisfying the condition p, if one exists.
This is the multiset version of List.find?,
and is like Multiset.choose, but Option-valued.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Multiset.find?_coe {α : Type u_1} (p : α → Prop) [DecidablePred p] (l : List α) (hp : {x : α | x ∈ ↑l ∧ p x}.Subsingleton) :
@[simp]
theorem Multiset.find?_congr {α : Type u_1} {p₁ p₂ : α → Prop} [DecidablePred p₁] [DecidablePred p₂] {s : Multiset α} (hp₁ : {x : α | x ∈ s ∧ p₁ x}.Subsingleton) (h : ∀ (x : α), x ∈ s → (p₁ x ↔ p₂ x)) :
If two predicates agree on all the elements, so does find?.