English
Let α be finite and p : α → Prop with decidablePred. If ∃! a, p a, then choose p hp ∈ α is the witness element.
Русский
Пусть α конечно, а p : α → Истина/Ложь сDecidablePred. Если существует единственный a, для которого p(a) выполняется, то choose p hp ∈ α является этим элементом.
LaTeX
$$$\\text{If } hp : \\exists! a, p(a), \\text{ then } \\text{choose } p hp \\in α$$$
Lean4
/-- Given a fintype `α` and a predicate `p`, associate to a proof that there is a unique element of
`α` satisfying `p` this unique element, as an element of `α`. -/
def choose (hp : ∃! a, p a) : α :=
chooseX p hp