Category Theory
Zulip Server
Archive

You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.


Stream: learning: questions

Topic: What is a coindexed coalgebra?


view this post on Zulip Antoine Van Muylder (Apr 17 2024 at 16:38):

I'm pretty sure this has been asked before but had trouble finding the information.

Let FF be a functor and let α\alpha be a functor algebra. From what I know there are 2 ways to define what "an algebra depending on α\alpha" should be (in what follows α|\alpha| is the carrier of α\alpha).

To get an indexed algebra out of a fibered one you use the fibers predicate. In the other direction you "sigma up" your indexed algebra.

Induction is then the fact that each μF\mu\,F fibered algebra has a section or that each indexed algebra is "inhabited".

My question is what happens for coalgebras?

view this post on Zulip Stelios Tsampas (Apr 18 2024 at 19:17):

On your example on PP: If we let your PP be a mono p:PNp : P \rightarrowtail \mathbb{N} into the natural numbers, then what you presented as an N\mathbb{N}-indexed algebra is

By initiality, PNP \cong \mathbb{N}, hence PnPn for all nn. Like you said, this is what a proof by induction looks like categorically (i.e. showing the existence of such an algebra 1+PP1 + P \to P), I just found your notation and viewpoint a bit unfamiliar to me. Also, I don't get why you would call this a logical predicate. Is it simply because it is a subcoalgebra? I disagree with this terminology, because to me a logical predicate (or relation) is a certain predicate on an initial algebra, where the carrier of said initial algebra exhibits some higher-order "applicative" behavior and said predicate maps inputs in the predicate to output in the predicate. I gave a (lousy?) presentation (edit: better slides here) on precisely this topic in your university two weeks ago (see also relevant paper) ;).

view this post on Zulip Stelios Tsampas (Apr 18 2024 at 19:20):

I will henceforth assume that the notion of a subalgebra on an initial algebra adequately captures the essence of a "predicate proven true by induction" and I hope that you will agree.

view this post on Zulip Stelios Tsampas (Apr 18 2024 at 19:23):

So, to answer your question, I will simply consider the dual of a subalgebra, a subcoalgebra. A predicate p:PXp : P \rightarrowtail X to the state space of a coalgebra XFXX \to FX is what is known as a (coalgebraic) invariant, i.e. in Set this corresponds to a subset on states which is preserved through computation.

view this post on Zulip Stelios Tsampas (Apr 18 2024 at 19:41):

If FF has, as you mention, an action on relations/predicates, e.g. F\overline{F}, the correct thing to say would be that a PP is an F\overline{F}-algebra (dually, an F\overline{F}-coalgebra). Furthermore, in his 2016 book, Jacobs calls the relational counterpart of the above a logical bisimulation, which justifies the terminology you used :grinning_face_with_smiling_eyes:.

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 13:25):

Stelios Tsampas said:

On your example on PP: If we let your PP be a mono p:PNp : P \rightarrowtail \mathbb{N} into the natural numbers, then what you presented as an N\mathbb{N}-indexed algebra is

By initiality, PNP \cong \mathbb{N}, hence PnPn for all nn. Like you said, this is what a proof by induction looks like categorically (i.e. showing the existence of such an algebra 1+PP1 + P \to P), I just found your notation and viewpoint a bit unfamiliar to me. Also, I don't get why you would call this a logical predicate. Is it simply because it is a subcoalgebra? I disagree with this terminology, because to me a logical predicate (or relation) is a certain predicate on an initial algebra, where the carrier of said initial algebra exhibits some higher-order "applicative" behavior and said predicate maps inputs in the predicate to output in the predicate. I gave a (lousy?) presentation (edit: better slides here) on precisely this topic in your university two weeks ago (see also relevant paper) ;).

Hi Stelios thanks for the answer.

Isn't it the case, still looking at N\mathbb{N}, that a family Pn,nNP_{n},n\in \mathbb{N} with P0P0 and n.PnP(n+1)\forall n.\, Pn \to P(n+1) is a logical predicate in your terminology?
I have to give your presentation a second look

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 13:32):

Stelios Tsampas said:

I will henceforth assume that the notion of a subalgebra on an initial algebra adequately captures the essence of a "predicate proven true by induction" and I hope that you will agree.

What you propose is a proof irrelevant "restriction" of what I described above. More specifically a subalgebra of α\alpha is in particular a α\alpha fibered algebra (since it is a morphism into α\alpha).

