All proofs
Project-declaredLean 4.31.0 · mathlib@fabf563a7c95

Prob split uniform sampling of equiv prod

prob_split_uniform_sampling_of_equiv_prod

Project documentation

Generic Probability Splitting Lemma (via Equivalence) This lemma proves that a single probability statement over a uniform distribution on a type α can be rewritten as a sequential probability statement over two smaller, independent distributions γ and δ, given an equivalence e : α ≃ γ × δ. This is a formal "change of variables" for probabilit...

Exact Lean statement

theorem prob_split_uniform_sampling_of_equiv_prod {α γ δ : Type}
    -- Fintype & Nonempty assumptions for all types
    [Fintype α] [Fintype γ] [Fintype δ]
    [Nonempty α] [Nonempty γ] [Nonempty δ]
    -- The equivalence that splits α into γ × δ
    (e : α ≃ γ × δ)
    -- The predicate on the original (combined) type
    (P : α → Prop)
    :
    -- LHS: Probability over the combined space
    Pr_{ let r ← $ᵖ α }[ P r ] =
    -- RHS: Probability over the sequential, split spaces
    Pr_{ let x ← $ᵖ γ; let y ← $ᵖ δ }[ P (e.symm (x, y)) ]

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem prob_split_uniform_sampling_of_equiv_prod {α γ δ : Type}    -- Fintype & Nonempty assumptions for all types    [Fintype α] [Fintype γ] [Fintype δ]    [Nonempty α] [Nonempty γ] [Nonempty δ]    -- The equivalence that splits α into γ × δ    (e : α ≃ γ × δ)    -- The predicate on the original (combined) type    (P : α  Prop)    :    -- LHS: Probability over the combined space    Pr_{ let r  $ᵖ α }[ P r ] =    -- RHS: Probability over the sequential, split spaces    Pr_{ let x  $ᵖ γ; let y  $ᵖ δ }[ P (e.symm (x, y)) ] := by  classical  -- 1. Unroll the LHS (a single `let`) using `prStx_unfold_final`  -- LHS = ∑' r, Pr[r] * (if P r then 1 else 0)  rw [prob_tsum_form_singleton]  let D_rest := fun (x : γ) => (do    let y  $ᵖ δ    return (P (e.symm (x, y)))  )  conv_rhs =>    apply prob_tsum_form_split_first (D := $ᵖ γ) (D_rest := D_rest)  simp_rw [D_rest]  simp only [PMF.uniformOfFintype_apply, mul_ite, mul_one, mul_zero]  simp_rw [prob_tsum_form_singleton]  -- ⊢ (∑' (x : α), ... = ∑' (x : γ), (↑(Fintype.card γ))⁻¹ * ∑' (x_1 : δ), ...  conv_rhs => enter [1, x]; rw [ENNReal.tsum_mul_left]  -- ⊢ (∑' (x : α), ... = ∑' (x : γ) (i : δ), ...  rw [ENNReal.tsum_prod]  -- ⊢ (∑' (x : α), ...) = (∑' (p : γ × δ), ...)  conv_lhs =>    rw [tsum_eq_sum (α := ENNReal) (β := α) (f :=      fun x => if P x then (↑(Fintype.card α))⁻¹ else 0) (s := Finset.univ) (hf := fun b => by      simp only [mem_univ, not_true_eq_false, ite_eq_right_iff, ENNReal.inv_eq_zero,        IsEmpty.forall_iff]    )]  conv_rhs =>    rw [tsum_eq_sum (α := ENNReal) (β := γ × δ) (f := fun x =>      (↑(Fintype.card γ))⁻¹ * (($ᵖ δ) x.2 * if P (e.symm x) then 1 else 0)    ) (s := Finset.univ) (hf := fun b => by      simp only [mem_univ, not_true_eq_false, IsEmpty.forall_iff]    )]  -- ⊢ (∑ b : α, .. = ..) = (∑ b : γ × δ, ..)  have hcard_of_equiv: (Fintype.card α) = (Fintype.card (γ × δ)) := Fintype.card_congr e  rw [Finset.sum_equiv (s := Finset.univ:= α)) (t := Finset.univ:= γ × δ))    (f := fun x => if P x then (↑(Fintype.card α))⁻¹ else 0)    (g := fun x => (↑(Fintype.card γ))⁻¹ * (($ᵖ δ) x.2 * if P (e.symm x) then 1 else 0))    (e := e) (hst := fun i => by    simp only [mem_univ]  ) (hfg := fun i => by    simp only [mem_univ, PMF.uniformOfFintype_apply, Equiv.symm_apply_apply, mul_ite, mul_one,      mul_zero, forall_const]    by_cases hP : P i    · simp only [hP, ↓reduceIte]      rw [hcard_of_equiv]      rw [ENNReal.mul_inv_rev_ENNReal (ha := Fintype.card_ne_zero)]      rw [Fintype.card_prod]; rw [Nat.cast_mul]    · simp only [hP, ↓reduceIte]  )]
Project
ArkLib
License
Apache-2.0
Commit
fad5cbf80877
Source
ArkLib/Data/Probability/Instances.lean:236-295

Reuse this declaration

Bring the exact result into your workflow

The import identifies the source module. Your project still needs the pinned package dependency shown on this page.

What this badge means

This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.

Continue in this project

Related declarations

Project-declaredLean 4.31.0

Affine gaps lifted to interleaved codes

affine_gaps_lifted_to_interleaved_codes

Project documentation

This lemma proves the final algebraic step in the DG25 Theorem 3.1 proof. It shows that if R > e + 1, then e * (R / (R - 1)) < e + 1. The intuition is that the fraction R / (R - 1) is always greater than 1, but as R gets larger, it gets closer to 1. The hypothesis R > e + 1 provides a strong enough bound to ensure the product e * (fraction) do...

cryptographyproof systemscoding theory

Source project: ArkLib

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

Gadget Decompose coeff

ArkLib.Lattices.Ajtai.gadgetDecompose_coeff

Plain-language statement

The k-th coefficient (k < deg φ) of a gadget-decomposition block is exactly the corresponding digit of the corresponding input coefficient.

cryptographyproof systemscoding theory

Source project: ArkLib

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

Gadget Decompose lawful

ArkLib.Lattices.Ajtai.gadgetDecompose_lawful

Plain-language statement

The base-b gadget decomposition is a lawful gadget decomposition.

cryptographyproof systemscoding theory

Source project: ArkLib

Person-level attribution pending.

View proof record