CSS

Thursday, December 29, 2011

Writing a History Book?

So I have been thinking about writing a book on history, but a different sort of book. The style is slightly inspired from mathematical writing and Herodotus, where each chapter is divided into "chunks".

A "chunk" discusses one subject, which is summarized in a single sentence --- the sentence is highlighted in bold, at the beginning of the chunk.

The idea is that there would be an overview, summarizing the chapter, which consists of just the "summary sentences". This way, the reader can get a cursory understanding of history, while looking for details in the appropriate section.

It would be nice to make it a website in the form of Real World Haskell, The Django Book, or Zend's Comment System. I think the Zend system is freely available via GIT.

Each paragraph ends with its own comments. However, with history, the author must be well prepared to deal with editing obscene comments. History is quite a sensitive subject.

After carefully examining the tools available, ucomment is the best choice.

It allows the author to dynamically update the document, while keeping the comments. Additionally, it uses the Sphinx markup language (which allows output to LaTeX).

Saturday, December 24, 2011

My Differential Geometry Images

So I am writing some notes on differential geometry, and using metapost for tricky diagrams. Here are a few of the tricky diagrams I have.

The first three images are:

The third image is a tad bit bigger:

Note the fonts in this picture are messed up, since I had to use postscript fonts. It looks far more beautiful in TeX using metapost, trust me!

numeric u;
color yellow;
u := 1pc;
yellow = red+green;

verbatimtex \input amssym.tex etex;

% sphere
beginfig(0)
  draw fullcircle scaled 4u;
  draw (-2u,0)..(0,-.7u)..(2u,0);
  draw (-2u,0)..(0,.7u)..(2u,0) dashed evenly;
endfig;

% plane + cylinder
beginfig(1)
  draw (0,-u)--(0,3u)--(u,4u)--(u,0)--cycle;

  draw (3u,0)..(4u,-.5u)..(5u,0);
  draw (3u,0)..(4u,.5u)..(5u,0) dashed evenly;

  draw (3u,4u)..(4u,4.5u)..(5u,4u);
  draw (5u,4u)..(4u,3.5u)..(3u,4u);

  draw (3u,0)--(3u,4u);
  draw (5u,0)--(5u,4u);
endfig;

% saddle
beginfig(2)
  path p[];
  z[0] = (2u,4u);
  z[1] = (2.5u,3u);
  z[2] = (1.5u,2.5u);
  z[3] = (4u,0u);
  z[4] = (6.5u,u);
  z[5] = (7.u,1.75u);
  z[6] = (6.75u,0.5u);

  p[0] = z[0]..z[1]..z[2];
  p[1] = z[1]..z[3]..z[4];
  p[2] = z[5]..z[4]..z[6];

  p[3] = z[0]--(point 0.75*length(p[1]) of p[0]);
  p[4] = z[2]--(1.75u,-2u);
  p[5] = z[6]--(6.5u,-2u);
  p[6] = z[5]--(point 0.9*length(p[1]) of p[2]);
  for i=0 upto 6:
    draw p[i];
  endfor;

  draw (4u,-u){up}..(point 0.6*length(p1) of p1);
  draw (point 0.6*length(p1) of p1)..{down}(5.125u,-.75u) dashed evenly;
  draw (1.75u,-2u)..(4u,-u)..(6.5u,-2u);

  p7 = ((0,0)--(2u*unitvector(direction 0 of p[6]))) shifted point (length p6) of p[6];
  draw p[7] dashed evenly;

  p8 = ((0,0)--(3.5u*unitvector(direction 0 of p3))) shifted point (length p3) of p3;
  draw p8 dashed evenly;

  p9 = (point (length p8) of p8)..(5.125u,-.75u)..(point (length p7) of p7);
  draw p9 dashed evenly;

endfig;

