Kernel-checked affine covering certificates #
This module is the arithmetic trust boundary for the external cone-covering
kernel. An affine form has integral coefficients and is evaluated only on an
integral point. A cone is a finite conjunction of inequalities a(x) >= 0.
The external program may emit a passive contradiction tree. Branching on a
form a adds its exact integral complement
-a(x) - 1 >= 0.
Leaves carry sparse rational Farkas multipliers. The executable checker verifies their signs, the vanishing of every variable coefficient, and a strictly negative constant sum. The soundness theorem proves that an accepted tree covers every integral point of the advertised base region by at least one advertised cone. No linear-programming algorithm is trusted or implemented here.
Row numbering agrees directly with the external C emitter: base-region rows come first, followed by asserted violation rows in root-to-leaf branch order. Thus a branch extends the active row list by appending its violation, rather than prepending it.
This layer deliberately gives no graph, subdivision, or divisor semantics to the cones. Those belong in a separate local-certificate checker.
Proof-free finite Boolean folds #
Boolean universal quantification over an arbitrary finite set. Finset.fold
keeps kernel evaluation proof-free even when the element type itself is a
finite combinatorial object such as Finset (Fin n).
Equations
- Utilities.Certificate.AffineCover.allFinset elements test = Finset.fold (fun (left right : Bool) => left && right) true test elements
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Proof-free extensional equality for integral affine forms. In particular,
this avoids asking Decidable to construct an equality proof between two
function-valued coefficient fields while a large generated certificate is
being reduced by the kernel.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Proof-free list membership for integral affine forms.
Equations
- form.mem forms = forms.any fun (candidate : Utilities.Certificate.AffineCover.AffineForm m) => form.equal candidate
Instances For
Evaluation of an integral affine form at an integral point.
Equations
- form.eval point = form.fixedValue + ∑ i : Fin m, form.coefficient i * point i
Instances For
The exact closed complement of form.Holds on integral points.
If a(x) >= 0 fails and a(x) is integral, then a(x) <= -1, equivalently
-a(x)-1 >= 0.
Equations
- form.violation = { fixedValue := -form.fixedValue - 1, coefficient := fun (i : Fin m) => -form.coefficient i }
Instances For
Rational evaluation, used only in the proof of Farkas soundness.
Equations
- form.evalRat point = ↑form.fixedValue + ∑ i : Fin m, ↑(form.coefficient i) * ↑(point i)
Instances For
A finite conjunction of affine inequalities. This is used for base regions and for individual proof cones.
Equations
- Utilities.Certificate.AffineCover.FormsHold forms point = ∀ form ∈ forms, form.Holds point
Instances For
A family of cones covers a base region at every integral point.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Passive sparse Farkas data. Repeated row indices are permitted.
- terms : List FarkasTerm
The ordered sparse row multipliers of the proposed Farkas combination; repeated indices are allowed.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Look up an affine row, returning the zero form when the index is out of range.
Equations
- Utilities.Certificate.AffineCover.FarkasData.rowAt rows index = rows.getD index 0
Instances For
Sum of the constant coefficients in the proposed Farkas combination.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Sum of one variable coefficient in the proposed Farkas combination.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Mathematical validity of sparse Farkas data for the displayed rows.
Equations
Instances For
Whether every sparse multiplier is integral. External emitters may always clear denominators within one homogeneous Farkas contradiction.
Equations
- data.integralWeights = data.terms.all fun (term : Utilities.Certificate.AffineCover.FarkasTerm) => decide (term.weight.den = 1)
Instances For
Integer coefficient sum used by the kernel-reduction fast path.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Integer constant sum used by the kernel-reduction fast path.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Proof-free arithmetic replay for a leaf whose multipliers have denominator one. Unlike rational multiplication and addition, these integer operations are transparent to ordinary kernel reduction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
General rational checker retained as the fallback for hand-written or legacy certificates whose denominators have not been cleared.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Executable exact checker for a Farkas leaf. Integral multipliers take a kernel-transparent fast path; arbitrary rationals retain the original exact checker.
Equations
- data.check rows = match data.integralWeights with | true => data.integralCheck rows | false => data.rationalCheck rows
Instances For
A valid Farkas leaf proves that its current affine region is empty.
Passive contradiction tree emitted by an external covering search.
branch cone arity children has one child for every form of the named cone;
the checker adds that form's exact integral violation in the corresponding
child. skip mirrors the external kernel's shared-form compression, while
empty closes immediately when one advertised cone has no inequalities.
Active rows are ordered exactly as the C certificate numbers them: the base rows first, then branch violations appended in root-to-leaf order.
- leaf {m : ℕ} (farkas : FarkasData) : CoverTree m
- empty {m : ℕ} (cone : ℕ) : CoverTree m
- skip {m : ℕ} (cone form : ℕ) (next : CoverTree m) : CoverTree m
- branch {m : ℕ} (cone arity : ℕ) (children : Fin arity → CoverTree m) : CoverTree m
Instances For
Look up a cone in the cover table, returning an empty cone for an out-of-range index.
Equations
- Utilities.Certificate.AffineCover.CoverTree.coneAt cones index = cones.getD index []
Instances For
Look up an affine constraint in a cone, returning the zero form for an out-of-range index.
Equations
- Utilities.Certificate.AffineCover.CoverTree.formAt cone index = cone.getD index 0
Instances For
Mathematical validity of a contradiction tree under the currently active affine rows.
Equations
- One or more equations did not get rendered due to their size.
- Utilities.Certificate.AffineCover.CoverTree.Valid cones active (Utilities.Certificate.AffineCover.CoverTree.leaf farkas) = farkas.Valid active
Instances For
Recursive Boolean replay of a contradiction tree under active rows.
Equations
- One or more equations did not get rendered due to their size.
- Utilities.Certificate.AffineCover.CoverTree.checkActive cones active (Utilities.Certificate.AffineCover.CoverTree.leaf farkas) = farkas.check active
Instances For
Executable exact checker for a complete covering tree.
Equations
- tree.check base cones = Utilities.Certificate.AffineCover.CoverTree.checkActive cones base tree
Instances For
Soundness of the passive checker: an accepted contradiction tree proves integral coverage of the base region by the advertised union of cones.
Proof-carrying cone reduction #
The search layer is allowed to delete an inequality from a local proof cone when that inequality follows from the base region and the other inequalities still present at that stage. This can make the global covering tree orders of magnitude smaller. It must not, however, enlarge the trusted interface.
Every deletion therefore carries a Farkas contradiction for
base ++ remaining ++ [violation removed].
The checker below replays those contradictions. Its soundness theorem runs the deletion chain backwards: the final reduced cone implies the last deleted row, then the preceding row, and eventually the complete original local cone.
Passive data for one proof-carrying deletion from a cone.
- removed : AffineForm m
The affine row proposed for deletion from the current cone.
- farkas : FarkasData
The Farkas data intended to certify that deleting this row preserves the required implication.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
A sequence of row deletions used to reduce a local proof cone.
- steps : List (ReductionStep m)
The ordered row-deletion steps of the reduction, each carrying its proposed Farkas justification.
Instances For
Equations
Instances For
The cone left after applying all named deletions. A missing row makes the
chain structurally invalid and returns none.
Equations
- One or more equations did not get rendered due to their size.
- Utilities.Certificate.AffineCover.ReductionChain.resultRows x✝ [] = some x✝
Instances For
Mathematical validity of rows deleted in the exact forward order in which they disappear from the cone.
Equations
- One or more equations did not get rendered due to their size.
- Utilities.Certificate.AffineCover.ReductionChain.ValidRows base x✝ [] = True
Instances For
Mathematical validity of every deletion in a chain.
Equations
- chain.Valid base full = Utilities.Certificate.AffineCover.ReductionChain.ValidRows base full chain.steps
Instances For
Boolean replay of row deletions from rows down to the claimed result.
Equations
Instances For
Executable exact replay of a reduction chain, including its claimed final reduced cone.
Equations
- chain.check base full reduced = Utilities.Certificate.AffineCover.ReductionChain.checkRows base reduced full chain.steps
Instances For
Soundness of a valid deletion chain: if the final rows hold in the base region, then every row of the original local proof cone holds.
A successful Boolean reduction replay proves the semantic implication from the reduced search cone back to the full local proof cone.
Small closed examples #
The affine form constant + a*x.
Equations
Instances For
The affine form constant + a*x + b*y.
Equations
Instances For
The two cones x-y >= 1 and y-x >= 0. Their use of constants -1
and 0 is the strict integer partition required by the C kernel grammar.
Equations
Instances For
If both one-row cones were violated, the active rows would be
x-y-1 >= 0 and y-x >= 0; adding them gives -1 >= 0.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Kernel-checked exact coverage of every integral pair by the strict
partition x-y >= 1 or y-x >= 0.
A direct human-readable specialization of strictPartitionCovers.
The base row x - 1 >= 0 implies the local row x >= 0. The reduction
step checks this by contradicting -x - 1 >= 0; adding the two active rows
gives the impossible constant -2.
The base constraint x - 1 ≥ 0 in the one-variable implication-reduction example.
Equations
Instances For
The redundant constraint x ≥ 0 that the example deletes using its stronger base
constraint.
Equations
Instances For
The single-step certificate deleting x ≥ 0, with unit weights on the two contradiction
rows.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The checked reduction really reconstructs its omitted local inequality.