News for hackers. Stuff that matters.
Re:Formalising Mathematics: An Introduction by Abhinav2000 on Sunday February 21, 2021 @01:59PM (#26216088)
What is constructive mathematics for the layman?
Re:Formalising Mathematics: An Introduction by kevinbuzzard on Sunday February 21, 2021 @02:18PM (#26216239)
It's mathematics where certain kinds of proof by contradiction are not allowed -- if you want to prove that something exists because you want to use it, then you have to make it, you can't just say "let's assume it didn't exist and go on from there to deduce that 0 = 1 which is definitely wrong, so our assumption is wrong, so it exists, so let's use it".

Here is the reason why it's obvious for mathematicians. If you're trying to prove a theorem (e.g. the theorem that class numbers of imaginary quadratic fields tend to infinity), and then someone comes up with a proof which assumes that a certain generalisation of the Riemann hypothesis is true, and then someone else comes up with a proof which assumes that the exact same generalisation is false, then we mathematicians say "great, the theorem is now proved". This actually happened.

However if your boss asks you to write some code which does a calculation, and the next day you show up in their office with two USB sticks and say "this code is guaranteed to produce the correct answer if the Riemann hypothesis is true, and this other code is guaranteed to produce the correct answer if the Riemann hypothesis is false" then you are going to lose your job, because all you did was prove that the code exists, which is less helpful than it could be.

For me one of the biggest problems with the area of formalisation of mathematics is that for decades it has been dominated by computer scientists, whose view of what is important and beautiful in mathematics does not really coincide with that of the working mathematician. This is what I am fighting to change.

Re:Formalising Mathematics: An Introduction by auggierose on Sunday February 21, 2021 @02:38PM (#26216398)
> This actually happened

Oh wow! Was it an interesting theorem that got proved this way? Did it get proved in another, less controversial manner as well? Could you provide a pointer to it?

Re:Formalising Mathematics: An Introduction by Someone on Sunday February 21, 2021 @05:27PM (#26217923)
Re:Formalising Mathematics: An Introduction by vmilner on Sunday February 21, 2021 @05:25PM (#26217909)
I remember when encountering my first (or one of my first) proof by contradiction (irrationality of sqrt(2), say) feeling unsatisfied because I didn't know how one could know that it was _your_ assumption that was wrong and not one of the more fundamental ones of mathematics.
Re:Formalising Mathematics: An Introduction by stacksemantics on Sunday February 21, 2021 @06:01PM (#26218235)
There is only one kind of proof by contradiction. Assume not P, derive a contradiction which implies not not P, then conclude (via excluded middle) P.

If you assume P, derive a contradiction, then conclude not P, that is a direct proof of negation not a proof by contradiction.

Re:Formalising Mathematics: An Introduction by auggierose on Sunday February 21, 2021 @02:40PM (#26216412)
I'd say it is still a pretty constructive answer, as you can run both codes, get two concrete answers, and one of them is guaranteed to be right.
Re:Formalising Mathematics: An Introduction by kmill on Sunday February 21, 2021 @03:58PM (#26217125)
A way to think about whether something is constructive is that everything is decidable, in the sense that there is some procedure that will give you the answer in finite time.

In Kevin's example where you have two programs, one which depends on the Riemann hypothesis being true and the other which depends on it being false, is that you can't just execute the programs -- they might have undefined behavior since they depend on the truth of some statement during their executions, and there's no general algorithm to decide whether undefined behavior is happening. They depend on undecided facts, so you can't put them together into a single program that decides the result. (Maybe a slogan is "truth can be contingent, but data cannot be.")

In Lean syntax, this is an example type signature of something that takes two programs (h and h') that respectively take in the truth/proof of a proposition or its negation, along with a proof that there is at most one element of α, and produces that element. I don't think there's a way to write this definition in Lean without marking the definition noncomputable:

  def extract {p : Prop} {α : Type*}
    (h : p → α) (h' : ¬p → α)
    (unique : ∀ (x y : α), x = y) : α := sorry
(the sorry indicates a missing definition).
Re:Formalising Mathematics: An Introduction by auggierose on Sunday February 21, 2021 @04:22PM (#26217345)
Yeah, I really was joking.
Re:Formalising Mathematics: An Introduction by Someone on Sunday February 21, 2021 @07:18PM (#26218812)
“and one of them is guaranteed to be right.”

That’s where opinions will differ. That’s only true if you accept the law of the excluded middle.

Mainstream math does, but most constructive math does not.

Re:Formalising Mathematics: An Introduction by auggierose on Sunday February 21, 2021 @07:57PM (#26219217)
Yup, I do accept the law of the excluded middle. Unreservedly. From a logical point of view, I cannot really imagine what it would mean NOT to be true.

Yes, Kripke semantics makes sense of constructive logic. Topos theory, too. But I really think of all of these embedded in classical logic, and assuming that the law of excluded middle doesn't hold for general reasoning just doesn't make any kind of sense to me.

Re:Formalising Mathematics: An Introduction by Abhinav2000 on Sunday February 21, 2021 @02:41PM (#26216426)
Thanks Kevin. It seems like having both approaches is more flexible and thus more general (which can hopefully only be a good thing?). One could always replace a proof by contradiction later with a direct proof, but there's definitely value in using it in the meantime (at least in my uneducated view).

p.s. could you let me know your e-mail so I can keep for future reference, as I'm also working on a hobby project for automated theorem solving.

Re:Formalising Mathematics: An Introduction by sgeisenh on Sunday February 21, 2021 @02:50PM (#26216497)
https://en.wikipedia.org/wiki/Intuitionistic_logic

If you are familiar with "Classical" logic, constructive math omits the law of excluded middle (e.g. "A or not A" must be true). In ZFC, the axiom of choice is omitted.

This leads to proofs that are not only a verification of some idea but also gives you the mechanism to compute the evidence. This is often described as "the computational content of proofs" and is especially valuable in the context of the Curry-Howard isomorphism: for every proof, there is a corresponding program (and vice-versa). This is the basis for formal verification of constructive proofs. When creating a proof in Coq, you are actually writing the corresponding program. And you can even extract the program in another general purpose programming language (usually OCaml in the context of Coq, but Haskell is also supported).

Re:Formalising Mathematics: An Introduction by abhinav22 on Sunday February 21, 2021 @05:32PM (#26217981)
Many thanks
Re:Formalising Mathematics: An Introduction by ithinkso on Sunday February 21, 2021 @02:50PM (#26216494)
Constructive mathematics rejects the law of excluded middle.

In a non-constructive mathematics it is true that 'either A or not A is true' and that allows you to prove existence of objects with certain properties by disproving their non-existence (if it cannot not-exist then it has to exist, by the law of excluded middle). Constructive mathematics, on the other hand, says that that's not enough and to prove that there exist objects with some properties you have to prove their existence.

Re:Formalising Mathematics: An Introduction by stacksemantics on Sunday February 21, 2021 @05:54PM (#26218194)
Constructive mathematics does not affirm excluded middle. That's distinct from rejecting it.
Re:Formalising Mathematics: An Introduction by ithinkso on Sunday February 21, 2021 @07:01PM (#26218683)
What do you mean? (sorry, english is not my first language).

The way I understand it is that if you have the law of excluded middle you cannot discard 'non-constructive' proofs as invalid since they follow straight from the axioms.

Re:Formalising Mathematics: An Introduction by stacksemantics on Monday February 22, 2021 @02:58AM (#26221956)
Constructive mathematicians do not assert that excluded middle is true since there is no constructive proof of (P not P). Nor do they assert that it is false, since that statement, (not (P or not P)), is constructively refutable i.e. there is a constructive proof of (not not (P or not P)). So there are no instances in constructive mathematics where excluded middle is false. But there are constructive settings where excluded middle holds, e.g. Boolean topoi, but you have to prove excluded middle is validated.

So we can't claim constructive mathematicians reject excluded middle, since they reject the rejection of excluded middle. I admit this will be confusing for people used to classical logic at first, even those for whom English is their native language.

> The way I understand it is that if you have the law of excluded middle you cannot discard 'non-constructive' proofs as invalid since they follow straight from the axioms.

This is accurate, my above point is just a pedantic one about semantics.

Re:Formalising Mathematics: An Introduction by Someone on Monday February 22, 2021 @02:46AM (#26221882)
“Not affirm” means they don’t take it as an axiom (“we don’t take this to be obviously true”)

“reject” would mean that if, given their set of axioms, it could be proven, they would try and tweak their axioms in order to make it unprovable or provably false in their system (“we think this cannot and should not be true”)

So, “not reject” means they would happily use it in their proofs, if it could be proven from their set of axioms (“interesting. That gives us a powerful tool to do proofs”)

Re:Formalising Mathematics: An Introduction by abhinav22 on Sunday February 21, 2021 @05:33PM (#26217996)
Thanks
Re:Formalising Mathematics: An Introduction by a1369209993 on Sunday February 21, 2021 @02:15PM (#26216216)
Roughly, that proving a statement of the form "For all a,b,c,..., there exists x,y,z such that some statement involving a,b,c,...,x,y, and z is true." requires actually constructing suitable x,y, and z given suitable a,b,c, etc to derive them from.
Re:Formalising Mathematics: An Introduction by zozbot234 on Sunday February 21, 2021 @02:51PM (#26216499)
With the proviso that the non-constructive statement '∃ x such that P(x)' can also be understood constructively as '¬∀ x ¬P(x)' which does not require constructing a suitable x, so classical proofs can be modeled without adding any extra axioms to the logic. (Clearly the two statements are classically, though not constructively equivalent).

Similarly, all classical uses of LEM (A ∨ B) can be understood as constructive statements of the form ¬(¬A ∧ ¬B).

Re:Formalising Mathematics: An Introduction by Abhinav2000 on Sunday February 21, 2021 @02:42PM (#26216429)
Thanks
Re:Formalising Mathematics: An Introduction by rssoconnor on Sunday February 21, 2021 @04:49PM (#26217587)
A lot of responses are going to say something like "it is mathematics without using the law of the excluded middle, or proof by contradiction" or something like that. They are not technically wrong, but I'd like to offer a different perspective.

The constructive logic used in constructive mathematics is classical logic with two new connectives added: the constructive existential, and the constructive disjunction (which could be defined in terms of the constructive existential).

The constructive disjunction and constructive existential connective has semantics given by the BKH interpretation[1]. A proof of the constructive disjunction A + B is either a proof of A or a proof of B. A proof of the constructive existential Σn:N. P(n) is a pair <n,p> where n is a natural number and p is a proof of P(n).

So constructive mathematics isn't classical mathematics hindered, but constructive mathematics is mathematics enhanced with a more expressive language. Naturally constructive mathematics tends to focus on theorems written in this more expressive language that make use of these new constructive connectives, rather than focusing on the classical fragment which is already well studied.

For the non-layman: we can see that the above interpretation is correct because the fundamental logical rules for universal quantification, implication, conjunction, false and true are all identical between classical and constructive logic. And, according to classical mathematicians at least, this set of logical combinatorics is complete. Thus the law of excluded middle holds, even in constructive logic, so long as you use the classical disjunction, which is defined in terms of conjunction, implication, and false. Similarly you can prove that proof by contraction, i.e. double negation elimination ¬ ¬A -> A is a theorem of constructive logic whenever A is a formula that does not use the constructive disjunction or constructive existential (where negation is defined in terms of implication and false).

For the all of the above, I'm particularly focused on first-order number theory, however all of the above carries over to higher-order theories, and I think it even holds for set theory (or at least some large part of set theory such as Zermelo set theory; I forget what happens with the replacement axiom). Higher-order constructive mathematics does come with the caveat that the Axiom of Choice is not a theorem of constructive mathematics even when it is phrased only using the classical existential.

[1]https://en.wikipedia.org/wiki/Brouwer%E2%80%93Heyting%E2%80%...

Re:Formalising Mathematics: An Introduction by abhinav22 on Sunday February 21, 2021 @05:33PM (#26217990)
Thanks!