File: Mathlib/Data/PNat/Defs.lean

full_name: PNat
code: /-- `ℕ+` is the type of positive natural numbers. It is defined as a subtype,
  and the VM representation of `ℕ+` is the same as `ℕ` because the proof
  is not stored. -/
def PNat 
goal: Type

full_name: _aux_Mathlib_Data_PNat_Defs___unexpand_PNat_1
code: @[inherit_doc]
notation "ℕ+" => PNat
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_Data_PNat_Defs___macroRules_termℕ+_1»
code: @[inherit_doc]
notation "ℕ+" => PNat
goal: Lean.Macro

full_name: instOnePNat
code: instance : One ℕ+ 
goal: One ℕ+

full_name: PNat.val
code: /-- The underlying natural number -/
@[coe]
def PNat.val : ℕ+ → ℕ 
goal: ℕ+ → ℕ

full_name: coePNatNat
code: instance coePNatNat : Coe ℕ+ ℕ 
goal: Coe ℕ+ ℕ

full_name: instReprPNat
code: instance : Repr ℕ+ 
goal: Repr ℕ+

full_name: instOfNatPNatOfNeZeroNat
code: instance (n : ℕ) [NeZero n] : OfNat ℕ+ n 
goal: OfNat ℕ+ n

full_name: PNat.mk_coe
code: @[simp]
theorem mk_coe (n h) : (PNat.val (⟨n, h⟩ : ℕ+) : ℕ) = n 
goal: ↑⟨n, h⟩ = n

full_name: PNat.natPred
code: /-- Predecessor of a `ℕ+`, as a `ℕ`. -/
def natPred (i : ℕ+) : ℕ 
goal: ℕ

full_name: PNat.natPred_eq_pred
code: @[simp]
theorem natPred_eq_pred {n : ℕ} (h : 0 < n) : natPred (⟨n, h⟩ : ℕ+) = n.pred 
goal: PNat.natPred ⟨n, h⟩ = n.pred

full_name: Nat.toPNat
code: /-- Convert a natural number to a positive natural number. The
  positivity assumption is inferred by `dec_trivial`. -/
def toPNat (n : ℕ) (h : 0 < n := by decide) : ℕ+ 
goal: ℕ+

full_name: Nat.succPNat
code: /-- Write a successor as an element of `ℕ+`. -/
def succPNat (n : ℕ) : ℕ+ 
goal: ℕ+

full_name: Nat.succPNat_coe
code: @[simp]
theorem succPNat_coe (n : ℕ) : (succPNat n : ℕ) = succ n 
goal: ↑n.succPNat = n.succ

full_name: Nat.natPred_succPNat
code: @[simp]
theorem natPred_succPNat (n : ℕ) : n.succPNat.natPred = n 
goal: n.succPNat.natPred = n

full_name: PNat.succPNat_natPred
code: @[simp]
theorem _root_.PNat.succPNat_natPred (n : ℕ+) : n.natPred.succPNat = n 
goal: n.natPred.succPNat = n

full_name: Nat.toPNat'
code: /-- Convert a natural number to a `PNat`. `n+1` is mapped to itself,
  and `0` becomes `1`. -/
def toPNat' (n : ℕ) : ℕ+ 
goal: ℕ+

full_name: Nat.toPNat'_zero
code: @[simp]
theorem toPNat'_zero : Nat.toPNat' 0 = 1 
goal: Nat.toPNat' 0 = 1

full_name: Nat.toPNat'_coe
code: @[simp]
theorem toPNat'_coe : ∀ n : ℕ, (toPNat' n : ℕ) = ite (0 < n) n 1
  
goal: ↑n.toPNat' = if 0 < n then n else 1

full_name: PNat.mk_le_mk
code: /-- 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.
-/
-- Porting note: no `simp`  because simp can prove it
theorem mk_le_mk (n k : ℕ) (hn : 0 < n) (hk : 0 < k) : (⟨n, hn⟩ : ℕ+) ≤ ⟨k, hk⟩ ↔ n ≤ k 
goal: ⟨n, hn⟩ ≤ ⟨k, hk⟩ ↔ n ≤ k

full_name: PNat.mk_lt_mk
code: theorem mk_lt_mk (n k : ℕ) (hn : 0 < n) (hk : 0 < k) : (⟨n, hn⟩ : ℕ+) < ⟨k, hk⟩ ↔ n < k 
goal: ⟨n, hn⟩ < ⟨k, hk⟩ ↔ n < k

full_name: PNat.coe_le_coe
code: @[simp, norm_cast]
theorem coe_le_coe (n k : ℕ+) : (n : ℕ) ≤ k ↔ n ≤ k 
goal: ↑n ≤ ↑k ↔ n ≤ k

full_name: PNat.coe_lt_coe
code: @[simp, norm_cast]
theorem coe_lt_coe (n k : ℕ+) : (n : ℕ) < k ↔ n < k 
goal: ↑n < ↑k ↔ n < k

full_name: PNat.pos
code: @[simp]
theorem pos (n : ℕ+) : 0 < (n : ℕ) 
goal: 0 < ↑n

full_name: PNat.eq
code: theorem eq {m n : ℕ+} : (m : ℕ) = n → m = n 
goal: ↑m = ↑n → m = n

full_name: PNat.coe_injective
code: theorem coe_injective : Function.Injective (fun (a : ℕ+) => (a : ℕ)) 
goal: Function.Injective fun a => ↑a

