Documentation

LeanMlir.Proofs.Nets.Small.CifarCNN

Chapter 4: CIFAR-10 2D CNN (no BatchNorm) — whole-network VJP #

The Chapter-4 demo model cifarCnn (the no-BN CIFAR-10 spec):

conv 3→32 (relu) → conv 32→32 (relu) → maxPool 2×2 → conv 32→64 (relu) → conv 64→64 (relu) → maxPool 2×2 → flatten → dense 4096→512 (relu) → dense 512→512 (relu) → dense 512→10

i.e. two conv→conv→maxPool stages (channels 3→32→32, then 32→64→64) and a three-layer dense head, on 32×32 RGB input with two 2×2 pools (32→16→8).

This is the Chapter-3 mnistCnnNoBn machinery scaled up: the same convRelu/denseRelu/maxPoolFlat building blocks, chained through vjpCompAt, just longer and with two maxpool steps. Spatial bookkeeping uses the final pooled size (h, w) as the unit: the second conv stage runs at (2h, 2w), the first at (2·(2h), 2·(2w)) — exactly the Chapter-3 (2h, 2w) convention nested one level deeper (so the two pools read maxPoolFlat _ (2h) (2w) and maxPoolFlat _ h w).

noncomputable def Proofs.cifarCnnForward {ic c1 c2 h w d1 nClasses kH kW : ℕ} (W₁ : Kernel4 c1 ic kH kW) (b₁ : Vec c1) (W₂ : Kernel4 c1 c1 kH kW) (b₂ : Vec c1) (W₃ : Kernel4 c2 c1 kH kW) (b₃ : Vec c2) (W₄ : Kernel4 c2 c2 kH kW) (b₄ : Vec c2) (W₅ : Mat (c2 * h * w) d1) (b₅ : Vec d1) (W₆ : Mat d1 d1) (b₆ : Vec d1) (W₇ : Mat d1 nClasses) (b₇ : Vec nClasses) :
Vec (ic * (2 * (2 * h)) * (2 * (2 * w))) → Vec nClasses

