Noncommutative geometry on a discrete periodic lattice and gauge theory