Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. Style: centered; floating; windowed.
Module RBT := MSets.MSetRBT.Make Nat_as_OT.
Definition build_trees (leaves: list nat) :=
  List.fold_left (fun trs n =>
      RBT.add n (hd RBT.empty trs) :: trs)
    leaves [] |> List.rev.

= [112213213421435214356]: RBT.t |> list
= [221214321432146321546]: RBT.t |> list
= [665546541652146521436]: RBT.t |> list