beginfig(3)
  picture Rn;
  picture sphere;
  picture torus;
  % R^n
  Rn = image(
      for i=1 upto 3:
      draw (-.5u,i*u)--(3.5u,i*u) withcolor 0.75white;
      draw (i*u,-.5u)--(i*u,3.5u) withcolor 0.75white;
    endfor;
    drawdblarrow (-.5u,0)--(3.5u,0);
    drawdblarrow (0,-.5u)--(0,3.5u);
    );
  % sphere  
  sphere = image( 
      draw fullcircle scaled 4u;
    draw ((-2u,0)..(0,-.7u)..(2u,0));
    draw ((-2u,0)..(0,.7u)..(2u,0)) dashed evenly;
    );
  % torus
  torus = image(
      path hole;
    path uhole;
      draw
      (0,2u)..(-2u,0)..(0,-2u)..(2u,-u)..(4u,-2u)..(6u,0)..(4u,2u)..(2u,u)..cycle;
    hole = halfcircle rotated 180 scaled 2u shifted (4.5u,0);
    draw hole;
    uhole = (point 0.1*length(hole) of hole)
     ..(0.5[(point 0.1*length(hole) of hole),(point 0.9*length(hole) of hole)]+(0,.5u))
     ..(point 0.9*length(hole) of hole);
    draw uhole; 
    );
  
  draw Rn;
  draw Rn shifted (20u,-5u);

  draw torus shifted (8u,4u);

  path localPatch;
  path imageOfF;
  path preimageOfG;
  path imageOfG;
  path imageOfPsi;
  path intersection;
  localPatch = (fullcircle scaled 2u shifted (1.5u,1.5u));
  fill localPatch withcolor 0.75[blue,white];
  draw localPatch dashed evenly;

  z[0] = (((u,0)--(u,2u)) intersectionpoint localPatch);
  draw (((0,u)--(u,u)) intersectionpoint localPatch)
  --(((2u,u)--(4u,u)) intersectionpoint localPatch) withcolor 0.75[black,blue];
  draw (((0,2u)--(2u,2u)) intersectionpoint localPatch)
  --(((2u,2u)--(4u,2u)) intersectionpoint localPatch) withcolor 0.75[black,blue];
  draw (((u,0)--(u,2u)) intersectionpoint localPatch)
  --(((u,2u)--(u,4u)) intersectionpoint localPatch) withcolor 0.75[black,blue];
  draw (((2u,0)--(2u,2u)) intersectionpoint localPatch)
  --(((2u,2u)--(2u,4u)) intersectionpoint localPatch) withcolor 0.75[black,blue];

  imageOfF = fullcircle xscaled 3u yscaled 1.5u shifted (8u,4u);
  fill imageOfF withcolor 0.75[blue,white];
  draw imageOfF dashed evenly;

  picture preG;

  preG = image(
  
  preimageOfG = unitsquare scaled 2u rotated 45 shifted (22u,-5u);

    fill preimageOfG withcolor 0.5[yellow,white];
    fill fullcircle xscaled u yscaled 5u rotated -23 shifted (22u,-3u)
      withcolor 0.5[green,white];
      draw (((21u,-4u)--(21u,-5u)) intersectionpoint preimageOfG)
    --(((21u,-5u)--(21u,-3u)) intersectionpoint preimageOfG)
    withcolor 0.5[black,yellow];
  draw (((22u,-2u)--(22u,-3u)) intersectionpoint preimageOfG)
    --(((22u,-4u)--(22u,-8u)) intersectionpoint preimageOfG)
    withcolor 0.5[black,yellow];
  draw (((23u,-3u)--(23u,-3.5u)) intersectionpoint preimageOfG)
    --(((23u,-3.5u)--(23u,-8u)) intersectionpoint preimageOfG)
    withcolor 0.5[black,yellow];
  draw (((21u,-4u)--(22u,-4u)) intersectionpoint preimageOfG)
    --(((22u,-4u)--(25u,-4u)) intersectionpoint preimageOfG)
    withcolor 0.5[black,yellow];
  draw (((21u,-3u)--(22u,-3u)) intersectionpoint preimageOfG)
    --(((22u,-3u)--(25u,-3u)) intersectionpoint preimageOfG)
    withcolor 0.5[black,yellow];
  draw preimageOfG dashed evenly;

  clip currentpicture to preimageOfG;
    );
  draw preG;

  imageOfG = (19u,2.5u)--(20u,3u)--(21.5u,3u)--(21u,2.5u)--cycle;


  fill imageOfG withcolor 0.5[white,yellow];

  imageOfPsi = fullcircle xscaled 2u yscaled u rotated -45
    shifted (20u,3u);
  fill imageOfPsi withcolor 0.75[blue,white];


  numeric t[];
  (t[0],whatever) = imageOfPsi intersectiontimes ((19u,2.5u)--(20u,3u));
  (t[1],whatever) = imageOfPsi intersectiontimes ((21u,2.5u)--(19u,2.5u));
  (t[2],whatever) = imageOfPsi intersectiontimes ((20u,3u)--(23u,3u));  
  (t[3],whatever) = imageOfPsi intersectiontimes ((19u,2.5u)--(20u,2.5u));
  
  intersection = (subpath(t0,t3) of imageOfPsi)--%(20u,3u)--
    (subpath(t1,t2) of imageOfPsi)--(20u,3u)--cycle;
  
  fill intersection withcolor 0.5[green,white];
  draw imageOfPsi dashed evenly;
  draw imageOfG dashed evenly;
  draw sphere shifted (20u,4u);

  p[0] := (point 0.25*length(localPatch) of localPatch)..(4u,4u)
  ..(point 0.5*length(imageOfF) of imageOfF);
  p[1] := (point 0 of imageOfF)..(12u,5u)..(19.5u,3.5u);
  p[2] := (21.5u,3u)..(23u,0)..(23u,-3u);
  p[3] := (point .75*length(localPatch) of localPatch)..(1.5u,-u)
  ..(10u,-4u)..(21.5u,-4.5u);
  drawarrow p[0];
  
  drawarrow p1;

  drawarrow p2;

  drawarrow p3 dashed evenly;

  label.top(btex $x$ etex, point 0.5*length(p0) of p0);
  label.top(btex $\varphi$ etex, point 0.75*length(p1) of p1);
  label.rt(btex $y^{-1}$ etex, point 0.5*length(p2) of p2);
  label.bot(btex $y^{-1}\circ\varphi\circ x$ etex, point 0.6*length(p3) of p3);

  label(btex $U$ etex, (1.5u,1.5u)) withcolor 0.5[black,blue];

  draw (8u,4u) withpen pencircle scaled 3;
  label.lft(btex $p$ etex, (8u,4u)) withcolor 0.75[blue,black];
  label.bot(btex $M$ etex, (12u,2u));

  label.rt(btex $N$ etex, (22u,4u));

  label.lft(btex $\Bbb{R}^{n}$ etex, (20u,-2u));

  label.lft(btex $\Bbb{R}^{m}$ etex, (0,3u));
