Topology on the hom space between profinite groups $\DeclareMathOperator\Hom{Hom}$Let $G,H$ be profinite groups. Let $\Hom(G,H)$ be the set of continuous group homomorphisms, equipped with the compact-open topology. I'd like to understand the topological characteristics of this space.
I'm particularly interested in the case where $G$ is (topologically) finitely generated. In this case is $\Hom(G,H)$ profinite? Certainly if $g_1,\ldots,g_r$ are generators for $G$, then restriction defines a continuous injection with closed image $\Hom(G,H)\subset C(\{g_1,\ldots,g_r\},H)\cong H^r$, where $C(X,Y)$ denotes the space of continuous functions, but it's unclear to me if the topology on $\Hom(G,H)$ agrees with the subspace topology.
If $G$ is not finitely generated, is $\Hom(G,H)$ at least locally compact?
References would also be appreciated! My go-to reference for profinite groups (Ribes-Zalesskii) does not seem to discuss this.
 A: As Benjamin Steinberg mentioned in the comments, his paper On the endomorphism monoid of a profinite semigroup describes the analogous question for $End(G)$ where $G$ is a profinite semigroup.
His argument also shows that if $G,H$ are profinite with $G$ finitely generated, then $Hom(G,H)$ is a profinite space. For completeness's sake, below I have translated Benjamin Steinberg's argument into our setting.
His argument uses a form of Ascoli's theorem for uniform spaces:
Theorem (Ascoli). Let $X,Y$ be compact Hausdorff spaces equipped with their unique uniform structures (which are compatible with their topology) and let $C(X,Y)$ denote the space of continuous maps from $X$ to $Y$ equipped with the compact-open topology. Then for a family $F\subset C(X,Y)$, $F$ is compact (when given the induced topology) if and only if $F$ is closed and uniformly equicontinuous.
Here, recall that a subset $F\subset C(X,Y)$ is uniformly equicontinuous if for any entourage $E\subset Y\times Y$, $\bigcap_{f\in F}(f\times f)^{-1}(E)$ (a subset of $X\times X$) is an entourage for $X$.
Step 1 - $Hom(G,H)$ is closed inside $C(G,H)$
Let $f : G\rightarrow H$ be continuous but not a homomorphism. Then for some $g,g'\in G$, $f(gg')\ne f(g)f(g')$. Choose disjoint open neighborhoods $U,V$ of $f(gg')$ and $f(g)f(g')$ respectively. By continuity of multiplication we can find open neighborhoods $W$ of $f(g)$ and $W'$ of $f(g')$ such that $W\cdot W'\subset V$. Then let $\Phi\subset C(G,H)$ be the subset consisting of continuous functions $\phi : G\rightarrow H$ w/ $\phi(gg')\in U$, $\phi(g)\in W$, $\phi(g')\in W'$ - in particular $\phi$ is not a homomorphism. On the other hand $\Phi$ is visibly open in $C(G,H)$ and contains $f$. Since this holds for every continuous non-homomorphism, $Hom(G,H)$ is closed.
Step 2 - $Hom(G,H)\subset C(G,H)$ is uniformly equicontinuous
For an open neighborhood $U\ni 1_G$, let $E_U := \{(x,y)\in G\times G\;|\; xy^{-1}\in U\}$. Note that $E_{U\cap U'} = E_U\cap E_{U'}$. Recall that the uniform structure on $G$ is given by: A subset $E\subset G\times G$ is an entourage if and only if $E\supset E_U$ for some open neighborhood $U\ni 1_G$ (and similarly for $H$). We wish to show that for any entourage $E\subset H\times H$,
$$\bigcap_{f\in Hom(G,H)}(f\times f)^{-1}(E)$$
is an entourage (equivalently, contains an entourage) for $G$. Since $1_H\in H$ admits a neighborhood basis consisting of open normal subgroups and the set of entourages form a filter, it suffices to check this for $E = E_N$ where $N\le H$ is an open normal subgroup. In this case it is easy to check that $(f\times f)^{-1}(E_N) = E_{f^{-1}(N)}$, so it suffices to show that $\bigcap_{f\in Hom(G,H)} E_{f^{-1}(N)}$ contains an entourage of $G$. Indeed, $[G:f^{-1}(N)]\le [H:N]$, and since $G$ is finitely generated there are only finitely many open subgroups of index $\le [H:N]$ (this is Proposition 2.5.1 in Ribes-Zalesskii). Let $M$ denote their intersection, so $M\le G$ is also open. Thus we have
$$\bigcap_{f\in Hom(G,H)} E_{f^{-1}(N)}\supset \bigcap_{U\le_o G, [G:U]\le[H:N]} E_U = E_M$$
as desired.
Step 3 - $Hom(G,H)$ is compact
Thus $Hom(G,H)\subset C(X,Y)$ is closed and uniformly equicontinuous, so by the Ascoli theorem we find that $Hom(G,H)$ is compact. Let $H^G := \prod_{g\in G}H$ with the product topology, so $H^G$ is a compact Hausdorff and totally disconnected space. Let $i : Hom(G,H)\rightarrow H^G$ be the injection $f\mapsto (f(g))_{g\in G}$, then $i$ is clearly continuous, but since the source is compact and the target is Hausdorff $i$ is a homeomorphism onto its image. In particular, $Hom(G,H)$ is compact, Hausdorff, and totally disconnected (i.e., profinite).
A: My contribution may not answer your question as it concentrates on the case of automorphisms of a profinite group, rather than all homomorphisms, but there is the earlier book by Shatz (Profinite groups, Arithmetic and Geometry, number 67 in Ann. Math. Studies, Princeton U.P.) which may contain useful material, (I do not have a copy with me, so cannot check) and for a related question on the automorphism groups of finitely generated profinite groups, perhaps the references:

*

*M. Anderson, Exactness properties of profinite completion functors, Topology, 13, (1974), 229–239

and

*

*J. Smith, On products of profinite groups, Ill. J. Math., 13, (1969), 680–688

may help, but it is a long time since I looked at them in detail.
I have checked also in

*

*J. Dixon, M. du Sautoy, A. Mann and D. Segal, 1999, Analytic pro-p groups, volume 61 of Cambridge Studies in Advanced Mathematics, Cambridge Univ. Press

where again the automorphism group case is discussed (p.89 section 5.2).
Unfortunately I have not found the more general case of $\operatorname{Hom}(G,H)$.
A good question would be to extend from that to the topological groupoid $H^G$ of continuous ‘functors and natural transformations’ from $G$ to $H$, thinking of groups as groupoids with a single object.  (Again I remember seeing something on this but cannot put my finger on a reference.  Sorry for that.)
