Lvc.Libs.PartialOrder

Require Export Containers.OrderedType Setoid Coq.Classes.Morphisms Computable.
Require Import Containers.OrderedTypeEx DecSolve MoreList.

Class PartialOrder (Dom:Type) := {
  poLe : DomDomProp;
  poLe_dec :> d , Computable (poLe d );
  poEq : DomDomProp;
  poEq_dec :> d , Computable (poEq d )
}.

Instance PartialOrder_pair_instance X `{PartialOrder X} Y `{PartialOrder Y}
: PartialOrder (X × Y) := {
  poLe x y := poLe (fst x) (fst y) poLe (snd x) (snd y);
  poLe_dec := _;
  poEq x y := poEq (fst x) (fst y) poEq (snd x) (snd y);
  poEq_dec := _
}.
- intros.
  decide (poLe (fst d) (fst )); decide (poLe (snd d) (snd )); try dec_solve.
- intros.
  decide (poEq (fst d) (fst )); decide (poEq (snd d) (snd )); try dec_solve.
Defined.

Instance PartialOrder_list_instance X `{PartialOrder X}
: PartialOrder (list X) := {
  poLe := list_eq poLe;
  poLe_dec := _;
  poEq := list_eq poEq;
  poEq_dec := _
}.