Reference · Signed rationals
rainbow.math.rational.signed.square-of-sum
The four-term expansion of a squared sum over signed rationals -- a reusable step for square convexity (the variance inequality) and other quadratic identities. signed/square-of-sum : (a+b)*(a+b) ~ ((a*a) + (a*b)) + ((b*a) + (b*b)) One right-distribution then two left-distributions. (a*b and b*a are kept distinct since the caller decides when to commute.) Axiom-free; additive; does not touch the LP checker.
signed/square-of-sum
signed/square-of-sum : (a b : ℚ) → (a + b) · (a + b) = a · a + a · b + (b · a + b · b)
+ = signed/add= = signed/equivalent: equality of rational values· = signed/multiplyℚ = signed/SignedRational