Documentation

Mathlib.Data.Int.Basic

Basic operations on the integers #

This file builds on Data.Int.Init by adding basic lemmas on integers. depending on Mathlib definitions.

theorem Int.inductionOn'_add_one {C : Sort u_1} {z b : } {H0 : C b} {Hs : (k : ) → b kC kC (k + 1)} {Hp : (k : ) → k bC kC (k - 1)} (hz : b z) :
(z + 1).inductionOn' b H0 Hs Hp = Hs z hz (z.inductionOn' b H0 Hs Hp)
theorem Int.strongRec_of_ge {m n : } {P : Sort u_1} {lt : (n : ) → n < mP n} {ge : (n : ) → n m((k : ) → k < nP k)P n} (hn : m n) :
Int.strongRec lt ge n = ge n hn fun (k : ) (x : k < n) => Int.strongRec lt ge k

nat abs #

theorem Int.pow_right_injective {a : } (h : 1 < a.natAbs) :
Function.Injective fun (x : ) => a ^ x

dvd #

theorem Int.natCast_dvd_natCast {m n : } :
m n m n
theorem Int.natCast_dvd {n : } {m : } :
m n m n.natAbs
theorem Int.dvd_natCast {m : } {n : } :
m n m.natAbs n
theorem Int.eq_zero_of_dvd_of_natAbs_lt_natAbs {m n : } (hmn : m n) (hnm : n.natAbs < m.natAbs) :
n = 0

If an integer with larger absolute value divides an integer, it is zero.

theorem Int.eq_zero_of_dvd_of_nonneg_of_lt {m n : } (hm : 0 m) (hmn : m < n) (hnm : n m) :
m = 0
theorem Int.eq_of_mod_eq_of_natAbs_sub_lt_natAbs {a b c : } (h1 : a % b = c) (h2 : (a - c).natAbs < b.natAbs) :
a = c

If two integers are congruent to a sufficiently large modulus, they are equal.

theorem Int.natAbs_le_of_dvd_ne_zero {m n : } (hmn : m n) (hn : n 0) :