Modules

categorical-crypto

  • Prelude

CategoricalCrypto

  • CategoricalCrypto
  • Abstract
  • Abstract2
  • Abstract2.Equivalence
  • Abstract2.Morphism
  • Abstract2.OAPEmulation
  • Abstract2.WideSubcategory
  • Channel.Category
  • Channel.Core
  • Channel.Selection
  • Examples.Basic
  • Examples.Commitment
  • Examples.RelSetup
  • Examples.Signatures
  • FamilyCategory
  • Machine.Constraints
  • Machine.Core
  • MachineAxioms
  • RandomOracle
  • RandomOracle2
  • SFunM
  • Standard
  • Standard2
  • Standard2.Morphism
  • StandardTV
  • UCSetup
  • UCSetup.Morphism
  • VanishingTV

Categories

  • Actegory
  • Actegory.Underlying
  • Category.EquivClosureHelper
  • Coherence.Monoidal
  • Coherence.Monoidal.Compare
  • Coherence.Monoidal.Diagram
  • Coherence.Monoidal.Frontend
  • Coherence.Monoidal.Frontend.Core
  • Coherence.Monoidal.Frontend.Sigma
  • Coherence.Monoidal.MacLane
  • Coherence.Monoidal.Normalize
  • Coherence.Monoidal.Reflect
  • Coherence.Monoidal.Sigma
  • Coherence.Monoidal.Test.Frontend
  • Coherence.Monoidal.Test.InterchangeStress
  • Coherence.Monoidal.Test.Limitations
  • Coherence.Monoidal.Test.SigmaFrontend
  • Coherence.Monoidal.WireCoherence
  • CoherenceIsos
  • Diagram.Coend.Ext.Setoids
  • Discrete
  • FreeMonoidal
  • FreeStrictMonoidal
  • Functor.Monoidal.CurriedTensor
  • Functor.Monoidal.CurriedTensor.Properties
  • Functor.Monoidal.Properties.Ext
  • Functor.Presheaf.Morphism
  • GradedKleisli
  • GradedKleisli.Functorial
  • GradedKleisli.Functorial.Category
  • GradedKleisli.Regrade
  • KernelCongruence
  • KernelCongruence.Reindex
  • LocallyGraded
  • LocallyGraded.FreeActegory
  • LocallyGraded.FreeActegory.Kleisli
  • LocallyGraded.Kleisli
  • Monad.Graded.Ext
  • Monad.Graded.Morphism
  • Monad.Graded.Pullback
  • Monad.Graded.Uncurried
  • Morphism.Reasoning.Ext
  • NaturalTransformationHelper
  • Properties

Class

  • Monad.Ext

Data

  • List.Properties.Ext
  • Maybe.Ext
  • Nat.Poly

LibExt

  • LibExt
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some metric structures (not packed up with sets, operations, etc.)
------------------------------------------------------------------------
 
-- The contents of this module should usually be accessed via
-- `Function.Metric`.
 
{-# 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 (_⊔_)
 
------------------------------------------------------------------------
-- Proto-metrics
 
-- We do not insist that the ordering relation is total as otherwise
-- we would exclude the real numbers.
 
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
 
------------------------------------------------------------------------
-- Pre-metrics
 
record IsPreMetric (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isProtoMetric : IsProtoMetric d
≈⇒0 : Definite _≈ₐ_ _≈ᵢ_ d 0#
 
open IsProtoMetric isProtoMetric public
 
------------------------------------------------------------------------
-- Quasi-semi-metrics
 
record IsQuasiSemiMetric (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isPreMetric : IsPreMetric d
0⇒≈ : Indiscernable _≈ₐ_ _≈ᵢ_ d 0#
 
open IsPreMetric isPreMetric public
 
------------------------------------------------------------------------
-- Semi-metrics
 
record IsSemiMetric (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isQuasiSemiMetric : IsQuasiSemiMetric d
sym : Symmetric _≈ᵢ_ d
 
open IsQuasiSemiMetric isQuasiSemiMetric public
 
------------------------------------------------------------------------
-- General metrics
 
-- A general metric obeys a generalised form of the triangle inequality.
-- It can be specialised to a standard metric/ultrametric/inframetric
-- etc. by providing the correct operator.
--
-- Furthermore we do not assume that _∙_ & 0# form a monoid as
-- associativity does not hold for p-relaxed metrics/p-inframetrics and
-- the identity laws do not hold for ultrametrics over negative
-- codomains.
--
-- See "Properties of distance spaces with power triangle inequalities"
-- by Daniel J. Greenhoe, 2016 (arXiv)
 
record IsGeneralMetric (_∙_ : Op₂ I) (d : DistanceFunction A I)
: Set (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃) where
field
isSemiMetric : IsSemiMetric d
triangle : TriangleInequality _≤_ _∙_ d
 
open IsSemiMetric isSemiMetric public