@[protected, instance]
Equations
- int.has_coe = {coe := int.of_nat}
@[protected, instance]
Equations
- int.has_repr = {repr := int.repr}
@[protected, instance]
Equations
@[protected, instance]
Equations
- int.has_zero = {zero := int.zero}
Equations
- int.sub_nat_nat m n = int.sub_nat_nat._match_1 m n (n - m)
- int.sub_nat_nat._match_1 m n k.succ = -[1+ k]
- int.sub_nat_nat._match_1 m n 0 = int.of_nat (m - n)
theorem
int.sub_nat_nat_of_sub_eq_zero
{m n : ℕ}
(h : n - m = 0) :
int.sub_nat_nat m n = int.of_nat (m - n)
theorem
int.sub_nat_nat_of_sub_eq_succ
{m n k : ℕ}
(h : n - m = k.succ) :
int.sub_nat_nat m n = -[1+ k]
@[protected]
Equations
- -[1+ m].add -[1+ n] = -[1+ (m + n).succ]
- -[1+ m].add (int.of_nat n) = int.sub_nat_nat n m.succ
- (int.of_nat m).add -[1+ n] = int.sub_nat_nat m n.succ
- (int.of_nat m).add (int.of_nat n) = int.of_nat (m + n)
@[protected]
Equations
- -[1+ m].mul -[1+ n] = int.of_nat ((m.succ) * n.succ)
- -[1+ m].mul (int.of_nat n) = int.neg_of_nat ((m.succ) * n)
- (int.of_nat m).mul -[1+ n] = int.neg_of_nat (m * n.succ)
- (int.of_nat m).mul (int.of_nat n) = int.of_nat (m * n)
theorem
int.of_nat_add_neg_succ_of_nat
(m n : ℕ) :
int.of_nat m + -[1+ n] = int.sub_nat_nat m n.succ
theorem
int.neg_succ_of_nat_add_of_nat
(m n : ℕ) :
-[1+ m] + int.of_nat n = int.sub_nat_nat n m.succ
theorem
int.of_nat_mul_neg_succ_of_nat
(m n : ℕ) :
(int.of_nat m) * -[1+ n] = int.neg_of_nat (m * n.succ)
theorem
int.neg_succ_of_nat_of_nat
(m n : ℕ) :
-[1+ m] * int.of_nat n = int.neg_of_nat ((m.succ) * n)
theorem
int.sub_nat_nat_elim
(m n : ℕ)
(P : ℕ → ℕ → ℤ → Prop)
(hp : ∀ (i n : ℕ), P (n + i) n (int.of_nat i))
(hn : ∀ (i m : ℕ), P m (m + i + 1) -[1+ i]) :
P m n (int.sub_nat_nat m n)
Equations
- -[1+ m].quot -[1+ n] = int.of_nat (m.succ / n.succ)
- -[1+ m].quot (int.of_nat n) = -int.of_nat (m.succ / n)
- (int.of_nat m).quot -[1+ n] = -int.of_nat (m / n.succ)
- (int.of_nat m).quot (int.of_nat n) = int.of_nat (m / n)
Equations
- -[1+ m].rem -[1+ n] = -int.of_nat (m.succ % n.succ)
- -[1+ m].rem (int.of_nat n) = -int.of_nat (m.succ % n)
- (int.of_nat m).rem -[1+ n] = int.of_nat (m % n.succ)
- (int.of_nat m).rem (int.of_nat n) = int.of_nat (m % n)
theorem
int.sub_nat_nat_sub
{m n : ℕ}
(h : n ≤ m)
(k : ℕ) :
int.sub_nat_nat (m - n) k = int.sub_nat_nat m (k + n)
theorem
int.sub_nat_nat_add
(m n k : ℕ) :
int.sub_nat_nat (m + n) k = int.of_nat m + int.sub_nat_nat n k
theorem
int.sub_nat_nat_add_neg_succ_of_nat
(m n k : ℕ) :
int.sub_nat_nat m n + -[1+ k] = int.sub_nat_nat m (n + k.succ)
theorem
int.add_assoc_aux1
(m n : ℕ)
(c : ℤ) :
int.of_nat m + int.of_nat n + c = int.of_nat m + (int.of_nat n + c)
theorem
int.of_nat_mul_neg_of_nat
(m n : ℕ) :
(int.of_nat m) * int.neg_of_nat n = int.neg_of_nat (m * n)
theorem
int.neg_of_nat_mul_of_nat
(m n : ℕ) :
(int.neg_of_nat m) * int.of_nat n = int.neg_of_nat (m * n)
theorem
int.neg_succ_of_nat_mul_neg_of_nat
(m n : ℕ) :
-[1+ m] * int.neg_of_nat n = int.of_nat ((m.succ) * n)
theorem
int.neg_of_nat_mul_neg_succ_of_nat
(m n : ℕ) :
(int.neg_of_nat n) * -[1+ m] = int.of_nat (n * m.succ)
theorem
int.of_nat_mul_sub_nat_nat
(m n k : ℕ) :
(int.of_nat m) * int.sub_nat_nat n k = int.sub_nat_nat (m * n) (m * k)
theorem
int.neg_succ_of_nat_mul_sub_nat_nat
(m n k : ℕ) :
-[1+ m] * int.sub_nat_nat n k = int.sub_nat_nat ((m.succ) * k) ((m.succ) * n)