Naming symmetries in quantum systems, e.g. $\mathbb{Z}_2$ or $U(1)$ I'm constantly confused by some of nomenclature that is associated with symmetries in quantum Hamiltonians and was hoping someone could set me straight.
Specifically, we often have something like a quantum transverse Ising model with
$$
H = \sum_i Z_i Z_{i+1} + \sum_i X_i
$$
where $Z_i$ is the Pauli $Z$ operator on spin (or qubit) $i$ and $X_i$ is the Pauli $X$ operator.  
It has been explained to me that Hamiltonians like this can be said to have a discrete $\mathbb{Z}_2$ symmetry, as the Hamiltonian commutes with the symmetry operator $S=\prod_i X_i$, which has two distinct eigenvalues (hence $\mathbb{Z}_2$).  However, from the properties of commutation, it would then also commute with $\exp(-i \phi S)$ for arbitrary real $\phi$, so it feels like it also has a $U(1)$ symmetry.  However, I've never heard it characterized this way, so I wonder if I'm wrong, or there is some choice preferring referencing the discrete $\mathbb{Z}_2$ symmetry over the $U(1)$ symmetry.
Along a similar vein, for fermionic problems that conserve the number of particles, for example something with the Hamiltonian
$$
H = \sum_{ij} h_{ij} a_i^\dagger a_j
$$
for Hermitian, real $h$, it commutes with the number operator $N=\sum_i a_i^\dagger a_i$.  I often hear the number symmetry referred to as a $U(1)$ symmetry, due to being able to map the Hamiltonian with the transformation $e^{-i \phi N}$ for arbitrary $\phi$, however it seems to me it also has a discrete symmetry corresponding to all the possible integer occupations, or $\mathbb{Z}$.
So I guess my question is boiled down to, why do we use $\mathbb{Z}_2$ for the symmetry in the ising model (instead of $U(1)$), and $U(1)$ for the fermionic number symmetry (instead of $\mathbb{Z}$).
Any clarification would be greatly appreciated!
 A: For a transformation to belong to a group of symmetries, it must at least:


*

*be invertible,

*leave the Hamiltonian invariant. 
These aren't sufficient conditions, but they are necessary conditions, and they're strong enough conditions to answer the question that's being asked here.
(We can also consider spacetime symmetries, like boosts, that don't leave the Hamiltonian invariant, but that isn't needed for addressing the examples shown in the OP.)
 First example 
First consider the example
$$
 H = \sum_i Z_i Z_{i+1} + \sum_i X_i,
$$
and define $S=\prod_i X_i$ as in the OP.


*

*The operator $S=S^{-1}$ is unitary, hence invertible. Since $S^2=1$, the operators $\{1,S\}$ constitute a unitary representation of the group $\mathbb{Z}_2$. The operator $S$ satisfies $SZ_iS^{-1}=-Z_i$ and $S X_iS^{-1}=X_i$ for all $i$, so both members of the group $\{1,S\}$ leave the Hamiltonian invariant. 

*The operator $U(\phi) := \exp(i\phi S)$ is also unitary for any given real number $\phi$, and this collection of unitary operators constitutes a unitary representation of the group $U(1)$, as noted in the OP. However, for most values of $\phi$, these transformations don't leave the Hamiltonian invariant, because $U(\phi)Z_i U^{-1}(\phi)=U(2\phi)Z_i$. 
 Second example 
Now consider the example
$$
H = \sum_{ij} h_{ij} a_i^\dagger a_j,
$$
and define $N=\sum_i a_i^\dagger a_i$ as in the OP.


*

*The spectrum of the operator $N$ is $\{0,1,2,...\}$. This operator is not invertible, because multiplication by zero is not invertible. 

*The transformation $U(\phi) :=\exp(i\phi N)$ is unitary for any real number $\phi$, and these transformations constitute a unitary representation of the group $U(1)$. Since $N$ commutes with the Hamiltonian, these unitary transformations all leave the Hamiltonian invariant.
A: (There is a bit of ranting here which I decided to include since I believe it can benefit the OP and provide context to his confusion)
Having worked with symmetries in physics for a while I believe your confusion is absolutely justified. It seems to me there is a (bad) habit in physics of referring to concrete symmetry operations acting on concrete systems by using the name of the abstract symmetry group without referring to representation. Not sure where this habit is coming from but I suspect  High Energy physicists are to blame ;). 
Example: you have a system of 2 spin-$\frac{1}{2}$ particles and a collective Hamiltonian $H_{12}$ that has a $SU(2)$ symmetry. Whether the symmetry transformations act only on particle 1 or 2 or it is the collective rotation of the two particles (or any other representation) is completely ambiguous from the statement that the symmetry of $H_{12}$ 
 is $SU(2)$.  
To be fair, it is often implied from the context how the symmetry is supposed to be represented. Even so, I believe this ambiguity creates confusion and we need to be more mindful of the fact that by only specifying the abstract group without specifying its representation in the physical system we render it meaningless for everyone who is not very familiar with the particular system and its symmetries. 
If someone does not agree or I am missing something or the above view is completely unjustified, please let me know here; I'd be happy to learn something new on the subject.
