Module Type TYPE_ALGEBRA.
(** Type expressions *)
Parameter t: Type.
Parameter eq: forall (x y: t), {x=y} + {x<>y}.
Parameter default: t.
(** Subtyping *)
Parameter sub: t -> t -> Prop.
Parameter sub_dec: forall x y, {sub x y} + {~sub x y}.
(** Least upper bounds. [lub x y] is specified only when [x] and [y] have a common supertype; it can be arbitrary otherwise. *)
Parameter lub: t -> t -> t.
(** Greater lower bounds. [glb x y] is specified only when [x] and [y] have a common subtype; it can be arbitrary otherwise.*)
Parameter glb: t -> t -> t.
(** Low and high bounds for a given type. *)
Parameter low_bound: t -> t.
Parameter high_bound: t -> t.

Axiom low_bound_sub: forall t, sub (low_bound t) t.
Axiom low_bound_minorant: forall x y, sub x y -> sub (low_bound y) x.
Axiom high_bound_sub: forall t, sub t (high_bound t).
Axiom high_bound_majorant: forall x y, sub x y -> sub y (high_bound x).