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

Finite probability tables and cell averages

Lax793645.FiniteProbability · concepts/Lax793645/FiniteProbability.lean · lax-793645

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

    All expectations are finite weighted sums. A partition is represented by a map to a finite set of cells. Cell averages are zero on cells of zero reference mass. Actual successful queries are subprobability masses; their densities are taken relative to the reference law. Restricting a query retains its original mass.

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

    Lean source view on GitHub

    1import Mathlib.Data.Real.Basic
    2import Mathlib.Data.Fintype.BigOperators
    3
    4/-!
    5---
    6title: Finite probability tables and cell averages
    7type: definition
    8---
    9All expectations are finite weighted sums. A partition is represented by a map
    10to a finite set of cells. Cell averages are zero on cells of zero reference mass.
    11Actual successful queries are subprobability masses; their densities are taken
    12relative to the reference law. Restricting a query retains its original mass.
    13-/
    14
    15namespace Lax793645.FiniteProbability
    16noncomputable section
    17open scoped BigOperators
    18
    19abbrev Weight (A : Type*) := A → ℝ
    20def indicator (P : Prop) : ℝ := @ite ℝ P (Classical.propDecidable _) 1 0
    21def expectation {A : Type*} [Fintype A] (μ f : Weight A) : ℝ := ∑ x, μ x * f x
    22def mass {A : Type*} [Fintype A] (μ : Weight A) (P : A → Prop) : ℝ :=
    23 expectation μ (fun x => indicator (P x))
    24def Probability {A : Type*} [Fintype A] (μ : Weight A) : Prop :=
    25 (∀ x, 0 ≤ μ x) ∧ ∑ x, μ x = 1
    26def Subprobability {A : Type*} [Fintype A] (μ : Weight A) : Prop :=
    27 (∀ x, 0 ≤ μ x) ∧ ∑ x, μ x ≤ 1
    28def product {A B : Type*} (μ : Weight A) (ν : Weight B) : Weight (A × B) :=
    29 fun x => μ x.1 * ν x.2
    30def pushforward {A B : Type*} [Fintype A] (μ : Weight A) (p : A → B) : Weight B :=
    31 fun c => mass μ (fun x => p x = c)
    32def inner {A : Type*} [Fintype A] (μ f g : Weight A) : ℝ :=
    33 expectation μ (fun x => f x * g x)
    34def project {A B : Type*} [Fintype A] (μ : Weight A) (p : A → B)
    35 (f : Weight A) : Weight A :=
    36 fun x => pushforward (fun y => μ y * f y) p (p x) / pushforward μ p (p x)
    37def density {A : Type*} (μ x : Weight A) : Weight A := fun a => x a / μ a
    38def dominatedSupport {A : Type*} (x μ : Weight A) : Prop :=
    39 ∀ a, x a ≠ 0 → μ a ≠ 0
    40def bounded {A : Type*} (f : Weight A) : Prop := (∀ x, 0 ≤ f x) ∧ (∀ x, f x ≤ 1)
    41def l1 {A : Type*} [Fintype A] (x y : Weight A) : ℝ := ∑ a, |x a - y a|
    42def clip {A : Type*} (R : ℝ) (μ x : Weight A) : Weight A :=
    43 fun a => min (max (density μ x a) 0) R
    44def projectionError {A B : Type*} [Fintype A]
    45 (μ f g : Weight A) (p : A → B) : ℝ :=
    46 inner μ f g - inner μ (project μ p f) (project μ p g)
    47def tail {A : Type*} [Fintype A] (R : ℝ) (μ x : Weight A) : ℝ :=
    48 mass x (fun a => R ≤ density μ x a)
    49def cellError {A B : Type*} [Fintype A] [Fintype B]
    50 (μ : Weight A) (p : A → B) (f x : Weight A) : ℝ :=
    51 l1 (pushforward (fun a => μ a * f a) p) (pushforward x p)
    52def HasNet {A : Type*} [Fintype A] (P : Weight A → Prop) (r : ℕ) (ε : ℝ) : Prop :=
    53 ∃ t : ℕ, t ≤ r ∧ ∃ f : Fin t → Weight A, ∀ x, P x → ∃ i, l1 x (f i) ≤ ε
    54
    55end
    56end Lax793645.FiniteProbability
    57

    Discussion

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

    Loading discussion…