Тёмный

Category Theory II 8.1: F-Algebras, Lambek's lemma 

Bartosz Milewski
Подписаться 27 тыс.
Просмотров 9 тыс.
50% 1

Опубликовано:

 

27 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@klaasvanschelven769
@klaasvanschelven769 6 лет назад
Great lecture, thanks very much! I did find the following somewhat confusing on first viewing: at 37:15 you start talking about the category of algebras for a fixed endofunctor. Objects in this category is a pair of an object and a morphism (38:00); when explaining the constraint on the morphisms in this category a second diagram is drawn (starting at 39:42). It took me a while to understand that this second diagram is in a different category (I think: Hask), especially since no further diagrams of the category of algebras are drawn. Hope that's helpful!
@DrBartosz
@DrBartosz 6 лет назад
The category of algebras for a given endofunctor is built on top of the underlying category (this can be any category). The diagrams I draw are in the underlying category -- they show the "implementation" of the morphisms of the category of algebras in terms of morphisms in the underlying category.
@erikprantare696
@erikprantare696 3 года назад
@@DrBartosz I also find that part a bit confusing. Is there a reason to not just use F a -> a as the object? Why add the carrier to the pair?
@marcusklaas4088
@marcusklaas4088 6 лет назад
Excellent lecture. Was a bit confused about how the fixed point of a functor fits in the with rest of the lecture though. Is `(Fix f) a -> a` also an algebra? Will probably have to go over this lecture again.
@TimTeatro
@TimTeatro 6 лет назад
Assuming I understand it correctly, the algebra is the function which can evaluate things that one might find at the ends of branches in an expression tree, but that is not recursive on its own, and nor is the functor on which the algebra is based. In order to construct a tree of arbitrary depth, you need Fix. It's then the catamorphism which can traverse the tree and distill it to a single value in the carrier type.
@LeChaosRampant
@LeChaosRampant 5 лет назад
As a passing remark, interestingly, if I'm not mistaken, at the end, we don't need anything more to have the other direction of the isomorphism, because by definition of m, the left square of the diagram commutes, which give m ○ j = Fj ○ Fm = F(j ○ m) = F(id) = id
@JH-qk8tj
@JH-qk8tj 2 года назад
Yes I think the diagram they wrote wouldnt work for the other side of the isomorphism
@tepan
@tepan 2 года назад
I like that when it comes to explaining "algrebra", the terms "endofunctor" and "monoid" are used - again. As if we could say "an algrebra is just a monad, what's the problem"? I'm just kidding, because I honestly don't know what I'm talking about. But I wonder if there could be made another over-my-head statement about algrebras in the likes of "a monad is just a monoid in the category of endofunctors".
@zephyrliu8833
@zephyrliu8833 5 лет назад
Impressive! If functor related to algebra expression like a polynomial, can we imply some rules to create equation, and then illustrate field extension in the language of category theory?
@marcbusque6012
@marcbusque6012 6 лет назад
For an endofuctor F, considering two algebras (a, i) and (F a, j), is it always the case that the evaluation of (a, i) is also an homomorphism from (F a, j) to (a, i)? F (F a) -------------> F a | F m | | | | j i | | | | | \/ m \/ F a -------------------> a m and i are the same?
@justpk5773
@justpk5773 5 лет назад
Hi Bartosz, How to represent higher order functions in category theory and can you please make a video on Y-Combinator.
@DrBartosz
@DrBartosz 5 лет назад
Higher order functions rely on exponential object (or function types, as we call them). I have a video on that. I prefer to introduce recursion through initial algebras, but this is totally equivalent to Y-combinator.
@PMikalaj
@PMikalaj 4 года назад
Hi, Bartosz, thanks for the great lectures and book! It took me a while to wrap my head around anamorphisms and I am still not sure whether I understand it correctly. I was confused a bit with the application of Fix as the last step in the definition of ana: ``` ana :: Functor f => (a -> f a) -> a -> Fix f ana coalg = *Fix* . fmap (ana coalg) . coalg ``` IIUC, If I take this definition of Fix ``` newtype Fix f = In (f (Fix f)) ``` It can be gradually expanded into ``` In (f (Fix f)) In (f (In (f (Fix f)))) In (f (In (f (In (f (Fix f)))))) In (f (In (f (In (f (In (f (...)))))))) ``` Fix in the line ``` ana coalg = Fix . fmap (ana coalg) . coalg ``` is the application of data constructor (aka In). As I understand it now, it is needed to match the infinite alternation of `In` and `f` to match definition of `Fix f` (data type, functor fixed point). Is my understanding correct?
@skibaa1
@skibaa1 2 года назад
45:44 Why the morphism m converts i to Fi? We know, that m converts i to a, but who said a is necessarily equal to Fi? Mr Milewski just wrote Fi without explaining where did it come from
@julianacunha3855
@julianacunha3855 5 месяцев назад
The morphism called m in 45:44 is not the same as the morphism in 42:23. Notice that a few seconds before at 42:41 there is also a morphism a-> b called m. In 42:23 he states the defn. of an initial object so an object i is initial if there is a unique morphism from i to any other object in the category. In 45:44 he says that i is an initial object hence there is exists a unique morphism from i to Fi, that he happened to call m. Fi might not be a, it might be it does not matter, what matters it that we know m exists. (i assume that after 2 years you got it but it might help someone else and it helps me to make things clearer in my head. Farewell.)
@skibaa1
@skibaa1 5 месяцев назад
@@julianacunha3855 following your reply I listened to this lecture again and this moment was very clear for me now, I would not ask any questions :) Thank you anyway
@JoelSjogren0
@JoelSjogren0 6 лет назад
I am hooked!
@jayprich
@jayprich 7 лет назад
Suppose for a general Endofunctor F of C there is no Initial Algebra - I think this implies C does not have all limits, otherwise we could find such an algebra - F in such a C can be discontinuous or incomplete in the limit. Isn't that the case for usual "1/(1+x)" algebra on the reals where expressions can result in partial functions #DIV/0 etc.?
@DrBartosz
@DrBartosz 7 лет назад
A good starting point is this paper: www.iti.cs.tu-bs.de/~adamek/initial.AT.pdf . It goes more into detail about constructing initial algebras and terminal coalgebras.
@toxicore1190
@toxicore1190 5 лет назад
Fix really reminds me of Stream
@sara-hc7wb
@sara-hc7wb 3 года назад
One issue I run into when describing algebras like this (with fixpoints of functors encoding the signature): With `Fix MonF`, I can't write any simple example expressions, because there is no way to inject a value of the carrier. I can only write boring expressions like `Fix (MAppend (Fix MEmpty) (Fix MEmpty)`, that all evaluate to `MEmpty` The way I usually get around this is by using `Free MonF a` instead, which is precisely the fixpoint of MonF + an injection. This lets me write e.g. `Free (MAppend (Pure 4) (Free (MAppend (Pure 3) (Free MEmpty))))` While this works, it's ... different from what all the literature I've seen talks about. I don't know if I'm missing something?
@BartoszMilewski
@BartoszMilewski 3 года назад
You're right, Fix MonF generates all binary trees with empty leaves, so there is really nothing to evaluate. You still have some leeway, for instance, you could evaluate all leaves to a fixed number, say 1, but that's not very interesting either. And anyway, since there is no way to impose monoid laws, this is not a real monoid. To really deal with monoids, you'd have to go to Lawvere's theories (which I discuss later). Having said that, what you can do is to parameterize the functor with one additional data type e: data MonF e a = Leaf e | Node a a. Then the fixed point in a will be a binary tree with e-type leaves. You can then define an algebra for (MonF Int a), with the carrier a that's also an Int. It would evaluate Leaf x to x, and Node x y to x+y. A catamorphism for this algebra would sum up all the leaf values. What you did also makes sense: your Pure is just an Int-carrying leaf, and you also have MEmpty leaves that evaluate to zero. The fact that zero is a neutral element is then encoded in the algebra, rather than being the (non-enforceable in Haskell) monoid law.
@toxicore1190
@toxicore1190 5 лет назад
Fix really reminds me of Stream
@toxicore1190
@toxicore1190 5 лет назад
Fix really reminds me of Stream
@stevemao1368
@stevemao1368 7 лет назад
nit: Mappend should be MAppend
Далее
Category Theory II 9.1: Lenses
41:59
Просмотров 8 тыс.
"Когти льва" Анатолий МАЛЕЦ
53:01
Category Theory II 9.2: Lenses categorically
43:42
Просмотров 6 тыс.
Category Theory II 4.1: Representable Functors
50:19
Просмотров 17 тыс.
Category Theory II 2.1: Limits, Higher order functors
42:36
Category Theory II 5.1: Yoneda Embedding
50:54
Просмотров 10 тыс.
A Sensible Introduction to Category Theory
26:20
Просмотров 435 тыс.
Category Theory II 3.2: Free Monoids
36:54
Просмотров 11 тыс.
Jesus was not crucified: the evidence with Dr. Ali Ataie
3:36:49
Category Theory II 1.2: Limits
48:26
Просмотров 24 тыс.