Theorema Egregium – rank theorem
Egregious and rank both (can) mean conspicuously bad, as in egregious behavior and rank treachery.
However the etymology of egregious shows that it originally meant conspicuously good! It is this original meaning Gauss intended when he named his result the Theorema Egregium.
A final note: The “rank theorem” is more commonly (but not exclusively) known as the “rank nullity theorem”.
Etymology Sources: (search on egregious)