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

78 declarations and 2 deprecated aliases. Mathlib docs · Source

instance instAddLeftMonoPNat E0 #

AddLeftMono ℕ+

instance instIsOrderedCancelMonoidPNat E0 #

IsOrderedCancelMonoid ℕ+

instance instMulPNat E0 #

Mul ℕ+

instance instCommMonoidPNat E0 #

CommMonoid ℕ+

instance instAddCommSemigroupPNat E0 #

AddCommSemigroup ℕ+

instance instAddLeftReflectLEPNat E0 #

AddLeftReflectLE ℕ+

instance instAddLeftReflectLTPNat E0 #

AddLeftReflectLT ℕ+

instance instAddRightCancelSemigroupPNat E0 #

AddRightCancelSemigroup ℕ+

instance instDistribPNat E0 #

Distrib ℕ+

instance instAddLeftStrictMonoPNat E0 #

AddLeftStrictMono ℕ+

instance instWellFoundedLTPNat E0 #

WellFoundedLT ℕ+

instance instAddLeftCancelSemigroupPNat E0 #

AddLeftCancelSemigroup ℕ+

instance instAddPNat E0 #

Add ℕ+

instance PNat.instCancelCommMonoid E0 #

CancelCommMonoid ℕ+

theorem PNat.one_add_natPred E0 #

∀ (n : ℕ+), 1 + n.natPred = ↑n

theorem PNat.natPred_add_one E0 #

∀ (n : ℕ+), n.natPred + 1 = ↑n

theorem PNat.natPred_strictMono E1 #

StrictMono PNat.natPred

theorem PNat.natPred_monotone E1 #

Monotone PNat.natPred

theorem PNat.natPred_injective E1 #

Function.Injective PNat.natPred

theorem PNat.natPred_lt_natPred E0 #

∀ {m n : ℕ+}, m.natPred < n.natPred ↔ m < n

theorem PNat.natPred_le_natPred E0 #

∀ {m n : ℕ+}, m.natPred ≤ n.natPred ↔ m ≤ n

theorem PNat.natPred_inj E0 #

∀ {m n : ℕ+}, m.natPred = n.natPred ↔ m = n

theorem PNat.val_ofNat E0 #

∀ (n : ℕ) [inst : NeZero n], ↑(OfNat.ofNat n) = OfNat.ofNat n

theorem PNat.mk_ofNat E0 #

∀ (n : ℕ) (h : 0 < n), ⟨OfNat.ofNat n, h⟩ = OfNat.ofNat n

theorem Nat.succPNat_strictMono E1 #

StrictMono Nat.succPNat

theorem Nat.succPNat_mono E1 #

Monotone Nat.succPNat

theorem Nat.succPNat_lt_succPNat E0 #

∀ {m n : ℕ}, m.succPNat < n.succPNat ↔ m < n

theorem Nat.succPNat_le_succPNat E0 #

∀ {m n : ℕ}, m.succPNat ≤ n.succPNat ↔ m ≤ n

theorem Nat.succPNat_injective E1 #

Function.Injective Nat.succPNat

theorem Nat.succPNat_inj E0 #

∀ {n m : ℕ}, n.succPNat = m.succPNat ↔ n = m

theorem PNat.coe_inj E0 #

∀ {m n : ℕ+}, ↑m = ↑n ↔ m = n

We now define a long list of structures on ℕ+ induced by similar structures on ℕ. Most of these behave in a completely obvious way, but there are a few things to be said about subtraction, division and powers.

theorem PNat.add_coe E0 #

∀ (m n : ℕ+), ↑(m + n) = ↑m + ↑n

def PNat.coeAddHom E1 #

ℕ+ →ₙ+ ℕ

coe promoted to an AddHom, that is, a morphism which preserves addition.

theorem PNat.coeAddHom_apply E0 #

∀ (a : ℕ+), PNat.coeAddHom a = ↑a

def OrderIso.pnatIsoNat E1 #

ℕ+ ≃o ℕ

The order isomorphism between ℕ and ℕ+ given by succ.

theorem OrderIso.pnatIsoNat_apply E0 #

⇑OrderIso.pnatIsoNat = PNat.natPred

theorem OrderIso.pnatIsoNat_symm_apply E0 #

⇑OrderIso.pnatIsoNat.symm = Nat.succPNat

theorem PNat.lt_add_one_iff E0 #

∀ {a b : ℕ+}, a < b + 1 ↔ a ≤ b

theorem PNat.add_one_le_iff E0 #

∀ {a b : ℕ+}, a + 1 ≤ b ↔ a < b

instance PNat.instOrderBot E0 #

OrderBot ℕ+

instance PNat.instIsBotOneClass E0 #

IsBotOneClass ℕ+

theorem PNat.bot_eq_one E0 #

⊥ = 1

def PNat.caseStrongInductionOn E1 #

{p : ℕ+ → Sort u_1} → (a : ℕ+) → p 1 → ((n : ℕ+) → ((m : ℕ+) → m ≤ n → p m) → p (n + 1)) → p a

Strong induction on ℕ+, with n = 1 treated separately.

def PNat.recOn E1 #

(n : ℕ+) → {p : ℕ+ → Sort u_1} → p 1 → ((n : ℕ+) → p n → p (n + 1)) → p n

An induction principle for ℕ+: it takes values in Sort*, so it applies also to Types, not only to Prop.

