Distribution relation in the Euler system of Heegner points I am trying to understand the details behind the so-called "distribution relations" between Heegner points on the modular curve $X_0(N)$, as given (for instance) in Gross's paper Kolyvagin's work on modular elliptic curves, [Proposition 3.7, (i)]. More precisely, the relation between Hecke and Galois actions on CM-points is still not clear for me. First of all let me recall in details the  general settings, which the familiar reader can skip and go directly to the question.
Settings:
Let $N$ be a positive integer, let $K$ be an imaginary quadratic field of discriminant $D<0$ such that every rational prime divisor of $N$ splits in $K$ (the so-called Heegner hypothesis). The Heegner hypothesis implies that one can find a (non-unique) ideal $\mathcal{N}$ of $\mathcal{O}_K$ such that $\mathcal{O}_N/\mathcal{N}\simeq \mathbb{Z}/N\mathbb{Z}$.
Edit: As noticed by Olivier I also have to assume $D<-4$, to ensure that $\mathcal{O}_K^{\times}=\{\pm 1\}$.
For a general $n$, denote by $\mathcal{O}_n=\mathbb{Z}+n\mathcal{O}_K\subset\mathcal{O}_K$ "the" order of $K$ of conductor $n$, and let $Pic(\mathcal{O}_n)$ be the ideal class group of $\mathcal{O}_n$ (which is isomorphic to $I(n)/P(n)$, with $I(n)$ the group of ideals in $\mathcal{O}_K$ that are prime to $n$; and $P(n)$ the subgroup of principal ideals in $\mathcal{O}_K$ generated by an element congruent mod $n\mathcal{O}_K$ to some $r\in\mathbb{Z}$, $(r,n)=1$).
Class-field theory provides us with an abelian extension $K_n$ of $K$ such that $\mathrm{Gal}(K_n/K)\simeq Pic(\mathcal{O}_n)$.
Let now $n$ be an integer prime to $ND$. Setting $\mathcal{N}_n:=\mathcal{N}\cap\mathcal{O}_n$, we get that $\mathcal{O}_n/\mathcal{N}_n\simeq \mathcal{O}_K/\mathcal{N}\simeq \mathbb{Z}/N\mathbb{Z}$. One can thus define a point $x_n\in X_0(N)$ by setting
$$x_n=[\mathbb{C}/\mathcal{O}_n\rightarrow \mathbb{C}/\mathcal{N}_n^{-1}]$$
(here $[E\rightarrow E']$ denotes the isomorphism class of the pair $(E,E')$ of elliptic curves, with $E\rightarrow E'$ a cyclic $N$-isogeny).
If $l$ is a rational prime not dividing $ND$ nor $n$, we can mimic the previous discussion and set 
$$x_{nl}=[\mathbb{C}/\mathcal{O}_{nl}\rightarrow \mathbb{C}/\mathcal{N}_{nl}^{-1}]$$ 
The theory of complex multiplication ensures that $x_n\in X_0(N)(K_n)$ (resp. $x_{nl}\in X_0(N)(K_{nl})$ ) 
Here comes my question: assuming $l$ is inert in $K/\mathbb{Q}$, why do we have
$$\mathrm{Tr}_{K_{nl}/K_n}x_{nl}:=\sum_{\sigma\in\mathrm{Gal}(K_{nl}/K_n)}\sigma x_{nl} = T_l x_n$$ 
as divisors on $X_0(N)$ ?
What I "understood" is that:


*

*For $\sigma\in \mathrm{Gal}(K_{nl}/K)$, the action of $\sigma$ on $x_{nl}$ is given by
$\sigma x_{nl}=[\mathbb{C}/\mathfrak{a}_{\sigma}^{-1}\rightarrow \mathbb{C}/\mathfrak{a}_{\sigma}^{-1}\mathcal{N}_{nl}^{-1}]$
where $\mathfrak{a}_{\sigma}$ is any (proper) ideal of $\mathcal{O}_{nl}$ such that $[\mathfrak{a}_{\sigma}]\in Pic(\mathcal{O}_{nl})$ corresponds to $\sigma$ via the isomorphism $\mathrm{Gal}(K_{nl}/K)\simeq Pic(\mathcal{O}_{nl})$.
Thus the sum $\mathrm{Tr}_{K_{nl}/K_n}x_{nl}$ rewrites as 


$$\sum_{\sigma\in\mathrm{Gal}(K_{nl}/K_n)}[\mathbb{C}/\mathfrak{a}_{\sigma}^{-1}\rightarrow \mathbb{C}/\mathfrak{a}_{\sigma}^{-1}\mathcal{N}_{nl}^{-1}]$$
Here the condition $\sigma\in\mathrm{Gal}(K_{nl}/K_n)$ implies, I think, that $\mathfrak{a}_{\sigma}\mathcal{O}_n$ is a principal $\mathcal{O}_n$-ideal.
Here $\mathrm{Gal}(K_{nl}/K_n)\simeq \mathbb{F}_{l^2}^{\times}/\mathbb{F}_{l}^{\times}$, so the sum has $l+1$ terms.


*

*The action of the Hecke operator $T_l$ ($l$ not dividing $N$) on divisors of the modular curve $X_0(N)$ can be described (at least in characteristic $0$) as
$$T_l [E\xrightarrow{\phi} E']=\sum_{C\subset E[l], \#C=l} [E/C\rightarrow E'/\phi(C)]$$
(there are $l+1$ such $C$)
In my situation, this can be rewritten (following Gross, Heegner points on $X_0(N)$, §6) as
$$T_l x_n=\sum_{\mathfrak{b}\subset\mathcal{O}_n\text{lattice of index } l}[\mathbb{C}/\mathfrak{b}\rightarrow \mathbb{C}/\mathfrak{b}(\mathcal{N}_n\cap End(\mathfrak{b}))^{-1}] $$


What I don't understand is why the exactly the same terms should appear in both sums. I get that $(id)x_{nl}=x_{nl}$ appears in $T_l x_n$, as $\mathcal{O}_{nl}$ is a sub-lattice of order $l$ in $\mathcal{O}_n$ with $End(\mathcal{O}_{nl})=\mathcal{O}_{nl}$, but I don't see why $\mathfrak{a}_{\sigma}^{-1}$ is a sublattice of order $l$ in $\mathcal{O}_n$  if $\sigma$ fixes $K_n$.
I think this involves properties about fractional ideals of orders which I don't  quite understand. 
I thank everyone taking the time to read this question and trying to provide me with any help !
 A: Thank you Olivier for this great answer, I wish I could be one of your students ;-) !
