Documentation

LeanPool.BrillNoetherGraphs.Utilities.Subdivision.AffineCover

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 Fin k, implemented as a list fold rather than a proof-producing Decidable computation.

Equations
Instances For
    @[simp]
    theorem Utilities.Certificate.AffineCover.allFin_eq_true_iff {k : ℕ} (test : Fin k → Bool) :
    allFin test = true ↔ ∀ (index : Fin k), test index = true
    def Utilities.Certificate.AffineCover.allFinset {α : Type u_1} (elements : Finset α) (test : α → Bool) :

    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
    Instances For
      @[simp]
      theorem Utilities.Certificate.AffineCover.allFinset_eq_true_iff {α : Type u_1} (elements : Finset α) (test : α → Bool) :
      allFinset elements test = true ↔ ∀ element ∈ elements, test element = true

      An integral affine form in m variables.

      • fixedValue : ℤ

        The integer constant term of the affine form.

      • coefficient : Fin m → ℤ

        The integer coefficient of each of the m coordinates.

      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[instance_reducible]
          Equations

          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
            @[simp]
            theorem Utilities.Certificate.AffineCover.AffineForm.equal_eq_true_iff {m : ℕ} (left right : AffineForm m) :
            left.equal right = true ↔ left = right

            Proof-free list membership for integral affine forms.

            Equations
            Instances For
              @[simp]
              theorem Utilities.Certificate.AffineCover.AffineForm.mem_eq_true_iff {m : ℕ} (form : AffineForm m) (forms : List (AffineForm m)) :
              form.mem forms = true ↔ form ∈ forms

              Evaluation of an integral affine form at an integral point.

              Equations
              Instances For

                The closed integral inequality represented by an affine form.

                Equations
                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
                  Instances For
                    @[simp]
                    theorem Utilities.Certificate.AffineCover.AffineForm.eval_zero {m : ℕ} (point : Fin m → ℤ) :
                    eval 0 point = 0
                    @[simp]
                    theorem Utilities.Certificate.AffineCover.AffineForm.eval_violation {m : ℕ} (form : AffineForm m) (point : Fin m → ℤ) :
                    form.violation.eval point = -form.eval point - 1
                    @[simp]

                    Rational evaluation, used only in the proof of Farkas soundness.

                    Equations
                    Instances For
                      @[simp]
                      theorem Utilities.Certificate.AffineCover.AffineForm.evalRat_eq_cast_eval {m : ℕ} (form : AffineForm m) (point : Fin m → ℤ) :
                      form.evalRat point = ↑(form.eval point)
                      def Utilities.Certificate.AffineCover.FormsHold {m : ℕ} (forms : List (AffineForm m)) (point : Fin m → ℤ) :

                      A finite conjunction of affine inequalities. This is used for base regions and for individual proof cones.

                      Equations
                      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

                          One sparse rational multiplier names a row of the current region.

                          • row : ℕ

                            The index of the active affine row used by this sparse Farkas term.

                          • weight : ℚ

                            The proposed rational multiplier of the selected affine row; its admissibility is checked by the validity predicate.

                          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.

                                • 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
                                      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
                                              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
                                                        Instances For
                                                          theorem Utilities.Certificate.AffineCover.FarkasData.not_formsHold_of_valid {m : ℕ} (data : FarkasData) (rows : List (AffineForm m)) {point : Fin m → ℤ} (hValid : data.Valid rows) :
                                                          ¬FormsHold rows point

                                                          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.

                                                          Instances For

                                                            Look up a cone in the cover table, returning an empty cone for an out-of-range index.

                                                            Equations
                                                            Instances For

                                                              Look up an affine constraint in a cone, returning the zero form for an out-of-range index.

                                                              Equations
                                                              Instances For

                                                                Mathematical validity of a contradiction tree under the currently active affine rows.

                                                                Equations
                                                                Instances For

                                                                  Recursive Boolean replay of a contradiction tree under active rows.

                                                                  Equations
                                                                  Instances For

                                                                    Executable exact checker for a complete covering tree.

                                                                    Equations
                                                                    Instances For
                                                                      @[simp]
                                                                      theorem Utilities.Certificate.AffineCover.CoverTree.check_eq_true_iff {m : ℕ} (tree : CoverTree m) (base : List (AffineForm m)) (cones : List (List (AffineForm m))) :
                                                                      tree.check base cones = true ↔ Valid cones base tree
                                                                      theorem Utilities.Certificate.AffineCover.CoverTree.covers_of_check_eq_true {m : ℕ} (tree : CoverTree m) (base : List (AffineForm m)) (cones : List (List (AffineForm m))) (hCheck : tree.check base cones = true) :
                                                                      Covers base cones

                                                                      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
                                                                              Instances For

                                                                                Mathematical validity of rows deleted in the exact forward order in which they disappear from the cone.

                                                                                Equations
                                                                                Instances For

                                                                                  Mathematical validity of every deletion in a chain.

                                                                                  Equations
                                                                                  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
                                                                                      Instances For
                                                                                        @[simp]
                                                                                        theorem Utilities.Certificate.AffineCover.ReductionChain.check_eq_true_iff {m : ℕ} (chain : ReductionChain m) (base full reduced : List (AffineForm m)) :
                                                                                        chain.check base full reduced = true ↔ chain.Valid base full ∧ resultRows full chain.steps = some reduced
                                                                                        theorem Utilities.Certificate.AffineCover.ReductionChain.formsHold_full_of_valid {m : ℕ} (chain : ReductionChain m) (base full reduced : List (AffineForm m)) (hValid : chain.Valid base full) (hResult : resultRows full chain.steps = some reduced) (point : Fin m → ℤ) (hBase : FormsHold base point) (hReduced : FormsHold reduced point) :
                                                                                        FormsHold full point

                                                                                        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.

                                                                                        theorem Utilities.Certificate.AffineCover.ReductionChain.formsHold_full_of_check_eq_true {m : ℕ} (chain : ReductionChain m) (base full reduced : List (AffineForm m)) (hCheck : chain.check base full reduced = true) (point : Fin m → ℤ) (hBase : FormsHold base point) (hReduced : FormsHold reduced point) :
                                                                                        FormsHold full point

                                                                                        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 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.