The Chapter-4 cifarCnn forward, in flattened Vec space. The conv stack runs at spatial (2·(2h), 2·(2w)); the first maxPool halves it to (2h, 2w) (where the second conv stage runs), the second to (h, w); then three dense layers (two with ReLU). With the real CIFAR shapes ic=3, c1=32, c2=64, h=w=8, d1=512, nClasses=10, kH=kW=3 the input width is 3·32·32 = 3072 and the flattened pool output is 64·8·8 = 4096.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    noncomputable def Proofs.cifarCnnHasVJPAt {ic c1 c2 h w d1 nClasses kH kW : ℕ} (W₁ : Kernel4 c1 ic kH kW) (b₁ : Vec c1) (W₂ : Kernel4 c1 c1 kH kW) (b₂ : Vec c1) (W₃ : Kernel4 c2 c1 kH kW) (b₃ : Vec c2) (W₄ : Kernel4 c2 c2 kH kW) (b₄ : Vec c2) (W₅ : Mat (c2 * h * w) d1) (b₅ : Vec d1) (W₆ : Mat d1 d1) (b₆ : Vec d1) (W₇ : Mat d1 nClasses) (b₇ : Vec nClasses) (x : Vec (ic * (2 * (2 * h)) * (2 * (2 * w)))) (h1 : ∀ (k : Fin (c1 * (2 * (2 * h)) * (2 * (2 * w)))), flatConv W₁ b₁ x k ≠ 0) (h2 : ∀ (k : Fin (c1 * (2 * (2 * h)) * (2 * (2 * w)))), flatConv W₂ b₂ ((relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₁ b₁) x) k ≠ 0) (h_mp1 : MaxPool2Smooth (Tensor3.unflatten (((relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₁ b₁) x))) (h3 : ∀ (k : Fin (c2 * (2 * h) * (2 * w))), flatConv W₃ b₃ (maxPoolFlat c1 (2 * h) (2 * w) (((relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₁ b₁) x)) k ≠ 0) (h4 : ∀ (k : Fin (c2 * (2 * h) * (2 * w))), flatConv W₄ b₄ ((relu (c2 * (2 * h) * (2 * w)) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * h) (2 * w) (((relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₁ b₁) x))) k ≠ 0) (h_mp2 : MaxPool2Smooth (Tensor3.unflatten (((relu (c2 * (2 * h) * (2 * w)) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * h) * (2 * w)) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * h) (2 * w) (((relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₁ b₁) x))))) (h5 : ∀ (k : Fin d1), dense W₅ b₅ (maxPoolFlat c2 h w (((relu (c2 * (2 * h) * (2 * w)) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * h) * (2 * w)) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * h) (2 * w) (((relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₁ b₁) x)))) k ≠ 0) (h6 : ∀ (k : Fin d1), dense W₆ b₆ ((relu d1 ∘ dense W₅ b₅) (maxPoolFlat c2 h w (((relu (c2 * (2 * h) * (2 * w)) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * h) * (2 * w)) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * h) (2 * w) (((relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₁ b₁) x))))) k ≠ 0) :
    HasVJPAt (cifarCnnForward W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ W₇ b₇) x

    CIFAR 2D CNN (no BN) whole-network VJP at a smooth point.

    The composed backward of the full Chapter-4 forward equals the pdiv-contracted Jacobian, conditional on smoothness at the six ReLU kinks and the two MaxPools. Built by vjpCompAt through convRelu → convRelu → maxPool → convRelu → convRelu → maxPool → denseRelu → denseRelu → dense. The Chapter-4 sibling of mnistCnnNoBnHasVJPAt (two conv stages, two pools).

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def Proofs.Tiny.T0 :
      Tensor3 1 (2 * (2 * 1)) (2 * (2 * 1))

      16 distinct positive values, 4×4 row-major ⇒ positionally injective. Typed at the 2·(2·1) spatial form so it lines up syntactically with the forward's stage-1 input shape (no 2*2 vs 2*(2*1) cast friction).

      Equations
      Instances For
        noncomputable def Proofs.Tiny.X :
        Vec (1 * (2 * (2 * 1)) * (2 * (2 * 1)))

        Whole-network input, the flattened T0 (Vec 16).

        Equations
        Instances For
          noncomputable def Proofs.Tiny.K :
          Kernel4 1 1 1 1

          Every conv: 1→1, 1×1 unit kernel ⇒ identity.

          Equations
          Instances For
            noncomputable def Proofs.Tiny.Bz :
            Vec 1
            Equations
            Instances For
              noncomputable def Proofs.Tiny.Wd5 :
              Mat (1 * 1 * 1) 1

              Dense heads: nonnegative weights + a strictly-positive bias keep every activation off the ReLU kink.

              Equations
              Instances For
                noncomputable def Proofs.Tiny.Wd6 :
                Mat 1 1
                Equations
                Instances For
                  noncomputable def Proofs.Tiny.Bp :
                  Vec 1
                  Equations
                  Instances For
                    noncomputable def Proofs.Tiny.Wd7 :
                    Mat 1 2
                    Equations
                    Instances For
                      noncomputable def Proofs.Tiny.Bz2 :
                      Vec 2
                      Equations
                      Instances For

                        Unconditional whole-network VJP for a concrete tiny CIFAR CNN. Every smoothness hypothesis of cifarCnnHasVJPAt is discharged — the two no-tie conditions via positional injectivity (maxPool2Smooth_of_injective, the second through pool1_inj), the six ReLU conditions via positivity — so the statement carries no side conditions and stays in the three-axiom closure.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Proofs.Tiny.cifarTinyCnnHasVJP_correct (dy : Vec 2) (i : Fin (1 * (2 * (2 * 1)) * (2 * (2 * 1)))) :

                          Public unconditional correctness theorem — the concrete tiny CIFAR CNN's backward equals the pdiv-Jacobian VJP, no hypotheses.

                          noncomputable def Proofs.cifarCnn8Forward {ic c1 c2 c3 c4 h w d1 nClasses kH kW : ℕ} (W₁ : Kernel4 c1 ic kH kW) (b₁ : Vec c1) (W₂ : Kernel4 c1 c1 kH kW) (b₂ : Vec c1) (W₃ : Kernel4 c2 c1 kH kW) (b₃ : Vec c2) (W₄ : Kernel4 c2 c2 kH kW) (b₄ : Vec c2) (W₅ : Kernel4 c3 c2 kH kW) (b₅ : Vec c3) (W₆ : Kernel4 c3 c3 kH kW) (b₆ : Vec c3) (W₇ : Kernel4 c4 c3 kH kW) (b₇ : Vec c4) (W₈ : Kernel4 c4 c4 kH kW) (b₈ : Vec c4) (W₉ : Mat (c4 * h * w) d1) (b₉ : Vec d1) (Wa : Mat d1 d1) (ba : Vec d1) (Wb : Mat d1 nClasses) (bb : Vec nClasses) :
                          Vec (ic * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) → Vec nClasses

                          The deeper (8-conv) CIFAR forward, flattened. Four conv→conv→pool stages (ic→c1→c1, c1→c2→c2, c2→c3→c3, c3→c4→c4) then dense 3-head.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def Proofs.cifarCnn8HasVJPAt {ic c1 c2 c3 c4 h w d1 nClasses kH kW : ℕ} (W₁ : Kernel4 c1 ic kH kW) (b₁ : Vec c1) (W₂ : Kernel4 c1 c1 kH kW) (b₂ : Vec c1) (W₃ : Kernel4 c2 c1 kH kW) (b₃ : Vec c2) (W₄ : Kernel4 c2 c2 kH kW) (b₄ : Vec c2) (W₅ : Kernel4 c3 c2 kH kW) (b₅ : Vec c3) (W₆ : Kernel4 c3 c3 kH kW) (b₆ : Vec c3) (W₇ : Kernel4 c4 c3 kH kW) (b₇ : Vec c4) (W₈ : Kernel4 c4 c4 kH kW) (b₈ : Vec c4) (W₉ : Mat (c4 * h * w) d1) (b₉ : Vec d1) (Wa : Mat d1 d1) (ba : Vec d1) (Wb : Mat d1 nClasses) (bb : Vec nClasses) (x : Vec (ic * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))) (hf1 : ∀ (k : Fin (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))), flatConv W₁ b₁ x k ≠ 0) (hf2 : ∀ (k : Fin (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))), flatConv W₂ b₂ ((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x) k ≠ 0) (hp1 : MaxPool2Smooth (Tensor3.unflatten (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x))) (hf3 : ∀ (k : Fin (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w))))), flatConv W₃ b₃ (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x)) k ≠ 0) (hf4 : ∀ (k : Fin (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w))))), flatConv W₄ b₄ ((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x))) k ≠ 0) (hp2 : MaxPool2Smooth (Tensor3.unflatten (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x))))) (hf5 : ∀ (k : Fin (c3 * (2 * (2 * h)) * (2 * (2 * w)))), flatConv W₅ b₅ (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x)))) k ≠ 0) (hf6 : ∀ (k : Fin (c3 * (2 * (2 * h)) * (2 * (2 * w)))), flatConv W₆ b₆ ((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x))))) k ≠ 0) (hp3 : MaxPool2Smooth (Tensor3.unflatten (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x))))))) (hf7 : ∀ (k : Fin (c4 * (2 * h) * (2 * w))), flatConv W₇ b₇ (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x)))))) k ≠ 0) (hf8 : ∀ (k : Fin (c4 * (2 * h) * (2 * w))), flatConv W₈ b₈ ((relu (c4 * (2 * h) * (2 * w)) ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x))))))) k ≠ 0) (hp4 : MaxPool2Smooth (Tensor3.unflatten (((relu (c4 * (2 * h) * (2 * w)) ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x))))))))) (hf9 : ∀ (k : Fin d1), dense W₉ b₉ (maxPoolFlat c4 h w (((relu (c4 * (2 * h) * (2 * w)) ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x)))))))) k ≠ 0) (hfa : ∀ (k : Fin d1), dense Wa ba ((relu d1 ∘ dense W₉ b₉) (maxPoolFlat c4 h w (((relu (c4 * (2 * h) * (2 * w)) ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ flatConv W₁ b₁) x))))))))) k ≠ 0) :
                            HasVJPAt (cifarCnn8Forward W₁ b₁ W₂ b₂ W₃ b₃ W₄ b₄ W₅ b₅ W₆ b₆ W₇ b₇ W₈ b₈ W₉ b₉ Wa ba Wb bb) x

                            Deeper (8-conv) CIFAR CNN (no BN) whole-network VJP at a smooth point. Conditional on the ten ReLU kinks (eight conv, hf1 … hf8; two dense, hf9, hfa) and the four MaxPools (hp1 … hp4); built by vjpCompAt through convRelu×8 / maxPool×4 / denseRelu×2 / dense. The 4-stage sibling of cifarCnnHasVJPAt. No concrete instance of this 4-stage net is proved; Tiny.cifarTinyCnnHasVJPAt is a concrete instance of the 2-stage cifarCnnHasVJPAt with every side condition discharged.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              noncomputable def Proofs.convBnReluPCHasVJPAt {ic oc h w kH kW : ℕ} (W : Kernel4 oc ic kH kW) (b : Vec oc) (ε : ℝ) (γ β : Vec oc) (hε : 0 < ε) (v : Vec (ic * h * w)) (h_smooth : ∀ (k : Fin (oc * h * w)), bnPerChannelTensor3 oc h w ε γ β (flatConv W b v) k ≠ 0) :
                              HasVJPAt (relu (oc * h * w) ∘ bnPerChannelTensor3 oc h w ε γ β ∘ flatConv W b) v

                              conv → per-channel-BN → relu block VJP at a smooth point. The per-channel (bnPerChannelTensor3, m=h·w) sibling of convBnReluHasVJPAt: the same two vjpCompAt chain with bnPerChannelTensor3 (vector γ/β [oc], its own block-diagonal VJP) in place of the scalar-global bnForward.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                noncomputable def Proofs.cifarCnnBn8Forward {ic c1 c2 c3 c4 h w d1 nClasses kH kW : ℕ} (W₁ : Kernel4 c1 ic kH kW) (b₁ : Vec c1) (ε₁ : ℝ) (γ₁ β₁ : Vec c1) (W₂ : Kernel4 c1 c1 kH kW) (b₂ : Vec c1) (ε₂ : ℝ) (γ₂ β₂ : Vec c1) (W₃ : Kernel4 c2 c1 kH kW) (b₃ : Vec c2) (ε₃ : ℝ) (γ₃ β₃ : Vec c2) (W₄ : Kernel4 c2 c2 kH kW) (b₄ : Vec c2) (ε₄ : ℝ) (γ₄ β₄ : Vec c2) (W₅ : Kernel4 c3 c2 kH kW) (b₅ : Vec c3) (ε₅ : ℝ) (γ₅ β₅ : Vec c3) (W₆ : Kernel4 c3 c3 kH kW) (b₆ : Vec c3) (ε₆ : ℝ) (γ₆ β₆ : Vec c3) (W₇ : Kernel4 c4 c3 kH kW) (b₇ : Vec c4) (ε₇ : ℝ) (γ₇ β₇ : Vec c4) (W₈ : Kernel4 c4 c4 kH kW) (b₈ : Vec c4) (ε₈ : ℝ) (γ₈ β₈ : Vec c4) (W₉ : Mat (c4 * h * w) d1) (b₉ : Vec d1) (Wa : Mat d1 d1) (ba : Vec d1) (Wb : Mat d1 nClasses) (bb : Vec nClasses) :
                                Vec (ic * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) → Vec nClasses

                                The 8-conv CIFAR forward with per-channel BatchNorm (bnPerChannelTensor3) between each conv and its ReLU, flattened: four conv→BN→relu→conv→BN→relu→pool stages, then the dense 3-layer head. The BN peer of cifarCnn8Forward.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  noncomputable def Proofs.cifarCnnBn8HasVJPAt {ic c1 c2 c3 c4 h w d1 nClasses kH kW : ℕ} (W₁ : Kernel4 c1 ic kH kW) (b₁ : Vec c1) (ε₁ : ℝ) (γ₁ β₁ : Vec c1) (hε₁ : 0 < ε₁) (W₂ : Kernel4 c1 c1 kH kW) (b₂ : Vec c1) (ε₂ : ℝ) (γ₂ β₂ : Vec c1) (hε₂ : 0 < ε₂) (W₃ : Kernel4 c2 c1 kH kW) (b₃ : Vec c2) (ε₃ : ℝ) (γ₃ β₃ : Vec c2) (hε₃ : 0 < ε₃) (W₄ : Kernel4 c2 c2 kH kW) (b₄ : Vec c2) (ε₄ : ℝ) (γ₄ β₄ : Vec c2) (hε₄ : 0 < ε₄) (W₅ : Kernel4 c3 c2 kH kW) (b₅ : Vec c3) (ε₅ : ℝ) (γ₅ β₅ : Vec c3) (hε₅ : 0 < ε₅) (W₆ : Kernel4 c3 c3 kH kW) (b₆ : Vec c3) (ε₆ : ℝ) (γ₆ β₆ : Vec c3) (hε₆ : 0 < ε₆) (W₇ : Kernel4 c4 c3 kH kW) (b₇ : Vec c4) (ε₇ : ℝ) (γ₇ β₇ : Vec c4) (hε₇ : 0 < ε₇) (W₈ : Kernel4 c4 c4 kH kW) (b₈ : Vec c4) (ε₈ : ℝ) (γ₈ β₈ : Vec c4) (hε₈ : 0 < ε₈) (W₉ : Mat (c4 * h * w) d1) (b₉ : Vec d1) (Wa : Mat d1 d1) (ba : Vec d1) (Wb : Mat d1 nClasses) (bb : Vec nClasses) (x : Vec (ic * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))) (h1 : ∀ (k : Fin (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))), bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ (flatConv W₁ b₁ x) k ≠ 0) (h2 : ∀ (k : Fin (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))), bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ (flatConv W₂ b₂ ((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)) k ≠ 0) (h3 : ∀ (k : Fin (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w))))), bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ (flatConv W₃ b₃ (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))) k ≠ 0) (h4 : ∀ (k : Fin (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w))))), bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ (flatConv W₄ b₄ ((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)))) k ≠ 0) (h5 : ∀ (k : Fin (c3 * (2 * (2 * h)) * (2 * (2 * w)))), bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ (flatConv W₅ b₅ (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))) k ≠ 0) (h6 : ∀ (k : Fin (c3 * (2 * (2 * h)) * (2 * (2 * w)))), bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ (flatConv W₆ b₆ ((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)))))) k ≠ 0) (h7 : ∀ (k : Fin (c4 * (2 * h) * (2 * w))), bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ (flatConv W₇ b₇ (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))))) k ≠ 0) (h8 : ∀ (k : Fin (c4 * (2 * h) * (2 * w))), bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₈ γ₈ β₈ (flatConv W₈ b₈ ((relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)))))))) k ≠ 0) (h_mp1 : MaxPool2Smooth (Tensor3.unflatten (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))) (h_mp2 : MaxPool2Smooth (Tensor3.unflatten (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))) (h_mp3 : MaxPool2Smooth (Tensor3.unflatten (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))))) (h_mp4 : MaxPool2Smooth (Tensor3.unflatten (((relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₈ γ₈ β₈ ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))))))) (h9 : ∀ (k : Fin d1), dense W₉ b₉ (maxPoolFlat c4 h w (((relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₈ γ₈ β₈ ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)))))))) k ≠ 0) (ha : ∀ (k : Fin d1), dense Wa ba ((relu d1 ∘ dense W₉ b₉) (maxPoolFlat c4 h w (((relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₈ γ₈ β₈ ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))))))) k ≠ 0) :
                                  HasVJPAt (cifarCnnBn8Forward W₁ b₁ ε₁ γ₁ β₁ W₂ b₂ ε₂ γ₂ β₂ W₃ b₃ ε₃ γ₃ β₃ W₄ b₄ ε₄ γ₄ β₄ W₅ b₅ ε₅ γ₅ β₅ W₆ b₆ ε₆ γ₆ β₆ W₇ b₇ ε₇ γ₇ β₇ W₈ b₈ ε₈ γ₈ β₈ W₉ b₉ Wa ba Wb bb) x

                                  Deeper (8-conv) CIFAR CNN with per-channel BatchNorm, whole-network VJP at a smooth point. Conditional on 0 < εᵢ (hε₁ … hε₈), the eight post-BN ReLU kinks (h1 … h8), the two dense ReLU kinks (h9, ha), and the four MaxPool conditions (h_mp1 … h_mp4, each a MaxPool2Smooth).

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem Proofs.cifarCnnBn8HasVJPAt_correct {ic c1 c2 c3 c4 h w d1 nClasses kH kW : ℕ} (W₁ : Kernel4 c1 ic kH kW) (b₁ : Vec c1) (ε₁ : ℝ) (γ₁ β₁ : Vec c1) (hε₁ : 0 < ε₁) (W₂ : Kernel4 c1 c1 kH kW) (b₂ : Vec c1) (ε₂ : ℝ) (γ₂ β₂ : Vec c1) (hε₂ : 0 < ε₂) (W₃ : Kernel4 c2 c1 kH kW) (b₃ : Vec c2) (ε₃ : ℝ) (γ₃ β₃ : Vec c2) (hε₃ : 0 < ε₃) (W₄ : Kernel4 c2 c2 kH kW) (b₄ : Vec c2) (ε₄ : ℝ) (γ₄ β₄ : Vec c2) (hε₄ : 0 < ε₄) (W₅ : Kernel4 c3 c2 kH kW) (b₅ : Vec c3) (ε₅ : ℝ) (γ₅ β₅ : Vec c3) (hε₅ : 0 < ε₅) (W₆ : Kernel4 c3 c3 kH kW) (b₆ : Vec c3) (ε₆ : ℝ) (γ₆ β₆ : Vec c3) (hε₆ : 0 < ε₆) (W₇ : Kernel4 c4 c3 kH kW) (b₇ : Vec c4) (ε₇ : ℝ) (γ₇ β₇ : Vec c4) (hε₇ : 0 < ε₇) (W₈ : Kernel4 c4 c4 kH kW) (b₈ : Vec c4) (ε₈ : ℝ) (γ₈ β₈ : Vec c4) (hε₈ : 0 < ε₈) (W₉ : Mat (c4 * h * w) d1) (b₉ : Vec d1) (Wa : Mat d1 d1) (ba : Vec d1) (Wb : Mat d1 nClasses) (bb : Vec nClasses) (x : Vec (ic * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))) (h1 : ∀ (k : Fin (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))), bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ (flatConv W₁ b₁ x) k ≠ 0) (h2 : ∀ (k : Fin (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))), bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ (flatConv W₂ b₂ ((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)) k ≠ 0) (h3 : ∀ (k : Fin (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w))))), bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ (flatConv W₃ b₃ (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))) k ≠ 0) (h4 : ∀ (k : Fin (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w))))), bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ (flatConv W₄ b₄ ((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)))) k ≠ 0) (h5 : ∀ (k : Fin (c3 * (2 * (2 * h)) * (2 * (2 * w)))), bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ (flatConv W₅ b₅ (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))) k ≠ 0) (h6 : ∀ (k : Fin (c3 * (2 * (2 * h)) * (2 * (2 * w)))), bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ (flatConv W₆ b₆ ((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)))))) k ≠ 0) (h7 : ∀ (k : Fin (c4 * (2 * h) * (2 * w))), bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ (flatConv W₇ b₇ (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))))) k ≠ 0) (h8 : ∀ (k : Fin (c4 * (2 * h) * (2 * w))), bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₈ γ₈ β₈ (flatConv W₈ b₈ ((relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)))))))) k ≠ 0) (h_mp1 : MaxPool2Smooth (Tensor3.unflatten (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))) (h_mp2 : MaxPool2Smooth (Tensor3.unflatten (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))) (h_mp3 : MaxPool2Smooth (Tensor3.unflatten (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))))) (h_mp4 : MaxPool2Smooth (Tensor3.unflatten (((relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₈ γ₈ β₈ ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))))))) (h9 : ∀ (k : Fin d1), dense W₉ b₉ (maxPoolFlat c4 h w (((relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₈ γ₈ β₈ ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x)))))))) k ≠ 0) (ha : ∀ (k : Fin d1), dense Wa ba ((relu d1 ∘ dense W₉ b₉) (maxPoolFlat c4 h w (((relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₈ γ₈ β₈ ∘ flatConv W₈ b₈) ∘ relu (c4 * (2 * h) * (2 * w)) ∘ bnPerChannelTensor3 c4 (2 * h) (2 * w) ε₇ γ₇ β₇ ∘ flatConv W₇ b₇) (maxPoolFlat c3 (2 * h) (2 * w) (((relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₆ γ₆ β₆ ∘ flatConv W₆ b₆) ∘ relu (c3 * (2 * (2 * h)) * (2 * (2 * w))) ∘ bnPerChannelTensor3 c3 (2 * (2 * h)) (2 * (2 * w)) ε₅ γ₅ β₅ ∘ flatConv W₅ b₅) (maxPoolFlat c2 (2 * (2 * h)) (2 * (2 * w)) (((relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₄ γ₄ β₄ ∘ flatConv W₄ b₄) ∘ relu (c2 * (2 * (2 * (2 * h))) * (2 * (2 * (2 * w)))) ∘ bnPerChannelTensor3 c2 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) ε₃ γ₃ β₃ ∘ flatConv W₃ b₃) (maxPoolFlat c1 (2 * (2 * (2 * h))) (2 * (2 * (2 * w))) (((relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₂ γ₂ β₂ ∘ flatConv W₂ b₂) ∘ relu (c1 * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w))))) ∘ bnPerChannelTensor3 c1 (2 * (2 * (2 * (2 * h)))) (2 * (2 * (2 * (2 * w)))) ε₁ γ₁ β₁ ∘ flatConv W₁ b₁) x))))))))) k ≠ 0) (dy : Vec nClasses) (i : Fin (ic * (2 * (2 * (2 * (2 * h)))) * (2 * (2 * (2 * (2 * w)))))) :
                                    (cifarCnnBn8HasVJPAt W₁ b₁ ε₁ γ₁ β₁ hε₁ W₂ b₂ ε₂ γ₂ β₂ hε₂ W₃ b₃ ε₃ γ₃ β₃ hε₃ W₄ b₄ ε₄ γ₄ β₄ hε₄ W₅ b₅ ε₅ γ₅ β₅ hε₅ W₆ b₆ ε₆ γ₆ β₆ hε₆ W₇ b₇ ε₇ γ₇ β₇ hε₇ W₈ b₈ ε₈ γ₈ β₈ hε₈ W₉ b₉ Wa ba Wb bb x h1 h2 h3 h4 h5 h6 h7 h8 h_mp1 h_mp2 h_mp3 h_mp4 h9 ha).backward dy i = ∑ j : Fin nClasses, pdiv (cifarCnnBn8Forward W₁ b₁ ε₁ γ₁ β₁ W₂ b₂ ε₂ γ₂ β₂ W₃ b₃ ε₃ γ₃ β₃ W₄ b₄ ε₄ γ₄ β₄ W₅ b₅ ε₅ γ₅ β₅ W₆ b₆ ε₆ γ₆ β₆ W₇ b₇ ε₇ γ₇ β₇ W₈ b₈ ε₈ γ₈ β₈ W₉ b₉ Wa ba Wb bb) x i j * dy j

                                    Public correctness theorem for cifarCnnBn8HasVJPAt — its backward equals the pdiv-contracted Jacobian of cifarCnnBn8Forward at x.