Documentation

LeanMlir.Proofs.Nets.ResNet.ResNet34FullBVJP

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

ResNet34FullB.lean states the batch-BN forward and its typed graph. This file gives that forward a certified HasVJPAt at the paper depth — the batched peer of what MobileNetV2FullVJP.lean does for MobileNetV2's seventeen bottlenecks, and the last piece of T1 in formalization.yaml 4e's port.

No new mathematics, and one new lemma one tier down #

Every block VJP is already proven at bnBatchLA: r34BasicBlockB_has_vjp_at and r34DownBlockB_has_vjp_at (ResNet34BackB0.lean) are exactly the two block shapes ResNet34FullB.lean's r34IdB / r34DownB unfold to. The eight bundle lemmas below are delegations in the EfficientNetFullB0 style.

⭐ The one thing that did not exist is batchMap_has_vjp_at (Foundation/BatchMapVJPAt.lean, written for this): r34's stem ends in batchMap N (maxPool3s2Flat 64 56 56) and a max-pool has no derivative at a tie, so the GLOBAL batchMap_has_vjp cannot lift it. The per-example pool VJP at a Vec point was already there (maxPool3s2Flat_has_vjp_at_vec), so the batched pool is two lines.

The hypothesis budget #

Pointwise (HasVJPAt), not global, and necessarily. relu is kinked. ⛔ And r34 carries two kink clauses per block, not one: the body's mid-relu AND the post-residual outer relu. That outer relu is ResNet's structural difference from MobileNetV2/EfficientNet, whose residual add IS the block output. Sixteen blocks therefore carry 32 clauses, plus the stem's relu and the stem pool's no-tie condition — bundled per block into R34IdSmoothAt / R34DownSmoothAt so the apex binds 18 smoothness bundles rather than 34 loose hypotheses, exactly as MobileNetV2FullVJP.lean bundles IVSmoothAt.

⚠ The pool's condition is per example (∀ r : Fin N, MaxPool3s2Smooth … on that example's row), because a tie is a property of one image's window, not of the batch. That is the shape batchMap_has_vjp_at consumes.

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

N is a variable throughout: this tier carries no numerals.

structure Proofs.R34IdPos {c : } (q : R34IdW c) :

Both BN epsilons of an identity basic block are positive.

