-- ToMathlib/Control/Lawful/MonadState.lean

namespace LawfulMonadStateOf

variable {σ : Type u} {m : Type u → Type v}

variable [Monad m] [LawfulMonad m] [MonadStateOf σ m] [LawfulMonadStateOf σ m]

end LawfulMonadStateOf

namespace LawfulMonadState

variable {σ : Type u} {m : Type u → Type v} [Monad m] [LawfulMonad m] [LawfulMonadState σ m]

end LawfulMonadState

namespace StateT

variable {σ : Type u} {m : Type u → Type v} [Monad m] [LawfulMonad m]

-- Repository definitions used:
content: ...

-- Repository lemmas used:
content: theorem List.getElem_append_left{α : Type u_1} {l₁ l₂ : List α} {i : Nat} (hn : i < l₁.length) :\n(l₁ ++ l₂)[i] = l₁[i]

-- Local definitions used:

-- Local lemmas used:

-- Target theorem and proof:
theorem set_get : (do let s ← @StateT.get σ m _; StateT.set s) = pure ⟨⟩
:= by
  unfold StateT.get StateT.instMonad StateT.bind StateT.set StateT.pure
  simp only [bind_pure_comp, map_pure]