Module LEq <: SEMILATTICE.
Definition t := res eqs.
Definition eq (x y: t) :=
match x, y with
| OK a, OK b => EqSet.Equal a b
| Error _, Error _ => True
| _, _ => False
end.
Definition beq (x y: t) :=
match x, y with
| OK a, OK b => EqSet.equal a b
| Error _, Error _ => true
| _, _ => false
end.
Definition ge (x y: t) :=
match x, y with
| OK a, OK b => EqSet.Subset b a
| Error _, _ => True
| _, Error _ => False
end.

Lemma ge_refl: forall x y, eq x y -> ge x y.
Lemma ge_trans: forall x y z, ge x y -> ge y z -> ge x z.