Documentation

Complexity.Probability.PMF.Uniform

Uniform distributions and resampling #

Every value of a nonempty finite type has positive uniform mass (mem_support_uniformOfFintype), and the uniform probability of an event is the fraction of its members (toOuterMeasure_uniformOfFintype, toOuterMeasure_uniformOfFintype_toReal).

Draw a uniformly from α and, independently, b uniformly from β. For any equivalence e : α × β ≃ γ × δ, the pair e (a, b) is uniform on γ × δ, so its first component is uniform on γ (uniformOfFintype_bind_map_fst_equiv). This is the resampling step of hybrid arguments: overwriting part of a uniform string a by independent uniform values b leaves it uniform, since the overwritten string and the old part together determine (a, b).

Main results #

Every value of a nonempty finite type is in the uniform distribution's support.

The first component of a uniform pair is uniform.

theorem Cslib.Probability.PMF.uniformOfFintype_bind_map_fst_equiv {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} [Fintype α] [Nonempty α] [Fintype β] [Nonempty β] [Fintype γ] [Nonempty γ] [Finite δ] (e : α × β ≃ γ × δ) :
((uniformOfFintype α).bind fun (a : α) => PMF.map (fun (b : β) => (e (a, b)).1) (uniformOfFintype β)) = uniformOfFintype γ

Resampling: for independent uniform a and b and an equivalence e : α × β ≃ γ × δ, the first component of e (a, b) is uniform.

theorem Cslib.Probability.PMF.uniformOfFintype_bind_bind_fst_equiv {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {ε : Type u_5} [Fintype α] [Nonempty α] [Fintype β] [Nonempty β] [Fintype γ] [Nonempty γ] [Finite δ] (e : α × β ≃ γ × δ) (f : γ → PMF ε) :
((uniformOfFintype α).bind fun (a : α) => (uniformOfFintype β).bind fun (b : β) => f (e (a, b)).1) = (uniformOfFintype γ).bind f

Resampling inside an experiment: running f on the first component of e (a, b), for independent uniform a and b, is running f on a uniform input.

theorem Cslib.Probability.PMF.toOuterMeasure_uniformOfFintype {α : Type u_1} [Fintype α] [Nonempty α] (event : Set α) [DecidablePred fun (x : α) => x ∈ event] :
(uniformOfFintype α).toOuterMeasure event = ↑{x : α | x ∈ event}.card * (↑(Fintype.card α))⁻¹

The uniform distribution on a finite type gives an event the fraction of its members, as an extended nonnegative real.

theorem Cslib.Probability.PMF.toOuterMeasure_uniformOfFintype_toReal {α : Type u_1} [Fintype α] [Nonempty α] (event : Set α) [DecidablePred fun (x : α) => x ∈ event] :
((uniformOfFintype α).toOuterMeasure event).toReal = ↑{x : α | x ∈ event}.card / ↑(Fintype.card α)

The probability of an event under the uniform distribution on a finite type is the fraction of its members.