Better HN
topnewbestaskshowjobs
Log inSign up

ImprobableTruth

1,706 karma · joined Dec 9, 2019 (6y ago) · 623 submissions

Submissions

comment 6y ago · link · parent

If you're fine with 'stupid' refinement types in the form of subset types without coercion, not only do you get them 'for free' from the core type theory without introducing another language element, I personally also think they're quite intuitive. Using a subset type of non-zero nats or providing a proof that the argument isn't zero to define a 'proper divsion' just 'makes the most sense' in my opinion, but that may just be ultimately down to personal taste.

I really do think though that no single part of dependent type theory is actually all that complex. It's not as simple as TLA+, but there's nothing really hard about it till you start proving.

And I'm not saying that all this is feasible right now, but I'm fairly certain that this is at least fundamentally possible. You can't 'truly' separate specifications from proofs in dependent type theory, but you also definitely don't need to really understand how to write actual proofs to write even complex specifications in it. All of this of course depends on stronger automation for a good subset (possibly by also integrating strongly with other provers), but I don't think that's a total pipe dream (though I am definitely personally biased on this).

>The type system in Java or Haskell cannot be used as a sound mathematical foundation, so whatever I call those things it would mean something quite different from maths functions

I'm just talking about the 'well-behaved' subset, but let me go at this from another angle.

If Lean tomorrow introduced a Sort Omega to type universes, the set of programs that you can write wouldn't change. It's essentially just a syntactic change. Would that really be enough to make you say that these are functions now while they previously weren't?

>But I wonder, in Agda, is `id id` some object even when a specific universe cannot be inferred? If so, how does Agda avoid Russel's paradox?

If you quantify over a universe, a constraint gets introduced as part of the type checker. These constraints can be viewed as a graph that is checked for cycles, so not having a specific universe isn't an issue.

comment 6y ago · link · parent

You can avoid the error of Data.List.last by 'inlining' it (just like you could in your first example)

   last :: NonEmpty a -> a
   last (NonEmpty (a, [])) = a
   last (NonEmpty (a, x:[])) = x
   last (NonEmpty (a, x:xs)) = last (NonEmpty (a, xs))

comment 6y ago · link · parent

>Not sure if the author claims that constructive types do not face this issue.

This might be true, but when they were making the case for constructive types they didn't mention it.

>On constructive types vs refinement types, there is a recent Reddit discussion on this topic

The discussions seems to be mostly dependent types vs refinement types, which I'd argue is a false dichotomy. I'd say that dependent types is a what makes refinement types actually powerful in the first place. It's also how most Coq specifications are written.

comment 6y ago · link · parent

>In practice, I think reasonably intuitive properties are already very difficult to formalize in refinement types.

Could you elaborate on that? Unless you're just saying that formalizing reasonably intuitive properties is difficult in general, I don't see what you mean.

comment 6y ago · link · parent

Why would you use Data.List.head rather than just matching on lst?

comment 6y ago · link · parent

>The main challenge of refinement types is that arbitrary properties are very difficult to check in general.

While this is true, I'm not sure how constructive types don't face the very same issue. Ultimately, you will have to provide evidence for the required properties, with constructive types the proof is just (more or less) implicitly embedded into the datatype, which imo just makes dealing with these properties harder rather than easier.

In regards to the post by Hillel Wayne you've posted, I'm not sure what this statement

>This means that predicative data is easier to express at the cost of permitting representable invalid data. This is enough of a problem that we prefer constructive data whenever feasible.

is supposed to mean exactly. If your predicate makes some data invalid, it's just not representable in the refined type.

comment 6y ago · link · parent

I'd agree that people are generally going to be less familiar with type theory (though I think it's not uncommon to touch on the simply typed lambda calculus in undergrad courses), but I really think anybody who has all those prerequisites could also learn enough type theory to write specifications in a couple hours because you don't actually need a deep understanding of type theory to use it (though maybe you meant that you immediately started writing specifications of large, real-world systems in TLA+, but I'd presume you'd then be the outlier on that). In my experience people pick up Isabelle (/HOL) really quickly and writing specifications in a type theory based proof assistant isn't a huge jump from that.

Now, writing actual proofs is a completely different matter, but I didn't disagree with you on how economical/ergonomic the over all approach actually is, just the basic complexity of the theory/specifications ;)

>What is the type of its first argument?

Some universe U, which is an implicit argument. You could alternatively write your Lean example as

def id {u} {α : Sort u} (a : α) : α := a

