This paper has several goals. The first idea is to study the geometric PDEs of connection-flatness, curvature-flatness, Ricci-flatness, scalar curvature-flatness in a modern and rigorous way. Although the idea is not new, our main Theorems about flatness introduce a different point of view in Differential Geometry. The second idea is to introduce and study the Euler-Lagrange prolongations of PDEs-flatness solutions via associated least squares Lagrangian densities and functionals on Riemannian manifolds. All geometric PDEs turned into one of the most intensively developing branches of modern differential geometry.