§B: the ViT encoder-block backward tie at the VECTOR LayerNorm the net runs #
The shipped depth-12 net is vitForwardKV, whose blocks are transformerBlockV at
γ β : Vec D, the form ViTRender.lean emits. This file states the block backward tie there,
so the whole-net fold in ViTWholeBackCertifiedTie.lean is about the blocks the artifact
contains. It is package 3.1's move for ConvNeXt-T, one architecture over.
⭐ There is no new analysis, and the reason is that ConvNeXt already built ViT's LayerNorm
backward. rowLNVecFlatBack (ChannelLNBack.lean) is perRowFlatPR of
bn_grad_input c ε 1 (X r) ∘ diagBack γ — the γ scale in front of the unit-γ input gradient at
each row's own saved activation — and its own header says it is "literally ViT's per-token LN
with 'token' read as 'spatial position'". rowLNVecFlat_has_vjp_backward_eq already pins it to
layerNormVec_per_token_has_vjp_mat. So the vector-LN seam (rowLNVecFlatBack_eq_vecLN_vjp) is
that lemma read at a flat saved input, and everything else in the block — mhsaBackFlat, the
dense Wᵀ 0 input-VJPs, the diagBack GELU derivative, the perRowFlatPR residual seams — is
LayerNorm-agnostic and is reused from ViTMhsaBackCertifiedTie.lean verbatim.
⚠ Both sublayer decompositions and the block unfold are rfl at the vector LN:
transformerBlockV_has_vjp_mat is a vjpMat_comp / biPathMat_has_vjp assembly, so the
projections reduce.
3-axiom-clean.
The vector-LN backward at a flat saved input IS the certified per-token vector-LN VJP,
flattened. rowLNVecFlat_has_vjp_backward_eq (ConvNeXt's) read through
hasVJPMat_to_hasVJP's projection. The only LayerNorm-specific step in this file.
The vector-LN MLP sublayer's VJP backward decomposes — the MLP peer, also rfl.
The attention-sublayer backward float-half IS the certified sublayer VJP, flat.
residual (rowLNVecFlatBack ∘ mhsaBackFlat) with Q/K/V
pinned at LNᵥ₁(A) and the LN backward at the block's own saved input. The sdpa leaf is
mhsaBackFlat_eq_mhsa_vjp, which never mentions a LayerNorm.
The MLP-sublayer backward float-half IS the certified sublayer VJP, flat. The residual
is lifted out of the per-token fold. The per-token
body tie (transformerMlp_back_flat_eq_perRowFlatPR) is LayerNorm-agnostic and reused
verbatim; only the LN₂-back seam changes.
⭐⭐ THE VECTOR-LN ViT BLOCK §B TIE. vitBlockBackV, with every saved activation pinned
to the real forward (Q/K/V at LNᵥ₁ A; the LN₁ backward at the block's own input A and the
LN₂ backward at the attention sublayer's output; the GELU derivative at
dense₁(LNᵥ₂(attn A))), IS the certified transformerBlockV input-gradient VJP, flattened.
Assembled from the block unfold and the two sublayer flat ties; no new analysis, and general in the head count.
The block tie in the form the tower recursion needs — vitBlockBackVAt at a FLAT saved
input v is the flat block's VJP backward at v, i.e. exactly the HasVJP that
vitBodyKVFlat_has_vjp's chain step consumes. Mat.flatten_unflatten is the only step.