Not being able to specify the type of u in Lean might seem kinda cheaty, but I'd say that's similar to how one declares generic type parameters in e.g. Java. You wouldn't say that those languages' generic functions aren't actually functions, would you?

Similar to how one could make those generics explicit, it is actually possible to define a special type of all universes (not including itself). Agda does this by having a special primitive type of universe levels. As an example

id : forall {u : Level} -> forall {A : Set u} -> A

is the signature of the universe polymorphic identity function. The Level type doesn't you any issues because it is essentially a 'top' type that doesn't have a type itself.

comment 6y ago · link · parent

>It is based on dependent products which you need to understand sooner-or-later (sooner, really),

Type-theoretic universal quantification _is_ the dependent product (/dependent function, a term I prefer). I assume you're talking about the Cartesian representation, but that's just one way to visualize it, the definition is not dependent on it. If you understand predicate logical quantification it's not necessary at all, since the introduction/elimination rules for type theoretic quantification are the same as for normal predicate logic quantifiers.

>are rather more intricate than FOL

Maybe in application and theoretical implications, but to grasp the concept you have just have to understand that it's relaxing the restriction on "what you can quantify over", which really isn't a huge jump I'd say.

> Ah, but that's the thing. It's not a function and it can't be (for the same reason you don't have an identity function in set theory).

Why would it not be a function? With set theory you have the issue that you can't take a set as an argument and have the codomain and it's elements be dependent on it, but that's exactly what dependent function types allow you to do. The universe U is a sort and A is a valid sort too, so

forall A:U. forall a : A. A

is a perfectly valid function signature and the term would just be (lambda A : U. lambda a : A. a). That doesn't strike me as any more complicated than your second TLA+ example. Sure, you have to deal with universe polymorphism, but I'd say that's compensated by the increased complexity from having to use syntactic operator.

Lean's syntax to specify the universe U is admittedly pretty ugly, but the actual meta-theory isn't that complex I'd say.

comment 6y ago · link · parent

>In the time in took me to grasp Lean's type-theoretic universal quantification

I'm not sure what you mean? They work in the exact same manner as in normal predicate (higher order) logic.

>I still find it hard to explain the meaning of universe-polymorphic operators like `id`.

Uh, are you talking about the normal identity function? If one knows that they types have a level (universe) instead of a "type of all types" to avoid the 'set of all sets' paradox, I'm not sure what the issue would be.

comment 6y ago · link · parent

I care about what Gates says because he's founded one of the world's largest charity organizations and has done a great deal to reduce human suffering as well as specifically a lot of work in regard to climate change. Being rich alone doesn't matter to me, I don't give a damn what e.g. Jeff Bezos has to say about the matter.

Being a prolific author doesn't mean much to me and neither does being an environmental philosopher in this context. Someone like Peter Singer definitely is an authority on environmental ethics, but on the effect of climate change/the ecological state of the world I don't see why anyone would consider him an authority.

comment 6y ago · link · parent

... you might want to add why Derrick Jensen is an authority instead. From a quick google search he just appears to be some random anprim guy that wrote some environmentalist books. Bill Gates has his foundation that is working to mitigate climate change, so I'd say he at least has some qualification since he is presumably in contact with scientific authorities. What does your guy have?

comment 6y ago · link · parent

>we should make allowances for non-abusive colloquial phrases ('wtf', 'what the hell?', etc.) or something, but how can you argue it's not breaking the black-and-white rule as written?

Because 'swear at' at specifically means using a swear _against_ somebody, not just in a statement while talking to them. If you look at e.g. any of the definitions in the free dictionary, you'll find that they're all about using abusive language towards someone, so the idea of 'non-abusive swearing' at somebody in itself is as absurd as say a 'non-abusive insult'.

It's the difference between swearing in front of your children and swearing at your children, one is possibly bad parenting, the other definitely is.

[1] https://idioms.thefreedictionary.com/swear+at

comment 6y ago · link · parent

... do you think the 'what the hell is going on at [company]" is also swearing at their staff? Because I don't think anybody I know would, to me this seems pretty damn clearly like using technicalities/inaccurate definitions as a weapon.

comment 6y ago · link · parent

How so? If there's a single group that's allowed to restrict the media, then it's politicians e.g. defamation laws.

comment 6y ago · link · parent

>"software trains" face basically all of the same challenges as a self-driving sedan would.

How so? It seems pretty evident to me that having separate, dedicated lanes should make it a lot easier. What I'd say is by far the biggest concern, human-driven traffic, is just completely eliminated with that.

comment 6y ago · link · parent

