Reference · Vectors
rainbow.math.linear.vector.dot-subtract
Subtraction laws for signed values and the native vector dot product. signed/subtract-respects-equivalence vector/dot-subtract-left vector/dot-subtract-right Native vector subtraction zips its arguments, so dot subtraction requires an explicit same-shape hypothesis: without it, the subtraction can discard a suffix that a separately computed dot product would retain. Under that hypothesis, left subtraction follows from dot additivity and dot negation; the right law follows by dot commutativity.
signed/subtract-respects-equivalence
signed/subtract-respects-equivalence : (left left-prime right right-prime : ℚ) (left-same : left = left-prime) (right-same : right = right-prime) → left - right = left-prime - right-prime
- = signed/subtract= = signed/equivalent: equality of rational valuesℚ = signed/SignedRational
vector/dot-subtract-left
vector/dot-subtract-left : (left right weights : List ℚ) (same : vector/same-shape left right) → vector/dot (vector/subtract left right) weights = vector/dot left weights - vector/dot right weights
- = signed/subtract= = signed/equivalent: equality of rational valuesList = data/Listℚ = signed/SignedRational
vector/dot-subtract-right
vector/dot-subtract-right : (weights left right : List ℚ) (same : vector/same-shape left right) → vector/dot weights (vector/subtract left right) = vector/dot weights left - vector/dot weights right
- = signed/subtract= = signed/equivalent: equality of rational valuesList = data/Listℚ = signed/SignedRational