Definition greatest_suchthat_is_greatest {A : P -> UU} (x : greatest_suchthat A) : ∏ y, A y -> y ≤ x. Proof. intros y A_y. exact (greatest_is_greatest _ x (_,,A_y)). Defined.
Require Import UniMath.Foundations.All. Require Import UniMath.MoreFoundations.All. Require Import UniMath.OrderTheory.OrderedSets.WellOrderedSets. Require Import UniMath.OrderTheory.DCPOs.AlternativeDefinitions.Dcpo. Require Import UniMath.OrderTheory.Posets.Subposets.