Documentation

LeanMlir.Proofs.Nets.ResNet.ResNet34SyncStepTieB

ResNet-34's data-parallel step at SYNCHRONISED BatchNorm IS the single-device step at R·N #

ResNet34StepTieB.lean (T3) threads the label-smoothed loss cotangent down the batch-BN backward chain on ONE device and ties every parameter gradient node to the certified gradient. This is its data-parallel twin, for the render ResNet34RenderB emits at replicas > 1 since 2026-09-21: R replicas at batch N, every BatchNorm synchronised (bnFwdSite / bnBackSite / bnGammaSite), every parameter gradient all-reduced by its mean. The capstone r34_net_syncTiedB says that, for every parameter,

mean over the R replicas of replica r's gradient node, loss divided by B
  = the single-device gradient node at the global batch R·N, loss divided by R·B

— the gradient node r34_net_tiedB at N := R·N ties to the certified gradient. So the sentence the DP render header carries ("this step IS the single-device step at the global batch") is a theorem, and the spec it is stated against has not moved: the right-hand side is the existing single-device chain at N := R·N.

Four steps #

  1. Sharding — each replica's backward chain, handed its shard of a global cotangent, computes the shard of the global chain. Every non-BN link (relu mask, conv and strided-conv input-VJP, the 3×3/s2 pool's scatter, the head) is a per-example map and commutes with sharding by definition; the BN link is bnSyncInB, whose shard lemma bnSyncInB_shard is P2 on the graph (DataParallelSync.den_bnSyncBack_allReduce) carried across the mul_assoc seam.
  2. The collectives — the mean over replicas of each replica's gradient node is 1/R of the global node at the global cotangent (DataParallelSync's P4 lemmas, plus the strided-conv and dense ones here). The γ node is the sync one, bnSyncGammaGradB, reading the forward's all-reduced statistics — the one parameter gradient sync-BN changes.
  3. Homogeneity — the single-device chain and its gradient nodes are linear in the loss cotangent (*_smul): R × the cotangent gives R × every node.
  4. The divisor — replica r divides its loss by B and the global step by R·B, so replica r's loss cotangent is R × its shard of the global one (replicaLossCot_eq). Steps 1–3 carry that R down the chain and it cancels the collective's 1/R.

What is NOT claimed #

⚠ The replicas' saved forward activations enter as the shards of the single-device forward's (batchShard r (r34Pre_k (R*N) w X)); that the sync forward graph computes exactly those is ResNet34SyncB.resnet34FwdGraphSync_full_shard, the forward half. ⚠ That the replicas' inputs are the shards of one batch is the driver's. ⚠ The emitted artifacts run convBias := false, so the conv-bias nodes are not emitted and are not tied here (r34_net_tiedB keeps them for the flag). ⚠ The lowerer's all_reduce is trusted as every other op's lowering is.

theorem Proofs.ResNet34SyncTieB.reluMaskB_smul (n : ) (pre dy : Vec n) (s : ) :
(ResNet34TieB.reluMaskB n pre fun (i : Fin n) => s * dy i) = fun (i : Fin n) => s * ResNet34TieB.reluMaskB n pre dy i
theorem Proofs.ResNet34SyncTieB.bn_grad_input_smul (n : ) (ε γ : ) (x dy : Vec n) (s : ) :
(bn_grad_input n ε γ x fun (i : Fin n) => s * dy i) = fun (i : Fin n) => s * bn_grad_input n ε γ x dy i

The three-term BatchNorm input-gradient is linear in dy — both its reductions are.

theorem Proofs.ResNet34SyncTieB.bnPerChannel_grad_input_smul (oc m : ) (ε : ) (γ : Vec oc) (x dy : Vec (oc * m)) (s : ) :
(bnPerChannel_grad_input oc m ε γ x fun (i : Fin (oc * m)) => s * dy i) = fun (i : Fin (oc * m)) => s * bnPerChannel_grad_input oc m ε γ x dy i
theorem Proofs.ResNet34SyncTieB.bnBatchTensor4_grad_input_smul (N oc h w : ) (ε : ) (γ : Vec oc) (x dy : Vec (N * (oc * (h * w)))) (s : ) :
(bnBatchTensor4_grad_input N oc h w ε γ x fun (i : Fin (N * (oc * (h * w)))) => s * dy i) = fun (i : Fin (N * (oc * (h * w)))) => s * bnBatchTensor4_grad_input N oc h w ε γ x dy i
theorem Proofs.ResNet34SyncTieB.bnInB_smul (N oc h w : ) (ε : ) (γ : Vec oc) (x dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.bnInB N oc h w ε γ x fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * h * w))) => s * ResNet34TieB.bnInB N oc h w ε γ x dy i
theorem Proofs.ResNet34SyncTieB.batchMap_smul {N a b : } (f : Vec aVec b) (hf : ∀ (s : ) (v : Vec a), (f fun (i : Fin a) => s * v i) = fun (i : Fin b) => s * f v i) (s : ) (X : Vec (N * a)) :
(StableHLO.batchMap N f fun (i : Fin (N * a)) => s * X i) = fun (i : Fin (N * b)) => s * StableHLO.batchMap N f X i
theorem Proofs.ResNet34SyncTieB.batchMapAux_smul {N t a b : } (f : Vec tVec aVec b) (hf : ∀ (s : ) (x : Vec t) (v : Vec a), (f x fun (i : Fin a) => s * v i) = fun (i : Fin b) => s * f x v i) (s : ) (aux : Vec (N * t)) (X : Vec (N * a)) :
(StableHLO.batchMapAux N f aux fun (i : Fin (N * a)) => s * X i) = fun (i : Fin (N * b)) => s * StableHLO.batchMapAux N f aux X i
theorem Proofs.ResNet34SyncTieB.cInB_smul (N : ) {ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (dy : Vec (N * (oc * h * w))) (s : ) :
(EnetTiePoC.cInB N W b fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (ic * h * w))) => s * EnetTiePoC.cInB N W b dy i
theorem Proofs.ResNet34SyncTieB.cStridedInB_smul (N : ) {ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.cStridedInB N W b fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (ic * (2 * h) * (2 * w)))) => s * ResNet34TieB.cStridedInB N W b dy i
theorem Proofs.ResNet34SyncTieB.maxPool3s2BackFlat_smul (c h w : ) (xv : Vec (c * (2 * h) * (2 * w))) (dyv : Vec (c * h * w)) (s : ) :
(StableHLO.maxPool3s2BackFlat c h w xv fun (i : Fin (c * h * w)) => s * dyv i) = fun (i : Fin (c * (2 * h) * (2 * w))) => s * StableHLO.maxPool3s2BackFlat c h w xv dyv i

