Documentation

LeanMlir.Proofs.Foundation.BatchedStageLayers

Batched activation stages — conv/depthwise → true BN → relu or relu6, as CertLayers #

The kinked stages the ResNets, MobileNetV2 and MobileNetV4 are built from, at the batched index N·(c·h·w). Each comes with its _at VJP (certified where the pre-activation misses the kink), its backward graph (.selectPos for relu, .selectMid for relu6) with _faithful, and a CertLayer bundling the two. The smooth stages (swish, projection) are in BatchedStages.

stageforwardCertLayer
conv → BN → relu6; depthwise → BN → relu6 (stride 1 / XLA-SAME stride 2)cbrB, dwbrB, dwbrBstridedcbrLayer, dwbrLayer, dwbrStridedLayer
1×1 projection → BNprojBprojLayer
conv → BN → relu; strided conv → BN → relucbReluB, cbReluStridedBcbReluLayer, cbReluStridedLayer
strided projection → BN (the downsample skip)projStridedBprojStridedLayer
@[reducible]
noncomputable def Proofs.StableHLO.cbrB (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ β : Vec oc) :
Vec (N * (ic * h * w)) → Vec (N * (oc * h * w))

Batched conv → bn → relu6 stage (MobileNetV2 expand), at the network layout N·(oc·h·w). Identical to EfficientNet's cbsB but with relu6 for swish.

