Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Theorem: There are infinitely many prime numbers.

Proof:

[GPT-3's "proof"]

Let p be a prime number. Then by definition, p is a positive integer that has no positive divisors other than 1 and p.

Now consider the integer q = p + 1. We will show that q is not a prime number, which will prove that there are infinitely many prime numbers.

Since p is a positive divisor of q, q cannot be prime.

[...another attempt with the same prompt]

We know that there are infinitely many natural numbers. Let's suppose that there are only finitely many prime numbers. Then we can list them all:

p_1, p_2, p_3, ..., p_n

Now, consider the number

N = p_1 p_2 p_3 ... p_n + 1

This number is greater than any of the prime numbers in our list, so it cannot be divisible by any of them. But it is also a natural number, so it must be prime. This contradicts our assumption that there are only finitely many prime numbers, so we must conclude that there are infinitely many prime numbers.

~~Personal remark: I had to give it the same prompt like 5 times to get a correct-ish proof. The first attempts came out like the first example.~~ The proof is still wrong.



Interestingly, these attempts are about the same as what pops up when I try to remember the proof:

- It's a proof by contradiction - The key step is in taking the finite list of primes, multiplying them together, and adding 1

I then try to flesh out the details, it might take a second to realize that this new number is also prime, and then a few moments more to remember the exact rationale why.

Along the way the proof lives in a kind of superposition where I'm not clear on the exact details. The "proofs" you gave here seem to be serializations of a similar superposition! GPT-3 seems to remember the proof about as well as I do, but it's missing the final sanity check which tweaks the proof until all the pieces correctly fit together.

In this case, you seem to be performing a version of this sanity check by running the prompt multiple times until a correct answer comes out. I wonder if it's possible to prove something more obscure using a similar process: GPT-3 comes up with ideas and the human sanity checks.


>this new number is also prime

Not necessarily, it might be composite, but in this case one of it's prime factors will necessarily not lie in the supposed list of primes, therefore also a contradiction.

The first counter example to "If L := {P0,P1,..,Pn} is a list of primes, then prod(L)+1 is prime" is {2,3,5,7,11,13}, their product is 30030, and 30031 is a composite of 2 primes, none of which are in the list.


It's somewhat silly semantics, but I believe it is a valid deductive step on the way to the contradiction - if the number is not divisible by any other prime, then it must be a new prime, ⊥.


The issue is that it is not divisible by any other prime *from the list*. The two cases (prime or composite) must be handled separately since they do not use the same logic to infer there is one more prime.

For instance, 2 * 3 * 5 * 7 * 11 * 13 + 1 = 30031 = 59 * 509.


You don't need two separate cases.

Assume p1, ..., pn is a finite list of primes. The sum p1+...+pn+1 is divisible by a prime, because every natural number> 1 is. However, it's not divisible by p1,...,pn, hence there must be an additional prime not in the list.

(I think you're right though that GP's "contradiction" doesn't work)


Oh, you're right.

Never thought of using "by definition, all numbers can be divided by a prime" tu merge the two cases. It's not that shorter, but is IMHO quite elegant, I'll remember it. Thanks for correcting me.


Well, it's not by definition, but "every number is divisible by a prime" is fairly obvious (just keep dividing until you reach a prime) and can technically be proven by using (strong) induction.


too late to edit: p1 * ... * pn+1, of course. not plus.


But to get the contradiction, you assume a finite number of primes. As each of them does not divide the new one, the new one is not divisible by a prime. It seems like your method is some kind of induction? Which probably gets a little closer to the "reason" for it, but isn't the standard proof I've seen.


These are really just logically equivalent ways of getting at the same result. You can either prove the statement "for every finite list of primes, there exists a prime not in this list" directly from the axioms of arithmetic, or you can add its negation "there are finitely many primes" as an assumption, derive a contradiction, and therefore conclude the negation of that new assumption. Nothing substantially changes about the proof either way.


I mean, yeah? It's still true you don't need to prove the composite case separately if you structure it a little different. Plus the original comment was clearly angling for the contradiction, so pivoting without warning to induction is just misleading


There is no induction involved (I mean, yes, for some of the lemmas about divisibility, probably you'll need induction, but not for the main proof).


Oh I see! I was talking about bootstrapping from "there's always another prime" to "there's a countably infinite number of primes", but you can just piggyback off the naturals.


Well, I suppose it matters which definition of "infinity" you want to use. The modern definition of an infinite set is that it's a set for which there exists an injection into the natural numbers. But that definition brings you into the territory of set theory, which seems unnecessarily complex when you're just trying to prove something about arithmetic.

Euclid's original proof of the theorem is of the form "for any list of primes, I can find an additional prime" [0], and for good reason: in Ancient Greece, thinking of infinity, or infinite sets, as a concrete object that you could manipulate would have seemed weird.

But the proof variant where you produce a contradiction doesn't really get into the set-theoretic details either. All it does is say: "Assume there is a finite list of all primes. Derive a contradiction. Therefore there is no such list." That's pretty much equivalent to the direct proof, it's just using different logical inference rules.

[0]: http://aleph0.clarku.edu/~djoyce/java/elements/bookIX/propIX...


I feel that calling the final step a "sanity check" underrates its significance. To me, it implies that you essentially have the proof, and you are just looking for confirmation that it is sound and whether there are some edge cases to finish off. In contrast, I would say that it is the first point at which you understand how the half-remembered fragments of the proof can be put together to make an unassailable case for the proposition. Until then, it is as if you are groping around in the dark, trying to remember what the room looked like when the light was on (I know what it's like, as I have frequently been in that situation!)

These answers are the sort one might expect from something that has a vast memory for what it has seen before, and an ability to draw huge networks of syntax-level associations and generalizations from all that text, but is not so strong on semantic associations and generalizations that are not manifest at the level of syntax. What surprises me is how successful that has been.


The thing I find interesting about the proof attempts in the GP comment is that they very much resemble what you'd expect to see coming from a hypothetical somewhat confused undergrad. I think that ties into what you say about the proof living "in a kind of superposition where I'm not clear on the exact details," because that's where I imagine said hypothetical confused undergrad's understanding being.


It’s imitation rather than true understanding. Still, even imitation is a remarkable ability for a computer.


I believe this recent paper demonstrates a method for allowing these large language models to perform this "sanity check" automatically[0].

[0]: Self-Consistency Improves Chain of Thought Reasoning in Language Models https://arxiv.org/abs/2203.11171


Both proofs are wrong, second one is closest. Second one should not claim that N is a prime (it likely isn't). It should say N is not divisible by any of p_i, and since due to Fun. Theo. of Arith. it is such that N = Sum {c_i q_i} where q_i are prime, and none of q_i in {p_i} which shows a finite list of primes is not possible construct.


This isn't really the "human level mathematician" equivalent task anyway. A human mathematician's main purpose isn't to memorize and reproduce proofs generated by other people. It's to prove original results no one else has proven before. To remember and reproduce existing proofs, I just typed "proof infinitely many primes" into DuckDuckGo and it gave me plenty of correct results.


That's like saying "standing still" isn't a human-level sprinter's task. In principle, yes, nothing in the 100m sprint requires that you need to be able to stand still. In practice, I would be very skeptical of someone who can't stand claiming they can sprint.


It's a human level mathematics student problem. If it can't determine that's it's proof is nonsense here there's little hope it could produce any worthwhile original work.


What does GPT-3 come up with if you ask it for a proof that there are a finite number of primes? Or that pi is rational?

I guess it would stitch together some more seemingly sensible statements that also don’t quite add up to a rigorous proof?


I keep asking GPT-3 to prove that the LR algorithm (for finding eigenvalues and eigenvectors) converges for PSD matrices. It keeps insisting that it's a form of gradient descent. Is that true?


I'm actually taking a proofs class right now, and edit my Latex in VS Code with Copilot enabled. Its syntax is always perfect, but most of the time it produces stuff that doesn't make a ton of sense. There have been a few times when it gets the next couple of lines correct for repetitive proofs with a lot of "boilerplate", but it doesn't really make big logical/creative jumps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: