Documentation

LeanMlir.Proofs.Nets.ConvNeXt.ConvNeXtStepTie

PoC: the FULL [3,3,9,3] ConvNeXt-T §1a TIE — the whole net tied through the real forward #

The Chapter-7 §1a tie: mnv2's whole-net thread (now MobileNetV2TieB.mnv2_net_tiedB; the per-example original was deleted 2026-09-08) for the ConvNeXt-T schedule. The §1 fold (ConvNeXtFold + M2/M3/ViT) already makes every rendered param op den = certified ∀ cotangent; this file feeds each consumer the real forward activations of the convNextTrainStepFaithfulV render and the loss-driven backward-chain cotangent that net delivers — so the whole 18-block train step is den-composed forward → loss → backward, no free activations, no symbolic cotangent.

The net this is about #

verified_mlir/convnext_train_step.mlir, measured, not assumed:

conventionthis fileread from
depth / widths[3,3,9,3], 96 → 192 → 384 → 768ConvNeXtRender.cnxTiny
stem4×4/s4 patchify conv then channel-LNconvNextFwdChain
normalisationchanLNTensor3 (per-channel [c] affine, h·w statistics per example) at all 22 spatial sites: 1 stem + 18 block + 3 downsampleConvNeXtRender.lnFwdSite
headGAP → vector-LN at one row (rowLNVecFlat 1 768) → denseheadLnFwdSite, restored 2026-08-30
activationGELU (smooth — no kink mask anywhere)fwdBlock
layer scaleper-channel Vec c, broadcast by chanIdxlayerScaleChF
paddingsymmetric; ConvNeXt is a PyTorch-origin net and has no XLA-SAME site
params182allParams, and the artifact's 184 func args (%x + 182 + %onehot)

Superseded scope note. Until 2026-09-05 this file tied the scalar-LN ConvNeXt-T — the retired whole-map bnForward spelling, with no stem LN and a scalar Vec 1 head LN. §2m flipped the renderer to the real per-channel channel_layer_norm and added the stem LN, §2n deleted the flag that had selected the old spelling, and 2026-08-30 restored the head LN. Every theorem in the old file was true and none of them was about the committed bytes. These are: the 22 spatial LN sites are chanLNTensor3 with Vec c γ/β, the head is ViT's vector-LN at N = 1, and the stem LN is here.

What is new against the scalar-LN version #

Coverage / honest residual #

All 182 parameters are tied. 181 of them at the full θ − lr·(certified ∂Loss/∂θ) step; the stem weight psW at its gradient, because the render emits convStride4WeightGrad and wraps it in the hand-written sgd text (a declared §5 carve-out — there is no fused convStride4WeightSgd op to be the den of). What remains outside: the block backward is rendered hand-written, so the cotangent SSA ↔ chain-cot correspondence is the per-op trust the whole suite carries; plus per-op pretty lexing; LN 0 < ε smoothness; ℝ → Float32 — the boundary every prior fold carries.

ConvNeXt block — all 9 params tied (depthwise → channel-LN → expand → GELU → project → layer-scale → +skip) #

Forward: out = addV( layerScaleCh lg (conv₁ₓ₁ₚᵣ( gelu( conv₁ₓ₁ₑₓ( chanLN( dw₇ₓ₇(xin) ))))), xin ). Backward from the block-output cotangent dyOut (the residual addV is the outermost op and there is no post-add activation, so it passes dyOut straight to the layer-scale output): layer-scale-back (cnxCotP) → project-conv-back → GELU mask (cnxCotE) → expand-conv-back (cnxCotN) → the channel-LN input-VJP (chanLNTensor3Back) → depthwise-back. Only that last-but-one step differs from the scalar-LN thread; cnxCotP/cnxCotE/cnxCotN are LN-form-agnostic and are reused verbatim from ConvNeXtChainClose.

