Library interfaces.ConcreteCategory
Require Export interfaces.Category.
Require Import FunctionalExtensionality.
Require Import ProofIrrelevance.
Require Import FunctionalExtensionality.
Require Import ProofIrrelevance.
Mathematical structures and enrichment
Concrete categories
Definition
First, we must define a typeclass which provides the extra
structure for a given set. This should consist of any constants,
operations and relations for the structure of interest, together
with the axioms they must satisfy.
Then, we must give the properties satisfied by structure-
preserving functions. These properties should be satisfied by
identity functions and preserved by composition.
Parameter Morphism : ∀ {A B} `{Structure A} `{Structure B}, (A → B) → Prop.
Existing Class Morphism.
Axiom id_mor :
∀ `{Structure}, Morphism (fun x ⇒ x).
Axiom compose_mor :
∀ {A B C} `{Structure A} `{Structure B} `{Structure C} (g: B → C) (f: A → B),
Morphism g →
Morphism f →
Morphism (fun x ⇒ g (f x)).
End ConcreteCategoryDefinition.
The unbundled form of mathematical structures is flexible, for
example we use it below to formulate enrichment as a supplementary
structure on an existing category. However we can also derive a
bundled form to use in cases where the unbundled form is too
cumbersome, and to equip a ConcreteCategory with the standard
Category interface.
Objects
Record structured_set :=
mkt {
carrier :> Type;
structure : C.Structure carrier
}.
Arguments mkt _ {_}.
Definition t := structured_set.
Identity Coercion tss : t >-> structured_set.
Record structured_map (A B : t) :=
mkm {
apply :> A → B;
morphism : C.Morphism apply
}.
Arguments mkm {_ _} _ {_}.
Definition m A B := structured_map A B.
Identity Coercion msm : m >-> structured_map.
Lemma meq {A B} (f g : m A B) :
(∀ x, f x = g x) → f = g.
Definition id A : m A A :=
mkm (fun x ⇒ x).
Definition compose {A B C} (g : m B C) (f : m A B) : m A C :=
mkm (fun x ⇒ g (f x)).
Lemma compose_id_left {A B} (f : m A B) :
compose (id B) f = f.
Lemma compose_id_right {A B} (f : m A B) :
compose f (id A) = f.
Lemma compose_assoc {A B C D} (f : m A B) (g : m B C) (h : m C D) :
compose (compose h g) f = compose h (compose g f).
Basic instances
Module cSET <: ConcreteCategory.
Definition Structure (X : Type) := unit.
Existing Class Structure.
Definition Morphism {A B} `{Structure A} `{Structure B} (f : A → B) := True.
Existing Class Morphism.
Global Instance id_mor `{Structure} :
Morphism (fun x ⇒ x).
Global Instance compose_mor {A B C} `{Structure A} `{Structure B} `{Structure C} :
∀ (g : B → C) (f : A → B),
Morphism g →
Morphism f →
Morphism (fun x ⇒ g (f x)).
Include ConcreteCategoryTheory.
End cSET.
Enrichment
Module Type Enriched (V : ConcreteCategoryDefinition) (C : CategoryDefinition).
Parameter hom_structure : ∀ (X Y : C.t), V.Structure (C.m X Y).
Axiom compose_mor_l :
∀ {A B C} (f : C.m A B),
V.Morphism (fun g : C.m B C ⇒ C.compose g f).
Axiom compose_mor_r :
∀ {A B C} (g : C.m B C),
V.Morphism (fun f : C.m A B ⇒ C.compose g f).
End Enriched.