This paper discusses thinning on 3D binary images with the 4-subfield approach. Although a thinning algorithm concerns binary images, the algorithm itself can be represented as a set of three-color reduction templates. A thinning algorithm is topology preserving if the set of all three-color templates is topology preserving. Sufficient and necessary conditions of time complexity O(n) were proposed for verifying the topological soundness of a 3D 4-subfield thinning algorithm of n three-color templates. Theories and techniques for computerizing such conditions were discussed. Two 4-subfield thinning algorithms on 3D images, one for generating medial curves, and the other one for generating medial surfaces, are proposed and proved to preserve topology by our sufficient and necessary conditions.