Documentation

LeanMlir.Proofs.Nets.ResNet.ResNet34ParamGrad

ResNet-34 — every parameter gradient node IS the loss's derivative in that parameter #

r34_net_tiedB says each of the 146 parameter gradient nodes denotes its layer's parameter Jacobian contracted with the cotangent the emitted backward chain threads to it; the *CotIn_eq_vjp lemmas say the block-input cotangents are certified VJP backwards; and r34_lossCot_is_smoothedCE_grad identifies the loss cotangent row by row. r34_net_lossGrad composes them: at the same cotangents, the loss of the WHOLE net with that one parameter varied is differentiable in it and every node is its gradient (HasGradAt), for any loss L of the logits with gradient g there; r34_net_lossGrad_smoothedCE instantiates it at the batched label-smoothed cross-entropy (smoothedBatchLoss) the renders emit.

Scope. One replica, at either precision: every conv weight node is stated on the renderers' switch (convWeightGradBAt bf16 id …, Foundation.GradNodesBAt), so bf16 := true is the bf16 kind resnet34in_momdp64bf16, the book's ImageNet run, emits, read over ℝ at the identity rounding (Bf16Erasure), and bf16 := false the f32 artifacts'. Sync-BN data parallelism is reached by composition: r34_net_syncTiedB says each all-reduced gradient is this net's tied node at N := R·N, which this file's capstone makes the loss's gradient at the global batch.

How. Three layers, each generic where it can be:

Hypotheses. R34PosB (every BN ε > 0), R34LossSmoothAtB (every relu off its kink and every stem-pool window dead, or its maximum at one position up to cells reading identical input patches, at the real activations), and L's gradient g at the logits; the smoothed-CE corollary discharges that from every example's target summing to one and 0 < nCls.

The stem pool's clause is stated for the parameters, not the image. Real batches have stem-pool windows whose positive maximum sits at two positions, because two cells read identical input patches (flat image regions). There the net has no derivative in the image, so the input VJP's R34SmoothAtB rejects them, but the tied cells are the same function of the stem's weights, so the loss IS differentiable in the parameters. R34LossSmoothAtB allows exactly those ties (StemPoolTwinAt at StemConvTwin), and the stem's parameter nodes are proved through the argmax gather they reduce to (r34StemPool_param_germ). At a tied window the render's pool backward (select_and_scatter with a GE select) sends the cotangent to the window's first maximal cell, and so does the denotation maxPool3s2BackB (its reindex reads windowArgmax, the first maximum). Every pool selector (IsMaxPool3s2SelectB) gives the same four stem gradients (r34Stem_select_grads_eq): r34_net_lossGrad_stemSelect states the stem's nodes at any of them. The probe script scripts/probes/stem_pool_smooth_probe.py checks the stem's clauses on real batches.

def Proofs.ResNet34TieB.r34IdLossTiedB {N h w c : ℕ} (xN cotN vN epsStr : String) (p : R34IdW c) (bf16 : Bool) (v : Vec (N * (c * h * w))) (Φ : R34IdW c → Vec 1) (dy : Vec (N * (c * h * w))) :

