Why would changing ceiling fan speed cause an AFCI breaker to trip?
Switches generate small, momentary arcs as part of their normal operation; AFCIs are designed to recognize and ignore these momentary arcs.  However, holding the switch between positions (or taking a while to transition between positions) can lead to the arc sustaining itself, which damages the switch contacts and also causes the AFCI to trip because it sees an arc it doesn't recognize as harmless.  

In other words: "Doctor, it hurts if I do this!" "Don't do that, then!"