Intervals in ℕ #
This file defines intervals of naturals. List.Ico m n
is the list of integers greater than m
and strictly less than n
.
TODO #
- Define
Ioo
andIcc
, state basic lemmas about them. - Also do the versions for integers?
- One could generalise even further, defining 'locally finite partial orders', for which
Set.Ico a b
is[Finite]
, and 'locally finite total orders', for which there is a list model. - Once the above is done, get rid of
Data.Int.range
(and maybeList.range'
?).
Ico n m
is the list of natural numbers n ≤ x < m
.
(Ico stands for "interval, closed-open".)
See also Data/Set/Intervals.lean
for Set.Ico
, modelling intervals in general preorders, and
Multiset.Ico
and Finset.Ico
for n ≤ x < m
as a multiset or as a finset.
Equations
- List.Ico n m = List.range' n (m - n)
Instances For
theorem
List.Ico.pairwise_lt
(n : ℕ)
(m : ℕ)
:
List.Pairwise (fun (x x_1 : ℕ) => x < x_1) (List.Ico n m)
@[simp]
theorem
List.Ico.bagInter_consecutive
(n : ℕ)
(m : ℕ)
(l : ℕ)
:
List.bagInter (List.Ico n m) (List.Ico m l) = []
theorem
List.Ico.chain'_succ
(n : ℕ)
(m : ℕ)
:
List.Chain' (fun (a b : ℕ) => b = Nat.succ a) (List.Ico n m)