Documentation

Mathlib.Data.Nat.Basic

Basic operations on the natural numbers #

This file builds on Mathlib.Data.Nat.Init by adding basic lemmas on natural numbers depending on Mathlib definitions.

See note [foundational algebra order theory].

succ, pred #

div #

theorem Nat.div_mul_div_le (a b c d : ) :
a / b * (c / d) a * c / (b * d)

pow #

TODO #

theorem Nat.pow_left_injective {n : } (hn : n 0) :
Function.Injective fun (a : ) => a ^ n
theorem Nat.pow_right_injective {a : } (ha : 2 a) :
Function.Injective fun (x : ) => a ^ x
theorem Nat.pow_left_inj {a b n : } (hn : n 0) :
a ^ n = b ^ n a = b
theorem Nat.pow_right_inj {a m n : } (ha : 2 a) :
a ^ m = a ^ n m = n
@[simp]
theorem Nat.pow_eq_one {a n : } :
a ^ n = 1 a = 1 n = 0
theorem Nat.pow_eq_self_iff {a b : } (ha : 1 < a) :
a ^ b = a b = 1

For a > 1, a ^ b = a iff b = 1.

@[simp]
theorem Nat.pow_le_one_iff {a n : } (hn : n 0) :
a ^ n 1 a 1

Recursion and induction principles #

This section is here due to dependencies -- the lemmas here require some of the lemmas proved above, and some of the results in later sections depend on the definitions in this section.

theorem Nat.leRecOn_injective {C : Sort u_1} {n m : } (hnm : n m) (next : {k : } → C kC (k + 1)) (Hnext : ∀ (n : ), Function.Injective next) :
Function.Injective (leRecOn hnm fun {k : } => next)
theorem Nat.leRecOn_surjective {C : Sort u_1} {n m : } (hnm : n m) (next : {k : } → C kC (k + 1)) (Hnext : ∀ (n : ), Function.Surjective next) :
Function.Surjective (leRecOn hnm fun {k : } => next)
theorem Nat.set_induction_bounded {n k : } {S : Set } (hk : k S) (h_ind : ∀ (k : ), k Sk + 1 S) (hnk : k n) :
n S

A subset of containing k : ℕ and closed under Nat.succ contains every n ≥ k.

theorem Nat.set_induction {S : Set } (hb : 0 S) (h_ind : ∀ (k : ), k Sk + 1 S) (n : ) :
n S

A subset of containing zero and closed under Nat.succ contains all of .

mod, dvd #

theorem Nat.dvd_sub' {m n k : } (h₁ : k m) (h₂ : k n) :
k m - n
theorem Nat.dvd_left_injective :
Function.Injective fun (x1 x2 : ) => x1 x2

dvd is injective in the left argument