Documentation

Mathlib.Order.Interval.Set.Nat

Finite intervals of naturals #

This file calculates the cardinality of intervals of natural numbers as sets.

@[simp]
theorem Set.ncard_Icc_nat (a b : ) :
(Icc a b).ncard = b + 1 - a
@[simp]
theorem Set.ncard_Ico_nat (a b : ) :
(Ico a b).ncard = b - a
@[simp]
theorem Set.ncard_Ioc_nat (a b : ) :
(Ioc a b).ncard = b - a
@[simp]
theorem Set.ncard_Ioo_nat (a b : ) :
(Ioo a b).ncard = b - a - 1
@[simp]
theorem Set.ncard_uIcc_nat (a b : ) :
(uIcc a b).ncard = (b - a).natAbs + 1
@[simp]
theorem Set.ncard_Iic_nat (b : ) :
(Iic b).ncard = b + 1
@[simp]
theorem Set.ncard_Iio_nat (b : ) :
(Iio b).ncard = b