News for hackers. Stuff that matters.
Re:Where do type systems come from? (2017) by bjornsing on Friday October 01, 2021 @06:09AM (#28716531)
> Similarly, type theory wasn’t enough to describe new foundations for mathematics from which all mathematical truths could in principle be proven using symbolic logic. It wasn’t enough because this goal in its full extent is unattainable.

This is an often repeated claim, but I can’t shake the feeling that it’s an incorrectly drawn conclusion (of Gödel’s incompleteness theorems).

My understanding: It’s true that there are such “mathematical truths without proofs within axiomatic system X”, but they are unreachable by mathematicians and symbolic logic / machines alike. If a mathematical statement has no proof within ZFC we (usually) don’t call it a “truth”, regardless of if it is true or not.

Please correct me if I’m wrong.

Re:Where do type systems come from? (2017) by simias on Friday October 01, 2021 @06:36AM (#28716676)
>If a mathematical statement has no proof within ZFC we (usually) don’t call it a “truth”, regardless of if it is true or not.

I'm not sure I understand what this changes to the overall situation. Remember that a formal system also can't prove its own consistency, so you can't just ignore bits that you don't like and expect that it doesn't matter, it's possible that one of these "true but unprovable" propositions would actually render your system inconsistent, in which case it ought to be addressed.

I mean in the end Godel's own proof effectively relies on this: he builds a proposition using the rule of the system saying "this proposition has no proof" and at this point you either have to accept that the proposition is incorrect, but then your system is inconsistent (it can be used to derive falsehoods) or that it is correct but then the system is incomplete. So you may decide not to call it a truth but you also can't really call it a falsehood.

I would also wager that mathematicians generally prefer incomplete to inconsistent systems, if which case you have to accept that these unprovable propositions are indeed truths.

It's like the "does the set of all sets not containing themselves contain itself" paradox, you can't just ignore it as irrelevant because it puts into question your entire formal system.

Re:Where do type systems come from? (2017) by Filligree on Friday October 01, 2021 @07:52AM (#28717260)
> I'm not sure I understand what this changes to the overall situation. Remember that a formal system also can't prove its own consistency, so you can't just ignore bits that you don't like and expect that it doesn't matter, it's possible that one of these "true but unprovable" propositions would actually render your system inconsistent, in which case it ought to be addressed.

Is that true? It seems to me that if a statement is unprovable, then even if it would in theory render your system inconsistent, there's no way that can actually happen.

Since, if you found any example of a chain of logic which leads to an inconsistency, that would count as a proof of the original statement. Which is unprovable, and as such can't have proofs.

Re:Where do type systems come from? (2017) by simias on Friday October 01, 2021 @08:11AM (#28717429)
But what if the statement is "this statement can't be proven"? You haven't proven the statement, you've proven that it can't be proven.

See https://youtu.be/HeQX2HjkcNo?t=926 for instance which is (IMO) a fairly good explanation of the proof and why you end up with something both true and not provable.

Penrose's "Emperor's New Mind" also discusses this topic at length (within the context of whether human brains can be emulated). I wasn't convinced with his argument regarding AI but his overview of the problem of what's computable and what's not is rather good if a bit dense.

Re:Where do type systems come from? (2017) by Filligree on Friday October 01, 2021 @09:32AM (#28718212)
> Penrose's "Emperor's New Mind" also discusses this topic at length (within the context of whether human brains can be emulated). I wasn't convinced with his argument regarding AI but his overview of the problem of what's computable and what's not is rather good if a bit dense.

As far as I'm aware physics is computable, so I don't buy that one. :)

At most one might argue that there are high-level optimizations to be had, which can't be used because they're uncomputable. In which case is it really an optimization?

Re:Where do type systems come from? (2017) by simias on Friday October 01, 2021 @09:38AM (#28718269)
That's part of his arguments, that some corners of quantum physics that still elude us (quantum gravity and all that) may be undecidable. He then goes on to explain how he thinks these phenomena could have an influence on cognition.

I don't really buy this theory, but the book is basically 80% "here's what we know" and 20% "here's what I conjecture" so it's still a worthwhile read IMO. It's worth noting that it's a book from the late 80's however, so it's a bit outdated in some parts (he didn't know that the universe's expansion was accelerating in particular, which renders his discussion of the curvature of the universe a bit obsolete).

Re:Where do type systems come from? (2017) by ProfHewitt on Friday October 01, 2021 @04:06PM (#28722851)
It turns out that foundational mathematical systems can prove their own consistency.

See the following:

https://papers.ssrn.com/abstract=3603021

However, the proof is not convincing because the proof is

valid even if the system is inconsistent!

Re:Where do type systems come from? (2017) by rssoconnor on Friday October 01, 2021 @11:20AM (#28719615)
There are true (in the sense of Tarski's definition of truth) but unprovable (Π₁) sentences in any consistent (sufficiently powerful) system. Which of these true sentences are unprovable varies from system to system.

Π₁-sentences (see arithmetical hierarchy) are closed formulas of the form, ∀x:ℕ. P(x), where P is some decidable predicate. i.e. all quantifiers in P are bounded. Thus for any given fixed value for x, say n, P(n) can be expanded out into conjunctions and disjunctions of atomic equalities and inequalities between closed arithmetic formula and those (in)equalities can in turn be decided (in principle) by calculation. Notice that 'x' is a formal variable in the language of first order logic, while we are using 'n' as a meta-variable denoting a term representing a numeral, e.g. 42.

Σ₁-sentences are closed formulas of the form, ∃x:ℕ. P(x), where P is again a decidable predicate.

Some basic first order logic yields that the negation of a Σ₁-sentence is logically equivalent to a Π₁-sentences and similarly the negation of a Π₁-sentence is logically equivalent to a Σ₁-sentence.

Important Fact: All true Σ₁-sentences are provable (in any sufficiently powerful system). Why? Suppose ∃x. P(x) is true. Then, there is some numeral 'n' where P(n) is true. Since P(n) is decidable we can prove P(n) when P(n) is true. And, by the rule of existential introduction, ∃x.P(x) is provable from P(n).

Now, let us consider some consistent system T (which is "sufficiently powerful"). For example, we can take T to be ZFC if you think ZFC is consistent. We can construct a Goedel-Rosser sentence for T, let's call this sentence G. G is a Π₁-sentence by construction, so we can put G in the form of ∀x:ℕ. P(x) for some decidable predicate P.

Now either G is true, (i.e. ∀x:ℕ. P(x) is true) or ¬G is true, (i.e. ∃x:ℕ. ¬P(x) is true). Suppose ¬G is true. Since ¬G is (equivalent to) a Σ₁-sentence then T proves ¬G. But by the Goedel-Rosser incompleteness theorem, this would imply that T is inconsistent, contradicting our assumption.

Thus it must be the case that G is true. However G is unprovable in T because, again by the Goedel-Rosser incompleteness theorem, if G were provable in T, then T would be inconsistent, contradicting our assumption.

Thus G is an example of a true sentence that isn't provable in T.

Re:Where do type systems come from? (2017) by auggierose on Sunday October 03, 2021 @04:46AM (#28735570)
So, what do you think about my answer to the same parent? In particular, how is your answer compatible with the fact that ZFC is complete, because it is a first-order theory?
Re:Where do type systems come from? (2017) by rssoconnor on Sunday October 03, 2021 @10:04AM (#28737214)
For sake of argument we will be presuming below that ZFC is consistent.

While it is true that ZFC is model-complete in your sense (which holds for all first-order theories as you note), ZFC has many non-standard models that come with with non-standard sets of natural numbers within them. There are Σ₁-sentences that are false in models with standard sets of natural numbers but are true in models with non-standard sets of numbers.

Tarski's definition of truth, which I'm using for the definition of (in)completeness in my comment, excludes non-standard models because it requires, for example, for a Σ₁-sentence ∃x. P(x) to be considered true, that there actually exist a numeral (e.g. a closed term such as 42), 'n' where P(n) is true (recalling P is a decidable predicate the truth or falsity of P(n) can be determined (in principle) by calculation). When a Σ₁-sentence is only true in models with non-standard natural numbers, such numerals that witness P do not exist.

Some people argue that non-standard natural numbers are just as good as standard natural numbers, and you can try that argument I suppose. However, if I'm hiring someone do formal analysis of some algorithm and they "prove" that it is terminating by showing it terminates in some non-standard number of iterations, then I'm just going to fire them because such a result isn't helpful for reasoning about programs.

There is a material difference between standard and non-standard natural numbers. The standard natural numbers are formed in a natural way from the terms that make up the formal language of the first-order logic under consideration (i.e. the terms that are numerals), but the non-standard natural numbers cannot since they include "numbers" that have no associated numeral. Also note this way of characterizing the standard natural numbers won't work for characterizing "standard sets", because we do not expect all sets to come with canonical concrete terms denoting them, like we do expect for natural numbers.

Re:Where do type systems come from? (2017) by auggierose on Sunday October 03, 2021 @10:29AM (#28737444)
Very helpful answer, thank you! I suspected that it has something to do with "Tarski's definition of truth", but there seem to be different ideas around about what this means. While Wikipedia agrees with yours, I can point to at least one popular book ("An Introduction to Mathematical Logic" by Richard E. Hodel) that equates Tarski truth just with model theoretic truth.

I wouldn't fire the analyst in your example, by the way, because the fault would be mine: I should have just specified what complexity bound would be acceptable in a termination proof of the algorithm for it to be practical for my purposes.

Re:Where do type systems come from? (2017) by rssoconnor on Sunday October 03, 2021 @12:39PM (#28738439)
> I wouldn't fire the analyst in your example, by the way, because the fault would be mine: I should have just specified what complexity bound would be acceptable in a termination proof of the algorithm for it to be practical for my purposes.

I thought someone might say something like this. My counter is that if the analyst just used a normal proof system (i.e. one that doesn't assume false (in the standard model) axioms) then we could use Goedel's Dialectica [1] to mine the proof for some (probably crappy) complexity bound. That said, this is getting close to the edge of my knowledge on this subject.

[1] http://math.stanford.edu/~feferman/papers/dialectica.pdf

Re:Where do type systems come from? (2017) by rssoconnor on Sunday October 03, 2021 @11:29AM (#28737938)
I guess Tarski's definition of truth is relative to some interpretation, but the usual unqualified version of his definition is implicitly relative to the standard model of natural numbers. (Edit: or maybe it is me who is using the notion of Tarski's definition of truth incorrectly.)
Re:Where do type systems come from? (2017) by ProfHewitt on Saturday October 02, 2021 @07:54PM (#28733268)
The halting problem provides examples of true but unprovable

propositions because there are some expressions that do not

halt but it is unprovable that they do not halt.

Re:Where do type systems come from? (2017) by garmaine on Friday October 01, 2021 @06:38AM (#28716690)
I believe it is correct to say there are undecidable theorems in some limited type systems which cannot be proven, but which can be once you extend the type system (e.g. by making it higher-level or dependent).

So in those limited systems we know there are things that are "true" or "false", but which can only be proven when we have a superset of the original tools available.

And by extension, maybe in our more complete type system there are things which can't be proven yet, but could perhaps be if there were better tools available?

Maybe another angle to look at it: one of the things which is difficult to prove is the halting problem. Maybe you can't prove that a given program will terminate. But you could run that program and watch it terminate, and then you'd know it does. In that sense there is a "true" answer, but one which couldn't have been proved in advance from type theory.

But I admit I only have a high-level understanding of these things. Type theory and axiomatic mathematics is something I'd like to know more about.

Re:Where do type systems come from? (2017) by UncleMeat on Friday October 01, 2021 @07:30AM (#28717072)
> If a mathematical statement has no proof within ZFC we (usually) don’t call it a “truth”, regardless of if it is true or not.

This depends on your formalism for logic. Intuitionist logic merges the meaning of "true" and "has a proof" but classical logic does not have any problem with having a thing be called "true" while also not being provable.

Re:Where do type systems come from? (2017) by rocqua on Friday October 01, 2021 @07:47AM (#28717224)
I believe most constructive mathematics (mathematics not using the law of the exluded middle) is actually weaker than peano arithmetic. Certainly there is less that has been proven in it. Most type theory is constructive afaik, hence it might be weaker than even Godel implies.
Re:Where do type systems come from? (2017) by zozbot234 on Friday October 01, 2021 @07:54AM (#28717278)
Constructive mathematics can prove anything that classical mathematics can, and more. The only catch is that propositions which are proven classically must always be stated in the negative fragment of the logic: there's no general duality as there is in classical logic, but a positive and a negative statement mean something different.
Re:Where do type systems come from? (2017) by Koshkin on Friday October 01, 2021 @10:13AM (#28718687)
> and more

I am not sure about that - there are some "pathological" phenomena in classical math that are rejected (for the lack of proof) in constructive math.

Re:Where do type systems come from? (2017) by rocqua on Friday October 01, 2021 @05:18PM (#28723480)
How does this work for the banach tarski paradox?
Re:Where do type systems come from? (2017) by zozbot234 on Saturday October 02, 2021 @05:58AM (#28727390)
That depends on the axiom of choice. From a constructive POV, this means you would have to introduce some sort of extra assumptions to the theorem itself. (The axiom of choice is also inconsistent with some popular extensions to constructive mathematics, so Banach-Tarski simply cannot apply to those mathematical objects.)
Re:Where do type systems come from? (2017) by auggierose on Friday October 01, 2021 @08:43AM (#28717727)
ZFC comes with First-Order Logic and is certainly complete. You are right in that sense.

Let me be more specific: Given a sentence that is true in every model of ZFC, you can prove that sentence. This is true because ZFC is a first-order theory, and this is a property of ANY first-order theory.

People that are pointing out incompleteness are talking about something else: They are talking about the fact that there are sentences S where neither S nor not S is provable. Additionally, there is a meta reason why S is believed to be true. For example, take S = encoding of "ZFC is consistent". BUT: This sentence S is true in some models of ZFC, and false in others, because otherwise the completeness of ZFC would make it provable / disprovable. So this boils down to the meta-truth being different from truth in a model.

Disclaimer: I just recently looked seriously into this stuff, because I was wondering about completeness of a logic I invented. So if the above is wrong, please somebody correct me!