That's actually the Yosemite Decimal Scale (YDS). And no, it isn't mathematical. Think like software versions. With software, version 3.2.10 is a higher version than 3.2.9.
A rating as three parts, the Roman numeral (the "grade"), the Arabic numeral before the decimal point (the "class") and the part after the decimal point (the difficulty of the hardest section of free climbing). In theory, there was going to be 6.0, 6.1, etc to design, but that didn't catch on and people use the A0-A5 ratings instead. So the full rating for a long route might be something like The Nose V 5.13b or 5.9 A2.
The V scale is entirely different. It is strictly consecutive V0 to V17 currently and generally used for bouldering only, not roped climbing (some exceptions when there is something in the middle of a roped climb that is like a boulder problem).
And there's the French system where an 8c climb is about as hard as a 7c boulder problem. And there's the British system which nobody but British climbers understand and nobody, not even British climbers who understand it, can explain to someone who doesn't otherwise understand it. And the Germanic countries have a system and the Australians have another one. There's probably several more.