  We study shape-deformations of the entanglement entropy and the modular
Hamiltonian for an arbitrary subregion and state (with a smooth dual geometry)
in a holographic conformal field theory. More precisely, we study a
double-deformation comprising of a shape deformation together with a state
deformation, where the latter corresponds to a small change in the bulk
geometry. Using a purely gravitational identity from the Hollands-Iyer-Wald
formalism together with the assumption of equality between bulk and boundary
modular flows for the original, undeformed state and subregion, we rewrite a
purely CFT expression for this double deformation of the entropy in terms of
bulk gravitational variables and show that it precisely agrees with the
Ryu-Takayanagi formula including quantum corrections. As a corollary, this
gives a novel, CFT derivation of the JLMS formula for arbitrary subregions in
the vacuum, without using the replica trick. Finally, we use our results to
give an argument that if a general, asymptotically AdS spacetime satisfies the
Ryu-Takayanagi formula for arbitrary subregions, then it must necessarily
satisfy the non-linear Einstein equation.
