7.1.2 Tensor Component Indexing Scope
Tensor Component Indexing Scope defines how indices label tensor components, specifying their range and position within the tensor's structure.
Tensor Component Indexing Scope is the delimitation of which integer values are valid for addressing a tensor's components, fixed by the dimension of the vector space feeding each slot and by a choice of starting convention (beginning the count at 1 or at 0), together with the requirement that every index used to address a component must fall within this range for the addressing to refer to an actual, existing component. Establishing this scope precisely is what prevents an index expression from silently referring to a nonexistent component, an error that is easy to make when working across sources that adopt different starting conventions.
The Valid Range for a Single Index Slot
One-Based Indexing
Under the one-based convention common in pure mathematics, an index slot corresponding to a d-dimensional space ranges over the integers 1 through d inclusive:
so that a value of i outside this set, such as i = 0 or i = d + 1, does not address any component and lies outside the indexing scope entirely.
Zero-Based Indexing
Under the zero-based convention common in computer science and many programming languages, the same d-dimensional slot instead ranges over 0 through d − 1:
with i = d now falling outside the valid scope, the opposite boundary error from the one-based case.
Why Two Conventions Coexist and Why Neither Is Mathematically Necessary
An Arbitrary Labeling Choice
Nothing about a tensor's abstract definition requires basis vectors to be labeled starting from any particular integer; a basis {e₁, ..., e_d} could equally well be relabeled {e₀, ..., e_{d−1}} without changing any transformation law or any structural property of the tensor, since the labels are purely a bookkeeping device for referring to specific basis vectors and their associated components.
The Practical Reason the Choice Still Matters
Despite being arbitrary in principle, the choice of starting convention matters in practice because mixing conventions across a single calculation or across communicating source and destination systems produces off-by-one errors: a component correctly addressed as T₅ under one-based indexing corresponds to T₄ under zero-based indexing for the same underlying basis vector, and conflating the two silently retrieves the wrong component.
Diagram of the Two Indexing Ranges
Extending Indexing Scope to Full Tensors of Higher Order
Independent Range Per Slot
For a tensor of order n with shape (d₁, ..., d_n), the indexing scope is the Cartesian product of the per-slot ranges, {1,...,d₁} × ... × {1,...,d_n} (or the zero-based equivalent), and a full multi-index is valid only when every one of its n entries independently falls within the range appropriate to its own slot; a multi-index valid in one slot but out of range in another does not address a component at all.
Boundary Checking as a Precondition for Meaningful Access
Any operation that accesses a tensor component by index — whether in a mathematical proof or in executable code — is meaningful only when the supplied indices lie within the indexing scope described here; addressing outside this scope does not silently return some default or related value but simply fails to correspond to any component of the tensor, making explicit boundary awareness a precondition for correct component access in both formal and computational settings.