Identity block, every parameter node a loss derivative. With Gn the loss read at the block's output and Φ the loss as a function of the block's weight record (hΦ), each of the eight nodes r34IdTiedB ties — at the same cotangents — is ∂Φ/∂slot with that one slot varied.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Proofs.ResNet34TieB.r34_idblock_lossTiedB {N h w c : ℕ} (xN cotN vN epsStr : String) (p : R34IdW c) (bf16 : Bool) (hq : R34IdPos p) (v : Vec (N * (c * h * w))) (hs : R34IdSmoothAt N h w p v) {Gn : Vec (N * (c * h * w)) → Vec 1} {dy : Vec (N * (c * h * w))} (hGn : HasGradAt Gn (r34IdB N h w p v) dy) {Φ : R34IdW c → Vec 1} (hΦ : ∀ (p' : R34IdW c), Φ p' = Gn (r34IdB N h w p' v)) :
    r34IdLossTiedB xN cotN vN epsStr p bf16 v Φ dy
    def Proofs.ResNet34TieB.r34DownLossTiedB {N h w ic oc : ℕ} (xN cotN vN epsStr : String) (p : R34DownW ic oc) (bf16 : Bool) (v : Vec (N * (ic * (2 * h) * (2 * w)))) (Φ : R34DownW ic oc → Vec 1) (dy : Vec (N * (oc * h * w))) :

    Downsample block, every parameter node a loss derivative — the twelve nodes r34DownTiedB ties.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Proofs.ResNet34TieB.r34_downblock_lossTiedB {N h w ic oc : ℕ} (xN cotN vN epsStr : String) (p : R34DownW ic oc) (bf16 : Bool) (hq : R34DownPos p) (v : Vec (N * (ic * (2 * h) * (2 * w)))) (hs : R34DownSmoothAt N h w p v) {Gn : Vec (N * (oc * h * w)) → Vec 1} {dy : Vec (N * (oc * h * w))} (hGn : HasGradAt Gn (r34DownB N h w p v) dy) {Φ : R34DownW ic oc → Vec 1} (hΦ : ∀ (p' : R34DownW ic oc), Φ p' = Gn (r34DownB N h w p' v)) :
      r34DownLossTiedB xN cotN vN epsStr p bf16 v Φ dy
      def Proofs.ResNet34TieB.StemConvTwin (N h w : ℕ) {ic : ℕ} (oc : ℕ) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (r : Fin N) (p q : Fin (2 * h) × Fin (2 * w)) :

      Two cells of example r's stem grid read identical input patches: every kernel and bias give them the same conv output, in every channel. A flat image region does this, and at such a pair the stem pool can tie at a positive maximum. The tie is then the same at every stem weight (r34StemZ_twin), which is why the parameter gradient survives it.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Proofs.ResNet34TieB.r34StemZ_twin (N h w : ℕ) {ic oc : ℕ} (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (εs : ℝ) (W : Kernel4 oc ic 7 7) (b γ β : Vec oc) (r : Fin N) (ci : Fin oc) (p q : Fin (2 * h) × Fin (2 * w)) (hT : StemConvTwin N h w oc x r p q) :

        Twinned stem cells stay equal through batch BN, at every stem parameter.

        theorem Proofs.ResNet34TieB.r34StemPool_param_germ_select {N h w ic oc P : ℕ} (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hstem : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpool : StemPoolTwinAt N h w (StemConvTwin N h w oc x) (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (hσ : IsMaxPool3s2SelectB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x) σ) (Wf : Vec P → Kernel4 oc ic 7 7) (bf γf βf : Vec P → Vec oc) (θ₀ : Vec P) (h0 : StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs (γf θ₀) (βf θ₀) (StableHLO.batchMap N (flatConvStride2 (Wf θ₀) (bf θ₀)) x) = StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs γs βs (StableHLO.batchMap N (flatConvStride2 Ws bs) x)) (hc : ContinuousAt (fun (θ : Vec P) => StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs (γf θ) (βf θ) (StableHLO.batchMap N (flatConvStride2 (Wf θ) (bf θ)) x)) θ₀) :
        (fun (θ : Vec P) => r34StemB N h w (Wf θ) (bf θ) εs (γf θ) (βf θ) x) =ᶠ[nhds θ₀] fun (θ : Vec P) (k : Fin (N * (oc * h * w))) => relu (N * (oc * (2 * h) * (2 * w))) (StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs (γf θ) (βf θ) (StableHLO.batchMap N (flatConvStride2 (Wf θ) (bf θ)) x)) (σ k)

        Along any family of stem parameters, the pooled stem is a fixed gather, for any pool selector σ at the stem's post-ReLU activation (IsMaxPool3s2SelectB). The family passes through the stem's own parameters at θ₀; there the pre-ReLU has no zero entry and every pool window is smooth up to input-patch twins. Then the pooled stem agrees near θ₀ with the gather along σ, whichever tied twin σ picks.

        theorem Proofs.ResNet34TieB.r34StemPool_param_germ {N h w ic oc P : ℕ} (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hstem : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpool : StemPoolTwinAt N h w (StemConvTwin N h w oc x) (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) (Wf : Vec P → Kernel4 oc ic 7 7) (bf γf βf : Vec P → Vec oc) (θ₀ : Vec P) (h0 : StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs (γf θ₀) (βf θ₀) (StableHLO.batchMap N (flatConvStride2 (Wf θ₀) (bf θ₀)) x) = StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs γs βs (StableHLO.batchMap N (flatConvStride2 Ws bs) x)) (hc : ContinuousAt (fun (θ : Vec P) => StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs (γf θ) (βf θ) (StableHLO.batchMap N (flatConvStride2 (Wf θ) (bf θ)) x)) θ₀) :
        (fun (θ : Vec P) => r34StemB N h w (Wf θ) (bf θ) εs (γf θ) (βf θ) x) =ᶠ[nhds θ₀] fun (θ : Vec P) (k : Fin (N * (oc * h * w))) => relu (N * (oc * (2 * h) * (2 * w))) (StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs (γf θ) (βf θ) (StableHLO.batchMap N (flatConvStride2 (Wf θ) (bf θ)) x)) (maxPool3s2LocalReindexB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x) k)

        Along any family of stem parameters, the pooled stem is the argmax gather: the selector maxPool3s2LocalReindexB names at the stem's own parameters (r34StemPool_param_germ_select).

        noncomputable def Proofs.ResNet34TieB.r34StemCotNAt {N h w ic oc : ℕ} (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (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)))

        The stem's cotangent at the BN output with the pool's cotangent routed along a selector σ: the scatter along σ, then the stem relu's mask. At the argmax gather it is the render's r34StemCotN (r34StemCotN_eq_at).

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def Proofs.ResNet34TieB.r34StemCotCAt {N h w ic oc : ℕ} (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (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)))

          …and at the conv output, through the BN backward.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Proofs.ResNet34TieB.r34StemCotN_eq_at {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))) :
            r34StemCotN N h w Ws bs εs γs βs x cotPool = r34StemCotNAt (maxPool3s2LocalReindexB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) Ws bs εs γs βs x cotPool

            The render's stem cotangents are the argmax gather's.

            theorem Proofs.ResNet34TieB.r34StemCotC_eq_at {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))) :
            r34StemCotC N h w Ws bs εs γs βs x cotPool = r34StemCotCAt (maxPool3s2LocalReindexB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) Ws bs εs γs βs x cotPool
            noncomputable def Proofs.ResNet34TieB.r34StemGNg {N h w oc : ℕ} (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (Gn : Vec (N * (oc * h * w)) → Vec 1) :
            Vec (N * (oc * (2 * h) * (2 * w))) → Vec 1

            The stem's loss as the gather model sees it, at the BN output: the pool replaced by the fixed gather σ.

            Equations
            Instances For
              noncomputable def Proofs.ResNet34TieB.r34StemGCg {N h w oc : ℕ} (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (Gn : Vec (N * (oc * h * w)) → Vec 1) (εs : ℝ) (γs βs : Vec oc) :
              Vec (N * (oc * (2 * h) * (2 * w))) → Vec 1

              …and at the conv output.

              Equations
              Instances For
                theorem Proofs.ResNet34TieB.r34StemGCg_hasGradAt_at {N h w ic oc : ℕ} (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (hεs : 0 < εs) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hstem : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpt : r34StemB N h w Ws bs εs γs βs x = fun (k : Fin (N * (oc * h * w))) => relu (N * (oc * (2 * h) * (2 * w))) (StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs γs βs (StableHLO.batchMap N (flatConvStride2 Ws bs) x)) (σ k)) {Gn : Vec (N * (oc * h * w)) → Vec 1} {dy : Vec (N * (oc * h * w))} (hGn : HasGradAt Gn (r34StemB N h w Ws bs εs γs βs x) dy) :
                HasGradAt (r34StemGNg σ Gn) (StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs γs βs (StableHLO.batchMap N (flatConvStride2 Ws bs) x)) (r34StemCotNAt σ Ws bs εs γs βs x dy) ∧ HasGradAt (r34StemGCg σ Gn εs γs βs) (StableHLO.batchMap N (flatConvStride2 Ws bs) x) (r34StemCotCAt σ Ws bs εs γs βs x dy)

                The gather model's gradients are the stem cotangents routed along σ. No pool hypothesis: the gather is linear after the ReLU. The loss's gradient at the pooled stem output transfers because at the stem's own parameters the pool IS the gather along σ (hpt).

                theorem Proofs.ResNet34TieB.r34StemGCg_hasGradAt {N h w ic oc : ℕ} (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (hεs : 0 < εs) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hstem : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpt : r34StemB N h w Ws bs εs γs βs x = fun (k : Fin (N * (oc * h * w))) => relu (N * (oc * (2 * h) * (2 * w))) (StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs γs βs (StableHLO.batchMap N (flatConvStride2 Ws bs) x)) (maxPool3s2LocalReindexB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x) k)) {Gn : Vec (N * (oc * h * w)) → Vec 1} {dy : Vec (N * (oc * h * w))} (hGn : HasGradAt Gn (r34StemB N h w Ws bs εs γs βs x) dy) :
                HasGradAt (r34StemGNg (maxPool3s2LocalReindexB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) Gn) (StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs γs βs (StableHLO.batchMap N (flatConvStride2 Ws bs) x)) (r34StemCotN N h w Ws bs εs γs βs x dy) ∧ HasGradAt (r34StemGCg (maxPool3s2LocalReindexB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) Gn εs γs βs) (StableHLO.batchMap N (flatConvStride2 Ws bs) x) (r34StemCotC N h w Ws bs εs γs βs x dy)

                The gather model's gradients are the render's stem cotangents (r34StemGCg_hasGradAt_at at the argmax gather).

                def Proofs.ResNet34TieB.r34StemLossTiedAtB {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))))) (Φ : Kernel4 oc ic 7 7 → Vec oc → Vec oc → Vec oc → Vec 1) (cotC cotNv : Vec (N * (oc * (2 * h) * (2 * w)))) :

                Stem, every parameter node a loss derivative, at given cotangents: the four nodes r34StemTiedB ties, read at the conv-output cotangent cotC and the BN-output cotangent cotN, Φ the loss as a function of the stem's (W, b, γ, β).

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def Proofs.ResNet34TieB.r34StemLossTiedB {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))))) (Φ : Kernel4 oc ic 7 7 → Vec oc → Vec oc → Vec oc → Vec 1) (dy : Vec (N * (oc * h * w))) :

                  Stem, every parameter node a loss derivative — r34StemLossTiedAtB at the render's cotangents r34StemCotC / r34StemCotN, the pool's cotangent dy.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem Proofs.ResNet34TieB.r34_stem_lossTiedB_select {N h w ic oc : ℕ} (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (hεs : 0 < εs) (γs βs : Vec oc) (bf16 : Bool) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hstem : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpool : StemPoolTwinAt N h w (StemConvTwin N h w oc x) (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (hσ : IsMaxPool3s2SelectB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x) σ) {Gn : Vec (N * (oc * h * w)) → Vec 1} {dy : Vec (N * (oc * h * w))} (hGn : HasGradAt Gn (r34StemB N h w Ws bs εs γs βs x) dy) {Φ : Kernel4 oc ic 7 7 → Vec oc → Vec oc → Vec oc → Vec 1} (hΦ : ∀ (W : Kernel4 oc ic 7 7) (b γ β : Vec oc), Φ W b γ β = Gn (r34StemB N h w W b εs γ β x)) :
                    r34StemLossTiedAtB xN cotN vN epsStr Ws bs εs γs βs bf16 x Φ (r34StemCotCAt σ Ws bs εs γs βs x dy) (r34StemCotNAt σ Ws bs εs γs βs x dy)

                    Stem, every parameter node a loss derivative, with the pool's cotangent routed by ANY selector σ at the stem's post-ReLU activation: each node read at the cotangents r34StemCotCAt σ / r34StemCotNAt σ is the gradient of Φ in its slot. The loss is the real pooled net's, not a gather model's: along each one-slot family the pooled stem IS the gather along σ near the stem's parameters (r34StemPool_param_germ_select).

                    theorem Proofs.ResNet34TieB.r34_stem_lossTiedB {N h w ic oc : ℕ} (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (hεs : 0 < εs) (γs βs : Vec oc) (bf16 : Bool) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hstem : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpool : StemPoolTwinAt N h w (StemConvTwin N h w oc x) (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) {Gn : Vec (N * (oc * h * w)) → Vec 1} {dy : Vec (N * (oc * h * w))} (hGn : HasGradAt Gn (r34StemB N h w Ws bs εs γs βs x) dy) {Φ : Kernel4 oc ic 7 7 → Vec oc → Vec oc → Vec oc → Vec 1} (hΦ : ∀ (W : Kernel4 oc ic 7 7) (b γ β : Vec oc), Φ W b γ β = Gn (r34StemB N h w W b εs γ β x)) :
                    r34StemLossTiedB xN cotN vN epsStr Ws bs εs γs βs bf16 x Φ dy
                    theorem Proofs.ResNet34TieB.r34Stem_select_grads_eq {N h w ic oc : ℕ} (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ℝ) (hεs : 0 < εs) (γs βs : Vec oc) (bf16 : Bool) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (hstem : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpool : StemPoolTwinAt N h w (StemConvTwin N h w oc x) (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (hσ : IsMaxPool3s2SelectB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x) σ) (dy : Vec (N * (oc * h * w))) :
                    StableHLO.den (StableHLO.SHlo.convStridedWeightGradBAt bf16 id xN bs x Ws (StableHLO.SHlo.operand cotN (r34StemCotCAt σ Ws bs εs γs βs x dy))) = StableHLO.den (StableHLO.SHlo.convStridedWeightGradBAt bf16 id xN bs x Ws (StableHLO.SHlo.operand cotN (r34StemCotC N h w Ws bs εs γs βs x dy))) ∧ StableHLO.den (StableHLO.SHlo.convStridedBiasGradB Ws x bs (StableHLO.SHlo.operand cotN (r34StemCotCAt σ Ws bs εs γs βs x dy))) = StableHLO.den (StableHLO.SHlo.convStridedBiasGradB Ws x bs (StableHLO.SHlo.operand cotN (r34StemCotC N h w Ws bs εs γs βs x dy))) ∧ StableHLO.den (StableHLO.SHlo.bnGammaGradB vN epsStr εs (BackLinks.reassocB N oc (2 * h) (2 * w) (StableHLO.batchMap N (flatConvStride2 Ws bs) x)) (StableHLO.SHlo.operand cotN (BackLinks.reassocB N oc (2 * h) (2 * w) (r34StemCotNAt σ Ws bs εs γs βs x dy)))) = StableHLO.den (StableHLO.SHlo.bnGammaGradB vN epsStr εs (BackLinks.reassocB N oc (2 * h) (2 * w) (StableHLO.batchMap N (flatConvStride2 Ws bs) x)) (StableHLO.SHlo.operand cotN (BackLinks.reassocB N oc (2 * h) (2 * w) (r34StemCotN N h w Ws bs εs γs βs x dy)))) ∧ StableHLO.den (StableHLO.SHlo.operand cotN (BackLinks.reassocB N oc (2 * h) (2 * w) (r34StemCotNAt σ Ws bs εs γs βs x dy))).bnBetaGradB = StableHLO.den (StableHLO.SHlo.operand cotN (BackLinks.reassocB N oc (2 * h) (2 * w) (r34StemCotN N h w Ws bs εs γs βs x dy))).bnBetaGradB

                    Routing a tied window's cotangent to either twin gives the same stem gradients. For any pool selector σ at the stem's post-ReLU activation and any pool cotangent dy, the four stem parameter nodes read at the σ-routed cotangents denote what they denote at the render's r34StemCotC / r34StemCotN. Tied twins read identical input patches and share a BN output, so moving a cotangent between them leaves the conv weight and bias gradients and BN's γ/β gradients unchanged. The proof does not compute this: both node sets are gradients of one function, the linear loss linLoss dy after the pooled stem, at the same point (r34_stem_lossTiedB_select, twice), and a gradient is unique.

                    theorem Proofs.ResNet34TieB.r34StemLossTiedB.select {N h w ic oc : ℕ} {xN cotN vN epsStr : String} {Ws : Kernel4 oc ic 7 7} {bs : Vec oc} {εs : ℝ} (hεs : 0 < εs) {γs βs : Vec oc} {bf16 : Bool} {x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))} (hstem : R34StemSmoothAt N h w Ws bs εs γs βs x) (hpool : StemPoolTwinAt N h w (StemConvTwin N h w oc x) (StableHLO.cbReluStridedB N Ws bs εs γs βs x)) {Φ : Kernel4 oc ic 7 7 → Vec oc → Vec oc → Vec oc → Vec 1} {dy : Vec (N * (oc * h * w))} (hT : r34StemLossTiedB xN cotN vN epsStr Ws bs εs γs βs bf16 x Φ dy) (σ : Fin (N * (oc * h * w)) → Fin (N * (oc * (2 * h) * (2 * w)))) (hσ : IsMaxPool3s2SelectB N oc h w (StableHLO.cbReluStridedB N Ws bs εs γs βs x) σ) :
                    r34StemLossTiedAtB xN cotN vN epsStr Ws bs εs γs βs bf16 x Φ (r34StemCotCAt σ Ws bs εs γs βs x dy) (r34StemCotNAt σ Ws bs εs γs βs x dy)

                    The stem bundle holds at any selector's routing. r34StemLossTiedB (the render's cotangents, as the R34 / R50 loss-gradient capstones state it) gives the same four gradients read at the cotangents routed along any pool selector σ (r34Stem_select_grads_eq): in particular along the render's select_and_scatter, which picks one maximal cell per window.

                    def Proofs.ResNet34TieB.r34HeadLossTiedB {N h w c nCls : ℕ} (xN cotN : String) (Wd : Mat c nCls) (bd : Vec nCls) (v : Vec (N * (c * h * w))) (Φ : Mat c nCls → Vec nCls → Vec 1) (g : Vec (N * nCls)) :

                    Head, both parameter nodes loss derivatives — the classifier weight and bias nodes r34HeadTiedB ties, Φ the loss as a function of (Wd, bd).

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Proofs.ResNet34TieB.r34_head_lossTiedB {N h w c nCls : ℕ} (xN cotN : String) (Wd : Mat c nCls) (bd : Vec nCls) (v : Vec (N * (c * h * w))) {L : Vec (N * nCls) → Vec 1} {g : Vec (N * nCls)} (hL : HasGradAt L (r34HeadB N h w Wd bd v) g) {Φ : Mat c nCls → Vec nCls → Vec 1} (hΦ : ∀ (W : Mat c nCls) (b : Vec nCls), Φ W b = L (r34HeadB N h w W b v)) :
                      r34HeadLossTiedB xN cotN Wd bd v Φ g
                      noncomputable def Proofs.ResNet34TieB.r34SufE1 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                      Vec (N * (512 * 7 * 7)) → Vec (N * nCls)

                      The net after block e1 — the head.

                      Equations
                      Instances For
                        noncomputable def Proofs.ResNet34TieB.r34SufE0 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                        Vec (N * (512 * 7 * 7)) → Vec (N * nCls)

                        The net after block e0: block e1, then the rest.

                        Equations
                        Instances For
                          noncomputable def Proofs.ResNet34TieB.r34SufD4 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                          Vec (N * (512 * 7 * 7)) → Vec (N * nCls)

                          The net after block d4: block e0, then the rest.

                          Equations
                          Instances For
                            noncomputable def Proofs.ResNet34TieB.r34SufC4 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                            Vec (N * (256 * 14 * 14)) → Vec (N * nCls)

                            The net after block c4: block d4, then the rest.

                            Equations
                            Instances For
                              noncomputable def Proofs.ResNet34TieB.r34SufC3 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                              Vec (N * (256 * 14 * 14)) → Vec (N * nCls)

                              The net after block c3: block c4, then the rest.

                              Equations
                              Instances For
                                noncomputable def Proofs.ResNet34TieB.r34SufC2 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                Vec (N * (256 * 14 * 14)) → Vec (N * nCls)

                                The net after block c2: block c3, then the rest.

                                Equations
                                Instances For
                                  noncomputable def Proofs.ResNet34TieB.r34SufC1 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                  Vec (N * (256 * 14 * 14)) → Vec (N * nCls)

                                  The net after block c1: block c2, then the rest.

                                  Equations
                                  Instances For
                                    noncomputable def Proofs.ResNet34TieB.r34SufC0 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                    Vec (N * (256 * 14 * 14)) → Vec (N * nCls)

                                    The net after block c0: block c1, then the rest.

                                    Equations
                                    Instances For
                                      noncomputable def Proofs.ResNet34TieB.r34SufD3 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                      Vec (N * (256 * 14 * 14)) → Vec (N * nCls)

                                      The net after block d3: block c0, then the rest.

                                      Equations
                                      Instances For
                                        noncomputable def Proofs.ResNet34TieB.r34SufB2 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                        Vec (N * (128 * 28 * 28)) → Vec (N * nCls)

                                        The net after block b2: block d3, then the rest.

                                        Equations
                                        Instances For
                                          noncomputable def Proofs.ResNet34TieB.r34SufB1 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                          Vec (N * (128 * 28 * 28)) → Vec (N * nCls)

                                          The net after block b1: block b2, then the rest.

                                          Equations
                                          Instances For
                                            noncomputable def Proofs.ResNet34TieB.r34SufB0 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                            Vec (N * (128 * 28 * 28)) → Vec (N * nCls)

                                            The net after block b0: block b1, then the rest.

                                            Equations
                                            Instances For
                                              noncomputable def Proofs.ResNet34TieB.r34SufD2 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                              Vec (N * (128 * 28 * 28)) → Vec (N * nCls)

                                              The net after block d2: block b0, then the rest.

                                              Equations
                                              Instances For
                                                noncomputable def Proofs.ResNet34TieB.r34SufA2 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                                Vec (N * (64 * 56 * 56)) → Vec (N * nCls)

                                                The net after block a2: block d2, then the rest.

                                                Equations
                                                Instances For
                                                  noncomputable def Proofs.ResNet34TieB.r34SufA1 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                                  Vec (N * (64 * 56 * 56)) → Vec (N * nCls)

                                                  The net after block a1: block a2, then the rest.

                                                  Equations
                                                  Instances For
                                                    noncomputable def Proofs.ResNet34TieB.r34SufA0 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                                    Vec (N * (64 * 56 * 56)) → Vec (N * nCls)

                                                    The net after block a0: block a1, then the rest.

                                                    Equations
                                                    Instances For
                                                      noncomputable def Proofs.ResNet34TieB.r34SufStem (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) :
                                                      Vec (N * (64 * 56 * 56)) → Vec (N * nCls)

                                                      The net after the stem: block a0, then the rest.

                                                      Equations
                                                      Instances For
                                                        theorem Proofs.ResNet34TieB.r34_factor_stem (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (W : Kernel4 64 3 7 7) (b γ β : Vec 64) :
                                                        resnet34ForwardBFull N { sW := W, sb := b, sε := w.sε, sγ := γ, sβ := β, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufStem N w (r34StemB N 56 56 W b w.sε γ β x)

                                                        The net with the stem's parameters varied is the suffix after the stem at the varied stem.

                                                        theorem Proofs.ResNet34TieB.r34_factor_a0 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 64) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := p, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufA0 N w (r34IdB N 56 56 p (r34Pre0 N w x))

                                                        The net with block a0's weights varied is the suffix after a0 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_a1 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 64) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := p, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufA1 N w (r34IdB N 56 56 p (r34Pre1 N w x))

                                                        The net with block a1's weights varied is the suffix after a1 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_a2 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 64) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := p, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufA2 N w (r34IdB N 56 56 p (r34Pre2 N w x))

                                                        The net with block a2's weights varied is the suffix after a2 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_d2 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34DownW 64 128) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := p, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufD2 N w (r34DownB N 28 28 p (r34Pre3 N w x))

                                                        The net with block d2's weights varied is the suffix after d2 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_b0 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 128) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := p, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufB0 N w (r34IdB N 28 28 p (r34Pre4 N w x))

                                                        The net with block b0's weights varied is the suffix after b0 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_b1 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 128) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := p, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufB1 N w (r34IdB N 28 28 p (r34Pre5 N w x))

                                                        The net with block b1's weights varied is the suffix after b1 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_b2 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 128) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := p, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufB2 N w (r34IdB N 28 28 p (r34Pre6 N w x))

                                                        The net with block b2's weights varied is the suffix after b2 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_d3 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34DownW 128 256) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := p, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufD3 N w (r34DownB N 14 14 p (r34Pre7 N w x))

                                                        The net with block d3's weights varied is the suffix after d3 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_c0 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 256) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := p, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufC0 N w (r34IdB N 14 14 p (r34Pre8 N w x))

                                                        The net with block c0's weights varied is the suffix after c0 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_c1 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 256) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := p, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufC1 N w (r34IdB N 14 14 p (r34Pre9 N w x))

                                                        The net with block c1's weights varied is the suffix after c1 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_c2 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 256) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := p, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufC2 N w (r34IdB N 14 14 p (r34Pre10 N w x))

                                                        The net with block c2's weights varied is the suffix after c2 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_c3 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 256) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := p, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufC3 N w (r34IdB N 14 14 p (r34Pre11 N w x))

                                                        The net with block c3's weights varied is the suffix after c3 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_c4 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 256) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := p, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufC4 N w (r34IdB N 14 14 p (r34Pre12 N w x))

                                                        The net with block c4's weights varied is the suffix after c4 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_d4 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34DownW 256 512) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := p, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufD4 N w (r34DownB N 7 7 p (r34Pre13 N w x))

                                                        The net with block d4's weights varied is the suffix after d4 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_e0 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 512) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := p, e1 := w.e1, Wd := w.Wd, bd := w.bd } x = r34SufE0 N w (r34IdB N 7 7 p (r34Pre14 N w x))

                                                        The net with block e0's weights varied is the suffix after e0 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_e1 (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (p : R34IdW 512) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := p, Wd := w.Wd, bd := w.bd } x = r34SufE1 N w (r34IdB N 7 7 p (r34Pre15 N w x))

                                                        The net with block e1's weights varied is the suffix after e1 at the varied block.

                                                        theorem Proofs.ResNet34TieB.r34_factor_head (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (W : Mat 512 nCls) (b : Vec nCls) :
                                                        resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := W, bd := b } x = r34HeadB N 7 7 W b (r34Pre16 N w x)

                                                        The net with the classifier varied is the head at the varied classifier.

                                                        structure Proofs.ResNet34TieB.R34LossSmoothAtB (N : ℕ) {nCls : ℕ} (w : R34BWeights nCls) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) :

                                                        The smooth-point bundle a loss gradient needs — R34SmoothAtB with the stem pool's clause weakened to allow ties between cells that read identical input patches (StemPoolTwinAt at StemConvTwin). Those ties exclude an input VJP (the net has no derivative in the image there) but not a parameter gradient (the tied cells are the same function of the stem's weights), and real batches have them. Every relu clause is R34SmoothAtB's.

                                                        Instances For
                                                          theorem Proofs.ResNet34TieB.r34LossSmoothAtB_of_smoothAtB {N nCls : ℕ} {w : R34BWeights nCls} {x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))} (hx : R34SmoothAtB N w x) :

                                                          The input-VJP bundle implies the loss-gradient one.

                                                          theorem Proofs.ResNet34TieB.r34IdB_hasGradAt_comp {N h w c : ℕ} (p : R34IdW c) (hq : R34IdPos p) (v : Vec (N * (c * h * w))) (hs : R34IdSmoothAt N h w p v) {G : Vec (N * (c * h * w)) → Vec 1} {dy : Vec (N * (c * h * w))} (hG : HasGradAt G (r34IdB N h w p v) dy) :
                                                          HasGradAt (fun (y : Vec (N * (c * h * w))) => G (r34IdB N h w p y)) v (r34IdCotIn N h w p v dy)

                                                          Pull the loss gradient back through an identity block: the certified block VJP, read at the chain's own fan-in (r34IdCotIn_eq_vjp).

                                                          theorem Proofs.ResNet34TieB.r34DownB_hasGradAt_comp {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) {G : Vec (N * (oc * h * w)) → Vec 1} {dy : Vec (N * (oc * h * w))} (hG : HasGradAt G (r34DownB N h w p v) dy) :
                                                          HasGradAt (fun (y : Vec (N * (ic * (2 * h) * (2 * w)))) => G (r34DownB N h w p y)) v (r34DownCotIn N h w p v dy)

                                                          …and through a downsample block (r34DownCotIn_eq_vjp).

                                                          def Proofs.ResNet34TieB.R34NetLossTiedB (N : ℕ) {nCls : ℕ} (xN cotN vN epsStr : String) (w : R34BWeights nCls) (bf16 : Bool) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (L : Vec (N * nCls) → Vec 1) (g : Vec (N * nCls)) :

                                                          Every ResNet-34 parameter gradient node is the gradient of L in that parameter, for a loss L of the logits and g the cotangent the chain starts from: the 146 nodes r34_net_tiedB ties, each at the cotangent the emitted chain threads to it, stated against L of resnet34ForwardBFull with that one parameter varied (a stem field, a block's weight record w.blk := p with one slot changed, or the classifier). r34_net_lossGrad proves it whenever g is L's gradient at the logits; r34_net_lossGrad_smoothedCE instantiates it at the loss the artifacts ship.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            theorem Proofs.ResNet34TieB.r34_net_lossGrad (N : ℕ) {nCls : ℕ} (xN cotN vN epsStr : String) (w : R34BWeights nCls) (hq : R34PosB w) (bf16 : Bool) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (hx : R34LossSmoothAtB N w x) {L : Vec (N * nCls) → Vec 1} {g : Vec (N * nCls)} (hL : HasGradAt L (resnet34ForwardBFull N w x) g) :
                                                            R34NetLossTiedB N xN cotN vN epsStr w bf16 x L g

                                                            Every ResNet-34 parameter gradient node is the gradient of L in that parameter, whenever g is L's gradient at the logits.

                                                            Hypotheses: every BN ε positive (R34PosB), every relu off its kink and every stem-pool window dead or tied only between cells reading identical input patches, at the real activations (R34LossSmoothAtB), and hL. One replica; bf16 selects the conv weight nodes' kind (the module's Scope).

                                                            theorem Proofs.ResNet34TieB.r34_net_lossGrad_smoothedCE (N : ℕ) {nCls : ℕ} (hK : 0 < nCls) (xN cotN vN epsStr aStr negAK bStr logN ohN : String) (α B : ℝ) (w : R34BWeights nCls) (hq : R34PosB w) (bf16 : Bool) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (hx : R34LossSmoothAtB N w x) (t : Vec (N * (1 * nCls))) (ht : ∀ (n : Fin N), ∑ k : Fin nCls, targetRow N nCls t n k = 1) :
                                                            R34NetLossTiedB N xN cotN vN epsStr w bf16 x (smoothedBatchLoss N nCls α B t) (BackLinks.unrowB N nCls (StableHLO.den (smoothedLossCotGraph N nCls α B aStr negAK bStr logN ohN (BackLinks.rowB N nCls (resnet34ForwardBFull N w x)) t)))

                                                            The artifacts' loss: every node is the gradient of the batched label-smoothed cross-entropy smoothedBatchLoss, g the emitted loss cotangent, given every example's target summing to one and at least one class.

                                                            theorem Proofs.ResNet34TieB.r34_net_lossGrad_stemSelect (N : ℕ) {nCls : ℕ} (xN cotN vN epsStr : String) (w : R34BWeights nCls) (hq : R34PosB w) (bf16 : Bool) (x : Vec (N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (hx : R34LossSmoothAtB N w x) {L : Vec (N * nCls) → Vec 1} {g : Vec (N * nCls)} (hL : HasGradAt L (resnet34ForwardBFull N w x) g) (σ : Fin (N * (64 * 56 * 56)) → Fin (N * (64 * (2 * 56) * (2 * 56)))) (hσ : IsMaxPool3s2SelectB N 64 56 56 (StableHLO.cbReluStridedB N w.sW w.sb w.sε w.sγ w.sβ x) σ) :
                                                            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; r34StemLossTiedAtB xN cotN vN epsStr w.sW w.sb w.sε w.sγ w.sβ bf16 x (fun (W : Kernel4 64 3 7 7) (b γ β : Vec 64) => L (resnet34ForwardBFull N { sW := W, sb := b, sε := w.sε, sγ := γ, sβ := β, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) (r34StemCotCAt σ w.sW w.sb w.sε w.sγ w.sβ x cotPool) (r34StemCotNAt σ w.sW w.sb w.sε w.sγ w.sβ x cotPool)

                                                            The stem's gradient nodes at the render's own pool routing. The stem bundle of r34_net_lossGrad reads the four stem nodes at the cotangent the pool backward maxPool3s2BackB denotes, which routes each window to maxPool3s2LocalReindexB's cell, the window's first maximum, as the emitted select_and_scatter does. This corollary states the nodes at any other routing too: for ANY pool selector σ at the stem's post-ReLU activation, the four nodes read at the cotangents routed along σ are the gradients of L in the stem's parameters (r34StemLossTiedB.select). The tied windows real ImageNet batches have are exactly the ones R34LossSmoothAtB's pool clause allows.

                                                            theorem Proofs.ResNet34TieB.r34_net_tied_lossGrad (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))) (hK : 0 < nCls) (hq : R34PosB w) (hx : R34LossSmoothAtB N w x) (ht : ∀ (n : Fin N), ∑ k : Fin nCls, targetRow N nCls t n k = 1) :
                                                            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; have L := smoothedBatchLoss N nCls α B t; (r34StemTiedB N 56 56 xN cotN vN epsStr w.sW w.sb w.sε w.sγ w.sβ bf16 x cotPool ∧ r34StemLossTiedB xN cotN vN epsStr w.sW w.sb w.sε w.sγ w.sβ bf16 x (fun (W : Kernel4 64 3 7 7) (b γ β : Vec 64) => L (resnet34ForwardBFull N { sW := W, sb := b, sε := w.sε, sγ := γ, sβ := β, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) cotPool) ∧ (r34IdTiedB N 56 56 xN cotN vN epsStr w.a0 bf16 (r34Pre0 N w x) dyA0 ∧ r34IdLossTiedB xN cotN vN epsStr w.a0 bf16 (r34Pre0 N w x) (fun (p : R34IdW 64) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := p, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyA0) ∧ (r34IdTiedB N 56 56 xN cotN vN epsStr w.a1 bf16 (r34Pre1 N w x) dyA1 ∧ r34IdLossTiedB xN cotN vN epsStr w.a1 bf16 (r34Pre1 N w x) (fun (p : R34IdW 64) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := p, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyA1) ∧ (r34IdTiedB N 56 56 xN cotN vN epsStr w.a2 bf16 (r34Pre2 N w x) dyA2 ∧ r34IdLossTiedB xN cotN vN epsStr w.a2 bf16 (r34Pre2 N w x) (fun (p : R34IdW 64) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := p, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyA2) ∧ (r34DownTiedB N 28 28 xN cotN vN epsStr w.d2 bf16 (r34Pre3 N w x) dyD2 ∧ r34DownLossTiedB xN cotN vN epsStr w.d2 bf16 (r34Pre3 N w x) (fun (p : R34DownW 64 128) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := p, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyD2) ∧ (r34IdTiedB N 28 28 xN cotN vN epsStr w.b0 bf16 (r34Pre4 N w x) dyB0 ∧ r34IdLossTiedB xN cotN vN epsStr w.b0 bf16 (r34Pre4 N w x) (fun (p : R34IdW 128) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := p, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyB0) ∧ (r34IdTiedB N 28 28 xN cotN vN epsStr w.b1 bf16 (r34Pre5 N w x) dyB1 ∧ r34IdLossTiedB xN cotN vN epsStr w.b1 bf16 (r34Pre5 N w x) (fun (p : R34IdW 128) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := p, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyB1) ∧ (r34IdTiedB N 28 28 xN cotN vN epsStr w.b2 bf16 (r34Pre6 N w x) dyB2 ∧ r34IdLossTiedB xN cotN vN epsStr w.b2 bf16 (r34Pre6 N w x) (fun (p : R34IdW 128) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := p, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyB2) ∧ (r34DownTiedB N 14 14 xN cotN vN epsStr w.d3 bf16 (r34Pre7 N w x) dyD3 ∧ r34DownLossTiedB xN cotN vN epsStr w.d3 bf16 (r34Pre7 N w x) (fun (p : R34DownW 128 256) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := p, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyD3) ∧ (r34IdTiedB N 14 14 xN cotN vN epsStr w.c0 bf16 (r34Pre8 N w x) dyC0 ∧ r34IdLossTiedB xN cotN vN epsStr w.c0 bf16 (r34Pre8 N w x) (fun (p : R34IdW 256) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := p, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyC0) ∧ (r34IdTiedB N 14 14 xN cotN vN epsStr w.c1 bf16 (r34Pre9 N w x) dyC1 ∧ r34IdLossTiedB xN cotN vN epsStr w.c1 bf16 (r34Pre9 N w x) (fun (p : R34IdW 256) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := p, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyC1) ∧ (r34IdTiedB N 14 14 xN cotN vN epsStr w.c2 bf16 (r34Pre10 N w x) dyC2 ∧ r34IdLossTiedB xN cotN vN epsStr w.c2 bf16 (r34Pre10 N w x) (fun (p : R34IdW 256) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := p, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyC2) ∧ (r34IdTiedB N 14 14 xN cotN vN epsStr w.c3 bf16 (r34Pre11 N w x) dyC3 ∧ r34IdLossTiedB xN cotN vN epsStr w.c3 bf16 (r34Pre11 N w x) (fun (p : R34IdW 256) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := p, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyC3) ∧ (r34IdTiedB N 14 14 xN cotN vN epsStr w.c4 bf16 (r34Pre12 N w x) dyC4 ∧ r34IdLossTiedB xN cotN vN epsStr w.c4 bf16 (r34Pre12 N w x) (fun (p : R34IdW 256) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := p, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyC4) ∧ (r34DownTiedB N 7 7 xN cotN vN epsStr w.d4 bf16 (r34Pre13 N w x) dyD4 ∧ r34DownLossTiedB xN cotN vN epsStr w.d4 bf16 (r34Pre13 N w x) (fun (p : R34DownW 256 512) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := p, e0 := w.e0, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyD4) ∧ (r34IdTiedB N 7 7 xN cotN vN epsStr w.e0 bf16 (r34Pre14 N w x) dyE0 ∧ r34IdLossTiedB xN cotN vN epsStr w.e0 bf16 (r34Pre14 N w x) (fun (p : R34IdW 512) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := p, e1 := w.e1, Wd := w.Wd, bd := w.bd } x)) dyE0) ∧ (r34IdTiedB N 7 7 xN cotN vN epsStr w.e1 bf16 (r34Pre15 N w x) dyE1 ∧ r34IdLossTiedB xN cotN vN epsStr w.e1 bf16 (r34Pre15 N w x) (fun (p : R34IdW 512) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := p, Wd := w.Wd, bd := w.bd } x)) dyE1) ∧ r34HeadTiedB N 7 7 xN cotN w.Wd w.bd (r34Pre16 N w x) g ∧ r34HeadLossTiedB xN cotN w.Wd w.bd (r34Pre16 N w x) (fun (W : Mat 512 nCls) (b : Vec nCls) => L (resnet34ForwardBFull N { sW := w.sW, sb := w.sb, sε := w.sε, sγ := w.sγ, sβ := w.sβ, a0 := w.a0, a1 := w.a1, a2 := w.a2, d2 := w.d2, b0 := w.b0, b1 := w.b1, b2 := w.b2, d3 := w.d3, c0 := w.c0, c1 := w.c1, c2 := w.c2, c3 := w.c3, c4 := w.c4, d4 := w.d4, e0 := w.e0, e1 := w.e1, Wd := W, bd := b } x)) g

                                                            The emitted ResNet-34 step's gradient nodes ARE the loss's gradient, at one chain. For each of the 146 parameter slots, at ONE cotangent chain (the tie's own, from the emitted smoothed-loss cotangent g): the node denotes its layer's Jacobian against the chain cotangent (r34_net_tiedB), and the batched smoothed loss of resnet34ForwardBFull with that one slot varied is differentiable there with the node as its gradient (r34_net_lossGrad_smoothedCE). The two theorems each state the chain; this one states it once, so an edit to either chain breaks its proof.