Ivory: Radicals
To be radical is to grasp things by the root — Karl Marx, Critique of Hegel’s Philosophy of Right
TODO:
(expt x y)is tricky:- When
yisnaturalwe get the same type asx(assuming it’s closed under multiplication, which all of our types are) - When
yisintegerwe getrationalnumbers or below - When
yisrationalwe getradicaland below - Probably don’t want anything more general than
rational, since their semantics involve logarithms, which I don’t know a normal form for - Unclear what’s the most general
xwe can support, whenyisrational:- I think
radicalis OK; roots of products seem fine. Roots of sums don’t easily rewrite (not sure of a general normal form for those…) - Roots become more, ahem, complex when dealing with
complex, and other hypercomplex numbers; since sums can cancel-out when squared. - Seems reasonable to return
complexwhen rooting a negative - If there’s a symbolic normal form for other
geometricnumbers it would be nice to use that - Fractional powers of a
polynomialshould be representable usingalgebraic-expression, I think? - Note: don’t confuse fractional powers of a
polynomialwith “roots” (substitutions for the indeterminate which evaluate to0)
- I think
- When
- Normalising
radicalrequires factorising. That’s slow, but also useful for cancelling common factors in arational. - How to read and write powers of sums? Would like to avoid
parentheses…
- Don’t!
- Maybe we can construct roots based on an “index”, e.g. we have (i n)
to refer to the nth symbol that squares to -1; how about (√ 5 3) for the
cube root of 5? Putting the “base” as first argument lets us default the
second to 2, so (√ 5) is short for (√ 5 2).
- Note that (√ n 1) reduces to n
- Composite numbers reduce to products, e.g. (√ 18) = (× (√ 2) (√ 3) (√ 3))
- Products of roots reduce as appropriate, e.g. (× (√ 3) (√ 3)) = 3
- The nice thing about this representation, is that we’re not having to deal with all algebraic numbers; we’re just simplifying the symbols that appear in a given expression.
NOTE: The set of algebraic numbers is larger than the set of radicals. Algebraic numbers are roots of arbitrary univariate polynomials, but quintics and above allow roots that can’t be expressed using radicals!