Reduction and the trace formula