Documentation

Mathlib.Algebra.Order.Group.Int

The integers form a linear ordered group #

This file contains the linear ordered group instance on the integers.

See note [foundational algebra order theory].

Recursors #

Equations
  • One or more equations did not get rendered due to their size.

Miscellaneous lemmas #

theorem Int.abs_eq_natAbs (a : ) :
|a| = (Int.natAbs a)
@[simp]
theorem Int.natCast_natAbs (n : ) :
(Int.natAbs n) = |n|
theorem Int.sign_mul_abs (a : ) :
Int.sign a * |a| = a
theorem Int.natAbs_le_self_sq (a : ) :
(Int.natAbs a) a ^ 2
theorem Int.le_self_sq (b : ) :
b b ^ 2
theorem Int.le_self_pow_two (b : ) :
b b ^ 2

Alias of Int.le_self_sq.

theorem Int.abs_natCast (n : ) :
|n| = n
theorem Int.natAbs_sub_pos_iff {i : } {j : } :
0 < Int.natAbs (i - j) i j
theorem Int.natAbs_sub_ne_zero_iff {i : } {j : } :
Int.natAbs (i - j) 0 i j

succ and pred #

theorem Int.le_add_one_iff {m : } {n : } :
m n + 1 m n m = n + 1
theorem Int.sub_one_lt_iff {a : } {b : } :
a - 1 < b a b
theorem Int.le_sub_one_iff {a : } {b : } :
a b - 1 a < b
@[simp]
theorem Int.abs_lt_one_iff {a : } :
|a| < 1 a = 0
theorem Int.abs_le_one_iff {a : } :
|a| 1 a = 0 a = 1 a = -1
theorem Int.one_le_abs {z : } (h₀ : z 0) :
1 |z|
def Int.inductionOn' {C : Sort u_1} (z : ) (b : ) (H0 : C b) (Hs : (k : ) → b kC kC (k + 1)) (Hp : (k : ) → k bC kC (k - 1)) :
C z

Inductively define a function on by defining it at b, for the succ of a number greater than b, and the pred of a number less than b.

Equations
Instances For
    def Int.inductionOn'.pos {C : Sort u_1} (b : ) (H0 : C b) (Hs : (k : ) → b kC kC (k + 1)) (n : ) :
    C (b + n)

    The positive case of Int.inductionOn'.

    Equations
    Instances For
      def Int.inductionOn'.neg {C : Sort u_1} (b : ) (H0 : C b) (Hp : (k : ) → k bC kC (k - 1)) (n : ) :
      C (b + Int.negSucc n)

      The negative case of Int.inductionOn'.

      Equations
      Instances For
        theorem Int.le_induction {P : Prop} {m : } (h0 : P m) (h1 : ∀ (n : ), m nP nP (n + 1)) (n : ) :
        m nP n

        See Int.inductionOn' for an induction in both directions.

        theorem Int.le_induction_down {P : Prop} {m : } (h0 : P m) (h1 : ∀ (n : ), n mP nP (n - 1)) (n : ) :
        n mP n

        See Int.inductionOn' for an induction in both directions.

        nat abs #

        / #

        theorem Int.ediv_eq_zero_of_lt_abs {a : } {b : } (H1 : 0 a) (H2 : a < |b|) :
        a / b = 0

        mod #

        @[simp]
        theorem Int.emod_abs (a : ) (b : ) :
        a % |b| = a % b
        theorem Int.emod_lt (a : ) {b : } (H : b 0) :
        a % b < |b|
        theorem Int.add_emod_eq_add_mod_right {m : } {n : } {k : } (i : ) (H : m % n = k % n) :
        (m + i) % n = (k + i) % n
        @[simp]
        theorem Int.neg_emod_two (i : ) :
        -i % 2 = i % 2

        properties of / and % #

        theorem Int.abs_ediv_le_abs (a : ) (b : ) :
        |a / b| |a|

        dvd #

        theorem Int.ediv_dvd_ediv {a : } {b : } {c : } :
        a bb cb / a c / a
        theorem Int.abs_sign_of_nonzero {z : } (hz : z 0) :
        |Int.sign z| = 1
        theorem Int.sign_eq_ediv_abs (a : ) :
        Int.sign a = a / |a|

        / and ordering #

        theorem Int.natAbs_eq_of_dvd_dvd {s : } {t : } (hst : s t) (hts : t s) :
        theorem Int.ediv_dvd_of_dvd {s : } {t : } (hst : s t) :
        t / s t

        toNat #

        @[simp]
        theorem Int.toNat_le {a : } {n : } :
        Int.toNat a n a n
        @[simp]
        theorem Int.lt_toNat {n : } {a : } :
        n < Int.toNat a n < a
        @[simp]
        theorem Int.natCast_nonpos_iff {n : } :
        n 0 n = 0
        theorem Int.toNat_le_toNat {a : } {b : } (h : a b) :
        theorem Int.toNat_lt_toNat {a : } {b : } (hb : 0 < b) :
        theorem Int.lt_of_toNat_lt {a : } {b : } (h : Int.toNat a < Int.toNat b) :
        a < b
        @[simp]
        theorem Int.toNat_pred_coe_of_pos {i : } (h : 0 < i) :
        (Int.toNat i - 1) = i - 1
        @[simp]
        theorem Int.toNat_eq_zero {n : } :
        Int.toNat n = 0 n 0
        @[simp]
        theorem Int.toNat_sub_of_le {a : } {b : } (h : b a) :
        (Int.toNat (a - b)) = a - b
        @[simp]
        theorem abs_zsmul_eq_zero {G : Type u_1} [AddGroup G] (a : G) (n : ) :
        |n| a = 0 n a = 0
        @[simp]
        theorem zpow_abs_eq_one {G : Type u_1} [Group G] (a : G) (n : ) :
        a ^ |n| = 1 a ^ n = 1