Documentation

LeanMlir.Proofs.Nets.ResNet.ResNet50FullBVJP

ResNet-50's whole-net input-VJP at TRUE BATCH-NORM (T1, the VJP half) #

ResNet50FullB.lean states the batch-BN forward at the [3,4,6,3] bottleneck ladder. This file gives that forward a certified HasVJPAt — the last piece of T1 for the largest hole in the Proofs tier (planning/archive/proofs_tier_to_paper_nets.md §3.5(a)).

No new mathematics, and nothing new one tier down #

Every block VJP is already proven at bnBatchLA: r50BottleneckB_has_vjp_at, r50ProjBlockB_has_vjp_at and r50DownBlockB_has_vjp_at (ResNet50BackB0.lean) are exactly the three shapes r50IdB / r50ProjB / r50DownB unfold to. The bundle lemmas below are delegations in ResNet34FullBVJP.lean's style.

And unlike ResNet-34's, this file needed no new Foundation lemma. r34's T1 was blocked on batchMap_has_vjp_at (4.1c) for its stem pool. ResNet-50 has the same stem — and reuses r34StemB_has_vjp_at verbatim, so that lemma is spent rather than re-derived. The head is ResNet-34's too (r34HeadB_has_vjp, GLOBAL: GAP and dense are smooth and each is batchMap of a per-example op, so no hypothesis appears).

The hypothesis budget #

Pointwise (HasVJPAt), not global, and necessarily. relu is kinked. ⛔ And a BOTTLENECK carries THREE kink clauses, where ResNet-34's basic block carries two: the two interior relus and the post-residual OUTER relu. Sixteen blocks give 48 clauses, plus the stem's relu and the stem pool's no-tie condition — bundled per block into R50IdSmoothAt / R50ProjSmoothAt / R50DownSmoothAt so the apex binds 18 bundles rather than 50 loose hypotheses.

⚠ The pool's condition is per example (R34PoolSmoothAt, reused): a tie is a property of one image's 3×3 window, not of the batch.

0 < q is a real hypothesis here, where ResNet-34 needed none. r34's ladder is at literals, so 0 < 56 closes by norm_num; R50's is at the binder q, and the stem pool's VJP needs its output grid nonempty. At q = 0 the net is degenerate and the statement says so.

The running activations are named r50Pre1r50Pre16 so each bundle can be STATED at the activation entering its block without a sixteen-deep nested application inline; r50Pre16 doubles as the trunk, and resnet50ForwardB_full_eq_chain bridges it back to the committed nested-application forward.

N and q are both variables: this tier carries no numerals, so ONE statement covers resnet50in_fwd (q = 7, 224 px) and resnet50in160_fwd (q = 5, 160 px) — the net the quoted 76.66% trains — at every batch size.

structure Proofs.R50IdPos {mid oc : } (p : R50IdW mid oc) :

All three BatchNorm epsilons of an identity bottleneck are positive.

