Prefixes, suffixes, infixes #
This file proves properties about
- List.isPrefix:- l₁is a prefix of- l₂if- l₂starts with- l₁.
- List.isSuffix:- l₁is a suffix of- l₂if- l₂ends with- l₁.
- List.isInfix:- l₁is an infix of- l₂if- l₁is a prefix of some suffix of- l₂.
- List.inits: The list of prefixes of a list.
- List.tails: The list of prefixes of a list.
- inserton lists
All those (except insert) are defined in Mathlib/Data/List/Defs.lean.
Notation #
- l₁ <+: l₂:- l₁is a prefix of- l₂.
- l₁ <:+ l₂:- l₁is a suffix of- l₂.
- l₁ <:+: l₂:- l₁is an infix of- l₂.
prefix, suffix, infix #
Equations
- [].decidableInfix x✝ = isTrue ⋯
- (a :: l₁).decidableInfix [] = isFalse ⋯
- x✝.decidableInfix (b :: l₂) = decidable_of_decidable_of_iff ⋯
instance
List.instIsPartialOrderIsPrefix
{α : Type u_1}
 :
IsPartialOrder (List α) fun (x1 x2 : List α) => x1 <+: x2
instance
List.instIsPartialOrderIsSuffix
{α : Type u_1}
 :
IsPartialOrder (List α) fun (x1 x2 : List α) => x1 <:+ x2
instance
List.instIsPartialOrderIsInfix
{α : Type u_1}
 :
IsPartialOrder (List α) fun (x1 x2 : List α) => x1 <:+: x2
insert #
@[simp]
theorem
List.sublist_insert
{α : Type u_1}
[DecidableEq α]
(a : α)
(l : List α)
 :
l.Sublist (List.insert a l)