
We present a determination of the corrections to Dashen's theorem and of the
individual up and down quark masses from a lattice calculation based on
quenched QED and $N_f=2+1$ QCD simulations with 5 lattice spacings down to
0.054 fm. The simulations feature lattice sizes up to 6 fm and average updown
quark masses all the way down to their physical value. For the parameter which
quantifies violations to Dashens's theorem we obtain $\epsilon=0.73(2)(5)(17)$,
where the first error is statistical, the second is systematic, and the third
is an estimate of the QED quenching error. For the light quark masses we
obtain, $m_u=2.27(6)(5)(4) \, MeV$ and $m_d=4.67(6)(5)(4) \, MeV$ in the
$\overline{MS}$ scheme at $2 \, GeV$ and the isospin breaking ratios
$m_u/m_d=0.485(11)(8)(14)$, $R=38.2(1.1)(0.8)(1.4)$ and
$Q=23.4(0.4)(0.3)(0.4)$. Our results exclude the $m_u=0$ solution to the strong
CP problem by more than 24 standard deviations.

In a previous letter (arXiv:1306.2287) we determined the isospin mass
splittings of the baryon octet from a lattice calculation based on quenched QED
and $N_f{=}2{+}1$ QCD simulations with 5 lattice spacings down to
$0.054~\mathrm{fm}$, lattice sizes up to $6~\mathrm{fm}$ and average updown
quark masses all the way down to their physical value. Using the same data we
determine here the corrections to Dashen's theorem and the individual up and
down quark masses. For the parameter which quantifies violations to Dashens's
theorem, we obtain $\epsilon=0.73(2)(5)(17)$, where the first error is
statistical, the second is systematic, and the third is an estimate of the QED
quenching error. For the light quark masses we obtain,
$m_u=2.27(6)(5)(4)~\mathrm{MeV}$ and $m_d=4.67(6)(5)(4)~\mathrm{MeV}$ in the
$\bar{\mathrm{MS}}$ scheme at $2~\mathrm{GeV}$ and the isospin breaking ratios
$m_u/m_d=0.485(11)(8)(14)$, $R=38.2(1.1)(0.8)(1.4)$ and
$Q=23.4(0.4)(0.3)(0.4)$. Our results exclude the $m_u=0$ solution to the strong
CP problem by more than $24$ standard deviations.

While electromagnetic and updown quark mass difference effects on octet
baryon masses are very small, they have important consequences. The stability
of the hydrogen atom against beta decay is a prominent example. Here we include
these effects by adding them to valence quarks in a lattice QCD calculation
based on $N_f=2+1$ simulations with 5 lattice spacings down to 0.054 fm,
lattice sizes up to 6 fm and average updown quark masses all the way down to
their physical value. This allows us to gain control over all systematic
errors, except for the one associated with neglecting electromagnetism in the
sea. We compute the octet baryon isomultiplet mass splittings, as well as the
individual contributions from electromagnetism and the updown quark mass
difference. Our results for the total splittings are in good agreement with
experiment.