-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basics of (oo,n)-categories #1302
base: master
Are you sure you want to change the base?
Conversation
|
Bah |
I've been thinking for a while that it might be better to rename |
This is why I always fully qualify everything. Note that I have a tool that should be able to do this automatically, if so desired. |
Co-Authored-By: Jason Gross <[email protected]>
cate_compose_temp has a universe error on one of the jobs. I suspect this is a coq bug. |
Exactly which coherence is this? Might it be possible to coinductively add the necessary coherence?
Is there any point defining one in terms of the other? Why not just define them separately?
Well I don't think that is the correct way to do finite dimensional cells. We are in HoTT, which means every type comes equipped with a full oo-groupoid structure. I would rather that "finite dimensional" categories begin using regular paths as higher cells. Then we can always characterize the action of functions on paths anyway using ap. So if I were to define a 2-cat X as some oo-cat, I would define the two dimensions and then say the higher cells are just paths. When I construct functors X -> Y, then I need only supply the action on the first two dimensions since the action on paths is always given. In general I think this is cool. It is a bit scary as you say though. It took me some time to get on board with the (oo,n) idea, but I see why it make some more practical sense than (oo,oo). One of the things I noticed with the (oo,oo)-definition is that it is relatively easy to show pType is a globular type. I struggled a lot trying to show it was a Cat0. Will it ever be possible to define some sort of functor category? If not, it looks less likely that we can characterise (co)limits. |
Yes, that's another option which is certainly better than just using Unit, but it's more work -- not at the level of I have no doubt that with the right approach we'll be able to characterize (co)limits. That might or might not involve defining a functor category. |
I tried pType; it does seem that the brute force approach isn't going to work. I'm sure there's a way to do it in this case, but this makes me think that maybe we'd need another level of parametrization: someone might want to be able to define an |
I think I see how to get pType as a displayed 0-coherent category over Type, although I haven't managed to push it all the way through yet: there's a missing precomposition lemma, and a universe issue when trying to sigma it up, plus the 0-coherence lemma for sigmas of displayed categories isn't complete. |
And, of course, dimension restrictions on the coherence of functors will infect categories as well, since we use functors to construct categories (inserters, comma categories, etc.). It would be pleasing if we could simply parametrize categories by an (n,r) as in (n,r)-category, where n can be infinity but r cannot. Then n would be a limit on the dimensions of stuff, r a bound on invertibility, and of course there will still be a coherence index as always that would be the only difference with "classical" higher category theory. Functors and transfors would have only an n bound, I guess. There will probably be some |
Trunc index inequality is currently a type class. |
Oh my, you're right. Is it used anywhere? |
@mikeshulman I think I made it a typeclass when I was doing the Trunc_min stuff. That should be in Truncations/Core.v |
So for 2-categories there is a notion of "hom-wise core". Do we have something similar but for only 1-cells? I imagine such an example wouldn't fit into the (oo,n)-framwork. Actually I'm not even sure this is possible. Can you have invertible lower cells without invertible higher ones? |
Yes, of course you can. The end result won't be describable as an (n,r)-category, but it makes sense to discard the noninvertible 1-cells and keep all the 2-cells between the invertible ones. |
@mikeshulman Do you know of any examples of this being done in 2-cat literature? |
Not offhand. |
Hmm, an example where this might be done would be to take a monoidal category C. Then consider it's 2-category delooping BC. For whatever reason, you might be interested in the sub 2-category that consists of "objects with inverses". Then this "lower core" would correspond to some sort of categorification of taking the subtgroup of invertible elements in a monoid. I also suspect there would be a Grothendieck-like construction that would correspond to formally inverting all the lower cells, though I am not sure what the higher cells for those would be. |
@mikeshulman Could you rebase this? |
@@ -705,6 +707,90 @@ Definition Unit_rect := Unit_ind. | |||
(** A [Unit] goal should be resolved by [auto] and [trivial]. *) | |||
Hint Resolve tt : core. | |||
|
|||
(** ** Natural numbers *) | |||
|
|||
(** The natural numbers are defined in [Coq.Init.Datatypes] (we weren't able to excise them from the stdlib), and studied further in [Spaces.Nat]. But her we give some basic definitions. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
(** The natural numbers are defined in [Coq.Init.Datatypes] (we weren't able to excise them from the stdlib), and studied further in [Spaces.Nat]. But her we give some basic definitions. *) | |
(** The natural numbers are defined in [Coq.Init.Datatypes] (we weren't able to excise them from the stdlib), and studied further in [Spaces.Nat]. But here we give some basic definitions. *) |
Also, I think this is no longer true as of #1429
(** Versions of [n = 0] and [n > 0] that are typeclasses and can be found automatically. *) | ||
Definition IsZeroNat (n : nat) : Type := | ||
match n with | ||
| O => Unit | ||
| S _ => Empty | ||
end. | ||
Existing Class IsZeroNat. | ||
Global Instance iszeronat : IsZeroNat 0 := tt. | ||
|
||
Definition IsPosNat (n : nat) : Type := | ||
match n with | ||
| O => Empty | ||
| S _ => Unit | ||
end. | ||
Existing Class IsPosNat. | ||
Global Instance isposnat (n : nat) : IsPosNat (S n) := tt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might make more sense have these be aliases for IsTrue (n =? 0)
and IsTrue (n >? 0)
? (I think one lesson from ssreflect is that reasoning is easier if you keep all decidable predicates in bool and only move to Prop at the very end.)
(** A version of [n = -2] that's a typeclass. *) | ||
Definition IsMinusTwo (n : trunc_index) : Type := | ||
match n with | ||
| minus_two => Unit | ||
| trunc_S _ => Empty | ||
end. | ||
Existing Class IsMinusTwo. | ||
Global Instance isminustwo : IsMinusTwo (-2) := tt. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, maybe we want to go through a boolean equality on trunc_index?
Existing Class IsGlob. | ||
Arguments Hom {n} A {_} a b. | ||
Notation "a $-> b" := (@Hom _ _ _ a b). | ||
Notation "a $== b" := (@Hom 0 _ _ a b). (** In the invertible dimensions, we use a notation that looks more like paths or homotopies *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want also an only printing notation for @Hom (pred 0) _ _ a b
?
{ | ||
DHom : forall (a b : A) (f : a $-> b) (u : B a) (v : B b), Type@{u} ; | ||
isdglob_dhom : forall (a b : A) (u : B a) (v : B b), | ||
@IsDGlob (pred m) (a $-> b) (pred n) (fun f => DHom a b f u v) _ ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You use notation for IsGlob
, why not also for IsDGlob
?
@IsDGlob (pred m) (a $-> b) (pred n) (fun f => DHom a b f u v) _ ; | |
@IsDGlob m.-1 (a $-> b) n.-1 (fun f => DHom a b f u v) _ ; |
|
||
Existing Class IsDGlob. | ||
Arguments DHom {m A n B _ _ a b} f u v. | ||
(** Since [DHom] has three arguments that generally need to be given explicitly, we don't try to give it an infix notation. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use something like u $-{ f }-> v
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I tried that, but found it unreadable in practice.
I've rebased this at https://github.com/JasonGross/HoTT/tree/pr/1302, fixed the build conflicts, and also fixed the universe issue (and reported it as coq/coq#14057). |
CoInductive IsDGlob {m : nat} {A : Type@{u}} (n : nat) (B : A -> Type@{u}) | ||
`{IsGlob m A} : Type := | ||
{ | ||
DHom : forall (a b : A) (f : a $-> b) (u : B a) (v : B b), Type@{u} ; | ||
isdglob_dhom : forall (a b : A) (u : B a) (v : B b), | ||
@IsDGlob (pred m) (a $-> b) (pred n) (fun f => DHom a b f u v) _ ; | ||
}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be useful to have a telescoped version of this, where B
is of type forall (a : A) (b : B a) (c : C a b) ..., Type
? I think I could probably code up a version where n
was a tuple of nat
s whose size is given by the length of the telescope (though perhaps it makes more sense to index the telescope over its length, so we can talk about two telescopes of the same length), and I could probably code up enough typeclass / canonical structure magic that you would just do something like IsDGlob (n1, n2, n3) (fun x y z => W)
and it would be able to infer the necessary types automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JasonGross I would be interested in this telescoping idea, could you write a small example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have it fully figured out, but here's what I have so far:
Set Universe Polymorphism.
Set Implicit Arguments.
Set Primitive Projections.
Record sig A P := exist { pr1 : A ; pr2 : P pr1 }.
Arguments sig (A P)%type.
Notation "{ x | P }" := (sig (fun x => P)) : type_scope.
Notation "{ x : A | P }" := (sig (A:=A) (fun x => P)) : type_scope.
Notation "{ ' pat | P }" := (sig (fun pat => P)) : type_scope.
Notation "{ ' pat : A | P }" := (sig (A:=A) (fun pat => P)) : type_scope.
Notation "n '.-1'" := (pred n) (at level 9, format "n '.-1'") : nat_scope.
Notation "n '.+1'" := (S n) (at level 9, format "n '.+1'") : nat_scope.
Notation "( x ; y )" := (exist _ x y) : fibration_scope.
Notation "( x ; .. ; y ; z )" := (exist _ x .. (exist _ y z) ..) : core_scope.
Fixpoint telescope (n : nat) : Type :=
match n with
| 0 => unit
| n.+1 => { A : Type | A -> telescope n }
end.
Fixpoint Sigma {n} : telescope n -> Type
:= match n with
| 0 => fun _ => unit
| n.+1 => fun '(A; B) => { a : A | Sigma (B a) }
end.
Fixpoint Pi {n} : forall t : telescope n, (Sigma t -> Type) -> Type
:= match n with
| 0 => fun _ B => B tt
| n.+1 => fun '(A; t) B => forall a : A, Pi _ (fun s => B (a; s))
end.
I haven't yet figured out what the right types are, but I think we need to bundle IsDGlob
to get this to work. The next step is to write something that takes in n : nat
and spits out { A : Type | { B : A -> Type | { C : forall a, B a -> Type | ... } } }
. I think I did this once before, and it's a bit tricky but doable. This is the type that we parametrize the generalization of IsGlob
/IsDGlob
over. Then we write a thing that takes in one of these sigmas and spits out the type of all the hom fields, again as a sigma. Then, finally, we take in an element of this sigma and perform the appropriate transformation to turn it back into a thing we can pass to IsGlob
. In this case, passing n := 0
will turn this coinductive into IsGlob
judgmentally. Passing n:=1
should turn it into, roughly { IsGlob A | IsDGlob B }
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something like this should work, but it's giving me universe inconsistencies:
Fixpoint Homs {n} : forall (tA tB : telescope n), Type
:= match n with
| 0 => fun 'tt 'tt => unit
| n.+1 => fun '(A; P) '(B; Q) => forall (a : A) (b : B), { Hom : Type | @Homs n (P a) (Q b) }
end.
Fixpoint Homs_cps {n} : forall {tA tB}, (telescope n -> Type) -> @Homs n tA tB -> Type
:= match n with
| 0 => fun 'tt 'tt F 'tt => F tt
| n.+1
=> fun '(A; P) '(B; Q) cont Hom
=> forall (a : A) (b : B),
@Homs_cps n (P a) (Q b) (fun t => cont (pr1 (Hom a b); (fun _ (* ??? *) => t))) (pr2 (Hom a b))
end.
Inductive Homs_cps_ind : forall {n tA tB}, (telescope n -> Type) -> @Homs n tA tB -> Type :=
| Homs0 : forall F, F tt -> @Homs_cps_ind 0 tt tt F tt
| HomsS : forall {n} A P B Q cont Hom,
(forall (a : A) (b : B), @Homs_cps_ind n (P a) (Q b) (fun t => cont (pr1 (Hom a b); (fun _ (* ??? *) => t))) (pr2 (Hom a b)))
-> @Homs_cps_ind (n.+1) (A; P) (B; Q) cont Hom
.
CoInductive IsGlob@{u} (n : nat) (A : Type@{u}) : Type :=
{
Hom : A -> A -> Type@{u} ;
isglob_hom : forall (x y : A), IsGlob n.-1 (Hom x y) ;
}.
CoInductive IsDGlob@{u} (n : nat) {A : Type@{u}} (B : A -> Type@{u}) : Type :=
{
DHom0 : A -> A -> Type@{u}
; DHom1 : forall (a b : A) (f : DHom0 a b) (u : B a) (v : B b), Type@{u}
; isdglob_dhom : forall (a b : A) (u : B a) (v : B b),
@IsDGlob (pred n) (DHom0 a b) (fun f => @DHom1 a b f u v) ;
}.
CoInductive IsGenGlob (n : nat) {len} (t : telescope len) : Type :=
{
GHom : Homs t t
; isgenglob_ghom : Homs_cps_ind (IsGenGlob n) GHom
}.
There's a ???
where I'm not sure that I set things up right. I expect that you should be able to prove IsGlob
here equivalent to IsGenGlob (len:=0)
and IsDGlob
here (which is bundled) equivalent to IsGenGlob (len:=1)
. It also shouldn't be hard to generalize to a tuple of nat
s rather than a single one, since the nat
s are independent from the types.
}. | ||
|
||
Existing Class IsCatSect0. | ||
Arguments fmapD {_ _ _ _ _ _} F {_ a b} f. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't suppose Coq will accept
Arguments fmapD {_ _ _ _ _ _} F {_ a b} f. | |
Arguments fmapD {_ _ _ _ _ _} F {_ a b} f, {_ _ _ _ _ _} F {_} a b f. |
? (I think it won't because fmapD
is a DHom
which might unfold to be a type of unknown arity.) If it did, you wouldn't need fmapD'
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know you could give multiple declarations of arguments! The documentation still seems a bit sparse but this is cool feature.
Ltac change_dim n := | ||
match n with | ||
| (pred ?m) => fail 1 | ||
| _ => progress change n with (pred (S n)) | ||
end. | ||
|
||
Ltac change_dim_0 n := | ||
match n with | ||
| (pred ?m) => fail 1 | ||
| 0%nat => progress change 0%nat with (pred 0) | ||
end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does typeclass resolution backtrack across successes of multisuccess tactics? If so, you might be able to do something like
Ltac change_dim n := | |
match n with | |
| (pred ?m) => fail 1 | |
| _ => progress change n with (pred (S n)) | |
end. | |
Ltac change_dim_0 n := | |
match n with | |
| (pred ?m) => fail 1 | |
| 0%nat => progress change 0%nat with (pred 0) | |
end. | |
Ltac change_dim n := | |
multimatch n with | |
| (pred ?m) => fail 1 | |
| _ => progress change n with (pred (S n)) | |
| 0%nat => progress change 0%nat with (pred 0) | |
end. |
CoInductive IsDGlob {m : nat} {A : Type@{u}} (n : nat) (B : A -> Type@{u}) | ||
`{IsGlob m A} : Type := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it important that IsDGlob
is indexed over the globular structure of A
, rather than providing the globular structure of both A
and B
at once? The reason I ask is because there seems to be a nice generalization to telescopes that makes IsGlob
the base case and IsDGlob
a sort of inductive step, but I think it requires bundling all the globular structure as fields rather than parameterizing over it, I think.
Defined. | ||
Existing Instance isdglob_compose. | ||
|
||
(** Tlsil has suggested that we could also define a dependent globular type to be a globular map into a globular type of spans. This would make [isdglob_compose] an instance of [isfunctor0_compose]. But it would require defining globular maps before dependent globular types, with the effect that globular maps wouldn't be definitionally globular sections of constant dependent globular types. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm struggling to understand how this fits into the picture. Can you elaborate on it a bit more?
The perspective I'm coming from is that it seems like all of the dependent globular theory should generalize to telescopes (i.e., from forall a, B
to forall a b ... c, D
), and I'm trying to understand what the telescope picture looks like here. Does doing this in a telescope way require defining globular maps mutually with globular types?
Class IsInitial `{IsGlob n A} (a : A) := | ||
catcontr_initial : forall b, CatContr (a $-> b). | ||
Global Existing Instance catcontr_initial. | ||
|
||
Class HasInitial `{IsGlob n A} := | ||
{ | ||
initial_obj : A ; | ||
isinitial_initial : IsInitial initial_obj ; | ||
}. | ||
Global Existing Instance isinitial_initial. | ||
|
||
Class IsTerminal `{IsGlob n A} (a : A) := | ||
catcontr_terminal : forall b, CatContr (b $-> a). | ||
Global Existing Instance catcontr_terminal. | ||
|
||
Class HasTerminal `{IsGlob n A} := | ||
{ | ||
terminal_obj : A ; | ||
isterminal_terminal : IsTerminal terminal_obj ; | ||
}. | ||
Global Existing Instance isterminal_terminal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be parameterized over laxity, so that we get things to line up more judgmentally. What do you think?
| lax => (b $-> a) | ||
end. | ||
|
||
Definition lcat_id (l : Laxity) `{IsCat1 n A} (a : A) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add
Definition lcat_compose {l : Laxity} `{IsCat1 n A} {a b c : A} (f : lHom l a b) (g : lHom l b c) : lHom l a c
?
CoInductive IsQIso `{IsCat0 n A} {a b : A} (f : a $-> b) := | ||
{ | ||
qiso_inv : b $-> a ; | ||
qiso_issect : (qiso_inv $o f) $-> (cat_id a) ; | ||
qiso_isretr : (f $o qiso_inv) $-> (cat_id b) ; | ||
isqiso_qiso_issect : @IsQIso _ (a $-> a) _ _ _ _ qiso_issect ; | ||
isqiso_qiso_isretr : @IsQIso _ (b $-> b) _ _ _ _ qiso_isretr ; | ||
}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for using this structure rather than talking about adjoint equivalences? They're the same, right, just involving a reshuffling of data?
|
||
(** ** Quasi-isomorphisms *) | ||
|
||
(** A morphism in an (oo,n)-category is an equivalence if either [n=0] or if it has an inverse up to equivalence. Since this is not a coherent structure, we denigrate it with the name "quasi-isomorphism". We define it coinductively, but in practice it suffices to reason about it inductively since all our categories are (oo,n)-categories for some finite n. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by the n=0
comment, since it seems that gpd_inv
is not enough to fill qiso_issect
and qiso_isretr
? I think this means we should be indexing "(oo,n)-category" starting with n = -1, not n = 0, so that the inverses we get are actually connected to the identity? Or is there a deep/good reason that we're not considering categories to be truncated at levels above n
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking a bit more about this, it seems like maybe gpt_inv
should be removed entirely, and its content is subsumed by being truncated one level up?
Hint Extern 1 (HasEquivs ?n (Hom _ _ _)) => change_dim n : typeclass_instances. | ||
Hint Extern 1 (HasEquivs ?n (Hom _ _ _)) => change_dim_0 n : typeclass_instances. | ||
|
||
(** A field can't be a working [Existing Class] due to a bug in Coq. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which bug is this? (Maybe add a reference in the comment?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coq/coq#12975 which will be fixed by coq/coq#9711
(** * 1-coherent oo-categories *) | ||
|
||
Generalizable Variables m n p A B C. | ||
|
||
(** ** 1-coherent oo-functors *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be empty?
- It could mean "having only the structure of a (0,n)-category at each dimension": composition, identities, and in the case [n=0] inversion, but no axioms. | ||
- It could mean the maximal difference in dimension between the inputs and outputs of operations is 0, so it has all operations but no axioms. | ||
|
||
We currently choose the latter, which happens to also be "everything that can be stated without referring to equivalences". *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, wouldn't the latter involve moving cat_id
, isfunctor0_postcomp
and isfunctor0_precomp
to IsCat1
, because cat_id
takes a 0-cell to a 1-cell, and the pre/post comp functor instances take 1-cells to 2-cells?
|
||
(** ** 1-coherent oo-categories *) | ||
|
||
(** As before, we have to choose what "1-coherent" means. At the moment we are choosing "whatever is necessary to have a good theory of equivalences", which is somewhere in between the two principled choices. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on this a bit more? If we were to fully go with the "at most 1 dimension of difference between input and output", would that mean getting rid of isfunctor1_{pre,post}comp
?
: Symmetric (@CatEquiv n A _ _ _) | ||
:= @cate_inverse n A _ _ _. | ||
|
||
(** TODO: Consider adjointifying one the following two lemmas so that they satisfy an [isadj] coherence. If we do that, it would be nice to give the user a way to specify that a particular notion of equivalence (e.g. [IsEquiv] for [Type]) is already adjointified, so that in that case these lemmas can preserve the homotopies supplied by the user. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to let the user specify this is to make a typeclass for "is already adjointified" and another one for "might already be adjointified" (where we add a high-cost instance for "it's not" to "might already be adjointified", and a lower cost instance from "it is adjointified" to "it might be"). Then these lemmas could take in the optional class, and adjointify only if we don't have a proof in hand that it's already adjointified, and then we could prove the coherence regardless of what instance is passed in, and we could prove that passing in a "already adjointified" instance preserves all the homotopies.
- intros [a u] [b v] [c w] [g q]. | ||
Abort. | ||
|
||
(* Global Existing Instance iscat0_sigma. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented?
set (l := head ls) in *. | ||
destruct l; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with the set
?
(** We can forget the invertibility of an iso-inserter. *) | ||
Definition colax_pseudo_inserter | ||
(ls : Stream Laxity) `{IsGlob m A} `{HasEquivs n B} | ||
(F G : A -> B) `{!IsFunctor0 F, !IsFunctor0 G} (a : A) | ||
: (GenDInserter (scons pseudo ls) F G a) -> (GenDInserter (scons colax ls) F G a) | ||
:= fun f => cate_fun f. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a more general version of this, where you can go from pseudo
to any laxity, right?
(** And we can turn around a lax inserter into a colax one. *) | ||
Definition colax_lax_inserter | ||
(ls : Stream Laxity) `{IsGlob m A} `{HasEquivs n B} | ||
(F G : A -> B) `{!IsFunctor0 F, !IsFunctor0 G} (a : A) | ||
: (GenDInserter (scons lax ls) G F a) -> (GenDInserter (scons colax ls) F G a) | ||
:= fun f => f. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have flip : Laxity -> Laxity
or something and this should be more general?
(@fmapD _ _ _ _ _ _ alpha alnat x y)). | ||
Defined. | ||
|
||
(** If we generalized comma categories (and hence inserters) to act on category-sections rather than just functors, we could in principle iterate this approach to define modifications and higher transfors, analogously to how we iterate [isglob_forall] to define all the higher structure of [Type] and similarly for [pType]. Such a generalization seems to require either that the displayed category is an isofibration, or that we define a more general notion of inserter over a given natural transformation, and either one seems to require 2-coherent categories. In fact, since the level of coherence seems to go down by one each time we apply a comma construction, we probably wouldn't be able to use this to define a whole oo-category of oo-categories at any fixed coherence level. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the relationship between comma categories and inserters?
Here's my next iteration of coinductive wild oo-categories.
Change # 1: By getting rid of (oo,oo)-categories and considering only (oo,n)-categories for finite n, the proof that equivalences compose becomes much simpler, and little if any interesting generality is lost -- the only true (oo,oo)-categories that I know of are things like the (oo,oo)-category of (oo,oo)-categories, and at the moment I don't think that even has a "wild" version since the amount of coherence required to even define a k-transfor seems to go up with k.
Change # 2: I simplified the notion of
HasEquivs
to include only the propertyCatIsEquiv
, with a bundled versionCatEquiv
defined uniformly for all categories. I think this is easier to read and work with; the only drawback is that at present,@CatEquiv Type
doesn't coincide withEquiv
. However, I think that can be finessed, either by bringing the basic category definitions intoBasics
, or by using a general notion ofsubtype
for both of them. For examples other thanType
, such aspType
, there's no problem since they are defined later in the library and can simply useCatEquiv
explicitly instead of whatever manual definition they already had.Change # 3: There is now a "default" coherent definition of
HasEquivs
using bi-invertibility that can be used for any category if desired, thus simplifying the process of defining a category. But I kept the option for users of defining a different one, so that if it's desired to use half-adjoint equivalences (e.g. forType
) that can be done. (I tried making the default definition use half-adjoint equivalences, but that was much harder than bi-invertibility since you need associativity and unit isomorphisms to even state the adjoint coherence law.)Change # 4: I defined dependent inserters directly rather than in terms of comma categories. I think this way is clearer, partly because it doesn't require product categories. We can then define comma categories in terms of them (but I didn't yet).
Change # 5: I added some results about truncated categories, including a general notion of "isomorphism" for (1,1)-categories that could be plugged into (for instance) groups, etc. rather than separately defining
GroupIsomorphism
and so on in each case separately.Overall I'm trying to figure out whether this development can be made "lightweight" and comprehensible enough to be "the" categories library we use everywhere, replacing the current truncated-only definitions in
WildCat
. An aspect of that would be to make it possible for users to use only finitely many dimensions, rather than being forced to work with infinitely many in all cases. It's already possibly to talk about categories with only finitely many dimensions of cells, just by sticking in Unit at the top of the coinductive notion. But there isn't yet a way to talk about functors that only act on finitely many dimensions if their domain and codomain categories were defined to include infinitely many. I think it should be possible to do this by parametrizing functors by a "coherence dimension", but I haven't tried yet.I'm interested in any feedback, but particularly about the feasibility of this idea. Could this actually be usable by anyone? Or is it unavoidably just too scary-looking and heavyweight?
I do think this approach would have some practical advantages. For instance, having the higher morphisms and equivalences around from the beginning deals more cleanly with a definition of 2-category than our previous version that required explicitly passing to cores on hom-categories. And it allows us to formulate general notions of universal property (e.g. reflective subcategories) that specialize in particular cases to our funext-free versions (e.g. reflective subuniverses).