Though I still not quite fully understand the adelic setting, here is some "classical" explanation I found, using the theory of ideals in orders of imaginary quadratic fields. I guess this is supposed to be a very well-known result but, since I haven't found any complete proof of it, I'll write down what I hope to be a detailed one in case some people are interested. My main reference is D.A. Cox 's "Primes of the form $x^2+ny^2$", chapters 7 and 8.
First, slightly modify the notations and set for any $f\in\mathbb{Z}$:


*

*$I_K(f)$: group of ideals of $\mathcal{O}_K$ which are prime to $f$ (i.e., whose norm is prime to $f$)

*$P_{K,\mathbb{Z}}(f)$: subgroup of $I_K(f)$ made of principal ideals of the form $\alpha\mathcal{O}_K$, with $\alpha$ congruent to some $a$ mod $f\mathcal{O}_K$, with $a\in\mathbb{Z}$ and $(a,f)=1$.


Here the ideals are meant to be integral ideals, and the group structure is obtained by identifying $\mathfrak{a}$ and $\mathfrak{b}$ iff there are some $\alpha$, $\beta\in \mathcal{O}_K$ such that $\alpha\mathfrak{a}=\beta\mathfrak{b}$.
The quotient $I_K(f)/P_{K,\mathbb{Z}}(f)$ is what we call a generalized ideal class group, isomorphic to $Pic(\mathcal{O}_f)\simeq \mathrm{Gal}(K_f/K)$ ($K_f/K $ is the ring class field of conductor $f$, the isomorphism being defined by sending any prime-to-$f$ prime ideal of $\mathcal{O}_K$ to its Frobenius element). Here we set $Pic(\mathcal{O}_f)$ to be the group formed by the quotient of proper ideals of $\mathcal{O}_f $ (i.e., ideals $\mathfrak{a}\subset \mathcal{O}_f$ such that $End(\mathfrak{a})=\mathcal{O}_f)$, by principal ideals.
An important fact is that any (proper or not) $\mathcal{O}_f$-ideal is a free  $\mathbb{Z}$-module of rank $2$.
The isomorphism between $I_K(f)/P_{K,\mathbb{Z}}(f)$ and $Pic(\mathcal{O}_f)$ is given by sending
$$\mathcal{O}_K\supset\mathfrak{a} \mapsto \mathfrak{a}\cap\mathcal{O}_f$$
One checks that elements of $P_{K,\mathbb{Z}}(f)$, of the form $\alpha\mathcal{O}_K$ are sent to $\alpha\mathcal{O}_f $ (this follows from $(a,f)=1$, with $a$ "the" integer congruent to $\alpha$ mod $f\mathcal{O}_K$.)
The inverse isomorphism is given by sending
$$\mathcal{O}_f\supset\mathfrak{a}\mapsto \mathfrak{a}\mathcal{O}_K$$
(see Cox's 7.18, 7.20).
Though it's not strictly necessary, I mention that the norm is preserved by these maps. The case$ f=1$ gives us the Hilbert class field $K_1 $ of $K$, such that $I_K/P_K=Pic(\mathcal{O}_K)\simeq \mathrm{Gal}(K_1/K)$. With these identifications, one obtains that the group $\mathrm{Gal}(K_f/K_1)$ corresponds to $I_K(f)\cap P_K/P_{K,\mathbb{Z}}(f)$.
An important fact is that, if $\mathcal{O}_K^{\times}=\{\pm 1\}$, we have the following exact sequence:
$$1\rightarrow (\mathbb{Z}/f\mathbb{Z})^{\times}\rightarrow (\mathcal{O}_K/f\mathcal{O}_K)^{\times}\rightarrow I_K(f)\cap P_K/P_{K,\mathbb{Z}}(f) \rightarrow 1$$
(see Cox, 7.27)
Applying this to $f=n$, $nl$, one gets that
$$\mathrm{Gal}(K_{nl}/K_1)\simeq (\mathcal{O}_K/nl\mathcal{O}_K)^{\times}/(\mathbb{Z}/nl\mathbb{Z})^{\times}$$
$$\mathrm{Gal}(K_{n}/K_1)\simeq (\mathcal{O}_K/n\mathcal{O}_K)^{\times}/(\mathbb{Z}/n\mathbb{Z})^{\times}$$
Therefore $\mathrm{Gal}(K_{nl}/K_n)$ is isomorphic to $$\frac{(\mathcal{O}_K/nl\mathcal{O}_K)^{\times}/(\mathbb{Z}/nl\mathbb{Z})^{\times}}{(\mathcal{O}_K/n\mathcal{O}_K)^{\times}/(\mathbb{Z}/n\mathbb{Z})^{\times}}
$$
$$\simeq (\mathcal{O}_K/l\mathcal{O}_K)^{\times}/(\mathbb{Z}/l\mathbb{Z})^{\times}$$
as $(n,l)=1$. This last group is isomorphic to $\mathbb{F}_{l^2}^{\times}/\mathbb{F}_{l}^{\times}$, for $l$ is inert in $K/\mathbb{Q}$, so has cardinal $l+1$.
Elements of the group $\mathrm{Gal}(K_{nl}/K_n)$ also corresponds to prime-to-$nl$ principal ideals of the form $\mathfrak{a}=\alpha\mathcal{O}_K$, with $\alpha$ congruent to $a\in\mathbb{Z}$ mod $n\mathcal{O}_K$, $(a,n)=1$. Notice that $\alpha\in\mathcal{O}_{nl}$ iff. it corresponds to the identity of $\mathrm{Gal}(K_{nl}/K_n)$.
Denote by $\mathfrak{a}(\sigma)=\alpha(\sigma)\mathcal{O}_K$ such an ideal corresponding to $\sigma\in\mathrm{Gal}(K_{nl}/K_n)$, and set $\mathfrak{a}_{\sigma}:=\mathfrak{a}({\sigma})\cap\mathcal{O}_{nl}$  the corresponding proper ideal of $\mathcal{O}_{nl}$.
As a consequence, if $\sigma\in\mathrm{Gal}(K_{nl}/K_n)$, then $\mathfrak{a}(\sigma)\cap\mathcal{O}_n=\alpha(\sigma)\mathcal{O}_n$ is principal, thus 
$\mathfrak{a}_{\sigma}\subset\mathcal{O}_{nl}$ satisfies
$$\alpha(\sigma)^{-1}\mathfrak{a}_{\sigma}\subset \mathcal{O}_n.$$
We have 
$$\frac{\mathcal{O}_n}{\alpha(\sigma)^{-1}\mathfrak{a}_{\sigma}}\xrightarrow{\sim}\frac{\mathfrak{a}(\sigma)\cap\mathcal{O}_n}{\mathfrak{a}_{\sigma}}\hookrightarrow \frac{\mathcal{O}_n}{\mathcal{O}_{nl}},$$
the first map being multiplication by $\alpha(\sigma)$.
As $\frac{\mathcal{O}_n}{\mathcal{O}_{nl}}\simeq \mathbb{Z}/l\mathbb{Z}$ and as $\frac{\mathfrak{a}(\sigma)\cap\mathcal{O}_n}{\mathfrak{a}_{\sigma}}$ is non-trivial (if $\sigma$ is not trivial then $\alpha(\sigma$) belongs to $\mathfrak{a}(\sigma)\cap\mathcal{O}_n$ but not to $\mathcal{O}_{nl})$; if $  \sigma$ is trivial then one directly gets $\frac{\mathfrak{a}(\sigma)\cap\mathcal{O}_n}{\mathfrak{a}_{\sigma}}=\frac{\mathcal{O}_{n}}{\mathcal{O}_{nl}})$,
this finally implies that 
$$\frac{\mathcal{O}_n}{\alpha(\sigma)^{-1}\mathfrak{a}_{\sigma}}\simeq \mathbb{Z}/l\mathbb{Z}$$
Combining this with the formula
$$\mathrm{Tr}_{K_{nl}/K_n}(x_{nl})=\sum_{\sigma\in\mathrm{Gal}(K_{nl}/K_n)}[\mathbb{C}/\mathfrak{a}_{\sigma}^{-1}\rightarrow \mathbb{C}/\mathfrak{a}_{\sigma}^{-1}\mathcal{N}_{nl}^{-1}]$$
(see my first post), and the facts that 1- $End(\alpha(\sigma)^{-1}\mathfrak{a}_{\sigma})=End(\mathfrak{a}_{\sigma})=\mathcal{O}_{nl}$, 2- the isomorphism class of an elliptic curve $\mathbb{C}/\Lambda$ is invariant under $\Lambda\mapsto \alpha\Lambda$ and 3- if $\sigma\neq \sigma' $ then $ \mathfrak{a}_{\sigma}$ and $\mathfrak{a}_{\sigma'}$ define different elements in $Pic(\mathcal{O}_{nl})$, one gets that $\mathrm{Tr}_{K_{nl}/K_n}(x_{nl})$ is a sum of $l+1$ distinct elements of the form
$$[\mathbb{C}/\mathfrak{b}\rightarrow \mathbb{C}/\mathfrak{b}(\mathcal{N_n}\cap End(\mathfrak{b}))^{-1}]$$
with $\mathfrak{b}\subset \mathcal{O}_n$ a sub-lattice of index $l$.
This is precisely the equality
$$\mathrm{Tr}_{K_{nl}/K_n}(x_{nl})=T_l(x_n)$$
which I was looking for.
A: 
What I don't understand is why the exactly the same terms should appear in both sums.

