Gerver sofa: related certificate and semantic modules #
GerverSofa.KernelOnly.Foundation.Batch002.
Gerver sofa dependency batch #
KernelOnly.LeanCertGerverData.KernelOnly.LeanCertNamedConstAD.KernelOnly.LeanCertGerverExpr.KernelOnly.LeanCertGerverCorrespondence.KernelOnly.LeanCertNoDetKrawczyk.KernelOnly.LeanCertGerverNumericsCore.
Part A final adapter data #
The original Gerver boxes are affinely normalized to [-1,1]^n.
If x = m + D u, then the preconditioner is transformed from C to
D⁻¹ C. Consequently
I - (D⁻¹ C) (J_F(x) D) = D⁻¹ (I - C J_F(x)) D,
so the old weighted sup-norm contraction becomes the ordinary infinity norm used by LeanCert.
The preconditioner literals below are exact public copies of the frozen
rational data already used by ExactReplay. This avoids exposing private
helpers during simplification.
Construct an exact rational from an integer numerator and natural denominator.
Equations
- GerverSofa.PartALeanCert.q n d = ↑n / ↑d
Instances For
The rational preconditioner table for the four reduced equations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The rational preconditioner table for the twenty-two full equations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Interpret rational row lists as a square matrix, using zero for missing entries.
Equations
- GerverSofa.PartALeanCert.listMatrix rows i j = GerverSofa.ExactReplay.getQ (GerverSofa.ExactReplay.getRow rows ↑i) ↑j
Instances For
The rational midpoint of a selected interval coordinate.
Equations
- GerverSofa.PartALeanCert.boxMid box i = ((GerverSofa.ExactReplay.getI box i).lo + (GerverSofa.ExactReplay.getI box i).hi) / 2
Instances For
Half the width of a selected rational interval coordinate.
Equations
- GerverSofa.PartALeanCert.boxRad box i = ((GerverSofa.ExactReplay.getI box i).hi - (GerverSofa.ExactReplay.getI box i).lo) / 2
Instances For
Map normalized coordinates to the given box using its midpoints and radii.
Equations
- GerverSofa.PartALeanCert.affineFromBox box u i = ↑(GerverSofa.PartALeanCert.boxMid box ↑i) + ↑(GerverSofa.PartALeanCert.boxRad box ↑i) * u i
Instances For
Subtract each box midpoint and divide by its coordinate radius.
Equations
- GerverSofa.PartALeanCert.normalizeToBox box x i = (x i - ↑(GerverSofa.PartALeanCert.boxMid box ↑i)) / ↑(GerverSofa.PartALeanCert.boxRad box ↑i)
Instances For
The coordinate box with interval [-1, 1] in every dimension.
Equations
- GerverSofa.PartALeanCert.unitBox x✝ = { lo := -1, hi := 1, le := GerverSofa.PartALeanCert.unitBox._proof_1 }
Instances For
The rational origin used as the normalized Newton center.
Equations
Instances For
Rescale each preconditioner row by the inverse box radius.
Equations
- GerverSofa.PartALeanCert.scaledPreconditioner box rows i j = (GerverSofa.PartALeanCert.boxRad box ↑i)⁻¹ * GerverSofa.PartALeanCert.listMatrix rows i j
Instances For
The preconditioner for the normalized four-dimensional system.
Equations
Instances For
The preconditioner for the normalized twenty-two-dimensional system.
Equations
Instances For
Map the normalized unit box into the reduced parameter box.
Equations
Instances For
Map the normalized unit box into the full Romik parameter box.
Equations
Instances For
Convert reduced parameter coordinates to normalized box coordinates.
Equations
Instances For
A deliberately generous verified contraction target.
The legacy exact bounds are ~5.2e-13 (4D) and ~8.6e-11 (22D), so 1/100
leaves many orders of magnitude of slack while keeping the normalized self-map
well inside the unit box.
Equations
- GerverSofa.PartALeanCert.qTarget = 1 / 100
Instances For
Minimal named-constant extension of LeanCert's AD soundness layer #
LeanCert's computable total dual evaluator already evaluates
Expr.namedConst c as DualInterval.ofMathConst c, whose derivative component
is the singleton interval {0}. Its public ADSupported predicate, however,
does not currently include namedConst.
The Gerver systems necessarily contain the exact constant Real.pi. This file
adds exactly one missing syntactic case -- differentiable named mathematical
constants -- while reusing LeanCert's existing evaluator, interval Jacobian,
matrix norm machinery, Newton map, and contraction theorem unchanged.
No interval arithmetic is reimplemented here.
The LeanCert AD fragment plus named mathematical constants. Every constructor here is everywhere differentiable.
- const (q : ℚ) : ADConstSupported (LeanCert.Core.Expr.const q)
- var (idx : ℕ) : ADConstSupported (LeanCert.Core.Expr.var idx)
- add {a b : LeanCert.Core.Expr} : ADConstSupported a → ADConstSupported b → ADConstSupported (a.add b)
- mul {a b : LeanCert.Core.Expr} : ADConstSupported a → ADConstSupported b → ADConstSupported (a.mul b)
- neg {a : LeanCert.Core.Expr} : ADConstSupported a → ADConstSupported a.neg
- exp {a : LeanCert.Core.Expr} : ADConstSupported a → ADConstSupported a.exp
- sin {a : LeanCert.Core.Expr} : ADConstSupported a → ADConstSupported a.sin
- cos {a : LeanCert.Core.Expr} : ADConstSupported a → ADConstSupported a.cos
- namedConst (c : LeanCert.Core.MathConst) : ADConstSupported (LeanCert.Core.Expr.namedConst c)
Instances For
Computable recognition of the exact fragment used by the Gerver models.
Equations
- GerverSofa.PartALeanCert.checkADConstSupported (LeanCert.Core.Expr.const q) = true
- GerverSofa.PartALeanCert.checkADConstSupported (LeanCert.Core.Expr.var idx) = true
- GerverSofa.PartALeanCert.checkADConstSupported (LeanCert.Core.Expr.namedConst c) = true
- GerverSofa.PartALeanCert.checkADConstSupported (a.add b) = (GerverSofa.PartALeanCert.checkADConstSupported a && GerverSofa.PartALeanCert.checkADConstSupported b)
- GerverSofa.PartALeanCert.checkADConstSupported (a.mul b) = (GerverSofa.PartALeanCert.checkADConstSupported a && GerverSofa.PartALeanCert.checkADConstSupported b)
- GerverSofa.PartALeanCert.checkADConstSupported a.neg = GerverSofa.PartALeanCert.checkADConstSupported a
- GerverSofa.PartALeanCert.checkADConstSupported a.exp = GerverSofa.PartALeanCert.checkADConstSupported a
- GerverSofa.PartALeanCert.checkADConstSupported a.sin = GerverSofa.PartALeanCert.checkADConstSupported a
- GerverSofa.PartALeanCert.checkADConstSupported a.cos = GerverSofa.PartALeanCert.checkADConstSupported a
- GerverSofa.PartALeanCert.checkADConstSupported x✝ = false
Instances For
Dual-evaluator domain validity is likewise automatic for this fragment.
Calculus layer #
LeanCert's computable total AD derivative theorem, extended by the single
missing namedConst case. The computed interval is unchanged.
Krawczyk calculus adapters retaining LeanCert's data path #
LeanCert expression models for the normalized Gerver systems #
These expressions use LeanCert's differentiable AD fragment plus exact
named mathematical constants. LeanCertNamedConstAD supplies the one
missing soundness case for namedConst (derivative zero).
The expression syntax interpreted by the certified interval evaluator.
Instances For
A rational constant expression.
Equations
Instances For
An indexed variable expression.
Equations
Instances For
Construct the sum of two expressions.
Equations
Instances For
Construct the negation of an expression.
Equations
Instances For
Construct a difference using addition and negation.
Equations
Instances For
Construct the product of two expressions.
Equations
Instances For
Multiply an expression by a rational constant.
Equations
Instances For
Apply sine in the expression syntax.
Equations
Instances For
Apply cosine in the expression syntax.
Equations
Instances For
The named π constant in the expression syntax.
Instances For
An expression for a box coordinate in terms of its normalized variable.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reduced 4D #
The four reduced equations encoded as evaluator expressions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Select an equation from the reduced four-dimensional expression system.
Equations
Instances For
Direct 22D #
A full Romik parameter encoded as a normalized variable expression.
Equations
Instances For
The expression for the first switching angle φ.
Instances For
The expression for the second switching angle θ.
Instances For
The expression for the reflected angle π/2 - θ.
Equations
Instances For
Encode the world-frame derivative of a selected path branch.
Equations
Instances For
The twenty-two full equations encoded as evaluator expressions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Select one equation from the full Romik expression system.
Equations
Instances For
Purely syntactic support checks for the Gerver expression fragment.
Gerver Sofa / Kernel Only / Lean Cert Gerver Correspondence #
LeanCert's named π has exactly Mathlib's real value.
Reduced semantic correspondence.
Full 22D semantic correspondence through the already proved public
fullDualOutput_model_eq. This avoids unfolding the private pathPrime helper.
Box transport #
Determinant-free checked Krawczyk endgame #
For a square system, the usual explicit determinant test on the preconditioner
is redundant once ‖I - YJ‖ < 1 is known: at any point in the box,
YJ = 1 - T with ‖T‖ < 1, hence YJ is a unit by the Neumann-series
theorem. Therefore Y is surjective, hence injective in finite dimension.
This matters computationally in dimension 22 because Mathlib's generic Leibniz determinant is the wrong algorithm for a huge exact rational matrix.
Kernel-reducible finite interval sums #
LeanCert's public intervalRatMatVec uses Finset.sum with a local
proof-transported AddCommMonoid IntervalRat. That is semantically sound, but
closed decide +kernel computations can get stuck reducing the transported
typeclass instance.
We keep LeanCert's interval operations and mathematical semantics, but package
this one finite sum by structural recursion on Fin n. Mathlib's existing
Fin.sum_univ_succ is the semantic bridge to the ordinary real finite sum.
A finite interval sum that reduces by structural recursion, with no
AddCommMonoid IntervalRat instance involved in computation.
Equations
Instances For
Semantic soundness of the kernel-reducible finite interval sum.
Kernel-reducible exact interval matrix-vector product.
Equations
- GerverSofa.PartALeanCert.kernelIntervalRatMatVec Y v i = GerverSofa.PartALeanCert.kernelIntervalFinSum fun (j : Fin n) => LeanCert.Core.IntervalRat.scale (Y i j) (v j)
Instances For
Kernel-reducible point values at the Newton center #
LeanCert's ordinary rational evaluator uses sinComputableReduced and
cosComputableReduced. Those are mathematically excellent general-purpose
routines, but their period-reduction step computes a rational floor. On the
closed Gerver certificates that floor can prevent decide +kernel from
normalizing an otherwise entirely rational proposition.
For the exact Gerver expression fragment (ADConstSupported) we therefore use
a tiny point evaluator that is identical on algebraic operations and named
constants, but calls the already-proved unreduced Taylor enclosures
sinComputable and cosComputable. These enclosures are globally sound for
arbitrary real arguments; argument reduction is an optimization, not a
soundness requirement. This keeps the Newton-center calculation purely in
kernel-reducible rational arithmetic without changing the mathematical map.
A kernel-reducible interval for π, using the exact project interval
whose semantic soundness is already proved in TranscendentalSoundness.
The generic LeanCert MathConst.interval route is mathematically sound, but
its named-constant machinery does not always normalize far enough for closed
decide +kernel comparisons. Reusing the project's already-certified exact
rational π endpoints removes only that reduction bottleneck; it does not
change the represented real constant or weaken any enclosure.
Equations
Instances For
The true real π lies in the kernel-reducible π interval.
Named constants for the point evaluator. π takes the specialized kernel-reducible path; every other LeanCert named constant keeps LeanCert's public certified interval unchanged.
Equations
Instances For
Point evaluator for the everywhere-defined Gerver expression fragment.
Unsupported constructors are deliberately mapped to {0}; the soundness
lemma below is only stated for ADConstSupported, whose constructors are all
handled explicitly.
Equations
- GerverSofa.PartALeanCert.kernelPointEvalCore (LeanCert.Core.Expr.const q) ρ depth = LeanCert.Core.IntervalRat.singleton q
- GerverSofa.PartALeanCert.kernelPointEvalCore (LeanCert.Core.Expr.var idx) ρ depth = ρ idx
- GerverSofa.PartALeanCert.kernelPointEvalCore (a.add b) ρ depth = (GerverSofa.PartALeanCert.kernelPointEvalCore a ρ depth).add (GerverSofa.PartALeanCert.kernelPointEvalCore b ρ depth)
- GerverSofa.PartALeanCert.kernelPointEvalCore (a.mul b) ρ depth = (GerverSofa.PartALeanCert.kernelPointEvalCore a ρ depth).mul (GerverSofa.PartALeanCert.kernelPointEvalCore b ρ depth)
- GerverSofa.PartALeanCert.kernelPointEvalCore a.neg ρ depth = (GerverSofa.PartALeanCert.kernelPointEvalCore a ρ depth).neg
- GerverSofa.PartALeanCert.kernelPointEvalCore a.exp ρ depth = (GerverSofa.PartALeanCert.kernelPointEvalCore a ρ depth).expComputable depth
- GerverSofa.PartALeanCert.kernelPointEvalCore a.sin ρ depth = (GerverSofa.PartALeanCert.kernelPointEvalCore a ρ depth).sinComputable depth
- GerverSofa.PartALeanCert.kernelPointEvalCore a.cos ρ depth = (GerverSofa.PartALeanCert.kernelPointEvalCore a ρ depth).cosComputable depth
- GerverSofa.PartALeanCert.kernelPointEvalCore (LeanCert.Core.Expr.namedConst c) ρ depth = GerverSofa.PartALeanCert.kernelNamedConstInterval c
- GerverSofa.PartALeanCert.kernelPointEvalCore e ρ depth = LeanCert.Core.IntervalRat.singleton 0
Instances For
Soundness of the kernel-reducible point evaluator on exactly the Gerver fragment. In the sine/cosine cases this uses LeanCert's global Taylor correctness theorems directly, so no period-reduction hypothesis is needed.
Taylor depth used only for the Newton-center point values.
The reduced system has coordinates at scale about 10^-15; the 22D system
contains substantially thinner coordinates. Depth 26 is the smallest retained value after an
exact-rational replay of all
22 normalized Newton-center images that still leaves the direct self-map
strictly inside the unit box. It materially reduces kernel rational size
compared with depth 27/34 while leaving the Jacobian evaluator and its
already-passing certificates untouched.
Instances For
Point-value enclosures for a square system at a rational center.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every real system coordinate at the rational center lies in the kernel-reducible point enclosure.
Kernel-reducible version of LeanCert's Newton-center enclosure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The real Newton center lies in the kernel-reducible enclosure.
Same checked self-map enclosure as before, now with a kernel-reducible finite interval sum at the Newton center.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Cached Newton-center values for large closed systems #
For the direct 22D Gerver certificate, recomputing all 22 transcendental point values inside every image-row proposition creates a very large kernel reduction. The following variant accepts independently checked point-value enclosures. It changes no mathematics: each cached interval is accompanied by a kernel proof that the corresponding real system value lies in it.
Endpoint inclusion between two rational intervals.
Instances For
Newton-center enclosure from externally supplied, proof-carrying point value intervals.
Equations
Instances For
Self-map enclosure built from independently certified center values.
Equations
- One or more equations did not get rendered due to their size.
Instances For
LeanCert Gerver numerical core #
Only shared definitions and lightweight list lemmas live here. The expensive 22D kernel checks are split into one Lake module per row.
The default evaluation configuration used for the numerical certificates.
Equations
Instances For
The interval enclosure of the normalized reduced Newton-map derivative.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The interval enclosure of the normalized full Newton-map derivative.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Proof-carrying cache for the 22 Newton-center residuals #
These deliberately simple rational intervals are much wider than the actual point residuals, but still narrow enough after the scaled preconditioner to leave a large self-map margin. Each coordinate is checked independently in a separate module before it is used by the final contraction theorem.
Cached interval evaluations of the full system at the normalized center.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Select a cached center evaluation of a full-system equation.
Equations
Instances For
The full Newton image enclosure computed with cached center evaluations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The reduced Newton image enclosure on the normalized unit box.
Equations
- One or more equations did not get rendered due to their size.