Tensor Standard Math

Ordinary arithmetic reinterpreted as typed tensor operations

Literals: numbers 2, vectors v(1,2), covectors cv(3,4), matrices m(1,2;3,4), rank-3 t3(a,b;c,d|e,f;g,h). Operators: + - add/sub, * tensor product, @ contract. Functions: trace det inv transpose norm identity raise lower sym antisym eigenvalues contract. GR: christoffel(g, dg) riemann(g, dg, ddg). Indexed: T[a+, b-], contract(T[a+, b-], v[b+]). Basis: components(T, e). Where: v + w where let v = v(1,2); let w = v(3,4).

Conversion Rules

Interpretation

Input
Tensor-form expression
Symbolic parse tree
Σ

Output

Result value

Evaluation Trace

No trace yet.
{}

Core Rules

Scalars are rank-0 tensors.
Addition requires identical tensor type.
Tensor product combines structure without collapsing it.
Contraction is explicit and dimension-aware.
Subtraction desugars to A + (-1) * B.

What 1 + 2 means here

1 is promoted to T[] with value 1.
2 is promoted to T[] with value 2.
T[] + T[] is valid because both are rank-0.
Result 3 is also T[]: scalar arithmetic is a special case of tensor arithmetic.
ƒ

Layer 2 Operations

trace(M) sums diagonal elements of a square matrix.
det(M) computes the determinant (2x2, 3x3).
inv(M) returns the inverse with swapped variance.
transpose(M) swaps rows/cols and variance.
norm(v) returns the Euclidean norm as a scalar.
identity(n) creates an n×n identity matrix.
lower(v, g) lowers a vector with metric g → covector.
raise(ω, g) raises a covector with metric g → vector.
TLS 0.2 Formal specification for a tensor-native symbolic mathematics language
1
Output will appear here after running.

Environment

No declarations yet.