(*D11*)
Definition sub (x y : canonTree) : option canonTree :=
match eq_dec (glb x y) y with
| left _ => Some (glb x (comp y))
| right _ => None
end.

Lemma decompose_glb: forall t1 t11 t12 t2 t21 t22 t3 t31 t32,
decompose t1 = (t11,t12) ->
decompose t2 = (t21,t22) ->
decompose t3 = (t31,t32) ->
(glb t1 t2 = t3 <-> (glb t11 t21 = t31 /\ glb t12 t22 = t32)).