Wednesday, August 5, 2015

Classes vs. sets

Over the last couple of years I've become increasingly interested in various foundational approaches to mathematics -- logic, set theory, category theory, lambda calculus, and so on. It's fascinating to see how these different schools of thought provide accounts for each other, and themselves.

Classes, simply put, are an elegant dodge to get around Russell's Paradox while retaining some of the expressive power of universal quantification.

To elaborate: if we allow a set theory to express "the set of all sets", or "the set of all cardinal numbers", or even just "the set of all singleton sets", we quickly run into the ground. Contemporary set theories like ZF give us restricted quantification, allowing us to say "\(\forall x \in S \cdot P(x)\)" (given a set \(S\) and a predicate \(P\)) but not "\(\forall x \cdot P(x)\)". But it's still useful to be able to quantify over collections of things that are too large to be sets. E.g. "all sets either contain an element or are empty"; "all sets admit a well-ordering".

Classes (effectively) correspond to predicates in language. For example, "is a singleton set" might be described by "\(\textrm{Singleton}(x) := \exists y \forall z \cdot (z \in x \Leftrightarrow y = z) \)". In the usual first-order presentations of ZF, "is a set" is a predicate that always returns true. And "represents a well-ordering of \(S\)" might be shorthand for "\(x \subseteq S^2 \land \textrm{IsWellOrdering}(x)\)", where \(\textrm{IsWellOrdering}\) itself is shorthand for a more complicated predicate that checks whether something encodes a reflexive antisymmetric transitive relation without infinite descending chains.

