Record metric : Prop := {
  metric_nonneg: forall x y:X, d x y >= 0;
  metric_sym: forall x y:X, d x y = d y x;
  triangle_inequality: forall x y z:X, d x z <= d x y + d y z;
  metric_zero: forall x:X, d x x = 0;
  metric_strict: forall x y:X, d x y = 0 -> x = y
}.Record metric : Prop := {
  metric_nonneg: forall x y:X, d x y >= 0;
  metric_sym: forall x y:X, d x y = d y x;
  triangle_inequality: forall x y z:X, d x z <= d x y + d y z;
  metric_zero: forall x:X, d x x = 0;
  metric_strict: forall x y:X, d x y = 0 -> x = y
}.Record metric : Prop := {
  metric_nonneg: forall x y:X, d x y >= 0;
  metric_sym: forall x y:X, d x y = d y x;
  triangle_inequality: forall x y z:X, d x z <= d x y + d y z;
  metric_zero: forall x:X, d x x = 0;
  metric_strict: forall x y:X, d x y = 0 -> x = y
}.Record metric : Prop := {
  metric_nonneg: forall x y:X, d x y >= 0;
  metric_sym: forall x y:X, d x y = d y x;
  triangle_inequality: forall x y z:X, d x z <= d x y + d y z;
  metric_zero: forall x:X, d x x = 0;
  metric_strict: forall x y:X, d x y = 0 -> x = y
}.Record metric : Prop := {
  metric_nonneg: forall x y:X, d x y >= 0;
  metric_sym: forall x y:X, d x y = d y x;
  triangle_inequality: forall x y z:X, d x z <= d x y + d y z;
  metric_zero: forall x:X, d x x = 0;
  metric_strict: forall x y:X, d x y = 0 -> x = y
}.Record metric : Prop := {
  metric_nonneg: forall x y:X, d x y >= 0;
  metric_sym: forall x y:X, d x y = d y x;
  triangle_inequality: forall x y z:X, d x z <= d x y + d y z;
  metric_zero: forall x:X, d x x = 0;
  metric_strict: forall x y:X, d x y = 0 -> x = y
}.Inductive metric_topology_neighborhood_basis (x:X) : Family X :=
  | intro_open_ball: forall r:R, r > 0 ->
    In (metric_topology_neighborhood_basis x) (open_ball x r).Inductive metric_topology_neighborhood_basis (x:X) : Family X :=
  | intro_open_ball: forall r:R, r > 0 ->
    In (metric_topology_neighborhood_basis x) (open_ball x r).Definition MetricTopology : TopologicalSpace.Definition metrizes (X:TopologicalSpace)
  (d:point_set X -> point_set X -> R) : Prop :=
  forall x:point_set X, open_neighborhood_basis
             (metric_topology_neighborhood_basis d x) x.Inductive metrizable (X:TopologicalSpace) : Prop :=
  | intro_metrizable: forall d:point_set X -> point_set X -> R,
    metric d -> metrizes X d ->
    metrizable X.Inductive metrizable (X:TopologicalSpace) : Prop :=
  | intro_metrizable: forall d:point_set X -> point_set X -> R,
    metric d -> metrizes X d ->
    metrizable X.

(* Specifications: *)
Lemma MetricTopology_metrizable: forall (X:Type) (d:X->X->R) (d_metric: metric d), metrizes (MetricTopology d d_metric) d.
Lemma metric_space_net_cluster_point: forall (X:TopologicalSpace) (d:point_set X -> point_set X -> R), metrizes X d -> forall (I:DirectedSet) (x:Net I X) (x0:point_set X), (forall eps:R, eps > 0 -> exists arbitrarily large i:DS_set I, d x0 (x i) < eps) -> net_cluster_point x x0.
Lemma metric_space_net_cluster_point_converse: forall (X:TopologicalSpace) (d:point_set X -> point_set X -> R), metrizes X d -> forall (I:DirectedSet) (x:Net I X) (x0:point_set X), net_cluster_point x x0 -> forall eps:R, eps > 0 -> exists arbitrarily large i:DS_set I, d x0 (x i) < eps.
Lemma metric_space_fun_continuity_converse: forall (X Y:TopologicalSpace) (f:point_set X->point_set Y) (x:point_set X) (dX:point_set X -> point_set X -> R) (dY:point_set Y -> point_set Y -> R), metrizes X dX -> metrizes Y dY -> continuous_at f x -> forall eps:R, eps > 0 -> exists delta:R, delta > 0 /\ forall x':point_set X, dX x x' < delta -> dY (f x) (f x') < eps.
Lemma metric_space_fun_continuity: forall (X Y:TopologicalSpace) (f:point_set X->point_set Y) (x:point_set X) (dX:point_set X -> point_set X -> R) (dY:point_set Y -> point_set Y -> R), metrizes X dX -> metrizes Y dY -> (forall eps:R, eps > 0 -> exists delta:R, delta > 0 /\ forall x':point_set X, dX x x' < delta -> dY (f x) (f x') < eps) -> continuous_at f x.
Lemma metrizable_impl_first_countable: forall X:TopologicalSpace, metrizable X -> first_countable X.
Lemma metrizable_separable_impl_second_countable: forall X:TopologicalSpace, metrizable X -> separable X -> second_countable X.
Lemma metrizable_Lindelof_impl_second_countable: forall X:TopologicalSpace, metrizable X -> Lindelof X -> second_countable X.