Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Build a stored integer certificate system from bounded selectors

Open
Lax109476Proofs.RamCertificateBuilder.buildSystem_spec

by Shuze Chen · Nov 18, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithmscomputational-complexitygraph-theory

Let PPP be a stored source integer program and FFF an r×sr\times sr×s target program. Suppose the matrix and right-hand-side selectors have the specified bounded execution contracts, preserve the required context fields and arrays, and return the entries of FFF. Under the source-height, dimension and allocated-buffer guards, the fixed nested-loop builder preserves PPP and stores the entire system:

system.A=AF,system.b=bF.\mathrm{system.A}=A_F,\qquad\mathrm{system.b}=b_F.system.A=AF​,system.b=bF​.

This is a reusable source interface for composing the complete finite-program implementation.

Retired because the namespace-wrapped declaration compiled during publication but the proof-comparison parser rejects that header (expected token / unknown full theorem identifier). The mathematically identical, fully qualified declaration is Lax109476Proofs.RamCertificateBuilder.buildSystem_spec_native.

Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_NativeDetailedInterfaces
Formal statement
namespace Lax109476Proofs.RamCertificateBuilder
theorem buildSystem_spec : ∀ (B M m n r s matrixCost boundCost : Nat) (P : Lax109476.LinearProgram.Program Int m n)
  (F : Lax109476.LinearProgram.Program Int r s) (matrixSelector boundSelector : Lax808846Proofs.Imp.Com),
  Nat.le ((1:Nat)) M →
    Nat.lt M B →
      Nat.lt
          (Nat.add
            (Nat.add
              (Nat.add (Nat.mul r s)
                r)
              s)
            ((4:Nat)))
          B →
        (∀ (i : Fin r) (j : Fin s), Nat.le (@Lax109476.LinearProgram.Program.A Int r s F i j).natAbs M) →
          (∀ (i : Fin r), Nat.le (@Lax109476.LinearProgram.Program.b Int r s F i).natAbs M) →
            (∀ (i : Fin r) (j : Fin s),
                Lax808846Proofs.Reasoning.Spec B
                  (fun (σ : Lax808846Proofs.Imp.Env) =>
                    And (@Lax109476Proofs.RamCertificateSource.Data m n P σ)
                      (And (@Eq Nat (σ.vars "query.row") (@Fin.val r i)) (@Eq Nat (σ.vars "query.col") (@Fin.val s j))))
                  matrixSelector
                  (fun (x τ : Lax808846Proofs.Imp.Env) =>
                    And (@Lax109476Proofs.RamCertificateSource.Data m n P τ)
                      (Lax109476Proofs.RamRational.FractionOutput
                        (@Int.cast Rat Rat.instIntCast (@Lax109476.LinearProgram.Program.A Int r s F i j)) τ))
                  matrixCost) →
              (∀ (i : Fin r),
                  Lax808846Proofs.Reasoning.Spec B
                    (fun (σ : Lax808846Proofs.Imp.Env) =>
                      And (@Lax109476Proofs.RamCertificateSource.Data m n P σ)
                        (@Eq Nat (σ.vars "query.row") (@Fin.val r i)))
                    boundSelector
                    (fun (x τ : Lax808846Proofs.Imp.Env) =>
                      And (@Lax109476Proofs.RamCertificateSource.Data m n P τ)
                        (Lax109476Proofs.RamRational.FractionOutput
                          (@Int.cast Rat Rat.instIntCast (@Lax109476.LinearProgram.Program.b Int r s F i)) τ))
                    boundCost) →
                (∀ (a : String),
                    @Membership.mem String (List String) (@List.instMembership String)
                        Lax109476Proofs.RamCertificateContext.fields a →
                      a ∉ matrixSelector.wvars) →
                  (∀ (a : String),
                      @Membership.mem String (List String) (@List.instMembership String)
                          Lax109476Proofs.RamCertificateContext.fields a →
                        a ∉ boundSelector.wvars) →
                    "build.i" ∉ matrixSelector.wvars →
                      "build.count" ∉ matrixSelector.wvars →
                        "build.i" ∉ boundSelector.wvars →
                          "build.count" ∉ boundSelector.wvars →
                            @Eq (List String) matrixSelector.warrs (@List.nil String) →
                              @Eq (List String) boundSelector.warrs (@List.nil String) →
                                Lax808846Proofs.Reasoning.Spec B
                                  (fun (σ : Lax808846Proofs.Imp.Env) =>
                                    And (@Lax109476Proofs.RamCertificateContext.Context m n P r s σ)
                                      (And
                                        (Lax109476Proofs.RamEllipsoidStep.Extents "system.A"
                                          (Nat.mul r s) σ)
                                        (Lax109476Proofs.RamEllipsoidStep.Extents "system.b" r σ)))
                                  (Lax109476Proofs.RamCertificateBuilder.buildSystem matrixSelector boundSelector)
                                  (fun (x τ : Lax808846Proofs.Imp.Env) =>
                                    And (@Lax109476Proofs.RamCertificateSource.Data m n P τ)
                                      (@Lax109476Proofs.RamEquationData.Data r s F τ))
                                  (Nat.add
                                    (Nat.add
                                      (Nat.mul
                                        (Nat.add matrixCost
                                          ((70:Nat)))
                                        (Nat.mul r s))
                                      (Nat.mul
                                        (Nat.add boundCost
                                          ((58:Nat)))
                                        r))
                                    ((62:Nat))) := by sorry
end Lax109476Proofs.RamCertificateBuilder
Source
https://github.com/EdouardBonnet/lax-109476/blob/0a042604c7ae1ef4cd9a4c7d82eb902f313d4864/proofs/Lax109476Proofs/RamCertificateBuilder.lean, theorem buildSystem_spec (lines 18–54)

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me