mathlib documentation

data.int.interval

Finite intervals of integers #

This file proves that ℤ is a locally_finite_order and calculates the cardinality of its intervals as finsets and fintypes.

@[protected, instance]
Equations
@[simp]
theorem int.card_Icc (a b : ℤ) :
(finset.Icc a b).card = (b + 1 - a).to_nat
@[simp]
theorem int.card_Ico (a b : ℤ) :
(finset.Ico a b).card = (b - a).to_nat
@[simp]
theorem int.card_Ioc (a b : ℤ) :
(finset.Ioc a b).card = (b - a).to_nat
@[simp]
theorem int.card_Ioo (a b : ℤ) :
(finset.Ioo a b).card = (b - a - 1).to_nat
theorem int.card_Icc_of_le (a b : ℤ) (h : a ≤ b + 1) :
↑((finset.Icc a b).card) = b + 1 - a
theorem int.card_Ico_of_le (a b : ℤ) (h : a ≤ b) :
↑((finset.Ico a b).card) = b - a
theorem int.card_Ioc_of_le (a b : ℤ) (h : a ≤ b) :
↑((finset.Ioc a b).card) = b - a
theorem int.card_Ioo_of_lt (a b : ℤ) (h : a < b) :
↑((finset.Ioo a b).card) = b - a - 1
@[simp]
theorem int.card_fintype_Icc (a b : ℤ) :
@[simp]
theorem int.card_fintype_Ico (a b : ℤ) :
@[simp]
theorem int.card_fintype_Ioc (a b : ℤ) :
@[simp]
theorem int.card_fintype_Ioo (a b : ℤ) :
theorem int.card_fintype_Icc_of_le (a b : ℤ) (h : a ≤ b + 1) :
theorem int.card_fintype_Ico_of_le (a b : ℤ) (h : a ≤ b) :
theorem int.card_fintype_Ioc_of_le (a b : ℤ) (h : a ≤ b) :
theorem int.card_fintype_Ioo_of_lt (a b : ℤ) (h : a < b) :
theorem int.image_Ico_mod (n a : ℤ) (h : 0 ≤ a) :
finset.image (λ (_x : ℤ), _x % a) (finset.Ico n (n + a)) = finset.Ico 0 a