Lemmas about List.Subset
, List.Sublist
, List.IsPrefix
, List.IsSuffix
, and List.IsInfix
. #
isPrefixOf #
isSuffixOf #
Subset #
List subset #
instance
List.instTransSubsetMem
{α : Type u_1}
:
Trans (fun (l₁ l₂ : List α) => l₂ ⊆ l₁) Membership.mem Membership.mem
Equations
- List.instTransSubsetMem = { trans := ⋯ }
Equations
- List.instTransSubset = { trans := ⋯ }
Sublist and isSublist #
theorem
List.Sublist.trans
{α : Type u_1}
{l₁ l₂ l₃ : List α}
(h₁ : l₁.Sublist l₂)
(h₂ : l₂.Sublist l₃)
:
l₁.Sublist l₃
Equations
- List.instTransSublist = { trans := ⋯ }
theorem
List.sublist_of_cons_sublist
{α✝ : Type u_1}
{a : α✝}
{l₁ l₂ : List α✝}
:
(a :: l₁).Sublist l₂ → l₁.Sublist l₂
Equations
- List.instTransSublistSubset = { trans := ⋯ }
Equations
- List.instTransSubsetSublist = { trans := ⋯ }
instance
List.instTransSublistMem
{α : Type u_1}
:
Trans (fun (l₁ l₂ : List α) => l₂.Sublist l₁) Membership.mem Membership.mem
Equations
- List.instTransSublistMem = { trans := ⋯ }
theorem
List.Sublist.length_le
{α✝ : Type u_1}
{l₁ l₂ : List α✝}
:
l₁.Sublist l₂ → l₁.length ≤ l₂.length
@[simp]
theorem
List.sublist_append_of_sublist_left
{α✝ : Type u_1}
{l l₁ l₂ : List α✝}
(s : l.Sublist l₁)
:
l.Sublist (l₁ ++ l₂)
@[simp]
theorem
List.sublist_append_of_sublist_right
{α✝ : Type u_1}
{l l₂ l₁ : List α✝}
(s : l.Sublist l₂)
:
l.Sublist (l₁ ++ l₂)
theorem
List.Sublist.reverse
{α✝ : Type u_1}
{l₁ l₂ : List α✝}
:
l₁.Sublist l₂ → l₁.reverse.Sublist l₂.reverse
@[simp]
theorem
List.reverse_sublist
{α✝ : Type u_1}
{l₁ l₂ : List α✝}
:
l₁.reverse.Sublist l₂.reverse ↔ l₁.Sublist l₂
theorem
List.sublist_reverse_iff
{α✝ : Type u_1}
{l₁ l₂ : List α✝}
:
l₁.Sublist l₂.reverse ↔ l₁.reverse.Sublist l₂
instance
List.instDecidableSublistOfDecidableEq
{α : Type u_1}
[DecidableEq α]
(l₁ l₂ : List α)
:
Decidable (l₁.Sublist l₂)
Equations
- l₁.instDecidableSublistOfDecidableEq l₂ = decidable_of_iff (l₁.isSublist l₂ = true) ⋯
IsPrefix / IsSuffix / IsInfix #
theorem
List.IsPrefix.filter
{α : Type u_1}
(p : α → Bool)
⦃l₁ l₂ : List α⦄
(h : l₁ <+: l₂)
:
List.filter p l₁ <+: List.filter p l₂
theorem
List.IsSuffix.filter
{α : Type u_1}
(p : α → Bool)
⦃l₁ l₂ : List α⦄
(h : l₁ <:+ l₂)
:
List.filter p l₁ <:+ List.filter p l₂
theorem
List.IsInfix.filter
{α : Type u_1}
(p : α → Bool)
⦃l₁ l₂ : List α⦄
(h : l₁ <:+: l₂)
:
List.filter p l₁ <:+: List.filter p l₂
theorem
List.IsPrefix.filterMap
{α : Type u_1}
{β : Type u_2}
(f : α → Option β)
⦃l₁ l₂ : List α⦄
(h : l₁ <+: l₂)
:
List.filterMap f l₁ <+: List.filterMap f l₂
theorem
List.IsSuffix.filterMap
{α : Type u_1}
{β : Type u_2}
(f : α → Option β)
⦃l₁ l₂ : List α⦄
(h : l₁ <:+ l₂)
:
List.filterMap f l₁ <:+ List.filterMap f l₂
theorem
List.IsInfix.filterMap
{α : Type u_1}
{β : Type u_2}
(f : α → Option β)
⦃l₁ l₂ : List α⦄
(h : l₁ <:+: l₂)
:
List.filterMap f l₁ <:+: List.filterMap f l₂
Equations
- l₁.instDecidableIsPrefixOfDecidableEq l₂ = decidable_of_iff (l₁.isPrefixOf l₂ = true) ⋯
Equations
- l₁.instDecidableIsSuffixOfDecidableEq l₂ = decidable_of_iff (l₁.isSuffixOf l₂ = true) ⋯
Deprecations #
@[reducible, inline, deprecated List.sublist_flatten_iff (since := "2024-10-14")]
Instances For
@[reducible, inline, deprecated List.flatten_sublist_iff (since := "2024-10-14")]
Instances For
@[reducible, inline, deprecated List.infix_of_mem_flatten (since := "2024-10-14")]