The foundation of the generalized theory of relativity