Instances For
    structure Proofs.R34DownPos {ic oc : } (q : R34DownW ic oc) :

    All three BN epsilons of a downsample basic block are positive (body twice, projection once).

    Instances For
      structure Proofs.R34IdSmoothAt (N h w : ) {c : } (q : R34IdW c) (v : Vec (N * (c * h * w))) :

      Both relu sites of an identity basic block are away from the kink at v: the body's mid-relu (at the first BN's output) and the OUTER relu (at the post-residual sum).

      Instances For
        structure Proofs.R34DownSmoothAt (N h w : ) {ic oc : } (q : R34DownW ic oc) (v : Vec (N * (ic * (2 * h) * (2 * w)))) :

        Both relu sites of a downsample basic block are away from the kink at v. The mid-relu is after the STRIDED conv's BN (already at h×w); the outer relu is at the projected residual.

        Instances For
          def Proofs.R34StemSmoothAt (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))))) :

          The stem's relu is away from the kink at the input x (the 7×7/s2 conv's BN output, at the pre-pool 2h×2w grid).

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Proofs.R34PoolSmoothAt (N h w : ) {oc : } (v : Vec (N * (oc * (2 * h) * (2 * w)))) :

            The stem pool has no argmax tie, per example: a tie is a property of one image's 3×3 window, so the condition is stated on each row of the batched activation. This is the shape batchMap_has_vjp_at consumes.

            Equations
            Instances For
              noncomputable def Proofs.r34IdB_has_vjp_at (N h w : ) {c : } (p : R34IdW c) (hq : R34IdPos p) (v : Vec (N * (c * h * w))) (hs : R34IdSmoothAt N h w p v) :
              HasVJPAt (r34IdB N h w p) v

              Identity basic block VJP — r34BasicBlockB_has_vjp_at at the bundle's fields.

              Equations
              Instances For
                theorem Proofs.r34IdB_differentiableAt (N h w : ) {c : } (p : R34IdW c) (hq : R34IdPos p) (v : Vec (N * (c * h * w))) (hs : R34IdSmoothAt N h w p v) :
                noncomputable def Proofs.r34DownB_has_vjp_at (N h w : ) {ic oc : } (p : R34DownW ic oc) (hq : R34DownPos p) (v : Vec (N * (ic * (2 * h) * (2 * w)))) (hs : R34DownSmoothAt N h w p v) :
                HasVJPAt (r34DownB N h w p) v

                Downsample basic block VJP — r34DownBlockB_has_vjp_at at the bundle's fields.

                Equations
                Instances For
                  theorem Proofs.r34DownB_differentiableAt (N h w : ) {ic oc : } (p : R34DownW ic oc) (hq : R34DownPos p) (v : Vec (N * (ic * (2 * h) * (2 * w)))) (hs : R34DownSmoothAt N h w p v) :
                  noncomputable def Proofs.r34StemB_has_vjp_at (N h w : ) {ic oc : } (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (hεs : 0 < εs) (γs βs : Vec oc) (hc : 0 < oc) (hh : 0 < h) (hw : 0 < w) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hrelu : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpool : R34PoolSmoothAt N h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) :
                  HasVJPAt (r34StemB N h w Ws bs εs γs βs) x

                  ⭐ Stem VJP: the 7×7/s2 conv-bn-relu, then the batched 3×3/s2 pool. The pool half is where batchMap_has_vjp_at earns its existence.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem Proofs.r34StemB_differentiableAt (N h w : ) {ic oc : } (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (hεs : 0 < εs) (γs βs : Vec oc) (hc : 0 < oc) (hh : 0 < h) (hw : 0 < w) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hrelu : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpool : R34PoolSmoothAt N h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) :
                    DifferentiableAt (r34StemB N h w Ws bs εs γs βs) x
                    noncomputable def Proofs.r34HeadB_has_vjp (N h w : ) {c nCls : } (Wd : Mat c nCls) (bd : Vec nCls) :
                    HasVJP (r34HeadB N h w Wd bd)

                    ⭐ The head is GLOBAL — GAP and dense are both smooth everywhere, and each is batchMap of a per-example op, so batchMap_has_vjp suffices and no smoothness hypothesis appears.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Proofs.r34HeadB_differentiable (N h w : ) {c nCls : } (Wd : Mat c nCls) (bd : Vec nCls) :
                      noncomputable def Proofs.r34Pre0 (N : ) {nCls : } (w : R34BWeights nCls) :
                      Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (64 * 56 * 56))
                      Equations
                      Instances For
                        noncomputable def Proofs.r34Pre1 (N : ) {nCls : } (w : R34BWeights nCls) :
                        Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (64 * 56 * 56))
                        Equations
                        Instances For
                          noncomputable def Proofs.r34Pre2 (N : ) {nCls : } (w : R34BWeights nCls) :
                          Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (64 * 56 * 56))
                          Equations
                          Instances For
                            noncomputable def Proofs.r34Pre3 (N : ) {nCls : } (w : R34BWeights nCls) :
                            Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (64 * 56 * 56))
                            Equations
                            Instances For
                              noncomputable def Proofs.r34Pre4 (N : ) {nCls : } (w : R34BWeights nCls) :
                              Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (128 * 28 * 28))
                              Equations
                              Instances For
                                noncomputable def Proofs.r34Pre5 (N : ) {nCls : } (w : R34BWeights nCls) :
                                Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (128 * 28 * 28))
                                Equations
                                Instances For
                                  noncomputable def Proofs.r34Pre6 (N : ) {nCls : } (w : R34BWeights nCls) :
                                  Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (128 * 28 * 28))
                                  Equations
                                  Instances For
                                    noncomputable def Proofs.r34Pre7 (N : ) {nCls : } (w : R34BWeights nCls) :
                                    Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (128 * 28 * 28))
                                    Equations
                                    Instances For
                                      noncomputable def Proofs.r34Pre8 (N : ) {nCls : } (w : R34BWeights nCls) :
                                      Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (256 * 14 * 14))
                                      Equations
                                      Instances For
                                        noncomputable def Proofs.r34Pre9 (N : ) {nCls : } (w : R34BWeights nCls) :
                                        Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (256 * 14 * 14))
                                        Equations
                                        Instances For
                                          noncomputable def Proofs.r34Pre10 (N : ) {nCls : } (w : R34BWeights nCls) :
                                          Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (256 * 14 * 14))
                                          Equations
                                          Instances For
                                            noncomputable def Proofs.r34Pre11 (N : ) {nCls : } (w : R34BWeights nCls) :
                                            Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (256 * 14 * 14))
                                            Equations
                                            Instances For
                                              noncomputable def Proofs.r34Pre12 (N : ) {nCls : } (w : R34BWeights nCls) :
                                              Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (256 * 14 * 14))
                                              Equations
                                              Instances For
                                                noncomputable def Proofs.r34Pre13 (N : ) {nCls : } (w : R34BWeights nCls) :
                                                Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (256 * 14 * 14))
                                                Equations
                                                Instances For
                                                  noncomputable def Proofs.r34Pre14 (N : ) {nCls : } (w : R34BWeights nCls) :
                                                  Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (512 * 7 * 7))
                                                  Equations
                                                  Instances For
                                                    noncomputable def Proofs.r34Pre15 (N : ) {nCls : } (w : R34BWeights nCls) :
                                                    Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (512 * 7 * 7))
                                                    Equations
                                                    Instances For
                                                      noncomputable def Proofs.r34Pre16 (N : ) {nCls : } (w : R34BWeights nCls) :
                                                      Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))Vec (N * (512 * 7 * 7))
                                                      Equations
                                                      Instances For
                                                        noncomputable def Proofs.resnet34ForwardB_full_has_vjp_at (N : ) {nCls : } (w : R34BWeights nCls) (hsε : 0 < w.) (qa0 : R34IdPos w.a0) (qa1 : R34IdPos w.a1) (qa2 : R34IdPos w.a2) (qd2 : R34DownPos w.d2) (qb0 : R34IdPos w.b0) (qb1 : R34IdPos w.b1) (qb2 : R34IdPos w.b2) (qd3 : R34DownPos w.d3) (qc0 : R34IdPos w.c0) (qc1 : R34IdPos w.c1) (qc2 : R34IdPos w.c2) (qc3 : R34IdPos w.c3) (qc4 : R34IdPos w.c4) (qd4 : R34DownPos w.d4) (qe0 : R34IdPos w.e0) (qe1 : R34IdPos w.e1) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (h_stem : R34StemSmoothAt N 56 56 w.sW w.sb w. w. w. x) (h_pool : R34PoolSmoothAt N 56 56 (StableHLO.cbReluStridedB N w.sW w.sb w. w. w. x)) (sa0 : R34IdSmoothAt N 56 56 w.a0 (r34Pre0 N w x)) (sa1 : R34IdSmoothAt N 56 56 w.a1 (r34Pre1 N w x)) (sa2 : R34IdSmoothAt N 56 56 w.a2 (r34Pre2 N w x)) (sd2 : R34DownSmoothAt N 28 28 w.d2 (r34Pre3 N w x)) (sb0 : R34IdSmoothAt N 28 28 w.b0 (r34Pre4 N w x)) (sb1 : R34IdSmoothAt N 28 28 w.b1 (r34Pre5 N w x)) (sb2 : R34IdSmoothAt N 28 28 w.b2 (r34Pre6 N w x)) (sd3 : R34DownSmoothAt N 14 14 w.d3 (r34Pre7 N w x)) (sc0 : R34IdSmoothAt N 14 14 w.c0 (r34Pre8 N w x)) (sc1 : R34IdSmoothAt N 14 14 w.c1 (r34Pre9 N w x)) (sc2 : R34IdSmoothAt N 14 14 w.c2 (r34Pre10 N w x)) (sc3 : R34IdSmoothAt N 14 14 w.c3 (r34Pre11 N w x)) (sc4 : R34IdSmoothAt N 14 14 w.c4 (r34Pre12 N w x)) (sd4 : R34DownSmoothAt N 7 7 w.d4 (r34Pre13 N w x)) (se0 : R34IdSmoothAt N 7 7 w.e0 (r34Pre14 N w x)) (se1 : R34IdSmoothAt N 7 7 w.e1 (r34Pre15 N w x)) :
                                                        HasVJPAt (r34HeadB N 7 7 w.Wd w.bd r34Pre16 N w) x

                                                        ⭐⭐ ResNet-34 at TRUE BATCH-NORM has a certified input-VJP at a smooth point — all sixteen basic blocks. 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 for formalization.yaml 4e's port.

                                                        ⚠ Pointwise, and necessarily: relu is kinked. ⛔ Each block contributes TWO clauses — the body's mid-relu and the post-residual OUTER relu — where MobileNetV2's bottleneck contributes two relu6 clauses and EfficientNet's MBConv contributes none.

                                                        ⭐ The head takes no hypothesis at all (GAP and dense are smooth, and each is batchMap of a per-example op), and N is a variable: this tier carries no numerals.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          theorem Proofs.r34Pre0_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre0 N w x = r34StemB N 56 56 w.sW w.sb w. w. w. x
                                                          theorem Proofs.r34Pre1_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre1 N w x = r34IdB N 56 56 w.a0 (r34Pre0 N w x)
                                                          theorem Proofs.r34Pre2_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre2 N w x = r34IdB N 56 56 w.a1 (r34Pre1 N w x)
                                                          theorem Proofs.r34Pre3_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre3 N w x = r34IdB N 56 56 w.a2 (r34Pre2 N w x)
                                                          theorem Proofs.r34Pre4_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre4 N w x = r34DownB N 28 28 w.d2 (r34Pre3 N w x)
                                                          theorem Proofs.r34Pre5_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre5 N w x = r34IdB N 28 28 w.b0 (r34Pre4 N w x)
                                                          theorem Proofs.r34Pre6_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre6 N w x = r34IdB N 28 28 w.b1 (r34Pre5 N w x)
                                                          theorem Proofs.r34Pre7_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre7 N w x = r34IdB N 28 28 w.b2 (r34Pre6 N w x)
                                                          theorem Proofs.r34Pre8_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre8 N w x = r34DownB N 14 14 w.d3 (r34Pre7 N w x)
                                                          theorem Proofs.r34Pre9_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre9 N w x = r34IdB N 14 14 w.c0 (r34Pre8 N w x)
                                                          theorem Proofs.r34Pre10_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre10 N w x = r34IdB N 14 14 w.c1 (r34Pre9 N w x)
                                                          theorem Proofs.r34Pre11_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre11 N w x = r34IdB N 14 14 w.c2 (r34Pre10 N w x)
                                                          theorem Proofs.r34Pre12_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre12 N w x = r34IdB N 14 14 w.c3 (r34Pre11 N w x)
                                                          theorem Proofs.r34Pre13_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre13 N w x = r34IdB N 14 14 w.c4 (r34Pre12 N w x)
                                                          theorem Proofs.r34Pre14_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre14 N w x = r34DownB N 7 7 w.d4 (r34Pre13 N w x)
                                                          theorem Proofs.r34Pre15_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre15 N w x = r34IdB N 7 7 w.e0 (r34Pre14 N w x)
                                                          theorem Proofs.r34Pre16_apply (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          r34Pre16 N w x = r34IdB N 7 7 w.e1 (r34Pre15 N w x)
                                                          theorem Proofs.resnet34ForwardB_full_eq_chain (N : ) {nCls : } (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          resnet34ForwardB_full N w x = (r34HeadB N 7 7 w.Wd w.bd r34Pre16 N w) x

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

                                                          theorem Proofs.resnet34ForwardB_full_has_vjp_at_correct (N : ) {nCls : } (w : R34BWeights nCls) (hsε : 0 < w.) (qa0 : R34IdPos w.a0) (qa1 : R34IdPos w.a1) (qa2 : R34IdPos w.a2) (qd2 : R34DownPos w.d2) (qb0 : R34IdPos w.b0) (qb1 : R34IdPos w.b1) (qb2 : R34IdPos w.b2) (qd3 : R34DownPos w.d3) (qc0 : R34IdPos w.c0) (qc1 : R34IdPos w.c1) (qc2 : R34IdPos w.c2) (qc3 : R34IdPos w.c3) (qc4 : R34IdPos w.c4) (qd4 : R34DownPos w.d4) (qe0 : R34IdPos w.e0) (qe1 : R34IdPos w.e1) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (h_stem : R34StemSmoothAt N 56 56 w.sW w.sb w. w. w. x) (h_pool : R34PoolSmoothAt N 56 56 (StableHLO.cbReluStridedB N w.sW w.sb w. w. w. x)) (sa0 : R34IdSmoothAt N 56 56 w.a0 (r34Pre0 N w x)) (sa1 : R34IdSmoothAt N 56 56 w.a1 (r34Pre1 N w x)) (sa2 : R34IdSmoothAt N 56 56 w.a2 (r34Pre2 N w x)) (sd2 : R34DownSmoothAt N 28 28 w.d2 (r34Pre3 N w x)) (sb0 : R34IdSmoothAt N 28 28 w.b0 (r34Pre4 N w x)) (sb1 : R34IdSmoothAt N 28 28 w.b1 (r34Pre5 N w x)) (sb2 : R34IdSmoothAt N 28 28 w.b2 (r34Pre6 N w x)) (sd3 : R34DownSmoothAt N 14 14 w.d3 (r34Pre7 N w x)) (sc0 : R34IdSmoothAt N 14 14 w.c0 (r34Pre8 N w x)) (sc1 : R34IdSmoothAt N 14 14 w.c1 (r34Pre9 N w x)) (sc2 : R34IdSmoothAt N 14 14 w.c2 (r34Pre10 N w x)) (sc3 : R34IdSmoothAt N 14 14 w.c3 (r34Pre11 N w x)) (sc4 : R34IdSmoothAt N 14 14 w.c4 (r34Pre12 N w x)) (sd4 : R34DownSmoothAt N 7 7 w.d4 (r34Pre13 N w x)) (se0 : R34IdSmoothAt N 7 7 w.e0 (r34Pre14 N w x)) (se1 : R34IdSmoothAt N 7 7 w.e1 (r34Pre15 N w x)) (dy : Vec (N * nCls)) (i : Fin (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :
                                                          (resnet34ForwardB_full_has_vjp_at N w hsε qa0 qa1 qa2 qd2 qb0 qb1 qb2 qd3 qc0 qc1 qc2 qc3 qc4 qd4 qe0 qe1 x h_stem h_pool sa0 sa1 sa2 sd2 sb0 sb1 sb2 sd3 sc0 sc1 sc2 sc3 sc4 sd4 se0 se1).backward dy i = j : Fin (N * nCls), pdiv (resnet34ForwardB_full N w) x i j * dy j

                                                          ⭐⭐ Public correctness theorem: the sixteen-block batch-BN backward equals the pdiv-contracted Jacobian of resnet34ForwardB_full ITSELF — the committed nested-application forward ResNet34FullB.lean defines and resnet34FwdGraphB_full_faithful proves the typed graph denotes — not of the layered chain the VJP is assembled on. Tied back through resnet34ForwardB_full_eq_chain.