simp[modifyThe, modifyGet, MonadStateOf.modifyGet, StateT.modifyGet,revDerivM, bind, StateT.bind, getThe, MonadStateOf.get, StateT.get, set, StateT.set, get, pure, StateT.pure, modify]
case h.h
K : Type
inst✝⁹ : RCLike K
m : Type → Type
m' : outParam (Type → Type)
inst✝⁸ : Monad m
inst✝⁷ : Monad m'
inst✝⁶ : RevDerivMonad K m m'
inst✝⁵ : LawfulMonad m
inst✝⁴ : LawfulMonad m'
S : Type
inst✝³ : SemiInnerProductSpace K S
X : Type
inst✝² : SemiInnerProductSpace K X
Y : Type ?u.264984
inst✝¹ : SemiInnerProductSpace K Y
Z : Type ?u.264995
inst✝ : SemiInnerProductSpace K Z
f : X → S → S
ha0 : HasAdjDiff K fun xs => f xs.1 xs.2
x✝¹ : X
x✝ : S
⊢ revDerivM K (fun x => modify (f x)) x✝¹ x✝ =
    (get >>= fun __do_lift =>
        let sdf := revDeriv K (fun xs => f xs.1 xs.2) (x✝¹, __do_lift);
        do
        set sdf.1
        pure
            ((), fun x => do
              let __do_lift ← get
              let dxs : X × S := sdf.2 __do_lift
              set dxs.2
              pure dxs.1))
      x✝
case h.h
K : Type
inst✝⁹ : RCLike K
m : Type → Type
m' : outParam (Type → Type)
inst✝⁸ : Monad m
inst✝⁷ : Monad m'
inst✝⁶ : RevDerivMonad K m m'
inst✝⁵ : LawfulMonad m
inst✝⁴ : LawfulMonad m'
S : Type
inst✝³ : SemiInnerProductSpace K S
X : Type
inst✝² : SemiInnerProductSpace K X
Y : Type ?u.264984
inst✝¹ : SemiInnerProductSpace K Y
Z : Type ?u.264995
inst✝ : SemiInnerProductSpace K Z
f : X → S → S
ha0 : HasAdjDiff K fun xs => f xs.1 xs.2
x✝¹ : X
x✝ : S
⊢ (do
      let ysdf ← revDerivM K (fun xs => pure (PUnit.unit, f xs.1 xs.2)) (x✝¹, x✝)
      pure ((ysdf.1.1, fun dx ds => ysdf.2 (dx, ds)), ysdf.1.2)) =
    pure
      (((), fun x =>
          StateT.bind StateT.get fun __do_lift =>
            StateT.bind (StateT.set ((revDeriv K (fun xs => f xs.1 xs.2) (x✝¹, x✝)).2 __do_lift).2) fun x =>
              StateT.pure ((revDeriv K (fun xs => f xs.1 xs.2) (x✝¹, x✝)).2 __do_lift).1),
        f x✝¹ x✝)