How to derive ring all-reduce's mathematical property step by step