Equational Reasoning in Type Theory