Dual Algebras with Applications to Invariant Subspaces and Dilation Theory