Тёмный

Category Theory 9.1: Natural transformations 

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

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

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 49   
@leorandomnickname
@leorandomnickname 3 года назад
This was a natural explanation. Thanks.
@PhilipSchwarzJ
@PhilipSchwarzJ 6 лет назад
thoroughly enjoyed this - love the fact he always relates concepts to programming
@SisypheanRoller
@SisypheanRoller 2 года назад
When you pointed out that the natural transformation had an interpretation as an optimization in a compiler, my mind was blown. Absolutely amazing. I can't believe this sort of knowledge is hidden behind dense graduate level textbooks. I need to let this one digest for a bit before your next lecture because that's where I start getting a bit lost. Absolutely amazing lecture. I'm so glad there's tons more for me to go through. 😁
@aboutajedyneayoub921
@aboutajedyneayoub921 3 года назад
Thanks again for recording this, it really helps me as a FP programmer and Category Theory lover
3 года назад
For me the naturality condition really only clicked when I remembered that in a category, all compositions of morphisms are also morphisms. This means there is a fifth arrow (not drawn by Prof) going from Fa to Gb, and that arrow is equivalent to the composition of both paths. This also explains why αb is not fully determined by (Ff, αb, Gf) - there can be multiple candidates for the composition to equal the fifth morphism.
@manishankarpandeypandey6741
@manishankarpandeypandey6741 5 лет назад
Best way of teaching.......I have studied from many books for this(natural transformation).but was not able understand it. Today I got it not only algebraically but also geometrically. Thank you sir.. You are awesome..
@georgezorikov3075
@georgezorikov3075 2 года назад
Yeah, what a great explanation. From intuitive understanding to formal definitions and examples in FP. Absolutely amazing
@anirudheka9950
@anirudheka9950 4 года назад
I came to two conclusions from this video that I’m not sure are valid: 1. You mentioned that a -> [a] is a natural transformation from Identity a to [a]. Does that mean every Functor constructor is really a natural transformation from the identity functor to that functor? 2. Also, thinking about your description of natural transformations as changing the packaging of an object from one functor to another. Does that mean the left map of a bifunctor could be seen as a natural transformation from the perspective of the object on the right? In which case a bimap can be seen as a commutative diagram? Thanks for clarifying!
@КлинтИствуд-ъ3и
@КлинтИствуд-ъ3и 7 лет назад
Amazing series! Thank you very much for this knowledge!
@jonaseschenburg6572
@jonaseschenburg6572 4 года назад
Thanks, Bartosz! That was a great one!
@ardiris2715
@ardiris2715 7 лет назад
This lecture elevated my card magic to a level beyond anything described in magic literature. Sleight of hand and forced cards are amateur's tricks compared to what I can do now. Without my touching the cards, I can instruct my spectator to perform a couple simple manipulations of cards' positions to achieve impossible illusions. The beauty is explaining how any one of my new illusions works requires knowledge of this underlying mapping optimization paradigm. What I could have achieved during my career as a nuclear engineer with this is a thrill future designers will enjoy in my stead. Thanks for posting these lectures.
@PunitSoni00
@PunitSoni00 4 года назад
That is interesting. Can you give an example of such a card trick?
@ardiris2715
@ardiris2715 4 года назад
@@PunitSoni00 I have not published any of my illusions. However, as Arthur C. Clarke said, technology is magic to the uninformed and I use that principle when designing my entertainments.
@laflaca5391
@laflaca5391 7 лет назад
Loved this lecture, not just a bunch of definitions and examples, this is really well explained
@fredeisele1895
@fredeisele1895 7 лет назад
Around 44:00 there was a comment that natural transformations are associative. I think what he meant was commutative. Could you respond to... "so it is almost like commutivity?" Oh, that is why they are called "commuting diagrams" (of course).
@utof
@utof Месяц назад
no i think he actually meant associativity becuase associativity is also kind of about not caring in which order to do the operations
@EnginAtik
@EnginAtik 6 лет назад
Mr Milewski set a standard on how to teach Category theory. (Apparently a set-theorist did not like his lectures and clicked thumb-down.)
@euclidestorres2844
@euclidestorres2844 2 года назад
I just came here because they said you were giving free theorems. hahaha (awesome lectures, thank you)
@marcusklaas4088
@marcusklaas4088 7 лет назад
Excellent as always.
@julianweber6227
@julianweber6227 6 лет назад
You're def. on the juice bro . "Natural" laughing my ass off
@whadevah9329
@whadevah9329 5 лет назад
So if I know that one functor, say, has a product and there is a natural transformation between this functor and some other one, then from naturality condition we can deduce that this other functor also has a product-that's why natural transformations are a "high level language" of category theory. So what we actually do is search for sub-categories inside a bigger category and define relations between them. Am I getting it wrong?
@ivcanet
@ivcanet 3 года назад
Could you say that a natural transformation from F to G is a functor from F's image to G's image? I'm not completely sure I understand the consequences of this. Let us take two arbitrary functors, but because I have no imagination I'll call them 'List a' and 'Array a' (and completely disregard whatever they might mean). If I understand correctly, saying that there exists a natural transformation from List to Array means that: • There exists a function 'x :: (f: a -> b) -> List a -> Array b' that is implemented as 'foo(List.map f)' • There exists a function 'y :: (f: a -> b) -> Array a -> List b' that is implemented as 'bar(Array.map f)' • The functions 'x' and 'y' are identical ? I don't really understand how that is possible, since 'x' and 'y' have different types.
@Bratjuuc
@Bratjuuc 3 года назад
I don't get both the mix of Haskell function signatures and C-like function signatures, AND the mix of List and Array. Also, the implementations of fmap for List and for Array are nowhere near the same, although they provide the same effect.
@mattetis
@mattetis Год назад
If I understood correctly: *any* polymorphic function n :: F a -> G a is a natural transformation. The consequence is what he explains, any funtion f :: a -> b can be applied *in any order* combined with fmap and the natural transformation: fmap f . n = n . fmap f Where the left hand fmap is for functor F and right hand fmap is for functor G. Which means that the right hand side acts (with f) on the contents of F a first and then converts it into G a. And the left hand side converts it into G a first and then acts on the contents. With some x it can be a little clearer written as: fmap f (n x) n (fmap f x) Where x is of type F a. Edit: given that F and G is not contravariant in a, or something like that. Edit2: with List a and Array a an example would be the natural transformation toArray :: List a -> Array a and the list l: fmap f (toArray l) toArray (fmap f l) Should produce identical results.
@Pitometsu
@Pitometsu 3 года назад
Can some of objects of functor's domain be images of different functors at the same time? Why so? And if not -- is that true that natural transformation is just a functor between functor's images?
@yasinyaqoobi
@yasinyaqoobi 4 года назад
I am wondering if there is a connection between finding the best (fit) morphism and natural selection.
@GustavoCosta-iu3kz
@GustavoCosta-iu3kz 4 года назад
I have a question, can we have a morphism between natural transformations? ex: we have "A" a natural transformation e B other natural transformation, i want to know if can exist a morphsm between A and B.
@DrBartosz
@DrBartosz 4 года назад
Not in the standard category. But in multicategories, you can have "modifications" between natural transformations. ncatlab.org/nlab/show/modification
@GustavoCosta-iu3kz
@GustavoCosta-iu3kz 4 года назад
@@DrBartosz thank you very much
@nirgle
@nirgle 7 лет назад
Karate chop sound at 32:04
@Bratjuuc
@Bratjuuc 3 года назад
What exactly guarantees that (alpha ∘ fmap f ≡ fmap f ∘ alpha) is always satisfied?
@amitsett8117
@amitsett8117 2 года назад
parametric polymorphism
@nayak232
@nayak232 6 лет назад
Does applying a filter on a list have a corresponding category theory operation? Looks like it is not a natural transformation since we cannot define an equivalent alpha.
@DrBartosz
@DrBartosz 6 лет назад
Since lists are recursive data structures, operations on lists come under the heading of F-algebras. Filtering could be defined as a catamorphism that uses a list as the carrier type.
@nayak232
@nayak232 6 лет назад
Thanks. I love your videos, btw.
@qseep
@qseep 2 года назад
A filter isn't a natural transformation because it's a function from (a -> Bool) -> [a] -> [a]. The type 'a' appears in contravariant position in the predicate type. To get a natural transformation, the type parameter can only appear in covariant positions.
@marcbusque6012
@marcbusque6012 6 лет назад
Is it possible to see a polymorphic function length [a] -> Int as a natural transformation from the List functor to the Identity Functor? In the video it is said to be a natural transformation from List to Const, and in the blog post of the same subject (bartoszmilewski.com/2015/04/07/natural-transformations/) it is demonstrated like so: unConst :: Const c a -> c unConst (Const x) = x length :: [a] -> Const Int a length [] = Const 0 length (x:xs) = Const (1 + unConst (length xs)) length [1, 2, 3] -- Const 3 But I can also do: unIdentity ::Identity a -> a unIdentity (Identity x) = x length :: [a] -> Identity Int length [] = Identity 0 length (x:xs) = Identity (1 + unIdentity (length xs)) length [1, 2, 3] -- Identity 3
@BartoszMilewski
@BartoszMilewski 6 лет назад
A natural transformation is a family of morphism fa->ga. Notice the same a.
@marcbusque6012
@marcbusque6012 6 лет назад
Undertood. Thanks :)
@allancto
@allancto 8 лет назад
question: 41:00 reference to Kmett using natural transformations for hs optimization, what's a good link to start?
@DrBartosz
@DrBartosz 8 лет назад
Edward Kmett uses a lot of categorical tricks to optimize algorithms. See for instance his blog posts on codensity monads: comonad.com/reader/2011/free-monads-for-less/
@PeagmaticDreamer1199
@PeagmaticDreamer1199 8 лет назад
Awesome work! I truly hope the lectures don't stop now as things are starting to get interesting (like most online resources unfortunately). Managing to cover Yoneda, Limits and Adjunctions would be really cool! Covering Monads, Algebras and Kan extensions would be EPIC (even if done in a future series soon after this one :) )
@satwikmisra2743
@satwikmisra2743 4 года назад
not my type of natural transformations tbh
@LizardanNet
@LizardanNet 7 лет назад
is it accurate to say that all functors are also endofunctors because of Identity?
@DrBartosz
@DrBartosz 7 лет назад
No, why?
@LizardanNet
@LizardanNet 7 лет назад
I was confused, sorry.
@rohanvaswani9418
@rohanvaswani9418 3 года назад
This guy is deffo not natty
@johnwalker7422
@johnwalker7422 6 лет назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-2LJC-XD5Ffo.htmlm16s - BINGO !!
Далее
Category Theory 9.2: bicategories
43:04
Просмотров 21 тыс.
Category Theory 4.2: Products
34:49
Просмотров 47 тыс.
What are...natural transformations?
14:16
Просмотров 2,4 тыс.
Category Theory For Beginners: Natural Transformations
1:11:43
Categories 3 Natural transformations
15:03
Просмотров 14 тыс.
Category Theory 4.1: Terminal and initial objects
47:47
Terence Tao at IMO 2024: AI and Mathematics
57:24
Просмотров 448 тыс.
A Sensible Introduction to Category Theory
26:20
Просмотров 436 тыс.
Category Theory 10.1: Monads
1:15:29
Просмотров 64 тыс.
Category Theory 6.1: Functors
54:10
Просмотров 59 тыс.