Edit mathematical appendix

This commit tightens up the mathematical reasoning and corrects some errors
and omissions.