Add functions to generate theorems and trees