Posts Tagged ‘Math’

latex2wp

I have a problem. I want to do all my writing in LaTeX, but I want to post some of it on my WordPress blog. I often use math; in fact, I often use a lot of math, and some of it is particularly difficult to typeset, like commutative diagrams.

WordPress has some ways of handling inline LaTeX—in particular, WP-LaTeX converts it to embedded images, and MathJax-LaTeX renders it client-side with a heady mix of JavaScript and CSS. But this doesn’t necessarily scale to complex packages for inference rules, commutative diagrams, and the like, without requiring custom hackery. And these solutions still require HTML markup on text, rather than LaTeX.

Here’s my solution. I’ve written a Haskell script, latex2wp, which takes a .tex file and outputs a .html file with markup suitable for WordPress. Inline math is kept intact and can be rendered with one of the aforementioned LaTeX plugins. Display math is rendered as PNGs and hotlinked, to support any fancy packages you might use.

Luca Trevisan also has a LaTeX2WP script, so I should explain how these differ. Mine relies on Pandoc (the Haskell-based Esperanto of text markup) for the translation, so it automatically supports a wide range of LaTeX features, including hyperlinks and macro expansion inside math mode.

Luca’s script does the translation manually, so it supports a more eclectic (though impressively large) subset of LaTeX. More importantly to me, it doesn’t handle commutative diagrams. Apologies for stealing the apt name—in a case-insensitive world, at least.

Let me know if you find it useful, and please contribute! The script is somewhat fragile right now—it only works on Linux, and you need to trivially edit the source to include any additional LaTeX packages.

A brief note on mathematics

This short excerpt started off an essay which will never see the light of day. I hope to eventually have a suitable way to complete this idea, but until then, maybe somebody will find it good food for thought. (You may also substitute “mathematics” for the theoretical subject of your choice, with varying degrees of success.)

In mathematics, a proof is no more than a convincing argument of a statement’s validity. But as justification for a theorem, a proof alone is wanting. Why state one theorem over another?

The metric of real-world utility seems not to apply. After all, the very objects of study are, in some sense, artificial.

But the allure of mathematics–to me, at least–is how well those objects fit together: the degree to which mathematics unifies apparently different concepts is staggering. Perhaps nobody said it better than G.H. Hardy in A Mathematician’s Apology: “The ‘seriousness’ of a mathematical theorem lies in…the significance of the mathematical ideas it connects.”

If research mathematics is about connecting ideas, surely math education ought to convey that interconnectedness. On the contrary; until reaching senior-level courses, mathematics appears an amalgam of essentially disparate concepts.

Mathematical rigor, I

Mathematical rigor.

This is an issue that has been at the front of my mind for a long time, and one which, despite first appearances, is surprisingly storied and even controversial.

Math is usually perceived as a completely rigorous field concerned with finding “correct” answers, and verifying the “correctness” of theorems. This is true in a very limited sense — math is indeed an axiomatic system under which certain conclusions follow from the premises, and others do not.

Of course, an axiomatic system can encompass any set of “truths” — after all, one can take any set of (non-contradictory) statements as a foundation. Thus, merely choosing axioms is an aesthetic decision not strictly based on any sort of reality.

While this may seem like a pedantic point, choosing axioms in math is actually a somewhat controversial issue. Apropos Godelian incompleteness, there is an infinite set of independent axioms to accept or reject. A few prominent examples are the axiom of choice and the continuum hypothesis in set theory, and a generalized Fubini’s theorem in analysis.

Historical axiomatization.

But has math always been a purely axiomatic system? Not really, as it turns out. Euclid‘s Elements is perhaps the greatest (or at least, most famous) specimen of axiomatization in mathematics. By taking several (reasonable) geometric truths as self-evident, Euclid was able to develop many non-obvious results in geometry.

(I must, of course, pause to note that one of his axioms is significantly less self-evident than the other. In fact, altering that axiom — the parallel postulate — yields a different kind of geometry, akin to conducting your business on the surface of a sphere instead of a plane.)

However, the lack of a concise shorthand for algebraic notions appears to have held back the rigorous treatment of non-geometric concepts. For instance, Newton’s second law, \(F=ma\), was expressed by him as “The alteration of motion is ever proportional to the motive force impress’d.” While it sounds pompous now, that’s simply how equations were discussed back in the day. Imagine solving a set of equations written that verbosely!

In fact, great mathematicians like Euler often stated results somewhat informally, and without proof. Even by the middle of the nineteenth century, Galois had to invent many terms in group theory to explain his highly-technical theory linking fields and groups.

Nicolas Bourbaki.

The true breakthrough in axiomatization began in the 1930s by a group of French mathematicians operating under the pseudonym Nicolas Bourbaki.

Bourbaki aimed to produce a coherent treatment of modern mathematics, publishing nine volumes covering a large portion of the field. While opinions on Bourbaki vary drastically, I think it’s evident that they accomplished their goal admirably, and in the process, very heavily influenced the way mathematics is performed.

Bourbaki took a very rigorous approach to mathematics, systematically building up concepts from set theory to algebra, topology, analysis, and beyond. The development is very rigorous and dry; no actual problems or applications are discussed, and virtually no diagrams are included.

At the time, Bourbaki’s books were undoubtedly the best references available; it is not surprising, then, that their new approach had a profound effect on mathematicians (particularly nascent ones). Even their vocabulary has stuck, such as the empty set symbol \(\emptyset\) and the words injective, surjective, and bijective.