Through the correspondence I laid out above, it is equivalently a map P:αhPropP : |\alpha| \to \mathrm{hProp} such that structure is respected.
I did not specify the meta theory in my question, and it was kind of assumed that we are working in HoTT, sorry :-)

If you work in HoTT you can hopefully prove an equivalence between the 2 notions but this equivalence will not be a definitional one (ie roundtrip proofs will not go by refl). That is why I make a distinction between fibered and indexed algebras.

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 13:47):

Stelios Tsampas said:

So, to answer your question, I will simply consider the dual of a subalgebra, a subcoalgebra. A predicate p:PXp : P \rightarrowtail X to the state space of a coalgebra XFXX \to FX is what is known as a (coalgebraic) invariant, i.e. in Set this corresponds to a subset on states which is preserved through computation.

I think I was rather interested in morphisms out of a coalgebra. In my terminology "cofibered coalgebras"

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 13:51):

Because I think that you can formulate coinduction with these? In fact is it possible to formulate coinduction as it can be done for induction?

Principle 1.
Induction is the property that any μF\mu F-fibered algebra has a section
Spelled out: if f:PμFf : P \to \mu F is an algebra morphism then there is a s:μFPs : \mu F \to P such that fs=idf\circ s = id

Naively I would think that coinduction can read

Principle 2.
Coinduction is the fact that any νF\nu F-cofibered coalgebra has a retraction.
Spelled out: if f:νFTf : \nu F \to T then there is r:TνFr : T \to \nu F such that rf=idr \circ f = id

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 17:17):

@Stelios Tsampas for what it's worth I think I've found some answer to my question.
Principle 1 above can be formulated as

Principle 1 bis.μFP  idxAlgi:μFind:P(i)\text{Principle 1 bis.}\\ \mu F \vDash P\;\text{idxAlg}\\ ------\\ i:\mu F \vDash ind : P(i)

where μFP  idxAlg\mu F \vDash P\;\text{idxAlg} is defined as "P is an indexed algebra", the same way I "define" it in my initial question.
So for N\mathbb{N} it's exactly what you get in the proof assistant.

I think "Principle 2 bis" probably looks like "bisimilarity is equality".
The following comes from Practical coinduction - D. Kozen, A. Silva

For set-based coalgebras, one form of the classical coinduction principle states that if two
elements are bisimilar, then their unique images in the final coalgebra are the same.

So my best guess for now is that a coindexed coalgbera is a bisimulation relation. I still have to understand how it all fits together.

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 17:30):

Antoine Van Muylder said:

Isn't it the case, still looking at N\mathbb{N}, that a family Pn,nNP_{n},n\in \mathbb{N} with P0P0 and n.PnP(n+1)\forall n.\, Pn \to P(n+1) is a logical predicate in your terminology?
I have to give your presentation a second look

In my terminology, I would say PP is a subalgebra (relative to the initial algebra) or an algebraic invariant (relative to the initial algebra), but because such PP just holds, such a terminology is a bit redundant.

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 17:35):

Again in my terminology, for a predicate PXP \rightarrowtail X to be logical, at least in the way the people dabbling with logical relations use it, then the following should happen:

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 17:40):

Basically the property of PXP \rightarrowtail X being a logical predicate is some sort of a generalization of the notion of a coalgebraic invariant, only for higher-order coalgebras! And indeed, the way I define the logical predicate is "an invariant that is relative to itself", or "an invariant that maps inputs in itself to outputs in itself".

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 17:43):

Antoine Van Muylder said:

Because I think that you can formulate coinduction with these? In fact is it possible to formulate coinduction as it can be done for induction?

Naively I would think that coinduction can read

Principle 2.
Coinduction is the fact that any νF\nu F-cofibered coalgebra has a retraction.
Spelled out: if f:νFTf : \nu F \to T then there is r:TνFr : T \to \nu F such that rf=idr \circ f = id

You are correct I believe :).

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 18:02):

Antoine Van Muylder said:

So my best guess for now is that a coindexed coalgbera is a bisimulation relation. I still have to understand how it all fits together.

I'm trying to think how a "coindexed coalgebra" would look like for relations...

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 18:11):

Antoine Van Muylder said:

Stelios Tsampas said:

I will henceforth assume that the notion of a subalgebra on an initial algebra adequately captures the essence of a "predicate proven true by induction" and I hope that you will agree.

What you propose is a proof irrelevant "restriction" of what I described above. More specifically a subalgebra of α\alpha is in particular a α\alpha fibered algebra (since it is a morphism into α\alpha).

