Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Column and row scales, clearing denominator and logarithmic costs

Definition
OAI_NumberTheory_PiExponent_Approximation_MatrixArithmetic_ScalesCosts

by Yuxuan Xu · Oct 11, 2026 · Mathlib 0df444a (Lean v4.33.1)

linear-algebranumber-theoryopenai-pi-exponent-017

Let qiq_iqi​ be natural denominators and let a,ba,ba,b be natural exponent vectors on mmm coordinates. Put wi=⌈log⁡qi⌉+w_i=\lceil\log q_i\rceil_+wi​=⌈logqi​⌉+​, where the ceiling is natural. Define the column scale, inverse row scale, and common denominator at real height HHH and natural truncation orders TiT_iTi​ by

Cq(a)=∏iqiai,Rq(b)=Cq(b)−1,D(q,T,H)=∏ilcm⁡(1,…,Ti)⌊H/wi⌋+.C_q(a)=\prod_i q_i^{a_i},\qquad R_q(b)=C_q(b)^{-1},\qquad D(q,T,H)=\prod_i\operatorname{lcm}(1,\ldots,T_i)^{\lfloor H/w_i\rfloor_+}.Cq​(a)=i∏​qiai​​,Rq​(b)=Cq​(b)−1,D(q,T,H)=i∏​lcm(1,…,Ti​)⌊H/wi​⌋+​.

For the original finite row domain R=Row(K,v0,θ,w,H)\mathcal R=\mathrm{Row}(K,v_0,\theta,w,H)R=Row(K,v0​,θ,w,H) and a column selection κ:R→Column(w0,w,H)\kappa:\mathcal R\to\mathrm{Column}(w_0,w,H)κ:R→Column(w0​,w,H), define the logarithmic costs

B=∑ρ∈R∑ibρ,ilog⁡qi,Aκ=∑ρ∈R∑iaκ(ρ),ilog⁡qi.B=\sum_{\rho\in\mathcal R}\sum_i b_{\rho,i}\log q_i,\qquad A_\kappa=\sum_{\rho\in\mathcal R}\sum_i a_{\kappa(\rho),i}\log q_i.B=ρ∈R∑​i∑​bρ,i​logqi​,Aκ​=ρ∈R∑​i∑​aκ(ρ),i​logqi​.

Here KKK is natural and w0,v0,θ,Hw_0,v_0,\theta,Hw0​,v0​,θ,H are real domain parameters; bρ,ib_{\rho,i}bρ,i​ and aκ(ρ),ia_{\kappa(\rho),i}aκ(ρ),i​ are the nonconstant coordinates of the row and selected column exponent vectors. All five quantities are real and are defined without positivity assumptions, using the original finite domains. They provide the scaling and cost data for determinant denominator clearing.

Definition code
import Definitions.Def_OAI_NumberTheory_PiExponent_Approximation_MatrixArithmetic_CoreData

namespace OAI.PiExponent.MatrixArithmetic

open scoped BigOperators

noncomputable def columnScale {m : ℕ} (q : Fin m → ℕ) (a : Fin m → ℕ) : ℝ :=
  ∏ i, (q i : ℝ) ^ a i

noncomputable def rowScale {m : ℕ} (q : Fin m → ℕ) (b : Fin m → ℕ) : ℝ :=
  (columnScale q b)⁻¹

noncomputable def denominator {m : ℕ} (q : Fin m → ℕ) (T : Fin m → ℕ) (H : ℝ) : ℝ :=
  ∏ i, (Nat.lcmUpto (T i) : ℝ) ^ ⌊H / logWeights q i⌋₊

noncomputable def rowCost {m : ℕ} (K : ℕ) (v0 θ : ℝ)
    (q : Fin m → ℕ) (H : ℝ) : ℝ :=
  ∑ ρ : InterpolationMatrix.Row K v0 θ (logWeights q) H,
    ∑ i, (ρ.2.1 i.succ : ℝ) * Real.log (q i)

noncomputable def columnCost {m : ℕ} {K : ℕ} {w0 v0 θ : ℝ}
    (q : Fin m → ℕ) {H : ℝ}
    (selection : InterpolationMatrix.Row K v0 θ (logWeights q) H →
      InterpolationMatrix.Column w0 (logWeights q) H) : ℝ :=
  ∑ ρ : InterpolationMatrix.Row K v0 θ (logWeights q) H,
    ∑ i, ((selection ρ).1 i.succ : ℝ) * Real.log (q i)

end OAI.PiExponent.MatrixArithmetic
Source
OpenAI math, commit adc7f1241b42e322a6451854ab7e4b4c146bf78a: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixArithmetic.lean#L135-L209

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