Instances For
    structure Proofs.R50ProjPos {ic mid oc : } (p : R50ProjW ic mid oc) :

    All four BatchNorm epsilons of a projection bottleneck are positive (body three, skip one). ⭐ One bundle for BOTH projection forms, as R50ProjW is one record for both.

    Instances For
      structure Proofs.R50IdSmoothAt (N h w : ) {mid oc : } (p : R50IdW mid oc) (v : Vec (N * (oc * h * w))) :

      The THREE relu sites of an identity bottleneck are away from the kink at v: the 1×1 reduce's BN output, the 3×3's BN output, and the post-residual sum. The 1×1 expand has no activation.

      Instances For
        structure Proofs.R50ProjSmoothAt (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (v : Vec (N * (ic * h * w))) :

        The three relu sites of the STRIDE-1 projection bottleneck at v. Identical to the identity block's except that the outer relu sits at the PROJECTED residual — both paths nontrivial.

        Instances For
          structure Proofs.R50DownSmoothAt (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (v : Vec (N * (ic * (2 * h) * (2 * w)))) :

          The three relu sites of the STRIDED projection bottleneck at v.

          ⚠⚠ v1.5: the FIRST relu is at the input resolution 2h × 2w and only the second is at h × w, because the stride is on the 3×3. Writing hm1 at h w typechecks nowhere, which is the one place a reader can get this shape wrong.

          Instances For
            noncomputable def Proofs.r50IdB_has_vjp_at (N h w : ) {mid oc : } (p : R50IdW mid oc) (hq : R50IdPos p) (v : Vec (N * (oc * h * w))) (hs : R50IdSmoothAt N h w p v) :
            HasVJPAt (r50IdB N h w p) v

            Identity bottleneck VJP — r50BottleneckB_has_vjp_at at the bundle's fields.

            Equations
            Instances For
              theorem Proofs.r50IdB_differentiableAt (N h w : ) {mid oc : } (p : R50IdW mid oc) (hq : R50IdPos p) (v : Vec (N * (oc * h * w))) (hs : R50IdSmoothAt N h w p v) :
              noncomputable def Proofs.r50ProjB_has_vjp_at (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (hq : R50ProjPos p) (v : Vec (N * (ic * h * w))) (hs : R50ProjSmoothAt N h w p v) :
              HasVJPAt (r50ProjB N h w p) v

              Stride-1 projection bottleneck VJP — r50ProjBlockB_has_vjp_at at the bundle's fields.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem Proofs.r50ProjB_differentiableAt (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (hq : R50ProjPos p) (v : Vec (N * (ic * h * w))) (hs : R50ProjSmoothAt N h w p v) :
                noncomputable def Proofs.r50DownB_has_vjp_at (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (hq : R50ProjPos p) (v : Vec (N * (ic * (2 * h) * (2 * w)))) (hs : R50DownSmoothAt N h w p v) :
                HasVJPAt (r50DownB N h w p) v

                Strided projection bottleneck VJP — r50DownBlockB_has_vjp_at at the bundle's fields.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem Proofs.r50DownB_differentiableAt (N h w : ) {ic mid oc : } (p : R50ProjW ic mid oc) (hq : R50ProjPos p) (v : Vec (N * (ic * (2 * h) * (2 * w)))) (hs : R50DownSmoothAt N h w p v) :
                  noncomputable def Proofs.r50Pre0 (N q : ) {nCls : } (w : R50BWeights nCls) :
                  Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (64 * (2 * (2 * (2 * q))) * (2 * (2 * (2 * q)))))
                  Equations
                  Instances For
                    noncomputable def Proofs.r50Pre1 (N q : ) {nCls : } (w : R50BWeights nCls) :
                    Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (256 * (2 * (2 * (2 * q))) * (2 * (2 * (2 * q)))))
                    Equations
                    Instances For
                      noncomputable def Proofs.r50Pre2 (N q : ) {nCls : } (w : R50BWeights nCls) :
                      Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (256 * (2 * (2 * (2 * q))) * (2 * (2 * (2 * q)))))
                      Equations
                      Instances For
                        noncomputable def Proofs.r50Pre3 (N q : ) {nCls : } (w : R50BWeights nCls) :
                        Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (256 * (2 * (2 * (2 * q))) * (2 * (2 * (2 * q)))))
                        Equations
                        Instances For
                          noncomputable def Proofs.r50Pre4 (N q : ) {nCls : } (w : R50BWeights nCls) :
                          Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (512 * (2 * (2 * q)) * (2 * (2 * q))))
                          Equations
                          Instances For
                            noncomputable def Proofs.r50Pre5 (N q : ) {nCls : } (w : R50BWeights nCls) :
                            Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (512 * (2 * (2 * q)) * (2 * (2 * q))))
                            Equations
                            Instances For
                              noncomputable def Proofs.r50Pre6 (N q : ) {nCls : } (w : R50BWeights nCls) :
                              Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (512 * (2 * (2 * q)) * (2 * (2 * q))))
                              Equations
                              Instances For
                                noncomputable def Proofs.r50Pre7 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (512 * (2 * (2 * q)) * (2 * (2 * q))))
                                Equations
                                Instances For
                                  noncomputable def Proofs.r50Pre8 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                  Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (1024 * (2 * q) * (2 * q)))
                                  Equations
                                  Instances For
                                    noncomputable def Proofs.r50Pre9 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                    Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (1024 * (2 * q) * (2 * q)))
                                    Equations
                                    Instances For
                                      noncomputable def Proofs.r50Pre10 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                      Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (1024 * (2 * q) * (2 * q)))
                                      Equations
                                      Instances For
                                        noncomputable def Proofs.r50Pre11 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                        Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (1024 * (2 * q) * (2 * q)))
                                        Equations
                                        Instances For
                                          noncomputable def Proofs.r50Pre12 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                          Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (1024 * (2 * q) * (2 * q)))
                                          Equations
                                          Instances For
                                            noncomputable def Proofs.r50Pre13 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                            Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (1024 * (2 * q) * (2 * q)))
                                            Equations
                                            Instances For
                                              noncomputable def Proofs.r50Pre14 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                              Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (2048 * q * q))
                                              Equations
                                              Instances For
                                                noncomputable def Proofs.r50Pre15 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                                Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (2048 * q * q))
                                                Equations
                                                Instances For
                                                  noncomputable def Proofs.r50Pre16 (N q : ) {nCls : } (w : R50BWeights nCls) :
                                                  Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))Vec (N * (2048 * q * q))
                                                  Equations
                                                  Instances For
                                                    noncomputable def Proofs.resnet50ForwardB_full_has_vjp_at (N q : ) (hq0 : 0 < q) {nCls : } (w : R50BWeights nCls) (hsε : 0 < w.) (qs1b0 : R50ProjPos w.s1b0) (qs1b1 : R50IdPos w.s1b1) (qs1b2 : R50IdPos w.s1b2) (qs2b0 : R50ProjPos w.s2b0) (qs2b1 : R50IdPos w.s2b1) (qs2b2 : R50IdPos w.s2b2) (qs2b3 : R50IdPos w.s2b3) (qs3b0 : R50ProjPos w.s3b0) (qs3b1 : R50IdPos w.s3b1) (qs3b2 : R50IdPos w.s3b2) (qs3b3 : R50IdPos w.s3b3) (qs3b4 : R50IdPos w.s3b4) (qs3b5 : R50IdPos w.s3b5) (qs4b0 : R50ProjPos w.s4b0) (qs4b1 : R50IdPos w.s4b1) (qs4b2 : R50IdPos w.s4b2) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) (h_stem : R34StemSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.sW w.sb w. w. w. x) (h_pool : R34PoolSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) (StableHLO.cbReluStridedB N w.sW w.sb w. w. w. x)) (ss1b0 : R50ProjSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b0 (r50Pre0 N q w x)) (ss1b1 : R50IdSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b1 (r50Pre1 N q w x)) (ss1b2 : R50IdSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b2 (r50Pre2 N q w x)) (ss2b0 : R50DownSmoothAt N (2 * (2 * q)) (2 * (2 * q)) w.s2b0 (r50Pre3 N q w x)) (ss2b1 : R50IdSmoothAt N (2 * (2 * q)) (2 * (2 * q)) w.s2b1 (r50Pre4 N q w x)) (ss2b2 : R50IdSmoothAt N (2 * (2 * q)) (2 * (2 * q)) w.s2b2 (r50Pre5 N q w x)) (ss2b3 : R50IdSmoothAt N (2 * (2 * q)) (2 * (2 * q)) w.s2b3 (r50Pre6 N q w x)) (ss3b0 : R50DownSmoothAt N (2 * q) (2 * q) w.s3b0 (r50Pre7 N q w x)) (ss3b1 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b1 (r50Pre8 N q w x)) (ss3b2 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b2 (r50Pre9 N q w x)) (ss3b3 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b3 (r50Pre10 N q w x)) (ss3b4 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b4 (r50Pre11 N q w x)) (ss3b5 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b5 (r50Pre12 N q w x)) (ss4b0 : R50DownSmoothAt N q q w.s4b0 (r50Pre13 N q w x)) (ss4b1 : R50IdSmoothAt N q q w.s4b1 (r50Pre14 N q w x)) (ss4b2 : R50IdSmoothAt N q q w.s4b2 (r50Pre15 N q w x)) :
                                                    HasVJPAt (r34HeadB N q q w.Wd w.bd r50Pre16 N q w) x

                                                    ⭐⭐ ResNet-50 at TRUE BATCH-NORM has a certified input-VJP at a smooth point — all sixteen bottlenecks. Chains stem → the [3,4,6,3] ladder → head with vjp_comp_at, one positivity bundle and one smoothness bundle per block. T1's VJP half, and the first tier ResNet-50 has ever had at the net level.

                                                    ⚠ Pointwise, and necessarily: relu is kinked. ⛔ Each block contributes THREE clauses — the two interior relus and the post-residual OUTER relu — where ResNet-34's basic block contributes two and EfficientNet's MBConv none.

                                                    ⭐ The head takes no hypothesis at all, and N and q are both variables, so this covers the 224-px and 160-px artifacts at every batch size. ⛔ 0 < q is needed for the stem pool.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      theorem Proofs.r50Pre0_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre0 N q w x = r34StemB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.sW w.sb w. w. w. x
                                                      theorem Proofs.r50Pre1_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre1 N q w x = r50ProjB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b0 (r50Pre0 N q w x)
                                                      theorem Proofs.r50Pre2_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre2 N q w x = r50IdB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b1 (r50Pre1 N q w x)
                                                      theorem Proofs.r50Pre3_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre3 N q w x = r50IdB N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b2 (r50Pre2 N q w x)
                                                      theorem Proofs.r50Pre4_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre4 N q w x = r50DownB N (2 * (2 * q)) (2 * (2 * q)) w.s2b0 (r50Pre3 N q w x)
                                                      theorem Proofs.r50Pre5_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre5 N q w x = r50IdB N (2 * (2 * q)) (2 * (2 * q)) w.s2b1 (r50Pre4 N q w x)
                                                      theorem Proofs.r50Pre6_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre6 N q w x = r50IdB N (2 * (2 * q)) (2 * (2 * q)) w.s2b2 (r50Pre5 N q w x)
                                                      theorem Proofs.r50Pre7_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre7 N q w x = r50IdB N (2 * (2 * q)) (2 * (2 * q)) w.s2b3 (r50Pre6 N q w x)
                                                      theorem Proofs.r50Pre8_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre8 N q w x = r50DownB N (2 * q) (2 * q) w.s3b0 (r50Pre7 N q w x)
                                                      theorem Proofs.r50Pre9_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre9 N q w x = r50IdB N (2 * q) (2 * q) w.s3b1 (r50Pre8 N q w x)
                                                      theorem Proofs.r50Pre10_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre10 N q w x = r50IdB N (2 * q) (2 * q) w.s3b2 (r50Pre9 N q w x)
                                                      theorem Proofs.r50Pre11_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre11 N q w x = r50IdB N (2 * q) (2 * q) w.s3b3 (r50Pre10 N q w x)
                                                      theorem Proofs.r50Pre12_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre12 N q w x = r50IdB N (2 * q) (2 * q) w.s3b4 (r50Pre11 N q w x)
                                                      theorem Proofs.r50Pre13_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre13 N q w x = r50IdB N (2 * q) (2 * q) w.s3b5 (r50Pre12 N q w x)
                                                      theorem Proofs.r50Pre14_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre14 N q w x = r50DownB N q q w.s4b0 (r50Pre13 N q w x)
                                                      theorem Proofs.r50Pre15_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre15 N q w x = r50IdB N q q w.s4b1 (r50Pre14 N q w x)
                                                      theorem Proofs.r50Pre16_apply (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      r50Pre16 N q w x = r50IdB N q q w.s4b2 (r50Pre15 N q w x)
                                                      theorem Proofs.resnet50ForwardB_full_eq_chain (N q : ) {nCls : } (w : R50BWeights nCls) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      resnet50ForwardB_full N q w x = (r34HeadB N q q w.Wd w.bd r50Pre16 N q w) x

                                                      The committed nested-application forward IS the layered chain the VJP is stated on — the ResNet-50 peer of resnet34ForwardB_full_eq_chain, and what lets the VJP be about resnet50ForwardB_full rather than about a re-spelling of it.

                                                      theorem Proofs.resnet50ForwardB_full_has_vjp_at_correct (N q : ) (hq0 : 0 < q) {nCls : } (w : R50BWeights nCls) (hsε : 0 < w.) (qs1b0 : R50ProjPos w.s1b0) (qs1b1 : R50IdPos w.s1b1) (qs1b2 : R50IdPos w.s1b2) (qs2b0 : R50ProjPos w.s2b0) (qs2b1 : R50IdPos w.s2b1) (qs2b2 : R50IdPos w.s2b2) (qs2b3 : R50IdPos w.s2b3) (qs3b0 : R50ProjPos w.s3b0) (qs3b1 : R50IdPos w.s3b1) (qs3b2 : R50IdPos w.s3b2) (qs3b3 : R50IdPos w.s3b3) (qs3b4 : R50IdPos w.s3b4) (qs3b5 : R50IdPos w.s3b5) (qs4b0 : R50ProjPos w.s4b0) (qs4b1 : R50IdPos w.s4b1) (qs4b2 : R50IdPos w.s4b2) (x : Vec (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) (h_stem : R34StemSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.sW w.sb w. w. w. x) (h_pool : R34PoolSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) (StableHLO.cbReluStridedB N w.sW w.sb w. w. w. x)) (ss1b0 : R50ProjSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b0 (r50Pre0 N q w x)) (ss1b1 : R50IdSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b1 (r50Pre1 N q w x)) (ss1b2 : R50IdSmoothAt N (2 * (2 * (2 * q))) (2 * (2 * (2 * q))) w.s1b2 (r50Pre2 N q w x)) (ss2b0 : R50DownSmoothAt N (2 * (2 * q)) (2 * (2 * q)) w.s2b0 (r50Pre3 N q w x)) (ss2b1 : R50IdSmoothAt N (2 * (2 * q)) (2 * (2 * q)) w.s2b1 (r50Pre4 N q w x)) (ss2b2 : R50IdSmoothAt N (2 * (2 * q)) (2 * (2 * q)) w.s2b2 (r50Pre5 N q w x)) (ss2b3 : R50IdSmoothAt N (2 * (2 * q)) (2 * (2 * q)) w.s2b3 (r50Pre6 N q w x)) (ss3b0 : R50DownSmoothAt N (2 * q) (2 * q) w.s3b0 (r50Pre7 N q w x)) (ss3b1 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b1 (r50Pre8 N q w x)) (ss3b2 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b2 (r50Pre9 N q w x)) (ss3b3 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b3 (r50Pre10 N q w x)) (ss3b4 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b4 (r50Pre11 N q w x)) (ss3b5 : R50IdSmoothAt N (2 * q) (2 * q) w.s3b5 (r50Pre12 N q w x)) (ss4b0 : R50DownSmoothAt N q q w.s4b0 (r50Pre13 N q w x)) (ss4b1 : R50IdSmoothAt N q q w.s4b1 (r50Pre14 N q w x)) (ss4b2 : R50IdSmoothAt N q q w.s4b2 (r50Pre15 N q w x)) (dy : Vec (N * nCls)) (i : Fin (N * (3 * (2 * (2 * (2 * (2 * (2 * q))))) * (2 * (2 * (2 * (2 * (2 * q)))))))) :
                                                      (resnet50ForwardB_full_has_vjp_at N q hq0 w hsε qs1b0 qs1b1 qs1b2 qs2b0 qs2b1 qs2b2 qs2b3 qs3b0 qs3b1 qs3b2 qs3b3 qs3b4 qs3b5 qs4b0 qs4b1 qs4b2 x h_stem h_pool ss1b0 ss1b1 ss1b2 ss2b0 ss2b1 ss2b2 ss2b3 ss3b0 ss3b1 ss3b2 ss3b3 ss3b4 ss3b5 ss4b0 ss4b1 ss4b2).backward dy i = j : Fin (N * nCls), pdiv (resnet50ForwardB_full N q w) x i j * dy j

                                                      ⭐⭐ Public correctness theorem: the sixteen-bottleneck batch-BN backward equals the pdiv-contracted Jacobian of resnet50ForwardB_full ITSELF — the committed nested-application forward ResNet50FullB.lean defines — not of the layered chain the VJP is assembled on. Tied back through resnet50ForwardB_full_eq_chain.