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 (min a b))) (Finset.range (max a b + 1 - min a b).toNat)
theorem
Int.card_fintype_Ico_of_le
(a : ℤ)
(b : ℤ)
(h : a ≤ b)
:
↑(Fintype.card ↑(Set.Ico a b)) = b - a
theorem
Int.card_fintype_Ioc_of_le
(a : ℤ)
(b : ℤ)
(h : a ≤ b)
:
↑(Fintype.card ↑(Set.Ioc a b)) = b - 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