Verified Deep Learning with Lean 4

4 CNN: Convolution and Pooling

Axiom 37 Conv2d forward
#

Opaque function declaration. Codegen provides the actual stablehlo.convolution; proofs reason about it as a black box.

Axiom 38 Conv2d input VJP
#

Reversed-kernel convolution formula, numerically gradient-checked.

Axiom 39 Conv2d weight VJP
#

Phase 7: the transpose-trick formula via Kernel4.flatten.

Axiom 40 Conv2d bias VJP
#

Phase 9: sum cotangent over spatial dims per channel.

Axiom 41 MaxPool 2x2 stride 2 forward
#
Axiom 42 MaxPool input VJP
#

Routes gradient to the argmax position within each pooling window.