proof of factor theorem