A Theory of Mean Field Approximation