#[local] Infix "\in" := E.In.
#[local] Infix "\subseteq" := E.isSubsetOf.
#[local] Obligation Tactic := i.
Create HintDb poset_hints.
#[program]
Definition mkProsetFrom_ltProp {A : Type} (ltProp : A -> A -> Prop) (ltProp_StrictOrder : StrictOrder ltProp) : isProset A :=
{| leProp x y := ltProp x y \/ x = y; Proset_isSetoid := mkSetoid_from_eq; |}.
Next Obligation.
split; ii; firstorder try congruence.
Qed.
Next Obligation.
intros x y. cbn. unfold flip. split; firstorder try congruence. contradiction (StrictOrder_Irreflexive x). firstorder.
Qed.
Class isPoset (A : Type) : Type :=
{ Poset_isProset :: isProset A
; Poset_eqProp_spec (x : A) (y : A)
: x == y <-> x = y
}.
Infix "≦" := (leProp (isProset := Poset_isProset)) : type_scope.
#[global]
Instance mkProsetFrom_ltProp_isPoset {A : Type} {ltProp : A -> A -> Prop} (ltProp_StrictOrder : StrictOrder ltProp) : isPoset A :=
{ Poset_isProset := mkProsetFrom_ltProp ltProp ltProp_StrictOrder
; Poset_eqProp_spec x y := conj (fun H : x = y => H) (fun H : x = y => H)
}.
Class has_ltProp (A : Type) : Type :=
ltProp (lhs : A) (rhs : A) : Prop.
Infix "≨" := ltProp : type_scope.
Class hasStrictOrder (A : Type) : Type :=
{ lt :: has_ltProp A
; lt_StrictOrder :: StrictOrder lt
}.
#[global]
Instance mkPoset_fromStrictOrder {A : Type} `{STRICT_ORDER : hasStrictOrder A} : isPoset A :=
@mkProsetFrom_ltProp_isPoset A lt lt_StrictOrder.

Lemma lt_iff_le_ne {A : Type} `{STRICT_ORDER : hasStrictOrder A} (x : A) (y : A)
: x ≨ y <-> (x ≦ y /\ x <> y).