Library HoTT.Categories.Category.Objects
Require Import Category.Core Category.Morphisms.
Set Universe Polymorphism.
Set Implicit Arguments.
Generalizable All Variables.
Set Asymmetric Patterns.
Local Open Scope category_scope.
Local Open Scope morphism_scope.
Set Universe Polymorphism.
Set Implicit Arguments.
Generalizable All Variables.
Set Asymmetric Patterns.
Local Open Scope category_scope.
Local Open Scope morphism_scope.
Definition unique_up_to_unique_isomorphism (C : PreCategory) (P : C → Type) :=
∀ x (_ : P x) x' (_ : P x'),
{ c : Contr (morphism C x x')
| IsIsomorphism (center (morphism C x x')) }.
Notation IsTerminalObject C x :=
(∀ x' : object C, Contr (morphism C x' x)).
Record TerminalObject (C : PreCategory) :=
{
object_terminal :> C;
isterminal_object_terminal :> IsTerminalObject C object_terminal
}.
Global Existing Instance isterminal_object_terminal.
(∀ x' : object C, Contr (morphism C x' x)).
Record TerminalObject (C : PreCategory) :=
{
object_terminal :> C;
isterminal_object_terminal :> IsTerminalObject C object_terminal
}.
Global Existing Instance isterminal_object_terminal.
Notation IsInitialObject C x :=
(∀ x' : object C, Contr (morphism C x x')).
Record InitialObject (C : PreCategory) :=
{
object_initial :> C;
isinitial_object_initial :> IsInitialObject C object_initial
}.
Global Existing Instance isinitial_object_initial.
Arguments unique_up_to_unique_isomorphism [C] P.
(∀ x' : object C, Contr (morphism C x x')).
Record InitialObject (C : PreCategory) :=
{
object_initial :> C;
isinitial_object_initial :> IsInitialObject C object_initial
}.
Global Existing Instance isinitial_object_initial.
Arguments unique_up_to_unique_isomorphism [C] P.
Section CategoryObjectsTheorems.
Variable C : PreCategory.
Local Ltac unique :=
repeat first [ intro
| ∃ _
| ∃ (center (morphism C _ _))
| etransitivity; [ symmetry | ]; apply contr ].
Variable C : PreCategory.
Local Ltac unique :=
repeat first [ intro
| ∃ _
| ∃ (center (morphism C _ _))
| etransitivity; [ symmetry | ]; apply contr ].
The terminal object is unique up to unique isomorphism.
Theorem terminal_object_unique
: unique_up_to_unique_isomorphism (fun x ⇒ IsTerminalObject C x).
Proof.
unique.
Qed.
: unique_up_to_unique_isomorphism (fun x ⇒ IsTerminalObject C x).
Proof.
unique.
Qed.
The initial object is unique up to unique isomorphism.
Theorem initial_object_unique
: unique_up_to_unique_isomorphism (fun x ⇒ IsInitialObject C x).
Proof.
unique.
Qed.
End CategoryObjectsTheorems.
: unique_up_to_unique_isomorphism (fun x ⇒ IsInitialObject C x).
Proof.
unique.
Qed.
End CategoryObjectsTheorems.