Documentation

Mathlib.Data.PNat.Interval

Finite intervals of positive naturals #

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

theorem PNat.Icc_eq_finset_subtype (a b : ℕ+) :
Finset.Icc a b = Finset.subtype (fun (n : ℕ) => 0 < n) (Finset.Icc ↑a ↑b)
theorem PNat.Ico_eq_finset_subtype (a b : ℕ+) :
Finset.Ico a b = Finset.subtype (fun (n : ℕ) => 0 < n) (Finset.Ico ↑a ↑b)
theorem PNat.Ioc_eq_finset_subtype (a b : ℕ+) :
Finset.Ioc a b = Finset.subtype (fun (n : ℕ) => 0 < n) (Finset.Ioc ↑a ↑b)
theorem PNat.Ioo_eq_finset_subtype (a b : ℕ+) :
Finset.Ioo a b = Finset.subtype (fun (n : ℕ) => 0 < n) (Finset.Ioo ↑a ↑b)
theorem PNat.uIcc_eq_finset_subtype (a b : ℕ+) :
Finset.uIcc a b = Finset.subtype (fun (n : ℕ) => 0 < n) (Finset.uIcc ↑a ↑b)
@[simp]
theorem PNat.card_Icc (a b : ℕ+) :
(Finset.Icc a b).card = ↑b + 1 - ↑a
@[simp]
theorem PNat.card_Ico (a b : ℕ+) :
(Finset.Ico a b).card = ↑b - ↑a
@[simp]
theorem PNat.card_Ioc (a b : ℕ+) :
(Finset.Ioc a b).card = ↑b - ↑a
@[simp]
theorem PNat.card_Ioo (a b : ℕ+) :
(Finset.Ioo a b).card = ↑b - ↑a - 1
@[simp]
theorem PNat.card_uIcc (a b : ℕ+) :
(Finset.uIcc a b).card = (↑↑b - ↑↑a).natAbs + 1
theorem PNat.card_fintype_Icc (a b : ℕ+) :
Fintype.card ↑(Set.Icc a b) = ↑b + 1 - ↑a
theorem PNat.card_fintype_Ico (a b : ℕ+) :
Fintype.card ↑(Set.Ico a b) = ↑b - ↑a
theorem PNat.card_fintype_Ioc (a b : ℕ+) :
Fintype.card ↑(Set.Ioc a b) = ↑b - ↑a
theorem PNat.card_fintype_Ioo (a b : ℕ+) :
Fintype.card ↑(Set.Ioo a b) = ↑b - ↑a - 1
theorem PNat.card_fintype_uIcc (a b : ℕ+) :
Fintype.card ↑(Set.uIcc a b) = (↑↑b - ↑↑a).natAbs + 1