The 3×3/s2 pool's select_and_scatter is linear in the cotangent it scatters.

theorem Proofs.ResNet34SyncTieB.mpInB_smul (N c h w : ) (x : Vec (N * (c * (2 * h) * (2 * w)))) (dy : Vec (N * (c * h * w))) (s : ) :
(ResNet34TieB.mpInB N c h w x fun (i : Fin (N * (c * h * w))) => s * dy i) = fun (i : Fin (N * (c * (2 * h) * (2 * w)))) => s * ResNet34TieB.mpInB N c h w x dy i
theorem Proofs.ResNet34SyncTieB.r34HeadCotBlk_smul (N h w : ) {c nCls : } (Wd : Mat c nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (dy : Vec (N * nCls)) (s : ) :
(ResNet34TieB.r34HeadCotBlk N h w Wd bd xin fun (i : Fin (N * nCls)) => s * dy i) = fun (i : Fin (N * (c * h * w))) => s * ResNet34TieB.r34HeadCotBlk N h w Wd bd xin dy i

The block cotangents, each one line from the previous link's.

theorem Proofs.ResNet34SyncTieB.r34IdCotA_smul (N h w : ) {c : } (p : R34IdW c) (xin dy : Vec (N * (c * h * w))) (s : ) :
(ResNet34TieB.r34IdCotA N h w p xin fun (i : Fin (N * (c * h * w))) => s * dy i) = fun (i : Fin (N * (c * h * w))) => s * ResNet34TieB.r34IdCotA N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34IdCotC2_smul (N h w : ) {c : } (p : R34IdW c) (xin dy : Vec (N * (c * h * w))) (s : ) :
(ResNet34TieB.r34IdCotC2 N h w p xin fun (i : Fin (N * (c * h * w))) => s * dy i) = fun (i : Fin (N * (c * h * w))) => s * ResNet34TieB.r34IdCotC2 N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34IdCotN1_smul (N h w : ) {c : } (p : R34IdW c) (xin dy : Vec (N * (c * h * w))) (s : ) :
(ResNet34TieB.r34IdCotN1 N h w p xin fun (i : Fin (N * (c * h * w))) => s * dy i) = fun (i : Fin (N * (c * h * w))) => s * ResNet34TieB.r34IdCotN1 N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34IdCotC1_smul (N h w : ) {c : } (p : R34IdW c) (xin dy : Vec (N * (c * h * w))) (s : ) :
(ResNet34TieB.r34IdCotC1 N h w p xin fun (i : Fin (N * (c * h * w))) => s * dy i) = fun (i : Fin (N * (c * h * w))) => s * ResNet34TieB.r34IdCotC1 N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34IdCotIn_smul (N h w : ) {c : } (p : R34IdW c) (xin dy : Vec (N * (c * h * w))) (s : ) :
(ResNet34TieB.r34IdCotIn N h w p xin fun (i : Fin (N * (c * h * w))) => s * dy i) = fun (i : Fin (N * (c * h * w))) => s * ResNet34TieB.r34IdCotIn N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34DownCotA_smul (N h w : ) {ic oc : } (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34DownCotA N h w p xin fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * h * w))) => s * ResNet34TieB.r34DownCotA N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34DownCotC2_smul (N h w : ) {ic oc : } (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34DownCotC2 N h w p xin fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * h * w))) => s * ResNet34TieB.r34DownCotC2 N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34DownCotN1_smul (N h w : ) {ic oc : } (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34DownCotN1 N h w p xin fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * h * w))) => s * ResNet34TieB.r34DownCotN1 N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34DownCotC1_smul (N h w : ) {ic oc : } (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34DownCotC1 N h w p xin fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * h * w))) => s * ResNet34TieB.r34DownCotC1 N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34DownCotCp_smul (N h w : ) {ic oc : } (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34DownCotCp N h w p xin fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * h * w))) => s * ResNet34TieB.r34DownCotCp N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34DownCotIn_smul (N h w : ) {ic oc : } (p : R34DownW ic oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34DownCotIn N h w p xin fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (ic * (2 * h) * (2 * w)))) => s * ResNet34TieB.r34DownCotIn N h w p xin dy i
theorem Proofs.ResNet34SyncTieB.r34StemCotP_smul (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))))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34StemCotP N h w Ws bs εs γs βs x fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * (2 * h) * (2 * w)))) => s * ResNet34TieB.r34StemCotP N h w Ws bs εs γs βs x dy i
theorem Proofs.ResNet34SyncTieB.r34StemCotN_smul (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))))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34StemCotN N h w Ws bs εs γs βs x fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * (2 * h) * (2 * w)))) => s * ResNet34TieB.r34StemCotN N h w Ws bs εs γs βs x dy i
theorem Proofs.ResNet34SyncTieB.r34StemCotC_smul (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))))) (dy : Vec (N * (oc * h * w))) (s : ) :
(ResNet34TieB.r34StemCotC N h w Ws bs εs γs βs x fun (i : Fin (N * (oc * h * w))) => s * dy i) = fun (i : Fin (N * (oc * (2 * h) * (2 * w)))) => s * ResNet34TieB.r34StemCotC N h w Ws bs εs γs βs x dy i

The gradient nodes.

