Тёмный

The Hardest Problem in Type Theory - Computerphile 

Computerphile
Подписаться 2,4 млн
Просмотров 130 тыс.
50% 1

Equality sounds a straightforward idea, but there are subtle problems in theoretical computer science. Professor Thorsten Altenkirch explains how his late friend Martin Hofmann solved one of the biggest problems.
More of Thorsten on Type Theory: bit.ly/C_Thor_playlist
Thorsten's paper dedicated to Martin: bit.ly/C_Thor_Paper
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

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

 

29 июл 2021

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 284   
@boredbytrash
@boredbytrash 2 года назад
RIP Martin Hoffmann :( Very sad story. He was my professor, so it hit us students hard.
@viczking8520
@viczking8520 2 года назад
you know the camera guy is lost when he hasn't said a word for 20 min straight!
@NuclearCraftMod
@NuclearCraftMod 2 года назад
I'd say the one place where I got quite lost and had to rewatch was the introduction of reflexivity, but the problem is that, if I was Sean, I wouldn't know what to ask other than "I didn't get it... can you explain that again?" :P
@ChrisLee-yr7tz
@ChrisLee-yr7tz 2 года назад
You can include me in that...
@yaeldillies
@yaeldillies 2 года назад
​@@NuclearCraftMod You know how natural numbers are defined by induction? You have two ways to make natural numbers: - The first is `zero : ℕ` - The second is `succ : ℕ → ℕ` (so for any `n : ℕ`, we have `succ n : ℕ`. Think of `succ n` as `n + 1`, but keeping in mind we haven't defined addition yet). And you also have the rules that all naturals are defined like that ("no junk") and no natural is represented in two different ways by `zero` and `succ` ("no confusion"). This is how we define *inductive types*, using the motto "no junk, no confusion". This motto ensures that to define a function `ℕ → α`, we only need to define it on `zero` and on `succ`. This is called the "elimination rule" (as opposed to the "introduction rules" `zero` and `succ n`). And when you think about it, this is *exactly* your usual induction! Defining something for `zero` is the base case, and defining something for `succ` is the induction hypothesis. Well, equality is defined as an inductive type as well, but with only one introduction rule: - `refl : a = a` In turn, the elimination rule is simpler than for naturals. It says "To prove that a = b implies some property P(a, b), it suffices to prove P(a, a)". In the video example, if you take P = sym, you get "To prove that a = b implies b = a, it suffices to prove a = a". And `a = a` is true by `refl`, so we're done.
@NuclearCraftMod
@NuclearCraftMod 2 года назад
@@yaeldillies Thanks a lot for the extra info regarding inductive types, as that does help better appreciate the form of the arguments :) However, really it was the fact that there is only that one introductory definition of equality that I didn’t understand - I just accepted it for the sake of the rest of the video. It’s not as easy for me to see how ‘refl’ is “enough” in the same way ‘zero’ and ‘succ’ are for the naturals, whether defining all equality terms, defining functions or writing proofs.
@meithecatte8492
@meithecatte8492 2 года назад
@@NuclearCraftMod Note that the constructors (here, just refl) should only handle the cases where our property (equality) holds. In any case where your equality relates something other than values of a type directly, such as "a + b = b + a", that's either because it hasn't yet been reduced to canonical form, or it contains free variables (most commonly they're bound outside with a forall). Now, once you actually substitute something for these variables and reduce fully, the only case that needs handling is that a value is equal to itself. Does that help?
@_..---
@_..--- 2 года назад
"people at the time when this was a problem said, oh yeah it's easy, we can do it and then went away and said oh hang on it doesn't work" so many problems are underestimated like this.
@recklessroges
@recklessroges 2 года назад
The whole of society is constructed on just such a house of cards, where almost every single one is a presumption or underestimation or overestimation.
@Bolpat
@Bolpat 2 года назад
You made me cry the first two seconds. He was supposed to be my bachelor's thesis advisor, but went missing before we got started. Such a loss for the world. I'll never go hiking alone.
@paullamar4111
@paullamar4111 2 года назад
Loved this! More Type Theory please!
@kamilziemian995
@kamilziemian995 2 года назад
I agree.
@marcus3d
@marcus3d 2 года назад
I'd like that, too, but explained a bit better.
@bobliboggin7375
@bobliboggin7375 2 года назад
Please, enable automatic subtitles. Non English speakers have a hard time understanding this man accent, and subtitles help a lot.
@AndreasHontzia
@AndreasHontzia 2 года назад
6:37 Iconic: "… because I am a computer scientist, ja." 🤘
@franciscovarela7127
@franciscovarela7127 2 года назад
Canonical, jawohl!
@LindaRistevski
@LindaRistevski 2 года назад
Prof T always has amazing explanations. RIP M Hofmann. Will be happy to see more about type theory on here.
@sappelsap534
@sappelsap534 2 года назад
“If I replace both with refl, so I have to prove that relf is equal to refl then i refl”
@TheMaginor
@TheMaginor 2 года назад
rofl
@k.c.sunshine1934
@k.c.sunshine1934 2 года назад
When one knows the depth that this professor knows, it is irrelevant which side goes outside on your tee-shirt.
@ryth1441
@ryth1441 2 года назад
😭😭😭
@icollectstories5702
@icollectstories5702 2 года назад
Perhaps he is proving an inverted shirt is still a shirt. Or he knows this is the side with fewer stains.🙃
@LKRaider
@LKRaider 2 года назад
He is just proving that the generic type for “t-shirt” can still represent the category of all t-shirts, be it folded, rotated or inverted!
@shigekax
@shigekax 2 года назад
I have a shirt of the same kind of which the normal side is the reverse and it raises question but it's a nice shirt
@jawad9757
@jawad9757 Год назад
he's ascended beyond the material realm
@MaxPicAxe
@MaxPicAxe 2 года назад
I've been working on a programming language where equality of types etc are necessary (for example, are two state machines equal even if they are encoded differently), and this video was very beneficial to my research. When you mentioned how a simple boolean can be encoded in different ways, it made me feel like there is information about what I'm looking for already out there and that I'm not in some obscure dead zone that hasn't been entered before. (edit: I probably phrased this comment very badly haha)
@up4life108
@up4life108 2 года назад
Look up isomophism of algebraic data types if you want to know how more "complex" types can be "encoded" differently just like booleans as integers
@theb1z0n
@theb1z0n Год назад
What is the name of this language? Could you please share the link here?
@MaxPicAxe
@MaxPicAxe Год назад
@@theb1z0n Essence. It's not public unfortunately, it may not be public for many more years.
@fluffymcdeath
@fluffymcdeath 2 года назад
I think I was following along right up until the Professor started talking.
@superscatboy
@superscatboy 2 года назад
I knew I was already lost when the title said "type theory"
@SubTroppo
@SubTroppo 2 года назад
I suspect that I am lost prior to clicking on the video, but the optimist in me cannot be thwarted.
@PapaWheelie1
@PapaWheelie1 2 года назад
I was trying to click on something about food probably and I’m just wandering around here now
@ScottLahteine
@ScottLahteine 2 года назад
When it comes to understanding formal systems and the limitations of proofs you can't do much better than "Gödel, Escher, Bach: An Eternal Golden Braid" by Douglas R. Hofstadter. Everyone interested in math, computers, science, or philosophy should read this classic (or at least as much of it as you can before the binding disintegrates). It will change how you see everything and inculcates a true appreciation for the challenges we face in obtaining that elusive thing we call "truth."
@franciscovarela7127
@franciscovarela7127 2 года назад
Oh, you are cruel. I read the author's preface to the 20th anniversary edition of GED and now feel that this strange loop is falling into the abyss. I may never be the same.
@DocBree13
@DocBree13 2 года назад
I’ve almost purchased this many times - now I’m convinced I need to read it - thanks :)
@donaldb1
@donaldb1 2 года назад
That is a brilliant book. It is work of genius. But it is also extremely witty and entertaining. It covers deep, difficult subjects, but explains them superbly at a level anyone can get into, if they are prepared to put in the effort. It is a big book, but that is mainly because every idea is explained in more than one way. He comes at everything from multiple different angles until you feel it all fit together.
@seiryn3082
@seiryn3082 2 года назад
When I was a kid, like 11-12 years, my dad show me this book because I know i loved math, and expected i will ony read the dialogues , which are interesting enough by themself. But i ventured in the classic parts and discovered the TNT. It truly changed me and enlighted me, because at this age I was the kid that provid the answer without the reasoning, considering it futile. This showed me the beauty of proofs.
@pmcate2
@pmcate2 2 года назад
I would say hofstadters book is a primer for people who haven’t done many proofs. An even better book is Peter smiths An Introduction to Godels theorems.
@VincentKun
@VincentKun 2 года назад
I studied the intuitionist Martin-Löf type theory in a course this year, it's really interesting but so obscure argument that few know. I would like other videos about this topic So sorry for Martin Hoffmann.
@musashi939
@musashi939 2 года назад
Yeah it's a bit obscure. As someone who studied cs and understands all the basics here (group theory, isomorphisms,..) I didn't quite get the explanation, haven't had a lesson on type theory. Guess I need to read up on it this on my own. But very interesting topic nonetheless.
@theb1z0n
@theb1z0n Год назад
What is the university that you studied it in?
@VincentKun
@VincentKun Год назад
@@theb1z0n University of Turin in Italy, the course was called Formal methods for computer science
@georganatoly6646
@georganatoly6646 2 года назад
interesting way to frame problems, as a programmer I'm used to thinking in the context of math or object related sets, but this looks like an interesting means of standardizing a mixture of the two to kind of more directly reason about it, and specifically a more direct means of incorporating logic through proofs
@AdrienLegendre
@AdrienLegendre 11 месяцев назад
This is the type of presentation that motivates the viewer to want to learn more. Excellent Professor Altenkirch!
@kamilziemian995
@kamilziemian995 2 года назад
Computerphile videos with Thorsten Altenkirch from 2017 make me seriously interested in homotopy type theory and type theory in general. So I want more videos about this subject on this channel. PS. I still try to crack syntax of type theory.
@LKRaider
@LKRaider 2 года назад
His channel has more in-depth content!
@Jaylooker
@Jaylooker 2 года назад
This provides some context to homotopy type theory since fundamental groupoids can be used
@LKRaider
@LKRaider 2 года назад
can be used ... what?
@TheRefinedGentleman
@TheRefinedGentleman 2 года назад
This solution is beautiful, I love it!
@Diapolo10
@Diapolo10 2 года назад
I know that I'm kind of nitpicking, but I really wanted to say something; "strong typing" is not a well-defined term, and Professor Torsten probably should've used the term "static typing" instead. Static typing is when variables have set types, dynamic typing is when they don't. These are both well-defined and understood terms. Strong typing and weak typing have no real definitions, for instance I'd argue C is weakly typed because you can bypass the type system entirely with void pointers, while I could say Python is strongly typed because while its types are dynamic, they're strictly adhered to and nothing gets implicitly converted to another type.
@kmill31415
@kmill31415 2 года назад
I'm not so sure these things are so clear cut -- you could say that Python is statically typed, too. It's just that every variable refers to a PyObject. What types do (from a type theory point of view) is specify the interface/API for a variable. Python gives you an interface where different methods of the PyObject get called in different situations. There's a related concept called a subtype, which consists of all those things with a specific type that satisfy some given property. PyObjects have a very rich interface, so there are many interesting subtypes in Python, for example by subclassing or duck typing. I think what makes typing "dynamic" is when a program checks whether something is in a given subtype at runtime. Unlike what Prof. Thorsten said, which is that everything can have at most one type, things can be in multiple different subtypes. Python objects can have a length, have arithmetic operations, be iterable, among many others subtypes. Even Haskell has dynamic subtype checking. For example, there is the subtype of nonempty lists, and the head function is only defined for this subtype. If you give it an empty list, the Haskell runtime will stop your program. Some type theories (like the one in Lean) let you turn subtypes into bona fide types that are statically checked, though when you have an object satisfying a subtype you have to supply a proof that you can do the "cast." Languages like Java have an extremely weak version of static subtyping in the form of interfaces. If I'm trying to say anything, it's that there is always some amount of dynamic subtyping in a program, no matter the type system, and it's interesting to find nice ways to express those subtypes statically. This can be difficult, though, since more elaborate subtypes can require that part of your program be a real mathematical proof. Sometimes you can get around this by having functions return some kind of Optional value, returning None for inputs that aren't part of the subtype.
@emiflake
@emiflake 2 года назад
I think in this case nominal typing vs structural typing is also an interesting duality to consider. Set theory deals with unions, subsets, etc. And so does structural typing, you can have types unify based on their structure alone. Nominal typing works more like type theory in the sense that types never share element because every element is sort of inherently tagged with its name (hence "nominal")
@kmill31415
@kmill31415 2 года назад
@@emiflake A sort of strange thing in type theory like the ones in Coq, Agda, and Lean, which all appear to have nominal typing, is that there must be types that share elements -- this is referred to as the failure of type constructors being injective. There are "too many types" for there to be enough tags to go around, so to speak. This is OK though, because statically you determine types based on how things are constructed in source code. At runtime, though, this means there is necessarily some type erasure (like in the Java generics sense). There's another level to this, which is that types have associated constructors that are used to create elements of that type. You could say the subtype of things created with a particular constructor is nominal because elements are essentially tagged with how they were constructed. An interesting way to implement structural typing is to add in a system that tries to automatically insert reasonable coercion functions when types fail to unify (this can be used in other situations, too, like when using a natural number where an integer is expected). I'm not sure if that does everything you'd want for structural typing, though.
@JivanPal
@JivanPal 2 года назад
Some level of ambiguity also exists in "statically typed", too. One can argue that C is not statically typed, in the same way that you argue C is not strongly typed: you can subvert the type system via casting, it just has to be done explicitly, unlike in, say, PHP, where types are expressly dynamic by design. The ambiguity in the use of the term "strong typing", and the nature of the term "static typing", is not relevant in type theory. Such ambiguity or ability to subvert static typic only exists in real, practical programs, such as in the example you give (e.g. casting pointers and datatypes at the potentially arbitrary whims of the programmer in C). It comes from the fact that real programs deal with actual binary data, instances of types in real programs are ultimately always realised as a binary encoding of whatever abstract thing they represent, and thus one can "translate" freely between different types by re-interpreting the underlying binary encoding. To give a simple example, one can "translate" between signed integers and unsigned integers by e.g. doing int x = -7; void* p = (void*)(&x); unsigned int y = *(unsigned int*)p; printf("%d", y); // prints '4294967289', assuming `int` is 4 bytes/32 bits But type theory is more abstract than this. In pure type theory, there is no notion of translating/re-interpreting an instance of one type as an instance of another. This is why we have tailor-made languages and apps like Agda and Coq which are specifically designed for applications of type theory and for performing computer-assisted proofs. The likes of Agda are not only statically typed like C, but they are _completely, definitively_ statically typed, unlike C, in the sense that there is _absolutely no way_ to subvert the type system; casting between types is not a feature.
@SimonBuchanNz
@SimonBuchanNz 2 года назад
@@JivanPal but you're just describing strong typing. Static typing means there's type checking done at compile time, dynamic typing means done at runtime (languages can also do both or neither). Strong typing means you can't do "bad things" with types, and is somewhat ambiguous across languages because different languages define "bad things" differently, and define the bar for whether the language is strong as a whole differently: does it need to be completely, provably strong in all situations? Is there an exception for "unsafe" tagged code? Writing to /proc/self/mem? The programmer doing things the language hasn't defined?
@mcspud
@mcspud 2 года назад
I actually think this is the best video you've ever done. Prof Thorsten described it perfectly in a very easy to understand manner.
@cstrep
@cstrep 2 года назад
but... can you prove it?
@Turidus
@Turidus 2 года назад
Doing Math with numbers? easy. Doing math with letters? okay. Doing math with symbols? hard. Doing maths with mathematical proofs? Blowing my mind ^^*
@randomsoul294
@randomsoul294 2 года назад
no
@LKRaider
@LKRaider 2 года назад
Proof and models are the bread and butter of mathematics
@BlastinRope
@BlastinRope 2 года назад
@@LKRaider and if you eat nothing but bread and butter for every meal you wouldnt be very healthy
@VasuJaganath
@VasuJaganath 2 года назад
Proofs are nothing but programs. Theorems are nothing but types. Simplification of proofs is nothing but evaluation (running) of programs. Type Theory is the grand unified theory of computation and can be a solid basis for all of mathematics*.
@ratsby
@ratsby 2 года назад
Looks like Professor Altenkirch has lost a lot of weight! Good for him!
@pedrobernardo5887
@pedrobernardo5887 2 года назад
Understood about 1% of it. Loved it!
@Abir_Haque
@Abir_Haque 2 года назад
Great video! I also like how Thorsten used continuous form paper during his explanation.
@hrclful
@hrclful 2 года назад
It's oe of the key artifacts / show elements of Computerphile. I wonder where they get those.
@LKRaider
@LKRaider 2 года назад
@@hrclful probably by raiding the university museum archives! j/k
@laykefindley6604
@laykefindley6604 2 года назад
I tried to follow this, but I think my expression after it is...what? I would love a few videos breaking this all down step by step. Fingers crossed!!
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Yes that’s the plan. There is already one video on Agda on the channel now and another one being prepared.
@laykefindley6604
@laykefindley6604 2 года назад
@@ThorstenAltenkirch awesome! Glad to hear!
@cluerip
@cluerip 2 года назад
A buddy of mine did a project on mathematically modelling where lost hikers would be likely to go over time. For a second I thought it was heading that direction.
@jezza10181
@jezza10181 2 года назад
There's something similar that's used to find people lost at sea. It's based on Bayesian updating.
@MrTej780
@MrTej780 2 года назад
It clicked for me, thanks for the explanation
@BlastinRope
@BlastinRope 2 года назад
I like how he didnt forget to return control after the sad story
@mag2XYZ
@mag2XYZ 2 года назад
Great video, but I couldn't really grasp the importance/impact of the solution to this problem. Like, what are consequences of this?
@LKRaider
@LKRaider 2 года назад
The Univalence principle, in combination with this work by Martin, can be used to rebuild the whole foundation of mathematics!
@muhammadsiddiqui2244
@muhammadsiddiqui2244 2 года назад
The only thing I learned is that Prof. Martin was a brave genius because he worked on something which I could not understand the heck about it ... Edit: And that something is related to types ...
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Sorry Muhammad. If you have some time you can listen to my lectures which are linked in the comments. Also I am always happy to answer questions.
@muhammadsiddiqui2244
@muhammadsiddiqui2244 2 года назад
@@ThorstenAltenkirch Thanks a lot for reply. It was just on a lighter note. I have seen your channel. Will watch your videos.
@davidgillies620
@davidgillies620 2 года назад
More like this please. I am a software engineer, not a computer scientist, so it is nice to see some of the theoretical underpinnings (I was blown away when I discovered monads and even more blown away when I found C++17 supported them - std::optional is the Maybe monad and now I use it all the time for operations that can fail like DB lookups etc.)
@JivanPal
@JivanPal 2 года назад
Don't get too carried away with functors and monads in such languages! In the likes of C++, you can almost always implement things more simply/cleanly by using e.g. `null` in place of `std::optional.empty` to indicate an error state, thereby removing a layer of encapsulation.
@jawad9757
@jawad9757 Год назад
@@JivanPal lol
@JivanPal
@JivanPal Год назад
@@jawad9757 double lol
@jawad9757
@jawad9757 Год назад
@@JivanPal by using null pointers, you get rid of all of the safety afforded by optional types
@JoJoModding
@JoJoModding 2 года назад
I know a bit more about this but am still mesmerized by Hedberg's theorem. Why do identity proofs become unique when your Type is discrete?
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
A decidable proposition is the same as a Boolean and equality of Booleans is trivial. Maybe this helps?
@sonicmaths8285
@sonicmaths8285 24 дня назад
Awesome!
@bulbuwu7749
@bulbuwu7749 2 года назад
Thanks awesome video
@setlonnert
@setlonnert 2 года назад
On a side note, Per Martin-Löf's type theory can actually be programmed. Maybe that was the goal from the 80'ties when they sought a real programmable logic (without cuts etc)? And, in a way, that would solve programming as "what" rather than "how". It would also make programs more of proofs than sequences of instructions. But for an ordinary programmer, programming in type theory is hard. Much harder than one would like it to be.
@davidwuhrer6704
@davidwuhrer6704 2 года назад
It makes it more difficult to put errors in empty files because you actually have to think about your domains. You can't to things like 1/0*8+'Batman'. But it makes your code easier to read, which makes it easier to maintain. With functional programming, the code often looks declarative rather than procedural. DSLs are _supposed_ to be declarative. But as my example above shows, untyped functional programming has no guarantee that the code does what you expect. As much as Matlab scripters hate it: Strict type checking is your friend.
@davidwuhrer6704
@davidwuhrer6704 2 года назад
@you- tube Programming is a fundamentally inhuman activity: There are no "happy accidents", you have to be diligent, consider all that can go wrong, and the feedback is mostly being shown your mistakes. And yet, programmers say that it is the most fun you can have with your clothes on (clothes not mandatory). As Shannon Garrity once observed: Programmers are not human.
@anthonyhart7878
@anthonyhart7878 2 года назад
So, your type theory doesn't have inheritance? It was stated that once an entity was typed that it wouldn't be of another type... In C#, my string is still an "Object" type...
@Bolpat
@Bolpat 2 года назад
No, Martin-Löf type theory doesn't have inheritance. Technically speaking, the type of prime natural numbers is not a sub-type of the natural numbers. The prime numbers type is modelled as a so-called Sigma type, also called a dependent pair type, that is a type containing pairs, where the type of the second entry may depend on the value of the first one. In the case of prime numbers, the first entry is the natural number to be a prime. The second entry is a proof (as explained in the video, that is a program) that in one way or another proves that the number is in fact prime. If the number is not a prime, no such proof can exist, and therefore, there is no pair containing it. One can prove that all possible proofs of prime-ness _of the same number(!)_ are equal. So the second entry of a such a pair provides no information beyond its existence. And that is what justifies talking about primes being a sub-type of the naturals in some textbooks. So, technically, there are no sub-types, but practically, there are. Another kind of de-facto sub-types is inclusion functions. If there's an injection function _inc_ that maps Nat to Int preserving everything interesting like operations and such, formally correct, it would be a monomorphism, we can look at Nat as if it were a sub-type of Int. Even programming languages are often smart enough to figure out where to insert the injection function: if z : Int and n : Nat, then z-n actually is z-inc(n) as minus is only available for Int. Then there's the type _Type,_ the Universe that “contains” the types. It is itself a type and it's objects are, well, types. So 1 : Nat, and Nat : Type. But Type cannot be of type Type, that would lead to inconsistencies. So instead of having one Universe, type theory requires an infinite hierarchy of Types, usually labelled Type0, Type1 and so on, where Nat : Type0 and Type0 : Type1 and Type1 : Type2 and so on. As far as I know - and please do _not_ take my word alone for it, those Universes are cumulative, so Nat : Type1, too. So smaller Universes are truly sub-types of larger Universes. Inheritance as in C# and Java isn't something commonly found in dependent type theories. That's a very different branch of type theory. Unfortunately, they're named similarly, but don't have too much in common.
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
I think sun typing is a notational convention. There is an embedding for example from natural numbers to integers and whenever you need an integer but only have a natural number you insert it automatically. However organising these embedding a effectively is certainly a non-trivial task. However it shouldn’t be at the core of a type system but in a component we call elaboration.
@Bolpat
@Bolpat 2 года назад
@@ThorstenAltenkirch Yes. There's also an embedding from the primes as defined in my comment above to the naturals: just take the first entry of the pair.
@fattimiv
@fattimiv 2 года назад
I really struggled to get what this was about. I feel like maybe too much was lost in "not trying to give too much detail about [XYZ]..." Maybe I have just missed some videos that would give background info but this one really lost me.
@FriendzoneLP
@FriendzoneLP 2 года назад
''You see I Start with zero, because I'm a computer scientist'' xD
@malkuchecker
@malkuchecker 2 года назад
My favourite! nice explanation, very Interesting Topic also 9:00 computer lagging a little
@barrotem5627
@barrotem5627 2 года назад
Please add captions !
@NorthWay_no
@NorthWay_no 2 года назад
Sadly this passes way above my head, and I can feel how this part of CS is Not My Kind Of Thing. Happy to see the dress code of professors to be spreading around though!
@hrclful
@hrclful 2 года назад
"Speak softly but make a severe dent in type theory" - Theodore Roosevelt
@---do2qd
@---do2qd 2 года назад
would you say this is not your .... type of thing?
@MatthewHaydenRE
@MatthewHaydenRE 2 года назад
Loving the inside out shirt.
@pmcgee003
@pmcgee003 2 года назад
"Thorsten's just this guy, you know".
@TMJ937
@TMJ937 2 года назад
RIP Martin. Great tribute to him, and video guys.
@AnarchoAmericium
@AnarchoAmericium 2 года назад
"I just wanted to understand types, now I'm learning about ∞-groupoids, (∞,1)-categories of (∞,1)-toposes, n-homotopies, n-truncation, higher Isbell duality... Where did my life go so wrong..?"
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Yes, I feel your pain.
@martijn3151
@martijn3151 2 года назад
Pro tip for the cameraman: if someone is right handed, film from the left side.
@namelastname4077
@namelastname4077 2 года назад
if there is a chair on the left side, AND...
@LKRaider
@LKRaider 2 года назад
Or use a mirror!
@MCRuCr
@MCRuCr Год назад
what does it imply to proof statements about proofs themselves?
@kap1840
@kap1840 2 года назад
I wish there were subs
@dralfonzo24
@dralfonzo24 2 года назад
Getting huge Godel's Incompleteness Theorem vibes halfway through this video. Are the concepts connected?
@datenraffzahn6094
@datenraffzahn6094 2 года назад
When he said there are multiple ways representations of equality within types, I also thought of that as well as Turing's theorem about computation. Basically there are multiple ways computer programs can be represented while producing the same output, under what aspects are such two program considered 'equal' or 'identical'? All these theorems Goedel and Turing are at least related to or affecting each other. On a wider scale you can apply this to scientific theories as well. Consider two scientists coming up with an equal theory, but either use a completely different language or vocabulary to represent the same thought, even use different ways or methods of proof. Who gets credited for the discovery? Its always mind blowing how much uncertainty arises when asking questions about 'equality' or 'identity'...
@pierreabbat6157
@pierreabbat6157 2 года назад
How do you write the programs? What do they look like?
@zilvarro5766
@zilvarro5766 2 года назад
Yeah. I was screaming that question to my screen during the video 😂 In particular: What does it mean for a program to prove something. Or programs to be considered "equal".
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Check out Agda which is also used in the Type Theory lectures which are linked in the description.
@Bratjuuc
@Bratjuuc 2 года назад
Also Idris language
@NoHandleToSpeakOf
@NoHandleToSpeakOf 2 года назад
Are you saying that we should only compare apples to apples and there are more than one apple around?
@LKRaider
@LKRaider 2 года назад
🍎 != 🍊
@willd4686
@willd4686 5 месяцев назад
What does it mean for to proofs to be equal? Only that they prove the same thing?
@gidi1899
@gidi1899 2 года назад
Doesn't it means we should try to define: Relative Equality of types Maybe we need a set of relative equalities, containing the 1 to 1 projection as the tool for a specific relative equality. I guess we move from discussion of the equality property of the set, to the projection quality of the set.
@erwinmulder1338
@erwinmulder1338 2 года назад
Wait, so does this mean that ANY type that has the same finite number of elements or has a 'countably infinite' number of elements is the same type?
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Yes, indeed. Because you cannot observe so much from a mere type. If you add more structure then you can distinguish more. E.g. not all groups with a fixed number of element are the same.
@LKRaider
@LKRaider 2 года назад
@@ThorstenAltenkirch does it mean only bijective groups are provably equal then?
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
@@LKRaider no why? I mean ok a commutative group will not be equal to a non-commutative group but certainly two non-commutative groups can be isomorphic and hence equal.
@_K_y
@_K_y 2 года назад
RIP Martin Hofmann
@AtriumComplex
@AtriumComplex 2 года назад
Does anyone have a MOOC or textbook they would recommend to learn more type theory?
@Computerphile
@Computerphile 2 года назад
There's a link in the description
@empathogen75
@empathogen75 2 года назад
IMO the best way to learn it is to learn a language like Haskell that leans on types heavily.
@chriswarburton4296
@chriswarburton4296 2 года назад
@@empathogen75 Dependent types are key to type theory, which Haskell doesn't have; or, more precisely, Haskell built up a very complicated non-dependent type system, then recently started to add dependent types, resulting in a big confusing tangle of features. Dependent types are actually much simpler than Haskell (e.g. there's no distinction between terms and types!). Hence I'd recommend Agda or Idris for this sort of thing, rather than Haskell.
@dialecticalmonist3405
@dialecticalmonist3405 2 года назад
J programming language.
@nournote
@nournote 2 года назад
(How) are category theory and type related?
@CircuitrinosOfficial
@CircuitrinosOfficial 2 года назад
What does it mean for two proofs to be equal?
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
The same as two programs being equal.
@morkovija
@morkovija 2 года назад
Wish I understood this better
@willyh.r.1216
@willyh.r.1216 2 года назад
... the type theory opens a new way of doing math. Really love it. This new math could have a cool name like: Mathoid or Algomath or Quantumath.
@MCLooyverse
@MCLooyverse 2 года назад
Or... Type Theory.
@sosariau1973
@sosariau1973 Год назад
It is called univalent foundations.
@Detsiwt6161
@Detsiwt6161 2 года назад
I really tried but there are a number of places where I just cannot parse the sounds I'm hearing into sensible sentences. Can't tell if it's the topic that's confusing or just missing information cause I'm bad at parsing unclear vocalizations (though likely some of both). But please make correct subtitles if you can. :)
@softwarelivre2389
@softwarelivre2389 2 года назад
Yeah, subtitles would be of help, even more so for non-native english speakers.
@danieljensen2626
@danieljensen2626 2 года назад
I know what most of these words mean on their own...
@LKRaider
@LKRaider 2 года назад
p, q, a, b ... erm yes, I heard of those...
@dognip
@dognip 2 года назад
If only this video had captions...
@madvorakCZ
@madvorakCZ 2 года назад
R. I. P. Martin Hofmann
@SimGunther
@SimGunther 2 года назад
The hardest problem: time travel in type theory
@AnarchoAmericium
@AnarchoAmericium 2 года назад
Nah. That's just a continuation type.
@aDifferentJT
@aDifferentJT 2 года назад
Interestingly in Idris you can prove uniqueness of equality proofs.
@NNOTM
@NNOTM 2 года назад
In Agda, you can prove it by default, too, because it has the K axiom (vaguely similar to J from the video, but lets you prove UIP). But you can add the flag --without-K, and then you can't prove UIP anymore.
@chriswarburton4296
@chriswarburton4296 2 года назад
Many systems can have UIP as an axiom (or something equivalent, like K). That was quite popular, since it made some proofs easier (hence why Agda has this, and apparently Idris too). There was no reason *not* to have UIP; until univalence came along, which is incompatible with UIP. That's when people started using the '--without-K' option in Agda :)
@okuno54
@okuno54 2 года назад
I wonder if that design choice comes down to the difficulty of efficiently implementing higher inductive types. Most well-known types in programming are plain inductive types which are easy to implement (little more than a discriminated union), and uip does hold for these kinds of types.
@davidwuhrer6704
@davidwuhrer6704 2 года назад
Doesn't UIP contradict Rice's lemma?
@droppedpasta
@droppedpasta 2 года назад
Any time I’m starting to feel smart, I watch something like this. Problem solved.
@jpjude68
@jpjude68 2 года назад
it would be so much easier if functions/statements could be executed backwards to be absolutely sure that there's a 1 to 1 correspondence between types. It seems like there's a chance that if 2 different functions are used, it may result in a completely different type. If functions/statements use multiple arguments, it's then impossible to have the original arguments when run forwards then backwards, we may only obtain a range of valid arguments in which the original arguments can be found...
@chriswarburton4296
@chriswarburton4296 2 года назад
Prolog can run functions backwards (more precisely, it defines relations rather than functions, and uses search to find values related to the ones we give, whether that's an "input" or an "output"). For multi-argument functions, currying can be useful. There are also languages like Racket, which allow multiple return values; that might be useful :)
@jpjude68
@jpjude68 2 года назад
@@chriswarburton4296 hmm neato!
@SimonBuchanNz
@SimonBuchanNz 2 года назад
Not much to do with multiple arguments, they're just a single tuple argument. The real problem is you need to handle expressions that aren't injective, for example x / 4 where x is an integer will result in the same value for 4 different possible values for x. And that's an easy one.
@chriswarburton4296
@chriswarburton4296 2 года назад
@@SimonBuchanNz Yep. Prolog (and related systems, like Kanren) handle this by returning multiple values (or a set/stream of values, if you prefer). I know Prolog's resolution algorithm relies on first-order logic, and wouldn't work in a higher-order logic like type theory. For example, in type theory we cannot ask 'does value V have type T?' (unlike set theory, where 'is element of' is a predicate which can be true or false). Instead, we would have to make an encoding of type theory, perform our search using that encoded form, then 'decode' the result back to a normal type theory value. This latter 'decoding' step is a challenge, since it would either introduce inconsistency, or incompleteness. Fascinating idea though!
@LKRaider
@LKRaider 2 года назад
@@chriswarburton4296 do you have more details of that encoding/decoding of type theory?
@henrikoldcorn
@henrikoldcorn 2 года назад
Hmm. I approximately followed until the ending - it’s not clear to me what the significance of this result is.
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Equality should identify objects that behave the same way. You need groupoids to handle this sort of equality for types.
@totalolage
@totalolage 2 года назад
I have no idea what I'm watching but I love it. If I get the chance to take type theory I'll make sure to get some basics then come back to this.
@TremereTT
@TremereTT 2 года назад
I did Kerninformatik (core informatics) for 4 Semesters....also had no idea.... Learned it all later in my second try ! turns out there is nothing to calculate, it's all about defining things or recognizing how things fit into defnitions....
@madvorakCZ
@madvorakCZ 2 года назад
I am always confused when somebody elaborates on whether one proof is equal to another proof.
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Since proofs are programs it reduces to the question wether two programs are equal.
@marklonergan3898
@marklonergan3898 2 года назад
RIP.
@hansisbrucker813
@hansisbrucker813 2 года назад
How does this relate to category theory? 🤔
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Category and Type Theory work very well together. Groupoids are categories where every morphism is an isomorphism. However to model types properly you need higher categories: types are weak infinity-1 groupoids.
@hansisbrucker813
@hansisbrucker813 2 года назад
@@ThorstenAltenkirch thanks 😊
@adamkimberley2575
@adamkimberley2575 2 года назад
RIP Martin Hoffman.
@KingPauke
@KingPauke 2 года назад
his shirt though
@peterhudecdotcom
@peterhudecdotcom 2 года назад
If only the camera was to the left of professor so he wouldn't obstruct what he was writing with his hand.
@bigJovialJon
@bigJovialJon 2 года назад
The Caps Lock.
@Xayuap
@Xayuap 2 года назад
o'course they are the same as they are infinitely countable, and they are also the same as Rationals
@allp84
@allp84 2 года назад
So im just seeing this video 2 weeks after it launched. Of the 2 mio suns, you haven't even gotten 70k views. I was aware that RU-vid was suppressing independent news but is this now also affecting informational videos?
@luiul5917
@luiul5917 2 года назад
Is the shirt inside out?
@hrclful
@hrclful 2 года назад
No
@nosuchthing8
@nosuchthing8 2 года назад
What is type theory
@Ryan_Hokanson
@Ryan_Hokanson 2 года назад
@@roman-fo2sk Which is a type of theory.
@drdca8263
@drdca8263 2 года назад
Are you familiar with the types in programming languages? It is like that, except as an alternative foundation (or, family of foundations) of math. You talk about types, and terms that belong to types, and how, given some terms of some types, how you can construct some other terms of other types (or of the same types), and things like that.
@ttt69420
@ttt69420 2 года назад
this is a level of abstraction that I'm not comfortable with
@AntiWanted
@AntiWanted 2 года назад
NIce
@tera.
@tera. 2 года назад
Would love if video had captions 🙁 It's too hard for me to understand what's being said at times
@johnqpublic2718
@johnqpublic2718 2 года назад
The Hardest Button to Button: uh oh!
@feandil666
@feandil666 2 года назад
I have trouble following the video after an intro like that.... yeah, some people are just too brave
@koysdo
@koysdo Год назад
is it just me smelling the black marker?
@vitaminprotein862
@vitaminprotein862 2 года назад
He looks like Bradd Pitt lol...
@markuspfeifer8473
@markuspfeifer8473 Год назад
Isn’t that basically a typed version of rice-Shapiro?
@jonathanschmidt5841
@jonathanschmidt5841 2 года назад
Germo just like me
@user-qo3qm7ud1d
@user-qo3qm7ud1d 2 года назад
everything seems to be clear, but in fact I did not understand anything (the deep meaning of this whole video), especially what is the practical application of this all, even if it was possible to prove it P.S. Maybe we just need a lot of good examples?
@ThorstenAltenkirch
@ThorstenAltenkirch 2 года назад
Indeed, sorry for not saying more due to lack of time. We like to identify objects which behave the same even though they are defied differently. This is important both in Mathematics and in Computer Science. The equality in the groupoid model gives you this.
@user-qo3qm7ud1d
@user-qo3qm7ud1d 2 года назад
@@ThorstenAltenkirch thank you for your specifying. The sense of the video now became more clear
@fabianforslund4622
@fabianforslund4622 2 года назад
hello torsten, I think you did a good job at introducing type theory and presenting that problem. Martin Hofmann 1965 - 2018. /cse-student, gothenburg
@MCLooyverse
@MCLooyverse 2 года назад
But... those are different kinds of equality? You cannot prove ℕ = ℤ, because they are different (irreducible) symbols. You cannot find an a such that refl a : ℕ = ℤ. Now, bijection is a totally valid and useful notion of equality, but it is not the same as the basic refl-only kind. That said, I'm sure I'm misunderstanding something. I've been dabbling in Type Theory for maybe a year; he has been actively involved in research for much longer.
@tonaxysam
@tonaxysam 3 месяца назад
The thing is that, the equality mentioned here is named "propositional equality", which is like "equal for what we care about". If You Say "two things are equal if there is a bijection between them" then sure enough, there is a proof that N and Z are equal. But they are NOT equal if You take bijections that respect adition for example. The set of real numbers and the Interval (0, 1) are equal in terms of topological properties. But they are NOT equal as metric spaces. One is bounded and the other isn't
@jacopo4395
@jacopo4395 2 года назад
SUBTITLES
@WillEhrendreich
@WillEhrendreich 2 года назад
I know some of these words..
@a51mj12
@a51mj12 2 года назад
IM STRAIGHT SLEEPINK!!! 35yr young here.
@ZGGuesswho
@ZGGuesswho 2 года назад
they had us in the first half ain't gonna lie
@MartinMaat
@MartinMaat 2 года назад
I am an experienced and fairly accomplished computer programmer. I know my languages and type systems. So when I saw the video I got interested. I watched it start to finish, trying to map what is told to programming languages, trying to imagine a practical application. I failed to do so. Now I am wondering: is that because there is not enough substance to what was told, was it not explained well enough or am I just not smart enough?
@123TeeMee
@123TeeMee 2 года назад
It’s just theory stuff, but the properties of operations like commutativity and associativity might be useful to know if you want to define operations on types you have made. E.g say you have a type for a stack of chairs, you could define an operation of syntax x
@123TeeMee
@123TeeMee 2 года назад
He deals with propositional logic which has a certain syntax that he uses so you’d need to know that for the video. This isn’t programming at this point.
@123TeeMee
@123TeeMee 2 года назад
Basically it’s relying on computer science theory so if you haven’t studied it will be gibberish
@123TeeMee
@123TeeMee 2 года назад
I also don’t think it’s explained too well and his hand gets in the way
@iabervon
@iabervon 2 года назад
Type theory is deep in figuring out whether the people who specified a programming language did a good job. It's not a tool like a hammer, but rather something like a training method for people who inspect hammer factories. A proof that an implementation of JavaScript doesn't have any optimizations that introduce security vulnerabilities could be in type theory, for example.
@roman9509
@roman9509 2 года назад
what is he talking about
@drdca8263
@drdca8263 2 года назад
Type theory
@blubberkumpel6740
@blubberkumpel6740 2 года назад
explain it like iam 5. please....
Далее
Eliminating Run-Time Errors with Agda - Computerphile
18:37
Propositions as Types - Computerphile
17:46
Просмотров 97 тыс.
Stupid Barry Family Vs Prisoners
00:26
Просмотров 1,8 млн
Bit Blit Algorithm (Amiga Blitter Chip) - Computerphile
26:02
Automated Mathematical Proofs - Computerphile
18:02
Просмотров 89 тыс.
Types of PDF - Computerphile
13:57
Просмотров 129 тыс.
Hacking Out of a Network - Computerphile
25:52
Просмотров 238 тыс.
∞-Category Theory for Undergraduates
1:53:51
Просмотров 39 тыс.
Strange Pattern in symmetries - Bott periodicity
14:50