Documentation

LeanMlir.Proofs.Nets.MobileNet.MobileNetV4StepTieB

The train-step tie for MobileNetV4-Conv-M — every gradient node at its chain cotangent #

Every parameter gradient node MNv4's batched train step emits denotes the certified gradient for an arbitrary cotangent, by a leaf lemma it shares with ResNet-34 or EfficientNet-B0 (the table below). This file removes that freedom: each node is stated at the cotangent the render's own backward chain delivers, driven by a loss cotangent g at the logits.

No accuracy is quoted for this net. The statements are about timm's mobilenetv4_conv_medium; the gates that pin the artifacts to it are scripts/parity/mnv4_timm_parity.py, scripts/parity/mnv4_forward_tie.py and scripts/parity/grad_tie.py --net mnv4.

The UIB bottleneck is linear, and that makes MNv4's chain shorter than ResNet's #

uibFwdSkipB emits addVB (project-BN out) (block input) with no activation after the add and none after the project's BatchNorm. So the block-output cotangent dyOut reaches the project BN's γ and β directly — where ResNet-50's r50IdCotA must first pass through the post-residual relu's mask, and where its skip branch carries the masked cotangent. Here the skip fan-in is addVB (body dx) dyOut, unmasked.

And every block's *CotIn_eq_vjp is its block layer's .faithful, not a new derivation. The UIB bodies, the fused stage and the head are CertLayers, so den (graph x e) = vjp.backward (den e) is already a theorem one tier down — the fact the r34, mnv2 and R50 ties re-derive per block. mnv4BodyCotIn_eq_vjp, mnv4SBodyCotIn_eq_vjp, mnv4SkipCotIn_eq_vjp, mnv4FusedCotIn_eq_vjp and mnv4HeadCotIn_eq_vjp state it for each constructed cotangent the capstone threads: each is the layer's .faithful plus a definitional match. The stem has none: no render emits a gradient into %x.

No new fp32 op-kind lemmas — MNv4's nine kinds are ResNet-34's and EfficientNet-B0's #

op kindsitescertificate
bnGammaGradB / bnBetaGradB77 BN layersGradNodeB.bnGammaGradB_den / bnBetaGradB_den
convWeightGradBexpands, projects, both head convs, the fused projectGradNodeB.convWGradB_den
convStridedWeightGradB (SYMMETRIC)the stem's and the fused stage's 3×3/s2GradNodeB.convStridedWGradB_den
depthwiseWeightGradBevery stride-1 depthwiseGradNodeB.depthwiseWGradB_den
depthwiseStridedWeightGradBrows 1, 3, 11's post-DW (timm's dw_mid)GradNodeB.depthwiseStridedWGradB_den
denseWeightGradB / denseBiasGradBthe classifierGradNodeB.denseWGradB_den / denseBGradB_den

Every strided site pads symmetrically (timm), so the stem and the fused stage share one certificate.

MNv4 emits no conv bias gradient at all. MobileNetV4RenderB has no convBias flag — every bias is folded into its BatchNorm and bound to %zb{c} — so convBiasGradB and its strided peers are never emitted and there is nothing to state. Same situation as ResNet-50.

Precision is a flag on the statement. The bf16 ImageNet artifacts (mnv4in_emaacc{,dp}8x128wxdowd005bf16, mnv4in_acc{,dp}8x128wxdropdowd01bf16) emit the bf16 conv and depthwise weight-gradient kinds (convWeightGradBBf16, depthwiseWeightGradBBf16, …; Foundation.Bf16GradNodes). Every conv and depthwise weight node below is stated on the renderers' switch — ConvWTiedBAt bf16 / ConvStridedWTiedBAt bf16 / DepthwiseWTiedBAt bf16 / DepthwiseStridedWTiedBAt bf16 (Foundation.GradNodesBAt): bf16 := false is the f32 node, bf16 := true the bf16 one — and the capstone mnv4_net_tiedB takes bf16, so it reaches the bf16 artifacts' gradient nodes read over ℝ exactly as it reads the f32 ones (Bf16Erasure: at the identity rounding the bf16 kind denotes what its f32 peer does). BatchNorm's and the classifier's nodes carry no flag because no render switches them.

Everything here is generic in the row #

Every definition and theorem below takes a UibSpec binder s and reads its widths off it, so s.ic, s.h and s.ic * s.expand are variables. That is not a convenience: MNv4's resolutions are literals, and letting den and width-indexed rfls run at 224/112/56/28/14/7 ends in kernel timeouts (MobileNetV4FullB.lean). Stated at a row binder they stay stuck; the capstone then instantiates at the 21 concrete rows.

The chain, node for node from uibBackSkipGradB #

cotangentatfeeds
dyOutthe block output — and the project BN's output, the add being linear%u{p}pg, %u{p}pbt
CotPcproject conv's output (bnBatchBack)%u{p}pW
CotDnpost-DW BN's output (convBackBatched, then the post-DW relu's selectPos mask)%u{p}dg, %u{p}dbt
CotDcpost-DW conv's output%u{p}dW
CotEnexpand BN's output (depthwiseBackBatched, then the expand relu's mask)%u{p}eg, %u{p}ebt
CotEcexpand conv's output%u{p}eW
CotQnpre-DW BN's output (convBackBatched; no mask — the pre-DW is BN only)%u{p}qg, %u{p}qbt
CotQcpre-DW conv's output%u{p}qW
CotInthe block input — addVB (depthwiseBackBatched dQc) dyOutthe previous block

A cotangent one step off is a silently wrong gradient, not a type error: %u{p}eg reads the cotangent at the expand BN's OUTPUT and %u{p}eW the one at the expand CONV's output, and both have the same type.

Data parallel. In mnv4in_adamdp64* every node named here feeds allReduceMeanF and BatchNorm is synchronised across replicas, so a replica's gradient node is not this file's node at its own N. This file describes a data-parallel artifact only at N := R·N: the per-replica statement is MobileNetV4SyncTieB.mnv4_net_syncTiedB, whose right-hand side is mnv4_net_tiedB's node at the global batch.

