Berry phase covariant derivative I have been studying some simple examples of the covariant derivative for 2D surfaces and the way that it is constructed is by taking the usual derivative in the 3D Euclidean space at a point $p$ on the surface and subtracting the component of the derivative that is along the normal vector to the tangent plane at $p$. This gives an "intrinsic" notion of a derivative, i.e. one that entirely has to do with the surface itself by always being confined to the tangent plane of each point.  
Now, I was also studying some basic things about the Berry phase and stumbled accross a talk by Haldane who stated that the covariant derivative is defined for a Hamiltonian eigenstate $|n\rangle$ as
$$D_\mu|n\rangle=\partial_\mu|n\rangle+iA_\mu|n\rangle$$
$$with\ A_\mu=i\langle n| \partial_\mu |n\rangle$$
But, written out explicitly, this gives
$$D_\mu|n\rangle=\partial_\mu|n\rangle-\langle n| \partial_\mu |n\rangle|n\rangle$$
which means that the covariant derivative acting on the state $|n\rangle$ is its "usual" derivative (i.e. the one that acts on the parameter space) minus the component of the derivative that is along the state $|n\rangle$, which seems to be the complete opposite of what we have in the case that I described first, which projects out the components that do not belong to the local tangent plane.  
Could somebody explain why do we define the covariant derivative in this way and why is this considered as being intrinsic in the same sense as the first example? In the first example, the covariant derivative was confined to the tangent space of each point $p$, while in the case of the Berry phase, it seems to be confined outside the space in which $|n\rangle$ lives in.  
Thank you and please keep the answers at the level of the question. I just need some intuition behind the definition.
 A: If we have a collection of degenerate states $|n,\lambda>$, $n=1,\ldots M$  depending on parameters $\lambda_\mu$ the we define the covariant derivative of the state  $|n>$ by
$$
\nabla_\mu |n> = \sum_{m=1}^M |m><m|\partial_\mu |n>.
$$
In other words we keep projecting the varying state $|n,\lambda>$ back into the degenerate subspace. If we define the $M$-by-$M$ matrix-valued "gauge fields" by
$$
iA_{mn\mu} = <m|\partial_\mu|n>
$$ 
then 
from $<m|n>= \delta_{mn}$ we have
$$
0=(\partial_\mu <m|)|n>+ <m|\partial_\mu |n> 
$$
and from $<a|b>= <b|a>^*$ we have $(\partial_\mu <m|)|n>= (<n|\partial_\mu |m>)^*$ we have 
 $$
A_{mn\mu}= A^*_{mn\mu}
$$ 
so the Berry-connection "gauge field" coefficients are Hermitian. Now if we want to compute the covariant derivative of a $\lambda$-dependent state 
$$
|\psi,\lambda>= \psi_n(\lambda) |n,\lambda>
$$
(sum on $n$ implied) 
we use that $\nabla_\mu$ is a derivation we find that 
$$
\nabla_\mu |\psi> \equiv  \nabla_\mu (\psi_n |n>) = (\nabla_\mu \psi_n)|n>+\psi_n  (
\nabla_\mu |n>)\\
= (\partial_\mu \psi_n )|n> + \psi_n |m> iA_{mn\mu} \\
= (\partial_\mu \psi_n + iA_{nm\mu} \psi_m) |n>.
$$
Here we have used the fact that the coefficients $\psi_n$ are just numbers so their covariant derivative are  just the usual  partials, and we have relabeled $m\leftrightarrow n$ in the last line. Thus if we focus on the coeffcients we can say (in the  usual confusing language used in this game) that
$$
\nabla_\mu \psi_n = \partial_\mu \psi_n+ iA_{nm\mu} \psi_m.
$$
This is what I think Duncan meant. In other words the "$|n>$" in your first equation are not vector elements of the Hilbert space but are instead  the numerical coeffcients $\psi_n$ of some  state $|\psi>$. 
This is the same problem that is caused by casually  confusing the state   $|\psi>$ (a vector in the Hilbert space)   with  its numerical components $\psi_n= <n|\psi>$ which are an $n$-dependent set of real numbers.
Note added: I looked at the definition of the "gauge covariant derivative" that Duncan gives in the talk cited by  LORENTZo_lamas. It is not the standard definition of a covariant derivative. Indeed it is exactly backwards. One wants the covariant derivative along a curve  to be zero when a vector is being parallel trasported. When the curve is embedded in a curved surface embedded in a larger flat space, parallel tranport  means that the change in the vector  is perpendicular to the surface. Thus we  define  the covarant derivative by subtracting of the components of  the change in the vector that are perpendicular to the tangent plane. Duncan's def is to subtract of the part that lies in the tangent space. He then says that something is parallel transported when his "gauge covariant derivative" is perpenticular to the surface. This may work for him --- it gives hime the same "gauge field" object $iA$ that everyone else uses, but his "gauge covariant derivative" is not the usual one.  
