Given a set S and an element b in an order β, where all intervals bounded above are finite,
we define the partial density of S (relative to a set A) to be the proportion of elements in
{x ∈ A | x < b} that lie in S ∩ A.
This definition was inspired from https://github.com/b-mehta/unit-fractions
Instances For
Given a set S in an order β, where all intervals bounded above are finite, we define the upper
density of S (relative to a set A) to be the limsup of the partial densities of S
(relative to A) for b → ∞.
Equations
- S.upperDensity A = Filter.limsup (fun (b : β) => S.partialDensity A b) Filter.atTop
Instances For
Given a set S in an order β, where all intervals bounded above are finite, we define the lower
density of S (relative to a set A) to be the liminf of the partial densities of S
(relative to A) for b → ∞.
Equations
- S.lowerDensity A = Filter.liminf (fun (b : β) => S.partialDensity A b) Filter.atTop
Instances For
A set S in an order β where all intervals bounded above are finite is said to have
density α : ℝ (relative to a set A) if the proportion of x ∈ S such that x < n
in A tends to α as n → ∞.
When β = ℕ this by default defines the natural density of a set
(i.e., relative to all of ℕ).
Equations
- S.HasDensity α A = Filter.Tendsto (fun (b : β) => S.partialDensity A b) Filter.atTop (nhds α)
Instances For
A set S in an order β where all intervals bounded above are finite is said to have
positive density (relative to a set A) if there exists a positive α : ℝ such that
S has density α (relative to a set A).
Equations
- S.HasPosDensity A = ∃ α > 0, S.HasDensity α A
Instances For
In a non-trivial partial order with a least element, the set of all elements has density one.
The natural density of the set of even numbers is 1 / 2.
A finite set has natural density zero.
A set of positive natural density is infinite.