12.8.1 Tensor Composition Domain Matching
Tensor Composition Domain Matching ensures compatibility between tensor spaces by aligning their structural domains for meaningful mathematical operations.
Tensor Composition Domain Matching is the requirement, applied at every stage of a composed tensor expression, that any two tensors about to be combined by addition or subtraction share the same underlying vector space, ensuring that each individual step of a longer computation remains well defined rather than merely checking compatibility at the final result.
The Requirement Within Composition
Local Check at Each Combination Step
When a tensor expression involves several operations performed in sequence, domain matching requires that at the moment any two intermediate tensors are added or subtracted, both of them are built over the identical underlying vector space and its corresponding dual space. This check must be repeated at every combination step in the composition, not assumed automatically from the compatibility of the original operands.
Propagation Through Scalar Operations
Because scalar multiplication and negation do not alter the underlying vector space of a tensor, any tensor produced by such an operation retains domain matching with the same space as its input. This allows the vector space associated with a tensor to be tracked consistently as it passes through a chain of scalar multiplications or negations within a larger composed expression.
Why Domain Matching Must Be Checked at Every Step
Errors Can Arise Mid-Computation
Even if the final intended result of a composed expression appears dimensionally sensible, an intermediate step that combines tensors from different underlying vector spaces produces an undefined operation at that point, regardless of what happens afterward. Domain matching guards against this by requiring validity at each individual step, not merely plausibility of the final answer.
Supporting Correct Simplification
Verifying domain matching throughout a composition ensures that any algebraic simplification performed along the way, such as applying distributivity or reordering terms, remains valid, since these simplifications rely on the underlying operations being genuinely well defined at each stage they are applied.
Illustrative Example
A Composed Expression with Consistent Domains
Consider an expression such as , where , , and are all built over the same vector space . Domain matching confirms that , , and each remain over , so every addition and subtraction performed while combining them is valid.
A Composed Expression with a Domain Mismatch
If instead were built over a different vector space unrelated to , the subtraction step involving would fail domain matching, rendering that particular step, and consequently the entire composed expression, undefined at that point in the computation.
Relationship to Type Matching
Two Independent but Jointly Necessary Conditions
Domain matching addresses only the identity of the underlying vector space, while a separate condition, type matching, addresses the rank and variance structure of the tensors involved. Both conditions must hold at every combination step within a composed expression for that step to be a valid tensor operation.