Multi-head Transformers Provably Learn Symbolic Multi-step Reasoning via Gradient Descent