James B. Wilson, Colorado State University
Follow the slides at your own pace.
Open your smartphone camera and point at this QR Code. Or type in the url directly
https://slides.com/jameswilson-3/tensor-types-cats/#/
Uriya First
U. Haifa
Joshua Maglione,
Bielefeld
Peter Brooksbank
Bucknell
Quadratic equations in d^2 variables.
Genercially quadratic equations are as hard as all polynomial equations.
Obvious solution is Groebner basis which is impossibly hard even for d=4.
Isometry is equivalence in this cateogry (columns are objects.)
But what if we look at a different category?
The Adjoint category:
Just flip the arrow -- legal because with isomorphism arrows are invertible.
Categories matter because they let us change the question, and see something different to try.
They also are critically helpful in making useful programs.
Below we explain in more detail.
Mathematics Computation
Vect[K,a] = [1..a] -> K
$ v:Vect[Float,4] = [3.14,2.7,-4,9]
$ v(2) = 2.7
*:Vect[K,a] -> Vect[K,a] -> K
u * v = ( (i:[1..a]) -> u(i)*v(i) ).fold(_+_)
Matrix[K,a,b] = [1..b] -> Vect[K,a]
$ M:Matrix[Float,2,3] = [[1,2,3],[4,5,6]]
$ M(2)(1) = 4
*:Matrix[K,a,b] -> Vect[K,b] -> Vect[K,a]
M * v = (i:[1..a]) -> M(i) * v
Difference? Math has sets, computation has types.
But types are math invention (B. Russell); lets use types too.
Definition. A tensor space is a linear map from a vector space into a space of multilinear maps.
Tensors are elements of a tensor space.
The frame is
The axes are the
The valence is the the size of the frame.
You type this:
t = [[ 3, 1, 0 ],[ 0, 3, 1 ],[ 0, 0, 3 ]]
You're thinking of:
But your program plans for:
Effect: your program stores your data all-over in memory heap and slows down to double-check your instructions.
Details.
In a garbage collected systems (Java/Python/GAP/Magma
/Sage...) objects are stored on a heap - e.g. a balanced (red/black) tree.
Separate data like rows in a list of lists are therefore placed into the heap in the place that balances the tree.
While lookups are logarithmic, because your data is spread out but only ever used together, you add slow down.
The more structured your data structure the more complex the lookup.
In a list of lists what you actually have is a pointer/reference to on address in memory for each row.
Within a list you can just add 1, 2, etc. to step the counter through the row.
However, if you intend to step through columns you jump around memory -- may force machine to load data in and out of cache.
Languages like Java/Python/GAP/Magma etc. need to confirm that you never access an entry outside the list.
So A[i][j][k] is in principal checking that i, j, and k are each in the right bounds.
As a list of lists, many systems cannot confirm that j is in range until it has the correct row (recall the computer prepares for uneven rows!) This is true even for most compiled languages.
Result: bounds are checked at runtime, even if you know they are not needed.
Solution: separate the data from the grid.
Tensors are any element of a tensor space so as long as they can be interpreted as multilinear they are indeed tensors. No grids needed.
Math is this:
See how we often access entire regions contiguously or by arithmetic progression.
Bad idea: perform arithmetic for each index lookup!
Quickly that work costs more than the actual tensor contraction.
Math is this:
Step through indices with an "abacus machine", e.g. Minsky Annals Math, 1960.
These are Turing complete computational models that are based on numbers -- not symbols -- so arithmetic is the program.
Never heard of one? Oh, its simply the registers AX, BX, ... with on x86 compatible microprocessor!
Problem: Checking bounds required only if computer cannot prove (before run-time) that we are in range.
Solution: don't give an index, give a proof!
t:Tensor 10 20 = ...
t[i+j=10][1<=k<=20]
t:Tensor a b = ...
t[i+j=a][1<=k<=b]
"=" and "<=" are data, proofs are data!
Even data based on variables allowed -- says when values are given they will conform to the stated structure.
The computer (compiler) can then safely remove all checks.
But requires a dependent type system.
Terms of types store object plus how it got made
Implications become functions
hypothesis (domain) to conclusion (codomain)
(Union, Or) becomes "+" of types
(Intersection,And) becomes dependent type
Sets are the same if they have the same elements.
Are these sets the same?
We cannot always answer this, both because of practical limits of computation, but also some problems like these are undecidable (say over the integers).
In types the above need not be a set.
Sets are types where a=b only by reducing b to a explicitly.
Quite the opposite: despite adding potentially more lines to your code, think of those as instructions to the compiler on how to remove any unnecessary steps at runtime. (The axioms of unique choice implies you can remove all the line-by-line proofs in process known as "erasure".)
Bonus: programming this way means when it works, you have a rigorous math proof that your code is what you claim.
To stack: add a wire and move right number of beads. Do vice-versa to slice.
Swap the wires.
Take the disjoint union of axes abaci!
Avoids writing to memory what in the end is just a bunch of repeated information. Less information to move/store, and easy to recompute.
Tensor as elements of tensor spaces can therefore be represented by any data structure appropriate to your task. Use that to your advantage.
1. An abliean group constructor (perhaps just an additive category?)
2. Together we a distributive "evaluation" function
3. Universal Mapping Property
Why the notation? Nice consequences to come, like...
Context: finite-dimensional vector spaces
Actually, versors can be defined categorically
Rewrite how we evaluate ("uncurry"):
Practice
Evaluation
Recognizing the complexity of nonassociatie algebra, A. A. Albert introduced "isotope" as coarser equivalence:
Algebra isomorphism:
Category theory made all things "-isms" so now "isotopism", and more generally "homotopism".
In want of term for tensors we use Albert's.
Compose pointwise
Linear
Isometry
Most theorems fail/harder if we include tensors with degeneracy "all zero rows/columns".
Easy to remove.
But, that removal is not by a homotopism!
Isometries are immensely facilitated by considering adjoints instead.
But, adjoints are not homotopisms!
For tensors of valence n there are 2^n "self-evident" categories.
Idea: endomorphisms in a category are monoids.
Theorem. A Groebner basis for this annihilator can be computed in polynomial time.
Akin to eigen spaces:
Akin to characteristic/minimal polynomial:
Akin to weights:
This is a ternary Galois connection.
For trinomial ideals, all geometries can arise so classification beyond this point is essentially impossible.
Treating 0 as contra-variant the natural hyperplane is:
That is, the generic linear trait is simply to say that operators are derivations!
However, the schemes Z(S,P) are not the same as Z(P), so generic here is not the same as generic there...work required.
Theorem (FMW). If
Then
(If 1. fails extend the field; if 2. is affine, shift; if 3 fails, then result holds over support of P.)
Theorem (FMW). If
Then in all but at most 2 values of a
In particular, to be an associative algebra we are limited to at most 2 coordinates. Whitney's definition is a fluke.
Theorem (FMW). If for every S and P
then
If
then the converse holds.
(We speculate this is if, and only if.)
Let operators act covariantly on support of e and contravariantly on support of f.
BUT this is rather forced and adds in way more operators than those needed.
Is there a better idea to just glue the natural categories together without introduction morphisms we don't want?
These are basis independent (in fact functors),
E.g.:
Rule: If shuffling through index 0, collect a dual.
And so duals applied in 0 and 1