noncomputable def Proofs.Mnv4TieB.mnv4CotPc (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
Vec (N * (s.oc * s.h * s.h))

Cotangent at the project CONV's output — dyOut through the project BN's backward. dyOut itself is the cotangent at the project BN's output: the bottleneck is linear, so nothing masks it. Feeds %u{p}pW.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    noncomputable def Proofs.Mnv4TieB.mnv4CotDn (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
    Vec (N * (s.ic * s.expand * s.h * s.h))

    Cotangent at the post-DW BN's output — the project conv's input-VJP, masked by the post-DW relu. Feeds %u{p}dg and %u{p}dbt.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def Proofs.Mnv4TieB.mnv4CotDc (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
      Vec (N * (s.ic * s.expand * s.h * s.h))

      Cotangent at the post-DW CONV's output — through the post-DW BN's backward. Feeds %u{p}dW.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def Proofs.Mnv4TieB.mnv4CotEn (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
        Vec (N * (s.ic * s.expand * s.h * s.h))

        Cotangent at the expand BN's output — masked by the expand relu. Feeds %u{p}eg/%u{p}ebt.

        This is where the chain dispatches on the table, exactly as mnv4PostDWSlot does and off the same row: with a post-depthwise the incoming cotangent is that depthwise's input-VJP; without one (postDWk = 0, the ConvNeXt-like and FFN rows) the project conv's input-VJP arrives here directly, because the render emits no post-DW nodes at all. One chain, three stride-1 profiles, and the if reduces at every concrete row.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def Proofs.Mnv4TieB.mnv4CotEc (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
          Vec (N * (s.ic * s.expand * s.h * s.h))

          Cotangent at the expand CONV's output — through the expand BN's backward. Feeds %u{p}eW.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def Proofs.Mnv4TieB.mnv4CotQn (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
            Vec (N * (s.ic * s.h * s.h))

            Cotangent at the pre-DW BN's output — the expand conv's input-VJP, UNMASKED: the pre-DW is BN only (timm's dw_start). Feeds %u{p}qg and %u{p}qbt.

            Equations
            Instances For
              noncomputable def Proofs.Mnv4TieB.mnv4CotQc (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
              Vec (N * (s.ic * s.h * s.h))

              Cotangent at the pre-DW CONV's output — through the pre-DW BN's backward. Feeds %u{p}qW.

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

                A near-copy of the stride-1 chain, and it has to be. The post-DW carries the stride (timm's dw_mid), so the block input, the BN-only pre-DW and the expand sit at 2h and the post-DW and the project at h — a change that runs through every type in the chain.

                And there is no skip: all three stride-2 rows change channels (ic ≠ oc), so the block IS the body and there is no addVB fan-in.

                noncomputable def Proofs.Mnv4TieB.mnv4SCotPc (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                Vec (N * (s.oc * s.h * s.h))

                Cotangent at the project CONV's output. dyOut itself is the cotangent at the project BN's output: the bottleneck is linear. Feeds %u{p}pW.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  noncomputable def Proofs.Mnv4TieB.mnv4SCotDn (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                  Vec (N * (s.ic * s.expand * s.h * s.h))

                  Cotangent at the STRIDED post-DW BN's output — the project conv's input-VJP, masked by the post-DW relu. Feeds %u{p}dg and %u{p}dbt.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def Proofs.Mnv4TieB.mnv4SCotDc (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                    Vec (N * (s.ic * s.expand * s.h * s.h))

                    Cotangent at the STRIDED post-DW CONV's output — through its BN's backward. Feeds %u{p}dW.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      noncomputable def Proofs.Mnv4TieB.mnv4SCotEn (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                      Vec (N * (s.ic * s.expand * (2 * s.h) * (2 * s.h)))

                      Cotangent at the expand BN's output, at 2h — the strided post-DW's input-VJP, masked by the expand relu. Feeds %u{p}eg/%u{p}ebt.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        noncomputable def Proofs.Mnv4TieB.mnv4SCotEc (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                        Vec (N * (s.ic * s.expand * (2 * s.h) * (2 * s.h)))

                        Cotangent at the expand CONV's output, at 2h. Feeds %u{p}eW.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          noncomputable def Proofs.Mnv4TieB.mnv4SCotQn (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                          Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))

                          Cotangent at the pre-DW BN's output, at 2h — the expand conv's input-VJP, unmasked (the pre-DW is BN only). Feeds %u{p}qg and %u{p}qbt.

                          Equations
                          Instances For
                            noncomputable def Proofs.Mnv4TieB.mnv4SCotQc (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                            Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))

                            Cotangent at the pre-DW CONV's output, at 2h. Feeds %u{p}qW.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              noncomputable def Proofs.Mnv4TieB.mnv4SBodyCotIn (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                              Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))

                              The strided block's input cotangent, at 2h: the pre-DW's input-VJP when there is one, the expand conv's otherwise. No fan-in: ic ≠ oc, so the block has no skip.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                noncomputable def Proofs.Mnv4TieB.mnv4BodyCotIn (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                                Vec (N * (s.ic * s.h * s.h))

                                The BODY's input cotangent — what the render's dx carries before the skip fan-in.

                                Dispatches on s.preDWk the way mnv4PreDWSlot does: with a pre-depthwise the body's dx is that depthwise's input-VJP, without one it is the expand conv's.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  noncomputable def Proofs.Mnv4TieB.mnv4SkipCotIn {N n : ℕ} (bodyDx dyOut : Vec (N * n)) :
                                  Vec (N * n)

                                  The skip fan-in itself: body dx + dyOut, at the block-input shape.

                                  Split from mnv4BodyCotIn for the same reason mnv4SkipGraphB is split from the body graph builders: the add needs s.oc and s.ic to be the SAME type, which they are at every stride-1 row and are not at a row binder. The body's cotangent is row-generic; the add is applied at the concrete row, where s.oc = s.ic is rfl.

                                  Equations
                                  Instances For
                                    def Proofs.Mnv4TieB.mnv4ExtraDWTiedB (N : ℕ) (s : StableHLO.UibSpec) (xN cotN vN epsStr : String) (p : StableHLO.UibParams s) (bf16 : Bool) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :

                                    ExtraDW block, tied. All twelve parameter nodes — four conv/depthwise weights and four BatchNorm γ/β pairs — denote the certified batched Σ_n gradient at the real forward activations and the real backward-chain cotangent driven by dyOut.

                                    Each BatchNorm's γ/β reads the cotangent at THAT BatchNorm's output (CotQn, CotEn, CotDn, and dyOut itself for the project) while its conv reads the one at the conv's output (CotQc, CotEc, CotDc, CotPc). Off by one and the gradient is silently wrong — the two have the same type. The project BN's pair reads dyOut unmasked: the bottleneck is linear.

                                    There are no conv-bias conjuncts: MobileNetV4RenderB has no convBias flag, so those ops are never emitted and every slot here is exercised by the artifact.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem Proofs.Mnv4TieB.mnv4_extradw_tiedB (N : ℕ) (s : StableHLO.UibSpec) (xN cotN vN epsStr : String) (p : StableHLO.UibParams s) (bf16 : Bool) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                                      mnv4ExtraDWTiedB N s xN cotN vN epsStr p bf16 xin dyOut

                                      And it holds — twelve instantiations of the shared ∀ cot leaf folds with the freedom removed: the cotangents are the chain's, not free.

                                      def Proofs.Mnv4TieB.mnv4ConvNeXtTiedB (N : ℕ) (s : StableHLO.UibSpec) (xN cotN vN epsStr : String) (p : StableHLO.UibParams s) (bf16 : Bool) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Proofs.Mnv4TieB.mnv4_convnext_tiedB (N : ℕ) (s : StableHLO.UibSpec) (xN cotN vN epsStr : String) (p : StableHLO.UibParams s) (bf16 : Bool) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                                        mnv4ConvNeXtTiedB N s xN cotN vN epsStr p bf16 xin dyOut

                                        And it holds — nine instantiations of the shared ∀ cot leaf folds at the chain's cotangents.

                                        def Proofs.Mnv4TieB.mnv4FfnTiedB (N : ℕ) (s : StableHLO.UibSpec) (xN cotN vN epsStr : String) (p : StableHLO.UibParams s) (bf16 : Bool) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          theorem Proofs.Mnv4TieB.mnv4_ffn_tiedB (N : ℕ) (s : StableHLO.UibSpec) (xN cotN vN epsStr : String) (p : StableHLO.UibParams s) (bf16 : Bool) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                                          mnv4FfnTiedB N s xN cotN vN epsStr p bf16 xin dyOut

                                          And it holds — six instantiations of the shared ∀ cot leaf folds at the chain's cotangents.

                                          def Proofs.Mnv4TieB.mnv4StridedTiedB (N : ℕ) (s : StableHLO.UibSpec) (xN cotN vN epsStr : String) (p : StableHLO.UibParams s) (bf16 : Bool) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :

                                          Strided block, tied — rows 1, 3 and 11. All twelve parameter nodes denote the certified batched Σ_n gradient at the real forward activations and the backward-chain cotangent driven by dyOut.

                                          The strided node is the post-DW's depthwiseStridedWeightGradB (timm's dw_mid, symmetric), reading its input at 2h; the pre-DW and the expand nodes read theirs at 2h, the project's at h.

                                          No skip and no addVB: ic ≠ oc at all three rows, so the block IS its body.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem Proofs.Mnv4TieB.mnv4_strided_tiedB (N : ℕ) (s : StableHLO.UibSpec) (xN cotN vN epsStr : String) (p : StableHLO.UibParams s) (bf16 : Bool) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) :
                                            mnv4StridedTiedB N s xN cotN vN epsStr p bf16 xin dyOut

                                            And it holds — twelve instantiations (one at the strided post-DW) of the shared ∀ cot leaf folds with the freedom removed.

                                            All three are generic in their widths, for the reason MobileNetV4FullB.lean's stem-graph docstring records: pinning MNv4's literal resolutions here lets den and the width-indexed rfls actually run, and the kernel gives up. The capstone instantiates.

                                            noncomputable def Proofs.Mnv4TieB.mnv4StemCotN (N h w : ℕ) {ic oc kH kW : ℕ} (Ws : Kernel4 oc ic kH kW) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (dyStem : Vec (N * (oc * h * w))) :
                                            Vec (N * (oc * h * w))

                                            Cotangent at the stem BN's output — the fused stage's dx, masked by the stem relu. Feeds %sg and %sbt.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              noncomputable def Proofs.Mnv4TieB.mnv4StemCotC (N h w : ℕ) {ic oc kH kW : ℕ} (Ws : Kernel4 oc ic kH kW) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (dyStem : Vec (N * (oc * h * w))) :
                                              Vec (N * (oc * h * w))

                                              Cotangent at the stem CONV's output — through the stem BN's backward. Feeds %sW.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def Proofs.Mnv4TieB.mnv4StemTiedB (N h w : ℕ) {ic oc kH kW : ℕ} (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic kH kW) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (bf16 : Bool) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (dyStem : Vec (N * (oc * h * w))) :

                                                Stem, tied. Its three nodes at the chain's cotangents.

                                                And the chain stops here. No render emits a gradient into %x, so the artifact's backward ends at this weight gradient. That is why the stem sits outside MobileNetV4FullB.lean's CertLayer trunk, and it is B0's situation exactly.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  theorem Proofs.Mnv4TieB.mnv4_stem_tiedB (N h w : ℕ) {ic oc kH kW : ℕ} (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic kH kW) (bs : Vec oc) (εs : ℝ) (γs βs : Vec oc) (bf16 : Bool) (x : Vec (N * (ic * (2 * h) * (2 * w)))) (dyStem : Vec (N * (oc * h * w))) :
                                                  mnv4StemTiedB N h w xN cotN vN epsStr Ws bs εs γs βs bf16 x dyStem
                                                  noncomputable def Proofs.Mnv4TieB.mnv4FusedCotPc (N h w : ℕ) {ic mid oc kH kW : ℕ} (Wc : Kernel4 mid ic kH kW) (bc : Vec mid) (εc : ℝ) (γc βc : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp : Vec oc) (εp : ℝ) (γp _βp : Vec oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyF : Vec (N * (oc * h * w))) :
                                                  Vec (N * (oc * h * w))

                                                  Cotangent at the fused stage's project CONV output. dyF reaches the project BN's γ/β unmasked — the fused stage ends in a BatchNorm with no activation. Feeds %f0pW.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    noncomputable def Proofs.Mnv4TieB.mnv4FusedCotN (N h w : ℕ) {ic mid oc kH kW : ℕ} (Wc : Kernel4 mid ic kH kW) (bc : Vec mid) (εc : ℝ) (γc βc : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp : Vec oc) (εp : ℝ) (γp βp : Vec oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyF : Vec (N * (oc * h * w))) :
                                                    Vec (N * (mid * h * w))

                                                    Cotangent at the fused BN's output — the project conv's input-VJP, masked by the fused relu. Feeds %f0cg and %f0cbt.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      noncomputable def Proofs.Mnv4TieB.mnv4FusedCotC (N h w : ℕ) {ic mid oc kH kW : ℕ} (Wc : Kernel4 mid ic kH kW) (bc : Vec mid) (εc : ℝ) (γc βc : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp : Vec oc) (εp : ℝ) (γp βp : Vec oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyF : Vec (N * (oc * h * w))) :
                                                      Vec (N * (mid * h * w))

                                                      Cotangent at the fused CONV's output — through the fused BN's backward. Feeds %f0cW.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        noncomputable def Proofs.Mnv4TieB.mnv4FusedCotIn (N h w : ℕ) {ic mid oc kH kW : ℕ} (Wc : Kernel4 mid ic kH kW) (bc : Vec mid) (εc : ℝ) (γc βc : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp : Vec oc) (εp : ℝ) (γp βp : Vec oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyF : Vec (N * (oc * h * w))) :
                                                        Vec (N * (ic * (2 * h) * (2 * w)))

                                                        The fused stage's input cotangent — the SYMMETRIC strided conv's input-VJP, landing at 2h.

                                                        Equations
                                                        Instances For
                                                          def Proofs.Mnv4TieB.mnv4FusedTiedB (N h w : ℕ) {ic mid oc kH kW : ℕ} (Wc : Kernel4 mid ic kH kW) (bc : Vec mid) (εc : ℝ) (γc βc : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp : Vec oc) (εp : ℝ) (γp βp : Vec oc) (xN cotN vN epsStr : String) (bf16 : Bool) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyF : Vec (N * (oc * h * w))) :

                                                          Fused stage, tied — its six parameter nodes. %f0cW is convStridedWeightGradB, symmetric padding, like the stem's.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            theorem Proofs.Mnv4TieB.mnv4_fused_tiedB (N h w : ℕ) {ic mid oc kH kW : ℕ} (Wc : Kernel4 mid ic kH kW) (bc : Vec mid) (εc : ℝ) (γc βc : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp : Vec oc) (εp : ℝ) (γp βp : Vec oc) (xN cotN vN epsStr : String) (bf16 : Bool) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyF : Vec (N * (oc * h * w))) :
                                                            mnv4FusedTiedB N h w Wc bc εc γc βc Wp bp εp γp βp xN cotN vN epsStr bf16 xin dyF

                                                            The head, timm's order: cn_960 conv-bn-relu at h×w, GAP, conv_head conv-bn-relu on the pooled [N, mid, 1, 1], dense. The two 1×1 relabellings (mnv4_pool11) are no-ops in the render and Fin.cast reads here.

                                                            noncomputable def Proofs.Mnv4TieB.mnv4To11 {N c : ℕ} (v : Vec (N * c)) :
                                                            Vec (N * (c * 1 * 1))

                                                            The pooled [N, c] read at [N, c, 1, 1] and back — castLayer's forward and backward.

                                                            Equations
                                                            Instances For
                                                              noncomputable def Proofs.Mnv4TieB.mnv4From11 {N c : ℕ} (v : Vec (N * (c * 1 * 1))) :
                                                              Vec (N * c)
                                                              Equations
                                                              Instances For
                                                                noncomputable def Proofs.Mnv4TieB.mnv4HeadPool (N h w : ℕ) {c mid : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (xin : Vec (N * (c * h * w))) :
                                                                Vec (N * (mid * 1 * 1))

                                                                The pooled head features at [N, mid, 1, 1]: GAP of the first head stage, relabelled.

                                                                Equations
                                                                Instances For
                                                                  noncomputable def Proofs.Mnv4TieB.mnv4HeadFeat (N h w : ℕ) {c mid oc : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (γ2 β2 : Vec oc) (xin : Vec (N * (c * h * w))) :
                                                                  Vec (N * oc)

                                                                  The dense input: conv_head-bn-relu of the pooled features, relabelled to [N, oc].

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    noncomputable def Proofs.Mnv4TieB.mnv4HeadCotHn (N h w : ℕ) {c mid oc nCls : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (γ2 β2 : Vec oc) (Wd : Mat oc nCls) (_bd : Vec nCls) (xin : Vec (N * (c * h * w))) (g : Vec (N * nCls)) :
                                                                    Vec (N * (oc * 1 * 1))

                                                                    Cotangent at conv_head's BN output ([N, oc, 1, 1]) — the dense input-VJP (rowDenseBackFlat, the den of the render's denseRowBack), relabelled, masked by that stage's relu. Feeds %hg and %hbt.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      noncomputable def Proofs.Mnv4TieB.mnv4HeadCotHc (N h w : ℕ) {c mid oc nCls : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (γ2 β2 : Vec oc) (Wd : Mat oc nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (g : Vec (N * nCls)) :
                                                                      Vec (N * (oc * 1 * 1))

                                                                      Cotangent at conv_head's CONV output. Feeds %hW.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For
                                                                        noncomputable def Proofs.Mnv4TieB.mnv4HeadCotH1n (N h w : ℕ) {c mid oc nCls : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (γ2 β2 : Vec oc) (Wd : Mat oc nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (g : Vec (N * nCls)) :
                                                                        Vec (N * (mid * h * w))

                                                                        Cotangent at the FIRST head BN's output — conv_head's input-VJP, relabelled, spread by the GAP backward, masked by the first relu. Feeds %h1g and %h1bt.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          noncomputable def Proofs.Mnv4TieB.mnv4HeadCotH1c (N h w : ℕ) {c mid oc nCls : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (γ2 β2 : Vec oc) (Wd : Mat oc nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (g : Vec (N * nCls)) :
                                                                          Vec (N * (mid * h * w))

                                                                          Cotangent at the first head CONV's output. Feeds %h1W.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            noncomputable def Proofs.Mnv4TieB.mnv4HeadCotIn (N h w : ℕ) {c mid oc nCls : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (γ2 β2 : Vec oc) (Wd : Mat oc nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (g : Vec (N * nCls)) :
                                                                            Vec (N * (c * h * w))

                                                                            The head's input cotangent — what block 21 receives as its dyOut.

                                                                            Equations
                                                                            Instances For
                                                                              def Proofs.Mnv4TieB.mnv4HeadTiedB (N h w : ℕ) {c mid oc nCls : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (γ2 β2 : Vec oc) (Wd : Mat oc nCls) (bd : Vec nCls) (xN cotN vN epsStr : String) (bf16 : Bool) (xin : Vec (N * (c * h * w))) (g : Vec (N * nCls)) :

                                                                              Head, tied — all EIGHT nodes: two conv weights, two BatchNorm γ/β pairs, and the classifier's weight and bias. conv_head's nodes (%hW, %hg, %hbt) read the POOLED features at h = w = 1; the classifier reads conv_head's relu output.

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                theorem Proofs.Mnv4TieB.mnv4_head_tiedB (N h w : ℕ) {c mid oc nCls : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (γ2 β2 : Vec oc) (Wd : Mat oc nCls) (bd : Vec nCls) (xN cotN vN epsStr : String) (bf16 : Bool) (xin : Vec (N * (c * h * w))) (g : Vec (N * nCls)) :
                                                                                mnv4HeadTiedB N h w W1 b1 ε1 γ1 β1 W2 b2 ε2 γ2 β2 Wd bd xN cotN vN epsStr bf16 xin g

                                                                                The capstone below threads dy21 … dyStem through mnv4HeadCotIn, mnv4BodyCotIn + mnv4SkipCotIn, mnv4SBodyCotIn and mnv4FusedCotIn. Each is stated here to be the backward of the certified CertLayer VJP it stands for, at a block input where that layer is certified (its .ok). Every proof is the layer's .faithful at e := .operand "" dyOut, then a definitional match with the constructed chain.

                                                                                theorem Proofs.Mnv4TieB.mnv4BodyCotIn_eq_vjp (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * s.h * s.h))) (dyOut : Vec (N * (s.oc * s.h * s.h))) (hok : (StableHLO.mnv4BodyOfRow N s p).ok xin) :
                                                                                mnv4BodyCotIn N s p xin dyOut = ((StableHLO.mnv4BodyOfRow N s p).vjp xin hok).backward dyOut

                                                                                A stride-1 UIB body's input cotangent is its certified VJP's backward. The chain the render emits (mnv4BodyCotIn, through mnv4CotQc … mnv4CotPc) is (mnv4BodyOfRow N s p).vjp's backward at the block input, for every row: the four preDWk/postDWk cases (ExtraDW, ConvNeXt-like, FFN, and the IB shape no Conv-M row uses) each reduce to the body layer's .faithful.

                                                                                theorem Proofs.Mnv4TieB.mnv4SBodyCotIn_eq_vjp (N : ℕ) (s : StableHLO.UibSpec) (p : StableHLO.UibParams s) (xin : Vec (N * (s.ic * (2 * s.h) * (2 * s.h)))) (dyOut : Vec (N * (s.oc * s.h * s.h))) (hok : (StableHLO.mnv4StridedBodyOfRow N s p).ok xin) :
                                                                                mnv4SBodyCotIn N s p xin dyOut = ((StableHLO.mnv4StridedBodyOfRow N s p).vjp xin hok).backward dyOut

                                                                                A strided UIB body's input cotangent is its certified VJP's backward — rows 1, 3, 11, at 2h.

                                                                                theorem Proofs.Mnv4TieB.mnv4SkipCotIn_eq_vjp {N n : ℕ} (L : StableHLO.CertLayer (N * n) (N * n)) (x : Vec (N * n)) (hok : L.ok x) (dyOut : Vec (N * n)) :
                                                                                mnv4SkipCotIn ((L.vjp x hok).backward dyOut) dyOut = (L.residual.vjp x hok).backward dyOut

                                                                                The skip fan-in is the residual layer's backward: body dx + dyOut, with body dx the body's certified backward, is CertLayer.residual's. Generic in the body, so at a stride-1 row it composes with mnv4BodyCotIn_eq_vjp (the add needs s.oc = s.ic, which is rfl at every concrete row and not at a row binder).

                                                                                theorem Proofs.Mnv4TieB.mnv4FusedCotIn_eq_vjp (N h w : ℕ) {ic mid oc kH kW : ℕ} (Wc : Kernel4 mid ic kH kW) (bc : Vec mid) (εc : ℝ) (hεc : 0 < εc) (γc βc : Vec mid) (Wp : Kernel4 oc mid 1 1) (bp : Vec oc) (εp : ℝ) (hεp : 0 < εp) (γp βp : Vec oc) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dyF : Vec (N * (oc * h * w))) (hok : (StableHLO.mnv4FusedStage N (StableHLO.cbReluStridedLayer N Wc bc εc hεc γc βc) (StableHLO.projLayer N Wp bp εp hεp γp βp)).ok xin) :
                                                                                mnv4FusedCotIn N h w Wc bc εc γc βc Wp bp εp γp βp xin dyF = ((StableHLO.mnv4FusedStage N (StableHLO.cbReluStridedLayer N Wc bc εc hεc γc βc) (StableHLO.projLayer N Wp bp εp hεp γp βp)).vjp xin hok).backward dyF

                                                                                The fused stage's input cotangent is its certified VJP's backward.

                                                                                theorem Proofs.Mnv4TieB.mnv4HeadCotIn_eq_vjp (N h w : ℕ) {c mid oc nCls : ℕ} (W1 : Kernel4 mid c 1 1) (b1 : Vec mid) (ε1 : ℝ) (hε1 : 0 < ε1) (γ1 β1 : Vec mid) (W2 : Kernel4 oc mid 1 1) (b2 : Vec oc) (ε2 : ℝ) (hε2 : 0 < ε2) (γ2 β2 : Vec oc) (Wd : Mat oc nCls) (bd : Vec nCls) (xin : Vec (N * (c * h * w))) (g : Vec (N * nCls)) (hok : (StableHLO.mnv4Head N (StableHLO.cbReluLayer N W1 b1 ε1 hε1 γ1 β1) (StableHLO.gapLayer N) (StableHLO.cbReluLayer N W2 b2 ε2 hε2 γ2 β2) (StableHLO.denseLayer N Wd bd)).ok xin) :
                                                                                mnv4HeadCotIn N h w W1 b1 ε1 γ1 β1 W2 b2 ε2 γ2 β2 Wd bd xin g = ((StableHLO.mnv4Head N (StableHLO.cbReluLayer N W1 b1 ε1 hε1 γ1 β1) (StableHLO.gapLayer N) (StableHLO.cbReluLayer N W2 b2 ε2 hε2 γ2 β2) (StableHLO.denseLayer N Wd bd)).vjp xin hok).backward g

                                                                                The head's input cotangent — block 21's dyOut — is its certified VJP's backward, at any loss cotangent g.

                                                                                noncomputable def Proofs.Mnv4TieB.mnv4Blk0 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                Vec (N * (48 * 56 * 56))

                                                                                The per-BLOCK forward prefixes: mnv4Blk0 is the fused stage's output — block 1's input — and mnv4Blk{k} is the activation entering block k+1.

                                                                                MobileNetV4FullB.lean's mnv4Pre0 … mnv4Pre6 are the resolution-group prefixes, which is the granularity the whole-net forward, graph and VJP need; the tie needs one per BLOCK, so these 22 name the finer chain. mnv4Blk0 is definitionally mnv4Pre1.

                                                                                Equations
                                                                                Instances For
                                                                                  noncomputable def Proofs.Mnv4TieB.mnv4Blk1 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                  Vec (N * (80 * 28 * 28))
                                                                                  Equations
                                                                                  Instances For
                                                                                    noncomputable def Proofs.Mnv4TieB.mnv4Blk2 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                    Vec (N * (80 * 28 * 28))
                                                                                    Equations
                                                                                    Instances For
                                                                                      noncomputable def Proofs.Mnv4TieB.mnv4Blk3 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                      Vec (N * (160 * 14 * 14))
                                                                                      Equations
                                                                                      Instances For
                                                                                        noncomputable def Proofs.Mnv4TieB.mnv4Blk4 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                        Vec (N * (160 * 14 * 14))
                                                                                        Equations
                                                                                        Instances For
                                                                                          noncomputable def Proofs.Mnv4TieB.mnv4Blk5 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                          Vec (N * (160 * 14 * 14))
                                                                                          Equations
                                                                                          Instances For
                                                                                            noncomputable def Proofs.Mnv4TieB.mnv4Blk6 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                            Vec (N * (160 * 14 * 14))
                                                                                            Equations
                                                                                            Instances For
                                                                                              noncomputable def Proofs.Mnv4TieB.mnv4Blk7 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                              Vec (N * (160 * 14 * 14))
                                                                                              Equations
                                                                                              Instances For
                                                                                                noncomputable def Proofs.Mnv4TieB.mnv4Blk8 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                Vec (N * (160 * 14 * 14))
                                                                                                Equations
                                                                                                Instances For
                                                                                                  noncomputable def Proofs.Mnv4TieB.mnv4Blk9 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                  Vec (N * (160 * 14 * 14))
                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    noncomputable def Proofs.Mnv4TieB.mnv4Blk10 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                    Vec (N * (160 * 14 * 14))
                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      noncomputable def Proofs.Mnv4TieB.mnv4Blk11 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                      Vec (N * (256 * 7 * 7))
                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        noncomputable def Proofs.Mnv4TieB.mnv4Blk12 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                        Vec (N * (256 * 7 * 7))
                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          noncomputable def Proofs.Mnv4TieB.mnv4Blk13 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                          Vec (N * (256 * 7 * 7))
                                                                                                          Equations
                                                                                                          Instances For
                                                                                                            noncomputable def Proofs.Mnv4TieB.mnv4Blk14 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                            Vec (N * (256 * 7 * 7))
                                                                                                            Equations
                                                                                                            Instances For
                                                                                                              noncomputable def Proofs.Mnv4TieB.mnv4Blk15 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                              Vec (N * (256 * 7 * 7))
                                                                                                              Equations
                                                                                                              Instances For
                                                                                                                noncomputable def Proofs.Mnv4TieB.mnv4Blk16 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                                Vec (N * (256 * 7 * 7))
                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  noncomputable def Proofs.Mnv4TieB.mnv4Blk17 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                                  Vec (N * (256 * 7 * 7))
                                                                                                                  Equations
                                                                                                                  Instances For
                                                                                                                    noncomputable def Proofs.Mnv4TieB.mnv4Blk18 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                                    Vec (N * (256 * 7 * 7))
                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      noncomputable def Proofs.Mnv4TieB.mnv4Blk19 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                                      Vec (N * (256 * 7 * 7))
                                                                                                                      Equations
                                                                                                                      Instances For
                                                                                                                        noncomputable def Proofs.Mnv4TieB.mnv4Blk20 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                                        Vec (N * (256 * 7 * 7))
                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          noncomputable def Proofs.Mnv4TieB.mnv4Blk21 (N : ℕ) {nCls : ℕ} (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                                                                                                                          Vec (N * (256 * 7 * 7))
                                                                                                                          Equations
                                                                                                                          Instances For
                                                                                                                            theorem Proofs.Mnv4TieB.mnv4_net_tiedB (N : ℕ) {nCls : ℕ} (xN cotN vN epsStr : String) (w : StableHLO.Mnv4BWeights nCls) (bf16 : Bool) (x : Vec (N * (3 * 224 * 224))) (g : Vec (N * nCls)) :
                                                                                                                            have dy21 := mnv4HeadCotIn N 7 7 w.h1W w.h1b w.h1E w.h1g w.h1bt w.hW w.hb w.hE w.hg w.hbt w.Wd w.bd (mnv4Blk21 N w x) g; have dy20 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row21 w.b21 (mnv4Blk20 N w x) dy21) dy21; have dy19 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row20 w.b20 (mnv4Blk19 N w x) dy20) dy20; have dy18 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row19 w.b19 (mnv4Blk18 N w x) dy19) dy19; have dy17 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row18 w.b18 (mnv4Blk17 N w x) dy18) dy18; have dy16 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row17 w.b17 (mnv4Blk16 N w x) dy17) dy17; have dy15 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row16 w.b16 (mnv4Blk15 N w x) dy16) dy16; have dy14 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row15 w.b15 (mnv4Blk14 N w x) dy15) dy15; have dy13 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row14 w.b14 (mnv4Blk13 N w x) dy14) dy14; have dy12 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row13 w.b13 (mnv4Blk12 N w x) dy13) dy13; have dy11 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row12 w.b12 (mnv4Blk11 N w x) dy12) dy12; have dy10 := mnv4SBodyCotIn N StableHLO.mnv4Row11 w.b11 (mnv4Blk10 N w x) dy11; have dy9 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row10 w.b10 (mnv4Blk9 N w x) dy10) dy10; have dy8 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row9 w.b9 (mnv4Blk8 N w x) dy9) dy9; have dy7 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row8 w.b8 (mnv4Blk7 N w x) dy8) dy8; have dy6 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row7 w.b7 (mnv4Blk6 N w x) dy7) dy7; have dy5 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row6 w.b6 (mnv4Blk5 N w x) dy6) dy6; have dy4 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row5 w.b5 (mnv4Blk4 N w x) dy5) dy5; have dy3 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row4 w.b4 (mnv4Blk3 N w x) dy4) dy4; have dy2 := mnv4SBodyCotIn N StableHLO.mnv4Row3 w.b3 (mnv4Blk2 N w x) dy3; have dy1 := mnv4SkipCotIn (mnv4BodyCotIn N StableHLO.mnv4Row2 w.b2 (mnv4Blk1 N w x) dy2) dy2; have dy0 := mnv4SBodyCotIn N StableHLO.mnv4Row1 w.b1 (mnv4Blk0 N w x) dy1; have dyStem := mnv4FusedCotIn N 56 56 w.f0cW w.f0cb w.f0cE w.f0cg w.f0cbt w.f0pW w.f0pb w.f0pE w.f0pg w.f0pbt (StableHLO.mnv4Pre0 N w x) dy0; mnv4StemTiedB N 112 112 xN cotN vN epsStr w.sW w.sb w.sE w.sg w.sbt bf16 x dyStem ∧ mnv4FusedTiedB N 56 56 w.f0cW w.f0cb w.f0cE w.f0cg w.f0cbt w.f0pW w.f0pb w.f0pE w.f0pg w.f0pbt xN cotN vN epsStr bf16 (StableHLO.mnv4Pre0 N w x) dy0 ∧ mnv4StridedTiedB N StableHLO.mnv4Row1 xN cotN vN epsStr w.b1 bf16 (mnv4Blk0 N w x) dy1 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row2 xN cotN vN epsStr w.b2 bf16 (mnv4Blk1 N w x) dy2 ∧ mnv4StridedTiedB N StableHLO.mnv4Row3 xN cotN vN epsStr w.b3 bf16 (mnv4Blk2 N w x) dy3 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row4 xN cotN vN epsStr w.b4 bf16 (mnv4Blk3 N w x) dy4 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row5 xN cotN vN epsStr w.b5 bf16 (mnv4Blk4 N w x) dy5 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row6 xN cotN vN epsStr w.b6 bf16 (mnv4Blk5 N w x) dy6 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row7 xN cotN vN epsStr w.b7 bf16 (mnv4Blk6 N w x) dy7 ∧ mnv4ConvNeXtTiedB N StableHLO.mnv4Row8 xN cotN vN epsStr w.b8 bf16 (mnv4Blk7 N w x) dy8 ∧ mnv4FfnTiedB N StableHLO.mnv4Row9 xN cotN vN epsStr w.b9 bf16 (mnv4Blk8 N w x) dy9 ∧ mnv4ConvNeXtTiedB N StableHLO.mnv4Row10 xN cotN vN epsStr w.b10 bf16 (mnv4Blk9 N w x) dy10 ∧ mnv4StridedTiedB N StableHLO.mnv4Row11 xN cotN vN epsStr w.b11 bf16 (mnv4Blk10 N w x) dy11 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row12 xN cotN vN epsStr w.b12 bf16 (mnv4Blk11 N w x) dy12 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row13 xN cotN vN epsStr w.b13 bf16 (mnv4Blk12 N w x) dy13 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row14 xN cotN vN epsStr w.b14 bf16 (mnv4Blk13 N w x) dy14 ∧ mnv4FfnTiedB N StableHLO.mnv4Row15 xN cotN vN epsStr w.b15 bf16 (mnv4Blk14 N w x) dy15 ∧ mnv4ConvNeXtTiedB N StableHLO.mnv4Row16 xN cotN vN epsStr w.b16 bf16 (mnv4Blk15 N w x) dy16 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row17 xN cotN vN epsStr w.b17 bf16 (mnv4Blk16 N w x) dy17 ∧ mnv4ExtraDWTiedB N StableHLO.mnv4Row18 xN cotN vN epsStr w.b18 bf16 (mnv4Blk17 N w x) dy18 ∧ mnv4FfnTiedB N StableHLO.mnv4Row19 xN cotN vN epsStr w.b19 bf16 (mnv4Blk18 N w x) dy19 ∧ mnv4FfnTiedB N StableHLO.mnv4Row20 xN cotN vN epsStr w.b20 bf16 (mnv4Blk19 N w x) dy20 ∧ mnv4ConvNeXtTiedB N StableHLO.mnv4Row21 xN cotN vN epsStr w.b21 bf16 (mnv4Blk20 N w x) dy21 ∧ mnv4HeadTiedB N 7 7 w.h1W w.h1b w.h1E w.h1g w.h1bt w.hW w.hb w.hE w.hg w.hbt w.Wd w.bd xN cotN vN epsStr bf16 (mnv4Blk21 N w x) g

                                                                                                                            The whole batch-BN MobileNetV4-Conv-M train step, tied. Threading the net's own forward prefixes as the block inputs and an arbitrary loss cotangent g down through the head, the 21 UIB blocks and the fused stage — each dy is that layer's certified VJP backward wherever the layer is certified (mnv4HeadCotIn_eq_vjp, mnv4BodyCotIn_eq_vjp with mnv4SkipCotIn_eq_vjp, mnv4SBodyCotIn_eq_vjp, mnv4FusedCotIn_eq_vjp) — every parameter GRADIENT node of the net — stem 3, fused 6, thirteen ExtraDW blocks × 12, four ConvNeXt-like × 9, four FFN × 6, head 8 — denotes the certified batched Σ_n gradient. That is 233, the render's own census and mnv4_fwd.mlir's signature minus %x. No free activation and no symbolic cotangent below the loss.

                                                                                                                            g is a binder. The loss chain is not part of this statement; mnv4_lossCot_is_smoothedCE_grad instantiates it at the label-smoothed softmax cotangent the artifacts actually emit.

                                                                                                                            No smoothness hypothesis and no 0 < ε, and N and nCls are both binders. The folds are ∀ cot statements at explicitly constructed cotangents; the kink and positivity conditions live in the CertLayers whose .ok MobileNetV4FullBVJP.lean binds. The statement is at 224×224; unlike ResNet-50 there is no resolution binder q. One device, at either precision: bf16 selects the conv and depthwise weight nodes' kind — false the f32 artifacts', true the bf16 ones', read over ℝ (Bf16Erasure); the right-hand side is the same certified gradient at either value.

                                                                                                                            On the data-parallel (sync-BN) artifacts this theorem applies at N := R·N: the per-replica statement is MobileNetV4SyncTieB.mnv4_net_syncTiedB, whose right-hand sides are this theorem's nodes at the global batch. The AdamW update that follows is not stated here.

                                                                                                                            theorem Proofs.Mnv4TieB.mnv4_lossCot_is_smoothedCE_grad (N : ℕ) {nCls : ℕ} (hK : 0 < nCls) (aStr negAK bStr logN ohN : String) (α B : ℝ) (w : StableHLO.Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) (t : Vec (N * (1 * nCls))) (n : Fin N) (j : Fin nCls) (ht : ∑ k : Fin nCls, Mat.unflatten (StableHLO.batchSlice N (1 * nCls) t n) 0 k = 1) :
                                                                                                                            StableHLO.den (smoothedLossCotGraph N nCls α B aStr negAK bStr logN ohN (BackLinks.rowB N nCls (StableHLO.mobilenetv4ForwardBFull N w x)) t) (finProdFinEquiv (n, finProdFinEquiv (0, j))) = pdiv (fun (z' : Vec nCls) (x : Fin 1) => softCE nCls (smoothTarget nCls α (Mat.unflatten (StableHLO.batchSlice N (1 * nCls) t n) 0)) z') (Mat.unflatten (StableHLO.batchSlice N (1 * nCls) (BackLinks.rowB N nCls (StableHLO.mobilenetv4ForwardBFull N w x)) n) 0) j 0 / B

                                                                                                                            And the loss cotangent g is instantiated: MNv4's is the label-smoothed softmax chain. Row by row, the six-op chain MobileNetV4RenderB emits (softmaxRow → subB → scaleB → addVB → shiftB → divConstB, α = 0.1) is (1/B)·∂/∂logits of soft-target cross-entropy against the SMOOTHED target, at that example's real logits.

                                                                                                                            softmaxRow at m := 1 — the rowB/unrowB spelling ResNet-34 and ResNet-50 use, NOT ConvNeXt's and ViT's expe → softmaxDiv at the plain N·K width. Read off the render's own lines rather than assumed: those two take different lemmas (smoothedLossCotGraph here, smoothedLossCotGraphDiv there) and nothing in the types tells them apart.

                                                                                                                            MNv4 ships one loss — there is no BCE twin to state, where ResNet-50 needed both. The only hypothesis is that the example's target sums to 1: a one-hot, or mixup's convex combination.