mathlib documentation

core.​init.​data.​int.​basic

core.​init.​data.​int.​basic

inductive int  :
Type

@[instance]

Equations
def int.​repr  :

Equations
@[instance]

Equations
theorem int.​coe_nat_eq (n : ℕ) :

def int.​zero  :

Equations
def int.​one  :

Equations
@[instance]

Equations
@[instance]

Equations
def int.​sub_nat_nat  :
ℕ → ℕ → ℤ

Equations
def int.​neg  :
ℤ → ℤ

Equations
@[instance]

Equations
@[instance]

Equations
@[instance]

Equations
def int.​sub  :
ℤ → ℤ → ℤ

Equations
@[instance]

Equations
theorem int.​neg_zero  :
-0 = 0

@[simp]
theorem int.​of_nat_eq_coe (n : ℕ) :

theorem int.​neg_succ_of_nat_coe (n : ℕ) :
-[1+ n] = -↑(n + 1)

@[simp]
theorem int.​coe_nat_add (m n : ℕ) :
↑(m + n) = ↑m + ↑n

@[simp]
theorem int.​coe_nat_mul (m n : ℕ) :
↑(m * n) = ↑m * ↑n

@[simp]
theorem int.​coe_nat_zero  :
↑0 = 0

@[simp]
theorem int.​coe_nat_one  :
↑1 = 1

@[simp]
theorem int.​coe_nat_succ (n : ℕ) :
↑(n.succ) = ↑n + 1

theorem int.​coe_nat_add_out (m n : ℕ) :
↑m + ↑n = ↑m + ↑n

theorem int.​coe_nat_mul_out (m n : ℕ) :
↑m * ↑n = ↑(m * n)

theorem int.​coe_nat_add_one_out (n : ℕ) :
↑n + 1 = ↑(n.succ)

theorem int.​coe_nat_inj {m n : ℕ} :
↑m = ↑n → m = n

theorem int.​coe_nat_eq_coe_nat_iff (m n : ℕ) :
↑m = ↑n ↔ m = n

theorem int.​neg_succ_of_nat_inj_iff {m n : ℕ} :
-[1+ m] = -[1+ n] ↔ m = n

theorem int.​neg_succ_of_nat_eq (n : ℕ) :
-[1+ n] = -(↑n + 1)

theorem int.​neg_neg (a : ℤ) :
--a = a

theorem int.​neg_inj {a b : ℤ} :
-a = -b → a = b

theorem int.​sub_eq_add_neg {a b : ℤ} :
a - b = a + -b

theorem int.​sub_nat_nat_elim (m n : ℕ) (P : ℕ → ℕ → ℤ → Prop) :
(∀ (i n : ℕ), P (n + i) n (int.of_nat i)) → (∀ (i m : ℕ), P m (m + i + 1) -[1+ i]) → P m n (int.sub_nat_nat m n)

@[simp]
def int.​nat_abs  :
ℤ → ℕ

Equations
@[simp]
theorem int.​nat_abs_of_nat (n : ℕ) :

theorem int.​eq_zero_of_nat_abs_eq_zero {a : ℤ} :
a.nat_abs = 0 → a = 0

theorem int.​nat_abs_pos_of_ne_zero {a : ℤ} :
a ≠ 0 → a.nat_abs > 0

@[simp]
theorem int.​nat_abs_zero  :

@[simp]
theorem int.​nat_abs_one  :

theorem int.​nat_abs_mul_self {a : ℤ} :
↑(a.nat_abs * a.nat_abs) = a * a

@[simp]
theorem int.​nat_abs_neg (a : ℤ) :

theorem int.​nat_abs_eq (a : ℤ) :

theorem int.​eq_coe_or_neg (a : ℤ) :
∃ (n : ℕ), a = ↑n ∨ a = -↑n

def int.​sign  :
ℤ → ℤ

Equations
@[simp]
theorem int.​sign_zero  :
0.sign = 0

@[simp]
theorem int.​sign_one  :
1.sign = 1

@[simp]
theorem int.​sign_neg_one  :
(-1).sign = -1

def int.​div  :
ℤ → ℤ → ℤ

Equations
def int.​mod  :
ℤ → ℤ → ℤ

Equations
def int.​fdiv  :
ℤ → ℤ → ℤ

Equations
def int.​fmod  :
ℤ → ℤ → ℤ

Equations
@[instance]

Equations
@[instance]

Equations
def int.​gcd  :
ℤ → ℤ → ℕ

Equations
theorem int.​add_comm (a b : ℤ) :
a + b = b + a

theorem int.​add_zero (a : ℤ) :
a + 0 = a

theorem int.​zero_add (a : ℤ) :
0 + a = a

theorem int.​add_assoc (a b c : ℤ) :
a + b + c = a + (b + c)

theorem int.​add_left_neg (a : ℤ) :
-a + a = 0

theorem int.​add_right_neg (a : ℤ) :
a + -a = 0

theorem int.​mul_comm (a b : ℤ) :
a * b = b * a

theorem int.​mul_assoc (a b c : ℤ) :
a * b * c = a * (b * c)

theorem int.​mul_zero (a : ℤ) :
a * 0 = 0

theorem int.​zero_mul (a : ℤ) :
0 * a = 0

theorem int.​distrib_left (a b c : ℤ) :
a * (b + c) = a * b + a * c

theorem int.​distrib_right (a b c : ℤ) :
(a + b) * c = a * c + b * c

theorem int.​zero_ne_one  :
0 ≠ 1

theorem int.​of_nat_sub {n m : ℕ} :
m ≤ n → int.of_nat (n - m) = int.of_nat n - int.of_nat m

theorem int.​add_left_comm (a b c : ℤ) :
a + (b + c) = b + (a + c)

theorem int.​add_left_cancel {a b c : ℤ} :
a + b = a + c → b = c

theorem int.​neg_add {a b : ℤ} :
-(a + b) = -a + -b

theorem int.​coe_nat_sub {n m : ℕ} :
n ≤ m → ↑(m - n) = ↑m - ↑n

def int.​to_nat  :
ℤ → ℕ

Equations
theorem int.​to_nat_sub (m n : ℕ) :
(↑m - ↑n).to_nat = m - n

def int.​nat_mod  :
ℤ → ℤ → ℕ

Equations
theorem int.​one_mul (a : ℤ) :
1 * a = a

theorem int.​mul_one (a : ℤ) :
a * 1 = a

theorem int.​neg_eq_neg_one_mul (a : ℤ) :
-a = (-1) * a

theorem int.​sign_mul_nat_abs (a : ℤ) :
a.sign * ↑(a.nat_abs) = a