TorchLean API

NN.MLTheory.CROWN.Proofs.GraphCertSoundness.NonlinearOps

Nonlinear IBP Soundness Lemmas #

Monotonicity and Lipschitz facts for the nonlinear graph operations handled by the IBP certificate soundness theorem.

Sigmoid monotonicity (via Mathlib’s Real.sigmoid) #

Our Activation.Math.sigmoid_spec definition over is exactly the Mathlib sigmoid function. So we can reuse its monotonicity lemma.

Monotonicity of the real sigmoid used by graph IBP certificates.

Tanh monotonicity (proved from calculus in Mathlib) #

Mathlib does not expose a Real.tanh_monotone lemma under that name. We prove it here:

  1. Use the identity tanh x = sinh x / cosh x.
  2. Differentiate the quotient, using d/dx sinh = cosh and d/dx cosh = sinh.
  3. Simplify the derivative using cosh^2 - sinh^2 = 1.
  4. Conclude strict monotonicity from deriv > 0, hence monotonicity.

Derivative of real tanh, stated in the form needed for monotonicity.

Soundness of Runtime.Ops.IBP.map_minmax for monotone scalar functions #

Runtime.Ops.IBP.sigmoid and Runtime.Ops.IBP.tanh are defined using map_minmax. If the activation is monotone, then the min/max of the endpoints is a correct enclosure.

Soundness of the 1-Lipschitz sin/cos enclosures #

Runtime.Ops.IBP.sin / Runtime.Ops.IBP.cos use a midpoint enclosure with radius r=(u-l)/2, clamped to [-1,1]. This avoids periodic case splits while remaining sound.