This is a general pattern in CAS. For a more basic case, it’s not obvious sqrt(square(x)) will simplify to x without any further assumptions on x.
That's not what it simplifies to using a real or complex number domains for x, it's abs(x). CAS need type inference assumptions and/or type qualifiers to be more powerful.
Edit: Fixed stuff.
I think you would get sqrt(x^2) = x, if x belonged to the natural domain of sqrt, which is a Riemann surface, that may also be defined using the language of "sheaves". I don't know how to connect this to the article or Mathematica.