Solution
= Solution
For a connected smooth <Riemannian manifold> $(M,g)$ without boundary, let $I(M)$ be the group of all global <diffeomorphisms> $f$ with $f^*g=g$, endowed with its <compact-open topology>. Equivalently these maps preserve the intrinsic distance; the <Myers-Steenrod theorem> supplies smoothness of distance-preserving bijections and makes $I(M)$ a finite-dimensional <Lie group> acting smoothly. The group is metric-dependent: a topological manifold can carry a very symmetric metric or one with no continuous symmetries. Connectedness matters here. With infinitely many identical disconnected components, permutations of those components can produce a group which is not a finite-dimensional <Lie group>.
An <isometry> is determined by its value and derivative at one point. To prove this, suppose $f(p)=p$ and $df_p=I$. Preservation of the <Levi-Civita connection> gives
$$
f(\exp_p v)=\exp_p(df_pv)=\exp_pv
$$
where the <exponential map> is defined locally. Thus $f$ is the identity in a normal neighborhood of $p$. The set where its value and derivative agree with the identity is both closed and, by the same argument, open. Connectedness makes it all of $M$. No completeness is needed for this determination argument.
The stabilizer $I(M)_p$ consequently acts faithfully and orthogonally on $T_pM$, so embeds in $O(n)$. More generally an <isometry> takes a chosen <orthonormal frame> at $p$ to one at its image point, providing an injective map into the <orthonormal frame bundle>. It is a smooth embedding, and the full <isometry> action is proper. The orbit-stabilizer dimension formula therefore gives
$$
\boxed{\dim I(M)\leq n+\frac{n(n-1)}2=\frac{n(n+1)}2.}
$$
Isotropy is compact. If $M$ is compact then $I(M)$ itself is compact, by the same frame description or Arzela-Ascoli applied to <isometries> and their inverses. Properness also means that the quotient by <isometries> has well-controlled local orbit structure, even though orbit dimensions may vary.
The infinitesimal equation is the <Killing equation>. Differentiating $f_t^*g=g$ at zero gives
$$
\mathcal L_Xg=0,\qquad \nabla_iX_j+\nabla_jX_i=0.
$$
Conversely a vector field satisfying this equation has local flows preserving the metric. A global one-parameter subgroup requires the field to be complete. On a geodesically complete manifold every <Killing field> is complete: its length is constant along each of its own trajectories, so a finite-time trajectory has bounded speed and stays in a closed bounded ball. The <Hopf-Rinow theorem> makes that ball compact, and the <ordinary differential equation> can then be continued. The caveat is real: on the Euclidean interval $(0,1)$, the field $\partial_x$ is Killing but its translations are not globally defined for all time. This illustrates <Killing fields on incomplete manifolds need not generate global isometries>.
The <Killing transport> identities determine a <Killing field> from $X(p)$ and the skew-adjoint map $(\nabla X)_p$. Along a <geodesic> the field is a <Jacobi field>, so uniqueness for its second-order <differential equation> propagates these <initial data>. They have $n+n(n-1)/2$ components, reproducing the dimension bound infinitesimally. The important distinction on an incomplete manifold is between all local Killing solutions and the <Lie algebra> of complete global <isometry> flows.
In dimension three the bound is six, and rotational isotropy gives stronger information. The <Lie subalgebras> of $\mathfrak{so}(3)$ have dimensions zero, one or three: identifying the bracket with the cross product, a two-plane is not closed under brackets. Suppose $\dim I(M)=5$. Since an orbit has dimension at most three, its stabilizer would have dimension at least two, and hence exactly three. Its connected isotropy acts as all of $SO(3)$ on the tangent space. But the orbit tangent space is invariant under that action and would have dimension $5-3=2$, impossible because the standard rotational representation is irreducible. Therefore \b[dimension five cannot occur].
If the dimension is six, each orbit has dimension three and each stabilizer dimension three. All orbits are open, so connectedness makes the action transitive. At each point the isotropy is transitive on tangent two-planes, forcing <sectional curvature> to be independent of the plane; transitivity makes its value independent of the point. Thus a maximally symmetric connected <three-manifold> has <constant sectional curvature>. Homogeneous <Riemannian manifolds> are complete, so its <simply connected> cover is the round sphere, <Euclidean space> or <hyperbolic space> after normalization. Conversely these three <simply connected> metrics attain dimension six:
$$
I(S^3)=O(4),\qquad I(\mathbb R^3)=\mathbb R^3\rtimes O(3),\qquad
I(\mathbb H^3)=O^+(3,1).
$$
Here $O^+(3,1)$ preserves the chosen sheet of the hyperboloid; it includes orientation-reversing hyperbolic <isometries>. Constant curvature alone does not imply that a quotient retains six-dimensional global symmetry.
Dimension four likewise forces transitivity: stabilizer dimension three would give a one-dimensional invariant orbit tangent space, again impossible for full rotational isotropy. The stabilizer thus has dimension one and the orbits are three-dimensional. Typical four-dimensional <isometry groups> occur for $S^2\times\mathbb R$ and $\mathbb H^2\times\mathbb R$, where the factor groups have dimensions three and one. The usual Nil metric has three translation symmetries and one rotational isotropy symmetry. In centred Heisenberg coordinates it is
$$
g=dx^2+dy^2+\bigl(dt+\tfrac12(y\,dx-x\,dy)\bigr)^2,
$$
which exhibits the horizontal rotations. Its distinct vertical and horizontal Ricci eigenvalues bound continuous isotropy by that rotation group, so its full <isometry> dimension is four. Standard metrics on $\widetilde{SL_2(\mathbb R)}$ and nonround Berger spheres also have dimension four. The standard Sol geometry has a three-dimensional translation group and only finite isotropy, giving dimension three. These examples show how a preferred vertical direction reduces rotational symmetry.
The <isometry dimensions in dimension three> are precisely $0,1,2,3,4,6$, all realizable. A compact <hyperbolic three-manifold> gives zero; the product of a circle and a closed hyperbolic surface gives one. For dimension two take $T^2\times(0,1)$ with
$$
g=dt^2+e^{2t}\,dx^2+e^{4t}\,dy^2.
$$
Its <scalar curvature> is the constant $-14$, but its Ricci eigenvalues are the distinct constants $-3,-6,-5$ in the two horizontal directions and the vertical direction. Hence connected isotropy is trivial and possible <isometries> preserve these line distributions. A local <isometry> preserving them has $t'=t+c$ and would require constant dilations $e^{-c}$ and $e^{-2c}$ of the two circle coordinates. A global circle <diffeomorphism> with such a constant dilation has degree $\pm1$, forcing $c=0$. The identity component is therefore exactly the two circle translations. A flat three-torus gives dimension three; $S^2\times\mathbb R$ gives four; a <simply connected> constant-curvature model gives six. This construction distinguishes local homogeneity from the smaller global <isometry group>.
For quotients, let a complete <simply connected> <Riemannian manifold> $X$ cover $M=X/\Gamma$. Every <isometry> of $M$ lifts to an <isometry> of $X$ which normalizes the <deck transformation group>. Conversely, every normalizing <isometry> descends. Two lifts differ by a <deck transformation>, giving the <isometry group of a Riemannian quotient> formula
$$
\boxed{I(X/\Gamma)=N_{I(X)}(\Gamma)/\Gamma.}
$$
Thus one should not replace the <isometry group> of a quotient by that of its model geometry. For a <flat torus>, for example,
$$
I(\mathbb R^3/\Lambda)=(\mathbb R^3/\Lambda)\rtimes\{R\in O(3):R\Lambda=\Lambda\}.
$$
The second factor is finite, whereas translations give the three-dimensional identity component.
There is a useful curvature test for <compact manifolds>. Contracting and differentiating the <Killing equation> gives $\nabla^*\nabla X=\operatorname{Ric}(X)$, with the nonnegative rough-Laplacian convention. Integration yields the <integrated Bochner identity for Killing fields>
$$
\int_M|\nabla X|^2\,dV=\int_M\operatorname{Ric}(X,X)\,dV.
$$
If <Ricci curvature> is negative definite, no nonzero <Killing field> exists. The compact <isometry group> then has dimension zero and is finite. This explains why closed hyperbolic manifolds have finite global symmetry, despite the six-dimensional <isometry group> of their <universal cover>. Compactness is essential to this conclusion.
For a compact <flat Riemannian manifold>, the same identity makes every <Killing field> parallel. Parallel fields are exactly the vectors fixed by linear holonomy. Therefore
$$
\boxed{\dim I(M)_0=\dim(\mathbb R^3)^{\operatorname{Hol}(M)}.}
$$
Applied to the six flat types of Question 1, this gives dimensions three for the <torus>, one for each of the four nontrivial cyclic types, and zero for the <Hantzsche-Wendt manifold>. These are identity-component dimensions; disconnected finite symmetries can still be present. Local curvature symmetry, global deck-group constraints, and completeness thus play different roles in determining the <isometry group>.