Explicit least witnesses to existentials on positive natural numbers #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Implemented via calling out to nat.find.
@[protected, instance]
Equations
- pnat.decidable_pred_exists_nat = λ (n' : ℕ), decidable_of_iff' (∃ (h : 0 < n'), p ⟨n', h⟩) _
@[protected]
The pnat version of nat.find_x
Equations
- pnat.find_x h = ⟨⟨↑(nat.find_x _), _⟩, _⟩
@[protected]
If p is a (decidable) predicate on ℕ+ and hp : ∃ (n : ℕ+), p n is a proof that
there exists some positive natural number satisfying p, then pnat.find hp is the
smallest positive natural number satisfying p. Note that pnat.find is protected,
meaning that you can't just write find, even if the pnat namespace is open.
The API for pnat.find is:
pnat.find_specis the proof thatpnat.find hpsatisfiesp.pnat.find_minis the proof that ifm < pnat.find hpthenmdoes not satisfyp.pnat.find_min'is the proof that ifmdoes satisfypthenpnat.find hp ≤ m.
Equations
- pnat.find h = ↑(pnat.find_x h)
@[protected]