  The observation of GW170817 and its electromagnetic counterpart implies that
gravitational waves travel at the speed of light, with deviations smaller than
a few $\times 10^{-15}$. We discuss the consequences of this experimental
result for models of dark energy and modified gravity characterized by a single
scalar degree of freedom. To avoid tuning, the speed of gravitational waves
must be unaffected not only for our particular cosmological solution, but also
for nearby solutions obtained by slightly changing the matter abundance. For
this to happen the coefficients of various operators must satisfy precise
relations that we discuss both in the language of the Effective Field Theory of
Dark Energy and in the covariant one, for Horndeski, beyond Horndeski and
degenerate higher-order theories. The simplification is dramatic: of the three
functions describing quartic and quintic beyond Horndeski theories, only one
remains and reduces to a standard conformal coupling to the Ricci scalar for
Horndeski theories. We show that the deduced relations among operators do not
introduce further tuning of the models, since they are stable under quantum
corrections.
