Symbolic einsum certificates #
This module constructs Check.CheckedEinsum values when tensor dimensions are
symbolic Nat expressions rather than reducible literals. The pattern and
operand ranks are still checked by computation. Repeated labels,
singleton broadcasting, logical-axis sources, and the expected output shape
are then proved against the original symbolic dimensions.
The resulting certificate feeds the same semantic lowering and native kernel compiler used for concrete shapes. Symbolic dimensions change how the checked plan is built, not what einsum means.
Find the symbolic length assigned to a reflected einsum axis.
Instances For
An explicit occurrence certifies that a logical axis length has an input
source. Keeping the witness outside List.any lets symbolic elaboration prove
only the dimension equality instead of simplifying every earlier occurrence.
Construct a checked einsum directly from symbolic natural-number dimensions.
The executable checker validates the complete rank and pattern structure on
same-rank singleton witnesses. The actual dimensions are then used in every
proof-valued field of CheckedEinsum. An expected output tensor shape, when
available, names the corresponding logical output lengths and is checked by
the same broadcasting and source-occurrence invariants.