Discrete gauge theories