Explicit least witnesses to existentials on positive natural numbers #
Implemented via calling out to Nat.find.
instance
PNat.decidablePredExistsNat
{p : ℕ+ → Prop}
[DecidablePred p]
:
DecidablePred fun (n' : ℕ) => ∃ (n : ℕ+) (_ : n' = ↑n), p n
Equations
- PNat.decidablePredExistsNat n' = decidable_of_iff' (∃ (h : 0 < n'), p ⟨n', h⟩) ⋯
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.findX h)
Instances For
theorem
PNat.find_min'
{p : ℕ+ → Prop}
[DecidablePred p]
(h : ∃ (n : ℕ+), p n)
{m : ℕ+}
(hm : p m)
:
@[simp]
@[simp]
@[simp]
theorem
PNat.find_mono
{p q : ℕ+ → Prop}
[DecidablePred p]
[DecidablePred q]
(h : ∀ (n : ℕ+), q n → p n)
{hp : ∃ (n : ℕ+), p n}
{hq : ∃ (n : ℕ+), q n}
: