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
- int.locally_finite_order = {finset_Icc := λ (a b : ℤ), finset.map (nat.cast_embedding.trans (add_left_embedding a)) (finset.range (b + 1 - a).to_nat), finset_Ico := λ (a b : ℤ), finset.map (nat.cast_embedding.trans (add_left_embedding a)) (finset.range (b - a).to_nat), finset_Ioc := λ (a b : ℤ), finset.map (nat.cast_embedding.trans (add_left_embedding (a + 1))) (finset.range (b - a).to_nat), finset_Ioo := λ (a b : ℤ), finset.map (nat.cast_embedding.trans (add_left_embedding (a + 1))) (finset.range (b - a - 1).to_nat), finset_mem_Icc := int.locally_finite_order._proof_2, finset_mem_Ico := int.locally_finite_order._proof_3, finset_mem_Ioc := int.locally_finite_order._proof_4, finset_mem_Ioo := int.locally_finite_order._proof_5}
theorem
int.Icc_eq_finset_map
(a b : ℤ) :
finset.Icc a b = finset.map (nat.cast_embedding.trans (add_left_embedding a)) (finset.range (b + 1 - a).to_nat)
theorem
int.Ico_eq_finset_map
(a b : ℤ) :
finset.Ico a b = finset.map (nat.cast_embedding.trans (add_left_embedding a)) (finset.range (b - a).to_nat)
theorem
int.Ioc_eq_finset_map
(a b : ℤ) :
finset.Ioc a b = finset.map (nat.cast_embedding.trans (add_left_embedding (a + 1))) (finset.range (b - a).to_nat)
theorem
int.Ioo_eq_finset_map
(a b : ℤ) :
finset.Ioo a b = finset.map (nat.cast_embedding.trans (add_left_embedding (a + 1))) (finset.range (b - a - 1).to_nat)
@[simp]
@[simp]
@[simp]
@[simp]
theorem
int.image_Ico_mod
(n a : ℤ)
(h : 0 ≤ a) :
finset.image (λ (_x : ℤ), _x % a) (finset.Ico n (n + a)) = finset.Ico 0 a