Classsifying $1$- and $2$-Dimensional Lie Algebras, up to Isomorphism I am trying to find all $1$- or $2$-dimensional Lie algebras $\mathfrak{a}$ up to isomorphism. This is what I have so far:
If $\mathfrak{a}$ is $1$-dimensional, then every vector (and therefore every tangent vector field) is of the form $cX$. Then, by anti-symmetry, and bilinearity:
$$
  [X,cX] = c[X,X] = -c[X,X] = 0 \,.
$$
I think this forces a unique Lie algebra because Lie algebra isomorphisms preserve the bracket.  I also know the reals $\mathbb{R}$ are the only $1$-dimensional Lie group, so its Lie algebra ($\mathbb{R}$ also) is also $1$-dimensional. How can I show that every other $1$-dimensional algebra is isomorphic to this one? Do I use preservation of bracket?
For $2$ dimensions, I am trying to use the fact that the dimension of the Lie algebra $\mathfrak{g}$ of a group $G$ is the same as the dimension of the ambient group/manifold $G$. I know that all surfaces (i.e., groups of dimension $2$) can be classified as products of spheres and tori, and I think the only $2$-dimensional Lie group is $S^1 \times S^1$, but I am not sure every Lie algebra can be realized as the Lie algebra of a Lie group (I think this is true in the finite-dimensional case, but I am not sure).
I know there is a result out there that I cannot yet prove that all $1$- and $2$-dimensional Lie algebras are isomorphic to Lie subalgebras of $\mathrm{GL}(2,\mathbb{R})$ (using matrix multiplication, of course); would someone suggest how to show this last? Thanks.
 A: I found myself working on this same problem (for homework), and I think I've written a fairly detailed solution. So I will post it here, in case it is helpful to anyone else.

Let $\mathfrak{g}$ be a 1-dimensional Lie algebra, and let $\{E_1\}$ be a basis for $\mathfrak{g}$. Then for any two vector fields $X,Y\in\mathfrak{g}$, we have $X=aE_1$ and $Y=bE_1$, for some $a,b\in\mathbb{R}$. Thus,
$$[X,Y]=[aE_1,bE_1]=ab[E_1,E_1]=0$$
for all $X,Y\in\mathfrak{g}$. Therefore, the only 1-dimensional Lie algebra is the trivial one. The map
$$\varphi:\mathfrak{g}\rightarrow\mathfrak{gl}(2,\mathbb{R})$$
$$\varphi:aE_1\mapsto
\left(\begin{array}{ll}
a&0\\
0&0
\end{array}\right)$$
is a Lie algebra homomorphism, since
$$\varphi([aE_1,bE_1])=\varphi(0)=\left(\begin{array}{ll}
0&0\\
0&0
\end{array}\right)\mbox{, and}$$
$$[\varphi(aE_1),\varphi(bE_1)]=\left(\begin{array}{ll}
a&0\\
0&0
\end{array}\right)\left(\begin{array}{ll}
b&0\\
0&0
\end{array}\right)-\left(\begin{array}{ll}
b&0\\
0&0
\end{array}\right)\left(\begin{array}{ll}
a&0\\
0&0
\end{array}\right)$$
$$=\left(\begin{array}{ll}
0&0\\
0&0
\end{array}\right).$$
 Thus, $\mathfrak{g}$ is isomorphic to the (abelian) Lie subalgebra
