Documentation

CslibFrontier.Probability.Product.Reindex

Relabelling the coordinates of a finite product #

Relabelling the coordinates of an independent product along an equivalence of the index types gives the independent product of the relabelled factors. In particular an independent product indexed by a product type ι × κ is a product of independent blocks indexed by ι, each an independent product indexed by κ, and a sample of q * m independent points splits into q independent blocks of m points along finProdFinEquiv.

Main results #

theorem Cslib.Probability.PMF.pi_map_piCongrLeft_symm {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] {α : ι → Type u_3} [∀ (i : ι), Finite (α i)] (p : (i : ι) → PMF (α i)) (e : κ ≃ ι) :
PMF.map (⇑(Equiv.piCongrLeft α e).symm) (pi p) = pi fun (k : κ) => p (e k)

Relabelling the coordinates of an independent product along an equivalence e of the index types gives the product of the relabelled factors.

theorem Cslib.Probability.PMF.pi_map_comp_equiv {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] {γ : Type u_3} [Finite γ] (p : PMF γ) (e : κ ≃ ι) :
PMF.map (fun (b : ι → γ) (k : κ) => b (e k)) (pi fun (x : ι) => p) = pi fun (x : κ) => p

Relabelling the coordinates of an independent sample along an equivalence e of the index types gives an independent sample.

theorem Cslib.Probability.PMF.pi_map_curry {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] {γ : Type u_3} [Finite γ] (p : ι × κ → PMF γ) :
PMF.map Function.curry (pi p) = pi fun (i : ι) => pi fun (k : κ) => p (i, k)

An independent product indexed by ι × κ is a product of independent blocks indexed by ι, each an independent product indexed by κ.

theorem Cslib.Probability.PMF.pi_map_finProdFinEquiv {γ : Type u_3} [Finite γ] (p : PMF γ) (q m : ℕ) :
PMF.map (fun (b : Fin (q * m) → γ) (j : Fin q) (k : Fin m) => b (finProdFinEquiv (j, k))) (pi fun (x : Fin (q * m)) => p) = pi fun (x : Fin q) => pi fun (x : Fin m) => p

An independent sample of q * m points is a sample of q independent blocks of m points, the block j consisting of the points finProdFinEquiv (j, k).