KernelCert is a small, demonstrative Coq formalization of a Neural Tangent Kernel (NTK) and related concepts. This repository is part of a continuing series exploring formal proofs in machine learning and quantum computing. Each section is self-contained and focuses on a specific topic.
This section isolates the core empirical NTK idea:
an NTK can be written as a Jacobian-feature inner product.
This Coq project proves a tiny but useful slice of NTK theory:
- A finite-dimensional feature-map kernel [ K_\phi(x, y) = \langle \phi(x), \phi(y) \rangle ] is symmetric.
- Its finite Gram quadratic form is nonnegative, i.e. it is positive semidefinite in the standard kernel sense.
- For a scalar affine network [ f_{(w,b)}(x) = wx + b, ] the parameter-Jacobian feature is [ \phi(x) = (x, 1), ] so the induced NTK is [ K(x,y) = xy + 1. ]
- A width-indexed NTK family converges pointwise to a limiting kernel under eventual feature stability (formalized in
pointwise_limit_of_width_kernels). - If the Jacobian feature is parameter-independent, the NTK is constant across training time indices.
- A polynomial Jacobian-map case study is embedded as an NTK feature source: the map is defined in Coq, the listed four preimages are proved to share the image
(1,0,0), and the induced projected NTK inherits symmetry/PSD/convergence/constancy results from the core theory.
This is intentionally small and illustrative. It gives a concrete formal proof of the Jacobian-contraction picture, extends it with an explicit infinite-width convergence layer, and captures a training-time constancy theorem for parameter-independent Jacobians.
The NTK of a model is the inner product of output derivatives with respect to parameters. For a scalar-output network f(θ, x), the empirical NTK is
[ K(x,y) = \left\langle \nabla_\theta f(\theta, x), \nabla_\theta f(\theta, y) \right\rangle. ]
In the infinite-width regime this kernel can become nearly constant during training, which is one of the key reasons NTKs are useful in theory: gradient descent can then be approximated by kernel regression dynamics. This repository includes a formal pointwise convergence theorem for width-indexed NTKs under eventual feature stability assumptions.
In practice, empirical NTKs are often computed by contracting Jacobians. This repository formalizes that core algebraic idea in the smallest setting where the proof is easy to read:
- a 2-dimensional parameter space,
- a scalar affine model,
- an exact closed-form kernel,
- and a proof that every finite Gram quadratic form is nonnegative.
theories/NTK/Core.v: general finite-feature kernel machinery over 2D real features, including:- symmetry of
kernel_of, - an explicit Jacobian-feature contraction theorem,
- a Gram/quadratic-form identity,
- nonnegativity of the induced quadratic form.
- symmetry of
theories/NTK/Asymptotic.v: asymptotic NTK statements, including:- an infinite-width convergence theorem from eventual feature stability,
- a training-time NTK constancy theorem from parameter-independent Jacobians.
theories/NTK/Affine.v: the affine network instance with feature(x, 1)and closed-form NTKxy + 1, plus concrete instantiations of the convergence and constancy theorems.theories/NTK/JacobianMap.v: a polynomial Jacobian-map case study that:- defines
t = 1 + xy,q = t^2 z + y^2 (1 + 3t), and the 3D polynomial map, - proves the four stated points map to
(1,0,0), - projects map components into a 2D NTK feature and reuses core symmetry/PSD/asymptotic theorems.
- defines
theories/NTK/Examples.v: tiny sanity-check examples, including a direct demonstration of the Jacobian-feature contraction identity.
If Coq is installed, build the project from this directory with:
make ntkTo build both NTK and Quantum proof targets together:
make allTo clean generated Coq artifacts:
make cleanThis section introduces a formalization of quantum neural tangent kernel concepts, focusing on the physical principles of superposition and entanglement. The goal is to provide a rigorous foundation for quantum-kernel reasoning in the context of machine learning.
- Fault Tolerance: A compact formal statement showing that a QNTK estimate remains bounded under a small circuit error rate.
- Scalability to Large Quantum Systems: A simple linear-growth argument showing that a QNTK estimate scales predictably with increased system size.
theories/Quantum/KernelProof.v: a compact proof layer for fault tolerance and scalability properties of a quantum neural tangent kernel estimate, including a basic formalization of those two design goals.
If Coq is installed, build the project from this directory with:
make quantumTo clean generated Coq artifacts:
make cleanThis project remains a pedagogical artifact focused on foundational principles, compiler-style formalization, and basic quantum-kernel reasoning rather than a complete production-grade quantum machine learning stack.
This section documents a formal, machine-checkable roadmap around the Riemann Hypothesis (RH). It does not claim an unconditional proof of RH. Instead, it encodes a conditional closure structure:
- Gap A (rigid test-function framework) is represented as a closed component in the roadmap logic.
- Gap B (uniform stability/remainder bounds) is represented as an explicit assumption.
- Gap C (Hilbert-Polya style spectral/operator closure) is represented as an explicit assumption.
- From A+B+C, the final RH target is derived conditionally.
-
A Coq module that defines abstract closure assumptions for the three-gap pipeline.
-
A machine-checked theorem that packages the dependency graph:
Gap A + Gap B + Gap C -> RH
-
A bundled theorem form suitable for CI checks and incremental formalization.
theories/Riemann/Roadmap.v: machine-checkable logical skeleton for conditional RH closure, including:- abstract assumptions for Gap A/B/C,
- intermediate propositions (
NoOffLineZeros,SpectralReality), - final conditional theorem
conditional_rh_closure.
riemann_hypothesis.tex: mathematical draft detailing the theorem/lemma roadmap and open obligations.
If Coq is installed, build the roadmap target with:
make riemannTo build all Coq targets currently wired in the Makefile:
make allTo compile the RH draft document (requires pdflatex):
make rh-pdfThis subproject is licensed under the MIT License. See LICENSE.