Documentation
Mathlib
.
Init
.
Data
.
List
.
Instances
Search
Google site search
return to top
source
Imports
Init
Mathlib.Mathport.Rename
Std.Data.List.Lemmas
Imported by
List
.
bind_singleton
List
.
bind_singleton'
List
.
map_eq_bind
List
.
bind_assoc
List
.
instMonad
List
.
pure_def
List
.
instLawfulMonad
List
.
instAlternative
List
.
decidableBex
List
.
decidableBall
Decidable and Monad instances for
List
not (yet) in
Std
#
source
theorem
List
.
bind_singleton
{α :
Type
u}
{β :
Type
v}
(f :
α
→
List
β
)
(x :
α
)
:
List.bind
[
x
]
f
=
f
x
source
@[simp]
theorem
List
.
bind_singleton'
{α :
Type
u}
(l :
List
α
)
:
(
List.bind
l
fun (
x
:
α
) =>
[
x
]
)
=
l
source
theorem
List
.
map_eq_bind
{α :
Type
u_1}
{β :
Type
u_2}
(f :
α
→
β
)
(l :
List
α
)
:
List.map
f
l
=
List.bind
l
fun (
x
:
α
) =>
[
f
x
]
source
theorem
List
.
bind_assoc
{γ :
Type
w}
{α :
Type
u_1}
{β :
Type
u_2}
(l :
List
α
)
(f :
α
→
List
β
)
(g :
β
→
List
γ
)
:
List.bind
(
List.bind
l
f
)
g
=
List.bind
l
fun (
x
:
α
) =>
List.bind
(
f
x
)
g
source
instance
List
.
instMonad
:
Monad
List
Equations
List.instMonad
=
Monad.mk
source
@[simp]
theorem
List
.
pure_def
{α :
Type
u}
(a :
α
)
:
pure
a
=
[
a
]
source
instance
List
.
instLawfulMonad
:
LawfulMonad
List
Equations
List.instLawfulMonad
=
⋯
source
instance
List
.
instAlternative
:
Alternative
List
Equations
List.instAlternative
=
Alternative.mk
@
List.nil
fun {
α
:
Type
u} (
l
:
List
α
) (
l'
:
Unit
→
List
α
) =>
List.append
l
(
l'
()
)
source
instance
List
.
decidableBex
{α :
Type
u}
{p :
α
→
Prop
}
[
DecidablePred
p
]
(l :
List
α
)
:
Decidable
(
∃ (
x
:
α
),
x
∈
l
∧
p
x
)
Equations
One or more equations did not get rendered due to their size.
List.decidableBex
[]
=
isFalse
⋯
source
instance
List
.
decidableBall
{α :
Type
u}
{p :
α
→
Prop
}
[
DecidablePred
p
]
(l :
List
α
)
:
Decidable
(
∀ (
x
:
α
),
x
∈
l
→
p
x
)
Equations
List.decidableBall
l
=
match
inferInstance
with |
isFalse
h
=>
isTrue
⋯
|
isTrue
h
=>
isFalse
⋯