While this submission is a draft, it cannot be used by other submissions.

Exponents for thin matrix preprocessing

Lax350013.MatrixParameters · concepts/Lax350013/MatrixParameters.lean · lax-350013

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    The entropy expression and parameter functions governing the preprocessing/query trade-off in Section 4. The threshold is ε∗=log⁡4/(5log⁡10)>0.1204\varepsilon^*=\log 4/(5\log 10)>0.1204. The cost expressions retain the paper’s integer recursion parameters and logarithmic factors.

    Concept map
    1 concept; 4 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1/-
    2Copyright (c) 2026 Anthropic, PBC. All rights reserved.
    3Released under Apache 2.0 license as described in the file LICENSE.
    4SPDX-License-Identifier: Apache-2.0
    5-/
    6/-
    7Modified for the independent Lax packaging by Édouard Bonnet, 2026.
    8Derived from 3sum-apsp/EndStatement.lean / PaperStatements.lean at upstream commit e1a4e6508154ea59f030480661590a9fe3018011.
    9Changes: Lax module/namespace layout, separated concepts and proofs, archive
    10annotations, and compatibility with the archive Lean/mathlib environment.
    11See NOTICE and README.md in the submission root for provenance and scope.
    12-/
    13
    14import Mathlib.Algebra.MvPolynomial.Basic
    15import Mathlib.Analysis.SpecialFunctions.Log.Base
    16import Mathlib.Analysis.SpecialFunctions.Log.Basic
    17import Mathlib.Analysis.SpecialFunctions.Pow.Real
    18import Mathlib.Combinatorics.SimpleGraph.Basic
    19import Mathlib.Data.Finset.Sort
    20import Mathlib.LinearAlgebra.Matrix.Notation
    21import Mathlib.MeasureTheory.Integral.Bochner.Basic
    22import Mathlib.NumberTheory.PrimeCounting
    23import Mathlib.Probability.Independence.Basic
    24import Mathlib.Tactic.DeriveFintype
    25
    26/-!
    27---
    28title: Exponents for thin matrix preprocessing
    29type: definition
    30---
    31The entropy expression and parameter functions governing the preprocessing/query trade-off in Section 4. The threshold is ε∗=log⁡4/(5log⁡10)>0.1204\varepsilon^*=\log 4/(5\log 10)>0.1204. The cost expressions retain the paper’s integer recursion parameters and logarithmic factors.
    32-/
    33
    34namespace Lax350013.MatrixParameters
    35
    36open Finset
    37
    38/-- Section 2.3.3: "N₀ := 3^{L-m}". Meant for `m ≤ L`; for `m > L` the subtraction of natural
    39numbers is cut off at 0 and the value is 1. -/
    40def N0 (L m : ℕ) : ℕ := 3 ^ (L - m)
    41
    42/-- Section 2.3.3: "K := binom(L, m)", the number of subsets of `{1, …, L}` of size `m`. -/
    43def K (L m : ℕ) : ℕ := L.choose m
    44
    45/-- Section 2.4.3: "α_d := binom(m, d) 9^d". -/
    46def alpha (m d : ℕ) : ℕ := m.choose d * 9 ^ d
    47
    48/-- The decay rate of the `β_d` (Table 1, and Section 4.3): "ρ := 9m / (L - m + 1)". -/
    49noncomputable def rho (L m : ℕ) : ℝ := 9 * (m : ℝ) / ((L : ℝ) - (m : ℝ) + 1)
    50
    51/-- The expression inside the `O(·)` of (8) (preprocessing time and space of Theorem 30):
    52"L m ρ^t/(1 - ρ) N² + N · 10^L / (√K N₀)". -/
    53noncomputable def cost8 (L m t N : ℕ) : ℝ :=
    54 (L : ℝ) * (m : ℝ) * (rho L m ^ t / (1 - rho L m)) * (N : ℝ) ^ 2
    55 + (N : ℝ) * (10 : ℝ) ^ L / (Real.sqrt (K L m : ℝ) * (N0 L m : ℝ))
    56
    57/-- The expression inside the `O(·)` of the query time of Theorem 30:
    58"L ∑_{d=0}^{t} α_d". -/
    59noncomputable def costQuery (L m t : ℕ) : ℝ := (L : ℝ) * ∑ d ∈ range (t + 1), (alpha m d : ℝ)
    60
    61/-- The expression inside the `O(·)` of (9), Theorem 30, for a set of `W` positions:
    62"L |W| ∑_{d=0}^{t} α_d + L m ρ^t/(1 - ρ) N² + N · 10^L / (√K N₀)". The paper labels the three terms
    63"queries", "boxes" and "encodings". -/
    64noncomputable def cost9 (L m t N W : ℕ) : ℝ :=
    65 (L : ℝ) * (W : ℝ) * ∑ d ∈ range (t + 1), (alpha m d : ℝ) + cost8 L m t N
    66
    67/-- Section 4.4: "let H(x) := -x ln x - (1 - x) ln(1 - x) be the entropy function (with natural
    68logarithms)". (Lean's `Real.log 0 = 0` gives `H(0) = H(1) = 0`, the usual convention.) -/
    69noncomputable def entropy (θ : ℝ) : ℝ := -θ * Real.log θ - (1 - θ) * Real.log (1 - θ)
    70
    71/-- The denominator of equation (11), which the paper calls `ln Λ`:
    72`c ln 10 - (1/2) c H(1/c) - (c - 1) ln 3 + γ ln 4`, where "Λ := 10^c e^{-(1/2) c H(1/c)} 3^{-(c-1)}
    734^γ" (Section 4.4). -/
    74noncomputable def lnΛ (c γ : ℝ) : ℝ :=
    75 c * Real.log 10 - (1 / 2) * c * entropy (1 / c) - (c - 1) * Real.log 3 + γ * Real.log 4
    76
    77/-- Equation (11): "R_c(γ) := ln 4 / ln Λ". -/
    78noncomputable def Rc (c γ : ℝ) : ℝ := Real.log 4 / lnΛ c γ
    79
    80/-- Section 4.1: "Let ε* := ln 4 / (5 ln 10)". -/
    81noncomputable def epsStar : ℝ := Real.log 4 / (5 * Real.log 10)
    82
    83/-- Corollary 31: "ρ_c := 9/(c - 1)". -/
    84noncomputable def rhoC (c : ℝ) : ℝ := 9 / (c - 1)
    85
    86/-- Corollary 31: "γ := θ ln(1/ρ_c) / ln 4". -/
    87noncomputable def gammaOf (c θ : ℝ) : ℝ := θ * Real.log (1 / rhoC c) / Real.log 4
    88
    89/-- Corollary 31: "q := (H(θ) + θ ln 9) / ln 4". -/
    90noncomputable def qOf (θ : ℝ) : ℝ := (entropy θ + θ * Real.log 9) / Real.log 4
    91
    92end Lax350013.MatrixParameters
    93

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…