Module Test2.
Structure semigroup := SemiGroup {
sg_car :> Type;
sg_op : sg_car -> sg_car -> sg_car;
}.
Structure monoid := Monoid {
monoid_car :> Type;
monoid_op : monoid_car -> monoid_car -> monoid_car;
monoid_unit : monoid_car;
monoid_left_id x : monoid_op monoid_unit x = x;
}.
Coercion monoid_sg (X : monoid) : semigroup :=
SemiGroup (monoid_car X) (monoid_op X).
Canonical Structure monoid_sg.
Canonical Structure nat_sg := SemiGroup nat plus.
Canonical Structure nat_monoid := Monoid nat plus 0 plus_O_n.

Lemma foo (x : nat) : 0 + x = x.