The positive natural numbers #
This file develops the type ℕ+
or PNat
, the subtype of natural numbers that are positive.
It is defined in Data.PNat.Defs
, but most of the development is deferred to here so
that Data.PNat.Defs
can have very few imports.
Equations
@[simp]
@[simp]
@[simp]
@[simp]
coe
promoted to an AddHom
, that is, a morphism which preserves addition.
Equations
- PNat.coeAddHom = { toFun := Coe.coe, map_add' := PNat.add_coe }
Instances For
Equations
Equations
Equations
Equations
An equivalence between ℕ+
and ℕ
given by PNat.natPred
and Nat.succPNat
.
Equations
- Equiv.pnatEquivNat = { toFun := PNat.natPred, invFun := Nat.succPNat, left_inv := PNat.succPNat_natPred, right_inv := Nat.natPred_succPNat }
Instances For
The order isomorphism between ℕ and ℕ+ given by succ
.
Equations
- OrderIso.pnatIsoNat = { toEquiv := Equiv.pnatEquivNat, map_rel_iff' := ⋯ }
Instances For
@[simp]
@[simp]
theorem
PNat.recOn_one
{p : ℕ+ → Sort u_1}
(p1 : p 1)
(hp : (n : ℕ+) → p n → p (n + 1))
:
PNat.recOn 1 p1 hp = p1
@[simp]
theorem
PNat.recOn_succ
(n : ℕ+)
{p : ℕ+ → Sort u_1}
(p1 : p 1)
(hp : (n : ℕ+) → p n → p (n + 1))
:
PNat.recOn (n + 1) p1 hp = hp n (PNat.recOn n p1 hp)
PNat.coe
promoted to a MonoidHom
.
Equations
- PNat.coeMonoidHom = { toOneHom := { toFun := Coe.coe, map_one' := PNat.one_coe }, map_mul' := PNat.mul_coe }
Instances For
Subtraction a - b is defined in the obvious way when a > b, and by a - b = 1 if a ≤ b.
Equations
- PNat.instSub = { sub := fun (a b : ℕ+) => Nat.toPNat' (↑a - ↑b) }