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
- instPNatAddLeftCancelSemigroup = Positive.addLeftCancelSemigroup
Equations
- instPNatAddRightCancelSemigroup = Positive.addRightCancelSemigroup
Equations
- instPNatAddCommSemigroup = Positive.addCommSemigroup
Equations
- instPNatLinearOrderedCancelCommMonoid = Positive.linearOrderedCancelCommMonoid
Equations
- instPNatDistrib = Positive.instDistribSubtypeLtOfNat
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
The order isomorphism between ℕ and ℕ+ given by succ
.
Equations
- OrderIso.pnatIsoNat = { toEquiv := Equiv.pnatEquivNat, map_rel_iff' := ⋯ }
Instances For
@[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.ofNat_le_ofNat
{m : ℕ}
{n : ℕ}
[NeZero m]
[NeZero n]
:
OfNat.ofNat m ≤ OfNat.ofNat n ↔ OfNat.ofNat m ≤ OfNat.ofNat n
@[simp]
theorem
PNat.ofNat_lt_ofNat
{m : ℕ}
{n : ℕ}
[NeZero m]
[NeZero n]
:
OfNat.ofNat m < OfNat.ofNat n ↔ OfNat.ofNat m < OfNat.ofNat n
@[simp]
theorem
PNat.ofNat_inj
{m : ℕ}
{n : ℕ}
[NeZero m]
[NeZero n]
:
OfNat.ofNat m = OfNat.ofNat n ↔ OfNat.ofNat m = OfNat.ofNat n
PNat.coe
promoted to a MonoidHom
.
Equations
- PNat.coeMonoidHom = { 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 : ℕ+) => (↑a - ↑b).toPNat' }