$$\varphi(\mathfrak{g})=\left\{\left(\begin{array}{ll}
a&0\\
0&0
\end{array}\right)\in\mathfrak{gl}(2,\mathbb{R}):a\in\mathbb{R}\right\}\subset\mathfrak{gl}(2,\mathbb{R}).$$
Now let $\mathfrak{h}$ be a 2-dimensional Lie algebra, and let $\{E_1,E_2\}$ be a basis for $\mathfrak{h}$. Then for any two vector fields $X,Y\in\mathfrak{h}$, we have $X=aE_1+bE_2$ and $Y=cE_1+dE_2$, for some $a,b,c,d\in\mathbb{R}$. Thus,
$$\begin{array}{ll}
[X,Y]&=[aE_1+bE_2,cE_1+dE_2]\\
&=a[E_1,cE_1+dE_2]+b[E_2,cE_1+dE_2]\\
&=ac[E_1,E_1]+ad[E_1,E_2]+bc[E_2,E_1]+bd[E_2,E_2]\\
&=(ad-bc)[E_1,E_2].
\end{array}$$
If $[E_1,E_2]=0$, then we have the trivial 2-dimensional Lie algebra. The map
$$\varphi:\mathfrak{h}\rightarrow\mathfrak{gl}(2,\mathbb{R})$$
$$\varphi:aE_1+bE_2\mapsto
\left(\begin{array}{ll}
a&0\\
0&b
\end{array}\right)$$
is a Lie algebra homomorphism, since 
$$\varphi([aE_1+bE_2,cE_1+dE_2])=\varphi(0)=\left(\begin{array}{ll}
0&0\\
0&0
\end{array}\right)\mbox{, and}$$
$$[\varphi(aE_1+bE_2),\varphi(cE_1+dE_2)]=\left(\begin{array}{ll}
a&0\\
0&b
\end{array}\right)\left(\begin{array}{ll}
c&0\\
0&d
\end{array}\right)-\left(\begin{array}{ll}
c&0\\
0&d
\end{array}\right)\left(\begin{array}{ll}
a&0\\
0&b
\end{array}\right)$$
$$=\left(\begin{array}{ll}
0&0\\
0&0
\end{array}\right).$$Furthermore, this map is faithful (injective). Thus, $\mathfrak{h}$ is isomorphic to the (abelian) Lie subalgebra
$$\varphi(\mathfrak{h})=\left\{\left(\begin{array}{ll}
a&0\\
0&b
\end{array}\right)\in\mathfrak{gl}(2,\mathbb{R}):a,b\in\mathbb{R}\right\}\subset\mathfrak{gl}(2,\mathbb{R}).$$
If $[E_1,E_2]\neq0$, then set $E_3=[E_1,E_2]$. Then for all $X,Y\in\mathfrak{h}$ we have $[X,Y]=\lambda E_3$ for some $\lambda\in\mathbb{R}$. In particular, for any $E_4\in\mathfrak{g}$ such that $E_4$ and $E_3$ are linearly independent, we have $[E_4,E_3]=\lambda_0 E_3$. Replacing $E_4$ with $1/\lambda_0 E_4$, we now have a basis $\{E_4, E_3\}$ for $\mathfrak{g}$ such that $[E_4, E_3]=E_3$. The map
$$\varphi:\mathfrak{h}\rightarrow\mathfrak{gl}(2,\mathbb{R})$$
$$\varphi:aE_4+bE_3\mapsto
\left(\begin{array}{ll}
a&b\\
0&0
\end{array}\right)$$
is a Lie algebra homomorphism, since 
$$\varphi([aE_4+bE_3,cE_4+dE_3])=\varphi((ad-bc)E_3)=\left(\begin{array}{ll}
0&ad-bc\\
0&0
\end{array}\right)\mbox{, and}$$
$$[\varphi(aE_4+bE_3),\varphi(cE_4+dE_3)]=\left(\begin{array}{ll}
a&b\\
0&0
\end{array}\right)\left(\begin{array}{ll}
c&d\\
0&0
\end{array}\right)-\left(\begin{array}{ll}
c&d\\
0&0
\end{array}\right)\left(\begin{array}{ll}
a&b\\
0&0
\end{array}\right)$$
$$=\left(\begin{array}{ll}
0&ad-bc\\
0&0
\end{array}\right).$$Furthermore, this map is faithful (injective). Thus, $\mathfrak{h}$ is isomorphic to the (non-abelian) Lie subalgebra
$$\varphi(\mathfrak{h})=\left\{\left(\begin{array}{ll}
a&b\\
0&0
\end{array}\right)\in\mathfrak{gl}(2,\mathbb{R}):a,b\in\mathbb{R}\right\}\subset\mathfrak{gl}(2,\mathbb{R}).$$
A: Although you've tagged your question "differential-geometry", it's actually a pure algebra question.  While you're right that for Lie algebras over (e.g.) $\mathbb{R}$ there is a deep relationship with Lie groups which motivates their study and can be helpful for proving "purely algebraic theorems", it seems to me that juggling between Lie groups and Lie algebras is distracting you from the issues at hand.
One more comment on your Lie-theoretic approach: there is indeed a bijection between connected, simply connected real Lie groups and finite-dimensional real Lie algebras, but the group structure on the Lie group side cannot be ignored.  It is not enough just to classify manifolds which admit a Lie group structure, since the same manifold may admit a Lie group structure in multiple different ways.  An especially relevant example is that any nilpotent Lie group -- i.e., a Lie group with associated Lie algebra a nilpotent Lie algebra -- is as a manifold isomorphic to $\mathbb{R}^n$, but the group law need not be commutative.
Coming back to the classification of Lie algebras of small dimension:
You have actually already done the one-dimensional case, as you have observed that the Lie bracket on any one-dimensional Lie algebra must be trivial.  Thus any two one-dimensional Lie algebras are isomorphic: any vector space isomorphism will do.
In two dimensions there is again the Lie algebra $L_1$ with trivial bracket, but there is also a noncommutative Lie algebra $L_2$.  Concretely, if we take a basis of $x,y$ of $\mathbb{R}^2$ and define $[x,x] = [y,y] = 0$ and $[x,y] = -[y,x] = y$ then this works to give a Lie algebra.  (Check this!)  Now the same construction can be done in many other ways, but they are all isomorphic to this one: start by assuming that 
$[x,y] = ax + by$ with $a$ and $b$ not both zero and then find a new basis $X$, $Y$ 
under which the bracket is again $[X,Y] = Y$.  Thus there are exactly two Lie algebras of dimension $2$ over $\mathbb{R}$.  In both cases, the corresponding Lie groups are isomorphic as manifolds to $\mathbb{R}^2$ (there are many ways to see this, magic words being exponential map and Baker-Campbell-Hausdorff formula; you'll probably learn them later on), but one of the group structures is the usual one on $\mathbb{R}^2$ and the other is a non-commutative group structure.
Note by the way that the situation is much different starting in dimension three: 
there are then infinitely many isomorphism classes of Lie algebras, and indeed continuous families of Lie algebras.  See for instance Section 4 of this paper
which constructs, over an arbitrary field $F$, for each $a \in F$ a Lie algebra $L_a^3$ such that for $a,b \in F$, $L_a^3 \cong L_b^3 \iff a = b$.  Thus Lie algebras "vary in moduli" starting in dimension three.
A: First, notice that all abelian Lie algebras of a given dimension (over a given field) are isomorphic. For any two abelian Lie algebras $\mathfrak{g}, \mathfrak{h}$ of the same dimension (and over the same field), any vector space isomorphism $\phi: \mathfrak{g} \to \mathfrak{h}$ is a Lie algebra isomorphism: $$\phi([X, Y]) = \phi(0_{\mathfrak{g}}) = 0_{\mathfrak{h}} = [\phi(X), \phi(Y)] .$$
Now, a general technique in the classification of Lie algebras is to look for a basis that is in some sense adapted to the Lie bracket. We can show, for example:
Lemma Any nonabelian $2$-dimensional Lie algebra admits a basis $(E_1, E_2)$ such that $$[E_1, E_2] = E_1 .$$ (We call such a basis adapted.)
This result immediately gives the following proposition, which completes our classification of $1$- and $2$-dimensional Lie algebras:
Proposition There is exactly $1$ nonabelian Lie algebra of dimension $2$ (over any field).

Proof.
(Existence.) Pick any $2$-dimensional vector space $\Bbb V$ and basis $(E_1, E_2)$ thereof. The skew-symmetric bilinear operation characterized by $[E_1, E_2] := E_1$ defines a Lie algebra on $\Bbb V$.
(Uniqueness.) Pick nonabelian Lie algebras $\mathfrak{a}, \mathfrak{b}$ of dimension $2$ and let $(E_1, E_2), (F_1, F_2)$ be any respective adapted bases. The vector space isomorphism $\phi: \mathfrak{a} \to \mathfrak{b}$ defined by $\phi(E_1) = F_1, \phi(E_2) = F_2$, is a Lie algebra isomorphism:
$$\phantom{\square} \qquad \phi([E_1, E_2]) = \phi(E_1) = F_1 = [F_1, F_2] = [\phi(E_1), \phi(E_2)] . \qquad \square$$


Proof of lemma. Given a nonabelian $2$-dimensional Lie algebra $\mathfrak{a}$, the subalgebra $$[\mathfrak{a}, \mathfrak{a}] := \{[U, V] : U, V \in \mathfrak{a}\}$$ is spanned by $[X, Y] \neq 0$ for any basis $(X, Y)$ of $\mathfrak{a}$ and particular is $1$-dimensional. So, pick a nonzero element $E_1 \in [\mathfrak{a}, \mathfrak{a}]$. Then, for any element $Z \in \mathfrak{a} \setminus [\mathfrak{a}, \mathfrak{a}]$ we have $[E_1, Z] = \mu E_1$ for some $\mu \neq 0$, and if we set $E_2 := \mu^{-1} Z$ then $(E_1, E_2)$ is a basis of $\mathfrak{a}$ for which
$$\phantom{\square} \qquad [E_1, E_2] = E_1 . \qquad \square$$

There's a nice concrete realization of the nonabelian Lie algebra of dimension $2$:
Exercise The Lie algebra is isomorphic to the Lie algebra $\mathfrak{aff}(\Bbb F) = \Bbb F \rightthreetimes \Bbb F$ of the affine Lie group $\operatorname{Aff}(\Bbb F) = \Bbb F \rightthreetimes \Bbb F^*$ of invertible affine transformations $t \mapsto a t + b$ of $\Bbb F$ under composition.
Remark More generally, for any Lie algebra $\mathfrak{g}$ a basis $(E_i)$ determines structure constants $C_{ij}^k$, characterized by
$$[E_i, E_j] = C_{ij}^k E_k .$$ If for another Lie algebra $\mathfrak{h}$ of the same dimension we can find a basis $(F_i)$ with the same structure constants, i.e., for which $[F_i, F_j] = C_{ij}^k F_k$ for all $i, j, k$, then the vector space isomorphism $\phi : \mathfrak{g} \to \mathfrak{h}$ defined by $\phi(E_i) = F_i$ (for all $i$) is a Lie algebra isomorphism. Put another way, a Lie algebra is determined by its structure constants (or just as well, its multiplication table).
