(** ** Complete uniform spaces *)
Definition cauchy {T : UniformSpace} (F : (T -> Prop) -> Prop) :=
forall eps : posreal, exists x, F (ball x eps).
Module CompleteSpace.
Record mixin_of (T : UniformSpace) := Mixin {
lim : ((T -> Prop) -> Prop) -> T ;
ax1 : forall F, ProperFilter F -> cauchy F -> forall eps : posreal, F (ball (lim F) eps) ;
ax2 : forall F1 F2, filter_le F1 F2 -> filter_le F2 F1 -> close (lim F1) (lim F2)
}.
Section ClassDef.
Record class_of (T : Type) := Class {
base : UniformSpace.class_of T ;
mixin : mixin_of (UniformSpace.Pack _ base T)
}.
Local Coercion base : class_of >-> UniformSpace.class_of.
Structure type := Pack { sort; _ : class_of sort ; _ : Type }.
Local Coercion sort : type >-> Sortclass.
Variable cT : type.
Definition class := let: Pack _ c _ := cT return class_of cT in c.
Let xT := let: Pack T _ _ := cT in T.
Notation xclass := (class : class_of xT).
Definition UniformSpace := UniformSpace.Pack cT xclass xT.
End ClassDef.
Module Exports.
Coercion base : class_of >-> UniformSpace.class_of.
Coercion mixin : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion UniformSpace : type >-> UniformSpace.type.
Canonical UniformSpace.
Notation CompleteSpace := type.
End Exports.
End CompleteSpace.
Export CompleteSpace.Exports.
Section CompleteSpace1.
Context {T : CompleteSpace}.
Definition lim : ((T -> Prop) -> Prop) -> T := CompleteSpace.lim _ (CompleteSpace.class T).

Lemma close_lim :
forall F1 F2 : (T -> Prop) -> Prop,
filter_le F1 F2 -> filter_le F2 F1 ->
close (lim F1) (lim F2).