Section IntervalLattice.
Variable (disp : unit) (T : latticeType disp).
Implicit Types (x y z : T) (b bl br : itv_bound T) (i : interval T).
Definition bound_meet bl br : itv_bound T :=
match bl, br with
| -oo, _ | _, -oo => -oo
| +oo, b | b, +oo => b
| BSide xb x, BSide yb y =>
BSide (((x <= y) && xb) || ((y <= x) && yb)) (x `&` y)
end.
Definition bound_join bl br : itv_bound T :=
match bl, br with
| -oo, b | b, -oo => b
| +oo, _ | _, +oo => +oo
| BSide xb x, BSide yb y =>
BSide ((~~ (x <= y) || yb) && (~~ (y <= x) || xb)) (x `|` y)
end.
Definition itv_bound_latticeMixin :=
LatticeMixin bound_meetC bound_joinC bound_meetA bound_joinA
bound_joinKI bound_meetKU bound_leEmeet.
Canonical itv_bound_latticeType :=
LatticeType (itv_bound T) itv_bound_latticeMixin.

Lemma bound_lex1 b : b <= +oo. Proof. by case: b => [|[]]. Qed.