endfig;


end;

Thursday, December 22, 2011

Outline of Commutative Geometry

So, preparing for my discussion of noncommutative geometry, I need to discuss "commutative geometry".

What's going on here? Well, lets begin with the simplest notion of a space: a topological space.

I have discussed in my notebk [googlecode.com] the notion of a topological space and continuous functions.

However, the algebra of continuous real-valued (or, more generally, complex-valued) functions encode the topology.

So I need to write notes reconstructing the topological data for $X$ from the ring structure and properties which $C(X)$ satisfy.

Vector Bundles

The next sort of space we can work with is a vector bundle. What's this guy?

Well, it's really a fibre bundle whose fibre forms a vector space. What's a fibre bundle?

It's a generalization of the product space where we fix one of the spaces.

Where does this occur? In vector calculus!

We are working with $\mathbb{R}^{3}$. A vector field assigns to each point in $\mathbb{R}^{3}$ a vector. But vectors live in "linear spaces" (or vector spaces).

So secretly we have $X=\mathbb{R}^{3}$ be the underlying space, and the total space be $E=F\times X$ consisting of "tangent vectors" (an ordered pair consisting of the vector assigned by the vector field, and its base point).

The fibre here is a vector space. Moreover, it is $F=\mathbb{R}^{3}$ as a vector space.

This is the simplest example of a vector bundle. So what?

Well, vector fields can be represented through ordered triples. That is, three smooth functions represent each component of the vector field (the x part, y part, and z part).

So algebraically we have $C^{\infty}(\mathbb{R}^{3})\times C^{\infty}(\mathbb{R}^{3})\times C^{\infty}(\mathbb{R}^{3})$ represent all possible vector fields on our space.

This is a free module over $C^{\infty}(\mathbb{R}^{3})$. So are vector bundles represented by free modules?

Not really, we use projective modules (which is more general).

There are a few other things to discuss on this matter, e.g., global sections, and so forth.

Spinor Bundles

This should be discussed in some detail, as there are few good references on the subject.

Even nLab's entry on Spinor bundles is lacking, alas!

However, we need to encode this data in a spectral triple. See the nLab's entry, it is quite good.