Through the correspondence I laid out above, it is equivalently a map P:αhPropP : |\alpha| \to \mathrm{hProp} such that structure is respected.
I did not specify the meta theory in my question, and it was kind of assumed that we are working in HoTT, sorry :-)

If you work in HoTT you can hopefully prove an equivalence between the 2 notions but this equivalence will not be a definitional one (ie roundtrip proofs will not go by refl). That is why I make a distinction between fibered and indexed algebras.

Ah OK, thank you for explaining. Did you assume that we are working in HoTT simply because it is your default mathematical universe, or are you explicitly looking to explore notions of (categorical) induction and coinduction in a HoTT foundations? I am generally curious to know more about your motivation.

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 18:13):

By the way, to give you and idea of where I'm coming from, my recent work on logical predicates and logical relations involve the categorical modelling/systematization of the common proof methods of resp. logical relations and logical predicates, and in the process expose lightweight reasoning principles.

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 18:51):

Stelios Tsampas said:

Again in my terminology, for a predicate PXP \rightarrowtail X to be logical, at least in the way the people dabbling with logical relations use it, then the following should happen:

So here XX is the carrier of a coalgebra?

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 18:52):

Yeah!

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 18:52):

Technically not a coalgebra, but a higher-order coalgebra, if you will. Without XX being such a carrier the notion of logicality (related inputs to related outputs) does not really apply.

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 18:58):

Right. I think my question regarded coalgebraic "coinvariants" if that is even a thing :grinning:
So instead of a coalgebra morphism PXP \rightarrowtail X, a coalgebra morphism XQX \twoheadrightarrow Q (or more generally a morphism XQX \to Q)

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 19:04):

Stelios Tsampas said:

Antoine Van Muylder said:

Stelios Tsampas said:

I will henceforth assume that the notion of a subalgebra on an initial algebra adequately captures the essence of a "predicate proven true by induction" and I hope that you will agree.

What you propose is a proof irrelevant "restriction" of what I described above. More specifically a subalgebra of α\alpha is in particular a α\alpha fibered algebra (since it is a morphism into α\alpha).

Through the correspondence I laid out above, it is equivalently a map P:αhPropP : |\alpha| \to \mathrm{hProp} such that structure is respected.
I did not specify the meta theory in my question, and it was kind of assumed that we are working in HoTT, sorry :-)

If you work in HoTT you can hopefully prove an equivalence between the 2 notions but this equivalence will not be a definitional one (ie roundtrip proofs will not go by refl). That is why I make a distinction between fibered and indexed algebras.

Ah OK, thank you for explaining. Did you assume that we are working in HoTT simply because it is your default mathematical universe, or are you explicitly looking to explore notions of (categorical) induction and coinduction in a HoTT foundations? I am generally curious to know more about your motivation.

I formulated my question in HoTT because it is nowadays my default math setting, but also because I'm interested not only in algebra monos PXP \rightarrowtail X but also arbitrary morphisms PXP \to X. Under the fibered-indexed correspondence these translate respectively to P:XhPropP : X \to \mathrm{hProp} and P:XTypeP : X \to \mathrm{Type}

i.e. induction can be used to prove things but also build objects that are more than proofs

Also it is a setting where I can make sense of why the fibered and indexed view are different: both are weakly equivalent

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 19:05):

Maybe you'll find Theorem 3.3.4 (also exercise 4.5.6) in Jacob's book interesting.

Abstractly, the principle of coinduction is presented in Theorem 4.5.8 in the same book (and it says that equality in the final coalgebra is also a final object in its own right). You can perhaps translate it in terms of "coindexing" somehow.

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 19:10):

Antoine Van Muylder said:

Stelios Tsampas said:

Antoine Van Muylder said:

Stelios Tsampas said:

I will henceforth assume that the notion of a subalgebra on an initial algebra adequately captures the essence of a "predicate proven true by induction" and I hope that you will agree.

What you propose is a proof irrelevant "restriction" of what I described above. More specifically a subalgebra of α\alpha is in particular a α\alpha fibered algebra (since it is a morphism into α\alpha).

Through the correspondence I laid out above, it is equivalently a map P:αhPropP : |\alpha| \to \mathrm{hProp} such that structure is respected.
I did not specify the meta theory in my question, and it was kind of assumed that we are working in HoTT, sorry :-)

If you work in HoTT you can hopefully prove an equivalence between the 2 notions but this equivalence will not be a definitional one (ie roundtrip proofs will not go by refl). That is why I make a distinction between fibered and indexed algebras.

