Solution 3 now uses Mathlib!