Activation Operators #
Semantic-preservation lemmas for unary activation operators in the IR -> compiled runtime bridge.
Each lemma mirrors the corresponding branch in the Correctness.SemanticEquivalence module and
gives that operator a stable theorem name. The main semantic equivalence proof can then focus on
graph traversal instead of carrying every parent-list and typed-index detail inline.
Build note: these proofs can be slower than the operators look. The activation itself is simple;
the proof cost comes from checking the singleton-parent contract, recovering a typed index from the
IR parent id, and showing that the dynamically evaluated DVal is the same value as the compiled
node output. The shared unary-operator skeleton keeps each activation branch focused on its tensor
function.
Semantic-preservation lemma for .relu lowering.
Semantic-preservation lemma for .tanh lowering.
Semantic-preservation lemma for .sigmoid lowering.
Semantic-preservation lemma for .exp lowering.
Positive-domain simplification for the compiled raw-log branch.
The end-to-end compiler theorem currently excludes raw .log through NoRawLog; a future theorem
can use this local fact after it carries per-node positivity facts through the graph.
Semantic-preservation lemma for .sin lowering.
Semantic-preservation lemma for .cos lowering.
Semantic-preservation lemma for .softmax axis lowering.
Implementation note: TorchLean's compiled softmax operator supports the last axis.
This is reflected by an explicit guard in buildFrom:
axis + 1 = Spec.Shape.rank outShape (equivalently, axis = rank-1).
Semantic preservation for stable last-axis softmax with a hard Boolean mask.