Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Read a stored integer matrix coefficient as a rational

Proved
Lax109476Proofs.RamCertificateLoad.matrix_spec_native

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

algorithmscomputational-complexitygraph-theory

Let PPP be a stored integer program with mmm rows and nnn columns, and let i<mi<mi<m, j<nj<nj<n. Suppose 1≤M<B1\le M<B1≤M<B, the matrix coefficient has magnitude at most MMM, and mn+m+n+4<Bmn+m+n+4<Bmn+m+n+4<B. The fixed coefficient reader preserves the source storage and returns the signed rational value

qout=Aijq_{\rm out}=A_{ij}qout​=Aij​

in at most 212121 instructions. The query registers initially specify i,ji,ji,j.

Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_NativeBlockInterfaces
namespace Lax109476Proofs.RamCertificateLoad
end Lax109476Proofs.RamCertificateLoad
Formal statement
theorem Lax109476Proofs.RamCertificateLoad.matrix_spec_native : ∀ (B M m n : Nat) (P : Lax109476.LinearProgram.Program Int m n) (i : Fin m) (j : Fin n),
  @LE.le Nat instLENat (@OfNat.ofNat Nat (nat_lit 1) (instOfNatNat (nat_lit 1))) M →
    @LT.lt Nat instLTNat M B →
      @LT.lt Nat instLTNat
          (@HAdd.hAdd Nat Nat Nat (@instHAdd Nat instAddNat)
            (@HAdd.hAdd Nat Nat Nat (@instHAdd Nat instAddNat)
              (@HAdd.hAdd Nat Nat Nat (@instHAdd Nat instAddNat) (@HMul.hMul Nat Nat Nat (@instHMul Nat instMulNat) m n)
                m)
              n)
            (@OfNat.ofNat Nat (nat_lit 4) (instOfNatNat (nat_lit 4))))
          B →
        @LE.le Nat instLENat (@Lax109476.LinearProgram.Program.A Int m n P i j).natAbs M →
          Lax808846Proofs.Reasoning.Spec B
            (fun (σ : Lax808846Proofs.Imp.Env) =>
              And (@Lax109476Proofs.RamCertificateSource.Data m n P σ)
                (And (@Eq Nat (σ.vars "query.a.row") (@Fin.val m i)) (@Eq Nat (σ.vars "query.a.col") (@Fin.val n j))))
            Lax109476Proofs.RamCertificateLoad.matrix
            (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 m n P i j)) τ))
            (@OfNat.ofNat Nat (nat_lit 21) (instOfNatNat (nat_lit 21))) := by sorry
Source
https://github.com/EdouardBonnet/lax-109476/blob/0a042604c7ae1ef4cd9a4c7d82eb902f313d4864/proofs/Lax109476Proofs/RamCertificateLoad.lean, theorem Lax109476Proofs.RamCertificateLoad.matrix_spec, line 17

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