Propositions as Types - Computerphile

Поділитися
Вставка
  • Опубліковано 26 вер 2017
  • Mathematics once again meets Computer Science as Professor Altenkirch continues to discuss Type Theory
    Thanks to Lily the dog!
    / 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

КОМЕНТАРІ • 198

  • @ThePritt12
    @ThePritt12 5 років тому +155

    My unpopular opinion: His videos are the best on computerphile.

    • @carlkuss
      @carlkuss 2 роки тому +6

      He´s very clear, and the material is both deep and interesting.

    • @starktyping
      @starktyping 11 годин тому

      he's indescribably funny

  • @lovealien43
    @lovealien43 6 років тому +181

    Eigentlich gut verständlich, aber er verwendet mächtig viele Anglizismen.

  • @lierdakil
    @lierdakil 6 років тому +87

    Finally a video on Curry-Howard equivalence! A nice, simple way to introduce it to boot. This was a bit of a mind-blower when I first stumbled upon it and really understood what it meant (being reasonably competent in both mathematics and programming at that point). One minor nitpick, you could've probably named the thing to make it easier to google for.

    • @sebastianelytron8450
      @sebastianelytron8450 6 років тому +7

      Such an elegant, potent, and weighty notion and a cornerstone of computer science butchered in this video by a babbling goon.

    • @lierdakil
      @lierdakil 6 років тому +34

      Relax, dear. You seem to be awfully worked up about this. Drink some chamomile tea and reflect on shortness of life and if you need waste what little time you've got on petty attacks over a video on the Internet.

    • @henrykkaufman1488
      @henrykkaufman1488 4 роки тому

      Hahah nice answer. Thanks for mentioning the scientific term dude.

  • @erinc.8633
    @erinc.8633 6 років тому +10

    About Vladimir Voevodsky's work there's an excellent article from Quanta Magazine written in May 2015. It's about replacing the foundation of maths (set theory) by univalent foundations (type theory), and how then that helps to automate maths proofs.

  • @kwanghoonchoi7695
    @kwanghoonchoi7695 4 роки тому +8

    I love a scene interrupted by a cute puppy. Totally unexpected in propositions as types!!
    8:10

  • @daxvena
    @daxvena 6 років тому +24

    Wow, it's so weird seeing this video after discovering these concepts on my own a few months ago for a project that I have been working on. What I discovered is that predicate logic, algebra and type theory all have a very similar structure:
    not ⊂ incrementation ⊂ option type (nullable value)
    xor ⊂ addition ⊂ sum type (enum + union)
    and ⊂ multiplication ⊂ product type (structs/tuples/cons cell)
    implication ⊂ exponentiation ⊂ function type (functions/arrays/dictionaries...)
    false ⊃ 0 ⊃ bottom type ("exception")
    true ⊃ 1 ⊃ unit type ("void")
    true ⊃ ...
    true ⊃ ∞/variable ⊃ top type (untyped variable)
    From this I also discovered:
    - Predicate logic is a restriction of algebra, where every operation is performed modulo 2.
    - Algebra is a restriction of type theory, where every operation is performed on the number of possible states each type describes.
    - Type theory doesn't need inverse functions like in algebra (decrement, subtraction, division, root, logarithm) because it is completely constructive.
    I've tried imagining what hyper-operations after exponentiation would mean, but I couldn't think of anything useful other than that it may be related to mapping lower dimension types to higher dimension types (point => line => circle => sphere => ... n-sphere).

    • @aion2177
      @aion2177 6 років тому

      awesome insight :)

    • @jyrikgauldurson8169
      @jyrikgauldurson8169 5 років тому +1

      void is the bottom type, not exception. Generally, any type that has no elements is an empty type (bottom). The unit type has one element, in Haskell it's ().

    • @TheFrozenCompass
      @TheFrozenCompass 5 років тому +3

      void is not the bottom type, it's a unit type. Don't get confused by the fact that many C-family languages use the syntactic sugar of ending the function without an explicit return statement, instead of offering () as an explicit expression. A function with a real bottom type cannot return at all.

    • @jyrikgauldurson8169
      @jyrikgauldurson8169 5 років тому

      @@TheFrozenCompass Void is by definition not a unit type. A unit type is a singleton whereas void has no elements; it's a uninhabited set. Haskell has void and unit

    • @TheFrozenCompass
      @TheFrozenCompass 5 років тому

      ​@@jyrikgauldurson8169 Void in Haskell and void in C-family languages are very different types. I was referring to the latter.

  • @AlexBerg1
    @AlexBerg1 6 років тому +58

    This is a hugely important idea in programming. Great introduction to the idea here! Thanks!

    • @sebastianelytron8450
      @sebastianelytron8450 6 років тому +14

      It does seem like an important idea. Shame this professor can't teach it to save his life......

    • @IvanKravarscan
      @IvanKravarscan 6 років тому +8

      I agree, shame he doesn't speak comprehensible English.

  • @Yotanido
    @Yotanido 6 років тому +15

    Some good stuff on computerphile lately. You should probably link to the paper, though.
    Also, if anyone wants to actually play around with this: Take a look at Agda or Coq. Those are languages specifically made to do this.
    Some other functional languages like Haskell and Idris can also do this, but especially in Haskell, it's a bit of effort.

    • @lierdakil
      @lierdakil 6 років тому

      Well, there's still hope we'll eventually get dependent types in Haskell, and then it won't be as much effort.

    • @Yotanido
      @Yotanido 6 років тому

      Indeed. The day we get DependentHaskell will be a glorious one!
      I can't wait.

    • @osolomons
      @osolomons 4 роки тому

      Also Idris! (It has similar syntax to Haskell)

  • @krasserkalle
    @krasserkalle 6 років тому +4

    Best video from this guy on computerphile so far

  • @matthewkriebel7342
    @matthewkriebel7342 6 років тому +3

    I'm just digging that classic LaserJet with the IrDA interface.

  • @IwoIwanov
    @IwoIwanov 2 роки тому +2

    This is just fascinating. Top content right here on Computerphile. Thanks for this.

  • @Kalernor
    @Kalernor 6 років тому +6

    I didn't fully understand, but this area seems very interesting to me. I am a cs student generally interested in areas relating to mathematical logic so these seems like a perfect fit for me. I will be reading more into this.

  • @coachsteve.
    @coachsteve. 6 років тому +32

    Very well explained! Here is a simple Haskell implementation.
    {-# LANGUAGE TypeOperators #-}
    type P = Bool
    type Q = Bool
    type R = Bool
    type a × b = (a, b)
    type a + b = Either a b
    f :: P × (Q + R) -> (P × Q) + (P × R)
    f (x, Left y) = Left (x, y)
    f (x, Right z) = Right (x, z)

    • @DimitriSabadie
      @DimitriSabadie 6 років тому

      Unneeded parens, use precedence ;)

    • @sebastianelytron8450
      @sebastianelytron8450 6 років тому +6

      I don't know (any) Haskell. Yet somehow reading your code made more sense than the entire video.

    • @Vvkmnn
      @Vvkmnn 6 років тому

      Thanks for this.
      Do you also have a Haskell explanation for the “Left of y” and “Right of z” parameters; do they just mean of type y : Q and z : R? If they are all Boolean, why have lefts and rights?

    • @MrMomoro123
      @MrMomoro123 6 років тому +3

      An Either a b type constructor takes two types and return a type which can be either a or b. The values are Left (something of type a) or Right (something of type b)
      For example, say we had a Haskell function nthPrime :: Int -> Int which takes an integer n and returns the nth prime. If we decide that if we get a negative number for n (and thus the nth prime is nonsensical) we want to return an error message instead, how would we do that if we said the function returns an Int?
      Well, one way is to use Either. Define nthPrime :: Int -> Either Int String. Then if they give us valid input, e.g. n=5 we just return Left 11, to specify that the input was valid and we returned an Int. If the input is invalid we can return Right "Hey, only positive numbers are allowed!".
      They don't even have to be different types. You can have an Either String String to represent a valid response vs an error message, which I think pertains more to your question.
      Either Bool Bool would let us differentiate between P and Q.

    • @pedrovasconcelos8260
      @pedrovasconcelos8260 6 років тому +3

      There is no need to prove the statement just for Bool, you can leave it fully parametric:
      type a * b = (a,b)
      type a + b = Either a b
      f :: p * (q+r) -> (p*q) + (p*r)
      f (x, Left y) = Left (x, y)
      f (x, Right z) = Right (x, z)

  • @Cody27
    @Cody27 6 років тому +52

    I don’t see the problem with his voice, its not hard to understand what he saying.

    • @FlumenSanctiViti
      @FlumenSanctiViti 6 років тому +1

      At first I thought he was saying "two" and "four"... only later it came to me it was actually truth and false.

    • @rostislavsvoboda7013
      @rostislavsvoboda7013 6 років тому +1

      Well then you must be possessing some superhuman understanding skills. Like an X-Man or stronger.

    • @00bean00
      @00bean00 5 років тому +4

      *It'z not hahd zu undarständ

    • @carlosmspk
      @carlosmspk 3 роки тому

      @@rostislavsvoboda7013 probably has something to do with where you come from. As a portuguese I have no trouble understanding him

  • @zzRider
    @zzRider 6 років тому

    Awesome! I hope you do more videos like this.

  • @ntmg90
    @ntmg90 6 років тому

    Awesome video. Thanks to all people which makes this type of content possible :)

  • @SSJHF
    @SSJHF 6 років тому +4

    One thing I have noticed from the comments in this video, is that everyone is from a different background.
    Some are programmers, some are mathematicians, some are logicians and some have no background in the things you covered.

  • @MusicThatILike234454
    @MusicThatILike234454 4 роки тому +5

    I worked with a language in university, coq, that allows one to write provably correct programs. The syntax being shown is very similar, I wouldn't be surprised if professor Altenkirch is one of the individuals working on it.

    • @martinkunev9911
      @martinkunev9911 9 місяців тому +1

      coq is developed mainly by the academia in France as far as I know

  • @AlexBerg1
    @AlexBerg1 6 років тому +7

    Most often, we write our programs as value-level logic. We gain type-checking if we write them as type-level logic. Type-checking gives confidence and maintainability to programs.

  • @brantwedel
    @brantwedel 6 років тому +5

    What I got out of it: If something is not provable it is not classically computable therefore use a mathematical logic that represents the idea of computability for computer science applications?

  • @ibic
    @ibic 3 роки тому +2

    At 9:00 , I believe he's talking about some people call the `left` and `right` functions as `inl` and `inr`.

  • @AhmadKhan-po8rl
    @AhmadKhan-po8rl 3 роки тому +1

    I’m confused at minute 15:03 where he’s explaining why the Law of Excluded Middle does not hold in this isomorphism. He says we must decide if all predicates are either true or all predicates are false, but aren’t we showing that all predicates are either true/false? As in the prime number example given, where for some Natural Numbers its going to be true, while for others it will be false. Does anyone have an explanation?

  • @matteofalduto766
    @matteofalduto766 4 роки тому +4

    at 0:17, I was almost expecting him to say, '"in kurzgesagt, we could say..."

  • @mlliarm
    @mlliarm Рік тому

    Great video, thanks !
    Now that you've watched this, go see the longer talk of prof. Wadler with the same title in a strangeloop conf.

  • @Yupppi
    @Yupppi 5 місяців тому

    I used to be really exhausted watching his episodes, trying hard to understand when I had had one class of C++ as a mechanical engineer. Now, maybe one semester while getting into programming via different C++ conference talks and other content on programming (particularly Adobe's senior principal scientist Sean Parent's talks have been eye opening), getting introduced to a couple of different languages, I've started to understand more fundamental problems in programming that every language is trying to solve a different way, these are really fascinating topics. How to show that your function is reliable for concurrency and parallelism or how can you try to become confident that it doesn't have a critical bug, perhaps in a setting where you can't really test the function/program. What kind of structures provide confidence.

  • @louisthibault555
    @louisthibault555 2 роки тому +1

    What is this topic of mathematics called and where can I read more about it? In particular, I’m curious how it connects with the type systems of functional languages like OCaml.

  • @jenniferstine8567
    @jenniferstine8567 6 років тому +3

    This was like playing NES Zelda, walking up to the guy who says, "I am Error," and saying to him, "I'm getting the same message." What did I watch?!

  • @jeffreyjdesir
    @jeffreyjdesir 28 днів тому

    This question means the world to me right now if and if could be sufficiently answered or engaged with, would make me very grateful; does this correspondence imply at all that complex types and their algebra can be represented fully with Boolean values and their operators?

  • @BangsarRia
    @BangsarRia 3 роки тому +1

    At 13:11. Symbol "x" appears with three entirely different meanings: as an operator, as the expression that the predicate/function operates on, and as the first of two arguments to the function. (However, "?" is clearly defined.)
    I was able to follow the proof, but it would have been easier if different symbols had been used.

    • @hugofontes5708
      @hugofontes5708 2 роки тому

      Yeah, had to spend a while rereading that bit, thanks to you now I know I did understand him

  • @esond
    @esond 6 років тому +20

    Somehow this feels excellently taught but I understood so little of it.

    • @migueld2456
      @migueld2456 4 роки тому +2

      I feel the same. Maybe we need to study more :)

  • @jankostanjevec5315
    @jankostanjevec5315 6 років тому +3

    Can programs handle mathematical induction? If so, what gets in the way of prop. = bool.?

    • @lierdakil
      @lierdakil 6 років тому +4

      If you assume prop=bool, that means each proposition is either True or False. When we get into programs-as-proofs, we run into one tiny problem. There's a class of propositions that are, within the system, neither True nor False, but unprovable. Reason being, the system only allows for constructive proofs, and not all possible proofs are constructive (also Gödel's theorem, there can be theorems that are, given a set of axioms, unprovable in principle, so classical logic doesn't make all that much sense anyway)

    • @ThorstenAltenkirch
      @ThorstenAltenkirch 6 років тому +5

      Yes, mathematical induction corresponds to primitive recursion, i.e. to write a function form the natural numbers it is enough to say what the function is doing for 0 and what it returns for n+1 if you assume that you already know what it returns for n. Prop = bool doesn't work because as I have said we cannot interpret the quantifiers as programs on the booleans.

    • @cuntsound
      @cuntsound 6 років тому +1

      Thorsten Altenkirch Thank you for the answer.

  • @shell_jump
    @shell_jump 6 років тому

    When are we getting "Propositions as Types as Spaces"?

  • @bucelliLeo
    @bucelliLeo 6 років тому +6

    Ah, I love symbolic logic! That is what I specialized in back when I was a philosophy student.

  • @spacejunk2186
    @spacejunk2186 6 років тому +53

    Ja?

  • @malcomdiene7745
    @malcomdiene7745 6 років тому +8

    So basically it is better to use propositions as types than propositions as bools, because if you use propositions as bools, it will check all the possibilities for the statement, but if you use types it will give the proof and then decide either it's true or false. It's faster and more general. Right?

    • @Yotanido
      @Yotanido 6 років тому +23

      Well, propositions as bools is more powerful, as was demonstrated. However, with propositions as types you can embed this into your programming language and have it machine-checked. You could have the compiler prove that your sorting algorithm does indeed sort the input without having to rely on tests which may or may not find a bug.
      Another great thing is that it avoids "boolean blindness". Your proof does not just return "true" or "false" but rather "the statement X is true/false". It contains a reference to what was actually proven. (Also known as evidence)
      This allows you to actually use the proof in other proofs, which is rather useful. (Though, with bools, you can't do any of this anyway, so it might a bit unfair to put this on top)

    • @malcomdiene7745
      @malcomdiene7745 6 років тому +4

      Thank you. I appreciate it.

    • @daggawagga
      @daggawagga 6 років тому

      +Yndostrui I had completely missed the point of the whole video before reading your comment. Thank you so much.

    • @SSJHF
      @SSJHF 6 років тому +1

      +Yndostrui There exist formal systems in classical logic, that allow you to use proofs in other proofs, as well as those that can be machine checked.
      In these aspects, homotopy type theory doesn't do anything new, it has just done it a nice way.

  • @Turalcar
    @Turalcar 6 років тому

    So, what about call-with-current-continuation then?

  • @martinkunev9911
    @martinkunev9911 9 місяців тому +1

    10:50 To prove the tautology he also needs to define the inverse function.

  • @winter9156
    @winter9156 2 роки тому +1

    Me a CS Student: "Oh ahah yeah. I know what a programm is. lol"
    Me a CS Student after this video: "What actually is a programm?"

  • @hingedelephant
    @hingedelephant 6 років тому +3

    Tom Petty - Rock Star Computer Scientist

  • @Wallawallawallawalla
    @Wallawallawallawalla 4 роки тому +1

    Why would you need to check the input to a program when you want to always return true? Just return true.

  • @Guillaurent
    @Guillaurent 6 років тому

    Well that takes me back to college...

  •  3 роки тому

    One day, I think Cubical Type Theory (the constructible version of Homotopy Type Theory) will be sufficiently developed to be able to do physics on it, that is, one day they may be able to re-formulate the big theories like quantum mechanics and relativity in cubical type theory and thus produce the so-called "theory of everything" - that is how big type theory is. For now it is a way to make better / more secure API's, and being able to catch bugs at compile time. But in the future type theory will be to our civilization what geometry was to the Greeks, nothing less than our greatest achievement. Mark my words.

  • @toxicore1190
    @toxicore1190 6 років тому +2

    Curry-Howard-Isomorphism at work :)

  • @eladgolan1
    @eladgolan1 6 років тому +23

    I think I just blew up a neuron

    • @adelarscheidt
      @adelarscheidt 6 років тому +2

      It's fine, you have 99,999,999,999 left

  • @saschar.8736
    @saschar.8736 6 років тому +1

    Isn't P ∨ ¬P equal to P ← P and thus translates to P → P whichs proof is be the identity function (λx . x) ?

    • @janmasrovira8664
      @janmasrovira8664 6 років тому +6

      No, in constructive logic ¬¬P is not equivalent to P

    • @saschar.8736
      @saschar.8736 6 років тому

      But isn't the proposition to be proved (P ∨ ¬P) just plain propositional logic? Or have I missed something?

    • @lierdakil
      @lierdakil 6 років тому +5

      Constructive logic. (P ∨ ¬P) isn't an axiom, you need to prove it on case-by-case basis. Not provable in general case. Propositions can be "unprovable" (that is, neither "true" nor "false").

    • @CyberneticOrganism01
      @CyberneticOrganism01 3 роки тому +1

      Another name for constructive logic is intuitionistic logic. It started with the mathematician Brouwer. It is somewhat weaker than classical logic, where "exclusion of the middle" holds.

  • @AfonsoSousa31
    @AfonsoSousa31 6 років тому +1

    This should be called: Program Algebra (it already exists, check it up)

    • @lierdakil
      @lierdakil 6 років тому +3

      Uh... it should be called Curry-Howard isomorphism, and it's a thing at least since 1970's.

  • @drdca8263
    @drdca8263 6 років тому

    I kept mishearing "dog" as "doc", and was confused for a bit.

  • @awesome24712
    @awesome24712 6 років тому

    Today I have a midterm on my propositional logic >.

  • @xybersurfer
    @xybersurfer 6 років тому +5

    it's an interesting topic. but i honestly think the explanation can use some work. some more examples showing the correspondence between proofs and programs would be nice (where all the steps are shown). i also don't think everyone is familiar with functional programming types and proof trees (so a lot of inbetween steps or transformations seem to be missing)

    • @Rockyzach88
      @Rockyzach88 2 роки тому

      Well, these video's aren't exactly lectures. They are more ideas for you to take interest in.

    • @xybersurfer
      @xybersurfer 2 роки тому

      ​@@Rockyzach88 this video seems to skip past a lot of the introductions, compared to other videos on this channel. making it harder to take an interest

  • @feldinho
    @feldinho 6 років тому +11

    Fellow viewer: Do you understand what we's trying to say without previously knowing it?

    • @6612770
      @6612770 6 років тому +2

      Felds Liscia
      Nope!

    • @boyracer3000
      @boyracer3000 6 років тому

      It just clicked straight away.

    • @torb-no
      @torb-no 6 років тому +1

      Yes… but I did pause to read the Wikipedia article on Zermelo-Fraenkel set theory. And being familiar with the idea of foundations of mathematics (Peano Arithmetic, Russel's goal of set theory/logic based mathematics), propositional logic, predicate logic and theory of computation probably helped me a lot in understanding it. I can imagine this being kindy tricky if you do not know about these things.

    • @traininggrounds9450
      @traininggrounds9450 4 роки тому

      All I saw was the commutative property over and over again. I wasn't sure if he was saying any more than that.

  • @amberstiefel9748
    @amberstiefel9748 9 місяців тому

    5:58 often an issue with poorly planned thought experiments and therefore statistics too...or maybe this error is why I'm stuck...

  • @Tehom1
    @Tehom1 6 років тому +4

    Am I the only one who wanted him to use discriminated unions instead of left and right operators? You can translate from one to the other, of course.

    • @woobilicious.
      @woobilicious. 6 років тому

      That's actually pretty much how discriminated unions work in Haskell, on the left of = you need to pull it out of the union, and on the right you need to construct one.

  • @ignaciocalderondelabarca4326
    @ignaciocalderondelabarca4326 2 роки тому +1

    Yo this is sick!!!

  • @klasus2344
    @klasus2344 5 років тому

    Yes..

  • @qzbnyv
    @qzbnyv 3 роки тому +1

    in Haskell:
    f :: (p, Either q r) -> Either (p, q) (p, r)
    f (x, Left y) = Left (x, y)
    f (x, Right z) = Right (x, z)

    • @qzbnyv
      @qzbnyv 3 роки тому

      does “pigs can fly” refer to Void?

  • @trabpukcip1177
    @trabpukcip1177 6 років тому

    import PropTypes from 'propositions-as-types'

  • @getowtofheyah3161
    @getowtofheyah3161 2 роки тому +1

    In case no one else noticed, he essentially constructed the category whose objects are propositions and whose morphisms are implications between propositions. Indeed, conjunctions (ands) are products in this category, and disjunctions (ors) are coproducts, what he calls ‘+’ here where it’s basically a type of disjoint union.

  • @networkgame
    @networkgame 10 місяців тому

    feel like this will most certainly simplify things....yeah...

    • @networkgame
      @networkgame 10 місяців тому

      this needs to be rewatched everyday and feels like Tetris but the blocks are my q.i.

    • @networkgame
      @networkgame 10 місяців тому

      13:23 yeah same

    • @networkgame
      @networkgame 10 місяців тому

      almost forgot about daily rewatch

  • @Rodney_Trotter
    @Rodney_Trotter 6 років тому +3

    love the new foo fighters track_ anyone else thoughts

  • @johndwolynetz6495
    @johndwolynetz6495 2 роки тому

    ohhhh, thats nice

  • @KohuGaly
    @KohuGaly 6 років тому +6

    so what you are saying is, that in propositional logic the logical law of excluded middle (A or not A) is unprovable? Makes me wonder, is this a case of Godel's incompleteness theorem, where the statement is true but unprovable? Or maybe, the more worldview-shattering and it actually demonstrates that the law of excluded middle is not always true and boolean logic merely happens to be an area where it is...

    • @Captain__Obvious
      @Captain__Obvious 6 років тому +4

      Well all roads lead to the Axiom of Choice (via Diaconescu's theorem)

    • @lierdakil
      @lierdakil 6 років тому +4

      There are a few logic systems where law of excluded middle is unprovable in the general case. Notably, constructive logic (also known as intuitionistic logic) allows having proof for excluded middle on case-by-case basis, but it's impossible to prove in the general case. Some logic systems replace law of excluded middle with negation as failure, meaning if something's impossible to prove to be true, it must be false, and it is a bit of a way out.

    • @ThorstenAltenkirch
      @ThorstenAltenkirch 6 років тому +1

      I am saying that if we base logic on evidence instead of truth then the principle of excluded middle is not valid. Because in this case we would have to give either supporting or negative evidence for any proposition. And if we use propositions as types then we are not even allowed to look into a type hence it is clearly impossible.

    • @ThorstenAltenkirch
      @ThorstenAltenkirch 6 років тому +4

      Yes, the axiom of choice also is not justified by the propositions as types explanation (if you do it right). However, Diaconescu proves that the axiom of choice implies excluded middle. The opposite is dose not hold, hence the axiom of choice is actually a stronger non-constructive principle.

    • @Captain__Obvious
      @Captain__Obvious 6 років тому +2

      +Thorsten Altenkirch Thanks for taking the time to write us informative replies, looking forward to your next video!

  • @mescellaneous
    @mescellaneous Рік тому

    I don't understand why ~P is P -> empty, and subsequently why he couldnt translate the P v ~P

  • @x00g40
    @x00g40 6 років тому +1

    proposischens

  • @thomasrosebrough9062
    @thomasrosebrough9062 Рік тому

    I know I'm a few years eight but can someone please caption this video. The concept is super cool but it's pretty difficult to understand his accent when distinguishing important words like "two" and "true".

  • @Vekkq
    @Vekkq 6 років тому +12

    The explanations use a lot of paper for a computer-phile channel.

  • @Theaksten
    @Theaksten 4 роки тому

    No comment thread on your article glorifying mathematics. The way mathematics is taught and programming is learned are vastly different. In mathematics, there is a solution and one thousand ways not to get it. In programming, save some cases, there are many ways to devise a solution and only a few ways to not get it. You can be a bad mathematician, but a great programmer. The converse is also true. You don't need to know a single math theory, or a computational one, to solve many computational problems. You only need to hone problem solving and design skills, but practicing mathematics likely helps. Lastly, why reinvent the wheel when copypasta exists?

  • @viniciusmartinez3537
    @viniciusmartinez3537 6 років тому

    I didn't get this one. :/

    • @CyberneticOrganism01
      @CyberneticOrganism01 3 роки тому

      Look up "Curry-Howard isomorphism", it's a deep concept and usually takes a book chapter to explain fully and clearly.

  • @Frobbyy
    @Frobbyy 6 років тому +2

    didn't expect david grohl to be on computerphile

  • @zakunknown9737
    @zakunknown9737 6 років тому

    explains a things a bit yeah?? yeah? :P tbh good video. i liked it

  • @Randgalf
    @Randgalf 6 років тому +2

    I wondered what Rick Wakeman has been up to lately, but what's with the accent?

    • @randairp
      @randairp 5 років тому

      Randgalf wasn’t expecting to read that this far deep in the comments...

  • @MultiPaulinator
    @MultiPaulinator 6 років тому

    2B∨¬2B≝? would be the more appropriate statement.

  • @izimsi
    @izimsi 6 років тому +40

    He could've said "kurzgesagt" instead of "in a nutshell" and i would understand.

    • @sebastianelytron8450
      @sebastianelytron8450 6 років тому +7

      When did he say "in a nutshell"?? Wait, is he trying to speak English?!?!

  • @shashwatvaibhav4596
    @shashwatvaibhav4596 6 років тому +1

    Brad Pitt 👍🤘🤘

  • @wingedtoast7495
    @wingedtoast7495 6 років тому

    I've never seen someone look so disappointed about going to the zoo.

  • @TGC40401
    @TGC40401 6 років тому

    It occurred to me that computers might have difficulty with things like, "This statement is false". However, one could think of it as saying, "This argument is not what it is" or "1 =/= 1"
    Any thoughts?

    • @xybersurfer
      @xybersurfer 6 років тому +3

      John Hightower it depends on the meaning you give to "This statement".
      let's call "This statement" "f(x)". then "This statement is false" is the proposition:
      f(x) = ¬f(x)
      then you can give it 2 interpretations
      1. if "f(x)" is just a meaningless symbol to you, then you get a simple contradiction as a proposition:
      P = ¬P
      which simply has the value false
      2. but, if you you interpret "¬f(x)" as the definition of "f(x)", then you get an infinite recursion. which computers have problems with of course:
      f(x) = ¬f(x) = ¬(¬f(x)) = ¬(¬(¬f(x))) ... etc
      in this way, the sentence "This statement is true" has the same infinite recursion problem because of self reference. recursion is supposed to have a decision about whether to continue or end (or it's just an infinite loop). computers have problem with it. because it does not make sense. the program is trying to do something with no hope of an answer. you can see it as computers having difficulty but you could also see it as us having difficulty telling them what to do (it's a blurry line)

    • @tricky778
      @tricky778 Рік тому

      for (;;) ;

  • @MagnusMegamind
    @MagnusMegamind 6 років тому +2

    Need subtitles for this one Tooth = proposition of ant?

  • @kd1s
    @kd1s 6 років тому +2

    Well you could always have the function return 2 regardless of input. Just discard the input.

    • @brenton8568
      @brenton8568 6 років тому +5

      To do that you would have to prove that 2 is an element of the return type. But, when the types are variables that isn't possible because it would have to hold for any type. (Parametricity!)

  • @hassiaschbi
    @hassiaschbi 6 років тому

    This happens if nobody compliments Heinrich for dressing himself today!

  • @OffTheBeatenPath_
    @OffTheBeatenPath_ 6 років тому +48

    is this one of the twins from Matrix?

    • @iseslc
      @iseslc 6 років тому +10

      He is Brad Pitt's cousin.

  • @alandawkins8297
    @alandawkins8297 6 років тому

    Which version English does he speak...?

    • @Trucmuch
      @Trucmuch 4 роки тому

      How many foreign languages do you speak?

    • @tech6hutch
      @tech6hutch 4 роки тому

      How many breads have you eaten?

  • @tricky778
    @tricky778 Рік тому

    P -> Q means "nothing but P" to "nothing but Q". It could return "nothing but Q" by not returning. Subtle

  • @KX36
    @KX36 6 років тому +97

    I never understand any of this guy's videos.

    • @BoomRoomFive
      @BoomRoomFive 6 років тому +21

      It would help if he opened his mouth when he spoke!

    • @tiavor
      @tiavor 6 років тому +8

      this is still better than GoT

    • @hendrikw4104
      @hendrikw4104 6 років тому +2

      Having experience with functional programming is very beneficial to understanding this.

    • @seethegalaxy
      @seethegalaxy 6 років тому +2

      You can just feel the category theory pulsing under the surface.

    • @SSJHF
      @SSJHF 6 років тому +1

      It seems to be aimed at an audience that has a small background in mathematical logic already.

  • @dipi71
    @dipi71 6 років тому

    What is a program?
    Not so fast, just glancing over the question omits several interesting distictions. For example: is a program a collection of bits and bytes on disk or tape? No, that’s a file (a program file, sometimes even an archive file of a program a la a.out or helloworld.a).
    So then, is a program a collection of bits and bytes in memory? Actually, we have a word for that: a process, a task, a thread, a fork etc.
    Is a program the abstraction of all of the above? The collection of algorithms in their purest, mathematical form? I don’t think so. It would take it away too far from what’s actually happening in the computer, GUI and bugs and warts and all.
    Well, then: what *_is_* a program?

  • @Nagria2112
    @Nagria2112 6 років тому +3

    bester deutesche akzent ever

  • @ThomasFackrell
    @ThomasFackrell 6 місяців тому

    Type theory is superior to set theory

  • @procactus9109
    @procactus9109 6 років тому

    mumble mumble mumble

  • @JLSoftware
    @JLSoftware 6 років тому +12

    You have GOT to be kidding me.

  • @sabriath
    @sabriath 6 років тому

    That last part didn't make sense.....P+P->0, is that set up to state "p or (p implies 0)" which is always true, or is it "(P+P) implies 0" which is just ¬P. The equations are extremely specific and have a solution, yet the professor makes it seem like it is infinite recursion of some kind?
    Implication is simply the formula:
    A->B = ¬A∨B
    At least in the programming sense.

    • @ThorstenAltenkirch
      @ThorstenAltenkirch 6 років тому +5

      What you say is correct if we explain propositions as booleans but not if we explain propositions as evidence, i.e. types.

    • @AhsimNreiziev
      @AhsimNreiziev 6 років тому +1

      It's *[P + (P -- > 0)]* , and yes he should have included the parentheses. However, your assertion that this statement _"is always true"_ is misguided. The statement is always true in Logic Systems where a proposition cannot be neither true nor false, e.g. classic Boolean Logic aka the "proposition == bool" system. However, the "proposition == type" system is not such a system. It can't be *shown* using the elements of the "proposition == type" system -- that is, using the Cartesian Product, the "OR Plus" by lack of a better name, functions and the Empty Type representing AND, OR, IMPLIES and NOT respectively -- that the proposition *[P OR (NOT P)]* , aka *[P + (P -- > 0)]* , is a tautology.
      This is entirely unsurprising, because in the "proposition == type" system, it *isn't* a Tautology. For the most basic example of this, let's examine the Predicate equivalent of the alleged Tautology, which is *[Q: FORALL x, Q(x) \/ ~Q(x)]* . For this statement to be a Tautology, it would have to hold regardless of what "Q" is. Now, if the domain of Q is taken to be the Natural Numbers _[i.e. 'x' is limited to the Natural Numbers]_ and is defined as *[x is Prime]* , then the statement *[FORALL x, Q(x) \/ ~Q(x)]* is indeed a Tautology. However, if instead Q is a Predicate on the Domain of programs -- or Turing Machines if your prefer -- and the definition of Q is *[x Halts]* , then the statement *[FORALL x, Q(x) \/ ~Q(x)]* is NOT a Tautology in Type Theory, as it's undecidable whether a given program eventually halts or not.
      This is what the professor meant when he said that *[P \/ ~P]* is not always true in Type Theory / the "proposition == type" System of Logic.
      Yes, it's true that *[P -- > Q]* is equivalent to *[~P \/ Q]* within the context of *Boolean Logic!!* But, again, we are not talking about Boolean Logic here, but about Type Theory (Logic). Equating propositions with types quite obviously doesn't assign truth values to propositions and doesn't use Boolean operators to equate to propositional operators. That, AGAIN, would be Boolean Logic. Type Theory / - Logic / whatever you want call "proposition == type" Logic assigns *types* to propositions and uses *type operators* to equate to propositional operators. The type operator that equates to Implication is the Function, which takes an input with the type of the left side of the Implication operator, and outputs something with the type of the right side of the Implication operator.
      Moral of the story: you're confusing Boolean Logic with Type Logic. This video is about Type Logic, and that would explain your confusion.

    • @drdca8263
      @drdca8263 6 років тому

      Ahsim Nreiziev You have to be careful about part of that though. Intuitionistic logic indeed does not in general prove "P or (not P)", but it DOES prove "not not (P or (not P))".
      "not (P or (not P))" is enough to prove "not P", as given "P" you could prove "P or (not P)", and using the "not (P or (not P))" this would allow you to prove False. So, given "not (P or (not P))" you can derive "not P". Using a similar method, you can also derive "not not P". Take as input "not P", and from that derive "P or (not P)". Then, using "not (P or (not P))" you can derive False. This works to show that "not not P" can be proven, if assuming "not (P or (not P))". So, "not (P or (not P))" is enough to prove both "not P", and "not not P". "not not P" allows you to derive False from "not P", so these two together let you prove that False. So, therefore, from "not (P or (not P))" you can derive False.
      This constitutes a proof of "not not (P or (not P))".
      Generally, if ordinary logic proves that "P", intuitionistic logic will at least prove "not not P", even if it can't prove "P".

  • @mahatmagandhiful
    @mahatmagandhiful 6 років тому

    No, no, go back to the doggo!

  • @VoidCraftedGamingHD
    @VoidCraftedGamingHD 6 років тому

    10th

  • @vp4744
    @vp4744 6 років тому +8

    two or false, cant write a pogram for pooposition.

  • @guydht1
    @guydht1 6 років тому +11

    Please tell me I'm not the only one who read the title as "Prostitutions as Types".......

    • @davinellulinvega
      @davinellulinvega 6 років тому +21

      @guy hircshorn I have bad news for you....
      You're alone.

    • @debugizzator
      @debugizzator 6 років тому +1

      Yeah man you have to worrie about it

    • @IIARROWS
      @IIARROWS 6 років тому +2

      Yes you are

    • @PsychozaBezNogi
      @PsychozaBezNogi 6 років тому +1

      no, you are

    • @HiAdrian
      @HiAdrian 6 років тому +2

      Only you man, I read Propositions.

  • @PsychozaBezNogi
    @PsychozaBezNogi 6 років тому +20

    it's too complicated

    • @KrzysztofLecyk
      @KrzysztofLecyk 6 років тому +14

      it's future of programming

    • @lierdakil
      @lierdakil 6 років тому +3

      It's rather straightforward actually. You do need to know some basics of type theory though, so previous prof. Altenkirch's video is recommended (or just read some books on the subject, B. Pierce's "Types and Programming Languages" is a good one if you need a recommendation)

    • @sebastianelytron8450
      @sebastianelytron8450 6 років тому +6

      It's actually a lot simpler than how this inept professor tries to explain it.

    • @bonbonpony
      @bonbonpony 6 років тому

      It's actually very simple. It's just that this dude cannot teach.
      If you want to have this explained in a straightforward and understandable way, watch Philip Wadler's "Propositions as Types" from Lambda Days or Strange Loop.

  • @Slarti
    @Slarti 6 років тому +1

    I am a software developer and I do not understand this man's explanations - he may be fantastically intelligent however he needs to brush up on teaching, a first step would be understanding how people have different ways of learning.

  • @orifl6653
    @orifl6653 6 років тому +3

    Firat

    • @SimGunther
      @SimGunther 6 років тому +3

      Владимир Путин В-пятых?

  • @jayjtee
    @jayjtee 6 років тому

    A proposition is a statement such as "all even numbers divide by 2". By definition it is either true or false. Why are you trying to redefine it as something it isn't? He isn't talking about propositions at all, he is talking about a theorem, which is not the same thing. This isn't a mathematics issue, it is an English issue. Stop trying to redefine the damn language please.

    • @Mitchicus94
      @Mitchicus94 6 років тому +4

      Jason Thacker don't be silly. Theorems are propositions. He is then linking the proposition (the type) with the program (its proof)

    • @-ion
      @-ion 6 років тому +1

      He mentioned ∀ being a part of the language, he just used concrete P, Q and R in his example to keep things simple. Here is his example with universal quantification. (The program/proof is the same.)
      f : ∀p q r. p×(q+r) → p×q+p×r
      f (x, left y) = left (x,y)
      f (x, right z) = right (x,z)
      Here is a proposition that is false, or type for which there exists no program.
      g : ∀p. p
      g = ?