Endomorphisms of a direct sum of Lie groups Let $G = \mathbb{T}^n \oplus A = \mathbb{T}^n \times A$, where $\mathbb{T}^n = \left( \mathbb{R} / \mathbb{Z} \right)^n$ and $A$ is a finite discrete abelian group. I'm trying to characterize $\operatorname{End}(G)$.
I know that $\operatorname{End} \left( \mathbb{T}^n \right) = \operatorname{Mat}(n, \mathbb{Z})$. I also know that if $T \in \operatorname{End}(G)$, then $T \left( \mathbb{T}^n \right) \subseteq \mathbb{T}^n$, since $\mathbb{T}^n$ is the identity component of $G$. However, we can't necessarily say that $T(A) \subseteq A$. Is there any kind of nice structure theorem for this?
Thanks!
 A: If $A$ and $B$ are objects in any category with finite biproducts, which includes the category of abelian Lie groups, as well as the ordinary category of abelian groups, then the endomorphism ring of $A \oplus B$ can be written
$$\text{End}(A \oplus B) \cong \left[ \begin{array}{cc} \text{End}(A) & \text{Hom}(B, A) \\ \text{Hom}(A, B) & \text{End}(B) \end{array} \right].$$
This notation refers to matrices acting on "vectors" in $\left[ \begin{array}{c} A \\ B \end{array} \right]$ in such a way that every multiplication operation refers to an evaluation homomorphism, and similarly matrices multiply in such a way that every multiplication operation refers to a composition. Addition refers to the canonical commutative monoid structure on the homsets of any category with finite biproducts (which for abelian Lie groups and abelian groups is pointwise addition). See the "matrix multiplication" section of A meditation on semiadditive categories for more details on how finite biproducts let you do this.
A direct sum of the form $\mathbb{T}^n \oplus A$ where $A$ is finite has the additional property that $\text{Hom}(\mathbb{T}^n, A) = 0$ because $\mathbb{T}^n$ is divisible. So the above simplifies to the upper triangular form
$$\text{End}(\mathbb{T}^n \oplus A) \cong \left[ \begin{array}{cc} M_n(\mathbb{Z}) & \text{Hom}(A, \mathbb{T}^n) \cong (A^{\ast})^n \\ 0 & \text{End}(A) \end{array} \right].$$
Here $A^{\ast} \cong \text{Hom}(A, \mathbb{T})$ is the Pontryagin dual of $A$. Concretely what this says is that an endomorphism of $\mathbb{T}^n \oplus A$ takes the form
$$\mathbb{T}^n \oplus A \ni (t, a) \mapsto (f(t) + g(a), h(a)) \in \mathbb{T}^n \oplus A$$
where $f : \mathbb{T}^n \to \mathbb{T}^n$ is an endomorphism, $g : A \to \mathbb{T}^n$ is a homomorphism, and $h : A \to A$ is an endomorphism. One of the nice things about writing this in matrix form is it's immediately clear what the automorphisms are: an upper-triangular matrix is invertible iff its diagonal entries are and this property continues to hold for block matrices like the above.
