Documentation

LeanMlir.Proofs.Nets.ResNet.ResNet50StepTieB

ResNet-50's T3 §1a TIE — the un-fused, batched whole-net thread #

ResNet34FoldB.lean's op-kind folds (ResNet34PoCB.*GradB_den) make every parameter GRADIENT node of ResNet-50's batched train step den-faithful for an ARBITRARY cotangent. This removes the "arbitrary": each 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. With T1 and T2 that is ResNet-50's T3, and it makes this the third net whose train-step tie is about the artifact its quoted accuracy comes from.

⭐⭐ The block cotangents are NOT derived here. ResNet50FullBVJP.lean's r50{Id,Proj,Down}B_has_vjp_at ARE the certified block backwards, and ResNet50BackB0.lean's r50{Bottleneck,ProjBlock,DownBlock}BackBatchedGraph_faithful family already proves the emitted backward subgraph denotes exactly them. The three *CotIn_eq_vjp lemmas below are that statement in this file's vocabulary, so the cross-block chain is a composition of certified VJPs rather than a re-derivation — the economy ResNet-34's 4.2a and MobileNetV2's 4.2c both took.

⭐⭐ THE LOSS COTANGENT IS A BINDER, and for this net it had to be. ResNet-34's and MobileNetV2's capstones compute g internally from smoothedLossCotGraph. ResNet-50 ships BOTH losses: bce := false artifacts carry the six-op label-smoothed softmax chain and bce := true ones — including resnet50in160_lambaccdp8x64bce, where the 76.66% comes from — carry BCE-with-logits' three-op chain. So r50_net_tiedB takes g as a hypothesis and the two loss corollaries instantiate it: r50_lossCot_is_smoothedCE_grad and r50_lossCot_is_bce_grad. That is 4b's "the head takes g as a BINDER" made necessary rather than merely tidier.

The stem tie is three nodes, not four, and the head tie is ResNet-34's. ResNet50RenderB has no convBias flag at all — its zb bakes false — so no conv-bias gradient op is ever emitted and there is nothing to keep "to cover the flag", unlike r34's and MobileNetV2's ties. ResNet34TieB.r34HeadTiedB is generic in {c nCls} and r34HeadCotBlk in the same, so the head is reused verbatim at 2048 channels — as r34HeadB itself was in T1.

The emitted chain, node for node #

ResNet50RenderB.bnkIdBackGradB, from the block-output cotangent dyOut:

%da  = selectPosB(a)     %dn3 = bnBatchBack(g3, c3)   %dc3 = convBackBatched(W3)
%dr2 = selectPosB(n2)    %dn2 = bnBatchBack(g2, c2)   %dc2 = convBackBatched(W2)
%dr1 = selectPosB(n1)    %dn1 = bnBatchBack(g1, c1)   %dc1 = convBackBatched(W1)
%dx  = addVB(%dc1, %da)

and the nine parameter nodes read W1 ← %dn1, g1/bt1 ← %dr1, W2 ← %dn2, g2/bt2 ← %dr2, W3 ← %dn3, g3/bt3 ← %da. ⚠ Off by one on any of those and the gradient is silently wrong; the render's own comment records the same trap on the stochastic-depth cotangent.

The projection blocks add %dnp = bnBatchBack(gp, cp, %da) and %dcp = convBack(Wp), and their fan-in is addVB(%dc1, %dcp) — both branches nontrivial.

Honest residual #

One add_comm per projection form. The render emits addVB(body, projection) where residualProj proj body adds proj + body, so r50{Proj,Down}CotIn_eq_vjp carry a commutation. The identity block needs none. Same seam T2's graph faithfulness has, for the same reason.

ONE REPLICA. In resnet50in160_lambaccdp8x64bce every gradient node feeds allReduceMeanF — the collective as an AST node since 4d piece 2 (2026-09-07), until then emitted text outside the AST — so every statement here is at the per-replica gradient node and Foundation/DataParallelNode.lean composes it with the replica mean (§4d). The 8× accumulation sits between the gradient and the optimizer as momVNextF at (μ := akeep), and the LAMB tail is lamb_triple_faithful — both certified, neither part of this file.

No smoothness hypothesis in the capstone, exactly as r34's and mnv2's: the folds are ∀ cot statements instantiated at explicitly constructed cotangents. The relu-kink and positivity conditions enter ONLY in the three *CotIn_eq_vjp lemmas, which say those cotangents ARE the certified whole-net backward. N and q are both binders.

