Monday, September 25, 2017

How to learn mathematics by reading Plato

Plato's writings are famous for their logically rigorous and conversational tone. For the mathematically-inclined out there, the dialogues resemble in many ways usual mathematical proof-writing. To be more specific, Plato begins with axioms (assumptions), and develops a purely logical argument¹ which he concludes with or without a contradiction.

For example, in the Republic (Book I, 331e) the idea of being just is elaborated upon. Beginning with an axiomatic constructions following Simonides:
Polemarchus: "That it is just to give to each what is owed."
Then Plato (incarnated in Socrates' figure) demands clarification, like a good mathematician would do in sight of shaky grounds:
Socrates: "Well, it certainly isn't easy to disbelieve a Simonides [...] However, you, Polemarchus, perhaps know what on earth he means, but I don't understand."
Previously, Socrates had raised an issue with the current definition that Polemarchus defends:
Socrates: "Everyone would surely say that if a man takes weapons from a friend when the latter is of sound mind, and the friend demands them back when he is mad, one shouldn't give back such things, and the man who gave them back would not be just [...]."
In other words, the current definition gives an undesirable corollary. This hints at the fact that our definition of what is just is necessarily wrong! Socrates continues:
Socrates: "Then Simonides, it seems, means something different from this sort of thing when he says that it is just to give back what is owed."
And Polemarchus reveals something crucial:
Polemarchus: "Of course it's different, by Zeus, [...] For he supposed that friends owe it to friends to do some good and nothing bad."
Polemarchus has secretly instrumentalized the notion of what is just by setting a logical condition (not an obvious one) on his argument; that is, that one owes to his friend if one has something that belongs to him and that something shall be used to do some good. But we never agreed on that, and we haven't even defined what it is for some action to be good or bad! Moreso, Socrates poses an interesting question:
Socrates: "Now, what about this? Must we give back to enemies whatever is owed to them?"
Hence Polemarchus faces the need to twist his definition around, forcing it to adjust to our desirable conclusions: we shall not give back to enemies what is owed to them, save for "some harm", obviously! Hence Polemarchus adds another condition to being just, to giving back: that it must be "fitting". To summarize:
Definition: To be just is to give back what one owes, assuming the following conditions hold:
   (1) One has something that belongs to someone else,
   (2) What is given back shall be used to do some good, and
   (3) It must be fitting for that specific "someone else".
Whew! In any case, Socrates eventually causes the definition to be "depurated":
Polemarchus: "[...] I no longer know what I did mean. However, it is still my opinion that justice is helping friends and harming enemies."
This is easier to handle, in terms of deriving logical conclusions from it. Socrates asks for clarification yet again:
Socrates: "Do you mean by friends those who seem to be good to an individual, or those who are, even if they don't seem to be, and similarly with enemies?" [...] "But don't human beings make mistakes about this, so that many seem to them to be good although they are not, and vice versa?"
Polemarchus: "They do make mistakes." 
Socrates: "So for them the good are enemies and the bad are friends?"
Polemarchus: "It looks like it."
Socrates: "Yet the good are just and such as not to do injustice?"
Polemarchus: "True."
Socrates: "Then, according to your argument, it's just to treat badly men who have done nothing unjust?" 
A Q.E.D. or ∎ would finish off this section well enough, for all I know! Polemarchus struggles with accepting that his definition is essentially wrong:
Polemarchus: "Not at all, Socrates, [...] For the argument seems to be bad."
Socrates finally suggests, again like a good mathematician, to fix our definitions:
Socrates: "[...] Let's change what we set down at the beginning. For I'm afraid we didn't set down the definition of friend and enemy correctly." 
Let us recap. It all began with an apparently harmless assumption, which in fact required further clarification and detail. In mathematical terms, this is equivalent to stating an axiom with "undefined" vocabulary, like postulating the existence of the real numbers without defining number first. After adequate adjustments were made (sometimes, as is the case, a clear sign of bad foundations), the axiom was restated in a much more succinct form. This reduced form finally allows us to transparently derive an "undesirable conclusion" from it, a logical fallacy in technical terms.

This is in fact a dialectical version of "proving the inconsistency of a theory". As far-removed as this might seem, we encounter such fallacious arguments every single day on TV, newspapers, discussions, and a long etcetera. Reading Plato can help mathematicians the same way it can help regular folk in their daily lives: freeing us all from the tyranny of words.


Friday, September 22, 2017

Salvador Giner sobre Catalunya

Tenemos tres dimensiones que no sabemos poner juntas. Política, económica y cultural. Somos una vieja nación europea. Tenemos más de mil años pero somos una región económica española, integrada totalmente y, después, somos una autonomía política. En otros países, estas tres dimensiones encajan. Aquí, no. Esto nos hace esquizofrénicos. Genera buenos poetas y gente melancólica, o también gente que confunde el Barça con la patria, y es momentáneamente feliz.
—Salvador Giner, entrevista ElDiario.es

Monday, September 18, 2017

Blake's songs

And we are put on earth a little space
That we may learn to bear the beams of love.
—William Blake, Songs of Innocence (5. The Little Black Boy), 1789.

Friday, September 15, 2017

Clarifications on Assembly

Over the span of the function’s execution, EBP is pointing to the current stack frame making it possible to access local variables and function arguments via EBP+offset. 
It is also possible to use ESP for the same purpose, although that is not very convenient since it changes frequently. The value of the EBP could be perceived as a frozen state of the value in ESP at the start of the function’s execution.
-- Dennis Yurichev, Reverse Engineering for Beginners (1.9, p. 68)

Sunday, August 6, 2017

Mendelssohn

It was an easy step to associate Mendelssohn with those Victorian attributes from which the new century tried to distance itself—shallowness, hypocrisy, prudishness, and all the rest. And so, by 1911, for the eleventh edition of the Encyclopaedia Britannica, Donald F. Tovey felt compelled to update the reprinted, eu­logizing Mendelssohn article from the tenth edition by W. S. Rockstro, a student of the composer in Leipzig during the 1840s, by noting that “Mendelssohn’s reputation, except as the composer of a few inexplica­bly beautiful and original orchestral pieces, has vanished”.
—Todd, R. Larry. 2003. Mendelssohn : A Life in Music. Oxford: Oxford University Press, 2003.

Wednesday, July 12, 2017

Time and the River

 Zeus, who guided mortals to be wise,has established his fixed law--wisdom comes through suffering.Trouble, with its memories of pain,drips in our hearts as we try to sleep,so men against their willlearn to practice moderation. 
    -- Agamemnon (from the Oresteia), Aeschylus

These lines came to my mind immediately after a quick RMA brought back a fully functional, but completely empty laptop. It had decided to shut down and refuse to charge, and fear was all I knew from that point on. Bottom line; I had refused (by means of laziness) to properly backup my files, I lost them, and willed to never let that happen again.

My current backup solution is simple; a single online copy, hosted on Backblaze's B2 cloud service. It is a fantastic service, with extremely good prices and integrated in many third-party programs, for Linux users like me. I found out about rclone a while ago (written on top of rsync) and decided to give it a try: after battling over encrypted buckets, i managed to upload most of my important files.

The next step was to make backups automatic, otherwise I'd be missing the whole point. So i found out about cron (protip: use corntab to validate your time formatting) and its smart formatting:

00 22 * * * /home/scripts/backup.sh 
(this script runs every day at 22:00).

However, my computer is not turned on 24/7; there must be a way for the computer to run 'lagging' tasks. And here comes anacron, which deals exactly with that. By default anacron runs, and most importantly, runs scripts as root, so I had to create my own local 'anacrontab'.

mkdir ~/.anacron
mkdir ~/.anacron/cron.{hourly,daily,weekly,monthly} ~/.anacron/spool
touch ~/.anacron/anacrontab

Now edit this new 'anacrontab' (replace 'your-user' by the obvious thing):

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/home/aszkid/bin
HOME=/home/your-user
LOGNAME=your-user
# period  delay  job-id  command
1  5   your-user.cron.daily    nice run-parts /home/your-user/.anacron/cron.daily
7  10  your-user.cron.weekly   nice run-parts /home/your-user/.anacron/cron.weekly
@monthly  5  your-user.cron.monthly  nice run-parts /home/your-user/.anacron/cron.monthly

This file will execute all scripts, at their due time, under each of 'cron.daily' etc. Protip: do not write file extensions! For some reason (it might be in the doc), anacron refuses to run files with extensions (e.g. '.sh' files).

And finally we edit our usual user 'crontab' to run anacron through 'crontab -e', and add the following lines:

01 * * * * /usr/sbin/anacron -t /home/your-user/.anacron/anacrontab -S /home/your-user/.anacron/spool
01 * * * * nice run-parts /home/your-user/.anacron/cron.hourly

Reboot (to be safe), and you're good to go.

Thursday, June 1, 2017

Et c'est la Nuit

La lune est rouge au brumeux horizon;
Dans un brouillard qui danse, la praire
S'endort fumeuse, et la grenouille crie
Par les joncs verts où circule un frisson; 
Les fleurs des eaux referment leurs corolles;
Des peupliers profilent aux lointains,
Droits et serrés, leur spectres incertains;
Vers les buissons errent les lucioles; 
Les chats-huants s'éveillent, et sans bruit
Rament l'air noir avec leurs ailes lourdes,
Et le zénith s'emplit de lueurs sourdes.
Blanche, Vénus émerge, et c'est la Nuit.

L'heure du berger, Paul Verlaine (1844-1896)