Intervals in ℕ as multisets #
For now this only covers Ico n m
, the "closed-open" interval containing [n, ..., m-1]
.
Ico #
Ico n m
is the multiset lifted from the list Ico n m
, e.g. the set {n, n+1, ..., m-1}
.
Equations
- multiset.Ico n m = ↑(list.Ico n m)
theorem
multiset.Ico.map_add
(n m k : ℕ) :
multiset.map (has_add.add k) (multiset.Ico n m) = multiset.Ico (n + k) (m + k)
theorem
multiset.Ico.map_sub
(n m k : ℕ)
(h : k ≤ n) :
multiset.map (λ (x : ℕ), x - k) (multiset.Ico n m) = multiset.Ico (n - k) (m - k)
theorem
multiset.Ico.add_consecutive
{n m l : ℕ}
(hnm : n ≤ m)
(hml : m ≤ l) :
multiset.Ico n m + multiset.Ico m l = multiset.Ico n l
@[simp]
theorem
multiset.Ico.succ_top
{n m : ℕ}
(h : n ≤ m) :
multiset.Ico n (m + 1) = m ::ₘ multiset.Ico n m
theorem
multiset.Ico.eq_cons
{n m : ℕ}
(h : n < m) :
multiset.Ico n m = n ::ₘ multiset.Ico (n + 1) m
@[simp]
theorem
multiset.Ico.filter_lt_of_top_le
{n m l : ℕ}
(hml : m ≤ l) :
multiset.filter (λ (x : ℕ), x < l) (multiset.Ico n m) = multiset.Ico n m
theorem
multiset.Ico.filter_lt_of_le_bot
{n m l : ℕ}
(hln : l ≤ n) :
multiset.filter (λ (x : ℕ), x < l) (multiset.Ico n m) = ∅
theorem
multiset.Ico.filter_le_of_bot
{n m : ℕ}
(hnm : n < m) :
multiset.filter (λ (x : ℕ), x ≤ n) (multiset.Ico n m) = {n}
theorem
multiset.Ico.filter_lt_of_ge
{n m l : ℕ}
(hlm : l ≤ m) :
multiset.filter (λ (x : ℕ), x < l) (multiset.Ico n m) = multiset.Ico n l
@[simp]
theorem
multiset.Ico.filter_lt
(n m l : ℕ) :
multiset.filter (λ (x : ℕ), x < l) (multiset.Ico n m) = multiset.Ico n (min m l)
theorem
multiset.Ico.filter_le_of_le_bot
{n m l : ℕ}
(hln : l ≤ n) :
multiset.filter (λ (x : ℕ), l ≤ x) (multiset.Ico n m) = multiset.Ico n m
theorem
multiset.Ico.filter_le_of_top_le
{n m l : ℕ}
(hml : m ≤ l) :
multiset.filter (λ (x : ℕ), l ≤ x) (multiset.Ico n m) = ∅
theorem
multiset.Ico.filter_le_of_le
{n m l : ℕ}
(hnl : n ≤ l) :
multiset.filter (λ (x : ℕ), l ≤ x) (multiset.Ico n m) = multiset.Ico l m
@[simp]
theorem
multiset.Ico.filter_le
(n m l : ℕ) :
multiset.filter (λ (x : ℕ), l ≤ x) (multiset.Ico n m) = multiset.Ico (max n l) m