Documentation

Mathlib.Algebra.Order.Ring.Int

The integers form a linear ordered ring #

This file contains:

Recursors #

Extra instances to short-circuit type class resolution #

These also prevent non-computable instances being used to construct these instances non-computably.

Equations
Equations

Miscellaneous lemmas #

theorem Nat.cast_natAbs {α : Type u_1} [AddGroupWithOne α] (n : ) :
(Int.natAbs n) = |n|
theorem Int.cast_mul_eq_zsmul_cast {α : Type u_1} [AddCommGroupWithOne α] (m : ) (n : ) :
(m * n) = m n

Note this holds in marginally more generality than Int.cast_mul

properties of / and % #

theorem Int.emod_two_eq_zero_or_one (n : ) :
n % 2 = 0 n % 2 = 1

dvd #

theorem Int.exists_lt_and_lt_iff_not_dvd (m : ) {n : } (hn : 0 < n) :
(∃ (k : ), n * k < m m < n * (k + 1)) ¬n m

If n > 0 then m is not divisible by n iff it is between n * k and n * (k + 1) for some k.

theorem bit0_mul {R : Type u_1} [NonUnitalNonAssocRing R] (n : R) (r : R) :
bit0 n * r = 2 (n * r)
theorem mul_bit0 {R : Type u_1} [NonUnitalNonAssocRing R] (n : R) (r : R) :
r * bit0 n = 2 (r * n)
theorem bit1_mul {R : Type u_1} [NonAssocRing R] (n : R) (r : R) :
bit1 n * r = 2 (n * r) + r
theorem mul_bit1 {R : Type u_1} [NonAssocRing R] {n : R} {r : R} :
r * bit1 n = 2 (r * n) + r