Finite intervals of integers #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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)
theorem
int.uIcc_eq_finset_map
(a b : ℤ) :
finset.uIcc a b = finset.map (nat.cast_embedding.trans (add_left_embedding (linear_order.min a b))) (finset.range (linear_order.max a b + 1 - linear_order.min a b).to_nat)
@[simp]
@[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