Section MAKE_CPO_FROM_COLA.
Context {D : Type} {PROSET : isProset D} {COLA : ColaDef.isCola D (PROSET := PROSET)}.
#[global, program]
Instance cola_isCpo : isCpo D :=
{ bottom_cpo := proj1_sig (ColaDef.supremum_cola E.empty)
; supremum_cpo X _ := proj1_sig (ColaDef.supremum_cola X)
; bottom_cpo_spec := _
; supremum_cpo_spec X _ := proj2_sig (ColaDef.supremum_cola X)
}.
Next Obligation.
destruct (ColaDef.supremum_cola E.empty) as [bot bot_spec]; simpl in *.
eapply bot_spec. ii. inv IN.
Qed.
End MAKE_CPO_FROM_COLA.
End CpoDef.
Class hsOrd (A : Type) `{PROSET : isProset A} : Type :=
{ compare (x : A) (y : A) : comparison
; compare_Lt x y
(OBS_Lt : compare x y = Lt)
: x =< y /\ ~ x == y
; compare_Eq x y
(OBS_Eq : compare x y = Eq)
: x == y
; compare_Gt x y
(OBS_Gt : compare x y = Gt)
: y =< x /\ ~ x == y
}.
#[global] Hint Resolve compare_Lt compare_Eq compare_Gt : poset_hints.

Lemma compare_spec {A : Type} {PROSET : isProset A} {ORD : hsOrd A (PROSET := PROSET)} (lhs : A) (rhs : A) :
match compare lhs rhs with
| Lt => lhs =< rhs /\ ~ lhs == rhs
| Eq => lhs == rhs
| Gt => rhs =< lhs /\ ~ lhs == rhs
end.