# Explicit least witnesses to existentials on positive natural numbers #

Implemented via calling out to Nat.find.

instance PNat.decidablePredExistsNat {p : } [] :
DecidablePred fun (n' : ) => ∃ (n : ℕ+) (_ : n' = n), p n
Equations
def PNat.findX {p : } [] (h : ∃ (n : ℕ+), p n) :
{ n : ℕ+ // p n m < n, ¬p m }

The PNat version of Nat.findX

Equations
Instances For
def PNat.find {p : } [] (h : ∃ (n : ℕ+), p n) :

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_spec is the proof that PNat.find hp satisfies p.
• PNat.find_min is the proof that if m < PNat.find hp then m does not satisfy p.
• PNat.find_min' is the proof that if m does satisfy p then PNat.find hp ≤ m.
Equations
Instances For
theorem PNat.find_spec {p : } [] (h : ∃ (n : ℕ+), p n) :
p (PNat.find h)
theorem PNat.find_min {p : } [] (h : ∃ (n : ℕ+), p n) {m : ℕ+} :
m < ¬p m
theorem PNat.find_min' {p : } [] (h : ∃ (n : ℕ+), p n) {m : ℕ+} (hm : p m) :
m
theorem PNat.find_eq_iff {p : } [] (h : ∃ (n : ℕ+), p n) {m : ℕ+} :
= m p m n < m, ¬p n
@[simp]
theorem PNat.find_lt_iff {p : } [] (h : ∃ (n : ℕ+), p n) (n : ℕ+) :
< n m < n, p m
@[simp]
theorem PNat.find_le_iff {p : } [] (h : ∃ (n : ℕ+), p n) (n : ℕ+) :
n mn, p m
@[simp]
theorem PNat.le_find_iff {p : } [] (h : ∃ (n : ℕ+), p n) (n : ℕ+) :
n m < n, ¬p m
@[simp]
theorem PNat.lt_find_iff {p : } [] (h : ∃ (n : ℕ+), p n) (n : ℕ+) :
n < mn, ¬p m
@[simp]
theorem PNat.find_eq_one {p : } [] (h : ∃ (n : ℕ+), p n) :
= 1 p 1
theorem PNat.one_le_find {p : } [] (h : ∃ (n : ℕ+), p n) :
1 < ¬p 1
theorem PNat.find_mono {p : } {q : } [] [] (h : ∀ (n : ℕ+), q np n) {hp : ∃ (n : ℕ+), p n} {hq : ∃ (n : ℕ+), q n} :
theorem PNat.find_le {p : } [] {n : ℕ+} {h : ∃ (n : ℕ+), p n} (hn : p n) :
n
theorem PNat.find_comp_succ {p : } [] (h : ∃ (n : ℕ+), p n) (h₂ : ∃ (n : ℕ+), p (n + 1)) (h1 : ¬p 1) :
= + 1