<p>The only thing that programming can do for you is teach you logical thinking, if you have problems there.</p>
<p>The computer won't let you use assumptions or take shortcuts. You have to create a complete, logical sequence of instructions to get from the problem to the solution. And that skill is of course also needed for mathematical proofs.</p>

CC BY-SA 4.0
2020-07-20T13:42:16.843Z
2020-07-20T13:42:16.843Z
Ralf Kleberhoff
<p>This is pretty much in the realm of opinion, but as a math PhD and a long time CS professor, I'd guess the answer is no. Programming is fun and programming can be useful, but its application to proving theorems in mathematics is very specialized and a bit limited. And it generally doesn't apply to the sorts of things a struggling math student wants to learn.</p>
<p>There are a couple of exceptions in which programming was instrumental in establishing a proof. One is the <a href="https://en.wikipedia.org/wiki/Four_color_theorem" rel="nofollow noreferrer">Four Color Theorem</a> which was originally proved with a computer because of the huge number of different possible planar maps. But mathematicians, like myself, find that proof unsatisfying and would prefer one that was more analytical and which would lead to more insight. But these sorts of cases are very rare.</p>
<p>But, theorem proving, like anything else is a skill best learned through practice. Once you have tried and eventually succeeded at proving some theorems, perhaps after false starts, you will start to gain insight. Every success can lead to the next success. But it is hard work. And the work may not get easier as you go, since you will probably take on harder problems. But practice, practice, practice.</p>
<p>Programming does, however, give you some practice with thinking logically and breaking a hard problem down into smaller, easier, parts. In that sense programming can be a bit helpful. But to learn math, just <em>do</em> math.</p>
<p>On the other hand, there are <a href="https://en.wikipedia.org/wiki/Automated_theorem_proving" rel="nofollow noreferrer">automated Theorem Provers</a> that can do some interesting things. But their results don't generally lead to the insight into a problem that a mathematician needs and to build one of them requires deep insight to start with.</p>

CC BY-SA 4.0
2020-07-16T11:13:15.933Z
2020-07-16T11:13:15.933Z
Buffy
<p>Programming is very useful in the process of conjecturing, and to some extent even in proofs.</p>
<p>Here are some examples from my own research, in theoretical computer science and combinatorics:</p>
<ol>
<li><p>An algorithm for maximum coverage (a basic combinatorial optimization problem) employs a non-standard objective function, with finely tuned parameters. These parameters were obtained by solving a linear problem on a computer. The parameters depend on <span class="math-container">$n$</span>, so I solved the linear programs corresponding to small <span class="math-container">$n$</span>, and generalized the solution. The solver also found the tight constraints, and this was very instrumental in the proof.</p>
</li>
<li><p>The construction of the Gelfand–Tsetlin basis for the Johnson scheme (equivalently, a canonical eigenvector basis for the Johnson and Kneser graphs) came out of some experimentation in a computer algebra system; I don't know whether you consider this programming.</p>
</li>
<li><p>Several papers in social choice theory aimed at proving phenomena which were first observed experimentally; this required programming in an efficient language.</p>
</li>
<li><p>Optimal gadgets in a paper in circuit complexity were found by exhaustive search using an efficient computer program.</p>
</li>
</ol>
<p>I would say that programming is a useful skill, at least in certain areas of mathematics.</p>

CC BY-SA 4.0
2020-08-06T10:18:00.690Z
2020-08-06T10:18:00.690Z
Yuval Filmus
<p>I study mathematics and sometimes I have difficulties to find proofs or counterexamples to some problems. Is it useful to learn programming to find counterexamples or proofs? How useful it is for mathematician to learn for example Coq or Lean?</p>

<programming><mathematics>
How useful it is for math student to learn programming to find proofs or counterexamples?
# How useful it is for math student to learn programming to find proofs or counterexamples?

(Asked by: username_0 on 2020-07-14)

I study mathematics and sometimes I have difficulties to find proofs or counterexamples to some problems. Is it useful to learn programming to find counterexamples or proofs? How useful it is for mathematician to learn for example Coq or Lean?

**Tags:** programming, mathematics


---

## 3 answers

### Answer by username_2 on 2020-07-16. Score: 4 | Accepted answer

This is pretty much in the realm of opinion, but as a math PhD and a long time CS professor, I'd guess the answer is no. Programming is fun and programming can be useful, but its application to proving theorems in mathematics is very specialized and a bit limited. And it generally doesn't apply to the sorts of things a struggling math student wants to learn.

There are a couple of exceptions in which programming was instrumental in establishing a proof. One is the [Four Color Theorem](https://en.wikipedia.org/wiki/Four_color_theorem) which was originally proved with a computer because of the huge number of different possible planar maps. But mathematicians, like myself, find that proof unsatisfying and would prefer one that was more analytical and which would lead to more insight. But these sorts of cases are very rare.

But, theorem proving, like anything else is a skill best learned through practice. Once you have tried and eventually succeeded at proving some theorems, perhaps after false starts, you will start to gain insight. Every success can lead to the next success. But it is hard work. And the work may not get easier as you go, since you will probably take on harder problems. But practice, practice, practice.

Programming does, however, give you some practice with thinking logically and breaking a hard problem down into smaller, easier, parts. In that sense programming can be a bit helpful. But to learn math, just *do* math.

On the other hand, there are [automated Theorem Provers](https://en.wikipedia.org/wiki/Automated_theorem_proving) that can do some interesting things. But their results don't generally lead to the insight into a problem that a mathematician needs and to build one of them requires deep insight to start with.


---

### Answer by username_3 on 2020-08-06. Score: 3

Programming is very useful in the process of conjecturing, and to some extent even in proofs.

Here are some examples from my own research, in theoretical computer science and combinatorics:

1. An algorithm for maximum coverage (a basic combinatorial optimization problem) employs a non-standard objective function, with finely tuned parameters. These parameters were obtained by solving a linear problem on a computer. The parameters depend on $n$, so I solved the linear programs corresponding to small $n$, and generalized the solution. The solver also found the tight constraints, and this was very instrumental in the proof.
2. The construction of the Gelfand–Tsetlin basis for the Johnson scheme (equivalently, a canonical eigenvector basis for the Johnson and Kneser graphs) came out of some experimentation in a computer algebra system; I don't know whether you consider this programming.
3. Several papers in social choice theory aimed at proving phenomena which were first observed experimentally; this required programming in an efficient language.
4. Optimal gadgets in a paper in circuit complexity were found by exhaustive search using an efficient computer program.

I would say that programming is a useful skill, at least in certain areas of mathematics.


---

### Answer by username_1 on 2020-07-20. Score: 1

The only thing that programming can do for you is teach you logical thinking, if you have problems there.

The computer won't let you use assumptions or take shortcuts. You have to create a complete, logical sequence of instructions to get from the problem to the solution. And that skill is of course also needed for mathematical proofs.


---

