mathlib: fixes and improvements, WIP