  The $g$-theorem is a momentous result in combinatorics that gives a complete
numerical characterization of the face numbers of simplicial convex polytopes.
The $g$-conjecture asserts that the same numerical conditions given in the
$g$-theorem also characterizes the face numbers of all simplicial spheres, or
even more generally, all simplicial homology spheres.
  In this paper, we prove the $g$-conjecture for simplicial
$\mathbb{R}$-homology spheres. A key idea in our proof is a new algebra
structure for polytopal complexes. Given a polytopal $d$-complex $\Delta$, we
use ideas from rigidity theory to construct a graded Artinian
$\mathbb{R}$-algebra $\Psi(\Delta,\nu)$ of stresses on a PL realization $\nu$
of $\Delta$ in $\mathbb{R}^d$, where overlapping realized $d$-faces are
allowed. In particular, we prove that if $\Delta$ is a simplicial
$\mathbb{R}$-homology sphere, then for generic PL realizations $\nu$, the
stress algebra $\Psi(\Delta,\nu)$ is Gorenstein and has the weak Lefschetz
property.
