Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Comparison language and exponentially indexed natural sums

Definition
APSCounting893_Main_ImplicitCountingArithmetic

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

apsbinary-arithmeticcounting-hierarchy

For a natural-valued function FFF on binary words, the comparison language tests whether the little-endian value written after a framed input is strictly below F(x)F(x)F(x).

For fixed resource constants a,ba,ba,b, let r=a(∣x∣+1)br=a(|x|+1)^br=a(∣x∣+1)b. The implicit indexed sum is

SF,a,b(x)=∑i=02r−1F(frame⁡(x) ∥ bits⁡r(i)),S_{F,a,b}(x)=\sum_{i=0}^{2^r-1}F\bigl(\operatorname{frame}(x)\,\Vert\,\operatorname{bits}_r(i)\bigr),SF,a,b​(x)=i=0∑2r−1​F(frame(x)∥bitsr​(i)),

where the index uses exactly rrr little-endian bits and ∥\Vert∥ denotes concatenation.

These objects support uniform counting arguments for short integer arithmetic. The sum is the actual finite natural-number sum; it does not assume a circuit, arithmetic oracle, or complexity bound.

Definition code
import Definitions.Def_APSCounting893_Main_BinaryOracleArithmetic
set_option autoImplicit false
namespace APSCounting893.Main

def NaturalLessLanguage (F : Word → ℕ) : Language :=
  fun z => Turing.MultiTapeTM.ofBits (Turing.MultiTapeTM.dropFrame z)<F (Turing.MultiTapeTM.unframe z)

noncomputable def indexedNaturalSum (F : Word → ℕ) (a b : ℕ) (x : Word) : ℕ :=
  ∑ i : Fin (2^polyBound a b x.length),F (Turing.MultiTapeTM.frame x++
    Cslib.BitString.lowBits (polyBound a b x.length) i.val)

end APSCounting893.Main
Source
Hesse, Allender and Barrington, Uniform Constant-Depth Threshold Circuits for Division and Iterated Multiplication, JCSS 65(4), 2002, author manuscript Section 4, pp. 8–11, including the iterated-addition steps in Lemmas 4.1 and 4.3, https://www.cs.rutgers.edu/~allender/papers/division.pdf; used in the arithmetic simulation for Agarwal, Hari, Pandey and Shukla, STOC 2027 submission #893, Theorem 6.4, pp. 25–26, https://github.com/sigact-stoc/stoc2027/releases/download/papers-1/893.pdf.

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