Import EqNotations.Require Import preorder.From Stdlib Require Import Logic.ProofIrrelevance.Set Printing Universes.Recordcategory_data : Type :=
make_category_data {
ob :> Type;
hom : ob -> ob -> Type;
identity {x} : hom x x;
comp {x y z} :
hom y z ->
hom x y ->
hom x z;
}.
Recordcategory_data
: Type@{max(category_data.u0+1,category_data.u1+1)} := make_category_data
{ ob : Type@{category_data.u0};
hom : ob -> ob -> Type@{category_data.u1};
identity : forallx : ob, hom x x;
comp : forallxyz : ob, hom y z -> hom x y -> hom x z }.
Arguments make_category_data ob%_type_scope
(hom identity comp)%_function_scope
Arguments ob c
Arguments hom c _ _
Arguments identity c {x}
Arguments comp c {x y z} _ _
Definitionid {C : category_data} {x}
: C.(hom) x x :=
identity C.Notation"C [ g +++ f ]" := (comp C g f) (at level1).Notation"g ∘ f" := (comp _ g f) (at level50).Notation"C [ a , b ]" := (hom C a b) (at level1).
Recordis_category (C : category_data) : Prop :=
make_is_category {
lunit {a b} {f : C [ a , b ]}
: id ∘ f = f;
runit {a b} {f : C [ a , b ]}
: f ∘ id = f;
assoc {a b c d}
{f : C [ a , b ]}
{g : C [ b , c ]}
{h : C [ c , d ]}
: (h ∘ g) ∘ f = h ∘ (g ∘ f);
}.Recordcategory : Type :=
make_category {
C :> category_data;
C_is_category :> is_category C;
}.SectionCategories.VariableC : category.Variableabc : C.Variablef : C.(hom) a b.Variableg : C.(hom) b c.
id
: C [a, a]
g ∘ f
: C [a, c]
EndCategories.
P: preordered_type
category_data
P: preordered_type
category_data
P: preordered_type
Type@{category_data.u0}
P: preordered_type
?ob -> ?ob -> Type@{category_data.u1}
P: preordered_type
forallx : ?ob, ?hom x x
P: preordered_type
forallxyz : ?ob, ?hom y z -> ?hom x y -> ?hom x z
P: preordered_type
Type@{category_data.u0}
exact P.
P: preordered_type
P -> P -> Type@{category_data.u1}
P: preordered_type x, y: P
Type@{category_data.u1}
exact (P.(preorder_on_A).(R) x y).
P: preordered_type
forallx : P, (funx0y : P => preorder_on_A P x0 y) x x
P: preordered_type
forallx : P, preorder_on_A P x x
P: preordered_type x: P
preorder_on_A P x x
apply (P.(preorder_on_A).(refl)).
P: preordered_type
forallxyz : P,
(funx0y0 : P => preorder_on_A P x0 y0) y z ->
(funx0y0 : P => preorder_on_A P x0 y0) x y ->
(funx0y0 : P => preorder_on_A P x0 y0) x z
P: preordered_type
forallxyz : P,
preorder_on_A P y z -> preorder_on_A P x y -> preorder_on_A P x z
P: preordered_type x, y, z: P H: preorder_on_A P y z H0: preorder_on_A P x y
Recorddisplayed_category_data
(C : category_data)
: Type :=
make_displayed_category_data {
d_ob :> C.(ob) -> Type;
d_hom {a b} (f : C[a, b])
: d_ob a -> d_ob b -> Type;
d_identity {a} {x : d_ob a}
: d_hom id x x;
d_comp {a b c} {x y z}
{g : C[b, c]}
{f : C[a, b]}
(g' : d_hom g y z)
(f' : d_hom f x y)
: d_hom (g ∘ f) x z;
}.
Recorddisplayed_category_data (C : category_data)
: Type@{max(category_data.u0,category_data.u1,displayed_category_data.u0+1,displayed_category_data.u1+1)} := make_displayed_category_data
{ d_ob : C -> Type@{displayed_category_data.u0};
d_hom : forallab : C,
C [a, b] -> d_ob a -> d_ob b -> Type@{displayed_category_data.u1};
d_identity : forall (a : C) (x : d_ob a), d_hom a a id x x;
d_comp : forall (abc : C) (x : d_ob a) (y : d_ob b)
(z : d_ob c) (g : C [b, c]) (f : C [a, b]),
d_hom b c g y z -> d_hom a b f x y -> d_hom a c (g ∘ f) x z }.
Arguments displayed_category_data C
Arguments make_displayed_category_data C
(d_ob d_hom d_identity d_comp)%_function_scope
Arguments d_ob C d _
Arguments d_hom C d {a b} f _ _
Arguments d_identity C d {a x}
Arguments d_comp C d {a b c x y z g f} g' f'
Definitiond_id
{C : category_data}
{D : displayed_category_data C}
{a}
{x : D.(d_ob _) a}
: D.(d_hom _) id x x :=
d_identity C D.Notation"D [ g +++' f ]" := (d_comp _ D g f) (at level1).Notation"g' ∘' f'" := (d_comp _ _ g' f') (at level50).Notation"D [ f | x , y ]" := (d_hom _ D f x y) (at level1).
Definitioneq_dep
{A : Type}
(P : A -> Type)
{ab : A}
(e : a = b)
(x : P a)
(y : P b)
: Prop :=
(rew [P] e in x) = y.Recordis_displayed_category
(C : category)
(D : displayed_category_data C)
: Prop :=
make_is_displayed_category {
d_lunit
{a b}
{f : C [ a , b ]}
{x y}
{f' : D [ f | x , y ]}
:
eq_dep
(funr => D [ r | x , y ])
(C.(lunit _))
(d_id ∘' f')
f';
d_runit
{a b}
{f : C [ a , b ]}
{x y}
{f' : D [ f | x , y ]}
:
eq_dep
(funr => D [ r | x , y ])
(C.(runit _))
(f' ∘' d_id)
f';
d_assoc
{a b c d}
{f : C [ a , b ]}
{g : C [ b , c ]}
{h : C [ c , d ]}
{w x y z}
{f' : D [ f | w , x ]}
{g' : D [ g | x , y ]}
{h' : D [ h | y , z ]}
:
eq_dep
(funr => D [ r | w , z ])
(C.(assoc _))
((h' ∘' g') ∘' f')
(h' ∘' (g' ∘' f'));
}.
Recordis_displayed_category (C : category) (D : displayed_category_data C)
: Prop := make_is_displayed_category
{ d_lunit : forall (ab : C) (f : C [a, b]) (x : D a)
(y : D b) (f' : D [f | x, y]),
eq_dep (funr : C [a, b] => D [r | x, y])
(lunit C C) (d_id ∘' f') f';
d_runit : forall (ab : C) (f : C [a, b]) (x : D a)
(y : D b) (f' : D [f | x, y]),
eq_dep (funr : C [a, b] => D [r | x, y])
(runit C C) (f' ∘' d_id) f';
d_assoc : forall (abcd : C) (f : C [a, b])
(g : C [b, c]) (h : C [c, d]) (w : D a)
(x : D b) (y : D c) (z : D d) (f' : D [f | w, x])
(g' : D [g | x, y]) (h' : D [h | y, z]),
eq_dep (funr : C [a, d] => D [r | w, z])
(assoc C C) ((h' ∘' g') ∘' f') (h' ∘' (g' ∘' f')) }.
Arguments is_displayed_category C D
Arguments make_is_displayed_category C D
(d_lunit d_runit d_assoc)%_function_scope
Arguments d_lunit C D i {a b f x y f'}
Arguments d_runit C D i {a b f x y f'}
Arguments d_assoc C D i {a b c d f g h w x y z f' g' h'}
C: category_data D: displayed_category_data C
category_data
C: category_data D: displayed_category_data C
category_data
C: category_data D: displayed_category_data C
Type@{category_data.u0}
C: category_data D: displayed_category_data C
?ob -> ?ob -> Type@{category_data.u1}
C: category_data D: displayed_category_data C
forallx : ?ob, ?hom x x
C: category_data D: displayed_category_data C
forallxyz : ?ob, ?hom y z -> ?hom x y -> ?hom x z
C: category_data D: displayed_category_data C
Type@{category_data.u0}
exact ({a : C & D a}).
C: category_data D: displayed_category_data C
{a : C & D a} -> {a : C & D a} -> Type@{category_data.u1}
exact (funab =>
{ f : C[projT1 a, projT1 b]
& D[f|projT2 a, projT2 b]
}
).
C: category_data D: displayed_category_data C
forallx : {a : C & D a},
(fun (a : {a : C & D a}) (b : {a0 : C & D a0}) =>
{f : C [projT1 a, projT1 b] & D [f | projT2 a, projT2 b]}) x x
C: category_data D: displayed_category_data C
forallx : {a : C & D a},
{f : C [projT1 x, projT1 x] & D [f | projT2 x, projT2 x]}
exact (funa => existT _ id d_id).
C: category_data D: displayed_category_data C
forallxyz : {a : C & D a},
(fun (a : {a : C & D a}) (b : {a0 : C & D a0}) =>
{f : C [projT1 a, projT1 b] & D [f | projT2 a, projT2 b]}) y z ->
(fun (a : {a : C & D a}) (b : {a0 : C & D a0}) =>
{f : C [projT1 a, projT1 b] & D [f | projT2 a, projT2 b]}) x y ->
(fun (a : {a : C & D a}) (b : {a0 : C & D a0}) =>
{f : C [projT1 a, projT1 b] & D [f | projT2 a, projT2 b]}) x z
C: category_data D: displayed_category_data C
forallxyz : {a : C & D a},
{f : C [projT1 y, projT1 z] & D [f | projT2 y, projT2 z]} ->
{f : C [projT1 x, projT1 y] & D [f | projT2 x, projT2 y]} ->
{f : C [projT1 x, projT1 z] & D [f | projT2 x, projT2 z]}
exact (funabcgf => existT _ (C[projT1 g +++ projT1 f]) (D[projT2 g +++' projT2 f])).Defined.
C: category D: displayed_category_data C
is_displayed_category C D -> is_category (total_category_data C D)
C: category D: displayed_category_data C
is_displayed_category C D -> is_category (total_category_data C D)
C: category D: displayed_category_data C H: is_displayed_category C D
is_category (total_category_data C D)
C: category D: displayed_category_data C H: is_displayed_category C D
forall (ab : total_category_data C D) (f : (total_category_data C D) [a, b]),
id ∘ f = f
C: category D: displayed_category_data C H: is_displayed_category C D
forall (ab : total_category_data C D) (f : (total_category_data C D) [a, b]),
f ∘ id = f
C: category D: displayed_category_data C H: is_displayed_category C D
forall (abcd : total_category_data C D)
(f : (total_category_data C D) [a, b])
(g : (total_category_data C D) [b, c])
(h : (total_category_data C D) [c, d]),
(h ∘ g) ∘ f = h ∘ (g ∘ f)
C: category D: displayed_category_data C H: is_displayed_category C D
forall (ab : total_category_data C D) (f : (total_category_data C D) [a, b]),
id ∘ f = f
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
id
∘ existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) a x),
projT1 (existT (funa0 : C => D a0) b y)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) a x),
projT2 (existT (funa0 : C => D a0) b y)])
f f' =
existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) a x),
projT1 (existT (funa0 : C => D a0) b y)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) a x),
projT2 (existT (funa0 : C => D a0) b y)])
f f'
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
existT (funf0 : C [a, b] => D [f0 | x, y]) (id ∘ f) (d_id ∘' f') =
existT (funf0 : C [a, b] => D [f0 | x, y]) f f'
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
id ∘ f = f
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
rew [funa0 : C [a, b] => D [a0 | x, y]] ?Goal1in (d_id ∘' f') = f'
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
id ∘ f = f
apply C.(lunit _).
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
rew [funa0 : C [a, b] => D [a0 | x, y]] lunit C C in (d_id ∘' f') = f'
apply H.(d_lunit _ _).
C: category D: displayed_category_data C H: is_displayed_category C D
forall (ab : total_category_data C D) (f : (total_category_data C D) [a, b]),
f ∘ id = f
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) a x),
projT1 (existT (funa0 : C => D a0) b y)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) a x),
projT2 (existT (funa0 : C => D a0) b y)])
f f'
∘ id =
existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) a x),
projT1 (existT (funa0 : C => D a0) b y)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) a x),
projT2 (existT (funa0 : C => D a0) b y)])
f f'
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
existT (funf0 : C [a, b] => D [f0 | x, y]) (f ∘ id) (f' ∘' d_id) =
existT (funf0 : C [a, b] => D [f0 | x, y]) f f'
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
f ∘ id = f
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
rew [funa0 : C [a, b] => D [a0 | x, y]] ?Goal0in (f' ∘' d_id) = f'
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
f ∘ id = f
apply C.(runit _).
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)]
rew [funa0 : C [a, b] => D [a0 | x, y]] runit C C in (f' ∘' d_id) = f'
apply H.(d_runit _ _).
C: category D: displayed_category_data C H: is_displayed_category C D
forall (abcd : total_category_data C D)
(f : (total_category_data C D) [a, b])
(g : (total_category_data C D) [b, c])
(h : (total_category_data C D) [c, d]),
(h ∘ g) ∘ f = h ∘ (g ∘ f)
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b c: C z: D c d: C w: D d
forall
(f : (total_category_data C D) [existT (funa0 : C => D a0) a x,
existT (funa0 : C => D a0) b y])
(g : (total_category_data C D) [existT (funa0 : C => D a0) b y,
existT (funa0 : C => D a0) c z])
(h : (total_category_data C D) [existT (funa0 : C => D a0) c z,
existT (funa0 : C => D a0) d w]),
(h ∘ g) ∘ f = h ∘ (g ∘ f)
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b c: C z: D c d: C w: D d f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)] g: C [projT1 (existT (funa : C => D a) b y),
projT1 (existT (funa : C => D a) c z)] g': D [g | projT2 (existT (funa : C => D a) b y),
projT2 (existT (funa : C => D a) c z)] h: C [projT1 (existT (funa : C => D a) c z),
projT1 (existT (funa : C => D a) d w)] h': D [h | projT2 (existT (funa : C => D a) c z),
projT2 (existT (funa : C => D a) d w)]
(existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) c z),
projT1 (existT (funa0 : C => D a0) d w)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) c z),
projT2 (existT (funa0 : C => D a0) d w)])
h h'
∘ existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) b y),
projT1 (existT (funa0 : C => D a0) c z)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) b y),
projT2 (existT (funa0 : C => D a0) c z)])
g g')
∘ existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) a x),
projT1 (existT (funa0 : C => D a0) b y)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) a x),
projT2 (existT (funa0 : C => D a0) b y)])
f f' =
existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) c z),
projT1 (existT (funa0 : C => D a0) d w)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) c z),
projT2 (existT (funa0 : C => D a0) d w)])
h h'
∘ (existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) b y),
projT1 (existT (funa0 : C => D a0) c z)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) b y),
projT2 (existT (funa0 : C => D a0) c z)])
g g'
∘ existT
(funf0 : C [projT1 (existT (funa0 : C => D a0) a x),
projT1 (existT (funa0 : C => D a0) b y)] =>
D [f0 | projT2 (existT (funa0 : C => D a0) a x),
projT2 (existT (funa0 : C => D a0) b y)])
f f')
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b c: C z: D c d: C w: D d f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)] g: C [projT1 (existT (funa : C => D a) b y),
projT1 (existT (funa : C => D a) c z)] g': D [g | projT2 (existT (funa : C => D a) b y),
projT2 (existT (funa : C => D a) c z)] h: C [projT1 (existT (funa : C => D a) c z),
projT1 (existT (funa : C => D a) d w)] h': D [h | projT2 (existT (funa : C => D a) c z),
projT2 (existT (funa : C => D a) d w)]
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b c: C z: D c d: C w: D d f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)] g: C [projT1 (existT (funa : C => D a) b y),
projT1 (existT (funa : C => D a) c z)] g': D [g | projT2 (existT (funa : C => D a) b y),
projT2 (existT (funa : C => D a) c z)] h: C [projT1 (existT (funa : C => D a) c z),
projT1 (existT (funa : C => D a) d w)] h': D [h | projT2 (existT (funa : C => D a) c z),
projT2 (existT (funa : C => D a) d w)]
(h ∘ g) ∘ f = h ∘ (g ∘ f)
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b c: C z: D c d: C w: D d f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)] g: C [projT1 (existT (funa : C => D a) b y),
projT1 (existT (funa : C => D a) c z)] g': D [g | projT2 (existT (funa : C => D a) b y),
projT2 (existT (funa : C => D a) c z)] h: C [projT1 (existT (funa : C => D a) c z),
projT1 (existT (funa : C => D a) d w)] h': D [h | projT2 (existT (funa : C => D a) c z),
projT2 (existT (funa : C => D a) d w)]
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b c: C z: D c d: C w: D d f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)] g: C [projT1 (existT (funa : C => D a) b y),
projT1 (existT (funa : C => D a) c z)] g': D [g | projT2 (existT (funa : C => D a) b y),
projT2 (existT (funa : C => D a) c z)] h: C [projT1 (existT (funa : C => D a) c z),
projT1 (existT (funa : C => D a) d w)] h': D [h | projT2 (existT (funa : C => D a) c z),
projT2 (existT (funa : C => D a) d w)]
(h ∘ g) ∘ f = h ∘ (g ∘ f)
apply C.(assoc _).
C: category D: displayed_category_data C H: is_displayed_category C D a: C x: D a b: C y: D b c: C z: D c d: C w: D d f: C [projT1 (existT (funa : C => D a) a x),
projT1 (existT (funa : C => D a) b y)] f': D [f | projT2 (existT (funa : C => D a) a x),
projT2 (existT (funa : C => D a) b y)] g: C [projT1 (existT (funa : C => D a) b y),
projT1 (existT (funa : C => D a) c z)] g': D [g | projT2 (existT (funa : C => D a) b y),
projT2 (existT (funa : C => D a) c z)] h: C [projT1 (existT (funa : C => D a) c z),
projT1 (existT (funa : C => D a) d w)] h': D [h | projT2 (existT (funa : C => D a) c z),
projT2 (existT (funa : C => D a) d w)]
rew [funa0 : C [a, d] => D [a0 | x, w]] assoc C C in ((h' ∘' g') ∘' f') =
h' ∘' (g' ∘' f')