convnextInputGradB is the certified whole-net ConvNeXt-T gradient at a batch #
ConvNeXtWholeBackCertifiedTie.lean proves for one image that convnextInputGrad, the reverse of
convNextForwardTCh, is the certified gradient at that image. The batched step tie
(ConvNeXtStepTieGB.lean) states every activation as StableHLO.batchMap B of the per-example
prefix and every cotangent as batchMapAux B of the per-example chain, because channel LayerNorm
is per-example and no ConvNeXt op couples examples. This file proves the same at that index: the
twelve-stage batched chain convnextInputGradB (ConvNeXtBackChains.lean), every slot the
per-example slot lifted at the batched saved activation, is the certified gradient of
batchMap B convNextForwardTCh at every batch x, for every B and every class count nC.
The forward is convNextForwardTCh: ConvNeXt-T ([3,3,9,3] at 96→192→384→768), without
drop-path, in exact real arithmetic. ConvNeXt is smooth everywhere, so every stage has a global
HasVJP and its batched witness is batchMapHasVJPAt over HasVJP.toHasVJPAt at each row. The
hypotheses are the 23 LayerNorm positivities the per-example tie carries and no smooth-point
condition.
cnxSavedB0 … cnxSavedB10— the eleven batched stage inputs, as reducible functions of the batch saved stage by stage (batchMap B stage ∘ cnxSavedB_{k-1} B w), not asbatchMap Bof the composed per-example prefix: the two agree only up tobatchMap_comp, notrfl, and the apex'svjpCompDiffAtproduces the former. Each is also its apex level's inner map, so the stage witness above it sits atcnxSavedB_k B w xon the nose.- The twelve batched stage witnesses
cnx*BAt, eachbatchMapHasVJPAtover the per-exampleHasVJPat each row, at the dimension spellings the per-example tie normalised (cnxDn1,cnxLNh,cnxSavedA0). - The batched leaf ties. GAP's is
rfl(its per-example tie is); the others arebatchMapAux_eq_batchMapHasVJPAt(or itsbatchMapform for the linear leaves) over the per-example leaf tie at each row. The channel-LN and downsample leaves are proved at variable dims (cnxChanLNBackB_eq_vjp,cnxDownBackB_eq_vjp) and instantiated by term. convNextForwardTChBHasVJPAt— the twelve-stage apex, elevenvjpCompDiffAts over the batched stage witnesses, levelk's inner map namedcnxSavedB_k B w— andconvnextInputGradB_eq_convNextForwardTChB_vjp, the tie: twelve leaf rewrites, then the eleven levels peeled byrw [vjpCompDiffAt_fst_backward].convNextForwardTChB_eq_chain—batchMap Bof the per-example twelve-factor chain is the twelve batched stages, bybatchMap_comp— andconvnextInputGradB_eq_batchMap_convNextForwardTCh_vjp, the tie carried to the global witnessbatchMapHasVJP _ (convNextForwardTChHasVJP …)throughHasVJPAt.backward_unique_of_eq, plus the∑ pdivreading onconvNextForwardTChitself (convnextInputGradB_correct).convnextImagenetInputGradB_eq_vjp— the same statement atnC = 1000,Ba binder.
The batched stem-conv output — the stem LayerNorm's saved input at every example.
Equations
Instances For
Stage 1's batched saved input.
Equations
- Proofs.cnxSavedB1 B w = Proofs.StableHLO.batchMap B (Proofs.chanLNTensor3 96 56 56 w.sε w.sγ w.sβ) ∘ Proofs.cnxSavedB0 B w
Instances For
Downsample 1's batched saved input.
Equations
- Proofs.cnxSavedB2 gf B w = Proofs.StableHLO.batchMap B (Proofs.convNextStageChK gf 3 w.s1) ∘ Proofs.cnxSavedB1 B w
Instances For
Stage 2's batched saved input.
Equations
- Proofs.cnxSavedB3 gf B w = Proofs.StableHLO.batchMap B (Proofs.cnxDn1 w) ∘ Proofs.cnxSavedB2 gf B w
Instances For
Downsample 2's batched saved input.
Equations
- Proofs.cnxSavedB4 gf B w = Proofs.StableHLO.batchMap B (Proofs.convNextStageChK gf 3 w.s2) ∘ Proofs.cnxSavedB3 gf B w
Instances For
Stage 3's batched saved input.
Equations
- Proofs.cnxSavedB5 gf B w = Proofs.StableHLO.batchMap B (Proofs.cnxDn2 w) ∘ Proofs.cnxSavedB4 gf B w
Instances For
Downsample 3's batched saved input.
Equations
- Proofs.cnxSavedB6 gf B w = Proofs.StableHLO.batchMap B (Proofs.convNextStageChK gf 9 w.s3) ∘ Proofs.cnxSavedB5 gf B w
Instances For
Stage 4's batched saved input.
Equations
- Proofs.cnxSavedB7 gf B w = Proofs.StableHLO.batchMap B (Proofs.cnxDn3 w) ∘ Proofs.cnxSavedB6 gf B w
Instances For
The head LayerNorm's batched saved input.
Equations
- Proofs.cnxSavedB9 gf B w = Proofs.StableHLO.batchMap B (Proofs.globalAvgPoolFlat 768 7 7) ∘ Proofs.cnxSavedB8✝ gf B w
Instances For
The classifier's batched saved input.
Equations
- Proofs.cnxSavedB10 gf B w = Proofs.StableHLO.batchMap B (Proofs.cnxLNh w) ∘ Proofs.cnxSavedB9 gf B w
Instances For
The batched stem-conv witness at x.
Equations
- Proofs.cnxStemBAt B w x = Proofs.batchMapHasVJPAt (Proofs.cnxSavedA0 w) x (fun (x_1 : Fin B) => (Proofs.cnxV0 w).toHasVJPAt (Proofs.Mat.unflatten x x_1)) ⋯
Instances For
The batched channel-LayerNorm witness at v, at any c h w.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The batched depth-k stage witness at v — one definition for all four stages.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The batched downsample witness at v, at any resolution and channel pair.
Equations
- Proofs.cnxDownBAt B h w p hε v = Proofs.batchMapHasVJPAt (Proofs.cnxDownChW h w p) v (fun (x : Fin B) => (Proofs.cnxDownChWHasVJP h w p hε).toHasVJPAt (Proofs.Mat.unflatten v x)) ⋯
Instances For
The batched GAP witness at v.
Equations
- Proofs.cnxGapBAt B v = Proofs.batchMapHasVJPAt (Proofs.globalAvgPoolFlat 768 7 7) v (fun (x : Fin B) => (Proofs.globalAvgPoolFlatHasVJP 768 7 7).toHasVJPAt (Proofs.Mat.unflatten v x)) ⋯
Instances For
The batched head-LayerNorm witness at v.
Equations
- Proofs.cnxLNhBAt B w hhε v = Proofs.batchMapHasVJPAt (Proofs.cnxLNh w) v (fun (x : Fin B) => (Proofs.cnxLNhVjp w hhε).toHasVJPAt (Proofs.Mat.unflatten v x)) ⋯
Instances For
The batched classifier witness at v.
Equations
- Proofs.cnxDenseBAt B w v = Proofs.batchMapHasVJPAt (Proofs.dense w.Wd w.bd) v (fun (x : Fin B) => (Proofs.denseHasVJP w.Wd w.bd).toHasVJPAt (Proofs.Mat.unflatten v x)) ⋯
Instances For
The batched stem tie. batchMap B of the reversed-kernel conv at the zero-extended 4×4
kernel IS the lift's backward: flatConvStride4Back_padOdd_eq_vjp_backward at one example's
row. padOdd is required here as in the per-example tie: w.sW is 4×4.
The batched channel-LayerNorm tie, at any c h w — chanLNTensor3Back_eq_chanLN_vjp at
each row. Note: stated at variable dims because an rfl proof at the literal 96 56 56
recursed past maxRecDepth 100000 on the numerals; at variables it is ViT's
vitLNBackB_eq_vjp. The stem instance below is a term.
The batched stage tie — cnxStageChKBack_eq_vjp at one example's row, for every depth.
The batched downsample tie, at any resolution — cnxDownChBack_eq_vjp at one example's
row. Generic for the same reason as cnxChanLNBackB_eq_vjp; the three instances below are
terms at the chain's dimension spellings (cnxDn1 … cnxDn3), which is the per-example tie's
cnxDn1Back_eq_vjp … cnxDn3Back_eq_vjp one batch index over. padOdd is required: p.W is
2×2.
The batched head-LayerNorm tie — cnxLNhBack_eq_vjp at one example's row.
The batched classifier tie — dense_transpose_eq_vjp_backward at one example's row (the
head is linear, so the saved v is free).
The batched whole-net witness, twelve batched stages composed by vjpCompDiffAt, each
at the batched saved activation the chain uses (cnxSavedB0 … cnxSavedB10). Level k's inner
map is named cnxSavedB_k B w rather than left to the unifier, which would fill it with the
composed chain and put every witness at the chain applied to x.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The batched tie. convnextInputGradB with every slot the per-example slot at the
batched saved activation is the backward of convNextForwardTChBHasVJPAt, at every B, nC
and batch x, under the 23 LayerNorm positivities.
The shape check. batchMap B of the per-example twelve-factor chain — the function
convNextForwardTChHasVJP is stated on — IS the twelve batched stages the apex is stated
on: batchMap_comp eleven times, and the normalised spellings (cnxLNh, cnxDn1 … cnxDn3,
cnxSavedA0) unfold to the chain's.
The batched apex at the global witness. convnextInputGradB is
(batchMapHasVJP _ (convNextForwardTChHasVJP …) …).backward x — the certified gradient of
the drop-free per-example ConvNeXt-T forward lifted over B examples, for every B, every
nC and every batch x. The hypotheses are the 23 LayerNorm positivities. Carried from the
chain-shaped apex by HasVJPAt.backward_unique_of_eq along convNextForwardTChB_eq_chain.
The batched apex, read as the Jacobian of the committed forward. convnextInputGradB is
the pdiv-contracted Jacobian transpose of batchMap B (convNextForwardTCh w) — the
nested-application forward the graph faithfulness convNextFwdGraphTCh_faithful is about —
at EVERY batch and EVERY cotangent, through convNextForwardTCh_eq_chain.
ConvNeXt-T's batched whole-net backward tie at the ImageNet head.
convnextInputGradB_eq_batchMap_convNextForwardTCh_vjp at nC = 1000, the class count of the
convnextin_* (ConvNeXt-T) artifacts, at a variable batch B (64 per device in those
artifacts). The dims are ConvNeXt-T's (3×224², [3,3,9,3] at 96→192→384→768). The forward
is the drop-free convNextForwardTCh in exact arithmetic: the drop-path (*drop*) artifacts
and ConvNeXt-S/B (convnextsin_*, convnextbin_*) compute other functions and are not
covered. The batched peers of the other nets are r34InputGradB_eq_r34B_full_vjp,
mnv2InputGradB_eq_mobilenetv2B_full_vjp and vitTinyInputGradB_eq_vitTiny_vjp.