Documentation

FormalConjectures.ForMathlib.Data.Set.Density

@[reducible, inline]
noncomputable abbrev Set.partialDensity {β : Type u_1} [Preorder β] [LocallyFiniteOrderBot β] (S : Set β) (A : Set β := univ) (b : β) :

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

Equations
Instances For
    noncomputable def Set.upperDensity {β : Type u_1} [Preorder β] [LocallyFiniteOrderBot β] (S : Set β) (A : Set β := univ) :

    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
    Instances For
      noncomputable def Set.lowerDensity {β : Type u_1} [Preorder β] [LocallyFiniteOrderBot β] (S : Set β) (A : Set β := univ) :

      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
      Instances For
        def Set.HasDensity {β : Type u_1} [Preorder β] [LocallyFiniteOrderBot β] (S : Set β) (α : ) (A : Set β := univ) :

        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
        Instances For
          def Set.HasPosDensity {β : Type u_1} [Preorder β] [LocallyFiniteOrderBot β] (S : Set β) (A : Set β := univ) :

          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
          Instances For
            @[simp]
            theorem Set.HasDensity.univ {β : Type u_1} [PartialOrder β] [LocallyFiniteOrder β] [OrderBot β] [Nontrivial β] [IsDirected β fun (x1 x2 : β) => x1 x2] :

            In a directed non-trivial partial order with a least element, the set of all elements has density one.

            @[simp]
            theorem Set.HasDensity.empty {β : Type u_1} [Preorder β] [LocallyFiniteOrderBot β] (A : Set β := Set.univ) :
            theorem Set.HasDensity.mono {β : Type u_1} [PartialOrder β] [LocallyFiniteOrder β] [OrderBot β] {S T : Set β} {αS αT : } [Filter.atTop.NeBot] [IsDirected β fun (x1 x2 : β) => x1 x2] [Nontrivial β] (h : S T) (hS : S.HasDensity αS) (hT : T.HasDensity αT) :
            αS αT
            theorem Set.HasDensity.nonneg {β : Type u_1} [Preorder β] [LocallyFiniteOrderBot β] [Filter.atTop.NeBot] {S : Set β} {α : } (h : S.HasDensity α) :
            0 α

            The natural density of the set of even numbers is 1 / 2.

            A finite set has natural density zero.

            theorem Nat.infinite_of_hasDensity_pos {S : Set } {α : } (h : S.HasDensity α) (hα : 0 < α) :

            A set of positive natural density is infinite.