By the theorem of
Kaplansky a bounded operator in a Banach space is algebraic if and only if it is
locally algebraic. We prove a generalization of this theorem. As a corollary we obtain
the analogous result for finite (or countable) families of operators. Further we prove
that a Banach algebra is PI (i.e. it satisfies a polynomial identity) if and only if it is
locally PI.