full_name: PNat.ne_zero
code: @[simp]
theorem ne_zero (n : ℕ+) : (n : ℕ) ≠ 0 
goal: ↑n ≠ 0

full_name: NeZero.pnat
code: instance _root_.NeZero.pnat {a : ℕ+} : NeZero (a : ℕ) 
goal: NeZero ↑a

full_name: PNat.toPNat'_coe
code: theorem toPNat'_coe {n : ℕ} : 0 < n → (n.toPNat' : ℕ) = n 
goal: 0 < n → ↑n.toPNat' = n

full_name: PNat.coe_toPNat'
code: @[simp]
theorem coe_toPNat' (n : ℕ+) : (n : ℕ).toPNat' = n 
goal: (↑n).toPNat' = n

full_name: PNat.one_le
code: @[simp]
theorem one_le (n : ℕ+) : (1 : ℕ+) ≤ n 
goal: 1 ≤ n

full_name: PNat.not_lt_one
code: @[simp]
theorem not_lt_one (n : ℕ+) : ¬n < 1 
goal: ¬n < 1

full_name: PNat.instInhabited
code: instance : Inhabited ℕ+ 
goal: Inhabited ℕ+

full_name: PNat.mk_one
code: @[simp]
theorem mk_one {h} : (⟨1, h⟩ : ℕ+) = (1 : ℕ+) 
goal: ⟨1, h⟩ = 1

full_name: PNat.one_coe
code: @[norm_cast]
theorem one_coe : ((1 : ℕ+) : ℕ) = 1 
goal: ↑1 = 1

full_name: PNat.coe_eq_one_iff
code: @[simp, norm_cast]
theorem coe_eq_one_iff {m : ℕ+} : (m : ℕ) = 1 ↔ m = 1 
goal: ↑m = 1 ↔ m = 1

full_name: PNat.instWellFoundedRelation
code: instance : WellFoundedRelation ℕ+ 
goal: WellFoundedRelation ℕ+

full_name: PNat.strongInductionOn
code: /-- Strong induction on `ℕ+`. -/
def strongInductionOn {p : ℕ+ → Sort*} (n : ℕ+) : (∀ k, (∀ m, m < k → p m) → p k) → p n
  
goal: ((k : ℕ+) → ((m : ℕ+) → m < k → p m) → p k) → p n

full_name: PNat.modDivAux
code: /-- We define `m % k` and `m / k` in the same way as for `ℕ`
  except that when `m = n * k` we take `m % k = k` and
  `m / k = n - 1`.  This ensures that `m % k` is always positive
  and `m = (m % k) + k * (m / k)` in all cases.  Later we
  define a function `div_exact` which gives the usual `m / k`
  in the case where `k` divides `m`.
-/
def modDivAux : ℕ+ → ℕ → ℕ → ℕ+ × ℕ
  
goal: ℕ+ → ℕ → ℕ → ℕ+ × ℕ

full_name: PNat.modDiv
code: /-- `mod_div m k = (m % k, m / k)`.
  We define `m % k` and `m / k` in the same way as for `ℕ`
  except that when `m = n * k` we take `m % k = k` and
  `m / k = n - 1`.  This ensures that `m % k` is always positive
  and `m = (m % k) + k * (m / k)` in all cases.  Later we
  define a function `div_exact` which gives the usual `m / k`
  in the case where `k` divides `m`.
-/
def modDiv (m k : ℕ+) : ℕ+ × ℕ 
goal: ℕ+ × ℕ

full_name: PNat.mod
code: /-- We define `m % k` in the same way as for `ℕ`
  except that when `m = n * k` we take `m % k = k` This ensures that `m % k` is always positive.
-/
def mod (m k : ℕ+) : ℕ+ 
goal: ℕ+

full_name: PNat.div
code: /-- We define `m / k` in the same way as for `ℕ` except that when `m = n * k` we take
  `m / k = n - 1`. This ensures that `m = (m % k) + k * (m / k)` in all cases. Later we
  define a function `div_exact` which gives the usual `m / k` in the case where `k` divides `m`.
-/
def div (m k : ℕ+) : ℕ 
goal: ℕ

full_name: PNat.mod_coe
code: theorem mod_coe (m k : ℕ+) :
    (mod m k : ℕ) = ite ((m : ℕ) % (k : ℕ) = 0) (k : ℕ) ((m : ℕ) % (k : ℕ)) 
goal: ↑(m.mod k) = if ↑m % ↑k = 0 then ↑k else ↑m % ↑k

full_name: PNat.div_coe
code: theorem div_coe (m k : ℕ+) :
    (div m k : ℕ) = ite ((m : ℕ) % (k : ℕ) = 0) ((m : ℕ) / (k : ℕ)).pred ((m : ℕ) / (k : ℕ)) 
goal: m.div k = if ↑m % ↑k = 0 then (↑m / ↑k).pred else ↑m / ↑k

full_name: PNat.divExact
code: /-- If `h : k | m`, then `k * (div_exact m k) = m`. Note that this is not equal to `m / k`. -/
def divExact (m k : ℕ+) : ℕ+ 
goal: ℕ+

full_name: Nat.canLiftPNat
code: instance Nat.canLiftPNat : CanLift ℕ ℕ+ (↑) (fun n => 0 < n) 
goal: CanLift ℕ ℕ+ PNat.val fun n => 0 < n

full_name: Int.canLiftPNat
code: instance Int.canLiftPNat : CanLift ℤ ℕ+ (↑) ((0 < ·)) 
goal: CanLift ℤ ℕ+ (fun x => ↑↑x) fun x => 0 < x