Is there an example that a theorem in number theory is useful in another field in mathematics?
I know there are two advanced approaches to number theory. That is, algebraic number theory and analytic number theory. I have heard that algebraic geometry, which generally seems completely different from number theory, is now known to be a very strong tool to attack number theory.
But what about converse?
Is there any other fields in mathematics in which number theory makes them easier? Is there any theorem in number theory which is helpful to other fields in mathematics?
I'm going to pick two of my favorites (and might add more later). I'm going to assume that you don't want an example such as cryptography due to (a) it being the one that's always given and (b) being too applied.
Example 1: Ring Theory
One (rather cheap) answer is that number theory has many applications in ring theory (and, indeed, is in many ways originally responsible for its study). So here we see that already that number theory ...
- Motivates the definition of an ideal.
- Provides a wealth of examples and counterexamples of rings that are easy to play with and yet exhibit exotic properties (e.g., non-UFD rings back in the day).
We could talk at length about the interplay between ring theory and number theory, but let me give you a relatively-unknown but beautiful connection. Define the space of integer-valued polynomials $R = \text{Int}(\mathbb{Z})$ to be the set of all polynomials $f(x) \in \mathbb{Q}[x]$ for which $f(\mathbb{Z}) \subseteq \mathbb{Z}$. This is a ring, and it's in fact an infinite dimensional $\mathbb{Z}$-module with basis
$$ \left\{\binom{x}{n} = \frac{x(x-1)\cdots (x-n+1)}{n!} \mid n = 0,1,2,\ldots \right\}. $$
This is a very interesting ring that has connections to algebraic $K$-theory and is arguably among the most accessible and nicest examples of a Prüfer domain, which is essentially what you get when you take a Dedekind ring and relax the assumption that all ideals are finitely generated.
So what does this have to do with number theory? Well apart from the obvious answer that it has to do with polynomials over a number field (and hence many of the properties of $\text{Int}(\mathbb{Z})$ are established number theoretically), a connection comes from the ideal structure of $R$. The integer-valued polynomials form a height two ring, with ideals falling into two distinct categories. First, there are ideals of the form $f(x)\mathbb{Q}[x] \cap \text{Int}(\mathbb{Z})$ for each irreducible $f(x) \in \mathbb{Q}[x]$. Each of these is of height one, lying above $(0)$. These are as interesting in this discussion.
The other, more relevant type of prime ideals are in two layers. The remaining height one prime ideals in $R$ are exactly those of the form $(p)$ for some prime $p$. Now for a fixed prime $p$, what are the height $2$ ideals lying over $(p)$? As it turns out, these are parametrized by the elements of the $p$-adic integers $\mathbb{Z}_p$. Specifically, for each prime $p$ and each $\alpha \in \mathbb{Z}_p$ the set
$$ \mathfrak{M}_{p,\alpha} = \{f(x) \in \text{Int}(\mathbb{Z}) \mid f(\alpha) \in p\mathbb{Z}_p\} $$
is a maximal ideal in $\text{Int}(\mathbb{Z})$ lying over $p$. (It's also not finitely generated!) This characterization is really only possible thanks to our pre-existing understanding of the $p$-adic completions of $\mathbb{Q}$ and their properties.
It's also worth noting that this ring and its brethren are still very much a subject of intense study in ring theory with many interesting questions about their structure still unanswered.
Example 2: Moonshine As a second example that's even farther afield, consider monstrous moonshine. This started with the observation that the Fourier coefficients of the $j$-function (a function of great importance in the study of modular forms within analytic number theory) are expressible as linear combinations of the dimensions of the irreducible representations of the monster group (the largest of the $26$ sporadic groups). This came as a huge surprise to everyone involved in its discovery, since there was no reason to expect a connection between these two objects at the time. In fact, the current proofs we have of the connection have yet to really shed light on why the $j$-function and $\mathbb{M}$ should be connected in this way.
While it's beyond the scope of your question to get into the details, our current understanding of moonshine establishes connections between the representations of the monster (from group theory), automorphic forms (from analytic number theory), and (of all things) physics (specifically conformal field theories).
Number theory is important in topology, specifically in arithmetic manifolds (the Wikipedia page is small but many people study this). The idea is that you can get manifolds from different number fields.
In fact, number theory seems to pop up a lot in hyperbolic geometry. The modular group acts on hyperbolic space by isometries, so its quotient has a hyperbolic metric.
Number theory is also important in representation theory as characters always have algebraic values (I think they are even algebraic integers). This means that symmetry groups such as those studied in physics and chemistry are affected by number theory.
Number theory is useful in logic. For example, in computability theory Gödel's $\beta$-function is used to show that quantifying over finite sequences is an arithmetic operation. The proof that the $\beta$-function works requires the Chinese remainder theorem. Another example is showing that $\mathbb{N}$ is definable in $(\mathbb{Z},+,\cdot)$ using Lagrange's four-square theorem. The fundamental theorem of arithmetic is heavily assumed in coding formal sentences.