Ah OK, thank you for explaining. Did you assume that we are working in HoTT simply because it is your default mathematical universe, or are you explicitly looking to explore notions of (categorical) induction and coinduction in a HoTT foundations? I am generally curious to know more about your motivation.

I formulated my question in HoTT because it is nowadays my default math setting, but also because I'm interested not only in algebra monos PXP \rightarrowtail X but also arbitrary morphisms PXP \to X. Under the fibered-indexed correspondence these translate respectively to P:XhPropP : X \to \mathrm{hProp} and P:XTypeP : X \to \mathrm{Type}

i.e. induction can be used to prove things but also build objects that are more than proofs

Also it is a setting where I can make sense of why the fibered and indexed view are different: both a weakly equivalent

I see! Indeed, you should be able to generalize this induction principle (no prober subalgebras on initial algebras) for arbitrary morphisms f:XμFf : X \to \mu F, also epi-mono factorize ff and see what happens, etc.

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 19:10):

Stelios Tsampas said:

By the way, to give you and idea of where I'm coming from, my recent work on logical predicates and logical relations involve the categorical modelling/systematization of the common proof methods of resp. logical relations and logical predicates, and in the process expose lightweight reasoning principles.

Yes I was trying to follow along during your talk 2weeks ago because I remember that classical normalization proofs are not so elegant. I still have to understand how you solve this:)

view this post on Zulip Antoine Van Muylder (Apr 19 2024 at 19:13):

cool I have to look at Jacobs book. thanks for the discussion

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 19:21):

Awesome! Yeah, there's quite a lot of moving parts, but only because the concrete setting has a lot of moving parts. I would be very happy to help you with specific questions, but some things to keep in mind:

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 19:22):

This attached slide might also be instructive.
image.png

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 19:22):

Antoine Van Muylder said:

cool I have to look at Jacobs book. thanks for the discussion

Cool discussion indeed!

view this post on Zulip Stelios Tsampas (Apr 19 2024 at 19:40):

Antoine Van Muylder said:

I formulated my question in HoTT because it is nowadays my default math setting, but also because I'm interested not only in algebra monos PXP \rightarrowtail X but also arbitrary morphisms PXP \to X. Under the fibered-indexed correspondence these translate respectively to P:XhPropP : X \to \mathrm{hProp} and P:XTypeP : X \to \mathrm{Type}

i.e. induction can be used to prove things but also build objects that are more than proofs

Also it is a setting where I can make sense of why the fibered and indexed view are different: both are weakly equivalent

By the way this is quite compelling a question.

view this post on Zulip Mike Shulman (Apr 19 2024 at 21:55):

I agree that the proper analogy is "recursion : induction :: corecursion : bisimulation". But it takes a bit of creativity to reformulate this in a way that brings out the categorical duality.

view this post on Zulip Mike Shulman (Apr 19 2024 at 22:02):

Antoine Van Muylder said:

Naively I would think that coinduction can read

Principle 2.
Coinduction is the fact that any νF-cofibered coalgebra has a retraction.
Spelled out: if f:νF→T then there is r:T→νF such that r∘f=id

...

So my best guess for now is that a coindexed coalgbera is a bisimulation relation.

I would say the connection between these two is that a surjective map νFT\nu F \to T is the quotient of its kernel KK, which is an equivalence relation in νF\nu F (though in HoTT it will in general be a "higher equivalence relation", i.e. a groupoid object). Thus, by the universal property of the quotient, to define a map TνFT\to \nu F, it suffices to define a map from KK to IdνF\mathsf{Id}_{\nu F}, which we can do by bisimulation.

view this post on Zulip Mike Shulman (Apr 19 2024 at 22:03):

I am not sure what to say about non-surjective maps νFT\nu F \to T.

view this post on Zulip Stelios Tsampas (Apr 20 2024 at 08:12):

Antoine Van Muylder said:

So my best guess for now is that a coindexed coalgbera is a bisimulation relation. I still have to understand how it all fits together.

Hmmm if I was to focus on the "bisimulation relation" part of the above quote, forget about the coindexing and follow along the ideas of Antoine from the beginning of the topic, then clearly an X×XX \times X-indexed coalgebra is a bisimulation. Let me sketch this, although it's really basic: suppose there is a coalgebra h:XX+1h : X \to X + 1 (keep in mind we can generalize to any functor F with a relation lifting) and a relation RR on XX. An X×XX \times X-indexed coalgebra on RR amounts to the following:

If R(t,s)R(t,s) then