noncomputable def Proofs.ResNet50TieB.r50IdCotA (N h w : ) {mid oc : } (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :
Vec (N * (oc * h * w))

Cotangent at the block's pre-relu sum a — the outer relu's mask applied to dyOut. 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.ResNet50TieB.r50IdCotC3 (N h w : ) {mid oc : } (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :
    Vec (N * (oc * h * w))

    Cotangent at conv₃'s output — r50IdCotA through bn₃'s backward. Feeds W₃.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def Proofs.ResNet50TieB.r50IdCotN2 (N h w : ) {mid oc : } (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :
      Vec (N * (mid * h * w))

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

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def Proofs.ResNet50TieB.r50IdCotC2 (N h w : ) {mid oc : } (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :
        Vec (N * (mid * h * w))

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

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def Proofs.ResNet50TieB.r50IdCotN1 (N h w : ) {mid oc : } (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :
          Vec (N * (mid * h * w))

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

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def Proofs.ResNet50TieB.r50IdCotC1 (N h w : ) {mid oc : } (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :
            Vec (N * (mid * h * w))

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

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              noncomputable def Proofs.ResNet50TieB.r50IdCotIn (N h w : ) {mid oc : } (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :
              Vec (N * (oc * h * w))

              The block-INPUT cotangent: the residual fan-in addVB(convBack(dn1), da) the render emits.

              Equations
              Instances For
                theorem Proofs.ResNet50TieB.r50IdCotIn_eq_vjp (N h w : ) {mid oc : } (p : R50IdW mid oc) (hq : R50IdPos p) (xin dyOut : Vec (N * (oc * h * w))) (hs : R50IdSmoothAt N h w p xin) (cotN : String) :
                r50IdCotIn N h w p xin dyOut = (r50IdB_has_vjp_at N h w p hq xin hs).backward dyOut

                ⭐⭐ The emitted fan-in IS the certified bottleneck VJP's backward. rfl after the graph lemma: the render's ten-node backward subgraph denotes (r50IdB_has_vjp_at …).backward dyOut.

                noncomputable def Proofs.ResNet50TieB.r50ProjCotA (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                Vec (N * (oc * h * w))

                Cotangent at the pre-relu sum. Feeds bn₃'s AND the projection's γ/β, and the projection's whole backward branch.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  noncomputable def Proofs.ResNet50TieB.r50ProjCotC3 (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                  Vec (N * (oc * h * w))

                  Cotangent at conv₃'s output. Feeds W₃.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def Proofs.ResNet50TieB.r50ProjCotN2 (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                    Vec (N * (mid * 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.ResNet50TieB.r50ProjCotC2 (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                      Vec (N * (mid * h * w))

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

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        noncomputable def Proofs.ResNet50TieB.r50ProjCotN1 (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                        Vec (N * (mid * 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.ResNet50TieB.r50ProjCotC1 (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                          Vec (N * (mid * h * w))

                          Cotangent at conv₁'s output. Feeds W₁.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def Proofs.ResNet50TieB.r50ProjCotCp (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                            Vec (N * (oc * h * w))

                            Cotangent at the PROJECTION conv's output — r50ProjCotA through the skip BN's backward. Feeds Wp. ⚠ It reads the UNMASKED-by-drop %da, which is the render's rule: the projection branch is never dropped.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              noncomputable def Proofs.ResNet50TieB.r50ProjCotIn (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                              Vec (N * (ic * h * w))

                              The block-INPUT cotangent: addVB(convBack(dn1), convBack(dnp)) — both branches nontrivial, unlike the identity block's.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem Proofs.ResNet50TieB.r50ProjCotIn_eq_vjp (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (hq : R50ProjPos p) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) (hs : R50ProjSmoothAt N h w p xin) (cotN : String) :
                                r50ProjCotIn N h w p xin dyOut = (r50ProjB_has_vjp_at N h w p hq xin hs).backward dyOut

                                The projected fan-in IS the certified stride-1 projection block's backward. ⚠ One add_comm: the render emits addVB(body, projection) and the graph builds addV(projection, body).

                                noncomputable def Proofs.ResNet50TieB.r50DownCotA (N h w : ) {ic mid oc : } (p : R50ProjW ic mid 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.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  noncomputable def Proofs.ResNet50TieB.r50DownCotC3 (N h w : ) {ic mid oc : } (p : R50ProjW ic mid 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₃ (a stride-1 1×1 at h × w).

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

                                    Cotangent at bn₂'s output, at h × w. Feeds γ₂/β₂.

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

                                      Cotangent at the STRIDED conv₂'s output. Feeds W₂.

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

                                        Cotangent at bn₁'s output — at the INPUT grid 2h × 2w, because conv₂ upsamples. Feeds γ₁/β₁. ⚠⚠ Writing this at h × w typechecks nowhere, and it is the one place a reader can get v1.5's shape wrong.

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

                                          Cotangent at conv₁'s output, at 2h × 2w. Feeds W₁, an ORDINARY conv weight gradient.

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

                                            Cotangent at the STRIDED projection conv's output. Feeds Wp.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              noncomputable def Proofs.ResNet50TieB.r50DownCotIn (N h w : ) {ic mid oc : } (p : R50ProjW ic mid 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: addVB(convBack(dn1), convStridedBack(dnp)).

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem Proofs.ResNet50TieB.r50DownCotIn_eq_vjp (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (hq : R50ProjPos p) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) (hs : R50DownSmoothAt N h w p xin) (cotN : String) :
                                                r50DownCotIn N h w p xin dyOut = (r50DownB_has_vjp_at N h w p hq xin hs).backward dyOut

                                                The projected fan-in IS the certified strided block's backward. One add_comm, as the stride-1 projection's is.

                                                Each conjunct is a ResNet34PoCB op-kind fold instantiated at the cotangent the render's chain delivers, so nothing here is a new proof: the bundles are the §1 fold with the freedom removed. reassocB bridges the conv/relu index N·(c·h·w) to the BatchNorm parameter ops' N·(c·(h·w)). ⛔ There are NO conv-bias conjuncts: ResNet50RenderB has no convBias flag, so those ops are never emitted and every slot here is exercised by the artifact.

                                                def Proofs.ResNet50TieB.r50IdTiedB (N h w : ) {mid oc : } (xN cotN vN epsStr : String) (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :

                                                Identity bottleneck, tied. All NINE parameter nodes — three conv weights and three BatchNorm γ/β pairs — denote the certified batched Σ_n gradient at the real forward activations and the real backward-chain cotangent driven by dyOut. ⚠ Each BatchNorm's γ/β reads the cotangent at THAT BatchNorm's output (cotN1, cotN2, cotA) while its conv reads the one at the conv's output (cotC1, cotC2, cotC3); off by one and the gradient is silently wrong.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  theorem Proofs.ResNet50TieB.r50_idblock_tiedB (N h w : ) {mid oc : } (xN cotN vN epsStr : String) (p : R50IdW mid oc) (xin dyOut : Vec (N * (oc * h * w))) :
                                                  r50IdTiedB N h w xN cotN vN epsStr p xin dyOut
                                                  def Proofs.ResNet50TieB.r50ProjTiedB (N h w : ) {ic mid oc : } (xN cotN vN epsStr : String) (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :

                                                  Stride-1 projection bottleneck, tied. Twelve nodes: the identity block's nine plus the 1×1 skip's weight and its BatchNorm γ/β. ⚠ The skip's conv is an ORDINARY convWeightGradB — stage 1 block 0 changes channels but not resolution, which is the whole reason this block form exists. ⚠ The skip's three nodes read cotA, the UNMASKED post-relu cotangent: the projection branch is never stochastic-depth dropped, which is the render's own rule.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    theorem Proofs.ResNet50TieB.r50_projblock_tiedB (N h w : ) {ic mid oc : } (xN cotN vN epsStr : String) (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * h * w))) (dyOut : Vec (N * (oc * h * w))) :
                                                    r50ProjTiedB N h w xN cotN vN epsStr p xin dyOut
                                                    def Proofs.ResNet50TieB.r50DownTiedB (N h w : ) {ic mid oc : } (xN cotN vN epsStr : String) (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :

                                                    Strided projection bottleneck, tied. Twelve nodes, and TWO of the four conv weights are the strided op. ⚠⚠ v1.5: W₁ is an ordinary convWeightGradB at the INPUT grid 2h × 2w and its BatchNorm reduces there too; only W₂ (the 3×3) and Wp (the skip) are strided. Both strided nodes are SYMMETRIC padding — flatConvStride2, not the XLA-SAME twin B0 and MobileNetV2 use.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      theorem Proofs.ResNet50TieB.r50_downblock_tiedB (N h w : ) {ic mid oc : } (xN cotN vN epsStr : String) (p : R50ProjW ic mid oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyOut : Vec (N * (oc * h * w))) :
                                                      r50DownTiedB N h w xN cotN vN epsStr p xin dyOut
                                                      theorem Proofs.ResNet50TieB.r50_net_tiedB (N q : ) {nCls : } (xN cotN vN epsStr : String) (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) (g : Vec (N * nCls)) :
                                                      have dy16 := ResNet34TieB.r34HeadCotBlk N q q w.Wd w.bd (r50Pre16 N q w x) g; have dy15 := r50IdCotIn N q q w.s4b2 (r50Pre15 N q w x) dy16; have dy14 := r50IdCotIn N q q w.s4b1 (r50Pre14 N q w x) dy15; have dy13 := r50DownCotIn N q q w.s4b0 (r50Pre13 N q w x) dy14; have dy12 := r50IdCotIn N (2 * q) (2 * q) w.s3b5 (r50Pre12 N q w x) dy13; have dy11 := r50IdCotIn N (2 * q) (2 * q) w.s3b4 (r50Pre11 N q w x) dy12; have dy10 := r50IdCotIn N (2 * q) (2 * q) w.s3b3 (r50Pre10 N q w x) dy11; have dy9 := r50IdCotIn N (2 * q) (2 * q) w.s3b2 (r50Pre9 N q w x) dy10; have dy8 := r50IdCotIn N (2 * q) (2 * q) w.s3b1 (r50Pre8 N q w x) dy9; have dy7 := r50DownCotIn N (2 * q) (2 * q) w.s3b0 (r50Pre7 N q w x) dy8; have dy6 := r50IdCotIn N (2 * (2 * q)) (2 * (2 * q)) w.s2b3 (r50Pre6 N q w x) dy7; have dy5 := r50IdCotIn N (2 * (2 * q)) (2 * (2 * q)) w.s2b2 (r50Pre5 N q w x) dy6; have dy4 := r50IdCotIn N (2 * (2 * q)) (2 * (2 * q)) w.s2b1 (r50Pre4 N q w x) dy5; have dy3 := r50DownCotIn N (2 * (2 * q)) (2 * (2 * q)) w.s2b0 (r50Pre3 N q w x) dy4; have dy2 := r50IdCotIn N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b2 (r50Pre2 N q w x) dy3; have dy1 := r50IdCotIn N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b1 (r50Pre1 N q w x) dy2; have cotPool := r50ProjCotIn N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b0 (r50Pre0 N q w x) dy1; ResNet34TieB.r34StemTiedB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) xN cotN vN epsStr w.sW w.sb w. w. w. x cotPool r50ProjTiedB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) xN cotN vN epsStr w.s1b0 (r50Pre0 N q w x) dy1 r50IdTiedB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) xN cotN vN epsStr w.s1b1 (r50Pre1 N q w x) dy2 r50IdTiedB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) xN cotN vN epsStr w.s1b2 (r50Pre2 N q w x) dy3 r50DownTiedB N (2 * (2 * q)) (2 * (2 * q)) xN cotN vN epsStr w.s2b0 (r50Pre3 N q w x) dy4 r50IdTiedB N (2 * (2 * q)) (2 * (2 * q)) xN cotN vN epsStr w.s2b1 (r50Pre4 N q w x) dy5 r50IdTiedB N (2 * (2 * q)) (2 * (2 * q)) xN cotN vN epsStr w.s2b2 (r50Pre5 N q w x) dy6 r50IdTiedB N (2 * (2 * q)) (2 * (2 * q)) xN cotN vN epsStr w.s2b3 (r50Pre6 N q w x) dy7 r50DownTiedB N (2 * q) (2 * q) xN cotN vN epsStr w.s3b0 (r50Pre7 N q w x) dy8 r50IdTiedB N (2 * q) (2 * q) xN cotN vN epsStr w.s3b1 (r50Pre8 N q w x) dy9 r50IdTiedB N (2 * q) (2 * q) xN cotN vN epsStr w.s3b2 (r50Pre9 N q w x) dy10 r50IdTiedB N (2 * q) (2 * q) xN cotN vN epsStr w.s3b3 (r50Pre10 N q w x) dy11 r50IdTiedB N (2 * q) (2 * q) xN cotN vN epsStr w.s3b4 (r50Pre11 N q w x) dy12 r50IdTiedB N (2 * q) (2 * q) xN cotN vN epsStr w.s3b5 (r50Pre12 N q w x) dy13 r50DownTiedB N q q xN cotN vN epsStr w.s4b0 (r50Pre13 N q w x) dy14 r50IdTiedB N q q xN cotN vN epsStr w.s4b1 (r50Pre14 N q w x) dy15 r50IdTiedB N q q xN cotN vN epsStr w.s4b2 (r50Pre15 N q w x) dy16 ResNet34TieB.r34HeadTiedB N q q xN cotN w.Wd w.bd (r50Pre16 N q w x) g

                                                      ⭐⭐ The whole batch-BN ResNet-50 train step, tied. Threading resnet50ForwardB_full's own prefixes as the block inputs and an arbitrary loss cotangent g down through the certified head backward and the sixteen certified bottleneck backwards, every parameter GRADIENT node of the net — stem 3, twelve identity bottlenecks × 9, four projection bottlenecks × 12, dense 2 — denotes the certified batched Σ_n gradient. That is 161, the render's own census and the signature of resnet50_fwd.mlir minus %x. No free activation and no symbolic cotangent below the loss.

                                                      ⭐⭐ g IS A BINDER, and for this net it had to be. ResNet-50 ships both losses — the label-smoothed softmax chain on the bce := false artifacts and BCE-with-logits' three-op chain on the bce := true ones, including resnet50in160_lambaccdp8x64bce where the quoted 76.66% comes from. r50_lossCot_is_smoothedCE_grad and r50_lossCot_is_bce_grad instantiate it; neither is privileged.

                                                      No smoothness hypothesis, no 0 < ε, and N and q are both binders. The folds are ∀ cot statements at explicitly constructed cotangents. The kink and positivity conditions enter only in r50{Id,Proj,Down}CotIn_eq_vjp, which say those cotangents ARE the certified whole-net backward — the two halves of the tie, kept apart because they have different hypotheses.

                                                      One replica. In resnet50in160_lambaccdp8x64bce every gradient node feeds allReduceMeanF, an AST node since 4d piece 2 (DataParallelNode.lean, §4d), and the 8× accumulation and the LAMB tail sit downstream of every node named here.

                                                      theorem Proofs.ResNet50TieB.r50_lossCot_is_smoothedCE_grad (N q : ) {nCls : } (hK : 0 < nCls) (aStr negAK bStr logN ohN : String) (α B : ) (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) (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 (ResNet34TieB.rowB N nCls (resnet50ForwardB_full N q 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) (ResNet34TieB.rowB N nCls (resnet50ForwardB_full N q w x)) n) 0) j 0 / B

                                                      The label-smoothed cotangent, for every bce := false artifact. Row by row, the six-op chain ResNet50RenderB emits is (1/B)·∂/∂logits of soft-target cross-entropy against the SMOOTHED target, 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.

                                                      theorem Proofs.ResNet50TieB.r50_lossCot_is_bce_grad (N q : ) {nCls : } (bStr logN ohN : String) (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) (t : Vec (N * (1 * nCls))) (n : Fin N) (j : Fin nCls) :
                                                      StableHLO.den (bceLossCotGraph N nCls (N * nCls) bStr logN ohN (ResNet34TieB.rowB N nCls (resnet50ForwardB_full N q w x)) t) (finProdFinEquiv (n, finProdFinEquiv (0, j))) = pdiv (fun (z' : Vec nCls) (x : Fin 1) => bceLogits nCls (Mat.unflatten (StableHLO.batchSlice N (1 * nCls) t n) 0) z') (Mat.unflatten (StableHLO.batchSlice N (1 * nCls) (ResNet34TieB.rowB N nCls (resnet50ForwardB_full N q w x)) n) 0) j 0 / (N * nCls)

                                                      ⭐⭐ The BCE-with-logits cotangent, for every bce := true artifact — including the one the 76.66% comes from. Row by row, the three-op chain sigmoidB → subB → divConstB is ∂/∂logits of Σ_k (softplus(z_k) − t_k·z_k) at that example's real logits, over the baked N·K. ⚠⚠ The divisor is N·K, not N: timm's BinaryCrossEntropy is reduction='mean' over B×C, and at K = 1000 the two differ by 1000× on the effective step. ⭐ NO hypothesis on the target at all, where the smoothed-CE row needs its mass to be 1 — BCE is per-class and separable, which is the point under mixup.