Documentation

LeanMlir.Proofs.Nets.ResNet.ResNet34FullBSeal

ResNet-34's non-degeneracy seal, on the full-width batched net (levels 2 and 3) #

planning/full_width_seals.md §4.1. ResNet34FullBVJP.lean proves resnet34ForwardB_full_has_vjp_at: the whole-net VJP at any (w, x) that satisfies 32 relu clauses, a stem clause and the stem pool's no-tie. A conditional theorem of that shape says nothing unless its hypotheses are jointly satisfiable at a point with a nonzero Jacobian — and until now that was exhibited only on a 2-channel per-example proxy (ResNet34Live*, retired with this file). This file exhibits it on resnet34ForwardB_full itself: 64→512 channels, [3,4,6,3] blocks, the 7×7/s2 stem, the 3×3/s2 pool, batch BatchNorm, at 224×224.

The witness #

Weights are structural, not trained (a trained-weight witness is a numeric fact about millions of floats, which is what the training runs evidence — planning/full_width_seals.md §7):

N = 2 and the input is sealX t = sealBase + t • sealV: both examples carry the same strictly decreasing ramp in channel 0, and sealV adds t to all of example 0's channel 0.

Why the carrier is a batch difference (§3.2 of the plan) #

⭐⭐ bnBatchLA normalizes each channel over all N·h·w cells, so the proxies' channel-difference carrier is exactly what a channel's own mean subtracts, and at N = 1 this net is constant in its input. The carrier here is EDiff: example 0's slab is example 1's plus a per-channel constant. Batch BN keeps it and scales it by γ_c · istd_c (BatchSeal.bnBatchLA_exdiff) because the two examples share one mean and one istd; the centre-tap convs copy channel 0's offset to every channel; the pool shifts with it (BatchSeal.maxPool3s2_shift, for every t, no argmax argument); the zeroed bodies add a batch-uniform constant and so are transparent. The class-0 output difference between the two examples is therefore t · R t with R a product of the four carrier-path istds, continuous and positive, so g'(0) = R 0 ≠ 0 and no BN-variance derivative is ever taken.

noncomputable def Proofs.R34FullBSeal.sealIdW (c : ) :

