Skip to content

Commit 7d840b4

Browse files
author
Paolo Torrini
committed
changes in encatI0.v
1 parent 0751b4a commit 7d840b4

File tree

1 file changed

+212
-5
lines changed

1 file changed

+212
-5
lines changed

theories/encatI0.v

Lines changed: 212 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,19 +1332,222 @@ Definition comm_triangle {Q: precat} {A B C: Q}
13321332
(h: A ~> C) (f: A ~> B) (g: B ~> C) : Prop :=
13331333
h = f \; g.
13341334

1335-
Record GMedArrow {Q: precat} {L R T: Q}
1336-
(l: L ~> T) (r: R ~> T)
1337-
(P: forall (B: Q) (p1: B ~> L) (p2: B ~> R), Type)
1338-
{B: Q} (p1: B ~> L) (p2: B ~> R) {B0: Q}
1335+
Record GMedArrow {Q: precat}
1336+
(* cospan *)
1337+
{L R T: Q} (l: L ~> T) (r: R ~> T)
1338+
(* span (for the pullback) *)
1339+
{B: Q} (p1: B ~> L) (p2: B ~> R)
1340+
(* another object *)
1341+
{B0: Q}
1342+
(* mediating morphism from B0 to B *)
13391343
(m: B0 ~> B) := {
13401344
gmedarrow_prop : forall (p01: B0 ~> L) (p02: B0 ~> R),
1341-
P B0 p01 p02 -> comm_triangle p01 m p1 /\ comm_triangle p02 m p2
1345+
@comm_square Q L R T l r B0 p01 p02 ->
1346+
comm_triangle p01 m p1 /\ comm_triangle p02 m p2
13421347
}.
13431348

13441349
(************************************************************************)
13451350

13461351
(* PULLBACKS *)
13471352

