  We introduce $L^2$-Betti numbers, as well as a general homology and
cohomology theory for the standard invariants of subfactors, through the
associated quasi-regular symmetric enveloping inclusion of II_1 factors. We
actually develop a (co)homology theory for arbitrary quasi-regular inclusions
of von Neumann algebras. For crossed products by countable groups $\Gamma$, we
recover the ordinary (co)homology of $\Gamma$. For Cartan subalgebras, we
recover Gaboriau's $L^2$-Betti numbers for the associated equivalence relation.
In this common framework, we prove that the $L^2$-Betti numbers vanish for
amenable inclusions and we give cohomological characterizations of property
(T), the Haagerup property and amenability. We compute the $L^2$-Betti numbers
for the standard invariants of the Temperley-Lieb-Jones subfactors and of the
Fuss-Catalan subfactors, as well as for free products and tensor products.