I think what further compounds this is that normally responsibility for accidents is 'distributed' across the population. whereas with autonomous driving it's going to be a single/a few companies shouldering it all. Being even responsible even just for 10% of total road fatalities (~4000 deaths per year) would be absolutely ruinous if they're held liable for them.

comment 6y ago · link · parent

>Physics is a science

'Physics' refers both to 'our knowledge/study of the physical' and 'the physical' in itself.

comment 6y ago · link · parent

> How do you feel about television?

I think it's kinda too early too judge (only ~60 years of widespread adoption and in this time the TV landscape has changed massively), but I think there's a pretty good chance that 'tabloid style' TV has caused a good deal more damage than the yellow press has.

> At least there's some ability to interact with a smartphone

Sure, but that also makes it a lot more addictive. You generally won't see people who are glued to their TV 24/7, but with smartphones that's not uncommon.

> yet society survived

Again, I'm not saying that society will just implode on itself, just that these things can do a lot of damage.

comment 6y ago · link · parent

> How would you handle state other than passing it around?

By only passing and updating the relevant bits of state.

>The fundamental thing that Haskell and Elm do is that they don't have mutable values. They create a new value from the old one.

If we're talking about the context of a game, you'll be very likely using monads where this isn't the case (IO, ST). Not to mention, even if you do just use a normal state monad, if you don't keep the old value around, there's no functional difference between mutating the entire program state and creating a new program state while forgetting the old.

comment 6y ago · link · parent

>somehow mentality of "iOS users are rich" sneaked in

This is just not true. The android app is an open source project by the community, whereas the iOS app is made by the original developer of anki.

comment 6y ago · link · parent

Haskell enforces purity, but you can still write pretty imperative looking code by using monads (e.g. some state monad). I don't think there is any philosophical difference between say

  int x = foo();
  bar();
  char y = baz(x);
and

  do
    x <- foo
    bar
    y <- baz x
I'd say the true difference is more related to how you describe state change. Imperative is about having a sequential list of instructions that all can mutate global state in some way, whereas with a functional style it's about composing functions that depend on their arguments rather than global state. Functional purity lends itself to a functional style, but you can just explicitly pass a large (global) state around and compose functions only sequentially, which imo lands you right back in imperative territory.

comment 6y ago · link · parent

>And we'll adjust, as we always do

I don't understand this line of thinking. Sure, it may not be the literal end of the world, but that doesn't mean that it won't cause a lot of damage before people 'adapt'. People have always adapted to wars, but that doesn't mean that the world wars weren't absolutely catastrophic.

And while I don't think that smartphones will 'destroy you', I think there's a good chance that it can both be very corrosive in all sorts of manners. I think smartphones are a lot more potent at sedating people and making them detached than novels ever could hope to be, which can have a very harmful impact on society at large.

comment 6y ago · link · parent

>NATO countries

A lot of eastern European countries have quite close ties with china. Even with countries like Germany and Italy I wouldn't be so sure.

comment 6y ago · link · parent

>Isn’t it a moot point anyway because nobody ever “buys” software, they just obtain a license to use it.

Well, depends on the country. In Germany that's not a thing because contract law doesn't allow it. Either you buy software or you rent it.

comment 6y ago · link · parent

>These are scientifically unsubstantiated claims but to claim that they are impossible is to go beyond the scope of the current science.

Proving things impossible is beyond the scope of _any_ science, that's just how epistemology works.

>How can you know that mind control is impossible?

I can't. I also can't know with absolute certainty that climate change is real, that the earth isn't flat, that vaccines work and don't cause autism or that bill gates isn't a satanist using covid pandemic to implant people with mind control microchips.

I have seen absolutely no evidence for any of it and all the believers seem to be absolute lunatics, so the chance of it being true are low enough that I'm pretty comfortable with acting like I know it for certain.

>If you were truly capable of it, would you advertise it?

Well, I'd say writing about your experience with your abilities in a book certainly counts as a form of advertisement! I also don't really see what there'd be to worry about if it's true that these powers could simply be learned.

>But all that aside, it's not really about believing or not believing in whatever the claims are. >Whether or not you become a pyromancer is actually not important, most of these disciplines actually discourage these things even though they believe in them.

Sure, they might see it like that, but I don't think it makes sense for anyone else to view it this way. If someone is either lying or deluding themselves, I think that's pretty important information to consider! If someone is, say, an anti-vaxxer that doesn't mean everything they're saying is false, but it certainly makes it seem pretty reasonable to dismiss what they're saying until they've provide some actual evidence.

Similarly, why shouldn't I be skeptic of people who are claiming supernatural powers while not being able to offer any evidence? Especially because they're not making it clear where knowledge ends and religion begins, possibly because they themselves don't know.