See also Alain Connes' "On the spectral characterization of manifolds" (arXiv:0810.2088) for details.

This would take some time to write up.

Noncommutative Rejoinder

I suspect that by taking an arbitrary ring, instead of the ring of smooth functions (or continuous functions, or...), we begin working with noncommutative geometry.

Is this algebraic geometry? No, not really. Algebraic geometers use polynomials to encode their geometric objects.

On the other hand, what we are doing here is considering the structure of rings and modules over our rings to encode geometric properties and data.

Of course, I may be misinformed on what algebraic geometers do...I frankly never understood it well enough to satisfy myself.

Tuesday, December 20, 2011

Ancient Geography

Reading Herodotus requires a greater knowledge of geography than I previously implied.

Fortunately, all the geography you need to know is encoded in a free map. Ironically it comes from a video game titled "Rome: Total Realism".

So, without further ado, here is the map:

Does it seem small? Well, it's a link, so click on it for the huge map.

Sunday, December 18, 2011

Experiments as "registers" in notes

Mathematics is about theorems, science is about experiments. But theorems are expressed rigorously in formal logic...what about experiments?

The "old fashioned" way would be to write up a lab report and carry out the experiment! However, nowadays, there are some programs to simulate experiments.

For example, the KDE Education Project has a few programs for physics, astronomy, and chemistry. Sadly, no biology (although I wouldn't know what that would look like...).

Additionally, if one is writing notes on history, there is a beautiful globe program one could use...

At any rate, for classical physics, this is perhaps the ideal set up. It allows the reader to play with the experiment, which is the entire idea of an experiment(!), and if so possessed one could set it up in real life.

Plus this is free, a small perk.

Physics

There is the Step program which is useful for classical mechanics.

Better, the physical systems being studied can be represented as a program.

And when you get to numerical analysis, you can perform a "How accurate was this?" series of exercises ;)

It is multiplatform, so anyone on Windows, Mac OS X, or *nix can use the KDE Education suite. It may be worth while to consider :)

However, I wonder if there is not a better program out there? The qt framework is always a wee bit heavy duty.

It would be nice if someone invented a scripting language that produced flash videos, or something along those lines...since qt runs slow on my 733MHz Pentium 3 processor :'(

Chemistry

I have not thought about writing up chemistry notes, although I feel if I write biology notes then it would become necessary to study chemistry.

Personally, chemistry seems to be a sibling to physics, it just is concerned with different scales. So experiment is very important in chemistry, and it is just as repeatable as in physics.

The Kalzium suite simulates chemistry to a degree. Everything is always "to a degree"!

Biology?

I am unaware of any similar such program for biology...but there are few experiments which are reproducible in biology!

Perhaps something like "virtual fruit flies" or "virtual peas" would be nice to study genetics, but I think it would be best to do it the "old fashioned way" (i.e., actually carry out the experiment!).

Take Home Message

If you are a mathematician writing notes on science, and are unable to perform the experiments: write a program.

Friday, December 16, 2011

Math to think about

There are several interesting directions I'd like to investigate. So interesting, I have decided to let you in on it too!

Moonshine

No living man cannot deny interest in moonshine. Terry Gannon's "Monstrous moonshine and the classification of CFT" (arXiv:math/9906167) provides a great review.

The basic idea is that we have a way to associate to "algebraic stuff" (e.g., groups) some "modular stuff".

What's great is, the word "stuff" is used in the technical sense of the word.

This would require reviewing group theory, finite groups, as well as some ring theory (for the "algebraic stuff"). To discuss "modular stuff", we'd need to review complex analysis, functional analysis. The connection here would require studying conformal field theory, to some degree.

Robert Wilson's Finite Simple Groups is a wonderful reference for finite simple groups; and as always SPLAG is a good reference too.

Noncommutative Geometry

People mean many things by "Noncommutative Geometry", here I mean Connes' approach.

I suppose this first requires us to consider what "commutative geometry" is!

This requires knowledge of commutative algebra and differential Geometry. The idea is to model "differential calculus over a commutative ring" (as Wikipedia calls it), i.e., consider the algebraic "grammar" underlying differential geometry.

Commutative algebra describes this algebraic "grammar". Studying this model in commutative algebra is precisely what I mean by "commutative geometry" (where projective modules correspond to vector bundles, and so on).

