Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Computing one binomial-table entry

Proved
Lax263307Proofs.NativeCombinations.entry_spec_native

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

algorithmscomputational-complexitygraph-theory

Let i≤ni\le ni≤n and j≤kj\le kj≤k. Suppose the binomial table prefix before coordinate (i,j)(i,j)(i,j) is stored, every required coefficient is below BBB, and the complete table addresses fit the stated word bound. Then the fixed entry command returns

v=(ij)v=\binom{i}{j}v=(ji​)

in at most thirty bounded operational steps. This is the local contract for building the subset-enumeration table.

Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_NativeNextInterfaces
namespace Lax263307Proofs.NativeCombinations
end Lax263307Proofs.NativeCombinations
Formal statement
theorem Lax263307Proofs.NativeCombinations.entry_spec_native : ∀ (B n k i j : Nat),
  @LE.le Nat instLENat i n →
    @LE.le Nat instLENat j k →
      @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)
                  (@HAdd.hAdd Nat Nat Nat (@instHAdd Nat instAddNat) n
                    (@OfNat.ofNat Nat (nat_lit 1) (instOfNatNat (nat_lit 1))))
                  (@HAdd.hAdd Nat Nat Nat (@instHAdd Nat instAddNat) k
                    (@OfNat.ofNat Nat (nat_lit 1) (instOfNatNat (nat_lit 1)))))
                n)
              k)
            (@OfNat.ofNat Nat (nat_lit 3) (instOfNatNat (nat_lit 3))))
          B →
        (∀ (i : Nat),
            @LE.le Nat instLENat i n → ∀ (j : Nat), @LE.le Nat instLENat j k → @LT.lt Nat instLTNat (i.choose j) B) →
          Lax808846Proofs.Reasoning.Spec B
            (fun (σ : Lax808846Proofs.Imp.Env) =>
              And (@Eq Nat (σ.vars "choose.row") i)
                (And (@Eq Nat (σ.vars "choose.col") j)
                  (And
                    (@Eq Nat (σ.vars "choose.cols")
                      (@HAdd.hAdd Nat Nat Nat (@instHAdd Nat instAddNat) k
                        (@OfNat.ofNat Nat (nat_lit 1) (instOfNatNat (nat_lit 1)))))
                    (Lax455465Proofs.RamVirtualState.Prefix
                      (@List.take Nat
                        (@HAdd.hAdd Nat Nat Nat (@instHAdd Nat instAddNat)
                          (@HMul.hMul Nat Nat Nat (@instHMul Nat instMulNat) i
                            (@HAdd.hAdd Nat Nat Nat (@instHAdd Nat instAddNat) k
                              (@OfNat.ofNat Nat (nat_lit 1) (instOfNatNat (nat_lit 1)))))
                          j)
                        (Lax263307Proofs.NativeCombinations.table n k))
                      "choose.table" σ))))
            Lax263307Proofs.NativeCombinations.entry
            (fun (x τ : Lax808846Proofs.Imp.Env) => @Eq Nat (τ.vars "choose.value") (i.choose j))
            (@OfNat.ofNat Nat (nat_lit 30) (instOfNatNat (nat_lit 30))) := by sorry
Source
https://github.com/EdouardBonnet/lax-263307/blob/68b2d26aa2075e2ef80fd9d355ea748d2a818fd1/proofs/Lax263307Proofs/NativeCombinations.lean#L100

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