Finite intervals of integers #
This file proves that ℤ
is a LocallyFiniteOrder
and calculates the cardinality of its
intervals as finsets and fintypes.
Equations
- One or more equations did not get rendered due to their size.
theorem
Int.Icc_eq_finset_map
(a b : ℤ)
:
Finset.Icc a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding a)) (Finset.range (b + 1 - a).toNat)
theorem
Int.Ico_eq_finset_map
(a b : ℤ)
:
Finset.Ico a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding a)) (Finset.range (b - a).toNat)
theorem
Int.Ioc_eq_finset_map
(a b : ℤ)
:
Finset.Ioc a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding (a + 1))) (Finset.range (b - a).toNat)
theorem
Int.Ioo_eq_finset_map
(a b : ℤ)
:
Finset.Ioo a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding (a + 1))) (Finset.range (b - a - 1).toNat)
theorem
Int.uIcc_eq_finset_map
(a b : ℤ)
:
Finset.uIcc a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding (a ⊓ b))) (Finset.range (a ⊔ b + 1 - a ⊓ b).toNat)
theorem
Int.card_fintype_Icc_of_le
(a b : ℤ)
(h : a ≤ b + 1)
:
↑(Fintype.card ↑(Set.Icc a b)) = b + 1 - a
theorem
Int.card_fintype_Ioo_of_lt
(a b : ℤ)
(h : a < b)
:
↑(Fintype.card ↑(Set.Ioo a b)) = b - a - 1
theorem
Int.image_Ico_emod
(n a : ℤ)
(h : 0 ≤ a)
:
Finset.image (fun (x : ℤ) => x % a) (Finset.Ico n (n + a)) = Finset.Ico 0 a