def Proofs.CnxTiePoC.cnxBlockChTied {c cExp h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (Wdw : DepthwiseKernel c 7 7) (bdw ng nbt : Vec c) (Wex : Kernel4 cExp c 1 1) (bex : Vec cExp) (Wpr : Kernel4 c cExp 1 1) (bpr lg : Vec c) (xin d nl p : Vec (c * h * w)) (e g : Vec (cExp * h * w)) (dyOut : Vec (c * h * w)) (lr : ) :

ConvNeXt block, tied. All 9 params (depthwise 7×7 W+b, channel-LN γ/β at Vec c, expand/project 1×1 conv W+b, per-channel layer-scale γ) denote the certified loss-descent step at the real block forward activations + the chain cotangents driven by dyOut.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Proofs.CnxTiePoC.cnx_block_ch_tied {c cExp h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (Wdw : DepthwiseKernel c 7 7) (bdw ng nbt : Vec c) (Wex : Kernel4 cExp c 1 1) (bex : Vec cExp) (Wpr : Kernel4 c cExp 1 1) (bpr lg : Vec c) (xin d nl p : Vec (c * h * w)) (e g : Vec (cExp * h * w)) (dyOut : Vec (c * h * w)) (lr : ) :
    cnxBlockChTied xN wN bN gN epsStr lrStr cotN ε Wdw bdw ng nbt Wex bex Wpr bpr lg xin d nl p e g dyOut lr

    Downsample — channel-LN → 2×2/s2 conv (all 4 params tied) #

    Forward: o = convˢ²(chanLN(xin)) (LN over the block-input grid 2h×2w with a Vec ci affine, then a 2×2/s2 conv ci → co). No skip. Backward from dyOut: strided-conv-back (cotN') → channel-LN-back. The strided weight is no longer a gap: convStridedWeightSgd is emitted at 2×2 since sWGradGeom split the odd/even padding cases, and ResNet34PoC.convStridedW_den is kernel-generic.

    def Proofs.CnxTiePoC.cnxDownChTied {ci co h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (dng dnbt : Vec ci) (Wd : Kernel4 co ci 2 2) (bd : Vec co) (xin n : Vec (ci * (2 * h) * (2 * w))) (dyOut : Vec (co * h * w)) (lr : ) :

    Downsample, tied. Channel-LN γ/β at the ci·(2h)·(2w) input grid, plus the strided conv's weight and bias, at the real forward + the chain cotangents.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Proofs.CnxTiePoC.cnx_down_ch_tied {ci co h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (dng dnbt : Vec ci) (Wd : Kernel4 co ci 2 2) (bd : Vec co) (xin n : Vec (ci * (2 * h) * (2 * w))) (dyOut : Vec (co * h * w)) (lr : ) :
      cnxDownChTied xN wN bN gN epsStr lrStr cotN ε dng dnbt Wd bd xin n dyOut lr

      Stem — 4×4/s4 patchify conv → channel-LN (all 4 params) #

      psng/psnbt tie at dyStem, the cotangent block 1 delivers at the stem-LN output; the conv's own two parameters then see cotPatch, the LN input-VJP of it. The bias grad is a pure cotangent reduce, so the render emits it as a stride-1 convBiasSgd at the OUTPUT resolution and the carried W/x are generic — the same modelling the mnv2/r34 stems use. The weight is the convStride4WeightGrad op, and it ties at the gradient: its SGD wrap is hand-written text.

      def Proofs.CnxTiePoC.cnxStemChTied {c h w : } (xN _wN bN gN epsStr lrStr cotN : String) (ε : ) (Wst : Kernel4 c 3 4 4) (psb psng psnbt : Vec c) (x : Vec (3 * (2 * (2 * h)) * (2 * (2 * w)))) (xstem : Tensor3 3 h w) (patch dyStem : Vec (c * h * w)) (lr : ) :

      Stem, tied. Channel-LN γ/β, the conv bias, and the conv weight's gradient.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Proofs.CnxTiePoC.cnx_stem_ch_tied {c h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (Wst : Kernel4 c 3 4 4) (psb psng psnbt : Vec c) (x : Vec (3 * (2 * (2 * h)) * (2 * (2 * w)))) (xstem : Tensor3 3 h w) (patch dyStem : Vec (c * h * w)) (lr : ) :
        cnxStemChTied xN wN bN gN epsStr lrStr cotN ε Wst psb psng psnbt x xstem patch dyStem lr

        Head — GAP → vector-LN at one row → dense #

        After GAP the tensor is a single [768] row, so "normalise each spatial row over its channels" and "normalise the feature vector" are the same function at m = 1: the head is ViT's per-token LN with one token, and headLnFwdSite is lnFwdSite with the two transposes deleted. Stated at the LITERAL 768 — 1 * m does not reduce at a variable m (Nat.mul recurses on its second argument), which is the annotation trap the render carries in its own comment.

        def Proofs.CnxTiePoC.cnxHeadChTied (gN xN bN bdN epsStr lrStr cotN dyN : String) (ε : ) (hng hnbt : Vec 768) (Wfc : Mat 768 10) (bfc : Vec 10) (gap : Vec (1 * 768)) (hn : Vec 768) (g : Vec 10) (lr : ) :

        Head LN + dense bias, tied. The head-LN γ/β (at the pooled row gap, cot = the dense-back cotHn) and the dense bias (cot = the loss g) at the real forward.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Proofs.CnxTiePoC.cnx_head_ch_tied (gN xN bN bdN epsStr lrStr cotN dyN : String) (ε : ) (hng hnbt : Vec 768) (Wfc : Mat 768 10) (bfc : Vec 10) (gap : Vec (1 * 768)) (hn : Vec 768) (g : Vec 10) (lr : ) :
          cnxHeadChTied gN xN bN bdN epsStr lrStr cotN dyN ε hng hnbt Wfc bfc gap hn g lr
          theorem Proofs.CnxTiePoC.cnx_dense_tied_totalloss {m : } (aN wN lrStr dyN : String) (Wd : Mat m 10) (bd : Vec 10) (a : Vec m) (label : Fin 10) (lr : ) (i : Fin m) (j : Fin 10) :
          StableHLO.den (StableHLO.SHlo.weightSgd aN wN lrStr a Wd lr (StableHLO.SHlo.operand dyN fun (k : Fin 10) => softmax 10 (mnistLinear Wd bd a) k - oneHot 10 label k)) (finProdFinEquiv (i, j)) = Wd i j - lr * pdiv (fun (v : Vec (m * 10)) (x : Fin 1) => crossEntropy 10 (dense (Mat.unflatten v) bd a) label) Wd.flatten (finProdFinEquiv (i, j)) 0

          Dense head weight Wd, tied to the WHOLE softmax-CE lossWd − lr·∂(CE ∘ dense)/∂Wd.

          theorem Proofs.CnxTiePoC.cnxLossCot_den (nlogN ohN : String) (logits : Vec 10) (label : Fin 10) :
          StableHLO.den ((StableHLO.SHlo.operand nlogN logits).expe.softmaxDiv.sub (StableHLO.SHlo.operand ohN (oneHot 10 label))) = fun (j : Fin 10) => softmax 10 logits j - oneHot 10 label j

          The emitted loss-cotangent graph denotes the softmax-CE gradient at the logits.

          Forward aliases (@[irreducible]) — thread block inputs through the real forward #

          @[irreducible] so the 18-deep nested composition stays opaque during the capstone's dimension inference (the r34/mnv2 heartbeat lesson).

          @[irreducible]
          noncomputable def Proofs.CnxTiePoC.cnxStemFwdO {c h w : } (ε : ) (Wst : Kernel4 c 3 4 4) (bst psng psnbt : Vec c) (x : Vec (3 * (2 * (2 * h)) * (2 * (2 * w)))) :
          Vec (c * h * w)

          The stem output: patchify conv then channel-LN (§2m — the pre-§2m render had no stem LN).

          Equations
          Instances For
            @[irreducible]
            noncomputable def Proofs.CnxTiePoC.cnxBlockBodyChO {c cExp h w : } (ε : ) (Wdw : DepthwiseKernel c 7 7) (bdw ng nbt : Vec c) (Wex : Kernel4 cExp c 1 1) (bex : Vec cExp) (Wpr : Kernel4 c cExp 1 1) (bpr lg : Vec c) (xin : Vec (c * h * w)) :
            Vec (c * h * w)
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[irreducible]
              noncomputable def Proofs.CnxTiePoC.cnxBlockFwdChO {c cExp h w : } (ε : ) (Wdw : DepthwiseKernel c 7 7) (bdw ng nbt : Vec c) (Wex : Kernel4 cExp c 1 1) (bex : Vec cExp) (Wpr : Kernel4 c cExp 1 1) (bpr lg : Vec c) (xin : Vec (c * h * w)) :
              Vec (c * h * w)
              Equations
              Instances For
                @[irreducible]
                noncomputable def Proofs.CnxTiePoC.cnxDownFwdChO {ci co h w : } (ε : ) (dng dnbt : Vec ci) (Wd : Kernel4 co ci 2 2) (bd : Vec co) (xin : Vec (ci * (2 * h) * (2 * w))) :
                Vec (co * h * w)
                Equations
                Instances For

                  Backward cot-in constructors (@[irreducible]) — thread block dyOuts (the residual fan-in) #

                  @[irreducible]
                  noncomputable def Proofs.CnxTiePoC.cnxBlockCotInChAt {c cExp h w : } (ε : ) (Wdw : DepthwiseKernel c 7 7) (bdw ng nbt : Vec c) (Wex : Kernel4 cExp c 1 1) (bex : Vec cExp) (Wpr : Kernel4 c cExp 1 1) (bpr lg : Vec c) (xin dyOut : Vec (c * h * w)) :
                  Vec (c * h * w)

                  ConvNeXt block input cotangent: depthwise-back(cotD) + dyOut (the identity-skip fan-in), with cotD through the channel-LN input-VJP.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[irreducible]
                    noncomputable def Proofs.CnxTiePoC.cnxDownCotInChAt {ci co h w : } (ε : ) (dng dnbt : Vec ci) (Wd : Kernel4 co ci 2 2) (bd : Vec co) (xin : Vec (ci * (2 * h) * (2 * w))) (dyOut : Vec (co * h * w)) :
                    Vec (ci * (2 * h) * (2 * w))

                    Downsample input cotangent (at ci·(2h)·(2w)): the channel-LN input-VJP of the strided-conv-back. No skip.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[irreducible]
                      noncomputable def Proofs.CnxTiePoC.cnxHeadDyXheadCh {h w : } (ε : ) (hng hnbt : Vec 768) (Wfc : Mat 768 10) (bfc : Vec 10) (xhead : Vec (768 * h * w)) (g : Vec 10) :
                      Vec (768 * h * w)

                      The cotangent at the last block output xhead (= s3b2's dyOut): gap-back(headLN-back( dense-back(g))). The head LN's input-VJP is the render's rowScaleF γ then lnRowBack at γ = 1, which is rowLNVecFlatBack (ConvNeXtBackB0.rowLNBack_affine_eq).

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Input-only *TiedAt wrappers (@[irreducible]) — compute internals from a block's input #

                        @[irreducible]
                        def Proofs.CnxTiePoC.cnxBlockChTiedAt {c cExp h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (Wdw : DepthwiseKernel c 7 7) (bdw ng nbt : Vec c) (Wex : Kernel4 cExp c 1 1) (bex : Vec cExp) (Wpr : Kernel4 c cExp 1 1) (bpr lg : Vec c) (xin dyOut : Vec (c * h * w)) (lr : ) :
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Proofs.CnxTiePoC.cnx_block_ch_tiedAt {c cExp h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (Wdw : DepthwiseKernel c 7 7) (bdw ng nbt : Vec c) (Wex : Kernel4 cExp c 1 1) (bex : Vec cExp) (Wpr : Kernel4 c cExp 1 1) (bpr lg : Vec c) (xin dyOut : Vec (c * h * w)) (lr : ) :
                          cnxBlockChTiedAt xN wN bN gN epsStr lrStr cotN ε Wdw bdw ng nbt Wex bex Wpr bpr lg xin dyOut lr
                          @[irreducible]
                          def Proofs.CnxTiePoC.cnxDownChTiedAt {ci co h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (dng dnbt : Vec ci) (Wd : Kernel4 co ci 2 2) (bd : Vec co) (xin : Vec (ci * (2 * h) * (2 * w))) (dyOut : Vec (co * h * w)) (lr : ) :
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem Proofs.CnxTiePoC.cnx_down_ch_tiedAt {ci co h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (dng dnbt : Vec ci) (Wd : Kernel4 co ci 2 2) (bd : Vec co) (xin : Vec (ci * (2 * h) * (2 * w))) (dyOut : Vec (co * h * w)) (lr : ) :
                            cnxDownChTiedAt xN wN bN gN epsStr lrStr cotN ε dng dnbt Wd bd xin dyOut lr
                            @[irreducible]
                            def Proofs.CnxTiePoC.cnxStemChTiedAt {c h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (Wst : Kernel4 c 3 4 4) (psb psng psnbt : Vec c) (x : Vec (3 * (2 * (2 * h)) * (2 * (2 * w)))) (xstem : Tensor3 3 h w) (dyStem : Vec (c * h * w)) (lr : ) :
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              theorem Proofs.CnxTiePoC.cnx_stem_ch_tiedAt {c h w : } (xN wN bN gN epsStr lrStr cotN : String) (ε : ) (Wst : Kernel4 c 3 4 4) (psb psng psnbt : Vec c) (x : Vec (3 * (2 * (2 * h)) * (2 * (2 * w)))) (xstem : Tensor3 3 h w) (dyStem : Vec (c * h * w)) (lr : ) :
                              cnxStemChTiedAt xN wN bN gN epsStr lrStr cotN ε Wst psb psng psnbt x xstem dyStem lr
                              @[irreducible]
                              def Proofs.CnxTiePoC.cnxHeadChTiedAt {h w : } (gN xN bN bdN epsStr lrStr cotN dyN : String) (ε : ) (hng hnbt : Vec 768) (Wfc : Mat 768 10) (bfc : Vec 10) (xhead : Vec (768 * h * w)) (g : Vec 10) (lr : ) :
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem Proofs.CnxTiePoC.cnx_head_ch_tiedAt {h w : } (gN xN bN bdN epsStr lrStr cotN dyN : String) (ε : ) (hng hnbt : Vec 768) (Wfc : Mat 768 10) (bfc : Vec 10) (xhead : Vec (768 * h * w)) (g : Vec 10) (lr : ) :
                                cnxHeadChTiedAt gN xN bN bdN epsStr lrStr cotN dyN ε hng hnbt Wfc bfc xhead g lr

                                The whole-net capstone — all 182 params through the REAL forward + composed cotangent #

                                The convNextTrainStepFaithfulV forward threaded: block inputs are the forward prefixes (cnxStemFwdO / cnxBlockFwdChO / cnxDownFwdChO), and the backward cotangents are composed from the loss g = softmax(logits) − onehot down through dense (dense_has_vjp) + the head LN + GAP (globalAvgPoolFlat_has_vjp) + every block's backward, with the residual fan-in + dyOut at each of the eighteen identity-skip merges, the channel-LN-back at each of the three downsamples, and the stem LN's own back before the patchify conv's gradients. Each stem / block / down / head tie then holds at its real input + threaded cotangent. The full §1a tie: the whole [3,3,9,3] 182-parameter ConvNeXt-T train step is den-composed forward → loss → backward, no free activations, no symbolic cotangent.

                                theorem Proofs.CnxTiePoC.cnx_net_tied_certified (xN wN bN gN epsStr lrStr cotN dN nlogN ohN : String) (ε : ) (Wst : Kernel4 96 3 4 4) (psb psng psnbt : Vec 96) (xstem : Tensor3 3 56 56) (aW1 : DepthwiseKernel 96 7 7) (aB1 nG1 nB1 : Vec 96) (eW1 : Kernel4 384 96 1 1) (eB1 : Vec 384) (pW1 : Kernel4 96 384 1 1) (pB1 sL1 : Vec 96) (aW2 : DepthwiseKernel 96 7 7) (aB2 nG2 nB2 : Vec 96) (eW2 : Kernel4 384 96 1 1) (eB2 : Vec 384) (pW2 : Kernel4 96 384 1 1) (pB2 sL2 : Vec 96) (aW3 : DepthwiseKernel 96 7 7) (aB3 nG3 nB3 : Vec 96) (eW3 : Kernel4 384 96 1 1) (eB3 : Vec 384) (pW3 : Kernel4 96 384 1 1) (pB3 sL3 dG0 dT0 : Vec 96) (dW0 : Kernel4 192 96 2 2) (dB0 : Vec 192) (aW4 : DepthwiseKernel 192 7 7) (aB4 nG4 nB4 : Vec 192) (eW4 : Kernel4 768 192 1 1) (eB4 : Vec 768) (pW4 : Kernel4 192 768 1 1) (pB4 sL4 : Vec 192) (aW5 : DepthwiseKernel 192 7 7) (aB5 nG5 nB5 : Vec 192) (eW5 : Kernel4 768 192 1 1) (eB5 : Vec 768) (pW5 : Kernel4 192 768 1 1) (pB5 sL5 : Vec 192) (aW6 : DepthwiseKernel 192 7 7) (aB6 nG6 nB6 : Vec 192) (eW6 : Kernel4 768 192 1 1) (eB6 : Vec 768) (pW6 : Kernel4 192 768 1 1) (pB6 sL6 dG1 dT1 : Vec 192) (dW1 : Kernel4 384 192 2 2) (dB1 : Vec 384) (aW7 : DepthwiseKernel 384 7 7) (aB7 nG7 nB7 : Vec 384) (eW7 : Kernel4 1536 384 1 1) (eB7 : Vec 1536) (pW7 : Kernel4 384 1536 1 1) (pB7 sL7 : Vec 384) (aW8 : DepthwiseKernel 384 7 7) (aB8 nG8 nB8 : Vec 384) (eW8 : Kernel4 1536 384 1 1) (eB8 : Vec 1536) (pW8 : Kernel4 384 1536 1 1) (pB8 sL8 : Vec 384) (aW9 : DepthwiseKernel 384 7 7) (aB9 nG9 nB9 : Vec 384) (eW9 : Kernel4 1536 384 1 1) (eB9 : Vec 1536) (pW9 : Kernel4 384 1536 1 1) (pB9 sL9 : Vec 384) (aW10 : DepthwiseKernel 384 7 7) (aB10 nG10 nB10 : Vec 384) (eW10 : Kernel4 1536 384 1 1) (eB10 : Vec 1536) (pW10 : Kernel4 384 1536 1 1) (pB10 sL10 : Vec 384) (aW11 : DepthwiseKernel 384 7 7) (aB11 nG11 nB11 : Vec 384) (eW11 : Kernel4 1536 384 1 1) (eB11 : Vec 1536) (pW11 : Kernel4 384 1536 1 1) (pB11 sL11 : Vec 384) (aW12 : DepthwiseKernel 384 7 7) (aB12 nG12 nB12 : Vec 384) (eW12 : Kernel4 1536 384 1 1) (eB12 : Vec 1536) (pW12 : Kernel4 384 1536 1 1) (pB12 sL12 : Vec 384) (aW13 : DepthwiseKernel 384 7 7) (aB13 nG13 nB13 : Vec 384) (eW13 : Kernel4 1536 384 1 1) (eB13 : Vec 1536) (pW13 : Kernel4 384 1536 1 1) (pB13 sL13 : Vec 384) (aW14 : DepthwiseKernel 384 7 7) (aB14 nG14 nB14 : Vec 384) (eW14 : Kernel4 1536 384 1 1) (eB14 : Vec 1536) (pW14 : Kernel4 384 1536 1 1) (pB14 sL14 : Vec 384) (aW15 : DepthwiseKernel 384 7 7) (aB15 nG15 nB15 : Vec 384) (eW15 : Kernel4 1536 384 1 1) (eB15 : Vec 1536) (pW15 : Kernel4 384 1536 1 1) (pB15 sL15 dG2 dT2 : Vec 384) (dW2 : Kernel4 768 384 2 2) (dB2 : Vec 768) (aW16 : DepthwiseKernel 768 7 7) (aB16 nG16 nB16 : Vec 768) (eW16 : Kernel4 3072 768 1 1) (eB16 : Vec 3072) (pW16 : Kernel4 768 3072 1 1) (pB16 sL16 : Vec 768) (aW17 : DepthwiseKernel 768 7 7) (aB17 nG17 nB17 : Vec 768) (eW17 : Kernel4 3072 768 1 1) (eB17 : Vec 3072) (pW17 : Kernel4 768 3072 1 1) (pB17 sL17 : Vec 768) (aW18 : DepthwiseKernel 768 7 7) (aB18 nG18 nB18 : Vec 768) (eW18 : Kernel4 3072 768 1 1) (eB18 : Vec 3072) (pW18 : Kernel4 768 3072 1 1) (pB18 sL18 hG hT : Vec 768) (Wfc : Mat 768 10) (bfc : Vec 10) (x : Vec (3 * 224 * 224)) (label : Fin 10) (lr : ) :
                                have ib1 := cnxStemFwdO ε Wst psb psng psnbt x; have ib2 := cnxBlockFwdChO ε aW1 aB1 nG1 nB1 eW1 eB1 pW1 pB1 sL1 ib1; have ib3 := cnxBlockFwdChO ε aW2 aB2 nG2 nB2 eW2 eB2 pW2 pB2 sL2 ib2; have ibD0 := cnxBlockFwdChO ε aW3 aB3 nG3 nB3 eW3 eB3 pW3 pB3 sL3 ib3; have ib4 := cnxDownFwdChO ε dG0 dT0 dW0 dB0 ibD0; have ib5 := cnxBlockFwdChO ε aW4 aB4 nG4 nB4 eW4 eB4 pW4 pB4 sL4 ib4; have ib6 := cnxBlockFwdChO ε aW5 aB5 nG5 nB5 eW5 eB5 pW5 pB5 sL5 ib5; have ibD1 := cnxBlockFwdChO ε aW6 aB6 nG6 nB6 eW6 eB6 pW6 pB6 sL6 ib6; have ib7 := cnxDownFwdChO ε dG1 dT1 dW1 dB1 ibD1; have ib8 := cnxBlockFwdChO ε aW7 aB7 nG7 nB7 eW7 eB7 pW7 pB7 sL7 ib7; have ib9 := cnxBlockFwdChO ε aW8 aB8 nG8 nB8 eW8 eB8 pW8 pB8 sL8 ib8; have ib10 := cnxBlockFwdChO ε aW9 aB9 nG9 nB9 eW9 eB9 pW9 pB9 sL9 ib9; have ib11 := cnxBlockFwdChO ε aW10 aB10 nG10 nB10 eW10 eB10 pW10 pB10 sL10 ib10; have ib12 := cnxBlockFwdChO ε aW11 aB11 nG11 nB11 eW11 eB11 pW11 pB11 sL11 ib11; have ib13 := cnxBlockFwdChO ε aW12 aB12 nG12 nB12 eW12 eB12 pW12 pB12 sL12 ib12; have ib14 := cnxBlockFwdChO ε aW13 aB13 nG13 nB13 eW13 eB13 pW13 pB13 sL13 ib13; have ib15 := cnxBlockFwdChO ε aW14 aB14 nG14 nB14 eW14 eB14 pW14 pB14 sL14 ib14; have ibD2 := cnxBlockFwdChO ε aW15 aB15 nG15 nB15 eW15 eB15 pW15 pB15 sL15 ib15; have ib16 := cnxDownFwdChO ε dG2 dT2 dW2 dB2 ibD2; have ib17 := cnxBlockFwdChO ε aW16 aB16 nG16 nB16 eW16 eB16 pW16 pB16 sL16 ib16; have ib18 := cnxBlockFwdChO ε aW17 aB17 nG17 nB17 eW17 eB17 pW17 pB17 sL17 ib17; have xhead := cnxBlockFwdChO ε aW18 aB18 nG18 nB18 eW18 eB18 pW18 pB18 sL18 ib18; have gap := globalAvgPoolFlat 768 7 7 xhead; have hn := rowLNVecFlat 1 768 ε hG hT gap; have g := fun (k : Fin 10) => softmax 10 (mnistLinear Wfc bfc hn) k - oneHot 10 label k; have dyO18 := cnxHeadDyXheadCh ε hG hT Wfc bfc xhead g; have dyO17 := cnxBlockCotInChAt ε aW18 aB18 nG18 nB18 eW18 eB18 pW18 pB18 sL18 ib18 dyO18; have dyO16 := cnxBlockCotInChAt ε aW17 aB17 nG17 nB17 eW17 eB17 pW17 pB17 sL17 ib17 dyO17; have dyD2 := cnxBlockCotInChAt ε aW16 aB16 nG16 nB16 eW16 eB16 pW16 pB16 sL16 ib16 dyO16; have dyO15 := cnxDownCotInChAt ε dG2 dT2 dW2 dB2 ibD2 dyD2; have dyO14 := cnxBlockCotInChAt ε aW15 aB15 nG15 nB15 eW15 eB15 pW15 pB15 sL15 ib15 dyO15; have dyO13 := cnxBlockCotInChAt ε aW14 aB14 nG14 nB14 eW14 eB14 pW14 pB14 sL14 ib14 dyO14; have dyO12 := cnxBlockCotInChAt ε aW13 aB13 nG13 nB13 eW13 eB13 pW13 pB13 sL13 ib13 dyO13; have dyO11 := cnxBlockCotInChAt ε aW12 aB12 nG12 nB12 eW12 eB12 pW12 pB12 sL12 ib12 dyO12; have dyO10 := cnxBlockCotInChAt ε aW11 aB11 nG11 nB11 eW11 eB11 pW11 pB11 sL11 ib11 dyO11; have dyO9 := cnxBlockCotInChAt ε aW10 aB10 nG10 nB10 eW10 eB10 pW10 pB10 sL10 ib10 dyO10; have dyO8 := cnxBlockCotInChAt ε aW9 aB9 nG9 nB9 eW9 eB9 pW9 pB9 sL9 ib9 dyO9; have dyO7 := cnxBlockCotInChAt ε aW8 aB8 nG8 nB8 eW8 eB8 pW8 pB8 sL8 ib8 dyO8; have dyD1 := cnxBlockCotInChAt ε aW7 aB7 nG7 nB7 eW7 eB7 pW7 pB7 sL7 ib7 dyO7; have dyO6 := cnxDownCotInChAt ε dG1 dT1 dW1 dB1 ibD1 dyD1; have dyO5 := cnxBlockCotInChAt ε aW6 aB6 nG6 nB6 eW6 eB6 pW6 pB6 sL6 ib6 dyO6; have dyO4 := cnxBlockCotInChAt ε aW5 aB5 nG5 nB5 eW5 eB5 pW5 pB5 sL5 ib5 dyO5; have dyD0 := cnxBlockCotInChAt ε aW4 aB4 nG4 nB4 eW4 eB4 pW4 pB4 sL4 ib4 dyO4; have dyO3 := cnxDownCotInChAt ε dG0 dT0 dW0 dB0 ibD0 dyD0; have dyO2 := cnxBlockCotInChAt ε aW3 aB3 nG3 nB3 eW3 eB3 pW3 pB3 sL3 ib3 dyO3; have dyO1 := cnxBlockCotInChAt ε aW2 aB2 nG2 nB2 eW2 eB2 pW2 pB2 sL2 ib2 dyO2; have dyStem := cnxBlockCotInChAt ε aW1 aB1 nG1 nB1 eW1 eB1 pW1 pB1 sL1 ib1 dyO1; cnxStemChTiedAt xN wN bN gN epsStr lrStr cotN ε Wst psb psng psnbt x xstem dyStem lr cnxBlockChTiedAt xN wN bN gN epsStr lrStr cotN ε aW1 aB1 nG1 nB1 eW1 eB1 pW1 pB1 sL1 ib1 dyO1 lr cnxBlockChTiedAt xN wN bN gN epsStr lrStr cotN ε aW2 aB2 nG2 nB2 eW2 eB2 pW2 pB2 sL2 ib2 dyO2 lr

                                The whole [3,3,9,3] ConvNeXt-T train step, tied. Threading the real (channel-LN, per-channel layer-scale) forward and the loss-driven backward cotangent chain (GELU masks, the residual fan-in at every identity skip, the channel-LN-back at every downsample and at the stem), the 18 ConvNeXt blocks, the 3 downsamples, the 4×4/s4 stem with its LN, the GAP → LN → dense head, and the dense total-loss fold + loss-cotangent graph all denote the certified loss-descent step. All 182 parameters; psW at its gradient (§5 carve-out).