Lemma interlaced_geqt_leqk_geqtconsensus {X : hSet} : ∏ (b : interlaced_prebilattice X) (x y : X), (∑ r : X, tle b r x × kle b r y) -> tle b (consensus b y x) x. Proof. intros b x y [r [p1 p2]]. assert (p1' : tle (make_interlaced_prebilattice (t_opp_prebilattice_is_interlaced b)) x r). { rewrite <- p1, iscomm_Lmin. use Lmax_absorb. } set (t := consensus b y x). assert (p : Lmax (tlattice b) t x = x). { rewrite iscomm_Lmax. exact (interlaced_leqt_leqk_leqtconsensus (make_interlaced_prebilattice (t_opp_prebilattice_is_interlaced b)) x y (r,,p1',,p2)). } rewrite <- p. use Lmin_absorb. Defined.
Require Import UniMath.OrderTheory.Prebilattice.Prebilattice. Require Import UniMath.OrderTheory.Lattice.Lattice. Require Import UniMath.Foundations.Sets. Require Import UniMath.MoreFoundations.Subtypes. Require Import UniMath.Algebra.BinaryOperations.