Noncommutative geometry, on the other hand, generalizes this model to the noncommutative setting!

I still need to write up my notes on differential geometry, but there are no good references for "commutative geometry"! There are a few books on commutative algebra, though...

I should type up my notes on algebraic topology too, since spin bundles are a "principal Spin bundle". Although I have some notes written on the Spin group (see my Lie groups notes), I should review it some more. Michelson and Lawson's Spin Geometry is a wonderful book to consider...

Operator algebras need to be reviewed for considering spectral triples. The algebra we typically work with are von Neumann algebras which are related to C* algebras.

Some references for operator algebras:

  1. Kadison and Ringrose, Fundamentals of the theory of operator algebras vol. I and II
  2. Blackadar. Operator Algebras: Theory of C*-Algebras and von Neumann Algebras. Encyclopaedia of Mathematical Sciences. Springer-Verlag, 2005.
  3. Yasuyuki Kawahigashi, "Conformal Field Theory and Operator Algebras" arXiv:0704.0097 (18 pages)
  4. Meghna Mittal, Vern Paulsen, "Operator Algebras of Functions." arXiv:0907.5184
  5. John M. Erdman Lecture Notes on Operator Algebras (129 pages)
  6. J. A. Erdos, C*-Algebras (51 pages).
  7. N.P. Landsman, "Lecture notes on C*-algebras, Hilbert C*-modules, and quantum mechanics" arXiv:math-ph/9807030 (89 pages).
  8. Jacob Lurie's Course Notes on Von Neumann Algebras, quite comprehensive!
  9. Wassermann, Operators on Hilbert space [ps] (70 pages)
  10. VFR Jones, von Neumann algebras [pdf] (150 pages)
  11. NP Landsman's Lecture Notes on Operator Algebras [pdf] (64 pages).
  12. John Hunter and Bruno Nachtergaele, Applied Analysis (free, legal ebook!)

And, of course, there is Connes' Noncommutative Geometry [pdf], as well as Connes and Marcolli's Noncommutative Geometry, Quantum Fields and Motives [pdf]

Thursday, December 15, 2011

Basic Physics Macros

Continuing from my post LaTeX Macros for Personal Notes, I'd like to discuss some macros for physics.

I am using the "ISEE" approach to tackling examples, where we have four major steps:

  1. "Identify" what do we have and what are we looking for?
  2. "Set Up" what are the relevant concepts and equations? Set up the equations.
  3. "Execute" Carry out the scratch work
  4. "Evaluate" Look back, reflect, what were the key points and key ideas?

We are working with a lot of examples, and the examples are long (compared to math!). So we need to indicate when the examples are done.

Following Euclid, we introduce a \qefsymbol which is used at the end of examples and constructions. This is done just as QED is used at the end of proofs.

I will use the amsthm package.

\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{prop}[thm]{Proposition}

\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
\newtheorem{ex}[thm]{Example}
\newtheorem{fact}{Experimental Fact}
\newtheorem{prob}[thm]{Problem}
\newtheorem{construction}[thm]{Construction}
\newtheorem{con}[thm]{Conjecture}
\newtheorem*{notation}{Notation}
\newtheorem*{assume}{Assumption}
\newtheorem*{quest}{Question}

\theoremstyle{remark}
\newtheorem{rmk}[thm]{Remark}
\newtheorem{sch}[thm]{Scholium}

\newcommand\qefsymbol{\ensuremath\blacksquare}
%{\ensuremath\triangle} % perhaps \ensuremath\triangle if one prefers...

\makeatletter
\newenvironment{example}{\begin{ex} %
  \let\qedsymbol\qefsymbol % this is a temporary "let"
  \pushQED{\qed}}%
  {\popQED\@endpefalse\end{ex}}

\newenvironment{construct}%
  {\begin{construction}\pushQED{\qed}}%
  {\popQED\end{construction}}
\makeatother

Now, to keep track of which step of ISEE we are at, I'd like to introduce the following code:

\font\manual=manfnt

