  We resolve the problem of optimal regularity and Uhlenbeck compactness for
affine connections in General Relativity and Mathematical Physics. First, we
prove that any affine connection $\Gamma$, with components $\Gamma \in L^{2p}$
and components of its Riemann curvature ${\rm Riem}(\Gamma)$ in $L^p$, in some
coordinate system, can be smoothed by coordinate transformation to optimal
regularity, $\Gamma \in W^{1,p}$ (one derivative smoother than the curvature),
$p> \max\{n/2,2\}$, dimension $n\geq 2$. For Lorentzian metrics in General
Relativity this implies that shock wave solutions of the Einstein-Euler
equations are non-singular -- geodesic curves, locally inertial coordinates and
the Newtonian limit, all exist in a classical sense, and the Einstein equations
hold in the strong sense. The proof is based on an $L^p$ existence theory for
the Regularity Transformation (RT) equations, a system of elliptic partial
differential equations (introduced by the authors) which determine the
Jacobians of the regularizing coordinate transformations. Secondly, this
existence theory gives the first extension of Uhlenbeck compactness from
Riemannian metrics, to general affine connections bounded in $L^\infty$, with
curvature in $L^{p}$, $p>n$, including semi-Riemannian metrics, and Lorentzian
metric connections of relativistic Physics. We interpret this as a "geometric"
improvement of the generalized Div-Curl Lemma. Our theory shows that Uhlenbeck
compactness and optimal regularity are pure logical consequences of the rule
which defines how connections transform from one coordinate system to another
-- what one could take to be the "starting assumption of geometry".
