Theory of deuteron production in proton-proton collisions