  I argue that a version of the quantum-corrected Ryu-Takayanagi formula holds
in any quantum error-correcting code. I present this result as a series of
theorems of increasing generality, with the final statement expressed in the
language of operator-algebra quantum error correction. In AdS/CFT this gives a
"purely boundary" interpretation of the formula. I also extend a recent
theorem, which established entanglement-wedge reconstruction in AdS/CFT, when
interpreted as a subsystem code, to the more general, and I argue more
physical, case of subalgebra codes. For completeness, I include a
self-contained presentation of the theory of von Neumann algebras on
finite-dimensional Hilbert spaces, as well as the algebraic definition of
entropy. The results confirm a close relationship between bulk gauge
transformations, edge-modes/soft-hair on black holes, and the Ryu-Takayanagi
formula. They also suggest a new perspective on the homology constraint, which
basically is to get rid of it in a way that preserves the validity of the
formula, but which removes any tension with the linearity of quantum mechanics.
Moreover they suggest a boundary interpretation of the "bit threads" recently
introduced by Freedman and Headrick.
