Documentation

LeanMlir.Proofs.Nets.ResNet.ResNet34FullBSeal

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

ResNet34FullBVJP.lean proves resnet34ForwardBFullHasVJPAt: the whole-net VJP at any (w, x) that satisfies 32 relu clauses, a stem clause and the stem pool's condition. A conditional theorem of that shape says nothing unless its hypotheses are jointly satisfiable at a point with a nonzero Jacobian. This file exhibits such a point on resnet34ForwardBFull 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 would be a numeric fact about millions of floats):

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 #

bnBatchLA normalizes each channel over all N·h·w cells, so a within-example 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 (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.seal_id_body (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.seal_dn_body (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).

        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))) => BatchSeal.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.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 maxPool3s2_shift.

        Both εs of a structural identity block are positive.

        theorem Proofs.R34FullBSeal.seal_id_smooth (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.seal_dn_smooth (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.seal_stem_smooth (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.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.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))) => BatchSeal.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))) => BatchSeal.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))) => BatchSeal.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).sε (sealW nCls).sγ (sealW nCls).sβ (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 (seal_pool_smooth).

              theorem Proofs.R34FullBSeal.seal_pool_clause (nCls : ℕ) (t : ℝ) :
              StemPoolSmoothAt 2 56 56 (StableHLO.cbReluStridedB 2 (sealW nCls).sW (sealW nCls).sb (sealW nCls).sε (sealW nCls).sγ (sealW nCls).sβ (sealX t))
              theorem Proofs.R34FullBSeal.seal_stem_clause (nCls : ℕ) (t : ℝ) :
              R34StemSmoothAt 2 56 56 (sealW nCls).sW (sealW nCls).sb (sealW nCls).sε (sealW nCls).sγ (sealW nCls).sβ (sealX t)

              Every BN ε of the witness is 1.

              theorem Proofs.R34FullBSeal.seal_smooth (nCls : ℕ) (t : ℝ) :
              R34SmoothAtB 2 (sealW nCls) (sealX t)

              The stem clause, the pool's no-tie and all 32 relu clauses at (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 resnet34ForwardBFull itself (transported through resnet34ForwardBFull_eq_chain).

              Equations
              Instances For

                The net is differentiable at the witness — fderiv_ne_zero_of_ray's first hypothesis.

                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.

                                R is continuous: every block is (relu, the pool and the residual adds included), and fun_prop composes them through the fourteen-block prefix once the chain is unfolded to its atoms. Every BN on the witness has ε = 1.

                                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 — resnet34ForwardBFull, the forward the ImageNet artifacts run — is not the zero map at the witness. The conditional apex resnet34ForwardBFullHasVJPAt is therefore not vacuous, and it is not vacuous on the net itself rather than on a 2-channel proxy of it.