5 ms·
Ask HN: Can the same individual accomplish more with programming than proofs?
Programming is a kind of fuzzy proof where details are worked out using debugging. The resulting program may not be perfect but it can be good enough.
Explicit proofs (e.g., in math and CS) are more precise but longer, harder to check, and harder to debug. And a missed detail or small mistake can render the entire proof wrong and unfixable.
So it seems that the same individual could accomplish more in life with programming than proofs.
- PaulHoule 5y agoDepends what you mean by “more.” You can write programs to search for and do other things with prime numbers. However this can only tell you about specific prime numbers. With proof you can prove things about all prime numbers or the integers as a whole. For instance Euclid proved that there are an infinite number of prime numbers. We remember Euclid 2300 later so he accomplished a lot with his life. Today there is a big market for web pages, microcontrollers for gas pumps and washing machines, missile defense systems, etc. You can keep very busy writing programs for that stuff but it probably won’t be remember in 2300 years. (What’s a gas pump?)
- amichail 5y agoBut maybe Euclid could have accomplished more in life with programming?
- PaulHoule 5y agoIn some sense yes. The two also can go together like peanut butter and jelly. When I was in grad school my thesis contained a derivation of the Gutzwiller trace formula https://inspirehep.net/files/20b84db59eace6a7f90fc38516f530ee https://inspirehep.net/files/20b84db59eace6a7f90fc38516f530e... integrating over phase space instead of position space (that paper does it over position space.) It was about 40 pages worth of math and while I wrote the math I also wrote each equation in a computer program that would try different inputs and check that the equality held. This didn't "prove" anything, but it convinced me that I had the math right. When you do a calculation like that you might have 50+ places where there might be or might not be a minus sign and if you make any mistakes you might as well flip the coin to get the sign. I could have done the calculation without writing the program but I would have either gotten the wrong answer (not so likely in this case because I knew what the answer was) or gotten the right answer in the wrong way.
- Brian_K_White 5y agoHe could write programs that find more primes, but never one that proves there will always be an infinite supply of primes. I think other comments already said it. "more" is an ambiguous term. Do whatever you want and feel free to call that "accomplishing more".
- jakear 5y agoWait what? Computer science encompasses mathematics. Any proof that can be validated by following a known set of reduction steps until axiomatic statements are reached (i.e. any proof worth the paper it’s written on) can be verified just as well by a computer as a person. For your specific case: definition infinite_primes (n : nat) : {p | p ≥ n ∧ prime p} := let m := fact (n + 1) in have m ≥ 1, from le_of_lt_succ (succ_lt_succ (fact_pos _)), have m + 1 ≥ 2, from succ_le_succ this, obtain p `prime p` `p ∣ m + 1`, from sub_prime_and_dvd this, have p ≥ 2, from ge_two_of_prime `prime p`, have p > 0, from lt_of_succ_lt (lt_of_succ_le `p ≥ 2`), have p ≥ n, from by_contradiction (suppose ¬ p ≥ n, have p < n, from lt_of_not_ge this, have p ≤ n + 1, from le_of_lt (lt.step this), have p ∣ m, from dvd_fact `p > 0` this, have p ∣ 1, from dvd_of_dvd_add_right (!add.comm ▸ `p ∣ m + 1`) this, have p ≤ 1, from le_of_dvd zero_lt_one this, absurd (le.trans `2 ≤ p` `p ≤ 1`) dec_trivial), subtype.tag p (and.intro this `prime p`) https://homotopytypetheory.org/2015/12/02/the-proof-assistant-lean/ https://homotopytypetheory.org/2015/12/02/the-proof-assistan...
- Jensson 5y agoWriting proofs in proof assistants is still harder than writing regular proofs despite all efforts done to make it simpler, so I doubt that Euler would have managed to prove much if he tried to do it via computer programs instead. Not to mention what it does to readability, humanity would never have gotten anywhere if mathematicians produced proofs looking like that. I'm not sure why programmers say mathematicians write hard to read stuff, when programmers trying to do the same thing comes up with that.
- jakear 5y agoIf Euclid had formulated his proof from axioms rather than intuition it would a) be an actual proof and b) far exceed the length of the above snippet.
- nvrrdt 5y agoWhat's the practicality of knowing that there's infinite number of primes?
- PaulHoule 5y agoIt's a fundamental fact about the theory of primes which has practical applications such as https://en.wikipedia.org/wiki/RSA_(cryptosystem) https://en.wikipedia.org/wiki/RSA_(cryptosystem)
- mkl 5y agoRSA requires a lot of big primes to exist (so the search space is large), but doesn't require infinitely many. For each key size there's a maximum prime size that matters, and all RSA cryptography that's used in practice would work fine if there were, say, no primes with more than a million digits.
- turbinerneiter 5y agoWhat if you proof the correctness of a compiler? Do you then transiently get all the achievements of all safety critical software that was then programmed with it? The value of the proof comes from the things it enables. I guess the Rust memory safety guarantees are based on some proofs?
- crocal 5y agoFYI, this has been done: https://compcert.org/ https://compcert.org/
- gpm 5y ago> Do you then transiently get all the achievements of all safety critical software that was then programmed with it? It's possible to write incorrect code and compile it with a correct compiler, so I don't think so. It's more like a citation that proven correct programs can use to say "I wrote this program correctly (see my own proof), and I compiled it correctly (see citation), thus I have a correct executable file". > I guess the Rust memory safety guarantees are based on some proofs? People have retroactively come up with formal proofs for much of it, but I believe the initial design was just based on intuition not a proof. For unsafe code some of the exact details of the memory model are still being worked out too (and thus definitely aren't proven correct).
- sgeisenh 5y agoThe Curry-Howard correspondence would like a word. Any time you write a program, you are also writing a proof. Mechanized proof checkers leverage this idea to enable users to specify formal proofs as programs.
- Jensson 5y agoPrograms are proofs in the same way solutions to arithmetic's problems are proofs, they typically don't prove anything interesting so are not considered proofs even though in practice you could map every program to some set of mathematical statements and vice versa. Edit: And for this topic in question, If you don't understand what you are proving then you aren't working with proofs. I really doubt that programmers actually constructs their programs by mapping it to mathematical statements, seeing what it proves and then mapping it back to a program, so they are writing programs, not proofs.
- gjm11 5y agoThe Curry-Howard isomorphism doesn't say that an interesting proof corresponds to a program anyone would care about (other than as an equivalent to the proof), nor that an interesting program corresponds to a proof anyone would care about (other than as an equivalent to the program). In practice, writing programs and finding proofs feel like quite different activities, and at least in my experience of doing both I almost never try to write a program by thinking "how could I prove that such-and-such a type is nonempty" and I literally never try to prove something by finding a corresponding type and writing a program that computes or represents something of that type. The Curry-Howard isomorphism is a beautiful theorem, and as you say it inspires some nice methods of automated proving / proof-checking, but I don't think it says anything much about the relationship between the programming and theorem-proving activities that actual humans engage in.
- AnimalMuppet 5y ago> Any time you write a program, you are also writing a proof. True, and (mostly) irrelevant. When I write a program, I am also writing a proof, but I don't care about it as a proof. It proves something that I am completely uninterested in proving. But as a program, it's a program that I am interested in running.
- wisnesky 5y agoWhen I write math papers I often use proof assistants such as Coq to leverage my programming background to avoid some pencil and paper proofs altogether and rule out many sources of human error. If you consider yourself better at programming than proving, definitely take a look at proof assistants to leverage the former to enhance the latter.
- dfdz 5y agoThere are about 30 million coders in the world [1] And about 80 thousand mathematicians [2] So about 375 individuals programming for every 1 person writing proofs If we assume this configuration is optimal, then my answer to your question is that if you had a group of 10000 people who like programming and proofs and have 9983 program and 27 write proofs this would be the best way to “accomplish more in life” [1] https://www.future-processing.com/blog/how-many-developers-are-there-in-the-world-in-2019/ https://www.future-processing.com/blog/how-many-developers-a... [2] https://mathoverflow.net/questions/5485/how-many-mathematicians-are-there https://mathoverflow.net/questions/5485/how-many-mathematici...
- jameshowison 5y agoYou might find some more thinking about this in the field of Computational Science and Engineering (aka CSE). This is related to computer science, but distinct (often a separate department). https://en.wikipedia.org/wiki/Computational_engineering https://en.wikipedia.org/wiki/Computational_engineering Some universities call these "Scientific Computing" as well. E.g., https://gradadm.seas.upenn.edu/masters/scientific-computing/ https://gradadm.seas.upenn.edu/masters/scientific-computing/ There is even an industry journal (closely linked to high performance computing). Of course this CSE is said to mean "Computing in Science and Engineering" (just to add confusion): https://www.computer.org/csdl/magazine/cs/2022/01 https://www.computer.org/csdl/magazine/cs/2022/01 Here's a paper that touches on some of the challenges of implementing proofs (and other scientific theory) in software. https://f1000research.com/articles/9-1192 https://f1000research.com/articles/9-1192
- throw149102 5y agoI think a critical point here lies on what exactly you're accomplishing when you're programming. A person could spend a lifetime on improving Google's ad network, make an incredible amount of money from it, and for all that have not accomplished very much in the sense that we care about accomplishment. One question that comes to mind is "What would happen if everyone did this?". To me, it seems straightforward that we don't want everyone writing proofs to switch over entirely to programming, nor do we want everyone coding to switch over entirely to writing proofs. We would want a certain proportion of people doing proofs, and other proportion doing programming. Each person's own experiences and talents would determine which one is more useful, but on-balance we might have some proportion p doing proofs, and 1-p doing programming. So, the question of "Can the same individual accomplish more with programming than proofs" turns into 2 questions - the situation that person is in, and also the global context of whether society is doing a good job at maintaining p provers and 1-p programmers for the overall benefit of society. For my money, I think society has made p too small. There are way too many good reasons to go into software engineering as opposed to math and CS (namely $$$$) and as a result the social benefit of proofs is under-explored. I don't think however, that I would accept very bad odds for that bet like 1:100 or 1:1000. Proofs (and the societal structure, academia, that has been created to create proofs) have their own problems and as such it's very hard to even determine what p should be.
- arcbyte 5y agoI'm actually betting on the opposite. Better proof systems will allow programmers to accomish many multiples of current productivity.
- ozim 5y agoI would argue on the point that more and more programming in my experience seems not to support things that are calculation heavy and need "correct answers" but supporting workflows and models of thinking. I don't see how supporting workflows or setting/managing/evolving models of thinking can have anything to do with proof systems or proving correctness of algorithms. Since we have CRUD basically worked out there is so much more software that can be written without being mathematically strict like the DBMS that we build on top.
- Jtsummers 5y agoPor que no los dos? There are reasons to prove things and reasons to program things. What is the hypothetical individual trying to accomplish that they can do more via programming than proofs? Also, as pointed out by others, as of the 20th century we had automated proof systems which have only improved in the 21st century. So someone wanting to prove things can do a lot more now without relying as much on proving "by hand".
- amelius 5y agoSmart people should write proofs. Less smart people should do the plumbing.
- graycat 5y ago> Explicit proofs (e.g., in math and CS) are more precise but longer, harder to check, and harder to debug. Sorry, I've done a LOT in both (1) proofs in pure and applied math and (2) algorithms and software, and your statement is strongly wrong and backwards -- the math is much easier than the computing. E.g., my Ph.D. dissertation in applied math had both proofs and the results of some software. There was no problem getting errors out of the proofs. Proofs are really easy to check. I've done thousands of proofs, and I'm not sure I've ever had a mistake in one. I've written perhaps a million lines of software, and over 50% of the programs had bugs until I found and fixed them. One of the real advantages, powers, of math is how easy it is to check proofs. Commonly it is much easier to have a correct and relatively easy to read proof of a math theorem than it is to have a correct and relatively easy to read proof of an algorithm where it is easy to see that the proof and the algorithm are as claimed. Even for just a simple, old algorithm such as Quicksort, it is not easy to prove it is correct; even the notation is not easy. In computing, proofs of correctness commonly have to be in the framework of mathematical induction, and there some notation is needed typically not seen otherwise for the algorithm. Uh, mathematical induction is to show something is true for all the natural numbers, and the technique basically returns to one of the good definitions of the natural numbers. Beyond just algorithms, in computing proofs of correctness are so difficult that we essentially give up: The reason is, the assumptions are too difficult to list. If you will, a common problem is "too many edge cases". It is true that there is something to learn about how to write proofs. Pure math has a standard that in precision puts it far above essentially all other writing: Some pictures or intuitive explanations may be tolerated but they are not necessary and mostly not wanted. Also, there is no role for "try it and find out", for "doing some examples to see how it goes", some manual manipulation like do when when learning to use socket wrenches or a chef's knife. An old joke was, how complicated a math description would be for how to put on a suit coat. E.g., a missed definition sticks out worse than a sore thumb. E.g., it should be clear, maybe even mentioned, in the proof, for each of the assumptions, where it got used. So, the math writing has to give really solid results just from the words and math notation. Bluntly, that is unique in writing. For accomplishing good, new things, I'm strongly on the side of math with proofs. The core of my startup is an example. There are no heuristics there, just some math with proofs. Without the math, there would be only guessing and heuristics on how to manipulate the input data to give the desired outputs, and the chances of any heuristics having stumbled onto the same manipulations as provided by the math are zip, zilch, and zero. E.g., some of the math is close to some math commonly considered, but my math fixes some essentially universal mistakes, really misunderstandings, that have become standard. That is, the common understanding is that there is a fundamental problem there, but that is not true, and my math, with proofs, shows that. Without the math and proofs, I would not have thought of the data manipulations or, if I did, have confidence in their correctness or power. Sorry, guys: In my opinion, math is the main tool for the most important progress in applying computing to help civilization.
- guyomes 5y agoOne of the goal of mathematics is to introduce tools that represent problems in a way that is easy to grasp for a human mind. For example, geometry is a good tool to get some intuitions on the problem of classifying sets of data. Also, a well written proof is, by design, easier to check by a human than by a computer. On the other hand, programming languages are designed first to be easily parsed by computers. With supercomputers, exascale computing [0] is now possible. Yet it is still hard to use fully the power of such computers because what is intuitive for a human mind is not always easy to program. For example the video proof of the inversion of the sphere [1] is checked more easily by a human than by a computer. Finally instead of using only the power of computers, or only the power of human brains, it is also possible to combine both. This requires to improve the interaction between computers and human beings. In a video on thinking the unthinkable [2], the author notably remarks that the introduction of symbols in algebra allowed human beings to extend the problems they could think about. With better interfaces, the computers could help us to write fuzzy or explicit proofs, but more importantly, they could help us to think. [0]: https://en.wikipedia.org/wiki/Exascale_computing https://en.wikipedia.org/wiki/Exascale_computing [1]: https://youtu.be/OI-To1eUtuU https://youtu.be/OI-To1eUtuU [2]: http://worrydream.com/MediaForThinkingTheUnthinkable/ http://worrydream.com/MediaForThinkingTheUnthinkable/