Section MaxSetMinSet.
Variable T : finType.
Notation sT := {set T}.
Implicit Types A B C : sT.
Implicit Type P : pred sT.
Definition minset P A := [forall (B : sT | B \subset A), (B == A) == P B].
Arguments minsetP {P A}.
(* The 'locked_with' allows Coq to find the value of P by unification. *)
Fact maxset_key : unit. Proof. by []. Qed.
Definition maxset P A :=
minset (fun B => locked_with maxset_key P (~: B)) (~: A).

Lemma maxsetP P A :
reflect ((P A) /\ (forall B, P B -> A \subset B -> B = A)) (maxset P A).