mathlib documentation

data.nat.interval

Finite intervals of naturals #

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

TODO #

Some lemmas can be generalized using ordered_group, canonically_ordered_monoid or succ_order and subsequently be moved upstream to data.finset.locally_finite.

@[protected, instance]
Equations
theorem nat.Icc_eq_range' (a b : ) :
theorem nat.Ico_eq_range' (a b : ) :
theorem nat.Ioc_eq_range' (a b : ) :
finset.Ioc a b = (list.range' (a + 1) (b - a)).to_finset
theorem nat.Ioo_eq_range' (a b : ) :
finset.Ioo a b = (list.range' (a + 1) (b - a - 1)).to_finset
@[simp]
theorem nat.card_Icc (a b : ) :
(finset.Icc a b).card = b + 1 - a
@[simp]
theorem nat.card_Ico (a b : ) :
(finset.Ico a b).card = b - a
@[simp]
theorem nat.card_Ioc (a b : ) :
(finset.Ioc a b).card = b - a
@[simp]
theorem nat.card_Ioo (a b : ) :
(finset.Ioo a b).card = b - a - 1
@[simp]
theorem nat.card_Iic (b : ) :
(finset.Iic b).card = b + 1
@[simp]
theorem nat.card_Iio (b : ) :
@[simp]
theorem nat.card_fintype_Icc (a b : ) :
@[simp]
theorem nat.card_fintype_Ico (a b : ) :
@[simp]
theorem nat.card_fintype_Ioc (a b : ) :
@[simp]
theorem nat.card_fintype_Ioo (a b : ) :
@[simp]
theorem nat.card_fintype_Iic (b : ) :
@[simp]
theorem nat.Icc_succ_left (a b : ) :
theorem nat.Ico_succ_right (a b : ) :
theorem nat.Ico_succ_left (a b : ) :
theorem nat.Icc_pred_right (a : ) {b : } (h : 0 < b) :
finset.Icc a (b - 1) = finset.Ico a b
@[simp]
theorem nat.Ico_succ_singleton (a : ) :
finset.Ico a (a + 1) = {a}
@[simp]
theorem nat.Ico_pred_singleton {a : } (h : 0 < a) :
finset.Ico (a - 1) a = {a - 1}
theorem nat.Ico_succ_right_eq_insert_Ico {a b : } (h : a b) :
finset.Ico a (b + 1) = insert b (finset.Ico a b)
theorem nat.Ico_insert_succ_left {a b : } (h : a < b) :
theorem nat.image_sub_const_Ico {a b c : } (h : c a) :
finset.image (λ (x : ), x - c) (finset.Ico a b) = finset.Ico (a - c) (b - c)
theorem nat.Ico_image_const_sub_eq_Ico {a b c : } (hac : a c) :
finset.image (λ (x : ), c - x) (finset.Ico a b) = finset.Ico (c + 1 - b) (c + 1 - a)