@@ -341,3 +341,60 @@ rewrite neq_lt => /orP[tp|pt].
341341Unshelve. all: by end_near. Qed .
342342
343343End cvg_at_right_left_dnbhs.
344+
345+ (* TODO: we need to have a way to force r in ball x r to be a realType, even for
346+ a normed space which is a lmodtype over (K : numDomain or numFieldtype) *)
347+ HB.factory Record Hausdorff_isMetric (R : realType) (M : Type ) & PseudoMetric R M := {
348+ absorbing : forall x y : M, exists e : {posnum R}, ball x e%:num y ;
349+ hausdorff : hausdorff_space M
350+ }.
351+
352+ HB.builders Context R M & Hausdorff_isMetric R M.
353+
354+ From mathcomp Require Import compact constructive_ereal.
355+
356+ Definition d (x y : M) := inf [set e : R | 0 < e /\ ball x e y].
357+
358+ Let d_positivity x y : d x y = 0 -> x = y.
359+ Proof .
360+ rewrite /d => Bxy.
361+ have := hausdorff.
362+ apply.
363+ rewrite -closeEnbhs.
364+ rewrite ball_close => e.
365+ have : forall a, 0 < a -> exists2 b, ball x b y & b < a.
366+ move=> a a0.
367+ have : has_inf [set e : R | (0 < e) /\ ball x e y].
368+ split.
369+ have [e' xe'y/= ] := absorbing x y.
370+ exists e'%:num => //=.
371+ by exists 0 => z/= [/ltW].
372+ move/inf_adherent => /(_ _ a0)[e' /= [e'0 xe'y]].
373+ rewrite Bxy add0r => e'a.
374+ by exists e'.
375+ move/(_ e%:num (gt0 e)) => [b + be].
376+ by apply: le_ball; exact: ltW.
377+ Qed .
378+
379+ Let d_ge0 x y : 0 <= d x y.
380+ Proof .
381+ have [e' xe'y/= ] := absorbing x y.
382+ rewrite /d /=; apply: lb_le_inf => /=; first by exists e'%:num => /=; split.
383+ by move => z [] * ; exact: ltW.
384+ Qed .
385+
386+
387+ Let ballEd (x : M) delta : ball x delta = [set y | d x y < delta].
388+ Proof .
389+ apply/seteqP; split.
390+ move=> /= z/= xdeltaz; rewrite /d/=.
391+ (* NB: this works only if we know that ball are open *)
392+ admit.
393+ have H z : [set e | 0 < e /\ ball x e z] !=set0.
394+ have [e' xe'y] := absorbing x z.
395+ by exists e'%:num => //=.
396+ move=> z/=; rewrite /d.
397+ move/inf_lt => /(_ (H z))[e/= [e0 xez]] edelta.
398+ apply: le_ball xez.
399+ exact: ltW.
400+ Admitted .
0 commit comments