AFTD Auto-Formalizing Theoretical Domains

bh_upper_density

def

For a set of natural numbers A and order h, the normalized upper density is the limit superior along atTop of |A ∩ {1, ..., n}| / n^(1/h) as n → ∞.

Statement

open scoped Classical in
noncomputable def bh_upper_density (h : ℕ) (A : Set ℕ) : ℝ
Defined in
arXiv:2611.01871, Sec. 1, line 81 and line 112
Verified
04 Nov 2026
Axioms
none listed
Used by 1
  • bh_upper_density_ge_of_subsequenceIf a set A has normalized counting function at least c along a strictly increasing sequence of checkpoints, and the normalized counting…

Read back from the Lean

Definition of bh_upper_density: given a natural number h and a set of natural numbers A, it returns the real number given by the limit superior (as $n \to \infty$ through Filter.atTop in $\mathbb{N}$) of the ratio $\frac{|A \cap \{1, \dots, n\}|}{n^{1/h}}$, where $|A \cap \{1, \dots, n\}|$ is the cardinality of elements in $\{1, \dots, n\}$ that belong to $A$ cast to ℝ, and $n^{1/h}$ uses real division $1/h$ and real power.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

open scoped Classical in
/-- The normalized upper limit limsup_{n → ∞} A(n) / n^(1/h) of a set A ⊆ ℕ. -/
noncomputable def bh_upper_density (h : ℕ) (A : Set ℕ) : ℝ := Filter.limsup (fun n : ℕ => (((Finset.Icc 1 n).filter (· ∈ A)).card : ℝ) / (n : ℝ) ^ ((1 : ℝ) / (h : ℝ))) Filter.atTop
See it in the graphDiscuss this resultChallenge it