The structural identity-block weights: both convs zeroed, every BN (ε, γ, β) = (1, 1, 1). The body is then the constant 1 and the block is a ↦ a + 1 on a nonnegative activation.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    noncomputable def Proofs.R34FullBSeal.sealDnW (ic oc : ) :
    R34DownW ic oc

    The structural downsample weights: zeroed body, centre-tap 1×1/s2 projection, β_p = 160 (the margin that keeps the post-residual relu off its kink at every input).

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def Proofs.R34FullBSeal.sealW (nCls : ) :

      The witness weights, generic in the class count.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Proofs.R34FullBSeal.projB_zero_const {N ic oc h w kH kW : } (hn : 0 < N * (h * w)) (W : Kernel4 oc ic kH kW) (b : Vec oc) (hW : ∀ (o : Fin oc) (c : Fin ic) (kh : Fin kH) (kw : Fin kW), W o c kh kw = 0) (hb : ∀ (o : Fin oc), b o = 0) (ε : ) (γ β : Vec oc) (bb : ) ( : ∀ (ci : Fin oc), β ci = bb) (u : Vec (N * (ic * h * w))) :
        projB N W b ε γ β u = fun (x : Fin (N * (oc * h * w))) => bb

        A zeroed final conv makes a body the constant β₂projB at a zero kernel is bnBatchLA of the constant 0, which is β₂ (variance 0). Used for both block kinds.

        theorem Proofs.R34FullBSeal.sealIdBody (N h w c : ) (hn : 0 < N * (h * w)) (v : Vec (N * (c * h * w))) :
        (projB N (sealIdW c).W₂ (sealIdW c).b₂ (sealIdW c).ε₂ (sealIdW c).γ₂ (sealIdW c).β₂ StableHLO.cbReluB N (sealIdW c).W₁ (sealIdW c).b₁ (sealIdW c).ε₁ (sealIdW c).γ₁ (sealIdW c).β₁) v = fun (x : Fin (N * (c * h * w))) => 1

        The identity block's body is the constant 1, at every input.

        theorem Proofs.R34FullBSeal.sealDnBody (N h w ic oc : ) (hn : 0 < N * (h * w)) (v : Vec (N * (ic * (2 * h) * (2 * w)))) :
        (projB N (sealDnW ic oc).W₂ (sealDnW ic oc).b₂ (sealDnW ic oc).ε₂ (sealDnW ic oc).γ₂ (sealDnW ic oc).β₂ StableHLO.cbReluStridedB N (sealDnW ic oc).W₁ (sealDnW ic oc).b₁ (sealDnW ic oc).ε₁ (sealDnW ic oc).γ₁ (sealDnW ic oc).β₁) v = fun (x : Fin (N * (oc * h * w))) => 1

        The downsample block's body is the constant 1, at every input.

        theorem Proofs.R34FullBSeal.sealIdB_eq (N h w c : ) (hn : 0 < N * (h * w)) (v : Vec (N * (c * h * w))) (hv : ∀ (k : Fin (N * (c * h * w))), 0 v k) :
        r34IdB N h w (sealIdW c) v = fun (k : Fin (N * (c * h * w))) => v k + 1

        The structural identity block is the shift a ↦ a + 1 on a nonnegative activation: the body is the constant 1 and the post-residual relu is off (1 + a ≥ 1 > 0).

        noncomputable def Proofs.R34FullBSeal.sealProj (N h w ic oc : ) :
        Vec (N * (ic * (2 * h) * (2 * w)))Vec (N * (oc * h * w))

        The structural downsample's collapsed form: its centre-tap projection.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Proofs.R34FullBSeal.sealProj_pos (N h w ic oc : ) (hm : |1| * ↑(N * (h * w)) < 160) (v : Vec (N * (ic * (2 * h) * (2 * w)))) (k : Fin (N * (oc * h * w))) :
          0 < sealProj N h w ic oc v k

          The projection is strictly positive at every input (the β = 160 margin).

          theorem Proofs.R34FullBSeal.sealDnB_eq (N h w ic oc : ) (hn : 0 < N * (h * w)) (hm : |1| * ↑(N * (h * w)) < 160) (v : Vec (N * (ic * (2 * h) * (2 * w)))) :
          r34DownB N h w (sealDnW ic oc) v = fun (k : Fin (N * (oc * h * w))) => sealProj N h w ic oc v k + 1

          The structural downsample is its projection plus one: the body is the constant 1 and the post-residual relu is off (proj > 0).

          theorem Proofs.R34FullBSeal.cbReluStridedB_eq {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)))) (hp : ∀ (k : Fin (N * (oc * h * w))), 0 < StableHLO.bnBatchLA N oc h w ε γ β (StableHLO.batchMap N (flatConvStride2 W b) x) k) :

          A strided conv-bn-relu stage whose BN is everywhere positive has no relu left.

          theorem Proofs.R34FullBSeal.r34StemB_eq {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))))) (hp : ∀ (k : Fin (N * (oc * (2 * h) * (2 * w)))), 0 < StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs γs βs (StableHLO.batchMap N (flatConvStride2 Ws bs) x) k) :
          r34StemB N h w Ws bs εs γs βs x = StableHLO.batchMap N (maxPool3s2Flat oc h w) (StableHLO.bnBatchLA N oc (2 * h) (2 * w) εs γs βs (StableHLO.batchMap N (flatConvStride2 Ws bs) x))

          The stem with its relu removed: pool ∘ bn ∘ strided conv. The pool stays — it is the net's only remaining kink, and the carrier crosses it by BatchSeal.maxPool3s2_shift.

          theorem Proofs.R34FullBSeal.r34IdB_nonneg (N h w c : ) (p : R34IdW c) (v : Vec (N * (c * h * w))) (k : Fin (N * (c * h * w))) :
          0 r34IdB N h w p v k

          A block output is a relu, hence nonnegative — whatever the weights.

          theorem Proofs.R34FullBSeal.r34DownB_nonneg (N h w ic oc : ) (p : R34DownW ic oc) (v : Vec (N * (ic * (2 * h) * (2 * w)))) (k : Fin (N * (oc * h * w))) :
          0 r34DownB N h w p v k
          theorem Proofs.R34FullBSeal.r34StemB_nonneg (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))))) (k : Fin (N * (oc * h * w))) :
          0 r34StemB N h w Ws bs εs γs βs x k

          The stem's pool preserves the relu's nonnegativity.

          Both εs of a structural identity block are positive.

          All three εs of a structural downsample are positive.

          theorem Proofs.R34FullBSeal.sealIdSmooth (N h w c : ) (hn : 0 < N * (h * w)) (v : Vec (N * (c * h * w))) (hv : ∀ (k : Fin (N * (c * h * w))), 0 v k) :

          The identity block's two relu clauses: the mid-relu sees the constant β₁ = 1 (weight-only), the outer one sees 1 + activation > 0.

          theorem Proofs.R34FullBSeal.sealDnSmooth (N h w ic oc : ) (hn : 0 < N * (h * w)) (hm : |1| * ↑(N * (h * w)) < 160) (v : Vec (N * (ic * (2 * h) * (2 * w)))) :
          R34DownSmoothAt N h w (sealDnW ic oc) v

          The downsample's two relu clauses — both weight-only: the mid-relu sees β₁ = 1, the outer one proj + 1 > 0 with proj > 0 by the margin. No hypothesis on the activation.

          theorem Proofs.R34FullBSeal.sealStemSmooth (N h w ic oc : ) (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (hm : |1| * ↑(N * (2 * h * (2 * w))) < 160) (x : Vec (N * (ic * (2 * (2 * h)) * (2 * (2 * w))))) :
          R34StemSmoothAt N h w Ws bs 1 (BatchSeal.kv oc 1) (BatchSeal.kv oc 160) x

          The stem's relu clause — weight-only, from the β = 160 margin.

          noncomputable def Proofs.R34FullBSeal.sealX (t : ) :
          Vec (2 * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))

          The witness input: the shared ray at 224×224.

          Equations
          Instances For
            noncomputable def Proofs.R34FullBSeal.sealV :
            Vec (2 * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))

            Its direction — all of example 0's channel 0.

            Equations
            Instances For
              theorem Proofs.R34FullBSeal.EDiff_sealX (t : ) :
              BatchSeal.EDiff (fun (ci : Fin 3) => if ci = 0 then t else 0) (sealX t)
              noncomputable def Proofs.R34FullBSeal.Zs (t : ) :
              Vec (2 * (64 * (2 * 56) * (2 * 56)))

              The stem's centre-tap conv output — the pre-BN activation on the carrier's path.

              Equations
              Instances For
                theorem Proofs.R34FullBSeal.margin_stem :
                |1| * ↑(2 * (2 * 56 * (2 * 56))) < 160
                theorem Proofs.R34FullBSeal.margin28 :
                |1| * ↑(2 * (28 * 28)) < 160
                theorem Proofs.R34FullBSeal.margin14 :
                |1| * ↑(2 * (14 * 14)) < 160
                theorem Proofs.R34FullBSeal.margin7 :
                |1| * ↑(2 * (7 * 7)) < 160
                theorem Proofs.R34FullBSeal.Zs_bn_pos (t : ) (k : Fin (2 * (64 * (2 * 56) * (2 * 56)))) :
                0 < StableHLO.bnBatchLA 2 64 (2 * 56) (2 * 56) 1 (BatchSeal.kv 64 1) (BatchSeal.kv 64 160) (Zs t) k

                The stem BN is strictly positive at every point of the ray.

                theorem Proofs.R34FullBSeal.sealPoolSmooth (t : ) :
                R34PoolSmoothAt 2 56 56 (StableHLO.bnBatchLA 2 64 (2 * 56) (2 * 56) 1 (BatchSeal.kv 64 1) (BatchSeal.kv 64 160) (Zs t))

                ⭐ The stem pool has no tie at the witness — the ramp is positionally injective and BN is injective within a channel.

                theorem Proofs.R34FullBSeal.nn0 (nCls : ) (t : ) (k : Fin (2 * (64 * 56 * 56))) :
                0 r34Pre0 2 (sealW nCls) (sealX t) k

                The stem's output is nonnegative (a pool of a relu).

                theorem Proofs.R34FullBSeal.pc0 (nCls : ) (t : ) :
                r34Pre0 2 (sealW nCls) (sealX t) = StableHLO.batchMap 2 (maxPool3s2Flat 64 56 56) (StableHLO.bnBatchLA 2 64 (2 * 56) (2 * 56) 1 (BatchSeal.kv 64 1) (BatchSeal.kv 64 160) (Zs t))

                The stem, collapsed: its relu is off, so it is pool ∘ bn ∘ centre-tap conv.

                theorem Proofs.R34FullBSeal.nn1 (nCls : ) (t : ) (k : Fin (2 * (64 * 56 * 56))) :
                0 r34Pre1 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn2 (nCls : ) (t : ) (k : Fin (2 * (64 * 56 * 56))) :
                0 r34Pre2 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn4 (nCls : ) (t : ) (k : Fin (2 * (128 * 28 * 28))) :
                0 r34Pre4 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn5 (nCls : ) (t : ) (k : Fin (2 * (128 * 28 * 28))) :
                0 r34Pre5 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn6 (nCls : ) (t : ) (k : Fin (2 * (128 * 28 * 28))) :
                0 r34Pre6 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn8 (nCls : ) (t : ) (k : Fin (2 * (256 * 14 * 14))) :
                0 r34Pre8 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn9 (nCls : ) (t : ) (k : Fin (2 * (256 * 14 * 14))) :
                0 r34Pre9 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn10 (nCls : ) (t : ) (k : Fin (2 * (256 * 14 * 14))) :
                0 r34Pre10 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn11 (nCls : ) (t : ) (k : Fin (2 * (256 * 14 * 14))) :
                0 r34Pre11 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn12 (nCls : ) (t : ) (k : Fin (2 * (256 * 14 * 14))) :
                0 r34Pre12 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn14 (nCls : ) (t : ) (k : Fin (2 * (512 * 7 * 7))) :
                0 r34Pre14 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.nn15 (nCls : ) (t : ) (k : Fin (2 * (512 * 7 * 7))) :
                0 r34Pre15 2 (sealW nCls) (sealX t) k
                theorem Proofs.R34FullBSeal.pc1 (nCls : ) (t : ) :
                r34Pre1 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (64 * 56 * 56))) => r34Pre0 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc2 (nCls : ) (t : ) :
                r34Pre2 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (64 * 56 * 56))) => r34Pre1 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc3 (nCls : ) (t : ) :
                r34Pre3 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (64 * 56 * 56))) => r34Pre2 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc4 (nCls : ) (t : ) :
                r34Pre4 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (128 * 28 * 28))) => sealProj 2 28 28 64 128 (r34Pre3 2 (sealW nCls) (sealX t)) k + 1
                theorem Proofs.R34FullBSeal.pc5 (nCls : ) (t : ) :
                r34Pre5 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (128 * 28 * 28))) => r34Pre4 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc6 (nCls : ) (t : ) :
                r34Pre6 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (128 * 28 * 28))) => r34Pre5 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc7 (nCls : ) (t : ) :
                r34Pre7 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (128 * 28 * 28))) => r34Pre6 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc8 (nCls : ) (t : ) :
                r34Pre8 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (256 * 14 * 14))) => sealProj 2 14 14 128 256 (r34Pre7 2 (sealW nCls) (sealX t)) k + 1
                theorem Proofs.R34FullBSeal.pc9 (nCls : ) (t : ) :
                r34Pre9 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (256 * 14 * 14))) => r34Pre8 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc10 (nCls : ) (t : ) :
                r34Pre10 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (256 * 14 * 14))) => r34Pre9 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc11 (nCls : ) (t : ) :
                r34Pre11 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (256 * 14 * 14))) => r34Pre10 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc12 (nCls : ) (t : ) :
                r34Pre12 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (256 * 14 * 14))) => r34Pre11 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc13 (nCls : ) (t : ) :
                r34Pre13 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (256 * 14 * 14))) => r34Pre12 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc14 (nCls : ) (t : ) :
                r34Pre14 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (512 * 7 * 7))) => sealProj 2 7 7 256 512 (r34Pre13 2 (sealW nCls) (sealX t)) k + 1
                theorem Proofs.R34FullBSeal.pc15 (nCls : ) (t : ) :
                r34Pre15 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (512 * 7 * 7))) => r34Pre14 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.pc16 (nCls : ) (t : ) :
                r34Pre16 2 (sealW nCls) (sealX t) = fun (k : Fin (2 * (512 * 7 * 7))) => r34Pre15 2 (sealW nCls) (sealX t) k + 1
                theorem Proofs.R34FullBSeal.stem_relu_off (nCls : ) (t : ) :
                StableHLO.cbReluStridedB 2 (sealW nCls).sW (sealW nCls).sb (sealW nCls). (sealW nCls). (sealW nCls). (sealX t) = StableHLO.bnBatchLA 2 64 (2 * 56) (2 * 56) 1 (BatchSeal.kv 64 1) (BatchSeal.kv 64 160) (Zs t)

                The stem's relu is off at the witness, so the pool's no-tie condition can be stated on the BN output (sealPoolSmooth).

                theorem Proofs.R34FullBSeal.sealPoolClause (nCls : ) (t : ) :
                R34PoolSmoothAt 2 56 56 (StableHLO.cbReluStridedB 2 (sealW nCls).sW (sealW nCls).sb (sealW nCls). (sealW nCls). (sealW nCls). (sealX t))
                theorem Proofs.R34FullBSeal.sealStemClause (nCls : ) (t : ) :
                R34StemSmoothAt 2 56 56 (sealW nCls).sW (sealW nCls).sb (sealW nCls). (sealW nCls). (sealW nCls). (sealX t)
                theorem Proofs.R34FullBSeal.sc_a0 (nCls : ) (t : ) :
                R34IdSmoothAt 2 56 56 (sealW nCls).a0 (r34Pre0 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_a1 (nCls : ) (t : ) :
                R34IdSmoothAt 2 56 56 (sealW nCls).a1 (r34Pre1 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_a2 (nCls : ) (t : ) :
                R34IdSmoothAt 2 56 56 (sealW nCls).a2 (r34Pre2 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_d2 (nCls : ) (t : ) :
                R34DownSmoothAt 2 28 28 (sealW nCls).d2 (r34Pre3 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_b0 (nCls : ) (t : ) :
                R34IdSmoothAt 2 28 28 (sealW nCls).b0 (r34Pre4 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_b1 (nCls : ) (t : ) :
                R34IdSmoothAt 2 28 28 (sealW nCls).b1 (r34Pre5 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_b2 (nCls : ) (t : ) :
                R34IdSmoothAt 2 28 28 (sealW nCls).b2 (r34Pre6 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_d3 (nCls : ) (t : ) :
                R34DownSmoothAt 2 14 14 (sealW nCls).d3 (r34Pre7 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_c0 (nCls : ) (t : ) :
                R34IdSmoothAt 2 14 14 (sealW nCls).c0 (r34Pre8 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_c1 (nCls : ) (t : ) :
                R34IdSmoothAt 2 14 14 (sealW nCls).c1 (r34Pre9 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_c2 (nCls : ) (t : ) :
                R34IdSmoothAt 2 14 14 (sealW nCls).c2 (r34Pre10 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_c3 (nCls : ) (t : ) :
                R34IdSmoothAt 2 14 14 (sealW nCls).c3 (r34Pre11 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_c4 (nCls : ) (t : ) :
                R34IdSmoothAt 2 14 14 (sealW nCls).c4 (r34Pre12 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_d4 (nCls : ) (t : ) :
                R34DownSmoothAt 2 7 7 (sealW nCls).d4 (r34Pre13 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_e0 (nCls : ) (t : ) :
                R34IdSmoothAt 2 7 7 (sealW nCls).e0 (r34Pre14 2 (sealW nCls) (sealX t))
                theorem Proofs.R34FullBSeal.sc_e1 (nCls : ) (t : ) :
                R34IdSmoothAt 2 7 7 (sealW nCls).e1 (r34Pre15 2 (sealW nCls) (sealX t))
                noncomputable def Proofs.R34FullBSeal.sealVJP (nCls : ) (t : ) :

                ⭐⭐ The whole-net VJP at the witness — every one of the 32 relu clauses, the stem clause and the pool's no-tie discharged at (sealW nCls, sealX t), on resnet34ForwardB_full itself (transported through resnet34ForwardB_full_eq_chain).

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

                  The net is differentiable at the witness — fderiv_ne_zero_of_ray's first hypothesis. Built block by block, as the apex's own proof builds its chain.

                  theorem Proofs.R34FullBSeal.sealProj_apply (N h w ic oc : ) (v : Vec (N * (ic * (2 * h) * (2 * w)))) :
                  sealProj N h w ic oc v = StableHLO.bnBatchLA N oc h w 1 (BatchSeal.kv oc 1) (BatchSeal.kv oc 160) (StableHLO.batchMap N (flatConvStride2 (BatchSeal.ctK oc ic 1 1 1) (BatchSeal.kv oc 0)) v)

                  sealProj, unfolded — bn of the centre-tap strided conv.

                  noncomputable def Proofs.R34FullBSeal.Zp2 (nCls : ) (t : ) :
                  Vec (2 * (128 * 28 * 28))

                  The three projections' pre-BN activations, on the carrier's path.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def Proofs.R34FullBSeal.Zp3 (nCls : ) (t : ) :
                    Vec (2 * (256 * 14 * 14))
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      noncomputable def Proofs.R34FullBSeal.Zp4 (nCls : ) (t : ) :
                      Vec (2 * (512 * 7 * 7))
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        noncomputable def Proofs.R34FullBSeal.dS (t : ) :
                        Fin 64

                        The carrier after the stem BN: t scaled by that BN's istd.

                        Equations
                        Instances For
                          noncomputable def Proofs.R34FullBSeal.dP2 (nCls : ) (t : ) :
                          Fin 128

                          The carrier after d2's projection BN.

                          Equations
                          Instances For
                            noncomputable def Proofs.R34FullBSeal.dP3 (nCls : ) (t : ) :
                            Fin 256

                            The carrier after d3's projection BN.

                            Equations
                            Instances For
                              noncomputable def Proofs.R34FullBSeal.dP4 (nCls : ) (t : ) :
                              Fin 512

                              The carrier after d4's projection BN — the one the head reads.

                              Equations
                              Instances For
                                theorem Proofs.R34FullBSeal.ed0 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dS t) (r34Pre0 2 (sealW nCls) (sealX t))

                                ⭐ The carrier at the stem's output: the centre-tap conv copies channel 0's t to every channel, the BN scales it by istd, and the pool carries it through unchanged.

                                theorem Proofs.R34FullBSeal.ed1 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dS t) (r34Pre1 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed2 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dS t) (r34Pre2 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed3 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dS t) (r34Pre3 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed4 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP2 nCls t) (r34Pre4 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed5 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP2 nCls t) (r34Pre5 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed6 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP2 nCls t) (r34Pre6 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed7 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP2 nCls t) (r34Pre7 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed8 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP3 nCls t) (r34Pre8 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed9 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP3 nCls t) (r34Pre9 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed10 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP3 nCls t) (r34Pre10 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed11 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP3 nCls t) (r34Pre11 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed12 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP3 nCls t) (r34Pre12 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed13 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP3 nCls t) (r34Pre13 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed14 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP4 nCls t) (r34Pre14 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed15 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP4 nCls t) (r34Pre15 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.ed16 (nCls : ) (t : ) :
                                BatchSeal.EDiff (dP4 nCls t) (r34Pre16 2 (sealW nCls) (sealX t))
                                theorem Proofs.R34FullBSeal.sealW_Wd (nCls : ) :
                                (sealW nCls).Wd = fun (i : Fin 512) (j : Fin nCls) => if i = 0 j = 0 then 1 else 0
                                theorem Proofs.R34FullBSeal.head_diff (nCls : ) (hn : 0 < nCls) (v : Vec (2 * (512 * 7 * 7))) (δ : Fin 512) (hv : BatchSeal.EDiff δ v) :
                                r34HeadB 2 7 7 (sealW nCls).Wd (sealW nCls).bd v (finProdFinEquiv (0, 0, hn)) - r34HeadB 2 7 7 (sealW nCls).Wd (sealW nCls).bd v (finProdFinEquiv (1, 0, hn)) = δ 0

                                The head reads channel 0 into class 0 — BatchSeal.head_diff_ct at this net's widths.

                                noncomputable def Proofs.R34FullBSeal.Rr (nCls : ) (t : ) :

                                ⭐⭐ The positive, continuous nonlinear factor: one istd per BN on the carrier's path — the stem's and the three projections'. ⚠ No γ appears because every carrier-path γ is 1, and no BN-variance derivative is ever taken: R enters only through the factor t · R t, whose derivative at 0 is R 0 for any R continuous there.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Proofs.R34FullBSeal.Rr_pos (nCls : ) (t : ) :
                                  0 < Rr nCls t
                                  theorem Proofs.R34FullBSeal.gd_ray (nCls : ) (hn : 0 < nCls) (t : ) :

                                  ⭐⭐ The class-0 difference between the two examples, along the ray, is t · R t. The carrier vanishes at the base (both examples carry the same ramp), so the product rule's cross terms all carry a factor t.

                                  theorem Proofs.R34FullBSeal.projB_continuous (N : ) {ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ) ( : 0 < ε) (γ β : Vec oc) :
                                  Continuous (projB N W b ε γ β)
                                  theorem Proofs.R34FullBSeal.cbReluB_continuous (N : ) {ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ) ( : 0 < ε) (γ β : Vec oc) :
                                  Continuous (StableHLO.cbReluB N W b ε γ β)
                                  theorem Proofs.R34FullBSeal.projStridedB_continuous (N : ) {ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ) ( : 0 < ε) (γ β : Vec oc) :
                                  theorem Proofs.R34FullBSeal.cbReluStridedB_continuous (N : ) {ic oc h w kH kW : } (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ) ( : 0 < ε) (γ β : Vec oc) :
                                  theorem Proofs.R34FullBSeal.r34IdB_continuous (N h w c : ) (p : R34IdW c) (h1 : 0 < p.ε₁) (h2 : 0 < p.ε₂) :
                                  Continuous (r34IdB N h w p)
                                  theorem Proofs.R34FullBSeal.r34DownB_continuous (N h w ic oc : ) (p : R34DownW ic oc) (h1 : 0 < p.ε₁) (h2 : 0 < p.ε₂) (hp : 0 < p.εp) :
                                  theorem Proofs.R34FullBSeal.r34StemB_continuous (N h w : ) {ic oc : } (Ws : Kernel4 oc ic 7 7) (bs : Vec oc) (εs : ) (hεs : 0 < εs) (γs βs : Vec oc) :
                                  Continuous (r34StemB N h w Ws bs εs γs βs)

                                  ⭐⭐ Level 2 — the witness is non-degenerate: the full-width batch-BN ResNet-34 at the structural weights is NOT constant in its input. Straight from the ray: the class-0 difference between the two examples is R 1 > 0 at t = 1 and 0 at the base.

                                  ⭐⭐ Level 3 — the whole-net Jacobian is nonzero at the witness. fderiv_ne_zero_of_ray at the readout "example 0's class 0 minus example 1's class 0": along the ray it is t · R t with R continuous and R 0 > 0, so its derivative at 0 is R 0 ≠ 0.

                                  theorem Proofs.R34FullBSeal.sealX_backward_nontrivial (nCls : ) (hn : 0 < nCls) :
                                  ∃ (j₀ : Fin (2 * nCls)) (i₀ : Fin (2 * (3 * (2 * (2 * 56)) * (2 * (2 * 56))))), (sealVJP nCls 0).backward (basisVec j₀) i₀ 0

                                  ⭐⭐ The seal: the proven whole-network backward of the full-width, batch-BatchNorm, [3,4,6,3], 224×224 ResNet-34 — resnet34ForwardB_full, the forward the ImageNet artifacts run — is not the zero map at the witness. The conditional apex resnet34ForwardB_full_has_vjp_at is therefore not vacuous, and it is not vacuous on the net itself rather than on a 2-channel proxy of it.