You said: Mathematical knowledge on the other hand is pretty much all a priori...things are proved to exist before any empirical observation...by pure thought.
Not quite .. and after thinking about it (ish) for a spell, it came to me .. the common empirical reference is measurement, in most cases. Geometry does not exclusively compare like with like and categorise, but may also involve measurement. Hence Pythagoras theorem based on measurement is in the same stable, so to speak.
Measurement is considered an empirical act because it involves the systematic observation and quantification of attributes of objects or events, allowing for comparisons based on collected data. This process relies on empirical evidence rather than theoretical assumptions.