File "stdin", line 32, characters 0-11: Error: In environment T : Type p : T -> bool a : T t1, t2 : btree T IH1 : count p (rev_tree t1) = count p t1 IH2 : count p (rev_tree t2) = count p t2 Unable to unify "(if p a then 1 else 0) + (count p t1 + count p t2)" with "(if p a then 1 else 0) + (count p t2 + count p t1)".