Definition union' (s1 s2: tree) : tree :=
match compare_height s1 s1 s2 s2 with
| Lt => fold' _ insert s1 s2
| Gt => fold' _ insert s2 s1
| Eq => linear_union s1 s2
end.

Lemma delete_min_valid:
forall s, valid s ->
match delete'_min s with
| Some (_, s0) => valid s0
| None => True
end.