PMF map uniform Of Fintype of fiber const
PMF.map_uniformOfFintype_of_fiber_const
Plain-language statement
Pushforward of PMF.uniformOfFintype α under a map f : α → β whose fibers over the image all have the same cardinality k > 0 is the uniform distribution on the image of f. Useful when f is an affine-linear surjection: every fiber is a translate of the kernel and hence has constant cardinality. The proximity-gap proofs use this to bridge the coeff...
Exact Lean statement
theorem PMF.map_uniformOfFintype_of_fiber_const
{α β : Type*} [Fintype α] [Nonempty α] [DecidableEq β]
(f : α → β) {k : ℕ} (hk : 0 < k)
(hfib : ∀ b ∈ Finset.univ.image f,
((Finset.univ : Finset α).filter (f · = b)).card = k) :
(PMF.uniformOfFintype α).map f =
PMF.uniformOfFinset (Finset.univ.image f)
(Finset.image_nonempty.mpr Finset.univ_nonempty)Formal artifact
Lean source
theorem PMF.map_uniformOfFintype_of_fiber_const {α β : Type*} [Fintype α] [Nonempty α] [DecidableEq β] (f : α → β) {k : ℕ} (hk : 0 < k) (hfib : ∀ b ∈ Finset.univ.image f, ((Finset.univ : Finset α).filter (f · = b)).card = k) : (PMF.uniformOfFintype α).map f = PMF.uniformOfFinset (Finset.univ.image f) (Finset.image_nonempty.mpr Finset.univ_nonempty) := by classical -- Total count = k * |image|. have h_card : Fintype.card α = k * (Finset.univ.image f).card := by rw [show Fintype.card α = (Finset.univ : Finset α).card from rfl, Finset.card_eq_sum_card_image f Finset.univ, Finset.sum_const_nat hfib] ring have h_k_ne : (k : ENNReal) ≠ 0 := Nat.cast_ne_zero.mpr hk.ne' have h_k_lt_top : (k : ENNReal) ≠ ⊤ := ENNReal.natCast_ne_top _ -- PMF extensionality. ext b rw [PMF.map_apply, PMF.uniformOfFinset_apply] simp_rw [PMF.uniformOfFintype_apply] -- LHS: ∑' a, if b = f a then (Fintype.card α)⁻¹ else 0 rw [tsum_fintype, Finset.sum_ite, Finset.sum_const_zero, add_zero, Finset.sum_const, nsmul_eq_mul] by_cases hb : b ∈ Finset.univ.image f · -- b ∈ image: filter (b = f ·) has card k. rw [if_pos hb] have h_filter_card : (Finset.univ.filter (fun a => b = f a)).card = k := by have h_swap : Finset.univ.filter (fun a => b = f a) = Finset.univ.filter (fun a => f a = b) := by ext a simp [eq_comm] rw [h_swap] exact hfib b hb rw [h_filter_card, h_card] -- Goal: ↑k * (↑(k * |image|))⁻¹ = (↑|image|)⁻¹ push_cast rw [ENNReal.mul_inv (Or.inl h_k_ne) (Or.inl h_k_lt_top), ← mul_assoc, ENNReal.mul_inv_cancel h_k_ne h_k_lt_top, one_mul] · -- b ∉ image: filter is empty. rw [if_neg hb] have h_empty : Finset.univ.filter (fun a => b = f a) = ∅ := by ext a simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.notMem_empty, iff_false] intro h apply hb exact h ▸ Finset.mem_image_of_mem f (Finset.mem_univ a) rw [h_empty, Finset.card_empty] simp- Project
- ArkLib
- License
- Apache-2.0
- Commit
- fad5cbf80877
- Source
- ArkLib/Data/Probability/Instances.lean:502-552
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
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...
Source project: ArkLib
Person-level attribution pending.
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.
Source project: ArkLib
Person-level attribution pending.
Gadget Decompose lawful
ArkLib.Lattices.Ajtai.gadgetDecompose_lawful
Plain-language statement
The base-b gadget decomposition is a lawful gadget decomposition.
Source project: ArkLib
Person-level attribution pending.