Documentation

LeanMlir.Proofs.Nets.ResNet.ResNet34StepTieB

ResNet-34's step TIE at TRUE BATCH-NORM — the un-fused, batched whole-net thread #

GradNodesB makes every parameter GRADIENT node of the batched ResNet-34 train step den-faithful for an arbitrary cotangent. This file removes the "arbitrary": each cotangent is pinned to the one the emitted backward chain delivers, so the whole train step is den-composed forward → loss → backward with no free activation and no symbolic cotangent.

The block cotangents are NOT derived here. r34IdBHasVJPAt / r34DownBHasVJPAt ARE the certified block backwards, so a block's input cotangent is a .backward application — and r34{BasicBlock,DownBlock}BackBatchedGraph_faithful already proves the emitted backward subgraph denotes exactly it. r34IdCotIn_eq_vjp and r34DownCotIn_eq_vjp below are that statement in the vocabulary this file threads, and they are what make the cross-block chain a composition of certified VJPs rather than a re-derivation.

The loss cotangent is the LABEL-SMOOTHED one, at a general target. ResNet34RenderB composes the head cotangent from six kit ops — softmaxRow → subB → scaleB → addVB → shiftB → divConstB, α baked at 0.1 and the ls0 variants at 0 — and the target arrives as the graph input %onehot, which under mixup or cutmix is a soft vector drawn on the host. Foundation/SmoothedLossCot.lean is that cotangent's lemma; the head fold below is stated at it, not at softmax − oneHot.

N is a binder. The capstone takes (N : Nat), exactly as efficientnet_net_tied does; the artifacts at 32 (resnet34_sgd/adam_train_step) or 64 (resnet34in_momdp64) are instances. The batch size is never pinned (the 224-px resolution and the 64…512 widths are literals).

The all-reduce. Every statement below is at one replica's gradient node. Every ResNet-34 data-parallel render (resnet34in_momdp64 among them) synchronises BatchNorm; its all-reduced gradients are ResNet34SyncStepTieB's r34_net_syncTiedB: this file's node at N := R·N.

Precision is a flag on the statement. The ImageNet run the book reports trains from resnet34in_momdp64bf16, whose conv weight gradients are the bf16 kinds (convWeightGradBBf16, …; Foundation.Bf16GradNodes). Every conv weight node below is stated on the renderers' switch — ConvWTiedBAt bf16 / ConvStridedWTiedBAt bf16 (Foundation.GradNodesBAt): bf16 := false is the f32 node, bf16 := true the bf16 one — and the capstone r34_net_tiedB takes bf16, so it reaches the bf16 artifacts' gradient nodes read over ℝ exactly as it reads the f32 ones (Bf16Erasure: at the identity rounding the bf16 kind denotes what its f32 peer does). BatchNorm, bias and dense nodes carry no flag because no render switches them. What the bf16 weight-gradient kinds do under sharding is DataParallel.SyncBf16; the data-parallel capstone is ResNet34SyncStepTieB at the same flag.

The parameter census is 110, not 146 #

ResNet34RenderB's writers default to convBias := false: the conv biases are gone from the signature (BatchNorm subsumes them, and He et al.'s .convBn has none), bound instead to the zero constants zeroBiasPrelude emits. So resnet34_sgd_train_step.mlir carries 110 SGD-updated tensors — stem 3 + 13 identity blocks × 6 + 3 downsample blocks × 9 + dense 2 — and 146 is the census at convBias := true. The bias conjuncts below are kept (they are one delegation each and they cover the flag), and they are about ops the committed artifacts do not emit. Nothing about this weakens a theorem: every fold is ∀-quantified over op instances, and bias = 0 is one of them.

Conventions, stated because nothing here checks them #

