mathlib documentation

core.​init.​data.​nat.​basic

core.​init.​data.​nat.​basic

inductive nat.​less_than_or_equal  :
ℕ → ℕ → Prop

@[instance]

Equations
def nat.​le  :
ℕ → ℕ → Prop

Equations
def nat.​lt  :
ℕ → ℕ → Prop

Equations
@[instance]

Equations
def nat.​pred  :
ℕ → ℕ

Equations
def nat.​sub  :
ℕ → ℕ → ℕ

Equations
def nat.​mul  :
ℕ → ℕ → ℕ

Equations
@[instance]

Equations
@[instance]

Equations
@[instance]

Equations
@[instance]

Equations
def nat.​repeat {α : Type u} :
(ℕ → α → α) → ℕ → α → α

Equations
@[instance]

Equations
@[simp]
theorem nat.​nat_zero_eq_zero  :
0 = 0

def nat.​le_refl (a : ℕ) :
a ≤ a

Equations
theorem nat.​le_succ (n : ℕ) :
n ≤ n.succ

theorem nat.​succ_le_succ {n m : ℕ} :
n ≤ m → n.succ ≤ m.succ

theorem nat.​zero_le (n : ℕ) :
0 ≤ n

theorem nat.​zero_lt_succ (n : ℕ) :
0 < n.succ

theorem nat.​not_succ_le_zero (n : ℕ) :
n.succ ≤ 0 → false

theorem nat.​not_lt_zero (a : ℕ) :
¬a < 0

theorem nat.​pred_le_pred {n m : ℕ} :
n ≤ m → n.pred ≤ m.pred

theorem nat.​le_of_succ_le_succ {n m : ℕ} :
n.succ ≤ m.succ → n ≤ m

@[instance]
def nat.​decidable_le (a b : ℕ) :

Equations
@[instance]
def nat.​decidable_lt (a b : ℕ) :
decidable (a < b)

Equations
theorem nat.​eq_or_lt_of_le {a b : ℕ} :
a ≤ b → a = b ∨ a < b

theorem nat.​lt_succ_of_le {a b : ℕ} :
a ≤ b → a < b.succ

@[simp]
theorem nat.​succ_sub_succ_eq_sub (a b : ℕ) :
a.succ - b.succ = a - b

theorem nat.​lt_irrefl (n : ℕ) :
¬n < n

theorem nat.​le_trans {n m k : ℕ} :
n ≤ m → m ≤ k → n ≤ k

theorem nat.​pred_le (n : ℕ) :
n.pred ≤ n

theorem nat.​pred_lt {n : ℕ} :
n ≠ 0 → n.pred < n

theorem nat.​sub_le (a b : ℕ) :
a - b ≤ a

theorem nat.​sub_lt {a b : ℕ} :
0 < a → 0 < b → a - b < a

theorem nat.​lt_of_lt_of_le {n m k : ℕ} :
n < m → m ≤ k → n < k

theorem nat.​zero_add (n : ℕ) :
0 + n = n

theorem nat.​succ_add (n m : ℕ) :
n.succ + m = (n + m).succ

theorem nat.​add_succ (n m : ℕ) :
n + m.succ = (n + m).succ

theorem nat.​add_zero (n : ℕ) :
n + 0 = n

theorem nat.​add_one (n : ℕ) :
n + 1 = n.succ

theorem nat.​succ_eq_add_one (n : ℕ) :
n.succ = n + 1

theorem nat.​bit0_succ_eq (n : ℕ) :

theorem nat.​zero_lt_bit0 {n : ℕ} :
n ≠ 0 → 0 < bit0 n

theorem nat.​zero_lt_bit1 (n : ℕ) :
0 < bit1 n

theorem nat.​bit0_ne_zero {n : ℕ} :
n ≠ 0 → bit0 n ≠ 0

theorem nat.​bit1_ne_zero (n : ℕ) :
bit1 n ≠ 0

def nat.​pow  :
ℕ → ℕ → ℕ

Equations
@[instance]

Equations
theorem nat.​pow_succ (b n : ℕ) :
b ^ n.succ = b ^ n * b

@[simp]
theorem nat.​pow_zero (b : ℕ) :
b ^ 0 = 1