The Sard problem in step 2 and in filiform Carnot groups, Francesco Boarotto, Luca Nalon and Davide Vittone ESAIM: COCV, 28 (2022) 75 Published online: 22 December 2022 DOI: 10.1051/cocv/2022074