\newcommand\identify{\noindent\llap{\manual\char'170\rm\kern.5em}\textbf{Identify:}}
\newcommand\setup{\noindent\llap{\manual\char'170\rm\kern.5em}\textbf{Set up:}}
\newcommand\execute{\noindent\llap{\manual\char'170\rm\kern.5em}\textbf{Execute:}}
\newcommand\evaluate{\noindent\llap{\manual\char'170\rm\kern.5em}\textbf{Evaluate:}}

There are other matters to discuss, like units and so forth, which I'll tackle next time...

MetaPost, Plotting, and numerical precision

So, to write up diagrams in LaTeX, you need to use Metapost. But Metapost doesn't use floating point arithmetic.

As Claudio Beccari's "Floating point numbers and METAFONT, METAPOST, TEX, and PostScript Type 1 fonts" (TUGboat [pdf]) notes, 32 bit integers are used to represent real numbers. The first 16 bits form the fractional part, 14 bits the integer part, 1 bit for the sign, and 1 bit for special purposes.

So, that means we have 16 log(2)/log(10) digits of precision, or about 4 digits. Now lets remember:

1 PS point = 1.00375 points
1 pica = 12 PS points
1 inch = 72 PS points = 72.27 points = 6 pica
1 cm = 28.3464567 PS points = 2.36220472 pica

We have precision of 2-16 points, or about 0.000868055556 inches, or 0.00220486111 centimeters.

That's decent for output but not for intermediate computations. For example, if we were to plot xx, we may lose a lot of precision.

Plots in Metapost

Lets consider a simple plot of $f(x)=x^{2}$.

numeric u;
u := 1pc; % units

vardef f(expr x) = x*x enddef;

beginfig(0)
  % draw the axes
  drawdblarrow (-3u-ahlength,0)--(3u+ahlength,0);
  drawdblarrow (0,0-2ahlength)--(0,9u+ahlength);

  % plot the function
  draw (-3u,f(-3)*u)
    for i=-3+0.05 step 0.05 until 3:
    ..(i*u,f(i)*u)
  endfor;
endfig;
end;

Remember that ahlength is the length of the arrow head.

This basic scheme can be generalized if we add numerics x0 and x1 which control where the plot begins and ends (respectively), as well as the step size dx which is taken to be "small enough".

Revising our code:

numeric u;
numeric dx;
u := 1pc; % units
dx := 0.05; 

vardef f(expr x) = x*x enddef;

beginfig(0)
  numeric x[];

  x0 := -3; % start plotting at x=-3
  x1 := 3; % stop plotting at x=+3

  % draw the axes
  drawdblarrow (x0*u-ahlength,0)--(x1*u+ahlength,0); % x-axis
  drawdblarrow (0,0-2ahlength)--(0,f(x1)*u+ahlength); % y-axis

  % plot the function
  draw (x0*u,f(x0)*u)
    for i=x0+dx step dx until 3:
    ..(i*u,f(i)*u)
  endfor;
endfig;
end;

This makes things a little complicated. What we are doing is computing the pairs (x,y) and then scaling them, then plotting.

The dx is the change in x before scaling. The points plotted have a change in x that amounts to dx*u=0.6pt approximately.

But we can do more! If we specify how big we want this plot to be, i.e. it has to fit within X inches, then we can determine the scale u by this.

Specifically, u := X/(x[1]-x[0]) is the scale factor definition.

If we demand that dx*u=0.6pt hold, which is "sufficiently good" for practical purposes, then we also define dx := (3pt)/(5*u).

The interested reader may want to read Learning Metapost by Doing.

LaTeX Macros for Personal Notes

So last time, I discussed the notion of personal mathematical notes (as opposed to expository mathematical notes) and would like to discuss some LaTeX macros which enable writing personal notes.

The basic scheme is to write in "chunks" (to borrow a term from literate programming). We've all seen examples of this, Bagchi and Wells refer to it as "labeled style" in their paper Varieties of Mathematical Prose

But each "chunk" is a self-contained concept, example, discussion, etc.

For a good example of this writing style, see On Euler's Footsteps.

LaTeX Code

I am taking CWEB's style. So, the code listing I have is as follows:

% chunk.sty
\ProvidesPackage{chunk}[2011/12/15 Cunking commands for personal notes]
\makeatletter

\@ifundefined{@addpunct}{
  \def\@addpunct#1{\ifnum\spacefactor>\@m \else#1\fi}
  }{}

\newcounter{chunk@ctr}

\newcommand\M{\medbreak\noindent%
  \refstepcounter{chunk@ctr}%
  \textbf{\thechunk@ctr\@addpunct{.}}\quad\ignorespaces}

% deprecated macro:
% \newcommand\N[1]{\M\textbf{#1\@addpunct{.}}\quad\ignorespaces}

% superior implementation:

\def\N{\@ifstar
        \NStar%
        \NNoStar%
}
\def\NStar#1{\medbreak\noindent\textbf{#1\@addpunct{.}\quad}\ignorespaces}
\def\NNoStar#1{\M\textbf{#1\@addpunct{.}\quad}\ignorespaces}

% permits writing \N*{Un-numbered chunk} for a chunk
% without a numeric label!

\makeatother
% end of cunk.sty

Note that it is completely self-contained code, and you do not need amsgen package. If you already loaded it, then no worries!

Each chunk is numbered. We use \M for unlabeled chunks, and \N{My favorite chunk!} for labeled chunks (which is labeled "My favorite chunk!").

So lets write up some example usage:

\documentclass{article}
\usepackage{chunk} % make it in the same directory
% or put it in ~/texmf/tex/latex/ and run "sudo texhash"
\title{Example Notes}
\author{Alex Nelson}
\date{\today}
\begin{document}
\maketitle

\N{Introduction}
Today we will solve all the problems in the universe. 

\M Lorem ipsum dolor sit amet, consectetur adipisicing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna 
aliqua. Ut enim ad minim veniam, quis nostrud exercitation 
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis 
aute irure dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat 
cupidatat non proident, sunt in culpa qui officia deserunt 
mollit anim id est laborum.

\N{Conclusion?} Nobel Prize please!

\end{document}

As far as bugs, I don't think there are any...it's too minimalistic!

To Do

The chunk counter is rather minimalistic, and doesn't count within any section. This has to be changed by hand if the user wants to use these macros and number chunks within each chapter...

In the time honored tradition of mathematicians, this exercise is left for the reader!

Tuesday, December 13, 2011

Personal v. Expository notes

Personal Notes Are For One's Self

I recently stumbled across Thinking Mathematically by J. Mason, L. Burton, K. Stacey (Amazon) which has an interesting approach to writing personal mathematical notes.

I say "personal" as opposed to "expository" because they are really personal scratchwork rather than explanations.

What's really cute is Mason, et al., espouse a sort of "markup language" approach (they call it a "rubric"). Let me review this a little.

When "entering" a mathematics problem, there are three things to ask ourselves, which constitute the entry phase:

  1. What am I know? (What is given?)
  2. What do I want?
  3. What can I introduce?
Know, want, introduce. These three things we should always, always, always ask ourselves! Even in long proofs, we should ask ourselves these questions! We should ask ourselves when we get stuck!

With introducing stuff. . . we can do several types of introduction.

Notation:
Assigning values and meanings to variables.
Organization:
Recording and arranging what you know.
Representation:
Choose particular representatives which are easier to manipulate.
Bear in mind that rephrasing the question is particularly useful.

Now, reviewing your work is also critical. There are several different ways of doing this:

Check:
the resolution;
Reflect:
on the key ideas and key moments;
Extend:
to a wider context.
The best way to get the most out of reviewing is to write up your resolution for someone else, in such a way that one can follow what you have done and why.

We can check several things:

  1. Check calculations;
  2. Check arguments to ensure computations are appropriate;
  3. Consequences of conclusions to see if they are reasonable;
  4. Check that the resolution fits the question.
This is sort of subconsciously done.

We also reflect in finitely many ways:

  1. What are the key ideas and key moments?
  2. What are the implications of conjectures and arguments?
  3. Can the resolution be made clearer?
It helps one see things that otherwise would have been missed.

As far as extending, one should really be generalizing the problem. For example: how many squares are on a 3 × 3 chess board? There are 9 instances of 1 × 1 squares, 4 instances of 2 × 2 squares, and a single 3 × 3 square. Thus there are 14 squares altogether. Now, to extend:

  1. How many squares are on an n × n board?
  2. How many rectangles are on a 3 × 3 board? Extend this to n × n boards.
  3. What if we start with an m × n board? How many squares are there in it?
  4. Why work only in two dimensions?
  5. Why count squares with edges parallel to the original?

When stuck, try re-entering the entry phase. This can be done through:

  1. Summarize everything known and wanted;
  2. Rephrase the question in a more appealing way;
  3. Re-read or re-digest the problem.
This is useful sometimes.

Conjecturing is a cyclic four-step procedure:

  1. Articulate a conjecture (and while making it, believe it);
  2. Check the conjecture covers all known cases and examples;
  3. Distrust the conjecture. Try to refute it by finding a nasty case or example; use it to make predictions which can be checked;
  4. Get a sense of why the conjecture is right, or how to modify it, on new examples (go back to step 1).
Note you can start anywhere in this procedure.

It's not too long until one gets to a state where one says "I don't believe it's possible" which leads to the questions

  1. Why can it not be done?
  2. All right, what can be done?
Asking "What can be done" is a critical step in conjecturing.

Now, critical mathematical thinking should be nurtured by thinking three things while doing or reading a proof:

  1. Every statement made should be treated as a conjecture.
  2. Try to defeat and prove conjectures simultaneously.
  3. Look critically at other people's proofs.
There are some mathematical registers that some authors suggest using while writing notes. The collection is sometimes called a rubric:
I Know:
What is given? What is known?
I Want:
What do we want to prove?
Introduce:
Try contributing some:
Notation:
Assigning values and meanings to variables.
Organization:
Recording and arranging what you know.
Representation:
Choose particular representatives which are easier to manipulate.
Stuck!:
"I do not understand...", "I do not know what to do about...", "I cannot see how to...", "I cannot see why..." — try going back to the entry portion "want/know/introduce", or make a conjecture.
AHA!:
Whenever you have a good idea, write it down. Usually, they are of the form: "AHA! Try...", "AHA! Maybe...", or "AHA! But why...".
Check:
the mathematics. This means:
  1. Check calculations;
  2. Check arguments to ensure computations are appropriate;
  3. Consequences of conclusions to see if they are reasonable;
  4. Check that the resolution fits the question, i.e., our answer is the answer to the question asked.
Reflect:
meditate on:
  1. What are the key ideas and key moments?
  2. What are the implications of conjectures and arguments?
  3. Can the resolution be made clearer?
Extend:
generalize to other settings.
The real trick is to change "I'm stuck, panic!" to "I'm stuck, okay, so what can be done about it?"

Monday, December 12, 2011

MathJax, Updates

Updates

I've just updated the design of the blog. I think it looks negligibly better.

I'll also try to write more here rather than on my notebk's wiki.

I posted some exercises for Sean [pdf] which are fun calculus problems.

I suspect what I'll do next is write up my notes on differential geometry from Osserman's course I audited a couple years ago, as well as my notes on algebraic topology (from Dr Schwarz's courses). Then I'll work on spin geometry, "commutative geometry", analysis, and so on.

By "commutative geometry", I really mean spectral triples using commutative rings (Here I am sloppy, but meh I am a sloppy person!). It is also called Differential Calculus over Commutative Algebras, although there are no real texts on the subject...

I'll have to review the prime spectrum of the commutative ring $C(M)$ of continuous functions on a topological space $M$ and how it relates to the topology of $M$.

If we let $M$ be a smooth manifold, then we work with $C^{\infty}(M)$ — I am told there is a theorem due to Shields which says if $M$ and $N$ are smooth manifolds and $C^{\infty}(M)$ is isomorphic to $C^{\infty}(N)$ then $M$ and $N$ are diffeomorphic. How interesting! But I cannot find this theorem...

At any rate, vector bundles over $M$ may be considered by looking at the projective modules over $C^{\infty}(M)$.

We consider algebraic analogs for sections, vector fields, covector fields, and so on. It is really quite cute.

Noncommutative geometry is similar in setting up a dictionary between "algebraic stuff" and "geometric stuff", at least how Connes approaches it. It's just that the "geometric stuff" we work with is a smooth Riemannian manifold $M$ equipped with a spin structure, we consider spin bundles over it, and so on.

MathJax

I am experimenting with MathJax on blogger, so bear with me people.

My reference for this subject is the thread at stackexchange on it.

Consider the "Harmonic Series" \[ \sum^{\infty}_{n=1}\frac{1}{n}=1+\frac{1}{2}+\frac{1}{3}+\cdots \] which diverges famously.

MathJax uses the \(...\) or $...$ for "inline mathematics" and \[...\] or $$...$$ for "display math", e.g., the mathematics produced above.

I don't know whether to keep it or not, because MathJax is sluggish on some computers. But it is the "way of the future", like blimps and autogyros.