Documentation
ToMathlib
.
Control
.
StateT
Search
return to top
source
Imports
Init
ToMathlib.General
Batteries.Control.Lemmas
ToMathlib.Control.FreeMonad
Imported by
StateT
.
instMonadLift_toMathlib
StateT
.
liftM_of_liftM_eq
StateT
.
liftM_def
StateT
.
monad_pure_def
StateT
.
monad_bind_def
StateT
.
monad_failure_eq
StateT
.
run_failure'
StateT
.
mk_pure_eq_pure
Lemmas about
StateT
#
source
instance
StateT
.
instMonadLift_toMathlib
{
m
:
Type
u →
Type
v
}
{
m'
:
Type
u →
Type
w
}
{
σ
:
Type
u}
[
MonadLift
m
m'
]
:
MonadLift
(
StateT
σ
m
)
(
StateT
σ
m'
)
Equations
StateT.instMonadLift_toMathlib
=
{
monadLift
:=
fun {
α
:
Type
?u.38} (
x
:
StateT
σ
m
α
) =>
StateT.mk
fun (
s
:
σ
) =>
liftM
(
x
.
run
s
)
}
source
@[simp]
theorem
StateT
.
liftM_of_liftM_eq
{
m
:
Type
u →
Type
v
}
{
m'
:
Type
u →
Type
w
}
{
σ
α
:
Type
u}
[
MonadLift
m
m'
]
(
x
:
StateT
σ
m
α
)
:
liftM
x
=
StateT.mk
fun (
s
:
σ
) =>
liftM
(
x
.
run
s
)
source
theorem
StateT
.
liftM_def
{
m
:
Type
u →
Type
v
}
{
σ
α
:
Type
u}
[
Monad
m
]
(
x
:
m
α
)
:
liftM
x
=
StateT.lift
x
source
theorem
StateT
.
monad_pure_def
{
m
:
Type
u →
Type
v
}
{
σ
α
:
Type
u}
[
Monad
m
]
(
x
:
α
)
:
pure
x
=
StateT.pure
x
source
theorem
StateT
.
monad_bind_def
{
m
:
Type
u →
Type
v
}
{
σ
α
β
:
Type
u}
[
Monad
m
]
(
x
:
StateT
σ
m
α
)
(
f
:
α
→
StateT
σ
m
β
)
:
x
>>=
f
=
x
.
bind
f
source
theorem
StateT
.
monad_failure_eq
{
m
:
Type
u →
Type
v
}
{
σ
α
:
Type
u}
[
Monad
m
]
[
Alternative
m
]
:
failure
=
StateT.failure
source
@[simp]
theorem
StateT
.
run_failure'
{
m
:
Type
u →
Type
v
}
{
σ
α
:
Type
u}
[
Monad
m
]
[
Alternative
m
]
:
failure
.
run
=
fun (
x
:
σ
) =>
failure
source
@[simp]
theorem
StateT
.
mk_pure_eq_pure
{
m
:
Type
u →
Type
v
}
{
σ
α
:
Type
u}
[
Monad
m
]
(
x
:
α
)
:
(
StateT.mk
fun (
s
:
σ
) =>
pure
(
x
,
s
)
)
=
pure
x