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
- PNat.instWellFoundedLTPNatToLTToPreorderToPartialOrderToOrderedCancelCommMonoidInstPNatLinearOrderedCancelCommMonoid = (_ : IsWellFounded ℕ+ WellFoundedRelation.rel)
instance
PNat.instIsWellOrderPNatLtToLTToPreorderToPartialOrderToOrderedCancelCommMonoidInstPNatLinearOrderedCancelCommMonoid :
IsWellOrder ℕ+ fun x x_1 => x < x_1
Equations
- One or more equations did not get rendered due to their size.
@[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
instance
PNat.covariantClass_add_le :
CovariantClass ℕ+ ℕ+ (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
instance
PNat.covariantClass_add_lt :
CovariantClass ℕ+ ℕ+ (fun x x_1 => x + x_1) fun x x_1 => x < x_1
instance
PNat.contravariantClass_add_le :
ContravariantClass ℕ+ ℕ+ (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
instance
PNat.contravariantClass_add_lt :
ContravariantClass ℕ+ ℕ+ (fun x x_1 => x + x_1) fun x x_1 => x < x_1
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' := (_ : ∀ {a b : ℕ+}, PNat.natPred a ≤ PNat.natPred b ↔ a ≤ b) }
Instances For
@[simp]
Equations
- One or more equations did not get rendered due to their size.
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.instSubPNat = { sub := fun a b => Nat.toPNat' (↑a - ↑b) }
@[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)