useful lemmas
refactor factorial proof