Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Bounded execution of the rational upper-root routine

Open
Lax109476Proofs.RamRounding.upperRootFraction_spec

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

algorithmscomputational-complexitygraph-theory

Let x=(−1)sn/dx=(-1)^s n/dx=(−1)sn/d, where s≤1s\le1s≤1, n,d,D≤Mn,d,D\le Mn,d,D≤M and d,D>0d,D>0d,D>0. Under (2(M3+2)+1)2+M3+3<B(2(M^3+2)+1)^2+M^3+3<B(2(M3+2)+1)2+M3+3<B and initialized operand/grid registers, the fixed upper-root command returns uD(x)u_D(x)uD​(x) as a reduced fraction. Here

uD(x)=⌊max⁡{0,⌈xD2⌉}⌋+1D.u_D(x)=\frac{\lfloor\sqrt{\max\{0,\lceil xD^2\rceil\}}\rfloor+1}{D}.uD​(x)=D⌊max{0,⌈xD2⌉}​⌋+1​.

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

Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_NativeDetailedInterfaces
Formal statement
namespace Lax109476Proofs.RamRounding
theorem upperRootFraction_spec : ∀ (B M s n d D : Nat),
  Nat.lt
      (Nat.add
        (Nat.add
          (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
            (Nat.add
              (Nat.mul
                ((2:Nat))
                (Nat.add
                  (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid))) M
                    ((3:Nat)))
                  ((2:Nat))))
              ((1:Nat)))
            ((2:Nat)))
          (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid))) M
            ((3:Nat))))
        ((3:Nat)))
      B →
    Nat.le s ((1:Nat)) →
      Nat.le n M →
        Nat.le d M →
          Nat.le D M →
            Nat.lt ((0:Nat)) d →
              Nat.lt ((0:Nat)) D →
                Lax808846Proofs.Reasoning.Spec B
                  (fun (σ : Lax808846Proofs.Imp.Env) =>
                    And (@Eq Nat (σ.vars "left.s") s)
                      (And (@Eq Nat (σ.vars "left.n") n)
                        (And (@Eq Nat (σ.vars "left.d") d) (@Eq Nat (σ.vars "grid.D") D))))
                  Lax109476Proofs.RamRounding.upperRootFraction
                  (fun (x σ' : Lax808846Proofs.Imp.Env) =>
                    Lax109476Proofs.RamRational.FractionOutput
                      (Lax109476Proofs.RationalRounding.sqrtUpper (Lax109476Proofs.RamRational.fractionValue s n d) D)
                      σ')
                  (Nat.add
                    (Nat.add
                      (Nat.mul
                        ((26:Nat))
                        (Lax109476Proofs.RamRounding.upperMagnitude s n d D).size)
                      (Nat.mul
                        ((36:Nat)) D.size))
                    ((128:Nat))) := by sorry
end Lax109476Proofs.RamRounding
Source
https://github.com/EdouardBonnet/lax-109476/blob/0a042604c7ae1ef4cd9a4c7d82eb902f313d4864/proofs/Lax109476Proofs/RamRounding.lean, theorem upperRootFraction_spec (lines 134–183)

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