The sharper the lens, it will peak at a lower f/number (at least in the centre) as it hits the diffraction limit sooner - but at a higher level than less sharp lenses, that peak at higher f/numbers.
Most of the best quality lenses peak around f/5.6, a very sharp lens will peak at f/4, and the Sigma 50/1.4 Art, the sharpest lens I have tested, peaks at f/2.8 in the centre. Sharpness at the edges and corners is a different story however. They can continue to improve at higher f/numbers, even when sharpness in the centre is reducing. Take that Sigma 50/1.4 Art again - edge sharpness peaks at f/5.6.
Edit: Not sure how clear that is above! Basically, it is various lens aberrations that reduce sharpness - mainly chromatic aberration, spherical aberration, coma - and diffraction. Most aberrations reduce as the f/number is raised, but diffraction goes the other way and increases at higher f/numbers. Diffraction is directly related to the physical size of the lens aperture (as seen by the lens) and affects all lenses the same, regardless of quality. So sharpness peaks at the point where the reduction in the other aberrations crosses-over with the ever-increasing rise in diffraction.
The reason why edge and corner sharpness behave differently is, the further off-centre, the stronger most aberrations are, and harder to correct. So the lens has to be stopped down further and therefore the cross-over point with diffraction happens at a lower standard of sharpness.