Tensor Coordinates #
This module connects the public Spec.Shape API to row-major coordinate geometry.
Both the specification and buffer layers use the same list of dimensions; their
size functions are connected explicitly so that each layer retains its own simplification API.
Shape.Coord supplies the finite coordinate space used by verified tensor lowering.
The finite multidimensional coordinate type of a TorchLean shape.
Instances For
The buffer-level element count agrees with the spec-level one.
Not a simp lemma. Spec.Shape.size and Tensor.Internal.Shape.size are two definitions of the
same function on the same type, one for each layer, and rewriting every buffer-level count into a
spec-level one would strand the buffer lemmas that Rep proofs rely on. Bridge explicitly where a
spec-level fact has to meet a buffer-level obligation.
Transport a spec-level size equality down to the buffer level.
The companion of internalSize_eq for the common case where a definition demands the buffer-level
equality and the caller has the spec-level one.
Validate a runtime coordinate list against a static tensor shape.
The list is outermost-first and must contain exactly one in-bounds index per axis. Successful validation returns the ordinary proof-carrying coordinate.
Instances For
Unlinearizing and then linearizing recovers the flat index.
Linearizing and then unlinearizing recovers the multidimensional coordinate.