I am studying time dependent perturbation theory.
Context
We introduce a Hamiltonian: $$H(t)=H_{0}+\Delta(t)$$
We also say that: let $\{|n\rangle\}$ be an orthonormal basis of $\mathcal{H}$ with $H_{0}|n\rangle=E_{n}|n\rangle$ and expand a general state as $$ |\psi(t)\rangle=\sum_{n} \mathrm{e}^{-\mathrm{i} E_{n} t / \hbar} a_{n}(t)|n\rangle $$ Using this expansion in the time dependent Schrödinger equation $\mathrm{i} \hbar \partial|\psi\rangle / \partial t=H(t)|\psi(t)\rangle$ gives $$ \sum_{n}\left(a_{n} E_{n}+\mathrm{i} \hbar \dot{a}_{n}\right) \mathrm{e}^{-\mathrm{i} E_{n} t / \hbar}|n\rangle=\sum_{n} a_{n}\left(E_{n}+\Delta(t)\right) \mathrm{e}^{-\mathrm{i} E_{n} t / \hbar}|n\rangle \tag{1} $$ Contract with $\langle k|$ to obtain $$ \mathrm{i} \hbar \dot{a}_{k}(t)=\sum_{n} a_{n}(t) \mathrm{e}^{\mathrm{i}\left(E_{k}-E_{n}\right) t / \hbar}\langle k|\Delta(t)| n\rangle \tag{2} $$
Question
Why couldn't I cross out the exponential terms on both sides of equation $(1)$? They are the same multiplicative factor corresponding to each term in the sum. However, if I did that, I wouldn't have left any exponential for line $(2)$.
I do understand how we reached line $(2)$, if we don't simplify the first line by dropping the $\mathrm{e}^{-\mathrm{i} E_{n} t / \hbar}$ terms.
Why cannot I drop the $\mathrm{e}^{-\mathrm{i} E_{n} t / \hbar}$ terms in line $(1)$?
Maybe some example where I am also not allowed to drop the same multiplicative terms from both sides of an equation would help my understanding.
A parallel question, much simpler, would be given real sequences $a_n$, $b_n$, and $c_n$, can we cancel out $c_n$ to get
$$ \sum_{n=1}^N a_n c_n = \sum_{n=1}^N b_n c_n \implies \sum_{n=1}^N a_n = \sum_{n=1}^N b_n? $$
No, because the two sides are not products at all. The notation $\sum a_n c_n$ means $\sum [a_n c_n]$ and not $\left[ \sum a_n \right] c_n$ (which makes less sense: what is the $n$ for $c_n$?)
For an even more specific example, with $N=3$, $(a_n) = (2, 2, 1)$, $(b_n) = (1,1,2)$, and $(c_n) = (1, 2, 3)$, the real sums above become
$$ 2 \cdot 1 + 2 \cdot 2 + 1 \cdot 3 = 9 = 1 \cdot 1 + 1 \cdot 2 + 2 \cdot 3 $$
but
$$ 2 + 2 + 1 \neq 1 + 1 + 2 $$