The integers, with addition, multiplication, and subtraction. #
the type, coercions, and notation
Instances for int
- algebra_int
- rat_module.no_zero_smul_divisors
- no_zero_smul_divisors.char_zero.no_zero_smul_divisors_int
- int.cast_coe
- int.has_sizeof_inst
- int.has_coe
- int.has_repr
- int.has_to_string
- int.has_zero
- int.has_one
- int.has_neg
- int.has_add
- int.has_mul
- int.has_sub
- int.has_div
- int.has_mod
- int.has_le
- int.has_lt
- int.linear_order
- native.float.of_int_coe
- json.int_coe
- has_le.le.can_lift
- div_inv_monoid.has_pow
- sub_neg_monoid.has_smul_int
- int.inhabited
- int.nontrivial
- int.comm_ring
- int.add_comm_monoid
- int.add_monoid
- int.monoid
- int.comm_monoid
- int.comm_semigroup
- int.semigroup
- int.add_comm_group
- int.add_group
- int.add_comm_semigroup
- int.add_semigroup
- int.comm_semiring
- int.semiring
- int.ring
- int.distrib
- int.has_to_format
- int.reflect
- add_group.int_smul_comm_class
- add_group.int_smul_comm_class'
- add_group.int_smul_with_zero
- with_zero.int.has_pow
- int.linear_ordered_comm_ring
- int.ordered_comm_ring
- int.ordered_ring
- int.linear_ordered_add_comm_group
- non_unital_non_assoc_ring.int_smul_comm_class
- non_unital_non_assoc_ring.int_is_scalar_tower
- int.can_lift_pnat
- rat.can_lift
- add_comm_group.int_module
- add_comm_group.int_is_scalar_tower
- linear_map.compatible_smul.int_module
- int.infinite
- int.countable
- int.encodable
- add_subgroup_class.has_zsmul
- subgroup_class.has_zpow
- add_subgroup.has_zsmul
- subgroup.has_zpow
- dfinsupp.has_int_scalar
- finsupp.has_int_scalar
- add_con.quotient.has_zsmul
- con.has_zpow
- denumerable.int
- tensor_product.compatible_smul.int
- ring_con.has_zsmul
- self_adjoint.int.has_pow
- int.euclidean_domain
- int.locally_finite_order
- module.finite.add_monoid_hom
- module.free.add_monoid_hom
- int.modeq.is_refl
- int.normalization_monoid
- int.gcd_monoid
- int.normalized_gcd_monoid
- int.topological_space
- int.discrete_topology
- int.noncompact_space
- int.floor_ring
- int.archimedean
- int.uniform_space
- add_group.has_continuous_const_smul_int
- add_group.has_continuous_smul_int
- subfield.int.has_pow
- nonneg.has_zpow
- int.ordered_smul
- add_group.has_uniform_continuous_const_smul_int
- int.has_dist
- int.metric_space
- int.proper_space
- int.normed_add_comm_group
- normed_add_group_hom.has_int_scalar
- int.normed_comm_ring
- int.norm_one_class
- category_theory.equivalence.int.has_pow
- category_theory.linear.preadditive_int_linear
- int.has_variable_names
- int.non_null_json_serializable
@[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}
definitions of basic functions
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].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)
these are only for internal use
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)
some basic functions and properties
neg
basic properties of sub_nat_nat
nat_abs
sign
Quotient and remainder
gcd
addition
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)
negation
multiplication
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)