Permutation Operators #
Semantic-preservation lemmas for permutation-style operators in the IR-to-compiled-runtime bridge.
This file covers the IR .permute perm node kind. The compiler lowers a permutation to a
swap-depth program (a list of axis swaps). The proof below mirrors that lowering: it validates the
permutation witness and computed swaps, constructs the compiled forward closure in terms of
applySwapsTensor, then rewrites the IR evaluator's permuteDVal to the same swap-based
implementation via permuteDVal_eq_applySwapsTensor.
Build note: permutation proofs are slow because a permutation changes both tensor data and the type level shape. The proof therefore has to relate a dynamic IR permutation to the compiled swap program while keeping casts proof-irrelevant. The swap-program lemmas should stay small and avoid redoing permutation arithmetic inside the compiler branch proof.
Semantic-preservation lemma for .permute perm lowering.