CoRN.metric2.Classification

Require Export Metric.
Require Import Qauto.

Open Local Scope Q_scope.

Classification of metric spaces

There is a heirarchy of properties that a metric space can possess. At the lowest level a metric space is stable if its ball relation is double negation stable. Arguablely this could be made a requirement of metric spaces.
Definition stableMetric (ms:MetricSpace) :=
  e (x y:ms), ~~(ball e x y)ball e x y.

Lemma stableEq : (ms:MetricSpace) (stable:stableMetric ms) (x y:ms),
 ~~(st_eq x y)st_eq x y.
Proof.
 intros ms stable x y Hxy.
 apply ball_eq.
 intros e.
 apply stable.
 revert Hxy.
 cut (st_eq x yball (m:=ms) e x y).
  tauto.
 intros H.
 rewriteH.
 apply ball_refl.
Qed.

At the next level up a metric space is located if you can choose between ball d x y and ~ball e x y for e < d. Every located metric is a stable metric.
Definition locatedMetric (ms:MetricSpace) :=
  (e d:Qpos) (x y:ms), e < d{ball d x y}+{¬ball e x y}.

At the top level a metric space is decidable if its ball relation is decidable. Every decidable metric is a located metric.
Definition decidableMetric (ms:MetricSpace) :=
  e (x y:ms), {ball e x y}+{¬ball e x y}.

Lemma decidable_located : ms,
 decidableMetric mslocatedMetric ms.
Proof.
 intros ms H e d x y Hed.
 destruct (H e x y).
  left.
  abstract ( apply ball_weak_le with e; try assumption; apply Qlt_le_weak; assumption).
 right; assumption.
Defined.

Lemma located_stable : ms,
 locatedMetric msstableMetric ms.
Proof.
 intros ms H e x y Hxy.
 apply ball_closed.
 intros d.
 destruct (H e (e+d)%Qpos x y); try (assumption || contradiction).
 autorewrite with QposElim.
 rewriteQlt_minus_iff; ring_simplify; auto with ×.
Qed.