Equations
Instances For
    @[reducible]
    noncomputable def Proofs.StableHLO.dwbrB (N : ℕ) {c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (γ β : Vec c) :
    Vec (N * (c * h * w)) → Vec (N * (c * h * w))

    Batched depthwise → bn → relu6 stage (MobileNetV2 depthwise), at the network layout. Identical to EfficientNet's dwbsB but with relu6 for swish.

    Equations
    Instances For
      @[reducible]
      noncomputable def Proofs.StableHLO.dwbrBstrided (N : ℕ) {c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (γ β : Vec c) :
      Vec (N * (c * (2 * h) * (2 * w))) → Vec (N * (c * h * w))

      Batched STRIDE-2 depthwise → bn → relu6 stage (MobileNetV2 downsample depthwise), at the network layout. The stride-2 analogue of dwbrB: maps the larger input spatial c·(2h)·(2w) to the output spatial c·h·w. Identical to EfficientNet's dwbsSB but with relu6 for swish.

      Equations
      Instances For
        noncomputable def Proofs.StableHLO.bnRelu6Stage_has_vjp_at (N : ℕ) {a oc h w : ℕ} (op : Vec a → Vec (oc * h * w)) (hop : Differentiable ℝ op) (hopv : HasVJP op) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * a)) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N op x) k ≠ 0 ∧ bnBatchLA N oc h w ε γ β (batchMap N op x) k ≠ 6) :
        HasVJPAt (relu6 (N * (oc * h * w)) ∘ bnBatchLA N oc h w ε γ β ∘ batchMap N op) x

        Generic relu6-on-batched-bn-stage _at VJP. The relu6 analogue of bnSwishStage_has_vjp, but _at (relu6 only has a pointwise VJP): compose the batched-op VJP, the true-BN VJP (both global, lifted via .toHasVJPAt), and relu6's pointwise VJP at the pre-relu6 activation.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Proofs.StableHLO.bnRelu6Stage_differentiableAt (N : ℕ) {a oc h w : ℕ} (op : Vec a → Vec (oc * h * w)) (hop : Differentiable ℝ op) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * a)) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N op x) k ≠ 0 ∧ bnBatchLA N oc h w ε γ β (batchMap N op x) k ≠ 6) :
          DifferentiableAt ℝ (relu6 (N * (oc * h * w)) ∘ bnBatchLA N oc h w ε γ β ∘ batchMap N op) x

          Differentiability of the generic relu6-on-batched-bn-stage at a smooth point.

          noncomputable def Proofs.StableHLO.cbrB_has_vjp_at (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * h * w))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 0 ∧ bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 6) :
          HasVJPAt (cbrB N W b ε γ β) x

          cbrB (conv-bn-relu6) _at VJP at a smooth point.

          Equations
          Instances For
            theorem Proofs.StableHLO.cbrB_differentiableAt (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * h * w))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 0 ∧ bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 6) :
            DifferentiableAt ℝ (cbrB N W b ε γ β) x
            noncomputable def Proofs.StableHLO.dwbrB_has_vjp_at (N : ℕ) {c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (hε : 0 < ε) (γ β : Vec c) (x : Vec (N * (c * h * w))) (h_smooth : ∀ (k : Fin (N * (c * h * w))), bnBatchLA N c h w ε γ β (batchMap N (depthwiseFlat W b) x) k ≠ 0 ∧ bnBatchLA N c h w ε γ β (batchMap N (depthwiseFlat W b) x) k ≠ 6) :
            HasVJPAt (dwbrB N W b ε γ β) x

            dwbrB (depthwise-bn-relu6) _at VJP at a smooth point.

            Equations
            Instances For
              theorem Proofs.StableHLO.dwbrB_differentiableAt (N : ℕ) {c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (hε : 0 < ε) (γ β : Vec c) (x : Vec (N * (c * h * w))) (h_smooth : ∀ (k : Fin (N * (c * h * w))), bnBatchLA N c h w ε γ β (batchMap N (depthwiseFlat W b) x) k ≠ 0 ∧ bnBatchLA N c h w ε γ β (batchMap N (depthwiseFlat W b) x) k ≠ 6) :
              DifferentiableAt ℝ (dwbrB N W b ε γ β) x
              noncomputable def Proofs.StableHLO.dwbrBstrided_has_vjp_at (N : ℕ) {c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (hε : 0 < ε) (γ β : Vec c) (x : Vec (N * (c * (2 * h) * (2 * w)))) (h_smooth : ∀ (k : Fin (N * (c * h * w))), bnBatchLA N c h w ε γ β (batchMap N (depthwiseStride2FlatXla W b) x) k ≠ 0 ∧ bnBatchLA N c h w ε γ β (batchMap N (depthwiseStride2FlatXla W b) x) k ≠ 6) :
              HasVJPAt (dwbrBstrided N W b ε γ β) x

              dwbrBstrided (STRIDE-2 depthwise-bn-relu6) _at VJP at a smooth point. The stride-2 analogue of dwbrB_has_vjp_at: lifts depthwiseStride2FlatXla_has_vjp (the strided per-channel conv input-VJP) through the generic relu6-bn stage.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem Proofs.StableHLO.dwbrBstrided_differentiableAt (N : ℕ) {c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (hε : 0 < ε) (γ β : Vec c) (x : Vec (N * (c * (2 * h) * (2 * w)))) (h_smooth : ∀ (k : Fin (N * (c * h * w))), bnBatchLA N c h w ε γ β (batchMap N (depthwiseStride2FlatXla W b) x) k ≠ 0 ∧ bnBatchLA N c h w ε γ β (batchMap N (depthwiseStride2FlatXla W b) x) k ≠ 6) :
                DifferentiableAt ℝ (dwbrBstrided N W b ε γ β) x
                noncomputable def Proofs.StableHLO.cbrBackBatchedGraph {N ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ β : Vec oc) (x : Vec (N * (ic * h * w))) (e : SHlo (N * (oc * h * w))) :
                SHlo (N * (ic * h * w))

                Batched conv → bn → relu6 stage backward graph (MobileNetV2 expand): convBackBatched ∘ bnBatchLABack ∘ selectMid, each at its cumulative forward activation. The relu6 analogue of cbsBackBatchedGraph — .selectMid (the relu6 two-sided-kink mask) replaces .swishBack.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem Proofs.StableHLO.cbrBackBatchedGraph_faithful {N ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * h * w))) (e : SHlo (N * (oc * h * w))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 0 ∧ bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 6) :
                  den (cbrBackBatchedGraph W b ε γ β x e) = (cbrB_has_vjp_at N W b ε hε γ β x h_smooth).backward (den e)
                  noncomputable def Proofs.StableHLO.dwbrBackBatchedGraph {N c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (γ β : Vec c) (x : Vec (N * (c * h * w))) (e : SHlo (N * (c * h * w))) :
                  SHlo (N * (c * h * w))

                  Batched depthwise → bn → relu6 stage backward graph (MobileNetV2 depthwise).

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem Proofs.StableHLO.dwbrBackBatchedGraph_faithful {N c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (hε : 0 < ε) (γ β : Vec c) (x : Vec (N * (c * h * w))) (e : SHlo (N * (c * h * w))) (h_smooth : ∀ (k : Fin (N * (c * h * w))), bnBatchLA N c h w ε γ β (batchMap N (depthwiseFlat W b) x) k ≠ 0 ∧ bnBatchLA N c h w ε γ β (batchMap N (depthwiseFlat W b) x) k ≠ 6) :
                    den (dwbrBackBatchedGraph W b ε γ β x e) = (dwbrB_has_vjp_at N W b ε hε γ β x h_smooth).backward (den e)
                    noncomputable def Proofs.StableHLO.dwbrBstridedBackBatchedGraph {N c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (γ β : Vec c) (x : Vec (N * (c * (2 * h) * (2 * w)))) (e : SHlo (N * (c * h * w))) :
                    SHlo (N * (c * (2 * h) * (2 * w)))

                    Batched STRIDE-2 depthwise → bn → relu6 stage backward graph (MobileNetV2 downsample depthwise). The stride-2 analogue of dwbrBackBatchedGraph: the bn/relu6 run at the OUTPUT spatial h×w, then depthwiseStridedBackBatched maps the bn-cotangent back to the larger input c·(2h)·(2w) (zero-upsample + reversed-kernel per-channel depthwise). The relu6 back is .selectMid as before.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Proofs.StableHLO.dwbrBstridedBackBatchedGraph_faithful {N c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (hε : 0 < ε) (γ β : Vec c) (x : Vec (N * (c * (2 * h) * (2 * w)))) (e : SHlo (N * (c * h * w))) (h_smooth : ∀ (k : Fin (N * (c * h * w))), bnBatchLA N c h w ε γ β (batchMap N (depthwiseStride2FlatXla W b) x) k ≠ 0 ∧ bnBatchLA N c h w ε γ β (batchMap N (depthwiseStride2FlatXla W b) x) k ≠ 6) :
                      den (dwbrBstridedBackBatchedGraph W b ε γ β x e) = (dwbrBstrided_has_vjp_at N W b ε hε γ β x h_smooth).backward (den e)
                      noncomputable def Proofs.StableHLO.cbrLayer (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) :
                      CertLayer (N * (ic * h * w)) (N * (oc * h * w))

                      The conv → bn → relu6 stage as a CertLayer, certified where its pre-relu6 activation misses both kinks. The kernel extent is a binder, so the same layer is a 1×1 or a 3×3.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        noncomputable def Proofs.StableHLO.dwbrLayer (N : ℕ) {c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (hε : 0 < ε) (γ β : Vec c) :
                        CertLayer (N * (c * h * w)) (N * (c * h * w))

                        The depthwise → bn → relu6 stage as a CertLayer.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          noncomputable def Proofs.StableHLO.dwbrStridedLayer (N : ℕ) {c h w kH kW : ℕ} (W : DepthwiseKernel c kH kW) (b : Vec c) (ε : ℝ) (hε : 0 < ε) (γ β : Vec c) :
                          CertLayer (N * (c * (2 * h) * (2 * w))) (N * (c * h * w))

                          The stride-2 depthwise → bn → relu6 stage as a CertLayer: 2h × 2w in, h × w out.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def Proofs.StableHLO.projLayer (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) :
                            CertLayer (N * (ic * h * w)) (N * (oc * h * w))

                            The conv → bn stage (projB, no activation) as a CertLayer. Globally certified (ok = True): with no activation there is no kink.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[reducible]
                              noncomputable def Proofs.StableHLO.cbReluB (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ β : Vec oc) :
                              Vec (N * (ic * h * w)) → Vec (N * (oc * h * w))

                              Batched conv → bn → relu stage (ResNet basic-block first stage), at the network layout N·(oc·h·w). The relu analogue of MobileNetV2's cbrB (relu for relu6).

                              Equations
                              Instances For
                                noncomputable def Proofs.StableHLO.bnReluStage_has_vjp_at (N : ℕ) {a oc h w : ℕ} (op : Vec a → Vec (oc * h * w)) (hop : Differentiable ℝ op) (hopv : HasVJP op) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * a)) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N op x) k ≠ 0) :
                                HasVJPAt (relu (N * (oc * h * w)) ∘ bnBatchLA N oc h w ε γ β ∘ batchMap N op) x

                                Generic relu-on-batched-bn-stage _at VJP. The relu analogue of bnRelu6Stage_has_vjp_at (and of bnSwishStage_has_vjp, but _at — relu only has a pointwise VJP): compose the batched-op VJP, the true-BN VJP (both global, lifted via .toHasVJPAt), and relu's pointwise VJP at the pre-relu activation. The smoothness hypothesis is the one-sided ≠ 0.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Proofs.StableHLO.bnReluStage_differentiableAt (N : ℕ) {a oc h w : ℕ} (op : Vec a → Vec (oc * h * w)) (hop : Differentiable ℝ op) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * a)) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N op x) k ≠ 0) :
                                  DifferentiableAt ℝ (relu (N * (oc * h * w)) ∘ bnBatchLA N oc h w ε γ β ∘ batchMap N op) x

                                  Differentiability of the generic relu-on-batched-bn-stage at a smooth point.

                                  noncomputable def Proofs.StableHLO.cbReluB_has_vjp_at (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * h * w))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 0) :
                                  HasVJPAt (cbReluB N W b ε γ β) x

                                  cbReluB (conv-bn-relu) _at VJP at a smooth point.

                                  Equations
                                  Instances For
                                    theorem Proofs.StableHLO.cbReluB_differentiableAt (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * h * w))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 0) :
                                    DifferentiableAt ℝ (cbReluB N W b ε γ β) x
                                    noncomputable def Proofs.StableHLO.cbReluBackBatchedGraph {N ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ β : Vec oc) (x : Vec (N * (ic * h * w))) (e : SHlo (N * (oc * h * w))) :
                                    SHlo (N * (ic * h * w))

                                    Batched conv → bn → relu stage backward graph (ResNet basic-block stage 1): convBackBatched ∘ bnBatchLABack ∘ selectPos, each at its cumulative forward activation. The relu analogue of MobileNetV2's cbrBackBatchedGraph — .selectPos (the relu one-sided-kink mask) replaces .selectMid.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem Proofs.StableHLO.cbReluBackBatchedGraph_faithful {N ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * h * w))) (e : SHlo (N * (oc * h * w))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConv W b) x) k ≠ 0) :
                                      den (cbReluBackBatchedGraph W b ε γ β x e) = (cbReluB_has_vjp_at N W b ε hε γ β x h_smooth).backward (den e)
                                      noncomputable def Proofs.StableHLO.cbReluLayer (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) :
                                      CertLayer (N * (ic * h * w)) (N * (oc * h * w))

                                      The conv → bn → relu stage as a CertLayer, certified where its pre-relu activation misses 0. The kernel extent is a binder, so the same layer is a 1×1 or a 3×3.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Proofs.StableHLO.cbReluLayer_fwd_apply (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (v : Vec (N * (ic * h * w))) :
                                        (cbReluLayer N W b ε hε γ β).fwd v = cbReluB N W b ε γ β v

                                        cbReluLayer's forward is cbReluB.

                                        @[reducible]
                                        noncomputable def Proofs.StableHLO.cbReluStridedB (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ β : Vec oc) :
                                        Vec (N * (ic * (2 * h) * (2 * w))) → Vec (N * (oc * h * w))

                                        Batched STRIDE-2 conv → bn → relu stage (downsample basic-block first stage), at the network layout N·(oc·h·w) ← N·(ic·(2h)·(2w)). The strided sibling of cbReluB (flatConvStride2 for flatConv); halves spatial.

                                        Equations
                                        Instances For
                                          noncomputable def Proofs.StableHLO.cbReluStridedB_has_vjp_at (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConvStride2 W b) x) k ≠ 0) :
                                          HasVJPAt (cbReluStridedB N W b ε γ β) x

                                          cbReluStridedB (strided conv-bn-relu) _at VJP at a smooth point. The strided sibling of cbReluB_has_vjp_at (flatConvStride2 for flatConv).

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem Proofs.StableHLO.cbReluStridedB_differentiableAt (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConvStride2 W b) x) k ≠ 0) :
                                            noncomputable def Proofs.StableHLO.cbReluStridedBackBatchedGraph {N ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ β : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (e : SHlo (N * (oc * h * w))) :
                                            SHlo (N * (ic * (2 * h) * (2 * w)))

                                            Batched strided conv → bn → relu stage backward graph: convStridedBackBatched ∘ bnBatchLABack ∘ selectPos, each at its cumulative forward activation. The strided sibling of cbReluBackBatchedGraph — convStridedBackBatched (the new stride-2 batched-conv VJP) replaces convBackBatched.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              theorem Proofs.StableHLO.cbReluStridedBackBatchedGraph_faithful {N ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (e : SHlo (N * (oc * h * w))) (h_smooth : ∀ (k : Fin (N * (oc * h * w))), bnBatchLA N oc h w ε γ β (batchMap N (flatConvStride2 W b) x) k ≠ 0) :
                                              den (cbReluStridedBackBatchedGraph W b ε γ β x e) = (cbReluStridedB_has_vjp_at N W b ε hε γ β x h_smooth).backward (den e)
                                              noncomputable def Proofs.StableHLO.cbReluStridedLayer (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) :
                                              CertLayer (N * (ic * (2 * h) * (2 * w))) (N * (oc * h * w))

                                              The strided conv → bn → relu stage as a CertLayer — cbReluLayer with flatConvStride2.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                @[reducible]
                                                noncomputable def Proofs.StableHLO.projStridedB (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ β : Vec oc) :
                                                Vec (N * (ic * (2 * h) * (2 * w))) → Vec (N * (oc * h * w))

                                                Batched strided conv → bn projection skip (downsample basic-block skip): bnBatchLA ∘ batchMap (flatConvStride2) — the 3×3 stride-2 projection that matches the body's downsampled oc·h·w output. The strided sibling of projB (flatConvStride2 for flatConv); no activation (linear bottleneck).

                                                Equations
                                                Instances For
                                                  theorem Proofs.StableHLO.projStridedB_differentiable (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) :
                                                  noncomputable def Proofs.StableHLO.projStridedB_has_vjp (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) :
                                                  HasVJP (projStridedB N W b ε γ β)
                                                  Equations
                                                  Instances For
                                                    noncomputable def Proofs.StableHLO.projStridedBackBatchedGraph {N ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ _β : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (e : SHlo (N * (oc * h * w))) :
                                                    SHlo (N * (ic * (2 * h) * (2 * w)))

                                                    Batched strided conv → bn projection-skip backward graph: convStridedBackBatched ∘ bnBatchLABack, at the skip's forward activation. The strided sibling of projBackBatchedGraph.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      theorem Proofs.StableHLO.projStridedBackBatchedGraph_faithful {N ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (e : SHlo (N * (oc * h * w))) :
                                                      den (projStridedBackBatchedGraph W b ε γ β x e) = (projStridedB_has_vjp N W b ε hε γ β).backward x (den e)
                                                      noncomputable def Proofs.StableHLO.projStridedLayer (N : ℕ) {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (hε : 0 < ε) (γ β : Vec oc) :
                                                      CertLayer (N * (ic * (2 * h) * (2 * w))) (N * (oc * h * w))

                                                      The strided conv → bn projection skip as a CertLayer — projLayer with flatConvStride2, globally certified.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For