Documentation

Extra.Topology.IMetricSpace.Constructions.List

IMetricSpace (List α) via the discrete metric #

We equip List α with the discrete IMetricSpace instance, regardless of whether α carries any metric or decidability structure: idist xs ys = 0 if xs = ys, and idist xs ys = 1 otherwise.

Motivation:

@[implicit_reducible]
noncomputable instance instIMetricSpaceList {α : Type u_1} [DecidableEq α] :

The discrete IMetricSpace on List α, requiring no structure on α.

Equations
theorem List.idist_eq {α : Type u_1} [DecidableEq α] (xs ys : List α) :
idist xs ys = if xs = ys then 0 else 1

The discrete metric on List α induces the discrete topology.

List α is complete under the discrete metric: every Cauchy sequence is eventually constant, hence converges.