Solution (source code)

= Solution

Every <sigma-algebra> is both a <pi-system> and a <Dynkin system>. Conversely, in a family having both properties, intersections and complements give finite unions and differences. For any sequence $(A_n)$ in it, replace $A_n$ by the disjoint sets $B_n=A_n\setminus\bigcup_{j<n}A_j$, which still belong to the family. Their disjoint union equals $\bigcup_nA_n$, proving closure under arbitrary countable unions. Thus the family is a <sigma-algebra>.