Documentation

ToMathlib.Control.StateT

Lemmas about StateT #

@[implicit_reducible]
instance StateT.instMonadLift_toMathlib {m : Type u → Type v} {m' : Type u → Type w} {σ : Type u} [MonadLift m m'] :
MonadLift (StateT σ m) (StateT σ m')
@[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 = mk fun (s : σ) => liftM (x.run s)
theorem StateT.liftM_def {m : Type u → Type v} {σ α : Type u} [Monad m] (x : m α) :
@[simp]
theorem StateT.run_liftM {m : Type u → Type v} {σ α : Type u} [Monad m] (x : m α) (s : σ) :
(liftM x).run s = do let ax pure (a, s)
theorem StateT.monad_pure_def {m : Type u → Type v} {σ α : Type u} [Monad m] (x : α) :
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
@[simp]
theorem StateT.run_failure' {m : Type u → Type v} {σ α : Type u} [Monad m] [Alternative m] :
failure.run = fun (x : σ) => failure
@[simp]
theorem StateT.mk_pure_eq_pure {m : Type u → Type v} {σ α : Type u} [Monad m] (x : α) :
(mk fun (s : σ) => pure (x, s)) = pure x