Towards a mathematical theory for consistency training in diffusion models