1353+
(* Span pinned to an object *)
1354+
HB.mixin Record IsPSpan {Q: precat}
1355+
{L R T: Q} (l: L ~> T) (r: R ~> T) (B: Q) : Type := {
1356+
lprj : B ~> L ;
1357+
rprj : B ~> R
1358+
}.
1359+
#[short(type="pspan"), verbose]
1360+
HB.structure Definition PSpan {Q: precat}
1361+
{L R T : Q} (l: L ~> T) (r: R ~> T) :=
1362+
{ B of IsPSpan Q L R T l r B }.
1363+
1364+
Definition medarrow_prop {Q: precat} {L R T: Q}
1365+
(l: L ~> T) (r: R ~> T)
1366+
(B: @pspan Q L R T l r)
1367+
{B0: Q} (m: B0 ~> PSpan.sort B) : Prop :=
1368+
@GMedArrow Q L R T l r B lprj rprj B0 m.
1369+
1370+
Definition has_medarrow {Q: precat} {L R T: Q}
1371+
(l: L ~> T) (r: R ~> T)
1372+
(B: @pspan Q L R T l r)
1373+
(B0: Q) : Type := sigma m, @medarrow_prop Q L R T l r B B0 m.
1374+
1375+
Definition medarrow_is_unique {Q: precat} {L R T: Q}
1376+
(l: L ~> T) (r: R ~> T)
1377+
(B: @pspan Q L R T l r) {B0: Q} : Prop :=
1378+
forall (m m': B0 ~> PSpan.sort B),
1379+
@medarrow_prop Q L R T l r B B0 m ->
1380+
@medarrow_prop Q L R T l r B B0 m' -> m = m'.
1381+
1382+
HB.mixin Record IsPrePBack (Q: precat) (L R T: Q) (l: L ~> T) (r: R ~> T)
1383+
(B: Q) of IsPSpan Q L R T l r B : Type := {
1384+
comm_sq : comm_square l r (@lprj Q L R T l r B) rprj ;
1385+
}.
1386+
#[short(type="prepback"), verbose]
1387+
HB.structure Definition PrePBack (Q: precat)
1388+
(L R T : Q) (l: L ~> T) (r: R ~> T) :=
1389+
{ B of IsPrePBack Q L R T l r B & }.
1390+
1391+
HB.status.
1392+
(* BUG: IsPrePBack -> IsPSpan missing down here? It is there before *)
1393+
#[verbose]
1394+
HB.mixin Record IsPBack (Q: precat) (L R T: Q) (l: L ~> T) (r: R ~> T)
1395+
(B: Q) of (*IsPrePBack Q L R T l r B*) PrePBack Q l r B : Type := {
1396+
has_umarrow : forall B0: Q, @has_medarrow Q L R T l r B B0
1397+
* @medarrow_is_unique Q L R T l r B B0
1398+
}.
1399+
#[short(type="pback"), verbose]
1400+
HB.structure Definition PBack (Q: precat)
1401+
{L R T : Q} (l: L ~> T) (r: R ~> T) :=
1402+
{ B of IsPBack Q L R T l r B }.
1403+
1404+
(*
1405+
(* packs all the definition together *)
1406+
HB.mixin Record IsPBack2 (Q: precat) (L R T: Q) (l: L ~> T) (r: R ~> T)
1407+
(B: @pspan Q L R T l r) : Type := {
1408+
comm_sq : comm_square l r (@lprj Q L R T l r B) rprj ;
1409+
has_umarrow : forall B0: Q, @has_medarrow Q L R T l r B B0
1410+
* @medarrow_is_unique Q L R T l r B B0
1411+
}.
1412+
#[short(type="pback2"), verbose]
1413+
HB.structure Definition PBack2 (Q: precat)
1414+
{L R T : Q} (l: L ~> T) (r: R ~> T) :=
1415+
{ B of IsPBack2 Q L R T l r B }.
1416+
*)
1417+
1418+
(***********************************************************************)
1419+
1420+
(*** CATEGORIES WITH PULLBACKS *)
1421+
1422+
(* category with all pullbacks *)
1423+
HB.mixin Record HasPBKop C of Cat C := {
1424+
pbkop : forall {L R T: C} (l: L ~> T) (r: R ~> T), C
1425+
}.
1426+
#[short(type="pbkop")]
1427+
HB.structure Definition PBKop :=
1428+
{C of HasPBKop C & PreCat C }.
1429+
1430+
#[wrapper]
1431+
HB.mixin Record HasPreSpanCat C of PBKop C : Type := {
1432+
has_prespan : forall {L R T: C} (l: L ~> T) (r: R ~> T),
1433+
@IsPSpan C L R T l r (@pbkop C L R T l r)
1434+
}.
1435+
#[short(type="prespancat")]
1436+
HB.structure Definition PreSpanCat :=
1437+
{C of HasPreSpanCat C}.
1438+
1439+
#[wrapper]
1440+
HB.mixin Record HasPrePBKcat C of PreSpanCat C : Type := {
1441+
has_prepbk : forall {L R T: C} (l: L ~> T) (r: R ~> T),
1442+
@IsPrePBack C L R T l r (@pbkop C L R T l r)
1443+
}.
1444+
#[short(type="prepbkcat")]
1445+
HB.structure Definition PrePBKcat :=
1446+
{C of HasPrePBKcat C}.
1447+
1448+
(* category with all pullbacks *)
1449+
#[wrapper]
1450+
HB.mixin Record HasPBKcat C of PrePBKcat C := {
1451+
has_pbk : forall {L R T: C} (l: L ~> T) (r: R ~> T),
1452+
@IsPBack C L R T l r (@pbkop C L R T l r)
1453+
}.
1454+
#[short(type="pbkcat")]
1455+
HB.structure Definition PBKcat :=
1456+
{C of HasPBKcat C & PreCat C }.
1457+
1458+
(*
1459+
(* on the other hand, this works... *)
1460+
#[wrapper]
1461+
HB.mixin Record HasPBK2cat C of PBKop C := {
1462+
is_gpbk2 : forall {L R T: C} (l: L ~> T) (r: R ~> T),
1463+
@IsPBack2 C L R T l r (@pbkop C L R T l r)
1464+
}.
1465+
#[short(type="pbk2cat")]
1466+
HB.structure Definition PBK2cat :=
1467+
{C of HasPBK2cat C & PreCat C }.
1468+
*)
1469+
1470+
(***********************************************************************)
1471+
1472+
HB.mixin Record isInternalHom {C: quiver} (C0 : C) (C1 : obj C) := {
1473+
src : C1 ~> C0; tgt : C1 ~> C0
1474+
}.
1475+
#[short(type="iHom")]
1476+
HB.structure Definition InternalHom {C: quiver} (C0 : C) :=
1477+
{ C1 of isInternalHom C C0 C1 }.
1478+
1479+
Notation "X ':>' C" := (X : obj C) (at level 60, C at next level).
1480+
1481+
Definition iprod {C: pbkcat} {C0 : C} (X Y : iHom C0) : C :=
1482+
(* pspan (@tgt C C0 (X :> C)) (@src C C0 (Y :> C)) := *)
1483+
@pbkop C (X :> C) (Y :> C) C0 (tgt : (X :> C) ~> C0) (src : (Y :> C) ~> C0).
1484+
1485+
(* could be problematic... *)
1486+
Program Definition iprod_pspan {C: pbkcat} {C0 : obj C} (X Y : iHom C0) :
1487+
pspan (@tgt C C0 (X :> C)) (@src C C0 (Y :> C)).
1488+
set (x := @iprod C C0 X Y).
1489+
destruct C.
1490+
destruct class as [A0 A1 A2 A3 A4 A5 A6].
1491+
destruct A4 as [IM].
1492+
econstructor.
1493+
econstructor.
1494+
eapply IM.
1495+
Defined.
1496+
1497+
Program Definition iprod_pbk {C: pbkcat} {C0 : obj C} (X Y : iHom C0) :
1498+
pback (@tgt C C0 (X :> C)) (@src C C0 (Y :> C)).
1499+
set (x := @iprod C C0 X Y).
1500+
destruct C.
1501+
destruct class as [A0 A1 A2 A3 A4 A5 A6].
1502+
destruct A6 as [IM].
1503+
econstructor.
1504+
econstructor.
1505+
eapply IM.
1506+
Defined.
1507+
1508+
Notation "X *_ C0 Y" := (@iprod _ C0 (X : iHom C0) (Y : iHom C0))
1509+
(at level 99, C0 at level 0, only parsing) : encat_scope.
1510+
Notation "X *_ C0 Y" := (@iprod _ C0 X Y)
1511+
(at level 99, C0 at level 0) : cat_scope.
1512+
1513+
(*** PROBLEMATIC *)
1514+
(* left and right projection morphisms of the product *)
1515+
Program Definition iprodl {C: pbkcat} {C0 : C} (X Y : iHom C0) :
1516+
X *_C0 Y ~> (X :> C).
1517+
remember C as C'.
1518+
destruct C'.
1519+
destruct class as [A0 A1 A2 A3 A4 A5 A6].
1520+
destruct A4 as [IM].
1521+
destruct X as [J1 J2].
1522+
destruct Y as [I1 I2].
1523+
simpl in *.
1524+
simpl.
1525+
unfold iprod.
1526+
simpl.
1527+
(* specialize (IM J1 I1 C0). *)
1528+
Admitted.
1529+
Fail Definition iprodr {C: pbcat} {C0 : C} (X Y : iHom C0) :
1530+
X *_C0 Y ~> (Y :> C) := bot2right (iprod_pb X Y).
1531+
1532+
Definition iprod_iHom {C: pbkcat} {C0: C} (X Y: @iHom C C0) :
1533+
@isInternalHom C C0 (X *_C0 Y) :=
1534+
@isInternalHom.Build C C0 (X *_C0 Y)
1535+
((iprodl X Y) \; src)
1536+
((iprodr X Y) \; tgt).
1537+
1538+
HB.instance Definition iprod_iHom' {C: pbcat} {C0: C} (X Y: @iHom C C0) :
1539+
@isInternalHom C C0 (X *_C0 Y) := iprod_iHom X Y.
1540+
1541+
(* the product as (iHom C0) object *)
1542+
Definition pbC0 (C : pbcat) (C0 : C) (X Y : iHom C0) : iHom C0 :=
1543+
(X *_C0 Y) : iHom C0.
1544+
1545+
1546+
1547+
(*** OLDER VERSION, not good *************************************)
1548+
1549+
(* PULLBACKS *)
1550+
13481551
(* Span pinned to an object *)
13491552
HB.mixin Record IsPSpan {Q: precat} {L R T: Q}
13501553
(l: L ~> T) (r: R ~> T) (B: Q) : Type := {
@@ -1475,6 +1678,10 @@ Notation "X *_ C0 Y" := (@iprod _ C0 (X : iHom C0) (Y : iHom C0))
14751678
Notation "X *_ C0 Y" := (@iprod _ C0 X Y)
14761679
(at level 99, C0 at level 0) : cat_scope.
14771680

1681+
1682+
(*** END OF IT *)
1683+
1684+
14781685
(*
14791686
HB.mixin Record IsPBkObj {Q: precat} {L R T: Q}
14801687
(l: L ~> T) (r: R ~> T) (B: Q) : Type := {

0 commit comments

Comments
 (0)