BatchNormbatch (bnBatchLA, reduce [0,2,3], width N·h·w)
paddingsymmetric at all seven stride-2 sites (convStrided*, not the XLA-SAME twins)
stem pool3×3/s2 (maxPool3s2Flat), not 2×2
activationrelu, TWO kinks per block (the body's mid-relu and the post-residual outer one)
optimizer formthe RAW gradient (*GradB); the fused θ − lr·g appears in no batched r34 step
losslabel-smoothed softmax-CE at a general target, batch-meaned

ResNet34RenderB.idBackGradB, node for node, from the block-output cotangent dyOut:

%da  = selectPosB(a)   %dn2 = bnBatchBack(g2, c2)   %dc2 = convBackBatched(W2)
%dr1 = selectPosB(n1)  %dn1 = bnBatchBack(g1, c1)   %dc1 = convBackBatched(W1)
%dx  = addVB(%dc1, %da)

and the eight parameter nodes read W1,b1 ← %dn1, g1,bt1 ← %dr1, W2,b2 ← %dn2, g2,bt2 ← %da. The four defs below are those four cotangents.

noncomputable def Proofs.ResNet34TieB.r34IdCotA (N h w : ℕ) {c : ℕ} (p : R34IdW c) (xin dyOut : Vec (N * (c * h * w))) :
Vec (N * (c * h * w))

Cotangent at the block's pre-relu sum a — the outer relu's mask applied to dyOut. It feeds bn₂'s γ/β directly AND (through the identity skip) the block-input fan-in.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    noncomputable def Proofs.ResNet34TieB.r34IdCotC2 (N h w : ℕ) {c : ℕ} (p : R34IdW c) (xin dyOut : Vec (N * (c * h * w))) :
    Vec (N * (c * h * w))

    Cotangent at conv₂'s output — r34IdCotA through bn₂'s backward. Feeds W₂/b₂.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def Proofs.ResNet34TieB.r34IdCotN1 (N h w : ℕ) {c : ℕ} (p : R34IdW c) (xin dyOut : Vec (N * (c * h * w))) :
      Vec (N * (c * h * w))

      Cotangent at bn₁'s output — conv₂'s input-VJP masked by the body's mid-relu. Feeds γ₁/β₁.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def Proofs.ResNet34TieB.r34IdCotC1 (N h w : ℕ) {c : ℕ} (p : R34IdW c) (xin dyOut : Vec (N * (c * h * w))) :
        Vec (N * (c * h * w))

        Cotangent at conv₁'s output — r34IdCotN1 through bn₁'s backward. Feeds W₁/b₁.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def Proofs.ResNet34TieB.r34IdCotIn (N h w : ℕ) {c : ℕ} (p : R34IdW c) (xin dyOut : Vec (N * (c * h * w))) :
          Vec (N * (c * h * w))

          The block-INPUT cotangent: the residual fan-in addVB(convBack(dn1), da) the render emits — the body branch plus the identity skip.

          Equations
          Instances For
            theorem Proofs.ResNet34TieB.r34IdCotIn_eq_vjp (N h w : ℕ) {c : ℕ} (p : R34IdW c) (hq : R34IdPos p) (xin dyOut : Vec (N * (c * h * w))) (hs : R34IdSmoothAt N h w p xin) :
            r34IdCotIn N h w p xin dyOut = (r34IdBHasVJPAt N h w p hq xin hs).backward dyOut

            The emitted fan-in IS the certified block VJP's backward. Not a re-derivation: the render's seven-node backward subgraph denotes (r34IdBHasVJPAt …).backward dyOut, which is r34BasicBlockBackBatchedGraph_faithful read in this file's vocabulary. This is what makes the cross-block thread a composition of certified VJPs.

            ResNet34RenderB.downBackGradB adds one branch to the identity block's chain:

            %da  = selectPosB(a)   %dn2 = bnBatchBack(g2,c2)  %dc2 = convBackBatched(W2)
            %dr1 = selectPosB(n1)  %dn1 = bnBatchBack(g1,c1)  %dc1 = convStridedBackBatched(W1)
            %dnp = bnBatchBack(gp,cp)                          %dcp = convStridedBackBatched(Wp)
            %dx  = addVB(%dc1, %dcp)
            

            so bnₚ's γ/β read the SAME %da that bn₂'s do — both feed the one addVB — and the projection's Wp/bp read %dnp.

            @[reducible]
            noncomputable def Proofs.ResNet34TieB.r34DownPre (N h w : ℕ) {ic oc : ℕ} (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) :
            Vec (N * (oc * h * w))

            The downsample block's pre-relu sum, as r34DownB composes it.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              noncomputable def Proofs.ResNet34TieB.r34DownCotA (N h w : ℕ) {ic oc : ℕ} (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :
              Vec (N * (oc * h * w))

              Cotangent at the pre-relu sum. Feeds bn₂'s AND bnₚ's γ/β — they share the one addVB.

              Equations
              Instances For
                noncomputable def Proofs.ResNet34TieB.r34DownCotC2 (N h w : ℕ) {ic oc : ℕ} (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :
                Vec (N * (oc * h * w))

                Cotangent at conv₂'s output. Feeds W₂/b₂.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  noncomputable def Proofs.ResNet34TieB.r34DownCotN1 (N h w : ℕ) {ic oc : ℕ} (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :
                  Vec (N * (oc * h * w))

                  Cotangent at bn₁'s output. Feeds γ₁/β₁.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def Proofs.ResNet34TieB.r34DownCotC1 (N h w : ℕ) {ic oc : ℕ} (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :
                    Vec (N * (oc * h * w))

                    Cotangent at the STRIDED conv₁'s output. Feeds W₁/b₁.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      noncomputable def Proofs.ResNet34TieB.r34DownCotCp (N h w : ℕ) {ic oc : ℕ} (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :
                      Vec (N * (oc * h * w))

                      Cotangent at the PROJECTION conv's output. Feeds Wp/bp; its BN's γ/β read r34DownCotA.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        noncomputable def Proofs.ResNet34TieB.r34DownCotIn (N h w : ℕ) {ic oc : ℕ} (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :
                        Vec (N * (ic * (2 * h) * (2 * w)))

                        The block-INPUT cotangent: the projected-residual fan-in addVB(%dc1, %dcp). Both operands are real backward subgraphs here — unlike the identity block, where the skip passes %da through verbatim.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Proofs.ResNet34TieB.r34DownCotIn_eq_vjp (N h w : ℕ) {ic oc : ℕ} (p : R34DownW ic oc) (hq : R34DownPos p) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) (hs : R34DownSmoothAt N h w p xin) :
                          r34DownCotIn N h w p xin dyOut = (r34DownBHasVJPAt N h w p hq xin hs).backward dyOut

                          The projected fan-in IS the certified downsample-block VJP's backward. The identity block's r34IdCotIn_eq_vjp at the strided shape. One add_comm: the render emits addVB(body, projection) and r34DownBlockBackBatchedGraph builds addV(projection, body). Same vector, and the emitted order is the one this file threads.

                          ResNet34RenderB, after the sixteen block backwards:

                          %dmp = maxPool3s2BackB(str)   %dsr = selectPosB(stn)   %dsn = bnBatchBack(sg, stc)
                          

                          with sW,sb ← %dsn and sg,sbt ← %dsr.

                          noncomputable def Proofs.ResNet34TieB.r34StemCotP (N h w : ℕ) {ic oc : ℕ} (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (cotPool : Vec (N * (oc * h * w))) :
                          Vec (N * (oc * (2 * h) * (2 * w)))

                          Cotangent at the stem's post-relu, pre-pool activation — the 3×3/s2 pool's backward applied to the cotangent block 1 delivers at its input.

                          Equations
                          Instances For
                            noncomputable def Proofs.ResNet34TieB.r34StemCotN (N h w : ℕ) {ic oc : ℕ} (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (cotPool : Vec (N * (oc * h * w))) :
                            Vec (N * (oc * (2 * h) * (2 * w)))

                            Cotangent at the stem BN's output — the stem relu's mask. Feeds γs/βs.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              noncomputable def Proofs.ResNet34TieB.r34StemCotC (N h w : ℕ) {ic oc : ℕ} (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (cotPool : Vec (N * (oc * h * w))) :
                              Vec (N * (oc * (2 * h) * (2 * w)))

                              Cotangent at the stem conv's output. Feeds sW/sb.

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

                                Each conjunct is GradNodesB's ∀ cot fold instantiated at the cotangent the render's chain delivers, so nothing here is a new proof: the bundles are GradNodesB's folds with the freedom removed. reassocB bridges the conv/relu index N·(c·h·w) to the BatchNorm parameter ops' N·(c·(h·w)).

                                The two conv-BIAS conjuncts in each block are about conv{,Strided}BiasGradB, which the committed artifacts do NOT emit — both renders run convBias := false and bind the bias operand to zeroBiasPrelude's zero constant. They are kept because they cost one delegation each and they cover the flag.

                                def Proofs.ResNet34TieB.r34IdTiedB (N h w : ℕ) {c : ℕ} (xN cotN vN epsStr : String) (p : R34IdW c) (bf16 : Bool) (xin dyOut : Vec (N * (c * h * w))) :

                                Identity basic block, tied. All eight parameter nodes — conv₁/conv₂ weight and bias, bn₁/bn₂ γ and β — denote the certified batched Σ_n gradient at the real forward activations and the real backward-chain cotangent driven by dyOut.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Proofs.ResNet34TieB.r34_idblock_tiedB (N h w : ℕ) {c : ℕ} (xN cotN vN epsStr : String) (p : R34IdW c) (bf16 : Bool) (xin dyOut : Vec (N * (c * h * w))) :
                                  r34IdTiedB N h w xN cotN vN epsStr p bf16 xin dyOut
                                  def Proofs.ResNet34TieB.r34DownTiedB (N h w : ℕ) {ic oc : ℕ} (xN cotN vN epsStr : String) (p : R34DownW ic oc) (bf16 : Bool) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :

                                  Downsample basic block, tied. All twelve parameter nodes — the STRIDED conv₁, the stride-1 conv₂ and the 1×1/s2 option-B projection, each with bias and BatchNorm γ/β. Both stride-2 sites are SYMMETRIC padding (convStrided*GradB, whose den is flatConvStride2_*), which is ResNet's convention and NOT B0's or MobileNetV2's XLA-SAME.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem Proofs.ResNet34TieB.r34_downblock_tiedB (N h w : ℕ) {ic oc : ℕ} (xN cotN vN epsStr : String) (p : R34DownW ic oc) (bf16 : Bool) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :
                                    r34DownTiedB N h w xN cotN vN epsStr p bf16 xin dyOut
                                    def Proofs.ResNet34TieB.r34StemTiedB (N h w : ℕ) {ic oc : ℕ} (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (bf16 : Bool) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (cotPool : Vec (N * (oc * h * w))) :

                                    Stem, tied. The 7×7/s2 conv's weight and bias and its BatchNorm's γ/β, at the cotangent that reaches the stem through block 1's input fan-in and the 3×3/s2 pool's backward.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem Proofs.ResNet34TieB.r34_stem_tiedB (N h w : ℕ) {ic oc : ℕ} (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (bf16 : Bool) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (cotPool : Vec (N * (oc * h * w))) :
                                      r34StemTiedB N h w xN cotN vN epsStr Ws bs εs γs βs bf16 x cotPool
                                      noncomputable def Proofs.ResNet34TieB.r34HeadCotBlk (N h w : ℕ) {c nCls : ℕ} (Wd : Mat c nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (dy : Vec (N * nCls)) :
                                      Vec (N * (c * h * w))

                                      The head's block-side cotangent, as the CERTIFIED head backward delivers it. The head is batchMap(dense) ∘ batchMap(GAP) — both smooth, both batchMap of a per-example op — so r34HeadBHasVJP is global and this needs no smoothness hypothesis, which is the one place in the whole net where that is true.

                                      Equations
                                      Instances For
                                        def Proofs.ResNet34TieB.r34HeadTiedB (N h w : ℕ) {c nCls : ℕ} (xN cotN : String) (Wd : Mat c nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (dy : Vec (N * nCls)) :

                                        Head, tied. The classifier's weight and bias nodes denote the certified batched Σ_n gradient at the real GAP output and the loss cotangent. The bias conjunct's Jacobian witness carries a zero activation rather than the real one: dense's derivative in b is the identity whatever x is, so the statement is x-free and there is no per-example choice to make (the same shape EfficientNetStepTie's bias conjuncts take).

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          theorem Proofs.ResNet34TieB.r34_head_tiedB (N h w : ℕ) {c nCls : ℕ} (xN cotN : String) (Wd : Mat c nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (dy : Vec (N * nCls)) :
                                          r34HeadTiedB N h w xN cotN Wd bd xin dy
                                          theorem Proofs.ResNet34TieB.r34_net_tiedB (N : ℕ) {nCls : ℕ} (xN cotN vN epsStr aStr negAK bStr logN ohN : String) (α B : ℝ) (w : R34BWeights nCls) (bf16 : Bool) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (t : Vec (N * (1 * nCls))) :
                                          have g := BackLinks.unrowB N nCls (StableHLO.den (smoothedLossCotGraph N nCls α B aStr negAK bStr logN ohN (BackLinks.rowB N nCls (resnet34ForwardBFull N w x)) t)); have dyE1 := r34HeadCotBlk N 7 7 w.Wd w.bd (r34Pre16 N w x) g; have dyE0 := r34IdCotIn N 7 7 w.e1 (r34Pre15 N w x) dyE1; have dyD4 := r34IdCotIn N 7 7 w.e0 (r34Pre14 N w x) dyE0; have dyC4 := r34DownCotIn N 7 7 w.d4 (r34Pre13 N w x) dyD4; have dyC3 := r34IdCotIn N 14 14 w.c4 (r34Pre12 N w x) dyC4; have dyC2 := r34IdCotIn N 14 14 w.c3 (r34Pre11 N w x) dyC3; have dyC1 := r34IdCotIn N 14 14 w.c2 (r34Pre10 N w x) dyC2; have dyC0 := r34IdCotIn N 14 14 w.c1 (r34Pre9 N w x) dyC1; have dyD3 := r34IdCotIn N 14 14 w.c0 (r34Pre8 N w x) dyC0; have dyB2 := r34DownCotIn N 14 14 w.d3 (r34Pre7 N w x) dyD3; have dyB1 := r34IdCotIn N 28 28 w.b2 (r34Pre6 N w x) dyB2; have dyB0 := r34IdCotIn N 28 28 w.b1 (r34Pre5 N w x) dyB1; have dyD2 := r34IdCotIn N 28 28 w.b0 (r34Pre4 N w x) dyB0; have dyA2 := r34DownCotIn N 28 28 w.d2 (r34Pre3 N w x) dyD2; have dyA1 := r34IdCotIn N 56 56 w.a2 (r34Pre2 N w x) dyA2; have dyA0 := r34IdCotIn N 56 56 w.a1 (r34Pre1 N w x) dyA1; have cotPool := r34IdCotIn N 56 56 w.a0 (r34Pre0 N w x) dyA0; r34StemTiedB N 56 56 xN cotN vN epsStr w.sW w.sb w.sε w.sγ w.sβ bf16 x cotPool ∧ r34IdTiedB N 56 56 xN cotN vN epsStr w.a0 bf16 (r34Pre0 N w x) dyA0 ∧ r34IdTiedB N 56 56 xN cotN vN epsStr w.a1 bf16 (r34Pre1 N w x) dyA1 ∧ r34IdTiedB N 56 56 xN cotN vN epsStr w.a2 bf16 (r34Pre2 N w x) dyA2 ∧ r34DownTiedB N 28 28 xN cotN vN epsStr w.d2 bf16 (r34Pre3 N w x) dyD2 ∧ r34IdTiedB N 28 28 xN cotN vN epsStr w.b0 bf16 (r34Pre4 N w x) dyB0 ∧ r34IdTiedB N 28 28 xN cotN vN epsStr w.b1 bf16 (r34Pre5 N w x) dyB1 ∧ r34IdTiedB N 28 28 xN cotN vN epsStr w.b2 bf16 (r34Pre6 N w x) dyB2 ∧ r34DownTiedB N 14 14 xN cotN vN epsStr w.d3 bf16 (r34Pre7 N w x) dyD3 ∧ r34IdTiedB N 14 14 xN cotN vN epsStr w.c0 bf16 (r34Pre8 N w x) dyC0 ∧ r34IdTiedB N 14 14 xN cotN vN epsStr w.c1 bf16 (r34Pre9 N w x) dyC1 ∧ r34IdTiedB N 14 14 xN cotN vN epsStr w.c2 bf16 (r34Pre10 N w x) dyC2 ∧ r34IdTiedB N 14 14 xN cotN vN epsStr w.c3 bf16 (r34Pre11 N w x) dyC3 ∧ r34IdTiedB N 14 14 xN cotN vN epsStr w.c4 bf16 (r34Pre12 N w x) dyC4 ∧ r34DownTiedB N 7 7 xN cotN vN epsStr w.d4 bf16 (r34Pre13 N w x) dyD4 ∧ r34IdTiedB N 7 7 xN cotN vN epsStr w.e0 bf16 (r34Pre14 N w x) dyE0 ∧ r34IdTiedB N 7 7 xN cotN vN epsStr w.e1 bf16 (r34Pre15 N w x) dyE1 ∧ r34HeadTiedB N 7 7 xN cotN w.Wd w.bd (r34Pre16 N w x) g

                                          The whole batch-BN ResNet-34 train step, tied. Threading resnet34ForwardBFull's own prefixes as the block inputs and the label-smoothed loss cotangent down through the certified head backward and the sixteen certified block backwards, every parameter GRADIENT node of the net — stem 4, thirteen identity blocks × 8, three downsample blocks × 12, dense 2 — denotes the certified batched Σ_n gradient. No free activation and no symbolic cotangent.

                                          N is a binder and there is no smoothness hypothesis. The folds are ∀ cot statements instantiated at explicitly-constructed cotangents, so the capstone needs neither 0 < ε nor a relu-kink condition. Those enter only in r34IdCotIn_eq_vjp / r34DownCotIn_eq_vjp, which say the constructed chain IS the certified whole-net backward — the two halves of the tie, kept apart because they have different hypotheses.

                                          Of the 146 conjunct slots, the committed artifacts exercise 110: both r34 renders run convBias := false, so the 36 conv-bias nodes are not emitted (the biases are zeroBiasPrelude's zero constants).

                                          One replica. In resnet34in_momdp64 every gradient node feeds allReduceMeanF, an AST node; ResNet34SyncTieB.r34_net_syncTiedB is the data-parallel step, and its right-hand sides are this theorem's nodes at N := R·N. bf16 selects the conv weight nodes' kind: false is the f32 artifacts' node, true the bf16 kind resnet34in_momdp64bf16 emits (convWeightGradBBf16), read over ℝ at the identity rounding (Bf16Erasure); the right-hand side is the same certified gradient at either value.

                                          theorem Proofs.ResNet34TieB.r34_lossCot_is_smoothedCE_grad (N : ℕ) {nCls : ℕ} (hK : 0 < nCls) (aStr negAK bStr logN ohN : String) (α B : ℝ) (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (t : Vec (N * (1 * nCls))) (n : Fin N) (j : Fin nCls) (ht : ∑ k : Fin nCls, Mat.unflatten (StableHLO.batchSlice N (1 * nCls) t n) 0 k = 1) :
                                          StableHLO.den (smoothedLossCotGraph N nCls α B aStr negAK bStr logN ohN (BackLinks.rowB N nCls (resnet34ForwardBFull N w x)) t) (finProdFinEquiv (n, finProdFinEquiv (0, j))) = pdiv (fun (z' : Vec nCls) (x : Fin 1) => softCE nCls (smoothTarget nCls α (Mat.unflatten (StableHLO.batchSlice N (1 * nCls) t n) 0)) z') (Mat.unflatten (StableHLO.batchSlice N (1 * nCls) (BackLinks.rowB N nCls (resnet34ForwardBFull N w x)) n) 0) j 0 / B

                                          And the cotangent the capstone threads is the smoothed loss's gradient. Row by row: the g above is, at example n and class j, (1/B)·∂/∂logits of soft-target cross-entropy against the SMOOTHED target (1−α)·t + α/K, at that example's real logits. The only hypothesis is that the example's target sums to 1 — a one-hot, or mixup's convex combination of two. Together with the capstone: every parameter gradient node is the certified per-op gradient at the cotangent the rendered chain delivers from the loss the trainer minimises; at a smooth point with positive epsilons (R34IdSmoothAt / R34DownSmoothAt, R34IdPos / R34DownPos, via r34IdCotIn_eq_vjp / r34DownCotIn_eq_vjp) the block-input cotangents are the certified block backwards.