The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

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_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.

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