theorem PNat.recOn_one E0 #

∀ {p : ℕ+ → Sort u_1} (one : p 1) (succ : (n : ℕ+) → p n → p (n + 1)), PNat.recOn 1 one succ = one

theorem PNat.recOn_succ E0 #

∀ (n : ℕ+) {p : ℕ+ → Sort u_1} (one : p 1) (succ : (n : ℕ+) → p n → p (n + 1)),
  (n + 1).recOn one succ = succ n (n.recOn one succ)

theorem PNat.ofNat_le_ofNat E0 #

∀ {m n : ℕ} [inst : NeZero m] [inst_1 : NeZero n], OfNat.ofNat m ≤ OfNat.ofNat n ↔ OfNat.ofNat m ≤ OfNat.ofNat n

theorem PNat.ofNat_lt_ofNat E0 #

∀ {m n : ℕ} [inst : NeZero m] [inst_1 : NeZero n], OfNat.ofNat m < OfNat.ofNat n ↔ OfNat.ofNat m < OfNat.ofNat n

theorem PNat.ofNat_inj E0 #

∀ {m n : ℕ} [inst : NeZero m] [inst_1 : NeZero n], OfNat.ofNat m = OfNat.ofNat n ↔ OfNat.ofNat m = OfNat.ofNat n

theorem PNat.mul_coe E0 #

∀ (m n : ℕ+), ↑(m * n) = ↑m * ↑n

def PNat.coeMonoidHom E1 #

ℕ+ →* ℕ

PNat.coe promoted to a MonoidHom.

theorem PNat.coe_coeMonoidHom E0 #

⇑PNat.coeMonoidHom = PNat.val

theorem PNat.lt_add_left E1 #

∀ (n m : ℕ+), n < m + n

theorem PNat.lt_add_right E1 #

∀ (n m : ℕ+), n < n + m

theorem PNat.pow_coe E0 #

∀ (m : ℕ+) (n : ℕ), ↑(m ^ n) = ↑m ^ n

theorem PNat.add_one E1 #

∀ (a : ℕ+), a + 1 = (↑a).succPNat

theorem PNat.lt_succ_self E1 #

∀ (a : ℕ+), a < (↑a).succPNat

instance PNat.instSub E0 #

Sub ℕ+

Subtraction a - b is defined in the obvious way when a > b, and by a - b = 1 if a ≤ b.

theorem PNat.sub_coe E0 #

∀ (a b : ℕ+), ↑(a - b) = if b < a then ↑a - ↑b else 1

theorem PNat.sub_le E1 #

∀ (a b : ℕ+), a - b ≤ a

theorem PNat.le_sub_one_of_lt E1 #

∀ {a b : ℕ+}, a < b → a ≤ b - 1

theorem PNat.add_sub_of_lt E1 #

∀ {a b : ℕ+}, a < b → a + (b - a) = b

theorem PNat.sub_add_of_lt E1 #

∀ {a b : ℕ+}, b < a → a - b + b = a

theorem PNat.add_sub E0 #

∀ {a b : ℕ+}, a + b - b = a

theorem PNat.exists_eq_succ_of_ne_one E1 #

∀ {n : ℕ+}, n ≠ 1 → ∃ k, n = k + 1

If n : ℕ+ is different from 1, then it is the successor of some k : ℕ+.

theorem PNat.modDivAux_spec E1 #

∀ (k : ℕ+) (r q : ℕ), ¬(r = 0 ∧ q = 0) → ↑(k.modDivAux r q).1 + ↑k * (k.modDivAux r q).2 = r + ↑k * q

Lemmas with div, dvd and mod operations

theorem PNat.mod_add_div E1 #

∀ (m k : ℕ+), ↑(m.mod k) + ↑k * m.div k = ↑m

theorem PNat.div_add_mod E1 #

∀ (m k : ℕ+), ↑k * m.div k + ↑(m.mod k) = ↑m

theorem PNat.mod_add_div' E1 #

∀ (m k : ℕ+), ↑(m.mod k) + m.div k * ↑k = ↑m

theorem PNat.div_add_mod' E1 #

∀ (m k : ℕ+), m.div k * ↑k + ↑(m.mod k) = ↑m

theorem PNat.mod_le E1 #

∀ (m k : ℕ+), m.mod k ≤ m ∧ m.mod k ≤ k

theorem PNat.dvd_iff E0 #

∀ {k m : ℕ+}, k ∣ m ↔ ↑k ∣ ↑m

theorem PNat.dvd_iff' E1 #

∀ {k m : ℕ+}, k ∣ m ↔ m.mod k = k

theorem PNat.le_of_dvd E1 #

∀ {m n : ℕ+}, m ∣ n → m ≤ n

theorem PNat.mul_div_exact E1 #

∀ {m k : ℕ+}, k ∣ m → k * m.divExact k = m

theorem PNat.dvd_antisymm E1 #

∀ {m n : ℕ+}, m ∣ n → n ∣ m → m = n

theorem PNat.dvd_one_iff E0 #

∀ (n : ℕ+), n ∣ 1 ↔ n = 1

theorem PNat.pos_of_div_pos E1 #

∀ {n : ℕ+} {a : ℕ}, a ∣ ↑n → 0 < a

Deprecated aliases

NameNew nameSince
PNat.le_one_iffle_one_iff_eq_one2026-05-07
PNat.one_lt_of_ltone_lt_of_gt2026-05-07