Mathlib.Data.PNat.Find
17 declarations. Mathlib docs · Source
Explicit least witnesses to existentials on positive natural numbers
Implemented via calling out to Nat.find.
theorem PNat.find.congr_simp E1 #
∀ {p p_1 : ℕ+ → Prop} (e_p : p = p_1) {inst : DecidablePred p} [inst_1 : DecidablePred p_1] (h : ∃ n, p n),
PNat.find h = PNat.find ⋯
instance PNat.decidablePredExistsNat E0 #
{p : ℕ+ → Prop} → [DecidablePred p] → DecidablePred fun n' ↦ ∃ n, ∃ (_ : n' = ↑n), p n
def PNat.findX E1 #
{p : ℕ+ → Prop} → [DecidablePred p] → (∃ n, p n) → { n // p n ∧ ∀ m < n, ¬p m }
The PNat version of Nat.findX
def PNat.find E1 #
{p : ℕ+ → Prop} → [DecidablePred p] → (∃ 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_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.
theorem PNat.find_spec E1 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n), p (PNat.find h)
theorem PNat.find_min E1 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n) {m : ℕ+}, m < PNat.find h → ¬p m
theorem PNat.find_min' E1 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n) {m : ℕ+}, p m → PNat.find h ≤ m
theorem PNat.find_eq_iff E0 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n) {m : ℕ+}, PNat.find h = m ↔ p m ∧ ∀ n < m, ¬p n
theorem PNat.find_lt_iff E0 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n) (n : ℕ+), PNat.find h < n ↔ ∃ m < n, p m
theorem PNat.find_le_iff E0 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n) (n : ℕ+), PNat.find h ≤ n ↔ ∃ m ≤ n, p m
theorem PNat.le_find_iff E0 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n) (n : ℕ+), n ≤ PNat.find h ↔ ∀ m < n, ¬p m
theorem PNat.lt_find_iff E0 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n) (n : ℕ+), n < PNat.find h ↔ ∀ m ≤ n, ¬p m
theorem PNat.find_eq_one E0 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n), PNat.find h = 1 ↔ p 1
theorem PNat.one_le_find E1 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n), 1 < PNat.find h ↔ ¬p 1
theorem PNat.find_mono E1 #
∀ {p q : ℕ+ → Prop} [inst : DecidablePred p] [inst_1 : DecidablePred q],
(∀ (n : ℕ+), q n → p n) → ∀ {hp : ∃ n, p n} {hq : ∃ n, q n}, PNat.find hp ≤ PNat.find hq
theorem PNat.find_le E1 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] {n : ℕ+} {h : ∃ n, p n}, p n → PNat.find h ≤ n
theorem PNat.find_comp_succ E1 #
∀ {p : ℕ+ → Prop} [inst : DecidablePred p] (h : ∃ n, p n) (h₂ : ∃ n, p (n + 1)), ¬p 1 → PNat.find h = PNat.find h₂ + 1