By that definition, all formats are lossy, because any preprocessing could be lossy, and the word loses all meaning … which is why we don't use that definition.
The word doesn't lose definition, it has different definitions for codecs and images.
If you reencode a jpeg to a png, you used a lossless format but your image is very lossy.
By what definition? I didn’t say anything was lossy; I said you couldn’t be sure that the image was lossless just from the extension. Of course, it might still be, and you might have other reasons to know it to be.
It's not the PNG encoding that causes the loss. The optimisers are literally creating a different image and then losslessly encoding it as PNG.
But it's also a valid point.
Arguably the same is true of JPEG. The format itself can record all the frequencies in full detail (with some tiny rounding errors I'm ignoring here), but the optimizer creates a different image by cutting elements that are less important and wasteful of bits. And then that different image is encoded losslessly.