[proofplan]
We compare the characteristic polynomials of the two residual representations on Frobenius elements at all primes outside the exceptional set. The stated congruences give equality of both traces and determinants, hence equality of the full two-dimensional characteristic polynomials on those Frobenius elements. Passing to the finite quotient through which the product representation factors, Chebotarev density promotes this equality from Frobenius conjugacy classes to every element of the finite image. Brauer-Nesbitt then identifies the semisimplifications.
[/proofplan]
custom_env
admin
[step:Package the two residual representations through a finite quotient]Let
\begin{align*}
\bar{\rho}_f := \bar{\rho}_{f,\lambda}: G_{\mathbb{Q}} &\to GL_2(k),\\
\bar{\rho}_g := \bar{\rho}_{g,\lambda}: G_{\mathbb{Q}} &\to GL_2(k)
\end{align*}
denote the two residual representations. Since $k$ is finite, the group $GL_2(k)$ is finite. Hence the product representation
\begin{align*}
\bar{\rho}: G_{\mathbb{Q}} &\to GL_2(k)\times GL_2(k)\\
\sigma &\mapsto \bigl(\bar{\rho}_f(\sigma),\bar{\rho}_g(\sigma)\bigr)
\end{align*}
has finite image. Define
\begin{align*}
H := \operatorname{im}(\bar{\rho}) \subset GL_2(k)\times GL_2(k),
\end{align*}
and let
\begin{align*}
\pi: G_{\mathbb{Q}} &\to H
\end{align*}
be the quotient map induced by $\bar{\rho}$.
For each $h \in H$, write
\begin{align*}
h = (A_h,B_h)
\end{align*}
with $A_h,B_h \in GL_2(k)$. The two representations of $H$ obtained by projection are
\begin{align*}
r_f: H &\to GL_2(k), & h &\mapsto A_h,\\
r_g: H &\to GL_2(k), & h &\mapsto B_h.
\end{align*}
Then
\begin{align*}
\bar{\rho}_f = r_f \circ \pi,
\qquad
\bar{\rho}_g = r_g \circ \pi.
\end{align*}
Thus it is enough to prove that $r_f^{\mathrm{ss}} \cong r_g^{\mathrm{ss}}$ as $k$-representations of the finite group $H$.[/step]
custom_env
admin
[guided]The point of this reduction is to replace the profinite group $G_{\mathbb{Q}}$ by a finite group. The representations take values in $GL_2(k)$, and $k$ is finite, so $GL_2(k)$ is finite. Therefore the simultaneous image of the two representations is a finite group:
\begin{align*}
H := \operatorname{im}\left(G_{\mathbb{Q}} \to GL_2(k)\times GL_2(k)\right).
\end{align*}
We write each element $h \in H$ as $h=(A_h,B_h)$, where $A_h$ is the value of the first residual representation and $B_h$ is the value of the second. Projection onto the first and second factors gives two representations
\begin{align*}
r_f: H &\to GL_2(k), & h &\mapsto A_h,\\
r_g: H &\to GL_2(k), & h &\mapsto B_h.
\end{align*}
The original Galois representations are exactly these finite-group representations pulled back along the quotient map $\pi: G_{\mathbb{Q}}\to H$:
\begin{align*}
\bar{\rho}_f = r_f \circ \pi,
\qquad
\bar{\rho}_g = r_g \circ \pi.
\end{align*}
Consequently, if the semisimplifications of $r_f$ and $r_g$ are isomorphic as representations of $H$, then their pullbacks to $G_{\mathbb{Q}}$ are isomorphic. This reduces the desired statement to a finite-group representation problem.[/guided]
custom_env
admin
[step:Use the Hecke congruences to identify Frobenius characteristic polynomials]Let $p \notin S$ be a rational prime. By hypothesis, both $\bar{\rho}_f$ and $\bar{\rho}_g$ are unramified at $p$, so the conjugacy classes of the arithmetic Frobenius element $\operatorname{Frob}_p \in G_{\mathbb{Q}}$ are defined for both representations.
For residual representations attached to normalized cuspidal newforms, the Frobenius characteristic polynomials at such primes are
\begin{align*}
\det\left(TI_2-\bar{\rho}_f(\operatorname{Frob}_p)\right)
&=
T^2-a_p(f)T+\varepsilon_f(p)p^{\kappa_f-1},\\
\det\left(TI_2-\bar{\rho}_g(\operatorname{Frob}_p)\right)
&=
T^2-a_p(g)T+\varepsilon_g(p)p^{\kappa_g-1}
\end{align*}
in $k[T]$. The two assumed congruences therefore give
\begin{align*}
\det\left(TI_2-\bar{\rho}_f(\operatorname{Frob}_p)\right)
=
\det\left(TI_2-\bar{\rho}_g(\operatorname{Frob}_p)\right)
\end{align*}
in $k[T]$ for every prime $p \notin S$.[/step]
custom_env
admin
[guided]For a two-dimensional representation, the characteristic polynomial is determined by trace and determinant:
\begin{align*}
\det(TI_2-A)=T^2-\operatorname{tr}(A)T+\det(A)
\end{align*}
for every matrix $A \in GL_2(k)$. For the residual representation attached to a normalized cuspidal newform, the standard compatibility with Hecke eigenvalues says that at every prime $p$ where the representation is unramified,
\begin{align*}
\operatorname{tr}\bigl(\bar{\rho}_f(\operatorname{Frob}_p)\bigr)&=a_p(f),\\
\det\bigl(\bar{\rho}_f(\operatorname{Frob}_p)\bigr)&=\varepsilon_f(p)p^{\kappa_f-1}
\end{align*}
in the residue field $k$, and similarly for $g$.
The set $S$ was chosen to contain $\ell$ and all primes dividing the levels, and the theorem additionally assumes unramifiedness outside $S$. Thus $\operatorname{Frob}_p$ is legitimate for both residual representations whenever $p \notin S$. The congruences
\begin{align*}
a_p(f) &\equiv a_p(g) \quad \text{in } k,\\
\varepsilon_f(p)p^{\kappa_f-1} &\equiv \varepsilon_g(p)p^{\kappa_g-1} \quad \text{in } k
\end{align*}
give equality of traces and determinants, hence equality of the full characteristic polynomials:
\begin{align*}
\det\left(TI_2-\bar{\rho}_f(\operatorname{Frob}_p)\right)
=
\det\left(TI_2-\bar{\rho}_g(\operatorname{Frob}_p)\right)
\end{align*}
in $k[T]$.[/guided]
custom_env
admin
[step:Promote Frobenius equality to equality on the finite image]Let $K$ be the finite Galois extension of $\mathbb{Q}$ fixed by $\ker(\pi)$. Then
\begin{align*}
\operatorname{Gal}(K/\mathbb{Q}) \cong H.
\end{align*}
For every $p \notin S$ unramified in $K$, the image $\pi(\operatorname{Frob}_p)$ is the Frobenius conjugacy class of $p$ in $H$.
By the Chebotarev density theorem for the finite Galois extension $K/\mathbb{Q}$ (citing a result not yet in the wiki: Chebotarev Density Theorem), every conjugacy class of $H$ contains $\pi(\operatorname{Frob}_p)$ for some rational prime $p \notin S$. Since characteristic polynomials are constant on conjugacy classes, the equality obtained for all primes outside $S$ implies
\begin{align*}
\det(TI_2-r_f(h))=\det(TI_2-r_g(h))
\end{align*}
in $k[T]$ for every $h \in H$.[/step]
custom_env
admin
[guided]We now explain why checking Frobenius elements at almost all primes is enough. The quotient map
\begin{align*}
\pi: G_{\mathbb{Q}} \to H
\end{align*}
has finite image, so its kernel fixes a finite Galois extension $K/\mathbb{Q}$. The [Galois group](/page/Galois%20Group) $\operatorname{Gal}(K/\mathbb{Q})$ is naturally identified with $H$.
Chebotarev density says that, in a finite Galois extension, Frobenius conjugacy classes are distributed through every conjugacy class of the Galois group. More precisely, for every conjugacy class $C \subset H$, there exists a rational prime $p$ unramified in $K$ such that
\begin{align*}
\pi(\operatorname{Frob}_p) \in C.
\end{align*}
Because $S$ is finite, we may choose such a prime outside $S$.
For that prime, the previous step gives equality of characteristic polynomials:
\begin{align*}
\det\left(TI_2-\bar{\rho}_f(\operatorname{Frob}_p)\right)
=
\det\left(TI_2-\bar{\rho}_g(\operatorname{Frob}_p)\right).
\end{align*}
Using $\bar{\rho}_f=r_f\circ \pi$ and $\bar{\rho}_g=r_g\circ \pi$, this becomes
\begin{align*}
\det\left(TI_2-r_f(\pi(\operatorname{Frob}_p))\right)
=
\det\left(TI_2-r_g(\pi(\operatorname{Frob}_p))\right).
\end{align*}
Characteristic polynomials are invariant under conjugation of matrices, so this equality holds for every element in the same conjugacy class of $H$. Since every conjugacy class is reached by such a Frobenius element, we obtain
\begin{align*}
\det(TI_2-r_f(h))=\det(TI_2-r_g(h))
\end{align*}
for every $h \in H$.[/guided]
custom_env
admin
[step:Apply Brauer-Nesbitt to identify the semisimplifications]The representations
\begin{align*}
r_f: H &\to GL_2(k),\\
r_g: H &\to GL_2(k)
\end{align*}
are finite-dimensional representations of the finite group $H$ over the field $k$. The previous step shows that $r_f(h)$ and $r_g(h)$ have the same characteristic polynomial for every $h \in H$. By the Brauer-Nesbitt theorem for finite-dimensional representations of finite groups over a field (citing a result not yet in the wiki: Brauer-Nesbitt Theorem), their semisimplifications are isomorphic:
\begin{align*}
r_f^{\mathrm{ss}} \cong r_g^{\mathrm{ss}}.
\end{align*}
Pulling this isomorphism back along $\pi: G_{\mathbb{Q}}\to H$ gives
\begin{align*}
\bar{\rho}_f^{\mathrm{ss}}
=
(r_f\circ \pi)^{\mathrm{ss}}
\cong
(r_g\circ \pi)^{\mathrm{ss}}
=
\bar{\rho}_g^{\mathrm{ss}}.
\end{align*}
This is the desired isomorphism.[/step]
custom_env
admin
[guided]At this point the problem is purely representation-theoretic. We have two representations
\begin{align*}
r_f,r_g: H \to GL_2(k)
\end{align*}
of the same finite group $H$ over the same field $k$, and we have proved that for every $h \in H$,
\begin{align*}
\det(TI_2-r_f(h))=\det(TI_2-r_g(h)).
\end{align*}
Brauer-Nesbitt states that finite-dimensional representations of a finite group over a field are determined up to semisimplification by their characteristic polynomials on all group elements. Its hypotheses are satisfied here: $H$ is finite, $k$ is a field, and $r_f$ and $r_g$ are finite-dimensional $k$-linear representations. Therefore
\begin{align*}
r_f^{\mathrm{ss}} \cong r_g^{\mathrm{ss}}.
\end{align*}
Finally, the original residual Galois representations are pullbacks of $r_f$ and $r_g$ along $\pi$:
\begin{align*}
\bar{\rho}_f=r_f\circ\pi,
\qquad
\bar{\rho}_g=r_g\circ\pi.
\end{align*}
Pullback preserves direct sums, irreducible constituents, and hence semisimplification. Thus the isomorphism of semisimplifications over $H$ pulls back to an isomorphism over $G_{\mathbb{Q}}$:
\begin{align*}
\bar{\rho}_{f,\lambda}^{\mathrm{ss}}
\cong
\bar{\rho}_{g,\lambda}^{\mathrm{ss}}.
\end{align*}
This completes the proof.[/guided]