sublists #
List.Sublists gives a list of all (not necessarily contiguous) sublists of a list.
This file contains basic results on this function.
sublists #
sublistsLen #
Auxiliary function to construct the list of all sublists of a given length. Given an
integer n, a list l, a function f and an auxiliary list L, it returns the list made of
f applied to all sublists of l of length n, concatenated with L.
Instances For
@[simp]
@[simp]
theorem List.sublistsLen_sublist_sublists' {α : Type u} (n : ℕ) (l : List α) :
(sublistsLen n l).Sublist l.sublists'
theorem List.sublistsLen_sublist_of_sublist {α : Type u} (n : ℕ) {l₁ l₂ : List α} (h : l₁.Sublist l₂) :
(sublistsLen n l₁).Sublist (sublistsLen n l₂)
theorem List.length_of_sublistsLen {α : Type u} {n : ℕ} {l l' : List α} :
l' ∈ sublistsLen n l → l'.length = n
@[simp]
theorem List.Pairwise.sublists' {α : Type u} {R : α → α → Prop} {l : List α} :
Pairwise R l → Pairwise (Lex (Function.swap R)) l.sublists'
Alias of the reverse direction of List.nodup_sublists.
Alias of the forward direction of List.nodup_sublists.
Alias of the forward direction of List.nodup_sublists'.
theorem List.nodup_sublistsLen {α : Type u} (n : ℕ) {l : List α} (h : l.Nodup) :
(sublistsLen n l).Nodup