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:
- Lists in this project are finite bookkeeping structures (scope stacks
ϙ, channel environmentsξ, statement sequences). They are constructed statically from syntax and never approximated by convergent sequences of "nearby" lists. - The
StoreisometryStore.type ≃ᵢ X × List Yrequires only thatList Ycarry a well-definedIMetricSpace; no continuity of list operations is needed. DecidableEqcannot be assumed: element types such asString →ᵤ Option Addressare function types with no decidable equality.open Classicalis appropriate since all metric instances in this project are noncomputable.CompleteSpace (List α)holds unconditionally: every Cauchy sequence is eventually constant (open balls of radius< 1are singletons under the discrete metric).
@[implicit_reducible]
The discrete IMetricSpace on List α, requiring no structure on α.
Equations
- instIMetricSpaceList = { toIMetricSpace := IMetricSpace.discrete, idist_discrete := ⋯ }
The discrete metric on List α induces the discrete topology.
List α is complete under the discrete metric: every Cauchy sequence is eventually
constant, hence converges.