comment 6y ago · link · parent

>So when you reach for The Mind Illuminated, which is a 400 page book, and trivialize the 390 pages of good pragmatic instructions on improving concentration and insight skills because you read 10 pages of spiritual mumbo-jumbo, you're missing a powerful opportunity.

This is just so crazy to me. We have a book that claims to be scientific while making absolute absurd statements without any comment, why wouldn't we dismiss it? It's a bit hyperbolic, but imagine if "Introduction to Electrodynamics" included a chapter on how to use magnets to communicate with god. To me it would absolutely ruin what is otherwise an amazing resource, because it fundamentally ruins my ability to trust the source. It doesn't matter if the rest of it is actually legitimate and good, either they're unable or unwilling to separate what is legitimate knowledge and what is religion.

Honestly, I'm actually rahter disturbed by the book's reception. It's a well received best seller that even on the (supposedly) skeptical HN is praised without a caveat. Not only that, but if you look into a lot of meditation forums, a lot of people into meditation do genuinely believe in the supernatural stuff. I can't imagine a better sign to show that we're not skeptical enough.

>The fact is that if you sit quietly and pay attention to your breath for a couple hours a day, some very transformative stuff will eventually start happening all on its own.

Sure and if you state it that way, I'd wager most people wouldn't dismiss it. The issue is that 99% of the time, this is not how it's sold.

>But as a society, we mostly aren't willing to do that because of attitudes like that displayed in your post

Sure, but without this attitude it's also a lot easier to fall for (intentional or unintentional) bullshit of all sorts. I used to be really into chaos magick (same deal basically, natural 'brain hacking') and I'm pretty sure without this attitude I would have turned into of the crazies who thinks their self inflicted psychosis means they have the powers to alter reality.

The fact that most people in meditation forums either outright admit believing the supernatural stuff or are incredibly evasive about it (just like with chaos magick), says more than enough in my opinion.

>My point was that we shouldn't throw out the baby with the bathwater in the name of being good scientists.

We shouldn't, but we should also be as skeptic as possible and dismiss people who seamlessly interweave facts and fiction, because that's also how conspiracy theorists and nonsensical "alternative medicine" quacks sell their craft.

comment 6y ago · link · parent

>This is something that yogis have been saying for 1000s of years, using breathing techniques like 'pranayam'.

Well, sure, and they've also been saying for 1000s of years that if you just meditate hard enough you'll get supernatural abilities.

If you mix religion and actual knowledge, I think you should expect to generally be dismissed until there's some more evidence.

comment 6y ago · link · parent

>then writing off the rest as spiritual mumbo-jumbo

Because a lot of it _is_ spiritual mumbo-jumbo.

The books "The Mind Illuminated" and "Mastering the Core Teachings of the Buddha" occasionally get recommended on here and are pretty mainstream books, supposedly backed by "brain science" and written by two PhDs. Let me give an excerpt from "The Mind Illuminated":

"The first practice involves cultivating the so-called “higher knowledges of the mundane type.” These are: 1. The “higher powers,” which are said to allow a yogi to perform miracles such as walking on water, or walking through walls. [...] 4. Knowing the minds of others, which is a form of telepathy. 5. Recollecting past lives"

And this isn't presented as a "oh, here's this historical context", it's presented without any real comment next to the jhanas.

Or, a nice bit in "Mastering the Core Teachings of the Buddha", talking about pyschic powers:

"On the other hand, it does seem to be possible through powerful intent, strong concentration ability, appreciation of interdependence and careful experimentation to manipulate what we might call “this world”,as well as those in it, in very unusual and profound ways. Yes, I am referring to such things as telekinesis, mind control, reading other peoples thoughts, pyromancy, and all of that. The more you get your concentration and insight trips together and the more you look into the magical aspect of things, the more you will learn about what I will call the magical laws of the universe and how to use your will to manipulate it."

You know why people are skeptical of things like "awakening"? Because it's sold in the same breath as all the religious parts, making it impossible to discern which is what. If the cost of getting to 'the deep parts' means having to not dismiss such obvious bullshit like pyromancy, I think society will do fine with such 'disservice'.

comment 6y ago · link · parent

I'm pretty sure the average amount of friends is more like 15-20 than 300.

comment 6y ago · link · parent

>It's not totally obvious to me that random hiring would be worse

Does this have some implied conditions I'm missing? Because to me it seems absolutely obvious that filtering for people who have experience/a degree will vastly improve your outcome over true random hiring.

1
151617
21