The Galois action on CM points is described in adelic terms via the fundamental theorem of complex multiplication (or Shimura's explicit reciprocity law) so identifying the terms appearing in the right-hand side of the equality 
$$\sum_{\sigma\in\mathrm{Gal}(K_{nl}/K_n)}\sigma x_{nl} = T_l x_n$$
boils down to describing the Galois group $\operatorname{Gal}(K_{n\ell}/K_n)$ in these terms, and this in turn is possible because $K_{n\ell}$ and $K_n$ are ring-class fields. 
Specifically, there exist open compact subgroups $Z_{n},Z_{n\ell}$ of $\widehat{\mathcal O}_K^\times$ containing $\widehat{\mathbb Z}^\times$ such that 
$$\operatorname{Gal}(K_{?}/K)\simeq \widehat{K}^\times/K^\times\widehat{\mathbb Q}^\times Z_{?}$$
for $?=n,n\ell$ and in which $\widehat{A}$ denotes $A\otimes_{\mathbb Z}\widehat{\mathbb Z}$ for a $\mathbb Z$-module $A$. This implies that $\operatorname{Gal}(K_{n\ell}/K_{n})$ is very closely related to $Z_{n}/Z_{n\ell}$ (in general, there might be a small kernel to the surjective map $Z_{n}/Z_{n\ell}\rightarrow\operatorname{Gal}(K_{n\ell}/K_{n})$ corresponding to units in $\mathcal O_{K}$) so it remains to describe the quotient $Z_{n}/Z_{n\ell}$.
The payoff of having worked adelically is now that you can analyze this quotient place by place and locally at all places except $\ell$, it will be trivial by construction. At $\ell$, you are considering the quotient of the multiplicative group of an order in a quadratic unramified extension $E$ of $\mathbb Q_{\ell}$ by the multiplicative group of a maximal order. Because $E$ embeds in $M_2(\mathbb Q_{\ell})$, you can realize these multiplicative subgroups of orders as compact subgroups of $\operatorname{GL}_{2}(\mathbb Q_{\ell})$.
Now I think I have done as much as I could without explicitly calculating, so the remaining part has to involve a calculation, which amounts to the fact that conjugating 
$$\begin{pmatrix}a&b\\c&d\end{pmatrix}\textrm{ by }g=\begin{pmatrix}\ell&0\\0&1\end{pmatrix}$$
yields
$$\begin{pmatrix}a&b/\ell\\c\ell&d\end{pmatrix}.$$
It follows that the subgroups $Z_{?}$ localized at $\ell$ can respectively be identified with the unit group of a maximal order $R$ in $M_{2}(\mathbb Q_{\ell})$ (which can be taken to be $M_2(\mathbb Z_{\ell})$) and the unit group of the order $R\cap g^{-1}Rg$. You should already recognize these as the groups appearing in the definition of the  Hecke operator $T(\ell)$ defined adelically but to be complete, we finally find that $Z_{n}/Z_{n\ell}$ is 
$$\frac{(\mathcal O_K/\ell\mathcal O_K)^\times}{(\mathbb Z/\ell\mathbb Z)^{\times}}$$
and so is $\mathrm{Gal}(K_{nl}/K_n)$ (up to a small group of units in general). In particular, the orbit of $x_{n\ell}$ under this Galois group is of cardinal $(\ell^2-1)/(\ell-1)=\ell+1$. The formal sum of points in this orbit is included in the divisor equal to $T(\ell)\cdot x_n$ by definition of $T(\ell)$ (a Hecke operator is the sum over all points on some modular curve mapping to a point on a modular curve below it and all points in the orbit do so) and the cardinality of the orbit and of the set of points in the definition of the Hecke operator are the same so these sets are equal. 
The moral of this story is that quotient of multiplicative group of orders in quadratic unramified extensions of local fields, which describe Galois groups of extensions between ring-class fields, can be described in terms of quotients of multiplicative group of orders by their conjugates in $M_2(E)$, and so are closely linked to Hecke operators. Note also that if what I have written above is correct, and I think it is, then the equality you wanted to understand might not be actually strictly true for all the $\ell$ you considered (because units in $\mathcal O_K$ might introduce a slight discrepancy between the orbit under the Galois group and the formal sum defining the Hecke operator for some small $\ell$). This explains the appearance of the hypothesis $D\neq -1,-3$ in some articles on Heegner points.
