Fixpoint power (base : nat) (exp : nat) : nat :=
 match exp with
 | 0 => 1
 | S n => base * (power base n)
 end.

(* Specifications: *)
Lemma countBLeafCT_limit: forall n s, countBLeafCT n s <= power 2 n.
Lemma countBLeafCT_bot: forall n, countBLeafCT n bot = 0.
Lemma countBLeafCT_top: forall n, countBLeafCT n top = power 2 n.
Lemma countBLeafCT_positive : forall s n, height s <= n -> bot <> s -> 0 < countBLeafCT n s.
Lemma countBLeafCT_mono_le: forall n1 n2 s, n1 <= n2 -> countBLeafCT n1 s <= countBLeafCT n2 s .
Lemma countBLeafCT_mono_diff: forall n1 n2 s1 s2, n1 <= n2 -> (s1 <= s2)%ba -> countBLeafCT n1 s2 - countBLeafCT n1 s1 <= countBLeafCT n2 s2 - countBLeafCT n2 s1.
Lemma countBLeafCT_mono_lt: forall n1 n2 s, n1 < n2 -> 0 < countBLeafCT n1 s -> countBLeafCT n1 s < countBLeafCT n2 s .
Lemma bot_join: forall t1 t2, join bot t1 t2 -> t1 = t2.
Lemma join_top : forall t1 t2, join top t1 t2 -> t1 = bot /\ t2 = top.
Lemma tree_height_0: forall s, height s = 0 -> s = top \/ s = bot.
Lemma tree_height_glb_limit: forall n s1 s2, height s1 <= n -> height s2 <= n -> height (glb s1 s2) <= n.
Lemma height_glb1 : forall s1 s2, height s1 <= tree_height s2-> height (glb s1 s2) <= height s2.
Lemma tree_height_lub_limit: forall n s1 s2, height s1 <= n -> height s2 <= n -> height (lub s1 s2) <= n.
Lemma height_lub1 : forall s1 s2, height s1 <= height s2-> height (lub s1 s2) <= height s2.
Lemma height_comp: forall s, height (comp s)= height s.
Lemma countBLeafCT_join_le: forall n s1 s2 s3, join s1 s2 s3 -> countBLeafCT n s1 + countBLeafCT n s2 <= countBLeafCT n s3.
Lemma countBLeafCT_join_eq: forall n s1 s2 s3, join s1 s2 s3 -> height s1 <= n -> height s2 <= n -> countBLeafCT n s1 + countBLeafCT n s2 = countBLeafCT n s3.