Algebra of Polar Codes