Claims that all members of a class satisfy some additional property can be encoded as universal quantifiers in the language, "\(\forall x \cdot P(x) \Rightarrow Q(x)\)". (The logic itself is still allowed universal quantifiers: it's the set building axioms which must be denied access to these.)

Classes typically exist in the metalanguage (i.e. are not first-class citizens of the theory itself). Classes can correspond to sets (e.g. the class of all empty sets, the class of natural numbers) but this is not guaranteed. This distinction is enough to get us past the classical presentation of Russell's paradox:

Monday, August 3, 2015

“Endless, formless ruins” (Invisible Cities)

In the lives of emperors there is a moment which follows pride in the boundless extension of the territories we have conquered, and the melancholy and relief of knowing we shall soon give up any thought of knowing and understanding them. There is a sense of emptiness that comes over us at evening, with the odor of the elephants after the rain and the sandalwood ashes growing cold in the braziers, a dizziness that makes rivers and mountains tremble on the fallow curves of the planispheres where they are portrayed, and rolls up, one after the other, the despatches announcing to us the collapse of the last enemy troops, from defeat to defeat, and flakes the wax of the seals of obscure kings who beseech our armies’ protection, offering in exchange annual tributes of precious metals, tanned hides, and tortoise shell. It is the desperate moment when we discover that this empire, which had seemed to us the sum of all wonders, is an endless, formless ruin, that corruption’s gangrene has spread too far to be healed by our scepter, that the triumph over enemy sovereigns has made us the heirs of their long undoing. Only in Marco Polo’s accounts was Kublai Khan able to discern, through the walls and towers destined to crumble, the tracery of a pattern so subtle it could escape the termites’ gnawing.
Italo Calvino, Invisible Cities

Monday, July 27, 2015

Links and quotes, June 2015

Paul Ford's monolithic essay for Bloomberg, What is Code?, is a tour de force across the world of computing, spanning from software engineering practices down to low-level assembly. It's an excellent guide for newcomers, and has just enough wry humour to keep veteran coders entertained, too. A must-read.

On a more algorithmic note, the Fibonacci heap ruins Mary Rose Cook's life. (And for good reason; functional data structures can be a pain to update.)

On working in the game industry:

If you’re anxious; depressed; if you’re mentally or chronically ill, it’s expected of you to adapt to a harmful work environment. But if you don’t – if you break – you’re just another expendable talent who burned brightly and quickly. In a way, you were the dream; someone who delivered high-quality work – or even perfection – without staying at the company long enough to get paid.

That feeling when the hitman you hired sells you out to the police.

A tranquil waterfall scene in Kumamoto Prefecture, Japan.

Source: Hideki Mizuta / National Geographic

Bad Horse writes on entropy(?) and art in Thoughts on listening to Mahler's Fifth Symphony three times in a row. They attribute the noise-like properties of many avant garde art styles to a fetishisation of randomness, per se.

This... is what happened to music. Composers internalized the theoretical belief that unexpectedness made music more complex and interesting, rather than just listening to it and saying whether they liked it or not."

Katherine Cross on the proclivity of mainstream cis-dominated media to treat trans women as a monolith:

The real double standard lies in certain cis feminists’ obsession with outward displays of femininity on the part of trans women. Elinor Burkett sees the death of feminism in the abyss of Jenner’s corset, but ignores Fallon Fox, a triumphant female athlete whose whole career is a spurning of feminine stereotypes. Were she white and cis she would be a cause celebre of people like Burkett. Instead, she’s ignored.

I’ve never found convincing evidence that bad grammar is actually indicative of poor ability outside of writing; the construction crew that put together my house probably don’t know when whom can be used, but my house is a lot more stable than it would be if Lynne Truss and I were the ones cobbling it together.

"The concept of pitch needing to be “correct” is a somewhat recent construct," writes Lessley Anderson, chronicling the history of Auto-Tune and asking exactly how ill its portent is.

Tadhg Kelly ponders what Patreon teaches us about the relationship between artist and viewer.

When the relationship between the artist and the audience loses its intermediaries then external ideas of integrity become irrelevant. Whether you’re crafting the most noble of interactive artworks or the most naked of real money bingo games, there is no standard by which to judge.

If brand recognition ads lure us into buying things by repeated positive conditioning, then why are there brand awareness ads for shoes but not for mattresses?

Surreal neural network feedback loop generated art.
Everyone's seen Deepdream by now, right? Right.

It's not the first time someone's spent column inches pondering what MOOCs tell us about the signalling value of university degrees, and it certainly won't be the last:

The only thing MOOCs provide is access to world-class professors at an unbeatable price. What they don’t offer are official college degrees... and that, it turns out, is mostly what college students are paying for.

Old news, still interesting: the political power granted to ultra-Orthodox parties in Israel ("the fulcrum of every single government coalition from 2006 until early 2013") has given them a great deal of leverage on domestic and social issues. The result: increasing state interference/restrictions towards women in public spaces.

Sunday, July 5, 2015

Links and quotes, May 2015

On race politics and gun culture:

"American guns are meant to represent the white man’s freedom to protect himself from government and from the colored hordes that surround him," Messiah Rhodes writes. "When a black man handles a gun of his own accord, he reverses the gun’s supposed purpose, and white people get scared."

Maths: Steven Wittens illustrates How to Fold a Julia Fractal. This visual essay is full of excellent illustrations and animations, including a beautiful demonstration of the square-and-shift operation on polar coordinates which really helps build intuition for why the Julia fractal is shaped the way it is.

I'm linking to Marsaglia's Random numbers fall mainly in the planes (1968) solely for the puntastic title, though its content -- finding unwanted patterns in a simplistic modular-exponentiation based random number generator -- is nothing to scoff at either. (Unless, presumably, you're currently making your living hawking said RNGs, in which case, scoff away.)

A pale red-haired centauress and a clothed, dark-skinned human wearing jockey boots curl up together on the ground, sharing a tender hug.

Source: Tumblr / jinamong.
Other slice-of-life fantasy creature sketches by the same artist: 1, 2.

I'm continually finding interesting perspectives on the "activist language merry-go-round" -- a term coined, I believe, by Serano in the last few years to describe a certain focus within activist communities on the fastidious quarantine of words known/found to be problematic. Cristan Williams describes the exercise as "[chasing] the ghost of empowerment through the reactionary policing of highly nuanced lexical epistemologies", and further notes that which words are considered accepted or problematic is a relative notion even between different activist communities.

I am fascinated by the implication here: the Internet provides the illusion of a global homogenised speech community, but organic language usage still happens subject to the constraints of geography and social group structure. Whomever's interpretation of various terms becomes canonised happens to be enjoying an unusual privilege.

The prose in In Flight, an extract from Mark Vanhoenacker's book, Skyfaring, is gorgeous through-and-through. The following extract is technical and poetic in equal measures:

Planes following altitudes referenced to the standard atmosphere collectively and continuously adjust their degree of wrongness — gently climbing or descending in a collective, school-of-fish-like movement as the true air pressure below changes with time and location. Locked for hours at what our altimeters show to be 31,000 feet, our true altitude may vary constantly. Think of an ocean, of all the boats across its vast expanse rising and descending on their local swells. All the boats are on the surface, though their true elevation varies. An altitude referenced to the standard atmosphere is called a flight level and it is just like such a surface: a membrane encircling the Earth, pressed with indentations and textured with rises, shimmering invisibly on the aerial imperfections of the world.

Wednesday, July 1, 2015

Creative Mysticism and “Don't Hug Me I'm Scared”

I am a little in love with Don't Hug Me I'm Scared, the cult hit Youtube short and Tumblr darling (and 2012 Sundance Film Festival nominee(!), did you know that?, I didn't know that) by Becky Sloan and Joseph Pelling.

DHMIS and its sequels sit within the genre of subverted kids' show: it's a short in the style of an educational kid's show that quickly turns subtly creepy, culminating in full-blown nightmare fuel. But of course, there's plenty to delve into.

Let's take DHMIS at face value: as educational, or at least as a work responding to educational shows. Quoth the creators on their Kickstarter pitch:

Don't Hug Me I'm Scared is a show about puppets learning stuff.

That's common to all of the DHMIS videos so far: the main characters (three puppets: red, green, and yellow, with distinctive personalities) are taught about some abstract topic by a teacher figure. Topics as of writing include: creativity, time, love, and computers.

It's not a huge leap to say that The teacher-student "dialogue" in DHMIS mirrors that between society and the individual.

Here I'm using "society" to refer to a very generalised "main" memeplex; an amalgamation of the education system and media and advertising and business culture and pretty much everything that's in the business of declaring how people ought to think. Related but not the same: Fiorenza's "kyriarchy", Moldbug's "cathedral", caricature hippies' "The Man". (And, disclaimer: I'm restricting the scope of this claim to English-speaking cultures since [1] I have more familiarity with [i.e. ability to speak meaningfully to] the "Western society" memeplex and [2] that's the cultural context DHMIS originates within and critiques).

This interpretation is hardly unique. That said, I'm not familiar enough with the literature (as it were) on DHMIS hermeneutics to know whether it's the accepted wisdom.

Anyway! Let's talk about the first DHMIS. The teacher is Notebook, who I'll be using "she" pronouns for since that seems to be the Tumblr consensus and I'm a lazy fuck (but remember, the official line is that Notebook's gender is paper). The subject: creativity.

Lesson summary: creativity is bad news.

Don't Hug Me I'm Scared, Becky Sloan and Joseph Pelling, 2011.

Creativity as a black box

— How do you get the ideas?

— I just try to think creatively.

There is no complete mechanistic account of how to be creative, no process summarised by an A4 flow chart. Instead, it seems that the creative process is a black box so far as monolithic organisations are concerned.

When Notebook says "I just try to think creatively", she effectively writes off the process of creativity as an inscrutable, atomic thing. She could have easily presented any number of actual suggestions, with all their varying pros and cons (e.g. any of the usual cliches: asking guiding questions, taking a walk, playing word association...). But she doesn't, and that's because (as a metaphor for "society") she has no interest in offering partial answers, in suggesting that there are pieces of the puzzle she can't provide. It's far more convenient to suggest that creativity is something that you either have or you don't.

The closest Notebook gets to providing constructive advice on the subject is "Listen to your heart / Listen to the rain / Listen to the voices your brain". Notice that these are all platitudes. They pattern match to some standard vague picture of what creativity is, but they don't actually offer any actionable advice.

(Compare to similar after-school special messages: "The power was inside you all along." "Real love prevails." Even when such platitudes do provide an account of something real, they do so in an entirely opaque way.)

Friday, June 19, 2015

Links and quotes, April 2015

From The New York Times comes this explainer on the mathematics of fair division. Highlights include an interactive visualisation of Sperner's lemma and a shout-out to the not-for-profit app Spliddit.

In an observational study, The University of Texas at Austin gave a group piano majors a Shostakovich passage to learn and perform a day later. They found that the amount of time spent practicing the passage didn't have much bearing on mastery. What did distinguish the top performers was how they handled their mistakes. The best ones took pains to individually locate and correct errors, addressed them immediately when they arose, and strategically slowed the piece down to address problem areas.

On the pros and cons of trigger warnings as standard classroom practice: "oh god oh god I want to be dead I want to be dead is just not a good mindset to be in when you’re trying to grasp the nuances of Derrida."

Still image of a cresting wave, backlit against the sun, from Ray Collins's "Sea Stills".
Sea Stills: Photographer Ray Collins captures giant waves in otherworldly moments.

Tuesday, June 16, 2015

Bash completion of aliased commands, revisited

When you alias a command in Bash, tab completion no longer works. If you regularly take advantage of tab completion, this undoes most of the convenience of aliasing.

A quick web search throws up an old script by Ole Jorgen that solves this problem by "wrapping" the original completion command with some code that modifies variables to make the complete believe you'd typed out the aliased command in full and are tab completing as per usual.

Unfortunately, running that circa-'08 script on Ubuntu 14.04 LTS (using bash 4.3.11) causes it to choke on most attempted tab completions, with error messages like:

$COMP_POINT: substring expression < 0

The problem: the script modifies two of the variables made available to Bash completion (COMP_CWORD and COMP_WORDS), but misses others. With a little hackery we can modify that script to alter the other variables, COMP_LINE and COMP_POINT.

# Author.: Ole J, Chris C
# Date...: 14.06.2015
# License: Whatever

# Wraps a completion function
# make-completion-wrapper <actual completion function> <name of new func.>
#                         <command name> <list supplied arguments>
# eg.
#     alias agi='apt-get install'
#     make-completion-wrapper _apt_get _apt_get_install apt-get install
# defines a function called _apt_get_install (that's $2) that will complete
# the 'agi' alias. (complete -F _apt_get_install agi)
function make-completion-wrapper () {
    local function_name="$2"
    local arg_count=$(($#-3))
    local comp_function_name="$1"
    shift 2 # For convenience, drop the extracted arguments
    local arg=${@:1}
    local function="
function $function_name {

    local cmdlength


    COMP_WORDS=( "$@" \${COMP_WORDS[@]:1} )

    return 0
    eval "$function"

Then usage proceeds as before:

alias sdr='screen -d -r'
make-completion-wrapper _screen _sdr screen -d -r
complete -F _sdr sdr