{-# OPTIONS --cubical-compatible --safe #-}
open import Relation.Binary.Core using (Rel)
open import Relation.Binary.Structures using (IsPartialOrder; IsEquivalence)
module Function.Metric.Structures
{a i ℓ₁ ℓ₂ ℓ₃} {A : Set a} {I : Set i}
(_≈ₐ_ : Rel A ℓ₁) (_≈ᵢ_ : Rel I ℓ₂) (_≤_ : Rel I ℓ₃) (0# : I) where
open import Algebra.Core using (Op₂)
open import Function.Metric.Core
open import Function.Metric.Definitions
open import Level using (_⊔_)
record IsProtoMetric (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isPartialOrder : IsPartialOrder _≈ᵢ_ _≤_
≈-isEquivalence : IsEquivalence _≈ₐ_
cong : Congruent _≈ₐ_ _≈ᵢ_ d
nonNegative : NonNegative _≤_ d 0#
open IsPartialOrder isPartialOrder public
renaming (module Eq to EqI)
module EqC = IsEquivalence ≈-isEquivalence
record IsPreMetric (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isProtoMetric : IsProtoMetric d
≈⇒0 : Definite _≈ₐ_ _≈ᵢ_ d 0#
open IsProtoMetric isProtoMetric public
record IsQuasiSemiMetric (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isPreMetric : IsPreMetric d
0⇒≈ : Indiscernable _≈ₐ_ _≈ᵢ_ d 0#
open IsPreMetric isPreMetric public
record IsSemiMetric (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isQuasiSemiMetric : IsQuasiSemiMetric d
sym : Symmetric _≈ᵢ_ d
open IsQuasiSemiMetric isQuasiSemiMetric public
record IsGeneralMetric (_∙_ : Op₂ I) (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isSemiMetric : IsSemiMetric d
triangle : TriangleInequality _≤_ _∙_ d
open IsSemiMetric isSemiMetric public