theorem Proofs.ResNet34SyncTieB.batchSlice_smul {N a : } (X : Vec (N * a)) (s : ) (n : Fin N) :
StableHLO.batchSlice N a (fun (i : Fin (N * a)) => s * X i) n = fun (i : Fin a) => s * StableHLO.batchSlice N a X n i
theorem Proofs.ResNet34SyncTieB.convWeightGradB_smul {N ic oc h w kH kW : } (xN cotN : String) (b : Vec oc) (x : Vec (N * (ic * h * w))) (W : Kernel4 oc ic kH kW) (cot : Vec (N * (oc * h * w))) (s : ) (idx : Fin (oc * ic * kH * kW)) :
StableHLO.den (StableHLO.SHlo.convWeightGradB xN b x W (StableHLO.SHlo.operand cotN fun (i : Fin (N * (oc * h * w))) => s * cot i)) idx = s * StableHLO.den (StableHLO.SHlo.convWeightGradB xN b x W (StableHLO.SHlo.operand cotN cot)) idx
theorem Proofs.ResNet34SyncTieB.convStridedWeightGradB_smul {N ic oc h w kH kW : } (xN cotN : String) (b : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (W : Kernel4 oc ic kH kW) (cot : Vec (N * (oc * h * w))) (s : ) (idx : Fin (oc * ic * kH * kW)) :
theorem Proofs.ResNet34SyncTieB.bnGammaGradB_smul {N oc h w : } (vN epsStr cotN : String) (ε : ) (v cot : Vec (N * (oc * (h * w)))) (s : ) (k : Fin oc) :
StableHLO.den (StableHLO.SHlo.bnGammaGradB vN epsStr ε v (StableHLO.SHlo.operand cotN fun (i : Fin (N * (oc * (h * w)))) => s * cot i)) k = s * StableHLO.den (StableHLO.SHlo.bnGammaGradB vN epsStr ε v (StableHLO.SHlo.operand cotN cot)) k
theorem Proofs.ResNet34SyncTieB.bnBetaGradB_smul {N oc h w : } (cotN : String) (cot : Vec (N * (oc * (h * w)))) (s : ) (k : Fin oc) :
StableHLO.den (StableHLO.SHlo.operand cotN fun (i : Fin (N * (oc * (h * w)))) => s * cot i).bnBetaGradB k = s * StableHLO.den (StableHLO.SHlo.operand cotN cot).bnBetaGradB k
theorem Proofs.ResNet34SyncTieB.denseWeightGradB_smul {N a c : } (xN cotN : String) (x : Vec (N * a)) (cot : Vec (N * c)) (s : ) (idx : Fin (a * c)) :
theorem Proofs.ResNet34SyncTieB.denseBiasGradB_smul {N c : } (cotN : String) (cot : Vec (N * c)) (s : ) (j : Fin c) :
theorem Proofs.ResNet34SyncTieB.reluMaskB_shard {R N n : } (PRE DY : Vec (R * N * n)) (r : Fin R) :
ResNet34TieB.reluMaskB (N * n) (batchShard R N n PRE r) (batchShard R N n DY r) = batchShard R N n (ResNet34TieB.reluMaskB (R * N * n) PRE DY) r
theorem Proofs.ResNet34SyncTieB.cInB_shard {R N ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (DY : Vec (R * N * (oc * h * w))) (r : Fin R) :
EnetTiePoC.cInB N W b (batchShard R N (oc * h * w) DY r) = batchShard R N (ic * h * w) (EnetTiePoC.cInB (R * N) W b DY) r
theorem Proofs.ResNet34SyncTieB.cStridedInB_shard {R N ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (DY : Vec (R * N * (oc * h * w))) (r : Fin R) :
ResNet34TieB.cStridedInB N W b (batchShard R N (oc * h * w) DY r) = batchShard R N (ic * (2 * h) * (2 * w)) (ResNet34TieB.cStridedInB (R * N) W b DY) r
theorem Proofs.ResNet34SyncTieB.mpInB_shard {R N : } (c h w : ) (X : Vec (R * N * (c * (2 * h) * (2 * w)))) (DY : Vec (R * N * (c * h * w))) (r : Fin R) :
ResNet34TieB.mpInB N c h w (batchShard R N (c * (2 * h) * (2 * w)) X r) (batchShard R N (c * h * w) DY r) = batchShard R N (c * (2 * h) * (2 * w)) (ResNet34TieB.mpInB (R * N) c h w X DY) r
theorem Proofs.ResNet34SyncTieB.r34HeadCotBlk_shard {R N : } (h w : ) {c nCls : } (Wd : Mat c nCls) (bd : Vec nCls) (XIN : Vec (R * N * (c * h * w))) (G : Vec (R * N * nCls)) (r : Fin R) :
ResNet34TieB.r34HeadCotBlk N h w Wd bd (batchShard R N (c * h * w) XIN r) (batchShard R N nCls G r) = batchShard R N (c * h * w) (ResNet34TieB.r34HeadCotBlk (R * N) h w Wd bd XIN G) r
noncomputable def Proofs.ResNet34SyncTieB.bnSyncInB (R : ) (hR : 0 < R) (N oc h w : ) (ε : ) (γ : Vec oc) (xs dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
Vec (N * (oc * h * w))

Replica r's sync-BN input cotangent, as bnBackSite's replicas > 1 branch computes it, in the network layout: this replica's [μ ‖ σ² ‖ mean(γ·dy) ‖ mean(x̂·γ·dy)] (bnSyncDyStatsB, reading the forward's syncStats) all-reduced, then bnSyncBack. The replica peer of ResNet34TieB.bnInB, and like it written as the den of the emitted nodes over .operand leaves.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Proofs.ResNet34SyncTieB.reassocB_shard {R N oc h w : } (X : Vec (R * N * (oc * h * w))) (r : Fin R) :
    EnetTiePoC.reassocB N oc h w (batchShard R N (oc * h * w) X r) = batchShard R N (oc * (h * w)) (EnetTiePoC.reassocB (R * N) oc h w X) r

    reassocB of a shard is the shard of the reassocB.

    theorem Proofs.ResNet34SyncTieB.bnSyncInB_shard (R : ) (hR : 0 < R) (N oc h w : ) (hm : N * (h * w) 0) (hM : R * N * (h * w) 0) (ε : ) (γ : Vec oc) (xs dys : Fin RVec (N * (oc * h * w))) (X DY : Vec (R * N * (oc * h * w))) (hxs : ∀ (r : Fin R), xs r = batchShard R N (oc * h * w) X r) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
    bnSyncInB R hR N oc h w ε γ xs dys r = batchShard R N (oc * h * w) (ResNet34TieB.bnInB (R * N) oc h w ε γ X DY) r

    ⭐⭐ The sync-BN backward on replica r is shard r of the global-batch BN backwardden_bnSyncBack_allReduce (P2 on the graph) at the network index. The right-hand side is bnInB, the single-device chain's BN link, at N := R·N.

    noncomputable def Proofs.ResNet34SyncTieB.r34IdSyncCotA (R N h w : ) {c : } (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (r : Fin R) :
    Vec (N * (c * h * w))
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def Proofs.ResNet34SyncTieB.r34IdSyncCotC2 (R : ) (hR : 0 < R) (N h w : ) {c : } (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (r : Fin R) :
      Vec (N * (c * h * w))
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def Proofs.ResNet34SyncTieB.r34IdSyncCotN1 (R : ) (hR : 0 < R) (N h w : ) {c : } (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (r : Fin R) :
        Vec (N * (c * h * w))
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def Proofs.ResNet34SyncTieB.r34IdSyncCotC1 (R : ) (hR : 0 < R) (N h w : ) {c : } (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (r : Fin R) :
          Vec (N * (c * h * w))
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def Proofs.ResNet34SyncTieB.r34IdSyncCotIn (R : ) (hR : 0 < R) (N h w : ) {c : } (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (r : Fin R) :
            Vec (N * (c * h * w))

            The replica's block-INPUT cotangent: the residual fan-in, body plus identity skip.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Proofs.ResNet34SyncTieB.r34IdSyncCotA_shard (R N h w : ) {c : } (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (c * h * w) DY r) (r : Fin R) :
              r34IdSyncCotA R N h w p XIN dys r = batchShard R N (c * h * w) (ResNet34TieB.r34IdCotA (R * N) h w p XIN DY) r
              theorem Proofs.ResNet34SyncTieB.r34IdSyncCotC2_shard (R : ) (hR : 0 < R) (N h w : ) {c : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (c * h * w) DY r) (r : Fin R) :
              r34IdSyncCotC2 R hR N h w p XIN dys r = batchShard R N (c * h * w) (ResNet34TieB.r34IdCotC2 (R * N) h w p XIN DY) r
              theorem Proofs.ResNet34SyncTieB.r34IdSyncCotN1_shard (R : ) (hR : 0 < R) (N h w : ) {c : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (c * h * w) DY r) (r : Fin R) :
              r34IdSyncCotN1 R hR N h w p XIN dys r = batchShard R N (c * h * w) (ResNet34TieB.r34IdCotN1 (R * N) h w p XIN DY) r
              theorem Proofs.ResNet34SyncTieB.r34IdSyncCotC1_shard (R : ) (hR : 0 < R) (N h w : ) {c : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (c * h * w) DY r) (r : Fin R) :
              r34IdSyncCotC1 R hR N h w p XIN dys r = batchShard R N (c * h * w) (ResNet34TieB.r34IdCotC1 (R * N) h w p XIN DY) r
              theorem Proofs.ResNet34SyncTieB.r34IdSyncCotIn_shard (R : ) (hR : 0 < R) (N h w : ) {c : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (c * h * w) DY r) (r : Fin R) :
              r34IdSyncCotIn R hR N h w p XIN dys r = batchShard R N (c * h * w) (ResNet34TieB.r34IdCotIn (R * N) h w p XIN DY) r
              noncomputable def Proofs.ResNet34SyncTieB.r34DownSyncCotA (R N h w : ) {ic oc : } (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
              Vec (N * (oc * h * w))
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def Proofs.ResNet34SyncTieB.r34DownSyncCotC2 (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
                Vec (N * (oc * h * w))
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  noncomputable def Proofs.ResNet34SyncTieB.r34DownSyncCotN1 (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
                  Vec (N * (oc * h * w))
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def Proofs.ResNet34SyncTieB.r34DownSyncCotC1 (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
                    Vec (N * (oc * h * w))
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      noncomputable def Proofs.ResNet34SyncTieB.r34DownSyncCotCp (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
                      Vec (N * (oc * h * w))
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        noncomputable def Proofs.ResNet34SyncTieB.r34DownSyncCotIn (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
                        Vec (N * (ic * (2 * h) * (2 * w)))

                        The replica's block-INPUT cotangent: the projected-residual fan-in.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Proofs.ResNet34SyncTieB.r34DownSyncCotA_shard (R N h w : ) {ic oc : } (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                          r34DownSyncCotA R N h w p XIN dys r = batchShard R N (oc * h * w) (ResNet34TieB.r34DownCotA (R * N) h w p XIN DY) r
                          theorem Proofs.ResNet34SyncTieB.r34DownSyncCotC2_shard (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                          r34DownSyncCotC2 R hR N h w p XIN dys r = batchShard R N (oc * h * w) (ResNet34TieB.r34DownCotC2 (R * N) h w p XIN DY) r
                          theorem Proofs.ResNet34SyncTieB.r34DownSyncCotN1_shard (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                          r34DownSyncCotN1 R hR N h w p XIN dys r = batchShard R N (oc * h * w) (ResNet34TieB.r34DownCotN1 (R * N) h w p XIN DY) r
                          theorem Proofs.ResNet34SyncTieB.r34DownSyncCotC1_shard (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                          r34DownSyncCotC1 R hR N h w p XIN dys r = batchShard R N (oc * h * w) (ResNet34TieB.r34DownCotC1 (R * N) h w p XIN DY) r
                          theorem Proofs.ResNet34SyncTieB.r34DownSyncCotCp_shard (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                          r34DownSyncCotCp R hR N h w p XIN dys r = batchShard R N (oc * h * w) (ResNet34TieB.r34DownCotCp (R * N) h w p XIN DY) r
                          theorem Proofs.ResNet34SyncTieB.r34DownSyncCotIn_shard (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                          r34DownSyncCotIn R hR N h w p XIN dys r = batchShard R N (ic * (2 * h) * (2 * w)) (ResNet34TieB.r34DownCotIn (R * N) h w p XIN DY) r
                          noncomputable def Proofs.ResNet34SyncTieB.r34StemSyncCotP (R N h w : ) {ic oc : } (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (γs βs : Vec oc) (X : Vec (R * N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
                          Vec (N * (oc * (2 * h) * (2 * w)))
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def Proofs.ResNet34SyncTieB.r34StemSyncCotN (R N h w : ) {ic oc : } (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (γs βs : Vec oc) (X : Vec (R * N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
                            Vec (N * (oc * (2 * h) * (2 * w)))
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              noncomputable def Proofs.ResNet34SyncTieB.r34StemSyncCotC (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (γs βs : Vec oc) (X : Vec (R * N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (dys : Fin RVec (N * (oc * h * w))) (r : Fin R) :
                              Vec (N * (oc * (2 * h) * (2 * w)))
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem Proofs.ResNet34SyncTieB.r34StemSyncCotP_shard (R N h w : ) {ic oc : } (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (γs βs : Vec oc) (X : Vec (R * N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                                r34StemSyncCotP R N h w Ws bs εs γs βs X dys r = batchShard R N (oc * (2 * h) * (2 * w)) (ResNet34TieB.r34StemCotP (R * N) h w Ws bs εs γs βs X DY) r
                                theorem Proofs.ResNet34SyncTieB.r34StemSyncCotN_shard (R N h w : ) {ic oc : } (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (γs βs : Vec oc) (X : Vec (R * N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                                r34StemSyncCotN R N h w Ws bs εs γs βs X dys r = batchShard R N (oc * (2 * h) * (2 * w)) (ResNet34TieB.r34StemCotN (R * N) h w Ws bs εs γs βs X DY) r
                                theorem Proofs.ResNet34SyncTieB.r34StemSyncCotC_shard (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (γs βs : Vec oc) (X : Vec (R * N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                                r34StemSyncCotC R hR N h w Ws bs εs γs βs X dys r = batchShard R N (oc * (2 * h) * (2 * w)) (ResNet34TieB.r34StemCotC (R * N) h w Ws bs εs γs βs X DY) r
                                theorem Proofs.ResNet34SyncTieB.den_allReduceMeanF_convStridedWeightGradB_shard {N ic oc h w kH kW : } (R : ) (hR : 0 < R) (t xN cotN : String) (ds : List ) (b : Vec oc) (W : Kernel4 oc ic kH kW) (X : Vec (R * N * (ic * (2 * h) * (2 * w)))) (DY : Vec (R * N * (oc * h * w))) (dy : Fin RStableHLO.SHlo (N * (oc * h * w))) (hdy : ∀ (r : Fin R), StableHLO.den (dy r) = batchShard R N (oc * h * w) DY r) (idx : Fin (oc * ic * kH * kW)) :
                                StableHLO.den (StableHLO.SHlo.allReduceMeanF R hR t ds fun (r : Fin R) => StableHLO.SHlo.convStridedWeightGradB xN b (batchShard R N (ic * (2 * h) * (2 * w)) X r) W (dy r)) idx = 1 / R * StableHLO.den (StableHLO.SHlo.convStridedWeightGradB xN b X W (StableHLO.SHlo.operand cotN DY)) idx

                                P4 at the STRIDED conv weightden_allReduceMeanF_convWeightGradB_shard's strided peer.

                                theorem Proofs.ResNet34SyncTieB.den_allReduceMeanF_denseWeightGradB_shard {N a c : } (R : ) (hR : 0 < R) (t xN cotN : String) (ds : List ) (A : Vec (R * N * a)) (DY : Vec (R * N * c)) (dy : Fin RStableHLO.SHlo (N * c)) (hdy : ∀ (r : Fin R), StableHLO.den (dy r) = batchShard R N c DY r) (idx : Fin (a * c)) :

                                P4 at the dense weight — the head's Σ_n outer product, split by replica.

                                theorem Proofs.ResNet34SyncTieB.den_allReduceMeanF_denseBiasGradB_shard {N c : } (R : ) (hR : 0 < R) (t cotN : String) (ds : List ) (DY : Vec (R * N * c)) (dy : Fin RStableHLO.SHlo (N * c)) (hdy : ∀ (r : Fin R), StableHLO.den (dy r) = batchShard R N c DY r) (j : Fin c) :

                                P4 at the dense biasΣ_n cot, split by replica.

                                def Proofs.ResNet34SyncTieB.ConvWSync (R : ) (hR : 0 < R) (N h w : ) {ic oc kH kW : } (t xN cotN : String) (b : Vec oc) (X : Vec (R * N * (ic * h * w))) (W : Kernel4 oc ic kH kW) (cots : Fin RVec (N * (oc * h * w))) (COT : Vec (R * N * (oc * h * w))) :

                                One conv weight, DP-tied: the mean over replicas of each replica's weight-gradient node (at its shard of the layer input and its own cotangent) IS the single-device node at the global batch. Tags are the render's: the collective is named for the parameter.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Proofs.ResNet34SyncTieB.ConvStridedWSync (R : ) (hR : 0 < R) (N h w : ) {ic oc kH kW : } (t xN cotN : String) (b : Vec oc) (X : Vec (R * N * (ic * (2 * h) * (2 * w)))) (W : Kernel4 oc ic kH kW) (cots : Fin RVec (N * (oc * h * w))) (COT : Vec (R * N * (oc * h * w))) :

                                  The strided conv weight, DP-tied.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def Proofs.ResNet34SyncTieB.BnSync (R : ) (hR : 0 < R) (N oc h w : ) (tg tb vN epsStr cotN : String) (ε : ) (V : Vec (R * N * (oc * h * w))) (cots : Fin RVec (N * (oc * h * w))) (COT : Vec (R * N * (oc * h * w))) :

                                    One BatchNorm's γ and β, DP-tied. Each replica's γ node is bnSyncGammaGradB, reading the forward's all-reduced [μ ‖ σ²] (syncStats over the replicas' pre-BN activations, tagged {tg}mu / {tg}var as bnFwdSite tags them), so its is the global batch's; the β node reads no statistic. The right-hand sides are the single-device bnGammaGradB / bnBetaGradB at N := R·NBnPairTiedB's nodes.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def Proofs.ResNet34SyncTieB.DenseSync (R : ) (hR : 0 < R) (N : ) {a c : } (tW tb xN cotN : String) (A : Vec (R * N * a)) (cots : Fin RVec (N * c)) (COT : Vec (R * N * c)) :

                                      The dense weight and bias, DP-tied.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Proofs.ResNet34SyncTieB.inv_mul_R (R : ) (hR : 0 < R) (v : ) :
                                        1 / R * (R * v) = v

                                        (1/R)·(R·v) = v — the collective's mean against the divisor's R.

                                        theorem Proofs.ResNet34SyncTieB.convWSync_of_scaled (R : ) (hR : 0 < R) (N h w : ) {ic oc kH kW : } (t xN cotN : String) (b : Vec oc) (X : Vec (R * N * (ic * h * w))) (W : Kernel4 oc ic kH kW) (cots : Fin RVec (N * (oc * h * w))) (COT : Vec (R * N * (oc * h * w))) (hc : ∀ (r : Fin R), cots r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => R * COT i) r) :
                                        ConvWSync R hR N h w t xN cotN b X W cots COT

                                        A replica family at R × the shards of COT gives the DP tie — the collective's 1/R (§4) cancels the R homogeneity (§1) carries. The same three lines for every kind below.

                                        theorem Proofs.ResNet34SyncTieB.convStridedWSync_of_scaled (R : ) (hR : 0 < R) (N h w : ) {ic oc kH kW : } (t xN cotN : String) (b : Vec oc) (X : Vec (R * N * (ic * (2 * h) * (2 * w)))) (W : Kernel4 oc ic kH kW) (cots : Fin RVec (N * (oc * h * w))) (COT : Vec (R * N * (oc * h * w))) (hc : ∀ (r : Fin R), cots r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => R * COT i) r) :
                                        ConvStridedWSync R hR N h w t xN cotN b X W cots COT
                                        theorem Proofs.ResNet34SyncTieB.bnSync_of_scaled (R : ) (hR : 0 < R) (N oc h w : ) (hm : N * (h * w) 0) (hM : R * N * (h * w) 0) (tg tb vN epsStr cotN : String) (ε : ) (V : Vec (R * N * (oc * h * w))) (cots : Fin RVec (N * (oc * h * w))) (COT : Vec (R * N * (oc * h * w))) (hc : ∀ (r : Fin R), cots r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => R * COT i) r) :
                                        BnSync R hR N oc h w tg tb vN epsStr cotN ε V cots COT
                                        theorem Proofs.ResNet34SyncTieB.denseSync_of_scaled (R : ) (hR : 0 < R) (N : ) {a c : } (tW tb xN cotN : String) (A : Vec (R * N * a)) (cots : Fin RVec (N * c)) (COT : Vec (R * N * c)) (hc : ∀ (r : Fin R), cots r = batchShard R N c (fun (i : Fin (R * N * c)) => R * COT i) r) :
                                        DenseSync R hR N tW tb xN cotN A cots COT
                                        def Proofs.ResNet34SyncTieB.r34IdSyncTiedB (R : ) (hR : 0 < R) (N h w : ) {c : } (pfx xN cotN vN epsStr : String) (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) :

                                        Identity basic block, DP-tied. Its six emitted parameter collectives — conv₁/conv₂ weights, bn₁/bn₂ γ and β — each equal the single-device node at the global batch, at the single-device chain cotangents driven by DY, when the replicas' block-output cotangents are R × its shards.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          theorem Proofs.ResNet34SyncTieB.r34IdSyncCotIn_scaled (R : ) (hR : 0 < R) (N h w : ) {c : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (c * h * w) (fun (i : Fin (R * N * (c * h * w))) => R * DY i) r) (r : Fin R) :
                                          r34IdSyncCotIn R hR N h w p XIN dys r = batchShard R N (c * h * w) (fun (i : Fin (R * N * (c * h * w))) => R * ResNet34TieB.r34IdCotIn (R * N) h w p XIN DY i) r

                                          The scaled-shard invariant, carried through one identity block: replicas at R × the shards of DY produce block-input cotangents at R × the shards of the single-device one.

                                          theorem Proofs.ResNet34SyncTieB.r34_idblock_syncTiedB (R : ) (hR : 0 < R) (N h w : ) {c : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (pfx xN cotN vN epsStr : String) (p : R34IdW c) (XIN : Vec (R * N * (c * h * w))) (dys : Fin RVec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (c * h * w) (fun (i : Fin (R * N * (c * h * w))) => R * DY i) r) :
                                          r34IdSyncTiedB R hR N h w pfx xN cotN vN epsStr p XIN dys DY
                                          def Proofs.ResNet34SyncTieB.r34DownSyncTiedB (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (pfx xN cotN vN epsStr : String) (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) :

                                          Downsample basic block, DP-tied — nine emitted collectives: the strided conv₁, the stride-1 conv₂ and the 1×1/s2 projection weights, and the three BatchNorms' γ and β.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem Proofs.ResNet34SyncTieB.r34DownSyncCotIn_scaled (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => R * DY i) r) (r : Fin R) :
                                            r34DownSyncCotIn R hR N h w p XIN dys r = batchShard R N (ic * (2 * h) * (2 * w)) (fun (i : Fin (R * N * (ic * (2 * h) * (2 * w)))) => R * ResNet34TieB.r34DownCotIn (R * N) h w p XIN DY i) r
                                            theorem Proofs.ResNet34SyncTieB.r34_downblock_syncTiedB (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (pfx xN cotN vN epsStr : String) (p : R34DownW ic oc) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => R * DY i) r) :
                                            r34DownSyncTiedB R hR N h w pfx xN cotN vN epsStr p XIN dys DY
                                            def Proofs.ResNet34SyncTieB.r34StemSyncTiedB (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (γs βs : Vec oc) (X : Vec (R * N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) :

                                            Stem, DP-tied — the 7×7/s2 conv weight and its BatchNorm's γ and β.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              theorem Proofs.ResNet34SyncTieB.r34_stem_syncTiedB (R : ) (hR : 0 < R) (N h w : ) {ic oc : } (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (γs βs : Vec oc) (X : Vec (R * N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) (dys : Fin RVec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => R * DY i) r) :
                                              r34StemSyncTiedB R hR N h w xN cotN vN epsStr Ws bs εs γs βs X dys DY
                                              def Proofs.ResNet34SyncTieB.r34HeadSyncTiedB (R : ) (hR : 0 < R) (N h w : ) {c nCls : } (xN cotN : String) (XIN : Vec (R * N * (c * h * w))) (gs : Fin RVec (N * nCls)) (G : Vec (R * N * nCls)) :

                                              Head, DP-tied — the classifier's weight and bias, at the GAP output.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem Proofs.ResNet34SyncTieB.r34_head_syncTiedB (R : ) (hR : 0 < R) (N h w : ) {c nCls : } (xN cotN : String) (XIN : Vec (R * N * (c * h * w))) (gs : Fin RVec (N * nCls)) (G : Vec (R * N * nCls)) (hgs : ∀ (r : Fin R), gs r = batchShard R N nCls (fun (i : Fin (R * N * nCls)) => R * G i) r) :
                                                r34HeadSyncTiedB R hR N h w xN cotN XIN gs G
                                                theorem Proofs.ResNet34SyncTieB.r34HeadCotBlk_scaled (R N h w : ) {c nCls : } (Wd : Mat c nCls) (bd : Vec nCls) (XIN : Vec (R * N * (c * h * w))) (gs : Fin RVec (N * nCls)) (G : Vec (R * N * nCls)) (hgs : ∀ (r : Fin R), gs r = batchShard R N nCls (fun (i : Fin (R * N * nCls)) => R * G i) r) (r : Fin R) :
                                                ResNet34TieB.r34HeadCotBlk N h w Wd bd (batchShard R N (c * h * w) XIN r) (gs r) = batchShard R N (c * h * w) (fun (i : Fin (R * N * (c * h * w))) => R * ResNet34TieB.r34HeadCotBlk (R * N) h w Wd bd XIN G i) r

                                                The head's block-side cotangent on a replica, at R × the shards of G, is R × the shard of the single-device one.

                                                theorem Proofs.ResNet34SyncTieB.rowB_shard {R N K : } (Z : Vec (R * N * K)) (r : Fin R) :
                                                ResNet34TieB.rowB N K (batchShard R N K Z r) = batchShard R N (1 * K) (ResNet34TieB.rowB (R * N) K Z) r

                                                rowB of a shard is the shard of the rowB — a relabelling inside each example.

                                                theorem Proofs.ResNet34SyncTieB.unrowB_shard {R N K : } (Z : Vec (R * N * (1 * K))) (r : Fin R) :
                                                ResNet34TieB.unrowB N K (batchShard R N (1 * K) Z r) = batchShard R N K (ResNet34TieB.unrowB (R * N) K Z) r
                                                theorem Proofs.ResNet34SyncTieB.replicaLossCot_eq (R N nCls : ) (hR : 0 < R) (α B : ) (aStr negAK bStr logN ohN : String) (Z : Vec (R * N * nCls)) (T : Vec (R * N * (1 * nCls))) (r : Fin R) :
                                                ResNet34TieB.unrowB N nCls (StableHLO.den (smoothedLossCotGraph N nCls α B aStr negAK bStr logN ohN (ResNet34TieB.rowB N nCls (batchShard R N nCls Z r)) (batchShard R N (1 * nCls) T r))) = batchShard R N nCls (fun (i : Fin (R * N * nCls)) => R * ResNet34TieB.unrowB (R * N) nCls (StableHLO.den (smoothedLossCotGraph (R * N) nCls α (R * B) aStr negAK bStr logN ohN (ResNet34TieB.rowB (R * N) nCls Z) T)) i) r

                                                The divisor step. Replica r divides its smoothed-CE cotangent by B — the render's divConstB at the per-replica batch — and the single-device step at the global batch divides by R·B. At the replica's shard of the logits and targets, the replica's cotangent is R × its shard of the global one. Nothing else about the loss differs: softmax, the label-smoothing shift and the target are per example.

                                                theorem Proofs.ResNet34SyncTieB.r34_net_syncTiedB (R : ) (hR : 0 < R) (N : ) (hN : 0 < N) {nCls : } (xN cotN vN epsStr aStr negAK bStr logN ohN : String) (α B : ) (w : R34BWeights nCls) (X : Vec (R * N * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))) (T : Vec (R * N * (1 * nCls))) :
                                                have G := ResNet34TieB.unrowB (R * N) nCls (StableHLO.den (smoothedLossCotGraph (R * N) nCls α (R * B) aStr negAK bStr logN ohN (ResNet34TieB.rowB (R * N) nCls (resnet34ForwardB_full (R * N) w X)) T)); have dyE1 := ResNet34TieB.r34HeadCotBlk (R * N) 7 7 w.Wd w.bd (r34Pre16 (R * N) w X) G; have dyE0 := ResNet34TieB.r34IdCotIn (R * N) 7 7 w.e1 (r34Pre15 (R * N) w X) dyE1; have dyD4 := ResNet34TieB.r34IdCotIn (R * N) 7 7 w.e0 (r34Pre14 (R * N) w X) dyE0; have dyC4 := ResNet34TieB.r34DownCotIn (R * N) 7 7 w.d4 (r34Pre13 (R * N) w X) dyD4; have dyC3 := ResNet34TieB.r34IdCotIn (R * N) 14 14 w.c4 (r34Pre12 (R * N) w X) dyC4; have dyC2 := ResNet34TieB.r34IdCotIn (R * N) 14 14 w.c3 (r34Pre11 (R * N) w X) dyC3; have dyC1 := ResNet34TieB.r34IdCotIn (R * N) 14 14 w.c2 (r34Pre10 (R * N) w X) dyC2; have dyC0 := ResNet34TieB.r34IdCotIn (R * N) 14 14 w.c1 (r34Pre9 (R * N) w X) dyC1; have dyD3 := ResNet34TieB.r34IdCotIn (R * N) 14 14 w.c0 (r34Pre8 (R * N) w X) dyC0; have dyB2 := ResNet34TieB.r34DownCotIn (R * N) 14 14 w.d3 (r34Pre7 (R * N) w X) dyD3; have dyB1 := ResNet34TieB.r34IdCotIn (R * N) 28 28 w.b2 (r34Pre6 (R * N) w X) dyB2; have dyB0 := ResNet34TieB.r34IdCotIn (R * N) 28 28 w.b1 (r34Pre5 (R * N) w X) dyB1; have dyD2 := ResNet34TieB.r34IdCotIn (R * N) 28 28 w.b0 (r34Pre4 (R * N) w X) dyB0; have dyA2 := ResNet34TieB.r34DownCotIn (R * N) 28 28 w.d2 (r34Pre3 (R * N) w X) dyD2; have dyA1 := ResNet34TieB.r34IdCotIn (R * N) 56 56 w.a2 (r34Pre2 (R * N) w X) dyA2; have dyA0 := ResNet34TieB.r34IdCotIn (R * N) 56 56 w.a1 (r34Pre1 (R * N) w X) dyA1; have g := fun (r : Fin R) => ResNet34TieB.unrowB N nCls (StableHLO.den (smoothedLossCotGraph N nCls α B aStr negAK bStr logN ohN (ResNet34TieB.rowB N nCls (batchShard R N nCls (resnet34ForwardB_full (R * N) w X) r)) (batchShard R N (1 * nCls) T r))); have eE1 := fun (r : Fin R) => ResNet34TieB.r34HeadCotBlk N 7 7 w.Wd w.bd (batchShard R N (512 * 7 * 7) (r34Pre16 (R * N) w X) r) (g r); have eE0 := r34IdSyncCotIn R hR N 7 7 w.e1 (r34Pre15 (R * N) w X) eE1; have eD4 := r34IdSyncCotIn R hR N 7 7 w.e0 (r34Pre14 (R * N) w X) eE0; have eC4 := r34DownSyncCotIn R hR N 7 7 w.d4 (r34Pre13 (R * N) w X) eD4; have eC3 := r34IdSyncCotIn R hR N 14 14 w.c4 (r34Pre12 (R * N) w X) eC4; have eC2 := r34IdSyncCotIn R hR N 14 14 w.c3 (r34Pre11 (R * N) w X) eC3; have eC1 := r34IdSyncCotIn R hR N 14 14 w.c2 (r34Pre10 (R * N) w X) eC2; have eC0 := r34IdSyncCotIn R hR N 14 14 w.c1 (r34Pre9 (R * N) w X) eC1; have eD3 := r34IdSyncCotIn R hR N 14 14 w.c0 (r34Pre8 (R * N) w X) eC0; have eB2 := r34DownSyncCotIn R hR N 14 14 w.d3 (r34Pre7 (R * N) w X) eD3; have eB1 := r34IdSyncCotIn R hR N 28 28 w.b2 (r34Pre6 (R * N) w X) eB2; have eB0 := r34IdSyncCotIn R hR N 28 28 w.b1 (r34Pre5 (R * N) w X) eB1; have eD2 := r34IdSyncCotIn R hR N 28 28 w.b0 (r34Pre4 (R * N) w X) eB0; have eA2 := r34DownSyncCotIn R hR N 28 28 w.d2 (r34Pre3 (R * N) w X) eD2; have eA1 := r34IdSyncCotIn R hR N 56 56 w.a2 (r34Pre2 (R * N) w X) eA2; have eA0 := r34IdSyncCotIn R hR N 56 56 w.a1 (r34Pre1 (R * N) w X) eA1; have ePool := r34IdSyncCotIn R hR N 56 56 w.a0 (r34Pre0 (R * N) w X) eA0; r34StemSyncTiedB R hR N 56 56 xN cotN vN epsStr w.sW w.sb w. w. w. X ePool (ResNet34TieB.r34IdCotIn (R * N) 56 56 w.a0 (r34Pre0 (R * N) w X) dyA0) r34IdSyncTiedB R hR N 56 56 "s1b0" xN cotN vN epsStr w.a0 (r34Pre0 (R * N) w X) eA0 dyA0 r34IdSyncTiedB R hR N 56 56 "s1b1" xN cotN vN epsStr w.a1 (r34Pre1 (R * N) w X) eA1 dyA1 r34IdSyncTiedB R hR N 56 56 "s1b2" xN cotN vN epsStr w.a2 (r34Pre2 (R * N) w X) eA2 dyA2 r34DownSyncTiedB R hR N 28 28 "d2" xN cotN vN epsStr w.d2 (r34Pre3 (R * N) w X) eD2 dyD2 r34IdSyncTiedB R hR N 28 28 "s2b0" xN cotN vN epsStr w.b0 (r34Pre4 (R * N) w X) eB0 dyB0 r34IdSyncTiedB R hR N 28 28 "s2b1" xN cotN vN epsStr w.b1 (r34Pre5 (R * N) w X) eB1 dyB1 r34IdSyncTiedB R hR N 28 28 "s2b2" xN cotN vN epsStr w.b2 (r34Pre6 (R * N) w X) eB2 dyB2 r34DownSyncTiedB R hR N 14 14 "d3" xN cotN vN epsStr w.d3 (r34Pre7 (R * N) w X) eD3 dyD3 r34IdSyncTiedB R hR N 14 14 "s3b0" xN cotN vN epsStr w.c0 (r34Pre8 (R * N) w X) eC0 dyC0 r34IdSyncTiedB R hR N 14 14 "s3b1" xN cotN vN epsStr w.c1 (r34Pre9 (R * N) w X) eC1 dyC1 r34IdSyncTiedB R hR N 14 14 "s3b2" xN cotN vN epsStr w.c2 (r34Pre10 (R * N) w X) eC2 dyC2 r34IdSyncTiedB R hR N 14 14 "s3b3" xN cotN vN epsStr w.c3 (r34Pre11 (R * N) w X) eC3 dyC3 r34IdSyncTiedB R hR N 14 14 "s3b4" xN cotN vN epsStr w.c4 (r34Pre12 (R * N) w X) eC4 dyC4 r34DownSyncTiedB R hR N 7 7 "d4" xN cotN vN epsStr w.d4 (r34Pre13 (R * N) w X) eD4 dyD4

                                                ⭐⭐⭐ The synchronised-BN data-parallel ResNet-34 step IS the single-device step at the global batch. R replicas at batch N, each dividing its loss by B, each running the render's sync-BN backward chain from its own label-smoothed cotangent; every parameter's all-reduced mean gradient — stem 3, thirteen identity blocks × 6, three downsample blocks × 9, dense 2: the 110 the render emits — equals the single-device batch-BN gradient node at batch R·N, loss divided by R·B, at the cotangent T3's chain delivers there.

                                                ⭐ The left-hand chain is the replicas' own: sync-BN backward (bnSyncInB, a collective per BN layer), per-example conv / relu / pool / head links, each replica's own loss cotangent. The right-hand chain is r34_net_tiedB's at N := R·N, B := R·B, whose nodes that capstone ties to the certified gradient — so this and it together say the DP step's update is the certified gradient of the mean loss over all R·N examples.

                                                ⛔ Before 2026-09-21 the DP render normalised per replica and this statement was false: DataParallel.dpMeanGrad_ne_globalBatchGrad is the witness, and stays as the statement of what those runs did.