Lemmas about List.Subset
, List.Sublist
, List.IsPrefix
, List.IsSuffix
, and List.IsInfix
. #
isPrefixOf #
isSuffixOf #
Subset #
List subset #
Equations
- List.instTransMemSubset = { trans := ⋯ }
Equations
- List.instTransSubset = { trans := ⋯ }
theorem
List.filter_subset
{α : Type u_1}
{l₁ : List α}
{l₂ : List α}
(p : α → Bool)
(H : l₁ ⊆ l₂)
:
List.filter p l₁ ⊆ List.filter p l₂
theorem
List.filterMap_subset
{α : Type u_1}
{β : Type u_2}
{l₁ : List α}
{l₂ : List α}
(f : α → Option β)
(H : l₁ ⊆ l₂)
:
List.filterMap f l₁ ⊆ List.filterMap f l₂
Sublist and isSublist #
Equations
- List.instTransSublist = { trans := ⋯ }
@[simp]
Equations
- List.instTransSublistSubset = { trans := ⋯ }
Equations
- List.instTransSubsetSublist = { trans := ⋯ }
Equations
- List.instTransMemSublist = { trans := ⋯ }
theorem
List.Sublist.filterMap
{α : Type u_1}
{β : Type u_2}
{l₁ : List α}
{l₂ : List α}
(f : α → Option β)
(s : l₁.Sublist l₂)
:
(List.filterMap f l₁).Sublist (List.filterMap f l₂)
theorem
List.Sublist.filter
{α : Type u_1}
(p : α → Bool)
{l₁ : List α}
{l₂ : List α}
(s : l₁.Sublist l₂)
:
(List.filter p l₁).Sublist (List.filter p l₂)
theorem
List.sublist_filterMap_iff
{β : Type u_1}
{α : Type u_2}
{l₂ : List α}
{l₁ : List β}
{f : α → Option β}
:
l₁.Sublist (List.filterMap f l₂) ↔ ∃ (l' : List α), l'.Sublist l₂ ∧ l₁ = List.filterMap f l'
theorem
List.sublist_filter_iff
{α : Type u_1}
{l₂ : List α}
{l₁ : List α}
{p : α → Bool}
:
l₁.Sublist (List.filter p l₂) ↔ ∃ (l' : List α), l'.Sublist l₂ ∧ l₁ = List.filter p l'
@[simp]
@[simp]
theorem
List.replicate_sublist_replicate
{α : Type u_1}
{m : Nat}
{n : Nat}
(a : α)
:
(List.replicate m a).Sublist (List.replicate n a) ↔ m ≤ n
theorem
List.sublist_replicate_iff :
∀ {α : Type u_1} {l : List α} {m : Nat} {a : α},
l.Sublist (List.replicate m a) ↔ ∃ (n : Nat), n ≤ m ∧ l = List.replicate n a
instance
List.instDecidableSublistOfDecidableEq
{α : Type u_1}
[DecidableEq α]
(l₁ : List α)
(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₁ : List α⦄
⦃l₂ : List α⦄
(h : l₁ <+: l₂)
:
List.filter p l₁ <+: List.filter p l₂
theorem
List.IsSuffix.filter
{α : Type u_1}
(p : α → Bool)
⦃l₁ : List α⦄
⦃l₂ : List α⦄
(h : l₁ <:+ l₂)
:
List.filter p l₁ <:+ List.filter p l₂
theorem
List.IsInfix.filter
{α : Type u_1}
(p : α → Bool)
⦃l₁ : List α⦄
⦃l₂ : List α⦄
(h : l₁ <:+: l₂)
:
List.filter p l₁ <:+: List.filter p l₂
instance
List.instDecidableIsPrefixOfDecidableEq
{α : Type u_1}
[DecidableEq α]
(l₁ : List α)
(l₂ : List α)
:
Equations
- l₁.instDecidableIsPrefixOfDecidableEq l₂ = decidable_of_iff (l₁.isPrefixOf l₂ = true) ⋯
instance
List.instDecidableIsSuffixOfDecidableEq
{α : Type u_1}
[DecidableEq α]
(l₁ : List α)
(l₂ : List α)
:
Equations
- l₁.instDecidableIsSuffixOfDecidableEq l₂ = decidable_of_iff (l₁.isSuffixOf l₂ = true) ⋯