Since then, mathematicians have essentially agreed to conduct mathematics more or less in the manner of Bourbaki. (It may seem surprising that math was at one point much less rigorous, but this merely reflects the huge influence of Bourbaki.)

Rigor considered harmful?

In my view, the most important question at this point is how beneficial (or detrimental) rigor is to mathematics. For reasons I will explain in the next installment, it seems evident (though initially counterintuitive) that rigor often helps clarify the situation. At the same time, I believe there is an alarming dearth of non-rigorous treatments of math.

Please comment on this if you have anything to add or ask; I plan on writing at least several more posts about mathematics, and I would like to focus on whatever points everyone finds most interesting.

Math stand-up II

(This is the act I performed for the second annual IU undergraduate math talent show. I also served as emcee.)

I’m glad all of you made it out here tonight. One great thing about math is how diverse it is–not just of mathematicians, but of the entire field itself. Math ranges from the purest, most useless subjects–the ones I like–to applied fields, like engineering; at the same time, some fields like computer science straddle the dichotomy, strangely both applied and pure at the same time.

As some of you know, I’ve recently come to like computer science a lot. I’m still learning the ropes, but it’s already pretty easy for me to find the computer scientists at a breakfast buffet. They’re usually in a queue by the hash table.

See, the choice between math and related fields is a tradeoff between purity and utility. The more applied fields actually get some important results.

For example, in computer science, they recently deduced the best way to walk: the logic gait. Of course, if you do too many logical ands, your ampersands may get inflamed, a serious condition called conjunctivitis.

In electrical engineering, they’re working on making even better semiconductors. I think adding gallium to silicon is totally dope.

In physics, they recently discovered a new salsa a thousand times better than pico de gallo. It’s called nano de gallo. And they excavated a derivative of the velociraptor: the acceleraptor.

Seriously, though. You probably saw that Wall Street Journal article about how mathematician is the best profession, since it pays well, and sitting in a chair doesn’t really have any occupational hazards.

Still, some mathematicians have gotten into entrepreneurial endeavors. I’ve been eating out lately at Markov’s chain of restaurants. They’re kind of artsy; you don’t actually get to order off a menu. They just choose your dish randomly based on the probability that you’ll like it. I highly recommend their Chinese, though. I quite enjoy their random wok.

Even the Ghostbusters have gone into math lately, studying Hilbert spaces. They’ve already made a lot of breakthroughs in spectral theory.

But Rick Astley hasn’t had as much success in game theory. He’s studying the prisoner’s dilemma, but he just can’t get past his moral hangups about ratting out the other prisoner to lessen your own sentence. Even if he knows the other prisoner won’t rat him out, Rick’s still never gonna give him up.

And ever since the economy tanked, cartesian products of rings have become more popular, since grad students can only afford to study free modules.

The military pulled out of some math research, too. At the NSA they can’t even generalize any more; they’ve been reduced to lieutenantizing. They’ve also been reconsidering some policies at their complex prisons. The problem with conjugal visits is that sometimes they result in those elements multiplying, which becomes a real problem of square magnitude.

But really, now. I’ve been making it sound like math isn’t good for anything, but that couldn’t be further from the truth.

I use calculus in the grocery store all the time. For example, how do you differentiate between cuts of beef? Prime rib.

And algebra comes in handy on the dance floor. You know the robot, right? It’s composed only of rigid motions, so it turns out it’s actually a subgroup of isometries.

And analysis is indispensable in the kitchen. The other day, I made a sequence of sandwiches for myself: first a p-naught butter and jelly sandwich, then a p1 butter and jelly sandwich, then a p2 butter and jelly sandwich… I tried to eat the whole series, but I realized the sandwiches didn’t get smaller, so I diverged from that plan.

To me, at least, math is really exciting. Seriously. I just get really excited whenever I’m doing math. Like, the other day, I had the surface integral of the curl of a vector field, and I was really stoked to turn it into a path integral instead.

One problem I’ve noticed in math classes is that there’s so much material in each class, but it isn’t compact enough to cover finitely. Good professors know that it’s easier once you add on a point at infinity; then you can always cover it finitely.

Anyway. Probably a lot of you have AT&T Wireless plans, right? They changed their name one and a half years ago or so; that’s because they realized how important linear algebra is, and they wanted to be invertible. So now they’re no longer singular.

A recent medical study found that Viagra works on some ring members with zero powers. After the trial, they were no longer nilpotent.

Anyway, I think it’s time for the next act, so I’m going to leave you with a little physics problem… (A demo ensues.)

FWT, TFW. WTF: WFT? TWF FTW.

Consider, my friends, the orbit of WTF under the action of S3.

  • WTF = What the fuck. Alternatively, World Taekwondo Federation.
  • FTW = For the win. Google suggests Fort Worth Meacham International Airport.
  • FWT = A sucking noise made with the mouth. Also, Flimsy West-African Textiles.
  • WFT = Whale Fighting Tactics. An international martial art created in AD 2101 to eradicate all whales, who turn out to be the masterminds of the illegal seizure of all your base.
  • TFW = Triboluminescent Fragmentation of Wint-O-Green-Life-Savers. Shorthand for well-known effect that chomping on Wint-O-Green Life Savers in the dark makes sparks.
  • TWF = Tricky War-time Fortifications. Famously used in World War I in the form of bunkers.