Hacker News new | past | comments | ask | show | jobs | submit login

Abraham Lincoln studied Euclid to become a better lawyer (to learn how to "demonstrate").

I've just studied a tiny bit of Euclid, and his design of lemmas (technical theorems, not beautiful in themselves, whose beauty is neatly meeting needs in higher-level theorems), is program decomposition into modules, that you can see.

I can't be sure yet, but I feel I'm already thinking more clearly.

EDIT Euclid means "renowned," from eu "well" + kleos "fame".

This jibes well with the team-theory: "Because the lack of biographical information is unusual for the period (extensive biographies are available for most significant Greek mathematicians for several centuries before and after Euclid), some researchers have proposed that Euclid was not, in fact, a historical character and that his works were written by a team of mathematicians who took the name Euclid from the historical character Euclid of Megara (compare Bourbaki)." https://wikipedia.org/wiki/Euclid#Life




I had the same insight from the opposite direction. My background is mathematics but have been struck by the similarities between refactoring code and splitting a proof into lemmas, corollaries and theorems. There's also an art to creating good definitions during mathematical exposition, which is akin to creating variables to encapsulate the right data and naming them well.

BTW Pythagoras is another ancient Greek who may well not have been a historical character.


Please bear with me while I draw a parallel:

Elements I, 32 (triangle sum theorem) https://mathcs.clarku.edu/~djoyce/elements/bookI/propI32.htm... looks lopsided - especially compared with this nicely symmetrical one: https://math.stackexchange.com/q/2727737

But I, 32 also shows that an exterior angle is the sum of the two opposite interior angles - which seems an odd, weird thing to prove, but fits nicely into other theorems. The one I've seen is the proof of the inscribed angle theorem, III, 20 (https://mathcs.clarku.edu/~djoyce/elements/bookIII/propIII20...). The diagram has much going on, but the relevant parahraph is labelled with a link to I,32 on the right.

The parallel with code is that I've sometimes seen very clever methods, that extract an odd-shaped piece of code, from several places. An example is from maths, the delta-mew algebra (forgotten the proper name) for numerical differentiation in computational fluid dynamics. Though, that example is really maths again.

The thing I wonder is if this is too clever... if a module has intrinsic beauty/sense/symmetry, it's easier to understand, remember and use - especially for the next neophyte to touch the code (or me in six months). However, maybe if you are an expert (like Euclid), these helper-theorems quickly became as familiar as alternate interior angles have for me...?

I think the difference is geometry is always the same, one eternal codebase. The modules can be reused all the time. But programmers are writing new code, in new areas (to them), all the time. So perhaps we just can't get to that level of specific mastery (of particular methods) - if we did, we should fully encapsulate them somehow! We need APIs that let us ignore the details - unless you work in the same area, long term (perhaps in writing an API).

Of course, just like modules, we can use a theorem and ignore the details (proofs)... but in the above case, we still have this odd, asymmetrical shape in the theorem, which is (I think) similarly hard to understand, remember and use. Even though that shape is a more useful one!

What do you think?


I'm finding it difficult to pinpoint where/why you think there's a difference. Absolutely there's a strong parallel between an oddly constructed theorem and an odd-shaped piece of reusable code.

Geometry may be an eternal, perfect realm of ideas, but the actual codebase is the book, which is exceedingly good but is not perfect, especially given the restraints of the medium (written text).

Someone who is practiced or naturally talented will be able to read that book with a similar ease with which you read elegantly written code (c.f. Einstein being amazed at the "lucidity" of Euclid's elements at the age of 12). For everyone else, I can imagine having a different, easier to grasp codebase for Euclid's elements: perhaps transcribe it into a wiki-like computer document which allows the reader to browse and flick between the referenced lemmas much more easily.

Both mathematical exposition and coding, and in fact almost any sort of writing, involve a sort of data compilation from a very high-level language ("how I/we understand it in my/our head/s") to a lower-level language which is more rigorous but lacks an interactive element.


Well, I'm still struggling with the question!

I wasn't thinking ideas vs their expression.

I see you're saying: you can have different expressions of Euclid for people of different abilities. (Actually, even different proofs for different levels: the high school proof of the Inscribed Angle Theorem is different in part from Euclid's, III, 20 (though I found Euclid's clearer and simpler)).

The difference I noted was just that geometry is like one codebase. But programmers deal with many codebases - there's no ugrad or high school course in a particular codebase!

Though, in a large company, do you get experts in their key codebase, both practiced and talented. But there's still a reluctance to invest your all in a codebase - what if they rewrite? Or go out of business? Or you quit? Your investment is lost. Not so with geometry.

There's also market forces for the adoption of third-party libraries (a library of theorems - like Elements' books!) - dominating the market will require being accessible to a range of abilities. A "pop culture", for better or worse.

I guess you'd say: "fine, the easier expressions will dominate". But I don't think there'll be any higher expression at all...

So... not a difference in essence, just in its role in the world.

BTW I find Euclid very hard to read, but easy to understand (so far, anyway).

BTW those links I gave are to a "wiki-like computer document".


Thinking about the beauty of proofs, as imdicated by simplicity, and how breifly they can be encoded (information-theoretic version of occam's razor):

Another aspect of the symmetrical stackexchange diagram (two alternate interior angles), and Euclid's lop-sided one is that Euclid's is slightly simpler (one alternate interior angle, and one corresponding angle).

But from another perspective, the symmetrical one is simpler, because its symmetry allows it to be remembered as symmetry, and only recording one side.

Further, although stating it is symmetrical may require more information to record than just explicitly stating both sides if you only record one theorem, if you record a corpus of theorems and symmetry is common over that corpus (which it is), it can be stated with less information. (i.e, like using shorter words for frequently used concepts).

But this is only for the proof details; I'm not sure how it applies to the theorem as a reusable component, where you don't have to worry about the details.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: