project
stringclasses
1 value
name
stringlengths
7
39
informal
stringlengths
127
4.37k
formal
stringlengths
82
14.6k
informal_source
stringlengths
36
53
formal_source
stringlengths
21
46
PFR
I_one_le
\begin{lemma}\label{phi-first-estimate}\lean{I_one_le}\leanok $I_1\le 2\eta d[X_1;X_2]$ \end{lemma} \begin{proof}\leanok \uses{phi-min-def,first-fibre} Similar to \Cref{first-estimate}: get upper bounds for $d[X_1;X_2]$ by $\phi[X_1;X_2]\le \phi[X_1+X_2;\tilde X_1+\tilde X_2]$ and $\phi[X_1;X_2]\le \phi[X_1|X_1+X_2;\tilde X_2|\tilde X_1+\tilde X_2]$, and then apply \Cref{first-fibre} to get an upper bound for $I_1$. \end{proof}
/-- $I_1\le 2\eta d[X_1;X_2]$ -/ lemma I_one_le (hA : A.Nonempty) : I₁ ≤ 2 * η * d[ X₁ # X₂ ] := by have : d[X₁ + X₂' # X₂ + X₁'] + d[X₁ | X₁ + X₂' # X₂ | X₂ + X₁'] + I₁ = 2 * k := rdist_add_rdist_add_condMutual_eq _ _ _ _ hX₁ hX₂ hX₁' hX₂' h₁ h₂ h_indep.reindex_four_abdc have : k - η * (ρ[X₁ | X₁ + X₂' # A] - ρ[X₁ # A]) - η * (ρ[X₂ | X₂ + X₁' # A] - ρ[X₂ # A]) ≤ d[X₁ | X₁ + X₂' # X₂ | X₂ + X₁'] := condRho_le_condRuzsaDist_of_phiMinimizes h_min hX₁ hX₂ (by fun_prop) (by fun_prop) have : k - η * (ρ[X₁ + X₂' # A] - ρ[X₁ # A]) - η * (ρ[X₂ + X₁' # A] - ρ[X₂ # A]) ≤ d[X₁ + X₂' # X₂ + X₁'] := le_rdist_of_phiMinimizes h_min (hX₁.add hX₂') (hX₂.add hX₁') have : ρ[X₁ + X₂' # A] ≤ (ρ[X₁ # A] + ρ[X₂ # A] + d[ X₁ # X₂ ]) / 2 := by rw [rho_eq_of_identDistrib h₂, (IdentDistrib.refl hX₁.aemeasurable).rdist_eq h₂] apply rho_of_sum_le hX₁ hX₂' hA simpa using h_indep.indepFun (show (0 : Fin 4) ≠ 3 by decide) have : ρ[X₂ + X₁' # A] ≤ (ρ[X₁ # A] + ρ[X₂ # A] + d[ X₁ # X₂ ]) / 2 := by rw [add_comm, rho_eq_of_identDistrib h₁, h₁.rdist_eq (IdentDistrib.refl hX₂.aemeasurable)] apply rho_of_sum_le hX₁' hX₂ hA simpa using h_indep.indepFun (show (2 : Fin 4) ≠ 1 by decide) have : ρ[X₁ | X₁ + X₂' # A] ≤ (ρ[X₁ # A] + ρ[X₂ # A] + d[ X₁ # X₂ ]) / 2 := by rw [rho_eq_of_identDistrib h₂, (IdentDistrib.refl hX₁.aemeasurable).rdist_eq h₂] apply condRho_of_sum_le hX₁ hX₂' hA simpa using h_indep.indepFun (show (0 : Fin 4) ≠ 3 by decide) have : ρ[X₂ | X₂ + X₁' # A] ≤ (ρ[X₁ # A] + ρ[X₂ # A] + d[ X₁ # X₂ ]) / 2 := by have : ρ[X₂ | X₂ + X₁' # A] ≤ (ρ[X₂ # A] + ρ[X₁' # A] + d[ X₂ # X₁' ]) / 2 := by apply condRho_of_sum_le hX₂ hX₁' hA simpa using h_indep.indepFun (show (1 : Fin 4) ≠ 2 by decide) have I : ρ[X₁' # A] = ρ[X₁ # A] := rho_eq_of_identDistrib h₁.symm have J : d[X₂ # X₁'] = d[X₁ # X₂] := by rw [rdist_symm, h₁.rdist_eq (IdentDistrib.refl hX₂.aemeasurable)] linarith nlinarith /- ***************************************** Second estimate ********************************************* -/ include hX₁ hX₂ hX₁' hX₂' h₁ h₂ h_indep in
pfr/blueprint/src/chapter/further_improvement.tex:227
pfr/PFR/RhoFunctional.lean:1294
PFR
I_two_le
\begin{lemma}\label{phi-second-estimate}\lean{I_two_le}\leanok $I_2\le 2\eta d[X_1;X_2] + \frac{\eta}{1-\eta}(2\eta d[X_1;X_2]-I_1)$. \end{lemma} \begin{proof}\leanok \uses{phi-min-def,cor-fibre,I1-I2-diff} First of all, by $\phi[X_1;X_2]\le \phi[X_1+\tilde X_1;X_2+\tilde X_2]$, $\phi[X_1;X_2]\le \phi[X_1|X_1+\tilde X_1;X_2|X_2+\tilde X_2]$, and the fibring identity obtained by applying \Cref{cor-fibre} on $(X_1,X_2,\tilde X_1,\tilde X_2)$, we have $I_2\le \eta (d[X_1;X_1]+d[X_2;X_2])$. Then apply \Cref{I1-I2-diff} to get $I_2\le 2\eta d[X_1;X_2] +\eta(I_2-I_1)$, and rearrange. \end{proof}
/-- $I_2\le 2\eta d[X_1;X_2] + \frac{\eta}{1-\eta}(2\eta d[X_1;X_2]-I_1)$. -/ lemma I_two_le (hA : A.Nonempty) (h'η : η < 1) : I₂ ≤ 2 * η * k + (η / (1 - η)) * (2 * η * k - I₁) := by have W : k - η * (ρ[X₁ + X₁' # A] - ρ[X₁ # A]) - η * (ρ[X₂ + X₂' # A] - ρ[X₂ # A]) ≤ d[X₁ + X₁' # X₂ + X₂'] := le_rdist_of_phiMinimizes h_min (hX₁.add hX₁') (hX₂.add hX₂') (μ₁ := ℙ) (μ₂ := ℙ) have W' : k - η * (ρ[X₁ | X₁ + X₁' # A] - ρ[X₁ # A]) - η * (ρ[X₂ | X₂ + X₂' # A] - ρ[X₂ # A]) ≤ d[X₁ | X₁ + X₁' # X₂ | X₂ + X₂'] := condRho_le_condRuzsaDist_of_phiMinimizes h_min hX₁ hX₂ (hX₁.add hX₁') (hX₂.add hX₂') have Z : 2 * k = d[X₁ + X₁' # X₂ + X₂'] + d[X₁ | X₁ + X₁' # X₂ | X₂ + X₂'] + I₂ := I_two_aux' h₁ h₂ h_indep hX₁ hX₂ hX₁' hX₂' have : ρ[X₁ + X₁' # A] ≤ (ρ[X₁ # A] + ρ[X₁ # A] + d[ X₁ # X₁ ]) / 2 := by refine (rho_of_sum_le hX₁ hX₁' hA (by simpa using h_indep.indepFun (show (0 : Fin 4) ≠ 2 by decide))).trans_eq ?_ rw [rho_eq_of_identDistrib h₁.symm, IdentDistrib.rdist_eq (IdentDistrib.refl hX₁.aemeasurable) h₁] have : ρ[X₂ + X₂' # A] ≤ (ρ[X₂ # A] + ρ[X₂ # A] + d[ X₂ # X₂ ]) / 2 := by refine (rho_of_sum_le hX₂ hX₂' hA (by simpa using h_indep.indepFun (show (1 : Fin 4) ≠ 3 by decide))).trans_eq ?_ rw [rho_eq_of_identDistrib h₂.symm, IdentDistrib.rdist_eq (IdentDistrib.refl hX₂.aemeasurable) h₂] have : ρ[X₁ | X₁ + X₁' # A] ≤ (ρ[X₁ # A] + ρ[X₁ # A] + d[ X₁ # X₁ ]) / 2 := by refine (condRho_of_sum_le hX₁ hX₁' hA (by simpa using h_indep.indepFun (show (0 : Fin 4) ≠ 2 by decide))).trans_eq ?_ rw [rho_eq_of_identDistrib h₁.symm, IdentDistrib.rdist_eq (IdentDistrib.refl hX₁.aemeasurable) h₁] have : ρ[X₂ | X₂ + X₂' # A] ≤ (ρ[X₂ # A] + ρ[X₂ # A] + d[ X₂ # X₂ ]) / 2 := by refine (condRho_of_sum_le hX₂ hX₂' hA (by simpa using h_indep.indepFun (show (1 : Fin 4) ≠ 3 by decide))).trans_eq ?_ rw [rho_eq_of_identDistrib h₂.symm, IdentDistrib.rdist_eq (IdentDistrib.refl hX₂.aemeasurable) h₂] have : I₂ ≤ η * (d[X₁ # X₁] + d[X₂ # X₂]) := by nlinarith rw [rdist_add_rdist_eq h₁ h₂ h_indep hX₁ hX₂ hX₁' hX₂'] at this have one_eta : 0 < 1 - η := by linarith apply (mul_le_mul_iff_of_pos_left one_eta).1 have : (1 - η) * I₂ ≤ 2 * η * k - I₁ * η := by linarith apply this.trans_eq field_simp ring /- **************************************** End Game ******************************************* -/ include h_min in omit [IsProbabilityMeasure (ℙ : Measure Ω)] in /-- If $G$-valued random variables $T_1,T_2,T_3$ satisfy $T_1+T_2+T_3=0$, then $$d[X_1;X_2]\le 3\bbI[T_1:T_2\mid T_3] + (2\bbH[T_3]-\bbH[T_1]-\bbH[T_2])+ \eta(\rho(T_1|T_3)+\rho(T_2|T_3)-\rho(X_1)-\rho(X_2)).$$ -/
pfr/blueprint/src/chapter/further_improvement.tex:244
pfr/PFR/RhoFunctional.lean:1407
PFR
KLDiv_add_le_KLDiv_of_indep
\begin{lemma}[Kullback--Leibler and sums]\label{kl-sums}\lean{KLDiv_add_le_KLDiv_of_indep}\leanok If $X, Y, Z$ are independent $G$-valued random variables, then $$D_{KL}(X+Z\Vert Y+Z) \leq D_{KL}(X\Vert Y).$$ \end{lemma} \begin{proof}\leanok \uses{kl-div-inj,kl-div-convex} For each $z$, $D_{KL}(X+z\Vert Y+z)=D_{KL}(X\Vert Y)$ by \Cref{kl-div-inj}. Then apply \Cref{kl-div-convex} with $w_z=\mathbf{P}(Z=z)$. \end{proof}
lemma KLDiv_add_le_KLDiv_of_indep [Fintype G] [AddCommGroup G] [DiscreteMeasurableSpace G] {X Y Z : Ω → G} [IsZeroOrProbabilityMeasure μ] (h_indep : IndepFun (⟨X, Y⟩) Z μ) (hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (habs : ∀ x, μ.map Y {x} = 0 → μ.map X {x} = 0) : KL[X + Z ; μ # Y + Z ; μ] ≤ KL[X ; μ # Y ; μ] := by rcases eq_zero_or_isProbabilityMeasure μ with rfl | hμ · simp [KLDiv] set X' : G → Ω → G := fun s ↦ (· + s) ∘ X with hX' set Y' : G → Ω → G := fun s ↦ (· + s) ∘ Y with hY' have AX' x i : μ.map (X' i) {x} = μ.map X {x - i} := by rw [hX', ← Measure.map_map (by fun_prop) (by fun_prop), Measure.map_apply (by fun_prop) (measurableSet_singleton x)] congr ext y simp [sub_eq_add_neg] have AY' x i : μ.map (Y' i) {x} = μ.map Y {x - i} := by rw [hY', ← Measure.map_map (by fun_prop) (by fun_prop), Measure.map_apply (by fun_prop) (measurableSet_singleton x)] congr ext y simp [sub_eq_add_neg] let w : G → ℝ := fun s ↦ (μ.map Z {s}).toReal have sum_w : ∑ s, w s = 1 := by have : IsProbabilityMeasure (μ.map Z) := isProbabilityMeasure_map hZ.aemeasurable simp [w] have A x : (μ.map (X + Z) {x}).toReal = ∑ s, w s * (μ.map (X' s) {x}).toReal := by have : IndepFun X Z μ := h_indep.comp (φ := Prod.fst) (ψ := id) measurable_fst measurable_id rw [this.map_add_singleton_eq_sum hX hZ, ENNReal.toReal_sum (by simp [ENNReal.mul_eq_top])] simp only [ENNReal.toReal_mul] congr with i congr 1 rw [AX'] have B x : (μ.map (Y + Z) {x}).toReal = ∑ s, w s * (μ.map (Y' s) {x}).toReal := by have : IndepFun Y Z μ := h_indep.comp (φ := Prod.snd) (ψ := id) measurable_snd measurable_id rw [this.map_add_singleton_eq_sum hY hZ, ENNReal.toReal_sum (by simp [ENNReal.mul_eq_top])] simp only [ENNReal.toReal_mul] congr with i congr 1 rw [AY'] have : KL[X + Z ; μ # Y + Z; μ] ≤ ∑ s, w s * KL[X' s ; μ # Y' s ; μ] := by apply KLDiv_of_convex (fun s _ ↦ by simp [w]) · exact A · exact B · intro s _ x rw [AX', AY'] exact habs _ apply this.trans_eq have C s : KL[X' s ; μ # Y' s ; μ] = KL[X ; μ # Y ; μ] := KLDiv_of_comp_inj (add_left_injective s) hX hY simp_rw [C, ← Finset.sum_mul, sum_w, one_mul] /-- If $X,Y,Z$ are random variables, with $X,Z$ defined on the same sample space, we define $$ D_{KL}(X|Z \Vert Y) := \sum_z \mathbf{P}(Z=z) D_{KL}( (X|Z=z) \Vert Y).$$ -/ noncomputable def condKLDiv {S : Type*} (X : Ω → G) (Y : Ω' → G) (Z : Ω → S) (μ : Measure Ω := by volume_tac) (μ' : Measure Ω' := by volume_tac) : ℝ := ∑' z, (μ (Z⁻¹' {z})).toReal * KL[X ; (ProbabilityTheory.cond μ (Z⁻¹' {z})) # Y ; μ'] @[inherit_doc condKLDiv] notation3:max "KL[" X " | " Z " ; " μ " # " Y " ; " μ' "]" => condKLDiv X Y Z μ μ' @[inherit_doc condKLDiv] notation3:max "KL[" X " | " Z " # " Y "]" => condKLDiv X Y Z volume volume /-- If $X, Y$ are $G$-valued random variables, and $Z$ is another random variable defined on the same sample space as $X$, then $$D_{KL}((X|Z)\Vert Y) = D_{KL}(X\Vert Y) + \bbH[X] - \bbH[X|Z].$$ -/
pfr/blueprint/src/chapter/further_improvement.tex:51
pfr/PFR/Kullback.lean:265
PFR
KLDiv_eq_zero_iff_identDistrib
\begin{lemma}[Converse Gibbs inequality]\label{Gibbs-converse}\lean{KLDiv_eq_zero_iff_identDistrib}\leanok If $D_{KL}(X\Vert Y) = 0$, then $Y$ is a copy of $X$. \end{lemma} \begin{proof}\leanok \uses{converse-log-sum} Apply \Cref{converse-log-sum}. \end{proof}
/-- `KL(X ‖ Y) = 0` if and only if `Y` is a copy of `X`. -/ lemma KLDiv_eq_zero_iff_identDistrib [Fintype G] [MeasurableSingletonClass G] [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] (hX : Measurable X) (hY : Measurable Y) (habs : ∀ x, μ'.map Y {x} = 0 → μ.map X {x} = 0) : KL[X ; μ # Y ; μ'] = 0 ↔ IdentDistrib X Y μ μ' := by refine ⟨fun h ↦ ?_, fun h ↦ by simp [KLDiv, h.map_eq]⟩ let νY := μ'.map Y have : IsProbabilityMeasure νY := isProbabilityMeasure_map hY.aemeasurable let νX := μ.map X have : IsProbabilityMeasure νX := isProbabilityMeasure_map hX.aemeasurable obtain ⟨r, hr⟩ : ∃ (r : ℝ), ∀ x ∈ Finset.univ, (νX {x}).toReal = r * (νY {x}).toReal := by apply sum_mul_log_div_eq_iff (by simp) (by simp) (fun i _ hi ↦ ?_) · rw [KLDiv_eq_sum] at h simpa using h · simp only [ENNReal.toReal_eq_zero_iff, measure_ne_top, or_false] at hi simp [habs i hi, νX] have r_eq : r = 1 := by have : r * ∑ x, (νY {x}).toReal = ∑ x, (νX {x}).toReal := by simp only [Finset.mul_sum, Finset.mem_univ, hr] simpa using this have : νX = νY := by apply Measure.ext_iff_singleton.mpr (fun x ↦ ?_) simpa [r_eq, ENNReal.toReal_eq_toReal] using hr x (Finset.mem_univ _) exact ⟨hX.aemeasurable, hY.aemeasurable, this⟩ /-- If $S$ is a finite set, $w_s$ is non-negative, and ${\bf P}(X=x) = \sum_{s\in S} w_s {\bf P}(X_s=x)$, ${\bf P}(Y=x) = \sum_{s\in S} w_s {\bf P}(Y_s=x)$ for all $x$, then $$D_{KL}(X\Vert Y) \le \sum_{s\in S} w_s D_{KL}(X_s\Vert Y_s).$$ -/
pfr/blueprint/src/chapter/further_improvement.tex:25
pfr/PFR/Kullback.lean:89
PFR
KLDiv_nonneg
\begin{lemma}[Gibbs inequality]\label{Gibbs}\uses{kl-div}\lean{KLDiv_nonneg}\leanok $D_{KL}(X\Vert Y) \geq 0$. \end{lemma} \begin{proof}\leanok \uses{log-sum} Apply \Cref{log-sum} on the definition. \end{proof}
/-- `KL(X ‖ Y) ≥ 0`.-/ lemma KLDiv_nonneg [Fintype G] [MeasurableSingletonClass G] [IsZeroOrProbabilityMeasure μ] [IsZeroOrProbabilityMeasure μ'] (hX : Measurable X) (hY : Measurable Y) (habs : ∀ x, μ'.map Y {x} = 0 → μ.map X {x} = 0) : 0 ≤ KL[X ; μ # Y ; μ'] := by rw [KLDiv_eq_sum] rcases eq_zero_or_isProbabilityMeasure μ with rfl | hμ · simp rcases eq_zero_or_isProbabilityMeasure μ' with rfl | hμ' · simp apply le_trans ?_ (sum_mul_log_div_leq (by simp) (by simp) ?_) · have : IsProbabilityMeasure (μ'.map Y) := isProbabilityMeasure_map hY.aemeasurable have : IsProbabilityMeasure (μ.map X) := isProbabilityMeasure_map hX.aemeasurable simp · intro i _ hi simp only [ENNReal.toReal_eq_zero_iff, measure_ne_top, or_false] at hi simp [habs i hi]
pfr/blueprint/src/chapter/further_improvement.tex:17
pfr/PFR/Kullback.lean:71
PFR
KLDiv_of_comp_inj
\begin{lemma}[Kullback--Leibler and injections]\label{kl-div-inj}\lean{KLDiv_of_comp_inj}\leanok If $f:G \to H$ is an injection, then $D_{KL}(f(X)\Vert f(Y)) = D_{KL}(X\Vert Y)$. \end{lemma} \begin{proof}\leanok\uses{kl-div} Clear from definition. \end{proof}
/-- If $f:G \to H$ is an injection, then $D_{KL}(f(X)\Vert f(Y)) = D_{KL}(X\Vert Y)$. -/ lemma KLDiv_of_comp_inj {H : Type*} [MeasurableSpace H] [DiscreteMeasurableSpace G] [MeasurableSingletonClass H] {f : G → H} (hf : Function.Injective f) (hX : Measurable X) (hY : Measurable Y) : KL[f ∘ X ; μ # f ∘ Y ; μ'] = KL[X ; μ # Y ; μ'] := by simp only [KLDiv] rw [← hf.tsum_eq] · symm congr with x have : (Measure.map X μ) {x} = (Measure.map (f ∘ X) μ) {f x} := by rw [Measure.map_apply, Measure.map_apply] · rw [Set.preimage_comp, ← Set.image_singleton, Set.preimage_image_eq _ hf] · exact .comp .of_discrete hX · exact measurableSet_singleton (f x) · exact hX · exact measurableSet_singleton x have : (Measure.map Y μ') {x} = (Measure.map (f ∘ Y) μ') {f x} := by rw [Measure.map_apply, Measure.map_apply] · congr exact Set.Subset.antisymm (fun ⦃a⦄ ↦ congrArg f) fun ⦃a⦄ a_1 ↦ hf a_1 · exact .comp .of_discrete hY · exact measurableSet_singleton (f x) · exact hY · exact measurableSet_singleton x congr · intro y hy have : Measure.map (f ∘ X) μ {y} ≠ 0 := by intro h simp [h] at hy rw [Measure.map_apply (.comp .of_discrete hX) (measurableSet_singleton y)] at this have : f ∘ X ⁻¹' {y} ≠ ∅ := by intro h simp [h] at this obtain ⟨z, hz⟩ := Set.nonempty_iff_ne_empty.2 this simp only [Set.mem_preimage, Function.comp_apply, Set.mem_singleton_iff] at hz exact Set.mem_range.2 ⟨X z, hz⟩
pfr/blueprint/src/chapter/further_improvement.tex:43
pfr/PFR/Kullback.lean:150
PFR
KLDiv_of_convex
\begin{lemma}[Convexity of Kullback--Leibler]\label{kl-div-convex}\lean{KLDiv_of_convex}\leanok If $S$ is a finite set, $\sum_{s \in S} w_s = 1$ for some non-negative $w_s$, and ${\bf P}(X=x) = \sum_{s\in S} w_s {\bf P}(X_s=x)$, ${\bf P}(Y=x) = \sum_{s\in S} w_s {\bf P}(Y_s=x)$ for all $x$, then $$D_{KL}(X\Vert Y) \le \sum_{s\in S} w_s D_{KL}(X_s\Vert Y_s).$$ \end{lemma} \begin{proof}\leanok \uses{kl-div,log-sum} For each $x$, replace $\log \frac{\mathbf{P}(X_s=x)}{\mathbf{P}(Y_s=x)}$ in the definition with $\log \frac{w_s\mathbf{P}(X_s=x)}{w_s\mathbf{P}(Y_s=x)}$ for each $s$, and apply \Cref{log-sum}. \end{proof}
lemma KLDiv_of_convex [Fintype G] [IsFiniteMeasure μ'''] {ι : Type*} {S : Finset ι} {w : ι → ℝ} (hw : ∀ s ∈ S, 0 ≤ w s) (X' : ι → Ω'' → G) (Y' : ι → Ω''' → G) (hconvex : ∀ x, (μ.map X {x}).toReal = ∑ s ∈ S, (w s) * (μ''.map (X' s) {x}).toReal) (hconvex' : ∀ x, (μ'.map Y {x}).toReal = ∑ s ∈ S, (w s) * (μ'''.map (Y' s) {x}).toReal) (habs : ∀ s ∈ S, ∀ x, μ'''.map (Y' s) {x} = 0 → μ''.map (X' s) {x} = 0) : KL[X ; μ # Y ; μ'] ≤ ∑ s ∈ S, w s * KL[X' s ; μ'' # Y' s ; μ'''] := by conv_lhs => rw [KLDiv_eq_sum] have A x : (μ.map X {x}).toReal * log ((μ.map X {x}).toReal / (μ'.map Y {x}).toReal) ≤ ∑ s ∈ S, (w s * (μ''.map (X' s) {x}).toReal) * log ((w s * (μ''.map (X' s) {x}).toReal) / (w s * (μ'''.map (Y' s) {x}).toReal)) := by rw [hconvex, hconvex'] apply sum_mul_log_div_leq (fun s hs ↦ ?_) (fun s hs ↦ ?_) (fun s hs h's ↦ ?_) · exact mul_nonneg (by simp [hw s hs]) (by simp) · exact mul_nonneg (by simp [hw s hs]) (by simp) · rcases mul_eq_zero.1 h's with h | h · simp [h] · simp only [ENNReal.toReal_eq_zero_iff, measure_ne_top, or_false] at h simp [habs s hs x h] have B x : (μ.map X {x}).toReal * log ((μ.map X {x}).toReal / (μ'.map Y {x}).toReal) ≤ ∑ s ∈ S, (w s * (μ''.map (X' s) {x}).toReal) * log ((μ''.map (X' s) {x}).toReal / (μ'''.map (Y' s) {x}).toReal) := by apply (A x).trans_eq apply Finset.sum_congr rfl (fun s _ ↦ ?_) rcases eq_or_ne (w s) 0 with h's | h's · simp [h's] · congr 2 rw [mul_div_mul_left _ _ h's] apply (Finset.sum_le_sum (fun x _ ↦ B x)).trans_eq rw [Finset.sum_comm] simp_rw [mul_assoc, ← Finset.mul_sum, KLDiv_eq_sum]
pfr/blueprint/src/chapter/further_improvement.tex:33
pfr/PFR/Kullback.lean:118
PFR
PFR_conjecture
\begin{theorem}[PFR]\label{pfr} \lean{PFR_conjecture}\leanok If $A \subset {\bf F}_2^n$ is non-empty and $|A+A| \leq K|A|$, then $A$ can be covered by most $2K^{12}$ translates of a subspace $H$ of ${\bf F}_2^n$ with $|H| \leq |A|$. \end{theorem} \begin{proof} \uses{pfr_aux}\leanok Let $H$ be given by \Cref{pfr_aux}. If $|H| \leq |A|$ then we are already done thanks to~\eqref{ah}. If $|H| > |A|$ then we can cover $H$ by at most $2 |H|/|A|$ translates of a subspace $H'$ of $H$ with $|H'| \leq |A|$. We can thus cover $A$ by at most \[2K^{13/2} \frac{|H|^{1/2}}{|A|^{1/2}}\] translates of $H'$, and the claim again follows from~\eqref{ah}. \end{proof}
theorem PFR_conjecture (h₀A : A.Nonempty) (hA : Nat.card (A + A) ≤ K * Nat.card A) : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c < 2 * K ^ 12 ∧ Nat.card H ≤ Nat.card A ∧ A ⊆ c + H := by obtain ⟨A_pos, -, K_pos⟩ : (0 : ℝ) < Nat.card A ∧ (0 : ℝ) < Nat.card (A + A) ∧ 0 < K := PFR_conjecture_pos_aux' h₀A hA -- consider the subgroup `H` given by Lemma `PFR_conjecture_aux`. obtain ⟨H, c, hc, IHA, IAH, A_subs_cH⟩ : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c ≤ K ^ (13/2) * Nat.card A ^ (1/2) * Nat.card H ^ (-1/2) ∧ Nat.card H ≤ K ^ 11 * Nat.card A ∧ Nat.card A ≤ K ^ 11 * Nat.card H ∧ A ⊆ c + H := PFR_conjecture_aux h₀A hA have H_pos : (0 : ℝ) < Nat.card H := by have : 0 < Nat.card H := Nat.card_pos; positivity rcases le_or_lt (Nat.card H) (Nat.card A) with h|h -- If `#H ≤ #A`, then `H` satisfies the conclusion of the theorem · refine ⟨H, c, ?_, h, A_subs_cH⟩ calc Nat.card c ≤ K ^ (13/2 : ℝ) * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ) := hc _ ≤ K ^ (13/2 : ℝ) * (K ^ 11 * Nat.card H) ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ) := by gcongr _ = K ^ 12 := by rpow_ring; norm_num _ < 2 * K ^ 12 := by linarith [show 0 < K ^ 12 by positivity] -- otherwise, we decompose `H` into cosets of one of its subgroups `H'`, chosen so that -- `#A / 2 < #H' ≤ #A`. This `H'` satisfies the desired conclusion. · obtain ⟨H', IH'A, IAH', H'H⟩ : ∃ H' : Submodule (ZMod 2) G, Nat.card H' ≤ Nat.card A ∧ Nat.card A < 2 * Nat.card H' ∧ H' ≤ H := by have A_pos' : 0 < Nat.card A := mod_cast A_pos exact ZModModule.exists_submodule_subset_card_le Nat.prime_two H h.le A_pos'.ne' have : (Nat.card A / 2 : ℝ) < Nat.card H' := by rw [div_lt_iff₀ zero_lt_two, mul_comm]; norm_cast have H'_pos : (0 : ℝ) < Nat.card H' := by have : 0 < Nat.card H' := Nat.card_pos; positivity obtain ⟨u, HH'u, hu⟩ := H'.toAddSubgroup.exists_left_transversal_of_le (H := H.toAddSubgroup) H'H dsimp at HH'u refine ⟨H', c + u, ?_, IH'A, by rwa [add_assoc, HH'u]⟩ calc (Nat.card (c + u) : ℝ) ≤ Nat.card c * Nat.card u := mod_cast natCard_add_le _ ≤ (K ^ (13/2 : ℝ) * Nat.card A ^ (1 / 2 : ℝ) * (Nat.card H ^ (-1 / 2 : ℝ))) * (Nat.card H / Nat.card H') := by gcongr apply le_of_eq rw [eq_div_iff H'_pos.ne'] norm_cast _ < (K ^ (13/2) * Nat.card A ^ (1 / 2) * (Nat.card H ^ (-1 / 2))) * (Nat.card H / (Nat.card A / 2)) := by gcongr _ = 2 * K ^ (13/2) * Nat.card A ^ (-1/2) * Nat.card H ^ (1/2) := by field_simp rpow_ring norm_num _ ≤ 2 * K ^ (13/2) * Nat.card A ^ (-1/2) * (K ^ 11 * Nat.card A) ^ (1/2) := by gcongr _ = 2 * K ^ 12 := by rpow_ring norm_num /-- Corollary of `PFR_conjecture` in which the ambient group is not required to be finite (but) then `H` and `c` are finite. -/
pfr/blueprint/src/chapter/pfr.tex:50
pfr/PFR/Main.lean:276
PFR
PFR_conjecture'
\begin{corollary}[PFR in infinite groups]\label{pfr-cor} \lean{PFR_conjecture'}\leanok If $G$ is an abelian $2$-torsion group, $A \subset G$ is non-empty finite, and $|A+A| \leq K|A| $, then $A$ can be covered by most $2K^{12}$ translates of a finite group $H$ of $G$ with $|H| \leq |A|$. \end{corollary} \begin{proof}\uses{pfr}\leanok Apply \Cref{pfr} to the group generated by $A$, which is isomorphic to $\F_2^n$ for some $n$. \end{proof}
theorem PFR_conjecture' {G : Type*} [AddCommGroup G] [Module (ZMod 2) G] {A : Set G} {K : ℝ} (h₀A : A.Nonempty) (Afin : A.Finite) (hA : Nat.card (A + A) ≤ K * Nat.card A) : ∃ (H : Submodule (ZMod 2) G) (c : Set G), c.Finite ∧ (H : Set G).Finite ∧ Nat.card c < 2 * K ^ 12 ∧ Nat.card H ≤ Nat.card A ∧ A ⊆ c + H := by let G' := Submodule.span (ZMod 2) A let G'fin : Fintype G' := (Afin.submoduleSpan _).fintype let ι : G'→ₗ[ZMod 2] G := G'.subtype have ι_inj : Injective ι := G'.toAddSubgroup.subtype_injective let A' : Set G' := ι ⁻¹' A have A_rg : A ⊆ range ι := by simp only [AddMonoidHom.coe_coe, Submodule.coe_subtype, Subtype.range_coe_subtype, G', ι] exact Submodule.subset_span have cardA' : Nat.card A' = Nat.card A := Nat.card_preimage_of_injective ι_inj A_rg have hA' : Nat.card (A' + A') ≤ K * Nat.card A' := by rwa [cardA', ← preimage_add _ ι_inj A_rg A_rg, Nat.card_preimage_of_injective ι_inj (add_subset_range _ A_rg A_rg)] rcases PFR_conjecture (h₀A.preimage' A_rg) hA' with ⟨H', c', hc', hH', hH'₂⟩ refine ⟨H'.map ι , ι '' c', toFinite _, toFinite (ι '' H'), ?_, ?_, fun x hx ↦ ?_⟩ · rwa [Nat.card_image_of_injective ι_inj] · erw [Nat.card_image_of_injective ι_inj, ← cardA'] exact hH' · erw [← image_add] exact ⟨⟨x, Submodule.subset_span hx⟩, hH'₂ hx, rfl⟩
pfr/blueprint/src/chapter/pfr.tex:63
pfr/PFR/Main.lean:335
PFR
PFR_conjecture_aux
\begin{lemma}\label{pfr_aux} \lean{PFR_conjecture_aux}\leanok If $A \subset {\bf F}_2^n$ is non-empty and $|A+A| \leq K|A|$, then $A$ can be covered by at most $K ^ {13/2}|A|^{1/2}/|H|^{1/2}$ translates of a subspace $H$ of ${\bf F}_2^n$ with \begin{equation} \label{ah} |H|/|A| \in [K^{-11}, K^{11}]. \end{equation} \end{lemma} \begin{proof} \uses{entropy-pfr, unif-exist, uniform-entropy-II, jensen-bound,ruz-dist-def,ruzsa-diff,bound-conc,ruz-cov}\leanok Let $U_A$ be the uniform distribution on $A$ (which exists by \Cref{unif-exist}), thus $\bbH[U_A] = \log |A|$ by \Cref{uniform-entropy-II}. By \Cref{jensen-bound} and the fact that $U_A + U_A$ is supported on $A + A$, $\bbH[U_A + U_A] \leq \log|A+A|$. By \Cref{ruz-dist-def}, the doubling condition $|A+A| \leq K|A|$ therefore gives \[d[U_A;U_A] \leq \log K.\] By \Cref{entropy-pfr}, we may thus find a subspace $H$ of $\F_2^n$ such that \begin{equation}\label{uauh} d[U_A;U_H] \leq \tfrac{1}{2} C' \log K\end{equation} with $C' = 11$. By \Cref{ruzsa-diff} we conclude that \begin{equation*} |\log |H| - \log |A|| \leq C' \log K, \end{equation*} proving~\eqref{ah}. From \Cref{ruz-dist-def},~\eqref{uauh} is equivalent to \[\bbH[U_A - U_H] \leq \log( |A|^{1/2} |H|^{1/2}) + \tfrac{1}{2} C' \log K.\] By \Cref{bound-conc} we conclude the existence of a point $x_0 \in \F_p^n$ such that \[p_{U_A-U_H}(x_0) \geq |A|^{-1/2} |H|^{-1/2} K^{-C'/2},\] or equivalently \[|A \cap (H + x_0)| \geq K^{-C'/2} |A|^{1/2} |H|^{1/2}.\] Applying \Cref{ruz-cov}, we may thus cover $A$ by at most \[\frac{|A + (A \cap (H+x_0))|}{|A \cap (H + x_0)|} \leq \frac{K|A|}{K^{-C'/2} |A|^{1/2} |H|^{1/2}} = K^{C'/2+1} \frac{|A|^{1/2}}{|H|^{1/2}}\] translates of \[\bigl(A \cap (H + x_0)\bigr) - \bigl(A \cap (H + x_0)\bigr) \subseteq H.\] This proves the claim. \end{proof}
lemma PFR_conjecture_aux (h₀A : A.Nonempty) (hA : Nat.card (A + A) ≤ K * Nat.card A) : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c ≤ K ^ (13/2 : ℝ) * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ) ∧ Nat.card H ≤ K ^ 11 * Nat.card A ∧ Nat.card A ≤ K ^ 11 * Nat.card H ∧ A ⊆ c + H := by classical have A_fin : Finite A := by infer_instance let _mG : MeasurableSpace G := ⊤ rw [sumset_eq_sub] at hA have : MeasurableSingletonClass G := ⟨λ _ ↦ trivial⟩ obtain ⟨A_pos, -, K_pos⟩ : (0 : ℝ) < Nat.card A ∧ (0 : ℝ) < Nat.card (A - A) ∧ 0 < K := PFR_conjecture_pos_aux h₀A hA let A' := A.toFinite.toFinset have h₀A' : Finset.Nonempty A' := by simpa [Finset.Nonempty, A'] using h₀A have hAA' : A' = A := Finite.coe_toFinset (toFinite A) rcases exists_isUniform_measureSpace A' h₀A' with ⟨Ω₀, mΩ₀, UA, hP₀, UAmeas, UAunif, -, -⟩ rw [hAA'] at UAunif have : d[UA # UA] ≤ log K := rdist_le_of_isUniform_of_card_add_le h₀A hA UAunif UAmeas rw [← sumset_eq_sub] at hA let p : refPackage Ω₀ Ω₀ G := ⟨UA, UA, UAmeas, UAmeas, 1/9, (by norm_num), (by norm_num)⟩ -- entropic PFR gives a subgroup `H` which is close to `A` for the Rusza distance rcases entropic_PFR_conjecture p (by norm_num) with ⟨H, Ω₁, mΩ₁, UH, hP₁, UHmeas, UHunif, hUH⟩ have H_fin : (H : Set G).Finite := (H : Set G).toFinite rcases independent_copies_two UAmeas UHmeas with ⟨Ω, mΩ, VA, VH, hP, VAmeas, VHmeas, Vindep, idVA, idVH⟩ have VAunif : IsUniform A VA := UAunif.of_identDistrib idVA.symm .of_discrete have VA'unif := VAunif rw [← hAA'] at VA'unif have VHunif : IsUniform H VH := UHunif.of_identDistrib idVH.symm .of_discrete let H' := (H : Set G).toFinite.toFinset have hHH' : H' = (H : Set G) := (toFinite (H : Set G)).coe_toFinset have VH'unif := VHunif rw [← hHH'] at VH'unif have : d[VA # VH] ≤ 11/2 * log K := by rw [idVA.rdist_eq idVH]; linarith have H_pos : (0 : ℝ) < Nat.card H := by have : 0 < Nat.card H := Nat.card_pos positivity have VA_ent : H[VA] = log (Nat.card A) := VAunif.entropy_eq' A_fin VAmeas have VH_ent : H[VH] = log (Nat.card H) := VHunif.entropy_eq' H_fin VHmeas have Icard : |log (Nat.card A) - log (Nat.card H)| ≤ 11 * log K := by rw [← VA_ent, ← VH_ent] apply (diff_ent_le_rdist VAmeas VHmeas).trans linarith have IAH : Nat.card A ≤ K ^ 11 * Nat.card H := by have : log (Nat.card A) ≤ log K * 11 + log (Nat.card H) := by linarith [(le_abs_self _).trans Icard] convert exp_monotone this using 1 · exact (exp_log A_pos).symm · rw [exp_add, exp_log H_pos, ← rpow_def_of_pos K_pos] have IHA : Nat.card H ≤ K ^ 11 * Nat.card A := by have : log (Nat.card H) ≤ log K * 11 + log (Nat.card A) := by linarith [(neg_le_abs _).trans Icard] convert exp_monotone this using 1 · exact (exp_log H_pos).symm · rw [exp_add, exp_log A_pos, ← rpow_def_of_pos K_pos] -- entropic PFR shows that the entropy of `VA - VH` is small have I : log K * (-11/2) + log (Nat.card A) * (-1/2) + log (Nat.card H) * (-1/2) ≤ - H[VA - VH] := by rw [Vindep.rdist_eq VAmeas VHmeas] at this linarith -- therefore, there exists a point `x₀` which is attained by `VA - VH` with a large probability obtain ⟨x₀, h₀⟩ : ∃ x₀ : G, rexp (- H[VA - VH]) ≤ (ℙ : Measure Ω).real ((VA - VH) ⁻¹' {x₀}) := prob_ge_exp_neg_entropy' _ ((VAmeas.sub VHmeas).comp measurable_id') -- massage the previous inequality to get that `A ∩ (H + {x₀})` is large have J : K ^ (-11/2 : ℝ) * Nat.card A ^ (1/2) * Nat.card H ^ (1/2 : ℝ) ≤ Nat.card (A ∩ (H + {x₀}) : Set G) := by rw [VA'unif.measureReal_preimage_sub VAmeas VH'unif VHmeas Vindep] at h₀ have := (Real.exp_monotone I).trans h₀ have hAA'_card : Nat.card A' = Nat.card A := congrArg Nat.card (congrArg Subtype hAA') have hHH'_card : Nat.card H' = Nat.card H := congrArg Nat.card (congrArg Subtype hHH') rw [hAA'_card, hHH'_card, le_div_iff₀] at this convert this using 1 · rw [exp_add, exp_add, ← rpow_def_of_pos K_pos, ← rpow_def_of_pos A_pos, ← rpow_def_of_pos H_pos] rpow_ring norm_num · rw [hAA', hHH'] positivity have Hne : (A ∩ (H + {x₀} : Set G)).Nonempty := by by_contra h' have : (0 : ℝ) < Nat.card (A ∩ (H + {x₀}) : Set G) := lt_of_lt_of_le (by positivity) J simp only [Nat.card_eq_fintype_card, card_of_isEmpty, CharP.cast_eq_zero, lt_self_iff_false, not_nonempty_iff_eq_empty.1 h'] at this /- use Rusza covering lemma to cover `A` by few translates of `A ∩ (H + {x₀}) - A ∩ (H + {x₀})` (which is contained in `H`). The number of translates is at most `#(A + (A ∩ (H + {x₀}))) / #(A ∩ (H + {x₀}))`, where the numerator is controlled as this is a subset of `A + A`, and the denominator is bounded below by the previous inequality`. -/ have Z3 : (Nat.card (A + A ∩ (↑H + {x₀})) : ℝ) ≤ (K ^ (13/2 : ℝ) * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * Nat.card ↑(A ∩ (↑H + {x₀})) := by calc (Nat.card (A + A ∩ (↑H + {x₀})) : ℝ) _ ≤ Nat.card (A + A) := by gcongr; exact Nat.card_mono (toFinite _) <| add_subset_add_left inter_subset_left _ ≤ K * Nat.card A := hA _ = (K ^ (13/2 : ℝ) * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * (K ^ (-11/2 : ℝ) * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (1/2 : ℝ)) := by rpow_ring; norm_num _ ≤ (K ^ (13/2 : ℝ) * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * Nat.card ↑(A ∩ (↑H + {x₀})) := by gcongr obtain ⟨u, huA, hucard, hAu, -⟩ := Set.ruzsa_covering_add (toFinite A) (toFinite (A ∩ ((H + {x₀} : Set G)))) Hne (by convert Z3) have A_subset_uH : A ⊆ u + H := by refine hAu.trans $ add_subset_add_left $ (sub_subset_sub (inter_subset_right ..) (inter_subset_right ..)).trans ?_ rw [add_sub_add_comm, singleton_sub_singleton, sub_self] simp exact ⟨H, u, hucard, IHA, IAH, A_subset_uH⟩ /-- The polynomial Freiman-Ruzsa (PFR) conjecture: if `A` is a subset of an elementary abelian 2-group of doubling constant at most `K`, then `A` can be covered by at most `2 * K ^ 12` cosets of a subgroup of cardinality at most `|A|`. -/
pfr/blueprint/src/chapter/pfr.tex:14
pfr/PFR/Main.lean:163
PFR
PFR_conjecture_improv
\begin{theorem}[Improved PFR]\label{pfr-improv}\lean{PFR_conjecture_improv}\leanok If $A \subset {\bf F}_2^n$ is non-empty and $|A+A| \leq K|A|$, then $A$ can be covered by most $2K^{11}$ translates of a subspace $H$ of ${\bf F}_2^n$ with $|H| \leq |A|$. \end{theorem} \begin{proof}\uses{pfr_aux-improv}\leanok By repeating the proof of \Cref{pfr} and using \Cref{pfr_aux-improv} one can obtain the claim with $11$ replaced by $10$. \end{proof}
theorem PFR_conjecture_improv (h₀A : A.Nonempty) (hA : Nat.card (A + A) ≤ K * Nat.card A) : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c < 2 * K ^ 11 ∧ Nat.card H ≤ Nat.card A ∧ A ⊆ c + H := by obtain ⟨A_pos, -, K_pos⟩ : (0 : ℝ) < Nat.card A ∧ (0 : ℝ) < Nat.card (A + A) ∧ 0 < K := PFR_conjecture_pos_aux' h₀A hA -- consider the subgroup `H` given by Lemma `PFR_conjecture_aux`. obtain ⟨H, c, hc, IHA, IAH, A_subs_cH⟩ : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c ≤ K ^ 6 * Nat.card A ^ (1/2) * Nat.card H ^ (-1/2) ∧ Nat.card H ≤ K ^ 10 * Nat.card A ∧ Nat.card A ≤ K ^ 10 * Nat.card H ∧ A ⊆ c + H := PFR_conjecture_improv_aux h₀A hA have H_pos : (0 : ℝ) < Nat.card H := by have : 0 < Nat.card H := Nat.card_pos; positivity rcases le_or_lt (Nat.card H) (Nat.card A) with h|h -- If `#H ≤ #A`, then `H` satisfies the conclusion of the theorem · refine ⟨H, c, ?_, h, A_subs_cH⟩ calc Nat.card c ≤ K ^ 6 * Nat.card A ^ (1/2) * Nat.card H ^ (-1/2) := hc _ ≤ K ^ 6 * (K ^ 10 * Nat.card H) ^ (1/2) * Nat.card H ^ (-1/2) := by gcongr _ = K ^ 11 := by rpow_ring; norm_num _ < 2 * K ^ 11 := by linarith [show 0 < K ^ 11 by positivity] -- otherwise, we decompose `H` into cosets of one of its subgroups `H'`, chosen so that -- `#A / 2 < #H' ≤ #A`. This `H'` satisfies the desired conclusion. · obtain ⟨H', IH'A, IAH', H'H⟩ : ∃ H' : Submodule (ZMod 2) G, Nat.card H' ≤ Nat.card A ∧ Nat.card A < 2 * Nat.card H' ∧ H' ≤ H := by have A_pos' : 0 < Nat.card A := mod_cast A_pos exact ZModModule.exists_submodule_subset_card_le Nat.prime_two H h.le A_pos'.ne' have : (Nat.card A / 2 : ℝ) < Nat.card H' := by rw [div_lt_iff₀ zero_lt_two, mul_comm]; norm_cast have H'_pos : (0 : ℝ) < Nat.card H' := by have : 0 < Nat.card H' := Nat.card_pos; positivity obtain ⟨u, HH'u, hu⟩ := H'.toAddSubgroup.exists_left_transversal_of_le (H := H.toAddSubgroup) H'H dsimp at HH'u refine ⟨H', c + u, ?_, IH'A, by rwa [add_assoc, HH'u]⟩ calc (Nat.card (c + u) : ℝ) ≤ Nat.card c * Nat.card u := mod_cast natCard_add_le _ ≤ (K ^ 6 * Nat.card A ^ (1 / 2) * (Nat.card H ^ (-1 / 2))) * (Nat.card H / Nat.card H') := by gcongr apply le_of_eq rw [eq_div_iff H'_pos.ne'] norm_cast _ < (K ^ 6 * Nat.card A ^ (1 / 2) * (Nat.card H ^ (-1 / 2))) * (Nat.card H / (Nat.card A / 2)) := by gcongr _ = 2 * K ^ 6 * Nat.card A ^ (-1/2) * Nat.card H ^ (1/2) := by field_simp rpow_ring norm_num _ ≤ 2 * K ^ 6 * Nat.card A ^ (-1/2) * (K ^ 10 * Nat.card A) ^ (1/2) := by gcongr _ = 2 * K ^ 11 := by rpow_ring norm_num /-- Corollary of `PFR_conjecture_improv` in which the ambient group is not required to be finite (but) then $H$ and $c$ are finite. -/
pfr/blueprint/src/chapter/improved_exponent.tex:229
pfr/PFR/ImprovedPFR.lean:982
PFR
PFR_conjecture_improv_aux
\begin{lemma}\label{pfr_aux-improv}\lean{PFR_conjecture_improv_aux}\leanok If $A \subset {\bf F}_2^n$ is non-empty and $|A+A| \leq K|A|$, then $A$ can be covered by at most $K^6 |A|^{1/2}/|H|^{1/2}$ translates of a subspace $H$ of ${\bf F}_2^n$ with $$ |H|/|A| \in [K^{-10}, K^{10}]. $$ \end{lemma} \begin{proof}\uses{entropy-pfr-improv, unif-exist, uniform-entropy-II, jensen-bound,ruz-dist-def,ruzsa-diff,bound-conc,ruz-cov}\leanok By repeating the proof of \Cref{pfr_aux} and using \Cref{entropy-pfr-improv} one can obtain the claim with $13/2$ replaced with $6$ and $11$ replaced by $10$. \end{proof}
lemma PFR_conjecture_improv_aux (h₀A : A.Nonempty) (hA : Nat.card (A + A) ≤ K * Nat.card A) : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c ≤ K ^ 6 * Nat.card A ^ (1/2) * Nat.card H ^ (-1/2) ∧ Nat.card H ≤ K ^ 10 * Nat.card A ∧ Nat.card A ≤ K ^ 10 * Nat.card H ∧ A ⊆ c + H := by have A_fin : Finite A := by infer_instance classical let mG : MeasurableSpace G := ⊤ have : MeasurableSingletonClass G := ⟨λ _ ↦ trivial⟩ obtain ⟨A_pos, -, K_pos⟩ : (0 : ℝ) < Nat.card A ∧ (0 : ℝ) < Nat.card (A + A) ∧ 0 < K := PFR_conjecture_pos_aux' h₀A hA let A' := A.toFinite.toFinset have h₀A' : Finset.Nonempty A' := by simp [A', Finset.Nonempty] exact h₀A have hAA' : A' = A := Finite.coe_toFinset (toFinite A) rcases exists_isUniform_measureSpace A' h₀A' with ⟨Ω₀, mΩ₀, UA, hP₀, UAmeas, UAunif, -⟩ rw [hAA'] at UAunif have hadd_sub : A + A = A - A := by ext; simp [mem_add, mem_sub, ZModModule.sub_eq_add] rw [hadd_sub] at hA have : d[UA # UA] ≤ log K := rdist_le_of_isUniform_of_card_add_le h₀A hA UAunif UAmeas rw [← hadd_sub] at hA let p : refPackage Ω₀ Ω₀ G := ⟨UA, UA, UAmeas, UAmeas, 1/8, (by norm_num), (by norm_num)⟩ -- entropic PFR gives a subgroup `H` which is close to `A` for the Rusza distance rcases entropic_PFR_conjecture_improv p (by norm_num) with ⟨H, Ω₁, mΩ₁, UH, hP₁, UHmeas, UHunif, hUH⟩ rcases independent_copies_two UAmeas UHmeas with ⟨Ω, mΩ, VA, VH, hP, VAmeas, VHmeas, Vindep, idVA, idVH⟩ have VAunif : IsUniform A VA := UAunif.of_identDistrib idVA.symm .of_discrete have VA'unif := VAunif rw [← hAA'] at VA'unif have VHunif : IsUniform H VH := UHunif.of_identDistrib idVH.symm .of_discrete let H' := (H : Set G).toFinite.toFinset have hHH' : H' = (H : Set G) := Finite.coe_toFinset (toFinite (H : Set G)) have VH'unif := VHunif rw [← hHH'] at VH'unif have H_fin : Finite (H : Set G) := by infer_instance have : d[VA # VH] ≤ 5 * log K := by rw [idVA.rdist_eq idVH]; linarith have H_pos : (0 : ℝ) < Nat.card H := by have : 0 < Nat.card H := Nat.card_pos positivity have VA_ent : H[VA] = log (Nat.card A) := IsUniform.entropy_eq' A_fin VAunif VAmeas have VH_ent : H[VH] = log (Nat.card H) := IsUniform.entropy_eq' H_fin VHunif VHmeas have Icard : |log (Nat.card A) - log (Nat.card H)| ≤ 10 * log K := by rw [← VA_ent, ← VH_ent] apply (diff_ent_le_rdist VAmeas VHmeas).trans linarith have IAH : Nat.card A ≤ K ^ 10 * Nat.card H := by have : log (Nat.card A) ≤ log K * 10 + log (Nat.card H) := by linarith [(le_abs_self _).trans Icard] convert exp_monotone this using 1 · exact (exp_log A_pos).symm · rw [exp_add, exp_log H_pos, ← rpow_def_of_pos K_pos] have IHA : Nat.card H ≤ K ^ 10 * Nat.card A := by have : log (Nat.card H) ≤ log K * 10 + log (Nat.card A) := by linarith [(neg_le_abs _).trans Icard] convert exp_monotone this using 1 · exact (exp_log H_pos).symm · rw [exp_add, exp_log A_pos, ← rpow_def_of_pos K_pos] -- entropic PFR shows that the entropy of `VA - VH` is small have I : log K * (-5) + log (Nat.card A) * (-1/2) + log (Nat.card H) * (-1/2) ≤ - H[VA - VH] := by rw [Vindep.rdist_eq VAmeas VHmeas] at this linarith -- therefore, there exists a point `x₀` which is attained by `VA - VH` with a large probability obtain ⟨x₀, h₀⟩ : ∃ x₀ : G, rexp (- H[VA - VH]) ≤ (ℙ : Measure Ω).real ((VA - VH) ⁻¹' {x₀}) := prob_ge_exp_neg_entropy' _ ((VAmeas.sub VHmeas).comp measurable_id') -- massage the previous inequality to get that `A ∩ (H + {x₀})` is large have J : K ^ (-5) * Nat.card A ^ (1/2) * Nat.card H ^ (1/2) ≤ Nat.card (A ∩ (H + {x₀}) : Set G) := by rw [VA'unif.measureReal_preimage_sub VAmeas VH'unif VHmeas Vindep] at h₀ have := (Real.exp_monotone I).trans h₀ have hAA'_card : Nat.card A' = Nat.card A := congrArg Nat.card (congrArg Subtype hAA') have hHH'_card : Nat.card H' = Nat.card H := congrArg Nat.card (congrArg Subtype hHH') rw [hAA'_card, hHH'_card, le_div_iff₀] at this convert this using 1 · rw [exp_add, exp_add, ← rpow_def_of_pos K_pos, ← rpow_def_of_pos A_pos, ← rpow_def_of_pos H_pos] rpow_ring norm_num · rw [hAA', hHH'] positivity have Hne : (A ∩ (H + {x₀} : Set G)).Nonempty := by by_contra h' have : (0 : ℝ) < Nat.card (A ∩ (H + {x₀}) : Set G) := lt_of_lt_of_le (by positivity) J simp only [Nat.card_eq_fintype_card, card_of_isEmpty, CharP.cast_eq_zero, lt_self_iff_false, not_nonempty_iff_eq_empty.1 h'] at this /- use Rusza covering lemma to cover `A` by few translates of `A ∩ (H + {x₀}) - A ∩ (H + {x₀})` (which is contained in `H`). The number of translates is at most `#(A + (A ∩ (H + {x₀}))) / #(A ∩ (H + {x₀}))`, where the numerator is controlled as this is a subset of `A + A`, and the denominator is bounded below by the previous inequality`. -/ have Z3 : (Nat.card (A + A ∩ (↑H + {x₀})) : ℝ) ≤ (K ^ 6 * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * Nat.card ↑(A ∩ (↑H + {x₀})) := by calc (Nat.card (A + A ∩ (↑H + {x₀})) : ℝ) _ ≤ Nat.card (A + A) := by gcongr; exact Nat.card_mono (toFinite _) <| add_subset_add_left inter_subset_left _ ≤ K * Nat.card A := hA _ = (K ^ 6 * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * (K ^ (-5 : ℝ) * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (1/2 : ℝ)) := by rpow_ring; norm_num _ ≤ (K ^ 6 * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * Nat.card ↑(A ∩ (↑H + {x₀})) := by gcongr obtain ⟨u, huA, hucard, hAu, -⟩ := Set.ruzsa_covering_add (toFinite A) (toFinite (A ∩ ((H + {x₀} : Set G)))) Hne (by convert Z3) have A_subset_uH : A ⊆ u + H := by refine hAu.trans $ add_subset_add_left $ (sub_subset_sub (inter_subset_right ..) (inter_subset_right ..)).trans ?_ rw [add_sub_add_comm, singleton_sub_singleton, sub_self] simp exact ⟨H, u, hucard, IHA, IAH, A_subset_uH⟩ /-- The polynomial Freiman-Ruzsa (PFR) conjecture: if $A$ is a subset of an elementary abelian 2-group of doubling constant at most $K$, then $A$ can be covered by at most $2K^{11$} cosets of a subgroup of cardinality at most $|A|$. -/
pfr/blueprint/src/chapter/improved_exponent.tex:214
pfr/PFR/ImprovedPFR.lean:864
PFR
PFR_projection
\begin{lemma}\label{pfr-projection}\lean{PFR_projection}\leanok If $G=\mathbb{F}_2^d$ and $\alpha\in (0,1)$ and $X,Y$ are $G$-valued random variables then there is a subgroup $H\leq \mathbb{F}_2^d$ such that \[\log \lvert H\rvert \leq 2 (\mathbb{H}(X)+\mathbb{H}(Y))\] and if $\psi:G \to G/H$ is the natural projection then \[\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y))\leq 34 d[\psi(X);\psi(Y)].\] \end{lemma} \begin{proof} \uses{pfr-projection'}\leanok Specialize \Cref{pfr-projection'} to $\alpha=3/5$. In the second inequality, it gives a bound $100/3 < 34$. \end{proof}
lemma PFR_projection (hX : Measurable X) (hY : Measurable Y) : ∃ H : Submodule (ZMod 2) G, log (Nat.card H) ≤ 2 * (H[X ; μ] + H[Y;μ']) ∧ H[H.mkQ ∘ X ; μ] + H[H.mkQ ∘ Y; μ'] ≤ 34 * d[H.mkQ ∘ X ;μ # H.mkQ ∘ Y;μ'] := by rcases PFR_projection' X Y μ μ' ((3 : ℝ) / 5) hX hY (by norm_num) (by norm_num) with ⟨H, h, h'⟩ refine ⟨H, ?_, ?_⟩ · convert h norm_num · have : 0 ≤ d[⇑H.mkQ ∘ X ; μ # ⇑H.mkQ ∘ Y ; μ'] := rdist_nonneg (.comp .of_discrete hX) (.comp .of_discrete hY) linarith end F2_projection open MeasureTheory ProbabilityTheory Real Set
pfr/blueprint/src/chapter/weak_pfr.tex:127
pfr/PFR/WeakPFR.lean:397
PFR
PFR_projection'
\begin{lemma}\label{pfr-projection'}\lean{PFR_projection'}\leanok If $G=\mathbb{F}_2^d$ and $\alpha\in (0,1)$ and $X,Y$ are $G$-valued random variables then there is a subgroup $H\leq \mathbb{F}_2^d$ such that \[\log \lvert H\rvert \leq \frac{1+\alpha}{2(1-\alpha)} (\mathbb{H}(X)+\mathbb{H}(Y))\] and if $\psi:G \to G/H$ is the natural projection then \[\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y))\leq \frac{20}{\alpha} d[\psi(X);\psi(Y)].\] \end{lemma} \begin{proof} \uses{app-ent-pfr}\leanok Let $H\leq \mathbb{F}_2^d$ be a maximal subgroup such that \[\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y))> \frac{20}{\alpha} d[\psi(X);\psi(Y)]\] and such that there exists $c \ge 0$ with \[\log \lvert H\rvert \leq \frac{1+\alpha}{2(1-\alpha)}(1-c)(\mathbb{H}(X)+\mathbb{H}(Y))\] and \[\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y))\leq c (\mathbb{H}(X)+\mathbb{H}(Y)).\] Note that this exists since $H=\{0\}$ is an example of such a subgroup or we are done with this choice of $H$. We know that $G/H$ is a $2$-elementary group and so by Lemma \ref{app-ent-pfr} there exists some non-trivial subgroup $H'\leq G/H$ such that \[\log \lvert H'\rvert < \frac{1+\alpha}{2}(\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y))\] and \[\mathbb{H}(\psi' \circ\psi(X))+\mathbb{H}(\psi' \circ \psi(Y))< \alpha(\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y)))\] where $\psi':G/H\to (G/H)/H'$. By group isomorphism theorems we know that there exists some $H''$ with $H\leq H''\leq G$ such that $H'\cong H''/H$ and $\psi' \circ \psi(X)=\psi''(X)$ where $\psi'':G\to G/H''$ is the projection homomorphism. Since $H'$ is non-trivial we know that $H$ is a proper subgroup of $H''$. On the other hand we know that \[\log \lvert H''\rvert=\log \lvert H'\rvert+\log \lvert H\rvert< \frac{1+\alpha}{2(1-\alpha)}(1-\alpha c)(\mathbb{H}(X)+\mathbb{H}(Y))\] and \[\mathbb{H}(\psi''(X))+\mathbb{H}(\psi''(Y))< \alpha (\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y)))\leq \alpha c (\mathbb{H}(X)+\mathbb{H}(Y)).\] Therefore (using the maximality of $H$) it must be the first condition that fails, whence \[\mathbb{H}(\psi''(X))+\mathbb{H}(\psi''(Y))\leq \frac{20}{\alpha}d[\psi''(X);\psi''(Y)].\] \end{proof}
lemma PFR_projection' (α : ℝ) (hX : Measurable X) (hY : Measurable Y) (αpos : 0 < α) (αone : α < 1) : ∃ H : Submodule (ZMod 2) G, log (Nat.card H) ≤ (1 + α) / (2 * (1 - α)) * (H[X ; μ] + H[Y ; μ']) ∧ α * (H[H.mkQ ∘ X ; μ] + H[H.mkQ ∘ Y ; μ']) ≤ 20 * d[H.mkQ ∘ X ; μ # H.mkQ ∘ Y ; μ'] := by let S := {H : Submodule (ZMod 2) G | (∃ (c : ℝ), 0 ≤ c ∧ log (Nat.card H) ≤ (1 + α) / (2 * (1 - α)) * (1 - c) * (H[X ; μ] + H[Y;μ']) ∧ H[H.mkQ ∘ X ; μ] + H[H.mkQ ∘ Y; μ'] ≤ c * (H[X ; μ] + H[Y;μ'])) ∧ 20 * d[H.mkQ ∘ X ; μ # H.mkQ ∘ Y ; μ'] < α * (H[H.mkQ ∘ X ; μ ] + H[H.mkQ ∘ Y; μ'])} have : 0 ≤ H[X ; μ] + H[Y ; μ'] := by linarith [entropy_nonneg X μ, entropy_nonneg Y μ'] have : 0 < 1 - α := sub_pos.mpr αone by_cases hE : ⊥ ∈ S · classical obtain ⟨H, ⟨⟨c, hc, hlog, hup⟩, hent⟩, hMaxl⟩ := S.toFinite.exists_maximal_wrt id S (Set.nonempty_of_mem hE) set G' := G ⧸ H set ψ : G →ₗ[ZMod 2] G' := H.mkQ have surj : Function.Surjective ψ := Submodule.Quotient.mk_surjective H obtain ⟨H', hlog', hup'⟩ := app_ent_PFR _ _ _ _ α hent (.comp .of_discrete hX) (.comp .of_discrete hY) have H_ne_bot : H' ≠ ⊥ := by by_contra! rcases this with rfl have inj : Function.Injective (Submodule.mkQ (⊥ : Submodule (ZMod 2) G')) := QuotientAddGroup.quotientBot.symm.injective rw [entropy_comp_of_injective _ (.comp .of_discrete hX) _ inj, entropy_comp_of_injective _ (.comp .of_discrete hY) _ inj] at hup' nlinarith [entropy_nonneg (ψ ∘ X) μ, entropy_nonneg (ψ ∘ Y) μ'] let H'' := H'.comap ψ use H'' rw [← (Submodule.map_comap_eq_of_surjective surj _ : H''.map ψ = H')] at hup' hlog' set H' := H''.map ψ have Hlt := calc H = (⊥ : Submodule (ZMod 2) G').comap ψ := by simp [ψ]; rw [Submodule.ker_mkQ] _ < H'' := by rw [Submodule.comap_lt_comap_iff_of_surjective surj]; exact H_ne_bot.bot_lt let φ : (G' ⧸ H') ≃ₗ[ZMod 2] (G ⧸ H'') := Submodule.quotientQuotientEquivQuotient H H'' Hlt.le set ψ' : G' →ₗ[ZMod 2] G' ⧸ H' := H'.mkQ set ψ'' : G →ₗ[ZMod 2] G ⧸ H'' := H''.mkQ have diag : ψ' ∘ ψ = φ.symm ∘ ψ'' := rfl rw [← Function.comp_assoc, ← Function.comp_assoc, diag, Function.comp_assoc, Function.comp_assoc] at hup' have cond : log (Nat.card H'') ≤ (1 + α) / (2 * (1 - α)) * (1 - α * c) * (H[X ; μ] + H[Y;μ']) := by have cardprod : Nat.card H'' = Nat.card H' * Nat.card H := by have hcard₀ := Nat.card_congr <| (Submodule.comapSubtypeEquivOfLe Hlt.le).toEquiv have hcard₁ := Nat.card_congr <| (ψ.domRestrict H'').quotKerEquivRange.toEquiv have hcard₂ := (H.comap H''.subtype).card_eq_card_quotient_mul_card rw [ψ.ker_domRestrict H'', Submodule.ker_mkQ, ψ.range_domRestrict H''] at hcard₁ simpa only [← Nat.card_eq_fintype_card, hcard₀, hcard₁, mul_comm] using hcard₂ calc log (Nat.card H'') _ = log (Nat.card H' * Nat.card H) := by rw [cardprod]; norm_cast _ = log (Nat.card H') + log (Nat.card H) := by rw [Real.log_mul (Nat.cast_ne_zero.2 (@Nat.card_pos H').ne') (Nat.cast_ne_zero.2 (@Nat.card_pos H).ne')] _ ≤ (1 + α) / 2 * (H[ψ ∘ X ; μ] + H[ψ ∘ Y ; μ']) + log (Nat.card H) := by gcongr _ ≤ (1 + α) / 2 * (c * (H[X ; μ] + H[Y;μ'])) + (1 + α) / (2 * (1 - α)) * (1 - c) * (H[X ; μ] + H[Y ; μ']) := by gcongr _ = (1 + α) / (2 * (1 - α)) * (1 - α * c) * (H[X ; μ] + H[Y ; μ']) := by field_simp; ring have HS : H'' ∉ S := λ Hs => Hlt.ne (hMaxl H'' Hs Hlt.le) simp only [S, Set.mem_setOf_eq, not_and, not_lt] at HS refine ⟨?_, HS ⟨α * c, by positivity, cond, ?_⟩⟩ · calc log (Nat.card H'') _ ≤ (1 + α) / (2 * (1 - α)) * (1 - α * c) * (H[X ; μ] + H[Y;μ']) := cond _ ≤ (1 + α) / (2 * (1 - α)) * 1 * (H[X ; μ] + H[Y;μ']) := by gcongr; simp; positivity _ = (1 + α) / (2 * (1 - α)) * (H[X ; μ] + H[Y;μ']) := by simp only [mul_one] · calc H[ ψ'' ∘ X ; μ ] + H[ ψ'' ∘ Y; μ' ] _ = H[ φ.symm ∘ ψ'' ∘ X ; μ ] + H[ φ.symm ∘ ψ'' ∘ Y; μ' ] := by simp_rw [← entropy_comp_of_injective _ (.comp .of_discrete hX) _ φ.symm.injective, ← entropy_comp_of_injective _ (.comp .of_discrete hY) _ φ.symm.injective] _ ≤ α * (H[ ψ ∘ X ; μ ] + H[ ψ ∘ Y; μ' ]) := hup'.le _ ≤ α * (c * (H[X ; μ] + H[Y ; μ'])) := by gcongr _ = (α * c) * (H[X ; μ] + H[Y ; μ']) := by ring · use ⊥ constructor · simp only [AddSubgroup.mem_bot, Nat.card_eq_fintype_card, Fintype.card_ofSubsingleton, Nat.cast_one, log_one] positivity · simp only [S, Set.mem_setOf_eq, not_and, not_lt] at hE exact hE ⟨1, by norm_num, by norm_num; exact add_le_add (entropy_comp_le μ hX _) (entropy_comp_le μ' hY _)⟩ /-- If $G=\mathbb{F}_2^d$ and `X, Y` are `G`-valued random variables then there is a subgroup $H\leq \mathbb{F}_2^d$ such that \[\log \lvert H\rvert \leq 2 * (\mathbb{H}(X)+\mathbb{H}(Y))\] and if $\psi:G \to G/H$ is the natural projection then \[\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y))\leq 34 * d[\psi(X);\psi(Y)].\] -/
pfr/blueprint/src/chapter/weak_pfr.tex:86
pfr/PFR/WeakPFR.lean:300
PFR
ProbabilityTheory.IdentDistrib.rdist_eq
\begin{lemma}[Copy preserves Ruzsa distance]\label{ruz-copy} \uses{ruz-dist-def} \lean{ProbabilityTheory.IdentDistrib.rdist_eq}\leanok If $X',Y'$ are copies of $X,Y$ respectively then $d[X';Y']=d[X ;Y]$. \end{lemma} \begin{proof} \uses{copy-ent}\leanok Immediate from Definitions \ref{ruz-dist-def} and \Cref{copy-ent}. \end{proof}
/-- If `X', Y'` are copies of `X, Y` respectively then `d[X' ; Y'] = d[X ; Y]`. -/ lemma ProbabilityTheory.IdentDistrib.rdist_eq {X' : Ω'' → G} {Y' : Ω''' → G} (hX : IdentDistrib X X' μ μ'') (hY : IdentDistrib Y Y' μ' μ''') : d[X ; μ # Y ; μ'] = d[X' ; μ'' # Y' ; μ'''] := by simp [rdist, hX.map_eq, hY.map_eq, hX.entropy_eq, hY.entropy_eq]
pfr/blueprint/src/chapter/distance.tex:99
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:129
PFR
ProbabilityTheory.IdentDistrib.tau_eq
\begin{lemma}[$\tau$ depends only on distribution]\label{tau-copy}\leanok \uses{tau-def} \lean{ProbabilityTheory.IdentDistrib.tau_eq} If $X'_1, X'_2$ are copies of $X_1,X_2$, then $\tau[X'_1;X'_2] = \tau[X_1;X_2]$. \end{lemma} \begin{proof}\uses{copy-ent}\leanok Immediate from \Cref{copy-ent}. \end{proof}
/-- If $X'_1, X'_2$ are copies of $X_1,X_2$, then $\tau[X'_1;X'_2] = \tau[X_1;X_2]$. -/ lemma ProbabilityTheory.IdentDistrib.tau_eq [MeasurableSpace Ω₁] [MeasurableSpace Ω₂] [MeasurableSpace Ω'₁] [MeasurableSpace Ω'₂] {μ₁ : Measure Ω₁} {μ₂ : Measure Ω₂} {μ'₁ : Measure Ω'₁} {μ'₂ : Measure Ω'₂} {X₁ : Ω₁ → G} {X₂ : Ω₂ → G} {X₁' : Ω'₁ → G} {X₂' : Ω'₂ → G} (h₁ : IdentDistrib X₁ X₁' μ₁ μ'₁) (h₂ : IdentDistrib X₂ X₂' μ₂ μ'₂) : τ[X₁ ; μ₁ # X₂ ; μ₂ | p] = τ[X₁' ; μ'₁ # X₂' ; μ'₂ | p] := by simp only [tau] rw [(IdentDistrib.refl p.hmeas1.aemeasurable).rdist_eq h₁, (IdentDistrib.refl p.hmeas2.aemeasurable).rdist_eq h₂, h₁.rdist_eq h₂] /-- Property recording the fact that two random variables minimize the tau functional. Expressed in terms of measures on the group to avoid quantifying over all spaces, but this implies comparison with any pair of random variables, see Lemma `is_tau_min`. -/
pfr/blueprint/src/chapter/entropy_pfr.tex:17
pfr/PFR/TauFunctional.lean:90
PFR
ProbabilityTheory.IndepFun.rdist_eq
\begin{lemma}[Ruzsa distance in independent case]\label{ruz-indep} \uses{ruz-dist-def} \lean{ProbabilityTheory.IndepFun.rdist_eq}\leanok If $X,Y$ are independent $G$-random variables then $$ d[X ;Y] := \bbH[X - Y] - \bbH[X]/2 - \bbH[Y]/2.$$ \end{lemma} \begin{proof} \uses{relabeled-entropy, copy-ent}\leanok Immediate from \Cref{ruz-dist-def} and Lemmas \ref{relabeled-entropy}, \ref{copy-ent}. \end{proof}
/-- If `X, Y` are independent `G`-random variables then `d[X ; Y] = H[X - Y] - H[X]/2 - H[Y]/2`. -/ lemma ProbabilityTheory.IndepFun.rdist_eq [IsFiniteMeasure μ] {Y : Ω → G} (h : IndepFun X Y μ) (hX : Measurable X) (hY : Measurable Y) : d[X ; μ # Y ; μ] = H[X - Y ; μ] - H[X ; μ]/2 - H[Y ; μ]/2 := by rw [rdist_def] congr 2 have h_prod : (μ.map X).prod (μ.map Y) = μ.map (⟨X, Y⟩) := ((indepFun_iff_map_prod_eq_prod_map_map hX.aemeasurable hY.aemeasurable).mp h).symm rw [h_prod, entropy_def, Measure.map_map (measurable_fst.sub measurable_snd) (hX.prodMk hY)] rfl
pfr/blueprint/src/chapter/distance.tex:108
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:161
PFR
app_ent_PFR
\begin{lemma}\label{app-ent-pfr}\lean{app_ent_PFR}\leanok Let $G=\mathbb{F}_2^n$ and $\alpha\in (0,1)$ and let $X,Y$ be $G$-valued random variables such that \[\mathbb{H}(X)+\mathbb{H}(Y)> \frac{20}{\alpha} d[X;Y].\] There is a non-trivial subgroup $H\leq G$ such that \[\log \lvert H\rvert <\frac{1+\alpha}{2}(\mathbb{H}(X)+\mathbb{H}(Y))\] and \[\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y))< \alpha (\mathbb{H}(X)+\mathbb{H}(Y))\] where $\psi:G\to G/H$ is the natural projection homomorphism. \end{lemma} \begin{proof} \uses{entropy-pfr-improv, ruzsa-diff, dist-projection, ruzsa-nonneg}\leanok By \Cref{entropy-pfr-improv} there exists a subgroup $H$ such that $d[X;U_H] + d[Y;U_H] \leq 10 d[X;Y]$. Using \Cref{dist-projection} we deduce that $\mathbb{H}(\psi(X)) + \mathbb{H}(\psi(X)) \leq 20 d[X;Y]$. The second claim follows adding these inequalities and using the assumption on $\mathbb{H}(X)+\mathbb{H}(Y)$. Furthermore we have by \Cref{ruzsa-diff} \[\log \lvert H \rvert-\mathbb{H}(X)\leq 2d[X;U_H]\] and similarly for $Y$ and thus \begin{align*} \log \lvert H\rvert &\leq \frac{\mathbb{H}(X)+\mathbb{H}(Y)}{2}+d[X;U_H] + d[Y;U_H] \leq \frac{\mathbb{H}(X)+\mathbb{H}(Y)}{2}+ 10d[X;Y] \\& < \frac{1+\alpha}{2}(\mathbb{H}(X)+\mathbb{H}(Y)). \end{align*} Finally note that if $H$ were trivial then $\psi(X)=X$ and $\psi(Y)=Y$ and hence $\mathbb{H}(X)+\mathbb{H}(Y)=0$, which contradicts \Cref{ruzsa-nonneg}. \end{proof}
lemma app_ent_PFR (α : ℝ) (hent : 20 * d[X ;μ # Y;μ'] < α * (H[X ; μ] + H[Y; μ'])) (hX : Measurable X) (hY : Measurable Y) : ∃ H : Submodule (ZMod 2) G, log (Nat.card H) < (1 + α) / 2 * (H[X ; μ] + H[Y;μ']) ∧ H[H.mkQ ∘ X ; μ] + H[H.mkQ ∘ Y; μ'] < α * (H[ X ; μ] + H[Y; μ']) := app_ent_PFR' (mΩ := .mk μ) (mΩ' := .mk μ') X Y hent hX hY set_option maxHeartbeats 300000 in /-- If $G=\mathbb{F}_2^d$ and `X, Y` are `G`-valued random variables and $\alpha < 1$ then there is a subgroup $H\leq \mathbb{F}_2^d$ such that \[\log \lvert H\rvert \leq (1 + α) / (2 * (1 - α)) * (\mathbb{H}(X)+\mathbb{H}(Y))\] and if $\psi:G \to G/H$ is the natural projection then \[\mathbb{H}(\psi(X))+\mathbb{H}(\psi(Y))\leq 20/\alpha * d[\psi(X);\psi(Y)].\] -/
pfr/blueprint/src/chapter/weak_pfr.tex:52
pfr/PFR/WeakPFR.lean:288
PFR
approx_hom_pfr
\begin{theorem}[Approximate homomorphism form of PFR]\label{approx-hom-pfr}\lean{approx_hom_pfr}\leanok Let $G,G'$ be finite abelian $2$-groups. Let $f: G \to G'$ be a function, and suppose that there are at least $|G|^2 / K$ pairs $(x,y) \in G^2$ such that $$ f(x+y) = f(x) + f(y).$$ Then there exists a homomorphism $\phi: G \to G'$ and a constant $c \in G'$ such that $f(x) = \phi(x)+c$ for at least $|G| / (2 ^ {144} * K ^ {122})$ values of $x \in G$. \end{theorem} \begin{proof}\uses{goursat, cs-bound, bsg, pfr_aux-improv}\leanok Consider the graph $A \subset G \times G'$ defined by $$ A := \{ (x,f(x)): x \in G \}.$$ Clearly, $|A| = |G|$. By hypothesis, we have $a+a' \in A$ for at least $|A|^2/K$ pairs $(a,a') \in A^2$. By \Cref{cs-bound}, this implies that $E(A) \geq |A|^3/K^2$. Applying \Cref{bsg}, we conclude that there exists a subset $A' \subset A$ with $|A'| \geq |A|/C_1 K^{2C_2}$ and $|A'+A'| \leq C_1C_3 K^{2(C_2+C_4)} |A'|$. Applying \Cref{pfr-9-aux'}, we may find a subspace $H \subset G \times G'$ such that $|H| / |A'| \in [L^{-8}, L^{8}]$ and a subset $c$ of cardinality at most $L^5 |A'|^{1/2} / |H|^{1/2}$ such that $A' \subseteq c + H$, where $L = C_1C_3 K^{2(C_2+C_4)}$. If we let $H_0,H_1$ be as in \Cref{goursat}, this implies on taking projections the projection of $A'$ to $G$ is covered by at most $|c|$ translates of $H_0$. This implies that $$ |c| |H_0| \geq |A'|;$$ since $|H_0| |H_1| = |H|$, we conclude that $$ |H_1| \leq |c| |H|/|A'|.$$ By hypothesis, $A'$ is covered by at most $|c|$ translates of $H$, and hence by at most $|c| |H_1|$ translates of $\{ (x,\phi(x)): x \in G \}$. As $\phi$ is a homomorphism, each such translate can be written in the form $\{ (x,\phi(x)+c): x \in G \}$ for some $c \in G'$. The number of translates is bounded by $$ |c|^2 \frac{|H|}{|A'|} \leq \left(L^5 \frac{|A'|^{1/2}}{|H|^{1/2}}\right)^2 \frac{|H|}{|A'|} = L^{10}. $$ By the pigeonhole principle, one of these translates must then contain at least $|A'|/L^{10} \geq |G| / (C_1C_3 K^{2(C_2+C_4)})^{10} (C_1 K^{2C_2})$ elements of $A'$ (and hence of $A$), and the claim follows. \end{proof}
theorem approx_hom_pfr (f : G → G') (K : ℝ) (hK : K > 0) (hf : Nat.card G ^ 2 / K ≤ Nat.card {x : G × G | f (x.1 + x.2) = f x.1 + f x.2}) : ∃ (φ : G →+ G') (c : G'), Nat.card {x | f x = φ x + c} ≥ Nat.card G / (2 ^ 144 * K ^ 122) := by let A := (Set.univ.graphOn f).toFinite.toFinset have hA : #A = Nat.card G := by rw [Set.Finite.card_toFinset]; simp [← Nat.card_eq_fintype_card] have hA_nonempty : A.Nonempty := by simp [-Set.Finite.toFinset_setOf, A] have := calc (#A ^ 3 / K ^ 2 : ℝ) = (Nat.card G ^ 2 / K) ^ 2 / #A := by field_simp [hA]; ring _ ≤ Nat.card {x : G × G | f (x.1 + x.2) = f x.1 + f x.2} ^ 2 / #A := by gcongr _ = #{ab ∈ A ×ˢ A | ab.1 + ab.2 ∈ A} ^ 2 / #A := by congr rw [← Nat.card_eq_finsetCard, ← Finset.coe_sort_coe, Finset.coe_filter, Set.Finite.toFinset_prod] simp only [Set.Finite.mem_toFinset, A, Set.graphOn_prod_graphOn] rw [← Set.natCard_graphOn _ (Prod.map f f), ← Nat.card_image_equiv (Equiv.prodProdProdComm G G' G G'), Set.image_equiv_eq_preimage_symm] congr aesop _ ≤ #A * E[A] / #A := by gcongr; exact mod_cast card_sq_le_card_mul_addEnergy .. _ = E[A] := by field_simp obtain ⟨A', hA', hA'1, hA'2⟩ := BSG_self' (sq_nonneg K) hA_nonempty (by simpa only [inv_mul_eq_div] using this) clear hf this have hA'₀ : A'.Nonempty := Finset.card_pos.1 $ Nat.cast_pos.1 $ hA'1.trans_lt' $ by positivity let A'' := A'.toSet have hA''_coe : Nat.card A'' = #A' := Nat.card_eq_finsetCard A' have hA''_pos : 0 < Nat.card A'' := by rw [hA''_coe]; exact hA'₀.card_pos have hA''_nonempty : Set.Nonempty A'' := nonempty_subtype.mp (Finite.card_pos_iff.mp hA''_pos) have : Finset.card (A' - A') = Nat.card (A'' + A'') := calc _ = Nat.card (A' - A').toSet := (Nat.card_eq_finsetCard _).symm _ = Nat.card (A'' + A'') := by rw [Finset.coe_sub, sumset_eq_sub] replace : Nat.card (A'' + A'') ≤ 2 ^ 14 * K ^ 12 * Nat.card A'' := by rewrite [← this, hA''_coe] simpa [← pow_mul] using hA'2 obtain ⟨H, c, hc_card, hH_le, hH_ge, hH_cover⟩ := better_PFR_conjecture_aux hA''_nonempty this clear hA'2 hA''_coe hH_le hH_ge obtain ⟨H₀, H₁, φ, hH₀H₁, hH₀H₁_card⟩ := goursat H have h_le_H₀ : Nat.card A'' ≤ Nat.card c * Nat.card H₀ := by have h_le := Nat.card_mono (Set.toFinite _) (Set.image_subset Prod.fst hH_cover) have h_proj_A'' : Nat.card A'' = Nat.card (Prod.fst '' A'') := Nat.card_congr (Equiv.Set.imageOfInjOn Prod.fst A'' <| Set.fst_injOn_graph.mono (Set.Finite.subset_toFinset.mp hA')) have h_proj_c : Prod.fst '' (c + H : Set (G × G')) = (Prod.fst '' c) + H₀ := by ext x ; constructor <;> intro hx · obtain ⟨x, ⟨⟨c, hc, h, hh, hch⟩, hx⟩⟩ := hx rewrite [← hx] exact ⟨c.1, Set.mem_image_of_mem Prod.fst hc, h.1, ((hH₀H₁ h).mp hh).1, (Prod.ext_iff.mp hch).1⟩ · obtain ⟨_, ⟨c, hc⟩, h, hh, hch⟩ := hx refine ⟨c + (h, φ h), ⟨⟨c, hc.1, (h, φ h), ?_⟩, by rwa [← hc.2] at hch⟩⟩ exact ⟨(hH₀H₁ ⟨h, φ h⟩).mpr ⟨hh, by rw [sub_self]; apply zero_mem⟩, rfl⟩ rewrite [← h_proj_A'', h_proj_c] at h_le apply (h_le.trans Set.natCard_add_le).trans gcongr exact Nat.card_image_le c.toFinite have hH₀_pos : (0 : ℝ) < Nat.card H₀ := Nat.cast_pos.mpr Nat.card_pos have h_le_H₁ : (Nat.card H₁ : ℝ) ≤ (Nat.card c) * (Nat.card H) / Nat.card A'' := calc _ = (Nat.card H : ℝ) / (Nat.card H₀) := (eq_div_iff <| ne_of_gt <| hH₀_pos).mpr <| by rw [mul_comm, ← Nat.cast_mul, hH₀H₁_card] _ ≤ (Nat.card c : ℝ) * (Nat.card H) / Nat.card A'' := by nth_rewrite 1 [← mul_one (Nat.card H : ℝ), mul_comm (Nat.card c : ℝ)] repeat rewrite [mul_div_assoc] refine mul_le_mul_of_nonneg_left ?_ (Nat.cast_nonneg _) refine le_of_mul_le_mul_right ?_ hH₀_pos refine le_of_mul_le_mul_right ?_ (Nat.cast_pos.mpr hA''_pos) rewrite [div_mul_cancel₀ 1, mul_right_comm, one_mul, div_mul_cancel₀, ← Nat.cast_mul] · exact Nat.cast_le.mpr h_le_H₀ · exact ne_of_gt (Nat.cast_pos.mpr hA''_pos) · exact ne_of_gt hH₀_pos clear h_le_H₀ hA''_pos hH₀_pos hH₀H₁_card let translate (c : G × G') (h : G') := A'' ∩ ({c} + {(0, h)} + Set.univ.graphOn φ) have h_translate (c : G × G') (h : G') : Prod.fst '' translate c h ⊆ { x : G | f x = φ x + (-φ c.1 + c.2 + h) } := by intro x hx obtain ⟨x, ⟨hxA'', _, ⟨c', hc, h', hh, hch⟩, x', hx, hchx⟩, hxx⟩ := hx show f _ = φ _ + (-φ c.1 + c.2 + h) replace := by simpa [-Set.Finite.toFinset_setOf, A] using hA' hxA'' rewrite [← hxx, this, ← hchx, ← hch, hc, hh] show c.2 + h + x'.2 = φ (c.1 + 0 + x'.1) + (-φ c.1 + c.2 + h) replace : φ x'.1 = x'.2 := (Set.mem_graphOn.mp hx).2 rw [map_add, map_add, map_zero, add_zero, this, add_comm (φ c.1), add_assoc x'.2, ← add_assoc (φ c.1), ← add_assoc (φ c.1), ← sub_eq_add_neg, sub_self, zero_add, add_comm] have h_translate_card c h : Nat.card (translate c h) = Nat.card (Prod.fst '' translate c h) := Nat.card_congr (Equiv.Set.imageOfInjOn Prod.fst (translate c h) <| Set.fst_injOn_graph.mono fun _ hx ↦ Set.Finite.subset_toFinset.mp hA' hx.1) let cH₁ := (c ×ˢ H₁).toFinite.toFinset have A_nonempty : Nonempty A'' := Set.nonempty_coe_sort.mpr hA''_nonempty replace hc : c.Nonempty := by obtain ⟨x, hx, _, _, _⟩ := hH_cover (Classical.choice A_nonempty).property exact ⟨x, hx⟩ replace : A' = Finset.biUnion cH₁ fun ch ↦ (translate ch.1 ch.2).toFinite.toFinset := by ext x ; constructor <;> intro hx · obtain ⟨c', hc, h, hh, hch⟩ := hH_cover hx refine Finset.mem_biUnion.mpr ⟨(c', h.2 - φ h.1), ?_⟩ refine ⟨(Set.Finite.mem_toFinset _).mpr ⟨hc, ((hH₀H₁ h).mp hh).2⟩, ?_⟩ refine (Set.Finite.mem_toFinset _).mpr ⟨hx, c' + (0, h.2 - φ h.1), ?_⟩ refine ⟨⟨c', rfl, (0, h.2 - φ h.1), rfl, rfl⟩, (h.1, φ h.1), ⟨h.1, by simp⟩, ?_⟩ beta_reduce rewrite [add_assoc] show c' + (0 + h.1, h.2 - φ h.1 + φ h.1) = x rewrite [zero_add, sub_add_cancel] exact hch · obtain ⟨ch, hch⟩ := Finset.mem_biUnion.mp hx exact ((Set.Finite.mem_toFinset _).mp hch.2).1 replace : ∑ _ ∈ cH₁, ((2 ^ 4)⁻¹ * (K ^ 2)⁻¹ * #A / cH₁.card : ℝ) ≤ ∑ ch ∈ cH₁, ((translate ch.1 ch.2).toFinite.toFinset.card : ℝ) := by rewrite [Finset.sum_const, nsmul_eq_mul, ← mul_div_assoc, mul_div_right_comm, div_self, one_mul] · apply hA'1.trans norm_cast exact (congrArg Finset.card this).trans_le Finset.card_biUnion_le · symm refine ne_of_lt <| Nat.cast_zero.symm.trans_lt <| Nat.cast_lt.mpr <| Finset.card_pos.mpr ?_ exact (Set.Finite.toFinset_nonempty _).mpr <| hc.prod H₁.nonempty obtain ⟨c', h, hch⟩ : ∃ c' : G × G', ∃ h : G', (2 ^ 4 : ℝ)⁻¹ * (K ^ 2)⁻¹ * #A / cH₁.card ≤ Nat.card { x : G | f x = φ x + (-φ c'.1 + c'.2 + h) } := by obtain ⟨ch, hch⟩ := Finset.exists_le_of_sum_le ((Set.Finite.toFinset_nonempty _).mpr (hc.prod H₁.nonempty)) this refine ⟨ch.1, ch.2, hch.2.trans ?_⟩ rewrite [Set.Finite.card_toFinset, ← Nat.card_eq_fintype_card, h_translate_card] exact Nat.cast_le.mpr <| Nat.card_mono (Set.toFinite _) (h_translate ch.1 ch.2) clear! hA' hA'1 hH_cover hH₀H₁ translate h_translate h_translate_card use φ, -φ c'.1 + c'.2 + h calc Nat.card G / (2 ^ 144 * K ^ 122) _ = Nat.card G / (2 ^ 4 * K ^ 2 * (2 ^ 140 * K ^ 120)) := by ring _ ≤ Nat.card G / (2 ^ 4 * K ^ 2 * #(c ×ˢ H₁).toFinite.toFinset) := ?_ _ = (2 ^ 4)⁻¹ * (K ^ 2)⁻¹ * ↑(#A) / ↑(#cH₁) := by rw [hA, ← mul_inv, inv_mul_eq_div, div_div] _ ≤ _ := hch have := (c ×ˢ H₁).toFinite.toFinset_nonempty.2 (hc.prod H₁.nonempty) gcongr calc (#(c ×ˢ H₁).toFinite.toFinset : ℝ) _ = #c.toFinite.toFinset * #(H₁ : Set G').toFinite.toFinset := by rw [← Nat.cast_mul, ← Finset.card_product, Set.Finite.toFinset_prod] _ = Nat.card c * Nat.card H₁ := by simp_rw [Set.Finite.card_toFinset, ← Nat.card_eq_fintype_card]; norm_cast _ ≤ Nat.card c * (Nat.card c * Nat.card H / Nat.card ↑A'') := by gcongr _ = Nat.card c ^ 2 * Nat.card H / Nat.card ↑A'' := by ring _ ≤ ((2 ^ 14 * K ^ 12) ^ 5 * Nat.card A'' ^ (1 / 2 : ℝ) * Nat.card H ^ (-1 / 2 : ℝ)) ^ 2 * Nat.card H / Nat.card ↑A'' := by gcongr _ = 2 ^ 140 * K ^ 120 := by field_simp; rpow_simp; norm_num
pfr/blueprint/src/chapter/approx_hom_pfr.tex:27
pfr/PFR/ApproxHomPFR.lean:33
PFR
averaged_construct_good
\begin{lemma}[Constructing good variables, III']\label{averaged-construct-good}\lean{averaged_construct_good}\leanok One has \begin{align*} k & \leq I(U : V \, | \, S) + I(V : W \, | \,S) + I(W : U \, | \, S) + \frac{\eta}{6} \sum_{i=1}^2 \sum_{A,B \in \{U,V,W\}: A \neq B} (d[X^0_i;A|B,S] - d[X^0_i; X_i]). \end{align*} \end{lemma} \begin{proof}\uses{construct-good-improv, key-ident}\leanok For each $s$ in the range of $S$, apply \Cref{construct-good-improv} with $T_1,T_2,T_3$ equal to $(U|S=s)$, $(V|S=s)$, $(W|S=s)$ respectively (which works thanks to \Cref{key-ident}), multiply by $\bbP[S=s]$, and sum in $s$ to conclude. \end{proof}
lemma averaged_construct_good : k ≤ (I[U : V | S] + I[V : W | S] + I[W : U | S]) + (p.η / 6) * (((d[p.X₀₁ # U | ⟨V, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # U | ⟨W, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # V | ⟨U, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # V | ⟨W, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # W | ⟨U, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # W | ⟨V, S⟩] - d[p.X₀₁ # X₁])) + ((d[p.X₀₂ # U | ⟨V, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # U | ⟨W, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # V | ⟨U, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # V | ⟨W, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # W | ⟨U, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # W | ⟨V, S⟩] - d[p.X₀₂ # X₂]))) := by have hS : Measurable S := by fun_prop have hU : Measurable U := by fun_prop have hV : Measurable V := by fun_prop have hW : Measurable W := by fun_prop have hUVW : U + V + W = 0 := sum_uvw_eq_zero X₁ X₂ X₁' have hz (a : ℝ) : a = ∑ z, (ℙ (S ⁻¹' {z})).toReal * a := by rw [← Finset.sum_mul, sum_measure_preimage_singleton' ℙ hS, one_mul] rw [hz k, hz (d[p.X₀₁ # X₁]), hz (d[p.X₀₂ # X₂])] simp only [condMutualInfo_eq_sum' hS, ← Finset.sum_add_distrib, ← mul_add, condRuzsaDist'_prod_eq_sum', hU, hS, hV, hW, ← Finset.sum_sub_distrib, ← mul_sub, Finset.mul_sum, ← mul_assoc (p.η/6), mul_comm (p.η/6), mul_assoc _ _ (p.η/6)] rw [Finset.sum_mul, ← Finset.sum_add_distrib] apply Finset.sum_le_sum (fun i _hi ↦ ?_) rcases eq_or_ne (ℙ (S ⁻¹' {i})) 0 with h'i|h'i · simp [h'i] rw [mul_assoc, ← mul_add] gcongr have : IsProbabilityMeasure (ℙ[|S ⁻¹' {i}]) := cond_isProbabilityMeasure h'i linarith [construct_good_improved'' h_min (ℙ[|S ⁻¹' {i}]) hUVW hU hV hW] variable (p) include hX₁ hX₂ hX₁' hX₂' h_indep h₁ h₂ in omit [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] in
pfr/blueprint/src/chapter/improved_exponent.tex:77
pfr/PFR/ImprovedPFR.lean:436
PFR
better_PFR_conjecture
\begin{theorem}[PFR with \texorpdfstring{$C=9$}{C=9}]\label{pfr-9}\lean{better_PFR_conjecture}\leanok If $A \subset {\bf F}_2^n$ is finite non-empty with $|A+A| \leq K|A|$, then there exists a subgroup $H$ of ${\bf F}_2^n$ with $|H| \leq |A|$ such that $A$ can be covered by at most $2K^9$ translates of $H$. \end{theorem} \begin{proof}\leanok \uses{pfr-9-aux,ruz-cov} Given \Cref{pfr-9-aux'}, the proof is the same as that of \Cref{pfr}. \end{proof}
lemma better_PFR_conjecture {A : Set G} (h₀A : A.Nonempty) {K : ℝ} (hA : Nat.card (A + A) ≤ K * Nat.card A) : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c < 2 * K ^ 9 ∧ Nat.card H ≤ Nat.card A ∧ A ⊆ c + H := by obtain ⟨A_pos, -, K_pos⟩ : (0 : ℝ) < Nat.card A ∧ (0 : ℝ) < Nat.card (A + A) ∧ 0 < K := PFR_conjecture_pos_aux' h₀A hA -- consider the subgroup `H` given by Lemma `PFR_conjecture_aux`. obtain ⟨H, c, hc, IHA, IAH, A_subs_cH⟩ : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c ≤ K ^ 5 * Nat.card A ^ (1 / 2 : ℝ) * Nat.card H ^ (-1 / 2 : ℝ) ∧ Nat.card H ≤ K ^ 8 * Nat.card A ∧ Nat.card A ≤ K ^ 8 * Nat.card H ∧ A ⊆ c + H := better_PFR_conjecture_aux h₀A hA have H_pos : (0 : ℝ) < Nat.card H := by have : 0 < Nat.card H := Nat.card_pos; positivity rcases le_or_lt (Nat.card H) (Nat.card A) with h|h -- If `#H ≤ #A`, then `H` satisfies the conclusion of the theorem · refine ⟨H, c, ?_, h, A_subs_cH⟩ calc Nat.card c ≤ K ^ 5 * Nat.card A ^ (1 / 2 : ℝ) * Nat.card H ^ (-1 / 2 : ℝ) := hc _ ≤ K ^ 5 * (K ^ 8 * Nat.card H) ^ (1 / 2 : ℝ) * Nat.card H ^ (-1 / 2 : ℝ) := by gcongr _ = K ^ 9 := by simp_rw [← rpow_natCast]; rpow_ring; norm_num _ < 2 * K ^ 9 := by linarith [show 0 < K ^ 9 by positivity] -- otherwise, we decompose `H` into cosets of one of its subgroups `H'`, chosen so that -- `#A / 2 < #H' ≤ #A`. This `H'` satisfies the desired conclusion. · obtain ⟨H', IH'A, IAH', H'H⟩ : ∃ H' : Submodule (ZMod 2) G, Nat.card H' ≤ Nat.card A ∧ Nat.card A < 2 * Nat.card H' ∧ H' ≤ H := by have A_pos' : 0 < Nat.card A := mod_cast A_pos exact ZModModule.exists_submodule_subset_card_le Nat.prime_two H h.le A_pos'.ne' have : (Nat.card A / 2 : ℝ) < Nat.card H' := by rw [div_lt_iff₀ zero_lt_two, mul_comm]; norm_cast have H'_pos : (0 : ℝ) < Nat.card H' := by have : 0 < Nat.card H' := Nat.card_pos; positivity obtain ⟨u, HH'u, hu⟩ := H'.toAddSubgroup.exists_left_transversal_of_le (H := H.toAddSubgroup) H'H dsimp at HH'u refine ⟨H', c + u, ?_, IH'A, by rwa [add_assoc, HH'u]⟩ calc (Nat.card (c + u) : ℝ) ≤ Nat.card c * Nat.card u := mod_cast natCard_add_le _ ≤ (K ^ 5 * Nat.card A ^ (1 / 2 : ℝ) * (Nat.card H ^ (-1 / 2 : ℝ))) * (Nat.card H / Nat.card H') := by gcongr apply le_of_eq rw [eq_div_iff H'_pos.ne'] norm_cast _ < (K ^ 5 * Nat.card A ^ (1 / 2 : ℝ) * (Nat.card H ^ (-1 / 2 : ℝ))) * (Nat.card H / (Nat.card A / 2)) := by gcongr _ = 2 * K ^ 5 * Nat.card A ^ (-1 / 2 : ℝ) * Nat.card H ^ (1 / 2 : ℝ) := by field_simp simp_rw [← rpow_natCast] rpow_ring norm_num _ ≤ 2 * K ^ 5 * Nat.card A ^ (-1 / 2 : ℝ) * (K ^ 8 * Nat.card A) ^ (1 / 2 : ℝ) := by gcongr _ = 2 * K ^ 9 := by simp_rw [← rpow_natCast] rpow_ring norm_num /-- Corollary of `better_PFR_conjecture` in which the ambient group is not required to be finite (but) then $H$ and $c$ are finite. -/
pfr/blueprint/src/chapter/further_improvement.tex:371
pfr/PFR/RhoFunctional.lean:2074
PFR
better_PFR_conjecture_aux
\begin{corollary}\label{pfr-9-aux'}\lean{better_PFR_conjecture_aux}\leanok If $|A+A| \leq K|A|$, then there exist a subgroup $H$ and a subset $c$ of $G$ with $A \subseteq c + H$, such that $|c| \leq K^{5} |A|^{1/2}/|H|^{1/2}$ and $|H|/|A|\in[K^{-8},K^8]$. \end{corollary} \begin{proof}\leanok \uses{pfr-9-aux, ruz-cov} Apply \Cref{pfr-9-aux} and \Cref{ruz-cov} to get the result, as in the proof of \Cref{pfr_aux}. \end{proof}
lemma better_PFR_conjecture_aux {A : Set G} (h₀A : A.Nonempty) {K : ℝ} (hA : Nat.card (A + A) ≤ K * Nat.card A) : ∃ (H : Submodule (ZMod 2) G) (c : Set G), Nat.card c ≤ K ^ 5 * Nat.card A ^ (1 / 2 : ℝ) * (Nat.card H : ℝ) ^ (-1 / 2 : ℝ) ∧ Nat.card H ≤ K ^ 8 * Nat.card A ∧ Nat.card A ≤ K ^ 8 * Nat.card H ∧ A ⊆ c + H := by obtain ⟨A_pos, -, K_pos⟩ : (0 : ℝ) < Nat.card A ∧ (0 : ℝ) < Nat.card (A + A) ∧ 0 < K := PFR_conjecture_pos_aux' h₀A hA rcases better_PFR_conjecture_aux0 h₀A hA with ⟨H, x₀, J, IAH, IHA⟩ have H_pos : (0 : ℝ) < Nat.card H := by have : 0 < Nat.card H := Nat.card_pos positivity have Hne : Set.Nonempty (A ∩ (H + {x₀})) := by by_contra h' have : 0 < Nat.card H := Nat.card_pos have : (0 : ℝ) < Nat.card (A ∩ (H + {x₀}) : Set G) := lt_of_lt_of_le (by positivity) J simp only [Nat.card_eq_fintype_card, Nat.card_of_isEmpty, CharP.cast_eq_zero, lt_self_iff_false, not_nonempty_iff_eq_empty.1 h', Fintype.card_ofIsEmpty] at this /- use Rusza covering lemma to cover `A` by few translates of `A ∩ (H + {x₀}) - A ∩ (H + {x₀})` (which is contained in `H`). The number of translates is at most `#(A + (A ∩ (H + {x₀}))) / #(A ∩ (H + {x₀}))`, where the numerator is controlled as this is a subset of `A + A`, and the denominator is bounded below by the previous inequality`. -/ have Z3 : (Nat.card (A + A ∩ (↑H + {x₀})) : ℝ) ≤ (K ^ 5 * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * Nat.card ↑(A ∩ (↑H + {x₀})) := by calc (Nat.card (A + A ∩ (↑H + {x₀})) : ℝ) _ ≤ Nat.card (A + A) := by gcongr; exact Nat.card_mono (toFinite _) <| add_subset_add_left inter_subset_left _ ≤ K * Nat.card A := hA _ = (K ^ 5 * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * (K ^ (-4 : ℤ) * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (1/2 : ℝ)) := by simp_rw [← rpow_natCast, ← rpow_intCast]; rpow_ring; norm_num _ ≤ (K ^ 5 * Nat.card A ^ (1/2 : ℝ) * Nat.card H ^ (-1/2 : ℝ)) * Nat.card ↑(A ∩ (↑H + {x₀})) := by gcongr obtain ⟨u, huA, hucard, hAu, -⟩ := Set.ruzsa_covering_add (toFinite A) (toFinite (A ∩ ((H + {x₀} : Set G)))) Hne (by convert Z3) have A_subset_uH : A ⊆ u + H := by refine hAu.trans $ add_subset_add_left $ (sub_subset_sub (inter_subset_right ..) (inter_subset_right ..)).trans ?_ rw [add_sub_add_comm, singleton_sub_singleton, _root_.sub_self] simp exact ⟨H, u, hucard, IHA, IAH, A_subset_uH⟩ /-- If $A \subset {\bf F}_2^n$ is finite non-empty with $|A+A| \leq K|A|$, then there exists a subgroup $H$ of ${\bf F}_2^n$ with $|H| \leq |A|$ such that $A$ can be covered by at most $2K^9$ translates of $H$. -/
pfr/blueprint/src/chapter/further_improvement.tex:358
pfr/PFR/RhoFunctional.lean:2028
PFR
better_PFR_conjecture_aux0
\begin{corollary}\label{pfr-9-aux}\lean{better_PFR_conjecture_aux0}\leanok If $|A+A| \leq K|A|$, then there exists a subgroup $H$ and $t\in G$ such that $|A \cap (H+t)| \geq K^{-4} \sqrt{|A||H|}$, and $|H|/|A|\in[K^{-8},K^8]$. \end{corollary} \begin{proof}\leanok \uses{pfr-rho,rho-init,rho-subgroup} Apply \Cref{pfr-rho} on $U_A,U_A$ to get a subspace such that $2\rho(U_H)\le 2\rho(U_A)+8d[U_A;U_A]$. Recall that $d[U_A;U_A]\le \log K$ as proved in \Cref{pfr_aux}, and $\rho(U_A)=0$ by \Cref{rho-init}. Therefore $\rho(U_H)\le 4\log(K)$. The claim then follows from \Cref{rho-subgroup}. \end{proof}
lemma better_PFR_conjecture_aux0 {A : Set G} (h₀A : A.Nonempty) {K : ℝ} (hA : Nat.card (A + A) ≤ K * Nat.card A) : ∃ (H : Submodule (ZMod 2) G) (t : G), K ^ (-4 : ℤ) * Nat.card A ^ (1 / 2 : ℝ) * Nat.card H ^ (1 / 2 : ℝ) ≤ Nat.card ↑(A ∩ (H + {t})) ∧ Nat.card A ≤ K ^ 8 * Nat.card H ∧ Nat.card H ≤ K ^ 8 * Nat.card A := by have A_fin : Finite A := by infer_instance classical let mG : MeasurableSpace G := ⊤ have : MeasurableSingletonClass G := ⟨λ _ ↦ trivial⟩ obtain ⟨A_pos, -, K_pos⟩ : (0 : ℝ) < Nat.card A ∧ (0 : ℝ) < Nat.card (A + A) ∧ 0 < K := PFR_conjecture_pos_aux' h₀A hA let A' := A.toFinite.toFinset have h₀A' : Finset.Nonempty A' := by simp [A', Finset.Nonempty] exact h₀A have hAA' : A' = A := Finite.coe_toFinset (toFinite A) rcases exists_isUniform_measureSpace A' h₀A' with ⟨Ω₀, mΩ₀, UA, hP₀, UAmeas, UAunif, -⟩ rw [hAA'] at UAunif have hadd_sub : A + A = A - A := by ext; simp [Set.mem_add, Set.mem_sub, ZModModule.sub_eq_add] rw [hadd_sub] at hA have : d[UA # UA] ≤ log K := rdist_le_of_isUniform_of_card_add_le h₀A hA UAunif UAmeas rw [← hadd_sub] at hA -- entropic PFR gives a subgroup `H` which is close to `A` for the rho functional rcases rho_PFR_conjecture UA UA UAmeas UAmeas A' h₀A' with ⟨H, Ω₁, mΩ₁, UH, hP₁, UHmeas, UHunif, hUH⟩ have ineq : ρ[UH # A'] ≤ 4 * log K := by rw [← hAA'] at UAunif have : ρ[UA # A'] = 0 := rho_of_uniform UAunif UAmeas h₀A' linarith set r := 4 * log K with hr have J : K ^ (-4 : ℤ) = exp (-r) := by rw [hr, ← neg_mul, mul_comm, exp_mul, exp_log K_pos] norm_cast have J' : K ^ 8 = exp (2 * r) := by have : 2 * r = 8 * log K := by ring rw [this, mul_comm, exp_mul, exp_log K_pos] norm_cast rw [J, J'] refine ⟨H, ?_⟩ have Z := rho_of_submodule UHunif h₀A' UHmeas r ineq have : Nat.card A = Nat.card A' := by simp [← hAA'] have I t : t +ᵥ (H : Set G) = (H : Set G) + {t} := by ext z; simp [mem_vadd_set_iff_neg_vadd_mem, add_comm] simp_rw [← I] convert Z exact hAA'.symm /-- Auxiliary statement towards the polynomial Freiman-Ruzsa (PFR) conjecture: if $A$ is a subset of an elementary abelian 2-group of doubling constant at most $K$, then there exists a subgroup $H$ such that $A$ can be covered by at most $K^5 |A|^{1/2} / |H|^{1/2}$ cosets of $H$, and $H$ has the same cardinality as $A$ up to a multiplicative factor $K^8$. -/
pfr/blueprint/src/chapter/further_improvement.tex:347
pfr/PFR/RhoFunctional.lean:1977
PFR
condKLDiv_eq
\begin{lemma}[Kullback--Leibler and conditioning]\label{kl-cond}\lean{condKLDiv_eq}\leanok If $X, Y$ are independent $G$-valued random variables, and $Z$ is another random variable defined on the same sample space as $X$, then $$D_{KL}((X|Z)\Vert Y) = D_{KL}(X\Vert Y) + \bbH[X] - \bbH[X|Z].$$ \end{lemma} \begin{proof}\leanok \uses{ckl-div} Compare the terms correspond to each $x\in G$ on both sides. \end{proof}
lemma condKLDiv_eq {S : Type*} [MeasurableSpace S] [Fintype S] [MeasurableSingletonClass S] [Fintype G] [IsZeroOrProbabilityMeasure μ] [IsFiniteMeasure μ'] {X : Ω → G} {Y : Ω' → G} {Z : Ω → S} (hX : Measurable X) (hZ : Measurable Z) (habs : ∀ x, μ'.map Y {x} = 0 → μ.map X {x} = 0) : KL[ X | Z ; μ # Y ; μ'] = KL[X ; μ # Y ; μ'] + H[X ; μ] - H[ X | Z ; μ] := by rcases eq_zero_or_isProbabilityMeasure μ with rfl | hμ · simp [condKLDiv, tsum_fintype, KLDiv_eq_sum, Finset.mul_sum, entropy_eq_sum] simp only [condKLDiv, tsum_fintype, KLDiv_eq_sum, Finset.mul_sum, entropy_eq_sum] rw [Finset.sum_comm, condEntropy_eq_sum_sum_fintype hZ, Finset.sum_comm (α := G), ← Finset.sum_add_distrib, ← Finset.sum_sub_distrib] congr with g simp only [negMulLog, neg_mul, Finset.sum_neg_distrib, mul_neg, sub_neg_eq_add, ← sub_eq_add_neg, ← mul_sub] simp_rw [← Measure.map_apply hZ (measurableSet_singleton _)] have : Measure.map X μ {g} = ∑ x, (Measure.map Z μ {x}) * (Measure.map X μ[|Z ⁻¹' {x}] {g}) := by simp_rw [Measure.map_apply hZ (measurableSet_singleton _)] have : Measure.map X μ {g} = Measure.map X (∑ x, μ (Z ⁻¹' {x}) • μ[|Z ⁻¹' {x}]) {g} := by rw [sum_meas_smul_cond_fiber hZ μ] rw [← MeasureTheory.Measure.sum_fintype, Measure.map_sum hX.aemeasurable] at this simpa using this nth_rewrite 1 [this] rw [ENNReal.toReal_sum (by simp [ENNReal.mul_eq_top]), Finset.sum_mul, ← Finset.sum_add_distrib] congr with s rw [ENNReal.toReal_mul, mul_assoc, ← mul_add, ← mul_add] rcases eq_or_ne (Measure.map Z μ {s}) 0 with hs | hs · simp [hs] rcases eq_or_ne (Measure.map X μ[|Z ⁻¹' {s}] {g}) 0 with hg | hg · simp [hg] have h'g : (Measure.map X μ[|Z ⁻¹' {s}] {g}).toReal ≠ 0 := by simp [ENNReal.toReal_eq_zero_iff, hg] congr have hXg : μ.map X {g} ≠ 0 := by intro h rw [this, Finset.sum_eq_zero_iff] at h specialize h s (Finset.mem_univ _) rw [mul_eq_zero] at h tauto have hXg' : (μ.map X {g}).toReal ≠ 0 := by simp [ENNReal.toReal_eq_zero_iff, hXg] have hYg : μ'.map Y {g} ≠ 0 := fun h ↦ hXg (habs _ h) have hYg' : (μ'.map Y {g}).toReal ≠ 0 := by simp [ENNReal.toReal_eq_zero_iff, hYg] rw [Real.log_div h'g hYg', Real.log_div hXg' hYg'] abel
pfr/blueprint/src/chapter/further_improvement.tex:65
pfr/PFR/Kullback.lean:332
PFR
condKLDiv_nonneg
\begin{lemma}[Conditional Gibbs inequality]\label{Conditional-Gibbs}\lean{condKLDiv_nonneg}\leanok $D_{KL}((X|W)\Vert Y) \geq 0$. \end{lemma} \begin{proof}\leanok \uses{Gibbs, ckl-div} Clear from Definition \ref{ckl-div} and Lemma \ref{Gibbs}. \end{proof}
/-- `KL(X|Z ‖ Y) ≥ 0`.-/ lemma condKLDiv_nonneg {S : Type*} [MeasurableSingletonClass G] [Fintype G] {X : Ω → G} {Y : Ω' → G} {Z : Ω → S} [IsZeroOrProbabilityMeasure μ'] (hX : Measurable X) (hY : Measurable Y) (habs : ∀ x, μ'.map Y {x} = 0 → μ.map X {x} = 0) : 0 ≤ KL[X | Z; μ # Y ; μ'] := by rw [condKLDiv] refine tsum_nonneg (fun i ↦ mul_nonneg (by simp) ?_) apply KLDiv_nonneg hX hY intro s hs specialize habs s hs rw [Measure.map_apply hX (measurableSet_singleton s)] at habs ⊢ exact cond_absolutelyContinuous habs
pfr/blueprint/src/chapter/further_improvement.tex:73
pfr/PFR/Kullback.lean:376
PFR
condMultiDist
\begin{definition}[Conditional multidistance]\label{cond-multidist-def}\uses{multidist-def}\lean{condMultiDist} \leanok If $X_{[m]} = (X_i)_{1 \leq i \leq m}$ and $Y_{[m]} = (Y_i)_{1 \leq i \leq m}$ are tuples of random variables, with the $X_i$ being $G$-valued (but the $Y_i$ need not be), then we define \begin{equation}\label{multi-def-cond-alt} D[ X_{[m]} | Y_{[m]} ] = \sum_{(y_i)_{1 \leq i \leq m}} \biggl(\prod_{1 \leq i \leq m} p_{Y_i}(y_i)\biggr) D[ (X_i \,|\, Y_i \mathop{=}y_i)_{1 \leq i \leq m}] \end{equation} where each $y_i$ ranges over the support of $p_{Y_i}$ for $1 \leq i \leq m$. \end{definition}
def condMultiDist {m : ℕ} {Ω : Fin m → Type*} (hΩ : ∀ i, MeasureSpace (Ω i)) {S : Type*} [Fintype S] (X : ∀ i, (Ω i) → G) (Y : ∀ i, (Ω i) → S) : ℝ := ∑ ω : Fin m → S, (∏ i, ((hΩ i).volume ((Y i) ⁻¹' {ω i})).toReal) * D[X; fun i ↦ ⟨cond (hΩ i).volume (Y i ⁻¹' {ω i})⟩] @[inherit_doc multiDist] notation3:max "D[" X " | " Y " ; " hΩ "]" => condMultiDist hΩ X Y
pfr/blueprint/src/chapter/torsion.tex:314
pfr/PFR/MoreRuzsaDist.lean:862
PFR
condMultiDist_eq
\begin{lemma}[Alternate form of conditional multidistance]\label{cond-multidist-alt}\lean{condMultiDist_eq}\leanok If the $(X_i,Y_i)$ are independent, \begin{equation}\label{multi-def-cond} D[ X_{[m]} | Y_{[m]}] := \bbH[\sum_{i=1}^m X_i \big| (Y_j)_{1 \leq j \leq m} ] - \frac{1}{m} \sum_{i=1}^m \bbH[ X_i | Y_i]. \end{equation} \end{lemma} \begin{proof}\uses{conditional-entropy-def, multidist-def, cond-multidist-def}\leanok This is routine from \Cref{conditional-entropy-def} and Definitions \ref{multidist-def} and \ref{cond-multidist-def}. \end{proof}
lemma condMultiDist_eq {m : ℕ} {Ω : Type*} [hΩ : MeasureSpace Ω] {S : Type*} [Fintype S] [hS : MeasurableSpace S] [MeasurableSingletonClass S] {X : Fin m → Ω → G} (hX : ∀ i, Measurable (X i)) {Y : Fin m → Ω → S} (hY : ∀ i, Measurable (Y i)) (h_indep: iIndepFun (fun i ↦ ⟨X i, Y i⟩)) : D[X | Y ; fun _ ↦ hΩ] = H[fun ω ↦ ∑ i, X i ω | fun ω ↦ (fun i ↦ Y i ω)] - (∑ i, H[X i | Y i])/m := by have : IsProbabilityMeasure (ℙ : Measure Ω) := h_indep.isProbabilityMeasure let E := fun i (yi:S) ↦ Y i ⁻¹' {yi} let E' := fun (y : Fin m → S) ↦ ⋂ i, E i (y i) let f := fun (y : Fin m → S) ↦ ∏ i, (ℙ (E i (y i))).toReal calc _ = ∑ y, (f y) * D[X; fun i ↦ ⟨cond ℙ (E i (y i))⟩] := by rfl _ = ∑ y, (f y) * (H[∑ i, X i; cond ℙ (E' y)] - (∑ i, H[X i; cond ℙ (E' y)]) / m) := by congr with y by_cases hf : f y = 0 . simp only [hf, zero_mul] congr 1 rw [multiDist_copy (fun i ↦ ⟨cond ℙ (E i (y i))⟩) (fun _ ↦ ⟨cond ℙ (E' y)⟩) X X (fun i ↦ ident_of_cond_of_indep hX hY h_indep y i (prob_nonzero_of_prod_prob_nonzero hf))] exact multiDist_indep _ _ <| h_indep.cond hY (prob_nonzero_of_prod_prob_nonzero hf) fun _ ↦ .singleton _ _ = ∑ y, (f y) * H[∑ i, X i; cond ℙ (E' y)] - (∑ i, ∑ y, (f y) * H[X i; cond ℙ (E' y)])/m := by rw [Finset.sum_comm, Finset.sum_div, ← Finset.sum_sub_distrib] congr with y rw [← Finset.mul_sum, mul_div_assoc, ← mul_sub] _ = _ := by congr · rw [condEntropy_eq_sum_fintype] · congr with y congr · calc _ = (∏ i, (ℙ (E i (y i)))).toReal := Eq.symm ENNReal.toReal_prod _ = (ℙ (⋂ i, (E i (y i)))).toReal := by congr exact (iIndepFun.meas_iInter h_indep fun _ ↦ mes_of_comap (.singleton _)).symm _ = _ := by congr ext x simp only [Set.mem_iInter, Set.mem_preimage, Set.mem_singleton_iff, E, Iff.symm funext_iff] · exact Finset.sum_fn Finset.univ fun c ↦ X c ext x simp only [Set.mem_iInter, Set.mem_preimage, Set.mem_singleton_iff, E'] exact Iff.symm funext_iff exact measurable_pi_lambda (fun ω i ↦ Y i ω) hY ext i calc _ = ∑ y, f y * H[X i; cond ℙ (E i (y i))] := by congr with y by_cases hf : f y = 0 . simp only [hf, zero_mul] congr 1 apply IdentDistrib.entropy_eq exact (ident_of_cond_of_indep hX hY h_indep y i (prob_nonzero_of_prod_prob_nonzero hf)).symm _ = ∑ y ∈ Fintype.piFinset (fun _ ↦ Finset.univ), ∏ i', (ℙ (E i' (y i'))).toReal * (if i'=i then H[X i; cond ℙ (E i (y i'))] else 1) := by simp only [Fintype.piFinset_univ] congr with y rw [Finset.prod_mul_distrib] congr rw [Fintype.prod_ite_eq'] _ = _ := by convert (Finset.prod_univ_sum (fun _ ↦ Finset.univ) (fun (i' : Fin m) (s : S) ↦ (ℙ (E i' s)).toReal * if i' = i then H[X i ; ℙ[|E i s]] else 1)).symm calc _ = ∏ i', if i' = i then H[X i' | Y i'] else 1 := by simp only [Finset.prod_ite_eq', Finset.mem_univ, ↓reduceIte] _ = _ := by congr with i' by_cases h : i' = i · simp only [h, ↓reduceIte, E] rw [condEntropy_eq_sum_fintype] exact hY i · simp only [h, ↓reduceIte, mul_one, E] exact (sum_measure_preimage_singleton' _ (hY i')).symm /-- If `(X_i, Y_i)`, `1 ≤ i ≤ m` are independent, then `D[X_[m] | Y_[m]] = ∑_{(y_i)_{1 ≤ i ≤ m}} P(Y_i=y_i ∀ i) D[(X_i | Y_i=y_i ∀ i)_{i=1}^m]` -/
pfr/blueprint/src/chapter/torsion.tex:322
pfr/PFR/MoreRuzsaDist.lean:999
PFR
condMultiDist_nonneg
\begin{lemma}[Conditional multidistance nonnegative]\label{cond-multidist-nonneg}\uses{cond-multidist-def}\lean{condMultiDist_nonneg}\leanok If $X_{[m]} = (X_i)_{1 \leq i \leq m}$ and $Y_{[m]} = (Y_i)_{1 \leq i \leq m}$ are tuples of random variables, then $D[ X_{[m]} | Y_{[m]} ] \geq 0$. \end{lemma} \begin{proof}\uses{multidist-nonneg}\leanok Clear from \Cref{multidist-nonneg} and \Cref{cond-multidist-def}, except that some care may need to be taken to deal with the $y_i$ where $p_{Y_i}$ vanish. \end{proof}
/--Conditional multidistance is nonnegative. -/ theorem condMultiDist_nonneg [Fintype G] {m : ℕ} {Ω : Fin m → Type*} (hΩ : ∀ i, MeasureSpace (Ω i)) (hprob : ∀ i, IsProbabilityMeasure (ℙ : Measure (Ω i))) {S : Type*} [Fintype S] (X : ∀ i, (Ω i) → G) (Y : ∀ i, (Ω i) → S) (hX : ∀ i, Measurable (X i)) : 0 ≤ D[X | Y; hΩ] := by dsimp [condMultiDist] apply Finset.sum_nonneg intro y _ by_cases h: ∀ i : Fin m, ℙ (Y i ⁻¹' {y i}) ≠ 0 . apply mul_nonneg . apply Finset.prod_nonneg intro i _ exact ENNReal.toReal_nonneg exact multiDist_nonneg (fun i => ⟨ℙ[|Y i ⁻¹' {y i}]⟩) (fun i => ProbabilityTheory.cond_isProbabilityMeasure (h i)) X hX simp only [ne_eq, not_forall, Decidable.not_not] at h obtain ⟨i, hi⟩ := h apply le_of_eq symm convert zero_mul ?_ apply Finset.prod_eq_zero (Finset.mem_univ i) simp only [hi, ENNReal.zero_toReal] /-- A technical lemma: can push a constant into a product at a specific term -/ private lemma Finset.prod_mul {α β:Type*} [Fintype α] [DecidableEq α] [CommMonoid β] (f:α → β) (c: β) (i₀:α) : (∏ i, f i) * c = ∏ i, (if i=i₀ then f i * c else f i) := calc _ = (∏ i, f i) * (∏ i, if i = i₀ then c else 1) := by congr simp only [prod_ite_eq', mem_univ, ↓reduceIte] _ = _ := by rw [← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i _ by_cases h : i = i₀ . simp [h] simp [h] /-- A technical lemma: a preimage of a singleton of Y i is measurable with respect to the comap of <X i, Y i> -/ private lemma mes_of_comap {Ω S G : Type*} [hG : MeasurableSpace G] [hS : MeasurableSpace S] {X : Ω → G} {Y : Ω → S} {s : Set S} (hs : MeasurableSet s) : MeasurableSet[(hG.prod hS).comap fun ω ↦ (X ω, Y ω)] (Y ⁻¹' s) := ⟨.univ ×ˢ s, MeasurableSet.univ.prod hs, by ext; simp [eq_comm]⟩ /-- A technical lemma: two different ways of conditioning independent variables gives identical distributions -/ private lemma ident_of_cond_of_indep {G : Type*} [hG : MeasurableSpace G] [MeasurableSingletonClass G] [Countable G] {m : ℕ} {Ω : Type*} [hΩ : MeasureSpace Ω] {S : Type*} [Fintype S] [hS : MeasurableSpace S] [MeasurableSingletonClass S] {X : Fin m → Ω → G} (hX : (i:Fin m) → Measurable (X i)) {Y : Fin m → Ω → S} (hY : (i:Fin m) → Measurable (Y i)) (h_indep : ProbabilityTheory.iIndepFun (fun i ↦ ⟨X i, Y i⟩)) (y : Fin m → S) (i : Fin m) (hy: ∀ i, ℙ (Y i ⁻¹' {y i}) ≠ 0) : IdentDistrib (X i) (X i) (cond ℙ (Y i ⁻¹' {y i})) (cond ℙ (⋂ i, Y i ⁻¹' {y i})) where aemeasurable_fst := Measurable.aemeasurable (hX i) aemeasurable_snd := Measurable.aemeasurable (hX i) map_eq := by ext s hs rw [Measure.map_apply (hX i) hs, Measure.map_apply (hX i) hs] let s' : Finset (Fin m) := {i} let f' := fun _ : Fin m ↦ X i ⁻¹' s have hf' : ∀ i' ∈ s', MeasurableSet[hG.comap (X i')] (f' i') := by intro i' hi' simp only [Finset.mem_singleton.mp hi'] exact MeasurableSet.preimage hs (comap_measurable (X i)) have h := cond_iInter hY h_indep hf' (fun _ _ ↦ hy _) fun _ ↦ .singleton _ simp only [Finset.mem_singleton, Set.iInter_iInter_eq_left, Finset.prod_singleton, s'] at h exact h.symm /-- A technical lemma: if a product of probabilities is nonzero, then each probability is individually non-zero -/ private lemma prob_nonzero_of_prod_prob_nonzero {m : ℕ} {Ω : Type*} [hΩ : MeasureSpace Ω] {S : Type*} [Fintype S] [MeasurableSpace S] [MeasurableSingletonClass S] {Y : Fin m → Ω → S} {y : Fin m → S} (hf : ∏ i, (ℙ (Y i ⁻¹' {y i})).toReal ≠ 0) : ∀ i, ℙ (Y i ⁻¹' {y i}) ≠ 0 := by simp [Finset.prod_ne_zero_iff, ENNReal.toReal_eq_zero_iff, forall_and] at hf exact hf.1 /-- If `(X_i, Y_i)`, `1 ≤ i ≤ m` are independent, then `D[X_[m] | Y_[m]] = H[∑ i, X_i | (Y_1, ..., Y_m)] - 1/m * ∑ i, H[X_i | Y_i]` -/
pfr/blueprint/src/chapter/torsion.tex:333
pfr/PFR/MoreRuzsaDist.lean:921
PFR
condRhoMinus_le
\begin{lemma}[Rho and conditioning]\label{rho-cond}\lean{condRhoMinus_le, condRhoPlus_le, condRho_le}\leanok If $X,Z$ are defined on the same space, one has $$ \rho^-(X|Z) \leq \rho^-(X) + \bbH[X] - \bbH[X|Z]$$ $$ \rho^+(X|Z) \leq \rho^+(X)$$ and $$ \rho(X|Z) \leq \rho(X) + \frac{1}{2}( \bbH[X] - \bbH[X|Z] ).$$ \end{lemma} \begin{proof}\leanok \uses{kl-cond} The first inequality follows from \Cref{kl-cond}. The second and third inequalities are direct corollaries of the first. \end{proof}
/-- $$ \rho^-(X|Z) \leq \rho^-(X) + \bbH[X] - \bbH[X|Z]$$ -/ lemma condRhoMinus_le [IsZeroOrProbabilityMeasure μ] {S : Type*} [MeasurableSpace S] [Fintype S] [MeasurableSingletonClass S] {Z : Ω → S} (hX : Measurable X) (hZ : Measurable Z) (hA : A.Nonempty) : ρ⁻[X | Z ; μ # A] ≤ ρ⁻[X ; μ # A] + H[X ; μ] - H[X | Z ; μ] := by have : IsProbabilityMeasure (uniformOn (A : Set G)) := by apply uniformOn_isProbabilityMeasure A.finite_toSet hA suffices ρ⁻[X | Z ; μ # A] - H[X ; μ] + H[X | Z ; μ] ≤ ρ⁻[X ; μ # A] by linarith apply le_csInf (nonempty_rhoMinusSet hA) rintro - ⟨μ', hμ', habs, rfl⟩ rw [condRhoMinus, tsum_fintype] let _ : MeasureSpace (G × G) := ⟨μ'.prod (uniformOn (A : Set G))⟩ have hP : (ℙ : Measure (G × G)) = μ'.prod (uniformOn (A : Set G)) := rfl have : IsProbabilityMeasure (ℙ : Measure (G × G)) := by rw [hP]; infer_instance have : ∑ b : S, (μ (Z ⁻¹' {b})).toReal * ρ⁻[X ; μ[|Z ← b] # A] ≤ KL[ X | Z ; μ # (Prod.fst + Prod.snd : G × G → G) ; ℙ] := by rw [condKLDiv, tsum_fintype] apply Finset.sum_le_sum (fun i hi ↦ ?_) gcongr apply rhoMinus_le_def hX (fun y hy ↦ ?_) have T := habs y hy rw [Measure.map_apply hX (measurableSet_singleton _)] at T ⊢ exact cond_absolutelyContinuous T rw [condKLDiv_eq hX hZ (by exact habs)] at this rw [← hP] linarith
pfr/blueprint/src/chapter/further_improvement.tex:176
pfr/PFR/RhoFunctional.lean:937
PFR
condRhoPlus_le
\begin{lemma}[Rho and conditioning]\label{rho-cond}\lean{condRhoMinus_le, condRhoPlus_le, condRho_le}\leanok If $X,Z$ are defined on the same space, one has $$ \rho^-(X|Z) \leq \rho^-(X) + \bbH[X] - \bbH[X|Z]$$ $$ \rho^+(X|Z) \leq \rho^+(X)$$ and $$ \rho(X|Z) \leq \rho(X) + \frac{1}{2}( \bbH[X] - \bbH[X|Z] ).$$ \end{lemma} \begin{proof}\leanok \uses{kl-cond} The first inequality follows from \Cref{kl-cond}. The second and third inequalities are direct corollaries of the first. \end{proof}
/-- $$ \rho^+(X|Z) \leq \rho^+(X)$$ -/ lemma condRhoPlus_le [IsProbabilityMeasure μ] {S : Type*} [MeasurableSpace S] [Fintype S] [MeasurableSingletonClass S] {Z : Ω → S} (hX : Measurable X) (hZ : Measurable Z) (hA : A.Nonempty) : ρ⁺[X | Z ; μ # A] ≤ ρ⁺[X ; μ # A] := by have : IsProbabilityMeasure (Measure.map Z μ) := isProbabilityMeasure_map hZ.aemeasurable have I₁ := condRhoMinus_le hX hZ hA (μ := μ) simp_rw [condRhoPlus, rhoPlus, tsum_fintype] simp only [Nat.card_eq_fintype_card, Fintype.card_coe, mul_sub, mul_add, Finset.sum_sub_distrib, Finset.sum_add_distrib, tsub_le_iff_right] rw [← Finset.sum_mul, ← tsum_fintype, ← condRhoMinus, ← condEntropy_eq_sum_fintype _ _ _ hZ] simp_rw [← Measure.map_apply hZ (measurableSet_singleton _)] simp only [Finset.sum_toReal_measure_singleton, Finset.coe_univ, measure_univ, ENNReal.one_toReal, one_mul, sub_add_cancel, ge_iff_le] linarith omit [Fintype G] [DiscreteMeasurableSpace G] in
pfr/blueprint/src/chapter/further_improvement.tex:176
pfr/PFR/RhoFunctional.lean:964
PFR
condRho_le
\begin{lemma}[Rho and conditioning]\label{rho-cond}\lean{condRhoMinus_le, condRhoPlus_le, condRho_le}\leanok If $X,Z$ are defined on the same space, one has $$ \rho^-(X|Z) \leq \rho^-(X) + \bbH[X] - \bbH[X|Z]$$ $$ \rho^+(X|Z) \leq \rho^+(X)$$ and $$ \rho(X|Z) \leq \rho(X) + \frac{1}{2}( \bbH[X] - \bbH[X|Z] ).$$ \end{lemma} \begin{proof}\leanok \uses{kl-cond} The first inequality follows from \Cref{kl-cond}. The second and third inequalities are direct corollaries of the first. \end{proof}
/-- $$ \rho(X|Z) \leq \rho(X) + \frac{1}{2}( \bbH[X] - \bbH[X|Z] )$$ -/ lemma condRho_le [IsProbabilityMeasure μ] {S : Type*} [MeasurableSpace S] [Fintype S] [MeasurableSingletonClass S] {Z : Ω → S} (hX : Measurable X) (hZ : Measurable Z) (hA : A.Nonempty) : ρ[X | Z ; μ # A] ≤ ρ[X ; μ # A] + (H[X ; μ] - H[X | Z ; μ]) / 2 := by rw [condRho_eq, rho] linarith [condRhoMinus_le hX hZ hA (μ := μ), condRhoPlus_le hX hZ hA (μ := μ)] omit [Fintype G] [DiscreteMeasurableSpace G] in
pfr/blueprint/src/chapter/further_improvement.tex:176
pfr/PFR/RhoFunctional.lean:987
PFR
condRho_of_injective
\begin{lemma}[Conditional rho and relabeling]\label{rho-cond-relabeled}\lean{condRho_of_injective}\leanok If $f$ is injective, then $\rho(X|f(Y))=\rho(X|Y)$. \end{lemma} \begin{proof}\leanok \uses{rho-cond-def} Clear from the definition. \end{proof}
/-- If $f$ is injective, then $\rho(X|f(Y))=\rho(X|Y)$. -/ lemma condRho_of_injective {S T : Type*} (Y : Ω → S) {A : Finset G} {f : S → T} (hf : Function.Injective f) : ρ[X | f ∘ Y ; μ # A] = ρ[X | Y ; μ # A] := by simp only [condRho] rw [← hf.tsum_eq] · have I c : f ∘ Y ⁻¹' {f c} = Y ⁻¹' {c} := by ext z; simp [hf.eq_iff] simp [I] · intro y hy have : f ∘ Y ⁻¹' {y} ≠ ∅ := by intro h simp [h] at hy rcases Set.nonempty_iff_ne_empty.2 this with ⟨a, ha⟩ simp only [mem_preimage, Function.comp_apply, mem_singleton_iff] at ha rw [← ha] exact mem_range_self (Y a)
pfr/blueprint/src/chapter/further_improvement.tex:168
pfr/PFR/RhoFunctional.lean:895
PFR
condRho_of_sum_le
\begin{lemma}[Rho and conditioning, symmetrized]\label{rho-cond-sym}\lean{condRho_of_sum_le}\leanok If $X,Y$ are independent, then $$ \rho(X | X+Y) \leq \frac{1}{2}(\rho(X)+\rho(Y) + d[X;Y]).$$ \end{lemma} \begin{proof}\leanok \uses{rho-invariant,rho-cond} First apply \Cref{rho-cond} to get $\rho(X|X+Y)\le \rho(X) + \frac{1}{2}(\bbH[X+Y]-\bbH[Y])$, and $\rho(Y|X+Y)\le \rho(Y)+\frac{1}{2}(\bbH[X+Y]-\bbH[X])$. Then apply \Cref{rho-invariant} to get $\rho(Y|X+Y)=\rho(X|X+Y)$ and take the average of the two inequalities. \end{proof}
lemma condRho_of_sum_le [IsProbabilityMeasure μ] (hX : Measurable X) (hY : Measurable Y) (hA : A.Nonempty) (h_indep : IndepFun X Y μ) : ρ[X | X + Y ; μ # A] ≤ (ρ[X ; μ # A] + ρ[Y ; μ # A] + d[ X ; μ # Y ; μ ]) / 2 := by have I : ρ[X | X + Y ; μ # A] ≤ ρ[X ; μ # A] + (H[X ; μ] - H[X | X + Y ; μ]) / 2 := condRho_le hX (by fun_prop) hA have I' : H[X ; μ] - H[X | X + Y ; μ] = H[X + Y ; μ] - H[Y ; μ] := by rw [ProbabilityTheory.chain_rule'' _ hX (by fun_prop), entropy_add_right hX hY, IndepFun.entropy_pair_eq_add hX hY h_indep] abel have J : ρ[Y | Y + X ; μ # A] ≤ ρ[Y ; μ # A] + (H[Y ; μ] - H[Y | Y + X ; μ]) / 2 := condRho_le hY (by fun_prop) hA have J' : H[Y ; μ] - H[Y | Y + X ; μ] = H[Y + X ; μ] - H[X ; μ] := by rw [ProbabilityTheory.chain_rule'' _ hY (by fun_prop), entropy_add_right hY hX, IndepFun.entropy_pair_eq_add hY hX h_indep.symm] abel have : Y + X = X + Y := by abel simp only [this] at J J' have : ρ[X | X + Y ; μ # A] = ρ[Y | X + Y ; μ # A] := by simp only [condRho] congr with s congr 1 have : ρ[X ; μ[|(X + Y) ⁻¹' {s}] # A] = ρ[fun ω ↦ X ω + s ; μ[|(X + Y) ⁻¹' {s}] # A] := by rw [rho_of_translate hX hA] rw [this] apply rho_eq_of_identDistrib apply IdentDistrib.of_ae_eq (by fun_prop) have : MeasurableSet ((X + Y) ⁻¹' {s}) := by have : Measurable (X + Y) := by fun_prop exact this (measurableSet_singleton _) filter_upwards [ae_cond_mem this] with a ha simp only [mem_preimage, Pi.add_apply, mem_singleton_iff] at ha rw [← ha] nth_rewrite 1 [← ZModModule.neg_eq_self (X a)] abel have : X - Y = X + Y := ZModModule.sub_eq_add _ _ rw [h_indep.rdist_eq hX hY, sub_eq_add_neg, this] linarith end
pfr/blueprint/src/chapter/further_improvement.tex:198
pfr/PFR/RhoFunctional.lean:1075
PFR
condRho_of_translate
\begin{lemma}[Conditional rho and translation]\label{rho-cond-invariant}\lean{condRho_of_translate}\leanok For any $s\in G$, $\rho(X+s|Y)=\rho(X|Y)$. \end{lemma} \begin{proof} \uses{rho-cond-def,rho-invariant}\leanok Direct corollary of \Cref{rho-invariant}. \end{proof}
/-- For any $s\in G$, $\rho(X+s|Y)=\rho(X|Y)$. -/ lemma condRho_of_translate {S : Type*} {Y : Ω → S} (hX : Measurable X) (hA : A.Nonempty) (s : G) : ρ[fun ω ↦ X ω + s | Y ; μ # A] = ρ[X | Y ; μ # A] := by simp [condRho, rho_of_translate hX hA] omit [Fintype G] [DiscreteMeasurableSpace G] in variable (X) in
pfr/blueprint/src/chapter/further_improvement.tex:160
pfr/PFR/RhoFunctional.lean:887
PFR
condRho_sum_le
\begin{lemma}\label{rho-increase}\lean{condRho_sum_le}\leanok For independent random variables $Y_1,Y_2,Y_3,Y_4$ over $G$, define $S:=Y_1+Y_2+Y_3+Y_4$, $T_1:=Y_1+Y_2$, $T_2:=Y_1+Y_3$. Then $$\rho(T_1|T_2,S)+\rho(T_2|T_1,S) - \frac{1}{2}\sum_{i} \rho(Y_i)\le \frac{1}{2}(d[Y_1;Y_2]+d[Y_3;Y_4]+d[Y_1;Y_3]+d[Y_2;Y_4]).$$ \end{lemma} \begin{proof}\leanok\uses{rho-sums-sym, rho-cond, rho-cond-sym, rho-cond-relabeled, cor-fibre} Let $T_1':=Y_3+Y_4$, $T_2':=Y_2+Y_4$. First note that \begin{align*} \rho(T_1|T_2,S) &\le \rho(T_1|S) + \frac{1}{2}\bbI(T_1:T_2\mid S) \\ &\le \frac{1}{2}(\rho(T_1)+\rho(T_1'))+\frac{1}{2}(d[T_1;T_1']+\bbI(T_1:T_2\mid S)) \\ &\le \frac{1}{4} \sum_{i} \rho(Y_i) +\frac{1}{4}(d[Y_1;Y_2]+d[Y_3;Y_4]) + \frac{1}{2}(d[T_1;T_1']+\bbI(T_1:T_2\mid S)). \end{align*} by \Cref{rho-cond}, \Cref{rho-cond-sym}, \Cref{rho-sums-sym} respectively. On the other hand, observe that \begin{align*} \rho(T_1|T_2,S) &=\rho(Y_1+Y_2|T_2,T_2') \\ &\le \frac{1}{2}(\rho(Y_1|T_2)+\rho(Y_2|T_2'))+\frac{1}{2}(d[Y_1|T_2;Y_2|T_2']) \\ &\le \frac{1}{4} \sum_{i} \rho(Y_i) +\frac{1}{4}(d[Y_1;Y_3]+d[Y_2;Y_4]) + \frac{1}{2}(d[Y_1|T_2;Y_2|T_2']). \end{align*} by \Cref{rho-cond-relabeled}, \Cref{rho-sums-sym}, \Cref{rho-cond-sym} respectively. By replacing $(Y_1,Y_2,Y_3,Y_4)$ with $(Y_1,Y_3,Y_2,Y_4)$ in the above inequalities, one has $$\rho(T_2|T_1,S) \le \frac{1}{4} \sum_{i} \rho(Y_i) +\frac{1}{4}(d[Y_1;Y_3]+d[Y_2;Y_4]) + \frac{1}{2}(d[T_2;T_2']+\bbI(T_1:T_2\mid S))$$ and $$\rho(T_2|T_1,S) \le \frac{1}{4} \sum_{i} \rho(Y_i) +\frac{1}{4}(d[Y_1;Y_2]+d[Y_3;Y_4]) + \frac{1}{2}(d[Y_1|T_1;Y_3|T_1']).$$ Finally, take the sum of all four inequalities, apply \Cref{cor-fibre} on $(Y_1,Y_2,Y_3,Y_4)$ and $(Y_1,Y_3,Y_2,Y_4)$ to rewrite the sum of last terms in the four inequalities, and divide the result by $2$. \end{proof}
lemma condRho_sum_le {Y₁ Y₂ Y₃ Y₄ : Ω → G} (hY₁ : Measurable Y₁) (hY₂ : Measurable Y₂) (hY₃ : Measurable Y₃) (hY₄ : Measurable Y₄) (h_indep : iIndepFun ![Y₁, Y₂, Y₃, Y₄]) (hA : A.Nonempty) : ρ[Y₁ + Y₂ | ⟨Y₁ + Y₃, Y₁ + Y₂ + Y₃ + Y₄⟩ # A] + ρ[Y₁ + Y₃ | ⟨Y₁ + Y₂, Y₁ + Y₂ + Y₃ + Y₄⟩ # A] - (ρ[Y₁ # A] + ρ[Y₂ # A] + ρ[Y₃ # A] + ρ[Y₄ # A]) / 2 ≤ (d[Y₁ # Y₂] + d[Y₃ # Y₄] + d[Y₁ # Y₃] + d[Y₂ # Y₄]) / 2 := by set S := Y₁ + Y₂ + Y₃ + Y₄ set T₁ := Y₁ + Y₂ set T₂ := Y₁ + Y₃ set T₁' := Y₃ + Y₄ set T₂' := Y₂ + Y₄ have J : ρ[T₁ | ⟨T₂, S⟩ # A] ≤ (ρ[Y₁ # A] + ρ[Y₂ # A] + ρ[Y₃ # A] + ρ[Y₄ # A]) / 4 + (d[Y₁ # Y₂] + d[Y₃ # Y₄] + d[Y₁ # Y₃] + d[Y₂ # Y₄]) / 8 + (d[Y₁ + Y₂ # Y₃ + Y₄] + I[Y₁ + Y₂ : Y₁ + Y₃ | Y₁ + Y₂ + Y₃ + Y₄] + d[Y₁ | Y₁ + Y₃ # Y₂ | Y₂ + Y₄]) / 4 := new_gen_ineq hY₁ hY₂ hY₃ hY₄ h_indep hA have J' : ρ[T₂ | ⟨T₁, Y₁ + Y₃ + Y₂ + Y₄⟩ # A] ≤ (ρ[Y₁ # A] + ρ[Y₃ # A] + ρ[Y₂ # A] + ρ[Y₄ # A]) / 4 + (d[Y₁ # Y₃] + d[Y₂ # Y₄] + d[Y₁ # Y₂] + d[Y₃ # Y₄]) / 8 + (d[Y₁ + Y₃ # Y₂ + Y₄] + I[Y₁ + Y₃ : Y₁ + Y₂|Y₁ + Y₃ + Y₂ + Y₄] + d[Y₁ | Y₁ + Y₂ # Y₃ | Y₃ + Y₄]) / 4 := new_gen_ineq hY₁ hY₃ hY₂ hY₄ h_indep.reindex_four_acbd hA have : Y₁ + Y₃ + Y₂ + Y₄ = S := by simp only [S]; abel rw [this] at J' have : d[Y₁ + Y₂ # Y₃ + Y₄] + I[Y₁ + Y₂ : Y₁ + Y₃ | Y₁ + Y₂ + Y₃ + Y₄] + d[Y₁ | Y₁ + Y₃ # Y₂ | Y₂ + Y₄] + d[Y₁ + Y₃ # Y₂ + Y₄] + I[Y₁ + Y₃ : Y₁ + Y₂|S] + d[Y₁ | Y₁ + Y₂ # Y₃ | Y₃ + Y₄] = (d[Y₁ # Y₂] + d[Y₃ # Y₄]) + (d[Y₁ # Y₃] + d[Y₂ # Y₄]) := by have K : Y₁ + Y₃ + Y₂ + Y₄ = S := by simp only [S]; abel have K' : I[Y₁ + Y₃ : Y₁ + Y₂|Y₁ + Y₂ + Y₃ + Y₄] = I[Y₁ + Y₃ : Y₃ + Y₄|Y₁ + Y₂ + Y₃ + Y₄] := by have : Measurable (Y₁ + Y₃) := by fun_prop rw [condMutualInfo_comm this (by fun_prop), condMutualInfo_comm this (by fun_prop)] have B := condMutualInfo_of_inj_map (X := Y₃ + Y₄) (Y := Y₁ + Y₃) (Z := Y₁ + Y₂ + Y₃ + Y₄) (by fun_prop) (by fun_prop) (by fun_prop) (fun a b ↦ a - b) (fun a ↦ sub_right_injective) (μ := ℙ) convert B with g simp have K'' : I[Y₁ + Y₂ : Y₁ + Y₃|Y₁ + Y₂ + Y₃ + Y₄] = I[Y₁ + Y₂ : Y₂ + Y₄|Y₁ + Y₂ + Y₃ + Y₄] := by have : Measurable (Y₁ + Y₂) := by fun_prop rw [condMutualInfo_comm this (by fun_prop), condMutualInfo_comm this (by fun_prop)] have B := condMutualInfo_of_inj_map (X := Y₂ + Y₄) (Y := Y₁ + Y₂) (Z := Y₁ + Y₂ + Y₃ + Y₄) (by fun_prop) (by fun_prop) (by fun_prop) (fun a b ↦ a - b) (fun a ↦ sub_right_injective) (μ := ℙ) convert B with g simp abel rw [sum_of_rdist_eq_char_2' Y₁ Y₂ Y₃ Y₄ h_indep hY₁ hY₂ hY₃ hY₄, sum_of_rdist_eq_char_2' Y₁ Y₃ Y₂ Y₄ h_indep.reindex_four_acbd hY₁ hY₃ hY₂ hY₄, K, K', K''] abel linarith /-- For independent random variables $Y_1,Y_2,Y_3,Y_4$ over $G$, define $T_1:=Y_1+Y_2, T_2:=Y_1+Y_3, T_3:=Y_2+Y_3$ and $S:=Y_1+Y_2+Y_3+Y_4$. Then $$\sum_{1 \leq i < j \leq 3} (\rho(T_i|T_j,S) + \rho(T_j|T_i,S) - \frac{1}{2}\sum_{i} \rho(Y_i))\le \sum_{1\leq i < j \leq 4}d[Y_i;Y_j]$$ -/
pfr/blueprint/src/chapter/further_improvement.tex:276
pfr/PFR/RhoFunctional.lean:1710
PFR
condRho_sum_le'
\begin{lemma}\label{rho-increase-symmetrized}\lean{condRho_sum_le'}\leanok For independent random variables $Y_1,Y_2,Y_3,Y_4$ over $G$, define $T_1:=Y_1+Y_2,T_2:=Y_1+Y_3,T_3:=Y_2+Y_3$ and $S:=Y_1+Y_2+Y_3+Y_4$. Then $$\sum_{1 \leq i<j \leq 3} (\rho(T_i|T_j,S) + \rho(T_j|T_i,S) - \frac{1}{2}\sum_{i} \rho(Y_i))\le \sum_{1\leq i < j \leq 4}d[Y_i;Y_j]$$ \end{lemma} \begin{proof}\uses{rho-increase}\leanok Apply Lemma \ref{rho-increase} on $(Y_i,Y_j,Y_k,Y_4)$ for $(i,j,k)=(1,2,3),(2,3,1),(1,3,2)$, and take the sum. \end{proof}
lemma condRho_sum_le' {Y₁ Y₂ Y₃ Y₄ : Ω → G} (hY₁ : Measurable Y₁) (hY₂ : Measurable Y₂) (hY₃ : Measurable Y₃) (hY₄ : Measurable Y₄) (h_indep : iIndepFun ![Y₁, Y₂, Y₃, Y₄]) (hA : A.Nonempty) : let S := Y₁ + Y₂ + Y₃ + Y₄ let T₁ := Y₁ + Y₂ let T₂ := Y₁ + Y₃ let T₃ := Y₂ + Y₃ ρ[T₁ | ⟨T₂, S⟩ # A] + ρ[T₂ | ⟨T₁, S⟩ # A] + ρ[T₁ | ⟨T₃, S⟩ # A] + ρ[T₃ | ⟨T₁, S⟩ # A] + ρ[T₂ | ⟨T₃, S⟩ # A] + ρ[T₃ | ⟨T₂, S⟩ # A] - 3 * (ρ[Y₁ # A] + ρ[Y₂ # A] + ρ[Y₃ # A] + ρ[Y₄ # A]) / 2 ≤ d[Y₁ # Y₂] + d[Y₁ # Y₃] + d[Y₁ # Y₄] + d[Y₂ # Y₃] + d[Y₂ # Y₄] + d[Y₃ # Y₄] := by have K₁ := condRho_sum_le hY₁ hY₂ hY₃ hY₄ h_indep hA have K₂ := condRho_sum_le hY₂ hY₁ hY₃ hY₄ h_indep.reindex_four_bacd hA have Y₂₁ : Y₂ + Y₁ = Y₁ + Y₂ := by abel have dY₂₁ : d[Y₂ # Y₁] = d[Y₁ # Y₂] := rdist_symm rw [Y₂₁, dY₂₁] at K₂ have K₃ := condRho_sum_le hY₃ hY₁ hY₂ hY₄ h_indep.reindex_four_cabd hA have Y₃₁ : Y₃ + Y₁ = Y₁ + Y₃ := by abel have Y₃₂ : Y₃ + Y₂ = Y₂ + Y₃ := by abel have S₃ : Y₁ + Y₃ + Y₂ + Y₄ = Y₁ + Y₂ + Y₃ + Y₄ := by abel have dY₃₁ : d[Y₃ # Y₁] = d[Y₁ # Y₃] := rdist_symm have dY₃₂ : d[Y₃ # Y₂] = d[Y₂ # Y₃] := rdist_symm rw [Y₃₁, Y₃₂, S₃, dY₃₁, dY₃₂] at K₃ linarith include hX₁ hX₂ hX₁' hX₂' h₁ h₂ h_indep h_min hη in
pfr/blueprint/src/chapter/further_improvement.tex:306
pfr/PFR/RhoFunctional.lean:1764
PFR
condRuzsaDist
\begin{definition}[Conditioned Ruzsa distance]\label{cond-dist-def} \uses{ruz-dist-def} \lean{condRuzsaDist}\leanok If $(X, Z)$ and $(Y, W)$ are random variables (where $X$ and $Y$ are $G$-valued) we define $$ d[X | Z; Y | W] := \sum_{z,w} \bbP[Z=z] \bbP[W=w] d[(X|Z=z); (Y|(W=w))].$$ similarly $$ d[X ; Y | W] := \sum_{w} \bbP[W=w] d[X ; (Y|(W=w))].$$ \end{definition}
def condRuzsaDist (X : Ω → G) (Z : Ω → S) (Y : Ω' → G) (W : Ω' → T) (μ : Measure Ω := by volume_tac) [IsFiniteMeasure μ] (μ' : Measure Ω' := by volume_tac) [IsFiniteMeasure μ'] : ℝ := dk[condDistrib X Z μ ; μ.map Z # condDistrib Y W μ' ; μ'.map W] @[inherit_doc condRuzsaDist] notation3:max "d[" X " | " Z " ; " μ " # " Y " | " W " ; " μ'"]" => condRuzsaDist X Z Y W μ μ' @[inherit_doc condRuzsaDist] notation3:max "d[" X " | " Z " # " Y " | " W "]" => condRuzsaDist X Z Y W volume volume
pfr/blueprint/src/chapter/distance.tex:217
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:455
PFR
condRuzsaDist'_of_copy
\begin{lemma}[Alternate form of distance]\label{cond-dist-alt} \lean{condRuzsaDist_of_copy, condRuzsaDist'_of_copy, condRuzsaDist_of_indep, condRuzsaDist'_of_indep}\leanok The expression $d[X | Z;Y | W]$ is unchanged if $(X,Z)$ or $(Y,W)$ is replaced by a copy. Furthermore, if $(X,Z)$ and $(Y,W)$ are independent, then $$ d[X | Z;Y | W] = \bbH[X-Y|Z,W] - \bbH[X|Z]/2 - \bbH[Y|W]/2$$ and similarly $$ d[X ;Y | W] = \bbH[X-Y|W] - \bbH[X]/2 - \bbH[Y|W]/2.$$ \end{lemma} \begin{proof}\uses{copy-ent, ruz-copy, ruz-indep, cond-dist-def, conditional-entropy-def}\leanok Straightforward thanks to \Cref{copy-ent}, \Cref{ruz-copy}, \Cref{ruz-indep}, \Cref{cond-dist-def}, \Cref{conditional-entropy-def}. \end{proof}
lemma condRuzsaDist'_of_copy (X : Ω → G) {Y : Ω' → G} (hY : Measurable Y) {W : Ω' → T} (hW : Measurable W) (X' : Ω'' → G) {Y' : Ω''' → G} (hY' : Measurable Y') {W' : Ω''' → T} (hW' : Measurable W') [IsFiniteMeasure μ'] [IsFiniteMeasure μ'''] (h1 : IdentDistrib X X' μ μ'') (h2 : IdentDistrib (⟨Y, W⟩) (⟨Y', W'⟩) μ' μ''') [FiniteRange W] [FiniteRange W'] : d[X ; μ # Y | W ; μ'] = d[X' ; μ'' # Y' | W' ; μ'''] := by classical set A := (FiniteRange.toFinset W) ∪ (FiniteRange.toFinset W') have hfull : Measure.prod (dirac ()) (μ'.map W) ((Finset.univ (α := Unit) ×ˢ A : Finset (Unit × T)) : Set (Unit × T))ᶜ = 0 := by apply Measure.prod_of_full_measure_finset · simp simp only [A] rw [Measure.map_apply ‹_›] convert measure_empty (μ := μ) simp [← FiniteRange.range] measurability have hfull' : Measure.prod (dirac ()) (μ'''.map W') ((Finset.univ (α := Unit) ×ˢ A : Finset (Unit × T)) : Set (Unit × T))ᶜ = 0 := by apply Measure.prod_of_full_measure_finset · simp simp only [A] rw [Measure.map_apply ‹_›] convert measure_empty (μ := μ) simp [← FiniteRange.range] measurability rw [condRuzsaDist'_def, condRuzsaDist'_def, Kernel.rdist, Kernel.rdist, integral_eq_setIntegral hfull, integral_eq_setIntegral hfull', integral_finset _ _ IntegrableOn.finset, integral_finset _ _ IntegrableOn.finset] have hWW' : μ'.map W = μ'''.map W' := (h2.comp measurable_snd).map_eq simp_rw [Measure.prod_apply_singleton, ENNReal.toReal_mul, ← hWW', Measure.map_apply hW (.singleton _)] congr with x by_cases hw : μ' (W ⁻¹' {x.2}) = 0 · simp only [smul_eq_mul, mul_eq_mul_left_iff, mul_eq_zero] refine Or.inr (Or.inr ?_) simp [ENNReal.toReal_eq_zero_iff, measure_ne_top, hw] congr 2 · rw [Kernel.const_apply, Kernel.const_apply, h1.map_eq] · have hWW'x : μ' (W ⁻¹' {x.2}) = μ''' (W' ⁻¹' {x.2}) := by have : μ'.map W {x.2} = μ'''.map W' {x.2} := by rw [hWW'] rwa [Measure.map_apply hW (.singleton _), Measure.map_apply hW' (.singleton _)] at this ext s hs rw [condDistrib_apply' hY hW _ _ hw hs, condDistrib_apply' hY' hW' _ _ _ hs] swap; · rwa [hWW'x] at hw congr have : μ'.map (⟨Y, W⟩) (s ×ˢ {x.2}) = μ'''.map (⟨Y', W'⟩) (s ×ˢ {x.2}) := by rw [h2.map_eq] rwa [Measure.map_apply (hY.prodMk hW) (hs.prod (.singleton _)), Measure.map_apply (hY'.prodMk hW') (hs.prod (.singleton _)), Set.mk_preimage_prod, Set.mk_preimage_prod, Set.inter_comm, Set.inter_comm ((fun a ↦ Y' a) ⁻¹' s)] at this
pfr/blueprint/src/chapter/distance.tex:226
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:901
PFR
condRuzsaDist'_of_indep
\begin{lemma}[Alternate form of distance]\label{cond-dist-alt} \lean{condRuzsaDist_of_copy, condRuzsaDist'_of_copy, condRuzsaDist_of_indep, condRuzsaDist'_of_indep}\leanok The expression $d[X | Z;Y | W]$ is unchanged if $(X,Z)$ or $(Y,W)$ is replaced by a copy. Furthermore, if $(X,Z)$ and $(Y,W)$ are independent, then $$ d[X | Z;Y | W] = \bbH[X-Y|Z,W] - \bbH[X|Z]/2 - \bbH[Y|W]/2$$ and similarly $$ d[X ;Y | W] = \bbH[X-Y|W] - \bbH[X]/2 - \bbH[Y|W]/2.$$ \end{lemma} \begin{proof}\uses{copy-ent, ruz-copy, ruz-indep, cond-dist-def, conditional-entropy-def}\leanok Straightforward thanks to \Cref{copy-ent}, \Cref{ruz-copy}, \Cref{ruz-indep}, \Cref{cond-dist-def}, \Cref{conditional-entropy-def}. \end{proof}
/-- Formula for conditional Ruzsa distance for independent sets of variables. -/ lemma condRuzsaDist'_of_indep {X : Ω → G} {Y : Ω → G} {W : Ω → T} (hX : Measurable X) (hY : Measurable Y) (hW : Measurable W) (μ : Measure Ω) [IsProbabilityMeasure μ] (h : IndepFun X (⟨Y, W⟩) μ) [FiniteRange W] : d[X ; μ # Y | W ; μ] = H[X - Y | W ; μ] - H[X ; μ]/2 - H[Y | W ; μ]/2 := by have : IsProbabilityMeasure (μ.map W) := isProbabilityMeasure_map hW.aemeasurable rw [condRuzsaDist'_def, Kernel.rdist_eq', condEntropy_eq_kernel_entropy _ hW, condEntropy_eq_kernel_entropy hY hW, entropy_eq_kernel_entropy] rotate_left · exact hX.sub hY congr 2 let Z : Ω → Unit := fun _ ↦ () rw [← condDistrib_unit_right hX μ] have h' : IndepFun (⟨X,Z⟩) (⟨Y, W⟩) μ := by rw [indepFun_iff_measure_inter_preimage_eq_mul] intro s t hs ht have : ⟨X, Z⟩ ⁻¹' s = X ⁻¹' ((fun c ↦ (c, ())) ⁻¹' s) := by ext1 y; simp rw [this] rw [indepFun_iff_measure_inter_preimage_eq_mul] at h exact h _ _ (measurable_prodMk_right hs) ht have h_indep := condDistrib_eq_prod_of_indepFun hX measurable_const hY hW _ h' have h_meas_eq : μ.map (⟨Z, W⟩) = (Measure.dirac ()).prod (μ.map W) := by ext s hs rw [Measure.map_apply (measurable_const.prodMk hW) hs, Measure.prod_apply hs, lintegral_dirac, Measure.map_apply hW (measurable_prodMk_left hs)] congr rw [← h_meas_eq] have : Kernel.map (Kernel.prodMkRight T (condDistrib X Z μ) ×ₖ Kernel.prodMkLeft Unit (condDistrib Y W μ)) (fun x ↦ x.1 - x.2) =ᵐ[μ.map (⟨Z, W⟩)] Kernel.map (condDistrib (⟨X, Y⟩) (⟨Z, W⟩) μ) (fun x ↦ x.1 - x.2) := by filter_upwards [h_indep] with y hy conv_rhs => rw [Kernel.map_apply _ (by fun_prop), hy] rw [← Kernel.mapOfMeasurable_eq_map _ (by fun_prop)] rfl rw [Kernel.entropy_congr this] have : Kernel.map (condDistrib (⟨X, Y⟩) (⟨Z, W⟩) μ) (fun x ↦ x.1 - x.2) =ᵐ[μ.map (⟨Z, W⟩)] condDistrib (X - Y) (⟨Z, W⟩) μ := (condDistrib_comp (hX.prodMk hY) (measurable_const.prodMk hW) _ _).symm rw [Kernel.entropy_congr this] have h_meas : μ.map (⟨Z, W⟩) = (μ.map W).map (Prod.mk ()) := by ext s hs rw [Measure.map_apply measurable_prodMk_left hs, h_meas_eq, Measure.prod_apply hs, lintegral_dirac] have h_ker : condDistrib (X - Y) (⟨Z, W⟩) μ =ᵐ[μ.map (⟨Z, W⟩)] Kernel.prodMkLeft Unit (condDistrib (X - Y) W μ) := by rw [Filter.EventuallyEq, ae_iff_of_countable] intro x hx rw [Measure.map_apply (measurable_const.prodMk hW) (.singleton _)] at hx ext s hs have h_preimage_eq : (fun a ↦ (PUnit.unit, W a)) ⁻¹' {x} = W ⁻¹' {x.2} := by conv_lhs => rw [← Prod.eta x, ← Set.singleton_prod_singleton, Set.mk_preimage_prod] ext1 y simp rw [Kernel.prodMkLeft_apply, condDistrib_apply' _ (measurable_const.prodMk hW) _ _ hx hs, condDistrib_apply' _ hW _ _ _ hs] rotate_left · exact hX.sub hY · convert hx exact h_preimage_eq.symm · exact hX.sub hY congr rw [Kernel.entropy_congr h_ker, h_meas, Kernel.entropy_prodMkLeft_unit] end omit [Countable S] in /-- The conditional Ruzsa distance is unchanged if the sets of random variables are replaced with copies. -/
pfr/blueprint/src/chapter/distance.tex:226
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:757
PFR
condRuzsaDist_diff_le
\begin{lemma}[Comparison of Ruzsa distances, I]\label{first-useful} \lean{condRuzsaDist_diff_le, condRuzsaDist_diff_le', condRuzsaDist_diff_le'', condRuzsaDist_diff_le'''}\leanok Let $X, Y, Z$ be random variables taking values in some abelian group of characteristic $2$, and with $Y, Z$ independent. Then we have \begin{align}\nonumber d[X ; Y + Z] -d[X ; Y] & \leq \tfrac{1}{2} (\bbH[Y+ Z] - \bbH[Y]) \\ & = \tfrac{1}{2} d[Y; Z] + \tfrac{1}{4} \bbH[Z] - \tfrac{1}{4} \bbH[Y]. \label{lem51-a} \end{align} and \begin{align}\nonumber d[X ;Y|Y+ Z] - d[X ;Y] & \leq \tfrac{1}{2} \bigl(\bbH[Y+ Z] - \bbH[Z]\bigr) \\ & = \tfrac{1}{2} d[Y;Z] + \tfrac{1}{4} \bbH[Y] - \tfrac{1}{4} \bbH[Z]. \label{ruzsa-3} \end{align} \end{lemma} \begin{proof} \uses{ruz-copy, independent-exist, kv, ruz-indep, relabeled-entropy, cond-dist-fact}\leanok We first prove~\eqref{lem51-a}. We may assume (taking an independent copy, using \Cref{independent-exist} and \Cref{ruz-copy}, \ref{ruz-indep}) that $X$ is independent of $Y, Z$. Then we have \begin{align*} d[X ;Y+ Z] & - d[X ;Y] \\ & = \bbH[X + Y + Z] - \bbH[X + Y] - \tfrac{1}{2}\bbH[Y + Z] + \tfrac{1}{2} \bbH[Y].\end{align*} Combining this with \Cref{kv} gives the required bound. The second form of the result is immediate \Cref{ruz-indep}. Turning to~\eqref{ruzsa-3}, we have from \Cref{information-def} and \Cref{relabeled-entropy} \begin{align*} \bbI[Y : Y+ Z] & = \bbH[Y] + \bbH[Y + Z] - \bbH[Y, Y + Z] \\ & = \bbH[Y] + \bbH[Y + Z] - \bbH[Y, Z] = \bbH[Y + Z] - \bbH[Z],\end{align*} and so~\eqref{ruzsa-3} is a consequence of \Cref{cond-dist-fact}. Once again the second form of the result is immediate from \Cref{ruz-indep}. \end{proof}
lemma condRuzsaDist_diff_le [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] {X : Ω → G} {Y : Ω' → G} {Z : Ω' → G} (hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') [FiniteRange X] [FiniteRange Z] [FiniteRange Y] : d[X ; μ # Y+ Z ; μ'] - d[X ; μ # Y ; μ'] ≤ (H[Y + Z; μ'] - H[Y; μ']) / 2 := (comparison_of_ruzsa_distances μ hX hY hZ h).1 variable (μ) [Module (ZMod 2) G] in
pfr/blueprint/src/chapter/distance.tex:322
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1386
PFR
condRuzsaDist_diff_le'
\begin{lemma}[Comparison of Ruzsa distances, I]\label{first-useful} \lean{condRuzsaDist_diff_le, condRuzsaDist_diff_le', condRuzsaDist_diff_le'', condRuzsaDist_diff_le'''}\leanok Let $X, Y, Z$ be random variables taking values in some abelian group of characteristic $2$, and with $Y, Z$ independent. Then we have \begin{align}\nonumber d[X ; Y + Z] -d[X ; Y] & \leq \tfrac{1}{2} (\bbH[Y+ Z] - \bbH[Y]) \\ & = \tfrac{1}{2} d[Y; Z] + \tfrac{1}{4} \bbH[Z] - \tfrac{1}{4} \bbH[Y]. \label{lem51-a} \end{align} and \begin{align}\nonumber d[X ;Y|Y+ Z] - d[X ;Y] & \leq \tfrac{1}{2} \bigl(\bbH[Y+ Z] - \bbH[Z]\bigr) \\ & = \tfrac{1}{2} d[Y;Z] + \tfrac{1}{4} \bbH[Y] - \tfrac{1}{4} \bbH[Z]. \label{ruzsa-3} \end{align} \end{lemma} \begin{proof} \uses{ruz-copy, independent-exist, kv, ruz-indep, relabeled-entropy, cond-dist-fact}\leanok We first prove~\eqref{lem51-a}. We may assume (taking an independent copy, using \Cref{independent-exist} and \Cref{ruz-copy}, \ref{ruz-indep}) that $X$ is independent of $Y, Z$. Then we have \begin{align*} d[X ;Y+ Z] & - d[X ;Y] \\ & = \bbH[X + Y + Z] - \bbH[X + Y] - \tfrac{1}{2}\bbH[Y + Z] + \tfrac{1}{2} \bbH[Y].\end{align*} Combining this with \Cref{kv} gives the required bound. The second form of the result is immediate \Cref{ruz-indep}. Turning to~\eqref{ruzsa-3}, we have from \Cref{information-def} and \Cref{relabeled-entropy} \begin{align*} \bbI[Y : Y+ Z] & = \bbH[Y] + \bbH[Y + Z] - \bbH[Y, Y + Z] \\ & = \bbH[Y] + \bbH[Y + Z] - \bbH[Y, Z] = \bbH[Y + Z] - \bbH[Z],\end{align*} and so~\eqref{ruzsa-3} is a consequence of \Cref{cond-dist-fact}. Once again the second form of the result is immediate from \Cref{ruz-indep}. \end{proof}
lemma condRuzsaDist_diff_le' [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] {X : Ω → G} {Y : Ω' → G} {Z : Ω' → G} (hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') [FiniteRange X] [FiniteRange Z] [FiniteRange Y] : d[X ; μ # Y + Z; μ'] - d[X ; μ # Y; μ'] ≤ d[Y; μ' # Z; μ'] / 2 + H[Z; μ'] / 4 - H[Y; μ'] / 4 := by linarith [condRuzsaDist_diff_le μ hX hY hZ h, entropy_sub_entropy_eq_condRuzsaDist_add μ hX hY hZ h] variable (μ) in
pfr/blueprint/src/chapter/distance.tex:322
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1402
PFR
condRuzsaDist_diff_le''
\begin{lemma}[Comparison of Ruzsa distances, I]\label{first-useful} \lean{condRuzsaDist_diff_le, condRuzsaDist_diff_le', condRuzsaDist_diff_le'', condRuzsaDist_diff_le'''}\leanok Let $X, Y, Z$ be random variables taking values in some abelian group of characteristic $2$, and with $Y, Z$ independent. Then we have \begin{align}\nonumber d[X ; Y + Z] -d[X ; Y] & \leq \tfrac{1}{2} (\bbH[Y+ Z] - \bbH[Y]) \\ & = \tfrac{1}{2} d[Y; Z] + \tfrac{1}{4} \bbH[Z] - \tfrac{1}{4} \bbH[Y]. \label{lem51-a} \end{align} and \begin{align}\nonumber d[X ;Y|Y+ Z] - d[X ;Y] & \leq \tfrac{1}{2} \bigl(\bbH[Y+ Z] - \bbH[Z]\bigr) \\ & = \tfrac{1}{2} d[Y;Z] + \tfrac{1}{4} \bbH[Y] - \tfrac{1}{4} \bbH[Z]. \label{ruzsa-3} \end{align} \end{lemma} \begin{proof} \uses{ruz-copy, independent-exist, kv, ruz-indep, relabeled-entropy, cond-dist-fact}\leanok We first prove~\eqref{lem51-a}. We may assume (taking an independent copy, using \Cref{independent-exist} and \Cref{ruz-copy}, \ref{ruz-indep}) that $X$ is independent of $Y, Z$. Then we have \begin{align*} d[X ;Y+ Z] & - d[X ;Y] \\ & = \bbH[X + Y + Z] - \bbH[X + Y] - \tfrac{1}{2}\bbH[Y + Z] + \tfrac{1}{2} \bbH[Y].\end{align*} Combining this with \Cref{kv} gives the required bound. The second form of the result is immediate \Cref{ruz-indep}. Turning to~\eqref{ruzsa-3}, we have from \Cref{information-def} and \Cref{relabeled-entropy} \begin{align*} \bbI[Y : Y+ Z] & = \bbH[Y] + \bbH[Y + Z] - \bbH[Y, Y + Z] \\ & = \bbH[Y] + \bbH[Y + Z] - \bbH[Y, Z] = \bbH[Y + Z] - \bbH[Z],\end{align*} and so~\eqref{ruzsa-3} is a consequence of \Cref{cond-dist-fact}. Once again the second form of the result is immediate from \Cref{ruz-indep}. \end{proof}
lemma condRuzsaDist_diff_le'' [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] {X : Ω → G} {Y : Ω' → G} {Z : Ω' → G} (hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') [FiniteRange X] [FiniteRange Z] [FiniteRange Y] : d[X ; μ # Y|Y+ Z ; μ'] - d[X ; μ # Y ; μ'] ≤ (H[Y+ Z ; μ'] - H[Z ; μ'])/2 := by rw [← mutualInfo_add_right hY hZ h] linarith [condRuzsaDist_le' (W := Y + Z) μ μ' hX hY (by fun_prop)] variable (μ) [Module (ZMod 2) G] in
pfr/blueprint/src/chapter/distance.tex:322
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1411
PFR
condRuzsaDist_diff_le'''
\begin{lemma}[Comparison of Ruzsa distances, I]\label{first-useful} \lean{condRuzsaDist_diff_le, condRuzsaDist_diff_le', condRuzsaDist_diff_le'', condRuzsaDist_diff_le'''}\leanok Let $X, Y, Z$ be random variables taking values in some abelian group of characteristic $2$, and with $Y, Z$ independent. Then we have \begin{align}\nonumber d[X ; Y + Z] -d[X ; Y] & \leq \tfrac{1}{2} (\bbH[Y+ Z] - \bbH[Y]) \\ & = \tfrac{1}{2} d[Y; Z] + \tfrac{1}{4} \bbH[Z] - \tfrac{1}{4} \bbH[Y]. \label{lem51-a} \end{align} and \begin{align}\nonumber d[X ;Y|Y+ Z] - d[X ;Y] & \leq \tfrac{1}{2} \bigl(\bbH[Y+ Z] - \bbH[Z]\bigr) \\ & = \tfrac{1}{2} d[Y;Z] + \tfrac{1}{4} \bbH[Y] - \tfrac{1}{4} \bbH[Z]. \label{ruzsa-3} \end{align} \end{lemma} \begin{proof} \uses{ruz-copy, independent-exist, kv, ruz-indep, relabeled-entropy, cond-dist-fact}\leanok We first prove~\eqref{lem51-a}. We may assume (taking an independent copy, using \Cref{independent-exist} and \Cref{ruz-copy}, \ref{ruz-indep}) that $X$ is independent of $Y, Z$. Then we have \begin{align*} d[X ;Y+ Z] & - d[X ;Y] \\ & = \bbH[X + Y + Z] - \bbH[X + Y] - \tfrac{1}{2}\bbH[Y + Z] + \tfrac{1}{2} \bbH[Y].\end{align*} Combining this with \Cref{kv} gives the required bound. The second form of the result is immediate \Cref{ruz-indep}. Turning to~\eqref{ruzsa-3}, we have from \Cref{information-def} and \Cref{relabeled-entropy} \begin{align*} \bbI[Y : Y+ Z] & = \bbH[Y] + \bbH[Y + Z] - \bbH[Y, Y + Z] \\ & = \bbH[Y] + \bbH[Y + Z] - \bbH[Y, Z] = \bbH[Y + Z] - \bbH[Z],\end{align*} and so~\eqref{ruzsa-3} is a consequence of \Cref{cond-dist-fact}. Once again the second form of the result is immediate from \Cref{ruz-indep}. \end{proof}
lemma condRuzsaDist_diff_le''' [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] {X : Ω → G} {Y : Ω' → G} {Z : Ω' → G} (hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') [FiniteRange X] [FiniteRange Z] [FiniteRange Y] : d[X ; μ # Y|Y+ Z ; μ'] - d[X ; μ # Y ; μ'] ≤ d[Y ; μ' # Z ; μ']/2 + H[Y ; μ']/4 - H[Z ; μ']/4 := by linarith [condRuzsaDist_diff_le'' μ hX hY hZ h, entropy_sub_entropy_eq_condRuzsaDist_add μ hX hY hZ h] variable (μ) in
pfr/blueprint/src/chapter/distance.tex:322
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1420
PFR
condRuzsaDist_diff_ofsum_le
\begin{lemma}[Comparison of Ruzsa distances, II]\label{second-useful} \lean{condRuzsaDist_diff_ofsum_le}\leanok Let $X, Y, Z, Z'$ be random variables taking values in some abelian group, and with $Y, Z, Z'$ independent. Then we have \begin{align}\nonumber & d[X ;Y + Z | Y + Z + Z'] - d[X ;Y] \\ & \qquad \leq \tfrac{1}{2} ( \bbH[Y + Z + Z'] + \bbH[Y + Z] - \bbH[Y] - \bbH[Z']).\label{7111} \end{align} \end{lemma} \begin{proof} \uses{first-useful}\leanok By \Cref{first-useful} (with a change of variables) we have \[d[X ; Y + Z | Y + Z + Z'] - d[X ; Y + Z] \leq \tfrac{1}{2}( \bbH[Y + Z + Z'] - \bbH[Z']).\] Adding this to~\eqref{lem51-a} gives the result. \end{proof}
lemma condRuzsaDist_diff_ofsum_le [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] {X : Ω → G} {Y Z Z' : Ω' → G} (hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (hZ' : Measurable Z') (h : iIndepFun ![Y, Z, Z'] μ') [FiniteRange X] [FiniteRange Z] [FiniteRange Y] [FiniteRange Z'] : d[X ; μ # Y + Z | Y + Z + Z'; μ'] - d[X ; μ # Y; μ'] ≤ (H[Y + Z + Z'; μ'] + H[Y + Z; μ'] - H[Y ; μ'] - H[Z' ; μ'])/2 := by have hadd : IndepFun (Y + Z) Z' μ' := (h.indepFun_add_left (Fin.cases hY <| Fin.cases hZ <| Fin.cases hZ' Fin.rec0) 0 1 2 (show 0 ≠ 2 by decide) (show 1 ≠ 2 by decide)) have h1 := condRuzsaDist_diff_le'' μ hX (show Measurable (Y + Z) by fun_prop) hZ' hadd have h2 := condRuzsaDist_diff_le μ hX hY hZ (h.indepFun (show 0 ≠ 1 by decide)) linarith [h1, h2]
pfr/blueprint/src/chapter/distance.tex:344
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1429
PFR
condRuzsaDist_le
\begin{lemma}[Upper bound on conditioned Ruzsa distance]\label{cond-dist-fact} \uses{cond-dist-def, information-def} \lean{condRuzsaDist_le, condRuzsaDist_le'}\leanok Suppose that $(X, Z)$ and $(Y, W)$ are random variables, where $X, Y$ take values in an abelian group. Then \[ d[X | Z;Y | W] \leq d[X ; Y] + \tfrac{1}{2} \bbI[X : Z] + \tfrac{1}{2} \bbI[Y : W].\] In particular, \[ d[X ;Y | W] \leq d[X ; Y] + \tfrac{1}{2} \bbI[Y : W].\] \end{lemma} \begin{proof} \uses{cond-dist-alt, independent-exist, cond-reduce}\leanok Using \Cref{cond-dist-alt} and \Cref{independent-exist}, if $(X',Z'), (Y',W')$ are independent copies of the variables $(X,Z)$, $(Y,W)$, we have \begin{align*} d[X | Z; Y | W]&= \bbH[X'-Y'|Z',W'] - \tfrac{1}{2} \bbH[X'|Z'] - \tfrac{1}{2}H[Y'|W'] \\ &\le \bbH[X'-Y']- \tfrac{1}{2} \bbH[X'|Z'] - \tfrac{1}{2}H[Y'|W'] \\ &= d[X';Y'] + \tfrac{1}{2} \bbI[X' : Z'] + \tfrac{1}{2} \bbI[Y' : W']. \end{align*} Here, in the middle step we used \Cref{cond-reduce}, and in the last step we used \Cref{ruz-dist-def} and \Cref{information-def}. \end{proof}
lemma condRuzsaDist_le [Countable T] {X : Ω → G} {Z : Ω → S} {Y : Ω' → G} {W : Ω' → T} [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] (hX : Measurable X) (hZ : Measurable Z) (hY : Measurable Y) (hW : Measurable W) [FiniteRange X] [FiniteRange Z] [FiniteRange Y] [FiniteRange W] : d[X | Z ; μ # Y|W ; μ'] ≤ d[X ; μ # Y ; μ'] + I[X : Z ; μ]/2 + I[Y : W ; μ']/2 := by have hXZ : Measurable (⟨X, Z⟩ : Ω → G × S):= hX.prodMk hZ have hYW : Measurable (⟨Y, W⟩ : Ω' → G × T):= hY.prodMk hW obtain ⟨ν, XZ', YW', _, hXZ', hYW', hind, hIdXZ, hIdYW, _, _⟩ := independent_copies_finiteRange hXZ hYW μ μ' let X' := Prod.fst ∘ XZ' let Z' := Prod.snd ∘ XZ' let Y' := Prod.fst ∘ YW' let W' := Prod.snd ∘ YW' have hX' : Measurable X' := hXZ'.fst have hZ' : Measurable Z' := hXZ'.snd have hY' : Measurable Y' := hYW'.fst have hW' : Measurable W' := hYW'.snd have : FiniteRange W' := instFiniteRangeComp .. have : FiniteRange X' := instFiniteRangeComp .. have : FiniteRange Y' := instFiniteRangeComp .. have : FiniteRange Z' := instFiniteRangeComp .. have hind' : IndepFun X' Y' ν := hind.comp measurable_fst measurable_fst rw [show XZ' = ⟨X', Z'⟩ by rfl] at hIdXZ hind rw [show YW' = ⟨Y', W'⟩ by rfl] at hIdYW hind rw [← condRuzsaDist_of_copy hX' hZ' hY' hW' hX hZ hY hW hIdXZ hIdYW, condRuzsaDist_of_indep hX' hZ' hY' hW' _ hind] have hIdX : IdentDistrib X X' μ ν := hIdXZ.symm.comp measurable_fst have hIdY : IdentDistrib Y Y' μ' ν := hIdYW.symm.comp measurable_fst rw [hIdX.rdist_eq hIdY, hIdXZ.symm.mutualInfo_eq, hIdYW.symm.mutualInfo_eq, hind'.rdist_eq hX' hY', mutualInfo_eq_entropy_sub_condEntropy hX' hZ', mutualInfo_eq_entropy_sub_condEntropy hY' hW'] have h := condEntropy_le_entropy ν (X := X' - Y') (hX'.sub hY') (hZ'.prodMk hW') linarith [h, entropy_nonneg Z' ν, entropy_nonneg W' ν] variable (μ μ') in
pfr/blueprint/src/chapter/distance.tex:302
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1289
PFR
condRuzsaDist_le'
\begin{lemma}[Upper bound on conditioned Ruzsa distance]\label{cond-dist-fact} \uses{cond-dist-def, information-def} \lean{condRuzsaDist_le, condRuzsaDist_le'}\leanok Suppose that $(X, Z)$ and $(Y, W)$ are random variables, where $X, Y$ take values in an abelian group. Then \[ d[X | Z;Y | W] \leq d[X ; Y] + \tfrac{1}{2} \bbI[X : Z] + \tfrac{1}{2} \bbI[Y : W].\] In particular, \[ d[X ;Y | W] \leq d[X ; Y] + \tfrac{1}{2} \bbI[Y : W].\] \end{lemma} \begin{proof} \uses{cond-dist-alt, independent-exist, cond-reduce}\leanok Using \Cref{cond-dist-alt} and \Cref{independent-exist}, if $(X',Z'), (Y',W')$ are independent copies of the variables $(X,Z)$, $(Y,W)$, we have \begin{align*} d[X | Z; Y | W]&= \bbH[X'-Y'|Z',W'] - \tfrac{1}{2} \bbH[X'|Z'] - \tfrac{1}{2}H[Y'|W'] \\ &\le \bbH[X'-Y']- \tfrac{1}{2} \bbH[X'|Z'] - \tfrac{1}{2}H[Y'|W'] \\ &= d[X';Y'] + \tfrac{1}{2} \bbI[X' : Z'] + \tfrac{1}{2} \bbI[Y' : W']. \end{align*} Here, in the middle step we used \Cref{cond-reduce}, and in the last step we used \Cref{ruz-dist-def} and \Cref{information-def}. \end{proof}
lemma condRuzsaDist_le' [Countable T] {X : Ω → G} {Y : Ω' → G} {W : Ω' → T} [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] (hX : Measurable X) (hY : Measurable Y) (hW : Measurable W) [FiniteRange X] [FiniteRange Y] [FiniteRange W] : d[X ; μ # Y|W ; μ'] ≤ d[X ; μ # Y ; μ'] + I[Y : W ; μ']/2 := by rw [← condRuzsaDist_of_const hX _ _ (0 : Fin 1)] refine (condRuzsaDist_le μ μ' hX measurable_const hY hW).trans ?_ simp [mutualInfo_const hX (0 : Fin 1)] variable (μ μ') in
pfr/blueprint/src/chapter/distance.tex:302
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1324
PFR
condRuzsaDist_of_copy
\begin{lemma}[Alternate form of distance]\label{cond-dist-alt} \lean{condRuzsaDist_of_copy, condRuzsaDist'_of_copy, condRuzsaDist_of_indep, condRuzsaDist'_of_indep}\leanok The expression $d[X | Z;Y | W]$ is unchanged if $(X,Z)$ or $(Y,W)$ is replaced by a copy. Furthermore, if $(X,Z)$ and $(Y,W)$ are independent, then $$ d[X | Z;Y | W] = \bbH[X-Y|Z,W] - \bbH[X|Z]/2 - \bbH[Y|W]/2$$ and similarly $$ d[X ;Y | W] = \bbH[X-Y|W] - \bbH[X]/2 - \bbH[Y|W]/2.$$ \end{lemma} \begin{proof}\uses{copy-ent, ruz-copy, ruz-indep, cond-dist-def, conditional-entropy-def}\leanok Straightforward thanks to \Cref{copy-ent}, \Cref{ruz-copy}, \Cref{ruz-indep}, \Cref{cond-dist-def}, \Cref{conditional-entropy-def}. \end{proof}
lemma condRuzsaDist_of_copy {X : Ω → G} (hX : Measurable X) {Z : Ω → S} (hZ : Measurable Z) {Y : Ω' → G} (hY : Measurable Y) {W : Ω' → T} (hW : Measurable W) {X' : Ω'' → G} (hX' : Measurable X') {Z' : Ω'' → S} (hZ' : Measurable Z') {Y' : Ω''' → G} (hY' : Measurable Y') {W' : Ω''' → T} (hW' : Measurable W') [IsFiniteMeasure μ] [IsFiniteMeasure μ'] [IsFiniteMeasure μ''] [IsFiniteMeasure μ'''] (h1 : IdentDistrib (⟨X, Z⟩) (⟨X', Z'⟩) μ μ'') (h2 : IdentDistrib (⟨Y, W⟩) (⟨Y', W'⟩) μ' μ''') [FiniteRange Z] [FiniteRange W] [FiniteRange Z'] [FiniteRange W'] : d[X | Z ; μ # Y | W ; μ'] = d[X' | Z' ; μ'' # Y' | W' ; μ'''] := by classical set A := (FiniteRange.toFinset Z) ∪ (FiniteRange.toFinset Z') set B := (FiniteRange.toFinset W) ∪ (FiniteRange.toFinset W') have hfull : Measure.prod (μ.map Z) (μ'.map W) ((A ×ˢ B : Finset (S × T)): Set (S × T))ᶜ = 0 := by simp only [A, B] apply Measure.prod_of_full_measure_finset all_goals { rw [Measure.map_apply ‹_›] convert measure_empty (μ := μ) simp [← FiniteRange.range] measurability } have hfull' : Measure.prod (μ''.map Z') (μ'''.map W') ((A ×ˢ B : Finset (S × T)): Set (S × T))ᶜ = 0 := by simp only [A, B] apply Measure.prod_of_full_measure_finset all_goals { rw [Measure.map_apply ‹_›] convert measure_empty (μ := μ) simp [← FiniteRange.range] measurability } rw [condRuzsaDist_def, condRuzsaDist_def, Kernel.rdist, Kernel.rdist, integral_eq_setIntegral hfull, integral_eq_setIntegral hfull', integral_finset _ _ IntegrableOn.finset, integral_finset _ _ IntegrableOn.finset] have hZZ' : μ.map Z = μ''.map Z' := (h1.comp measurable_snd).map_eq have hWW' : μ'.map W = μ'''.map W' := (h2.comp measurable_snd).map_eq simp_rw [Measure.prod_apply_singleton, ENNReal.toReal_mul, ← hZZ', ← hWW', Measure.map_apply hZ (.singleton _), Measure.map_apply hW (.singleton _)] congr with x by_cases hz : μ (Z ⁻¹' {x.1}) = 0 · simp only [smul_eq_mul, mul_eq_mul_left_iff, mul_eq_zero] refine Or.inr (Or.inl ?_) simp [ENNReal.toReal_eq_zero_iff, measure_ne_top, hz] by_cases hw : μ' (W ⁻¹' {x.2}) = 0 · simp only [smul_eq_mul, mul_eq_mul_left_iff, mul_eq_zero] refine Or.inr (Or.inr ?_) simp [ENNReal.toReal_eq_zero_iff, measure_ne_top, hw] congr 2 · have hZZ'x : μ (Z ⁻¹' {x.1}) = μ'' (Z' ⁻¹' {x.1}) := by have : μ.map Z {x.1} = μ''.map Z' {x.1} := by rw [hZZ'] rwa [Measure.map_apply hZ (.singleton _), Measure.map_apply hZ' (.singleton _)] at this ext s hs rw [condDistrib_apply' hX hZ _ _ hz hs, condDistrib_apply' hX' hZ' _ _ _ hs] swap; · rwa [hZZ'x] at hz congr have : μ.map (⟨X, Z⟩) (s ×ˢ {x.1}) = μ''.map (⟨X', Z'⟩) (s ×ˢ {x.1}) := by rw [h1.map_eq] rwa [Measure.map_apply (hX.prodMk hZ) (hs.prod (.singleton _)), Measure.map_apply (hX'.prodMk hZ') (hs.prod (.singleton _)), Set.mk_preimage_prod, Set.mk_preimage_prod, Set.inter_comm, Set.inter_comm ((fun a ↦ X' a) ⁻¹' s)] at this · have hWW'x : μ' (W ⁻¹' {x.2}) = μ''' (W' ⁻¹' {x.2}) := by have : μ'.map W {x.2} = μ'''.map W' {x.2} := by rw [hWW'] rwa [Measure.map_apply hW (.singleton _), Measure.map_apply hW' (.singleton _)] at this ext s hs rw [condDistrib_apply' hY hW _ _ hw hs, condDistrib_apply' hY' hW' _ _ _ hs] swap; · rwa [hWW'x] at hw congr have : μ'.map (⟨Y, W⟩) (s ×ˢ {x.2}) = μ'''.map (⟨Y', W'⟩) (s ×ˢ {x.2}) := by rw [h2.map_eq] rwa [Measure.map_apply (hY.prodMk hW) (hs.prod (.singleton _)), Measure.map_apply (hY'.prodMk hW') (hs.prod (.singleton _)), Set.mk_preimage_prod, Set.mk_preimage_prod, Set.inter_comm, Set.inter_comm ((fun a ↦ Y' a) ⁻¹' s)] at this
pfr/blueprint/src/chapter/distance.tex:226
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:826
PFR
condRuzsaDist_of_indep
\begin{lemma}[Alternate form of distance]\label{cond-dist-alt} \lean{condRuzsaDist_of_copy, condRuzsaDist'_of_copy, condRuzsaDist_of_indep, condRuzsaDist'_of_indep}\leanok The expression $d[X | Z;Y | W]$ is unchanged if $(X,Z)$ or $(Y,W)$ is replaced by a copy. Furthermore, if $(X,Z)$ and $(Y,W)$ are independent, then $$ d[X | Z;Y | W] = \bbH[X-Y|Z,W] - \bbH[X|Z]/2 - \bbH[Y|W]/2$$ and similarly $$ d[X ;Y | W] = \bbH[X-Y|W] - \bbH[X]/2 - \bbH[Y|W]/2.$$ \end{lemma} \begin{proof}\uses{copy-ent, ruz-copy, ruz-indep, cond-dist-def, conditional-entropy-def}\leanok Straightforward thanks to \Cref{copy-ent}, \Cref{ruz-copy}, \Cref{ruz-indep}, \Cref{cond-dist-def}, \Cref{conditional-entropy-def}. \end{proof}
lemma condRuzsaDist_of_indep {X : Ω → G} {Z : Ω → S} {Y : Ω → G} {W : Ω → T} (hX : Measurable X) (hZ : Measurable Z) (hY : Measurable Y) (hW : Measurable W) (μ : Measure Ω) [IsProbabilityMeasure μ] (h : IndepFun (⟨X, Z⟩) (⟨Y, W⟩) μ) [FiniteRange Z] [FiniteRange W] : d[X | Z ; μ # Y | W ; μ] = H[X - Y | ⟨Z, W⟩ ; μ] - H[X | Z ; μ]/2 - H[Y | W ; μ]/2 := by have : IsProbabilityMeasure (μ.map Z) := isProbabilityMeasure_map hZ.aemeasurable have : IsProbabilityMeasure (μ.map W) := isProbabilityMeasure_map hW.aemeasurable rw [condRuzsaDist_def, Kernel.rdist_eq', condEntropy_eq_kernel_entropy _ (hZ.prodMk hW), condEntropy_eq_kernel_entropy hX hZ, condEntropy_eq_kernel_entropy hY hW] swap; · exact hX.sub hY congr 2 have hZW : IndepFun Z W μ := h.comp measurable_snd measurable_snd have hZW_map : μ.map (⟨Z, W⟩) = (μ.map Z).prod (μ.map W) := (indepFun_iff_map_prod_eq_prod_map_map hZ.aemeasurable hW.aemeasurable).mp hZW rw [← hZW_map] refine Kernel.entropy_congr ?_ have : Kernel.map (condDistrib (⟨X, Y⟩) (⟨Z, W⟩) μ) (fun x ↦ x.1 - x.2) =ᵐ[μ.map (⟨Z, W⟩)] condDistrib (X - Y) (⟨Z, W⟩) μ := (condDistrib_comp (hX.prodMk hY) (hZ.prodMk hW) _ _).symm refine (this.symm.trans ?_).symm suffices Kernel.prodMkRight T (condDistrib X Z μ) ×ₖ Kernel.prodMkLeft S (condDistrib Y W μ) =ᵐ[μ.map (⟨Z, W⟩)] condDistrib (⟨X, Y⟩) (⟨Z, W⟩) μ by filter_upwards [this] with x hx rw [Kernel.map_apply _ (by fun_prop), Kernel.map_apply _ (by fun_prop), hx] exact (condDistrib_eq_prod_of_indepFun hX hZ hY hW μ h).symm
pfr/blueprint/src/chapter/distance.tex:226
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:729
PFR
condRuzsaDist_of_sums_ge
\begin{lemma}[Lower bound on conditional distances]\label{first-cond} \lean{condRuzsaDist_of_sums_ge}\leanok We have \begin{align*} & d[X_1|X_1+\tilde X_2; X_2|X_2+\tilde X_1] \\ & \qquad\quad \geq k - \eta (d[X^0_1; X_1 | X_1 + \tilde X_2] - d[X^0_1; X_1]) \\ & \qquad\qquad\qquad\qquad - \eta(d[X^0_2; X_2 | X_2 + \tilde X_1] - d[X^0_2; X_2]). \end{align*} \end{lemma} \begin{proof}\uses{cond-distance-lower}\leanok Immediate from \Cref{cond-distance-lower}. \end{proof}
lemma condRuzsaDist_of_sums_ge : d[X₁ | X₁ + X₂' # X₂ | X₂ + X₁'] ≥ k - p.η * (d[p.X₀₁ # X₁ | X₁ + X₂'] - d[p.X₀₁ # X₁]) - p.η * (d[p.X₀₂ # X₂ | X₂ + X₁'] - d[p.X₀₂ # X₂]) := condRuzsaDistance_ge_of_min _ h_min hX₁ hX₂ _ _ (by fun_prop) (by fun_prop)
pfr/blueprint/src/chapter/entropy_pfr.tex:103
pfr/PFR/FirstEstimate.lean:84
PFR
condRuzsaDistance_ge_of_min
\begin{lemma}[Conditional distance lower bound]\label{cond-distance-lower} \uses{tau-min-def, cond-dist-def} \lean{condRuzsaDistance_ge_of_min}\leanok For any $G$-valued random variables $X'_1,X'_2$ and random variables $Z,W$, one has $$ d[X'_1|Z;X'_2|W] \geq k - \eta (d[X^0_1;X'_1|Z] - d[X^0_1;X_1] ) - \eta (d[X^0_2;X'_2|W] - d[X^0_2;X_2] ).$$ \end{lemma} \begin{proof}\uses{distance-lower}\leanok Apply \Cref{distance-lower} to conditioned random variables and then average. \end{proof}
lemma condRuzsaDistance_ge_of_min [MeasurableSingletonClass G] [Fintype S] [MeasurableSpace S] [MeasurableSingletonClass S] [Fintype T] [MeasurableSpace T] [MeasurableSingletonClass T] (h : tau_minimizes p X₁ X₂) (h1 : Measurable X₁') (h2 : Measurable X₂') (Z : Ω'₁ → S) (W : Ω'₂ → T) (hZ : Measurable Z) (hW : Measurable W) : d[X₁ # X₂] - p.η * (d[p.X₀₁ # X₁' | Z] - d[p.X₀₁ # X₁]) - p.η * (d[p.X₀₂ # X₂' | W] - d[p.X₀₂ # X₂]) ≤ d[X₁' | Z # X₂' | W] := by have hz (a : ℝ) : a = ∑ z ∈ FiniteRange.toFinset Z, (ℙ (Z ⁻¹' {z})).toReal * a := by simp_rw [← Finset.sum_mul,← Measure.map_apply hZ (MeasurableSet.singleton _), Finset.sum_toReal_measure_singleton] rw [FiniteRange.full hZ] simp have hw (a : ℝ) : a = ∑ w ∈ FiniteRange.toFinset W, (ℙ (W ⁻¹' {w})).toReal * a := by simp_rw [← Finset.sum_mul,← Measure.map_apply hW (MeasurableSet.singleton _), Finset.sum_toReal_measure_singleton] rw [FiniteRange.full hW] simp rw [condRuzsaDist_eq_sum h1 hZ h2 hW, condRuzsaDist'_eq_sum h1 hZ, hz d[X₁ # X₂], hz d[p.X₀₁ # X₁], hz (p.η * (d[p.X₀₂ # X₂' | W] - d[p.X₀₂ # X₂])), ← Finset.sum_sub_distrib, Finset.mul_sum, ← Finset.sum_sub_distrib, ← Finset.sum_sub_distrib] apply Finset.sum_le_sum intro z _ rw [condRuzsaDist'_eq_sum h2 hW, hw d[p.X₀₂ # X₂], hw ((ℙ (Z ⁻¹' {z})).toReal * d[X₁ # X₂] - p.η * ((ℙ (Z ⁻¹' {z})).toReal * d[p.X₀₁ ; ℙ # X₁' ; ℙ[|Z ← z]] - (ℙ (Z ⁻¹' {z})).toReal * d[p.X₀₁ # X₁])), ← Finset.sum_sub_distrib, Finset.mul_sum, Finset.mul_sum, ← Finset.sum_sub_distrib] apply Finset.sum_le_sum intro w _ rcases eq_or_ne (ℙ (Z ⁻¹' {z})) 0 with hpz | hpz · simp [hpz] rcases eq_or_ne (ℙ (W ⁻¹' {w})) 0 with hpw | hpw · simp [hpw] set μ := (hΩ₁.volume)[|Z ← z] have hμ : IsProbabilityMeasure μ := cond_isProbabilityMeasure hpz set μ' := ℙ[|W ← w] have hμ' : IsProbabilityMeasure μ' := cond_isProbabilityMeasure hpw suffices d[X₁ # X₂] - p.η * (d[p.X₀₁; volume # X₁'; μ] - d[p.X₀₁ # X₁]) - p.η * (d[p.X₀₂; volume # X₂'; μ'] - d[p.X₀₂ # X₂]) ≤ d[X₁' ; μ # X₂'; μ'] by replace this := mul_le_mul_of_nonneg_left this (show 0 ≤ (ℙ (Z ⁻¹' {z})).toReal * (ℙ (W ⁻¹' {w})).toReal by positivity) convert this using 1 ring exact distance_ge_of_min' p h h1 h2
pfr/blueprint/src/chapter/entropy_pfr.tex:60
pfr/PFR/TauFunctional.lean:207
PFR
cond_multiDist_chainRule
\begin{lemma}[Conditional multidistance chain rule]\label{multidist-chain-rule-cond}\lean{cond_multiDist_chainRule}\leanok Let $\pi \colon G \to H$ be a homomorphism of abelian groups. Let $I$ be a finite index set and let $X_{[m]}$ be a tuple of $G$-valued random variables. Let $Y_{[m]}$ be another tuple of random variables (not necessarily $G$-valued). Suppose that the pairs $(X_i, Y_i)$ are jointly independent of one another (but $X_i$ need not be independent of $Y_i$). Then \begin{align}\nonumber D[ X_{[m]} | Y_{[m]} ] &= D[ X_{[m]} \,|\, \pi(X_{[m]}), Y_{[m]}] + D[ \pi(X_{[m]}) \,|\, Y_{[m]}] \\ &\quad\qquad + \bbI[ \sum_{i=1}^m X_i : \pi(X_{[m]}) \; \big| \; \pi\bigl(\sum_{i=1}^m X_i \bigr), Y_{[m]} ].\label{chain-eq-cond} \end{align} \end{lemma} \begin{proof}\uses{multidist-chain-rule}\leanok For each $y_i$ in the support of $p_{Y_i}$, apply \Cref{multidist-chain-rule} with $X_i$ replaced by the conditioned random variable $(X_i|Y_i=y_i)$, and the claim~\eqref{chain-eq-cond} follows by averaging~\eqref{chain-eq} in the $y_i$ using the weights $p_{Y_i}$. \end{proof}
lemma cond_multiDist_chainRule {G H : Type*} [hG : MeasurableSpace G] [MeasurableSingletonClass G] [AddCommGroup G] [Fintype G] [hH : MeasurableSpace H] [MeasurableSingletonClass H] [AddCommGroup H] [Fintype H] (π : G →+ H) {S : Type*} [Fintype S] [hS : MeasurableSpace S] [MeasurableSingletonClass S] {m : ℕ} {Ω : Type*} [hΩ : MeasureSpace Ω] {X : Fin m → Ω → G} (hX : ∀ i, Measurable (X i)) {Y : Fin m → Ω → S} (hY : ∀ i, Measurable (Y i)) (h_indep : iIndepFun (fun i ↦ ⟨X i, Y i⟩)) : D[X | Y; fun _ ↦ hΩ] = D[X | fun i ↦ ⟨π ∘ X i, Y i⟩; fun _ ↦ hΩ] + D[fun i ↦ π ∘ X i | Y; fun _ ↦ hΩ] + I[∑ i, X i : fun ω ↦ (fun i ↦ π (X i ω)) | ⟨π ∘ (∑ i, X i), fun ω ↦ (fun i ↦ Y i ω)⟩] := by have : IsProbabilityMeasure (ℙ : Measure Ω) := h_indep.isProbabilityMeasure set E' := fun (y : Fin m → S) ↦ ⋂ i, Y i ⁻¹' {y i} set f := fun (y : Fin m → S) ↦ (ℙ (E' y)).toReal set hΩc : (Fin m → S) → MeasureSpace Ω := fun y ↦ ⟨cond ℙ (E' y)⟩ calc _ = ∑ y, (f y) * D[X; fun _ ↦ hΩc y] := condMultiDist_eq' hX hY h_indep _ = ∑ y, (f y) * D[X | fun i ↦ π ∘ X i; fun _ ↦ hΩc y] + ∑ y, (f y) * D[fun i ↦ π ∘ X i; fun _ ↦ hΩc y] + ∑ y, (f y) * I[∑ i, X i : fun ω ↦ (fun i ↦ π (X i ω)) | π ∘ (∑ i, X i); (hΩc y).volume] := by simp_rw [← Finset.sum_add_distrib, ← left_distrib] congr with y by_cases hf : f y = 0 . simp only [hf, zero_mul] congr 1 convert multiDist_chainRule π (hΩc y) hX _ refine h_indep.cond hY ?_ fun _ ↦ .singleton _ apply prob_nonzero_of_prod_prob_nonzero convert hf rw [← ENNReal.toReal_prod] congr exact (iIndepFun.meas_iInter h_indep fun _ ↦ mes_of_comap <| .singleton _).symm _ = _ := by have hmes : Measurable (π ∘ ∑ i : Fin m, X i) := by apply Measurable.comp .of_discrete convert Finset.measurable_sum (f := X) Finset.univ _ with ω . exact Fintype.sum_apply ω X exact (fun i _ ↦ hX i) have hpi_indep : iIndepFun (fun i ↦ ⟨π ∘ X i, Y i⟩) ℙ := by set g : G × S → H × S := fun p ↦ ⟨π p.1, p.2⟩ convert iIndepFun.comp h_indep (fun _ ↦ g) _ intro i exact .of_discrete have hpi_indep' : iIndepFun (fun i ↦ ⟨X i, ⟨π ∘ X i, Y i⟩⟩) ℙ := by set g : G × S → G × (H × S) := fun p ↦ ⟨p.1, ⟨π p.1, p.2⟩⟩ convert iIndepFun.comp h_indep (fun _ ↦ g) _ intro i exact .of_discrete have hey_mes : ∀ y, MeasurableSet (E' y) := by intro y apply MeasurableSet.iInter intro i exact MeasurableSet.preimage (MeasurableSet.singleton (y i)) (hY i) congr 2 . rw [condMultiDist_eq' hX _ hpi_indep'] . rw [← Equiv.sum_comp (Equiv.arrowProdEquivProdArrow _ _ _).symm, Fintype.sum_prod_type, Finset.sum_comm] congr with y by_cases pey : ℙ (E' y) = 0 . simp only [pey, ENNReal.zero_toReal, zero_mul, f] apply (Finset.sum_eq_zero _).symm intro s _ convert zero_mul _ convert ENNReal.zero_toReal apply measure_mono_null _ pey intro ω hω simp [E', Equiv.arrowProdEquivProdArrow] at hω ⊢ intro i exact (hω i).2 rw [condMultiDist_eq' (hΩ := hΩc y) hX, Finset.mul_sum] . congr with s dsimp [f, E', Equiv.arrowProdEquivProdArrow] rw [← mul_assoc, ← ENNReal.toReal_mul] congr 2 . rw [mul_comm] convert ProbabilityTheory.cond_mul_eq_inter (hey_mes y) ?_ _ . rw [← Set.iInter_inter_distrib] apply Set.iInter_congr intro i ext ω simp only [Set.mem_preimage, Set.mem_singleton_iff, Prod.mk.injEq, comp_apply, Set.mem_inter_iff] exact And.comm infer_instance funext _ congr 1 dsimp [hΩc, E'] rw [ProbabilityTheory.cond_cond_eq_cond_inter (hey_mes y), ← Set.iInter_inter_distrib] . congr 1 apply Set.iInter_congr intro i ext ω simp only [Set.mem_inter_iff, Set.mem_preimage, Set.mem_singleton_iff, comp_apply, Prod.mk.injEq] exact And.comm apply MeasurableSet.iInter intro i apply MeasurableSet.preimage (MeasurableSet.singleton _) exact Measurable.comp .of_discrete (hX i) . intro i exact Measurable.comp .of_discrete (hX i) set g : G → G × H := fun x ↦ ⟨x, π x⟩ refine iIndepFun.comp ?_ (fun _ ↦ g) fun _ ↦ .of_discrete . refine h_indep.cond hY ?_ fun _ ↦ .singleton _ rw [iIndepFun.meas_iInter h_indep fun _ ↦ mes_of_comap <| .singleton _] at pey contrapose! pey obtain ⟨i, hi⟩ := pey exact Finset.prod_eq_zero (Finset.mem_univ i) hi intro i exact Measurable.prodMk (Measurable.comp .of_discrete (hX i)) (hY i) . rw [condMultiDist_eq' _ hY hpi_indep] intro i apply Measurable.comp .of_discrete (hX i) rw [condMutualInfo_eq_sum', Fintype.sum_prod_type, Finset.sum_comm] . congr with y by_cases pey : ℙ (E' y) = 0 . simp only [pey, ENNReal.zero_toReal, zero_mul, f] apply (Finset.sum_eq_zero _).symm intro s _ convert zero_mul _ convert ENNReal.zero_toReal apply measure_mono_null _ pey intro ω hω simp [E'] at hω ⊢ rw [← hω.2] simp only [implies_true] have : IsProbabilityMeasure (hΩc y).volume := cond_isProbabilityMeasure pey rw [condMutualInfo_eq_sum' hmes, Finset.mul_sum] congr with x dsimp [f, E'] rw [← mul_assoc, ← ENNReal.toReal_mul] congr 2 . rw [mul_comm] convert ProbabilityTheory.cond_mul_eq_inter (hey_mes y) ?_ _ . ext ω simp only [Set.mem_preimage, Set.mem_singleton_iff, Prod.mk.injEq, comp_apply, Finset.sum_apply, _root_.map_sum, Set.mem_inter_iff, Set.mem_iInter, E'] rw [and_comm] apply and_congr_left intro _ exact funext_iff infer_instance dsimp [hΩc, E'] rw [ProbabilityTheory.cond_cond_eq_cond_inter (hey_mes y)] . congr ext ω simp only [Set.mem_inter_iff, Set.mem_iInter, Set.mem_preimage, Set.mem_singleton_iff, comp_apply, Finset.sum_apply, _root_.map_sum, Prod.mk.injEq, E'] rw [and_comm] apply and_congr_right intro _ exact Iff.symm funext_iff exact MeasurableSet.preimage (MeasurableSet.singleton x) hmes exact Measurable.prodMk hmes (measurable_pi_lambda (fun ω i ↦ Y i ω) hY)
pfr/blueprint/src/chapter/torsion.tex:390
pfr/PFR/MoreRuzsaDist.lean:1190
PFR
construct_good_improved'
\begin{lemma}[Constructing good variables, II']\label{construct-good-improv}\lean{construct_good_improved'}\leanok One has \begin{align*} k & \leq \delta + \frac{\eta}{6} \sum_{i=1}^2 \sum_{1 \leq j,l \leq 3; j \neq l} (d[X^0_i;T_j|T_l] - d[X^0_i; X_i]) \end{align*} \end{lemma} \begin{proof} \uses{construct-good-prelim-improv}\leanok Average \Cref{construct-good-prelim-improv} over all six permutations of $T_1,T_2,T_3$. \end{proof}
lemma construct_good_improved' : k ≤ δ + (p.η / 6) * ((d[p.X₀₁ # T₁ | T₂] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # T₁ | T₃] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # T₂ | T₁] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # T₂ | T₃] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # T₃ | T₁] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # T₃ | T₂] - d[p.X₀₁ # X₁]) + (d[p.X₀₂ # T₁ | T₂] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # T₁ | T₃] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # T₂ | T₁] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # T₂ | T₃] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # T₃ | T₁] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # T₃ | T₂] - d[p.X₀₂ # X₂])) := by have I1 : I[T₂ : T₁] = I[T₁ : T₂] := mutualInfo_comm hT₂ hT₁ _ have I2 : I[T₃ : T₁] = I[T₁ : T₃] := mutualInfo_comm hT₃ hT₁ _ have I3 : I[T₃ : T₂] = I[T₂ : T₃] := mutualInfo_comm hT₃ hT₂ _ have Z123 := construct_good_prelim' h_min hT hT₁ hT₂ hT₃ have h132 : T₁ + T₃ + T₂ = 0 := by rw [← hT]; abel have Z132 := construct_good_prelim' h_min h132 hT₁ hT₃ hT₂ have h213 : T₂ + T₁ + T₃ = 0 := by rw [← hT]; abel have Z213 := construct_good_prelim' h_min h213 hT₂ hT₁ hT₃ have h231 : T₂ + T₃ + T₁ = 0 := by rw [← hT]; abel have Z231 := construct_good_prelim' h_min h231 hT₂ hT₃ hT₁ have h312 : T₃ + T₁ + T₂ = 0 := by rw [← hT]; abel have Z312 := construct_good_prelim' h_min h312 hT₃ hT₁ hT₂ have h321 : T₃ + T₂ + T₁ = 0 := by rw [← hT]; abel have Z321 := construct_good_prelim' h_min h321 hT₃ hT₂ hT₁ simp only [I1, I2, I3] at Z123 Z132 Z213 Z231 Z312 Z321 linarith include h_min in omit [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] [IsProbabilityMeasure (ℙ : Measure Ω)] in /-- Rephrase `construct_good_improved'` with an explicit probability measure, as we will apply it to (varying) conditional measures. -/
pfr/blueprint/src/chapter/improved_exponent.tex:57
pfr/PFR/ImprovedPFR.lean:384
PFR
construct_good_prelim
\begin{lemma}[Constructing good variables, I]\label{construct-good-prelim} \lean{construct_good_prelim}\leanok One has \begin{align*} k \leq \delta + \eta (& d[X^0_1;T_1]-d[X^0_1;X_1]) + \eta (d[X^0_2;T_2]-d[X^0_2;X_2]) \\ & + \tfrac12 \eta \bbI[T_1:T_3] + \tfrac12 \eta \bbI[T_2:T_3]. \end{align*} \end{lemma}
lemma construct_good_prelim : k ≤ δ + p.η * c[T₁ # T₂] + p.η * (I[T₁: T₃] + I[T₂ : T₃])/2 := by let sum1 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ d[T₁; ℙ[|T₃ ⁻¹' {t}] # T₂; ℙ[|T₃ ⁻¹' {t}]]] let sum2 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ d[p.X₀₁; ℙ # T₁; ℙ[|T₃ ⁻¹' {t}]] - d[p.X₀₁ # X₁]] let sum3 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ d[p.X₀₂; ℙ # T₂; ℙ[|T₃ ⁻¹' {t}]] - d[p.X₀₂ # X₂]] let sum4 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ ψ[T₁; ℙ[|T₃ ⁻¹' {t}] # T₂; ℙ[|T₃ ⁻¹' {t}]]] have hp.η : 0 ≤ p.η := by linarith [p.hη] have hP : IsProbabilityMeasure (Measure.map T₃ ℙ) := isProbabilityMeasure_map hT₃.aemeasurable have h2T₃ : T₃ = T₁ + T₂ := calc T₃ = T₁ + T₂ + T₃ - T₃ := by rw [hT, zero_sub]; simp [ZModModule.neg_eq_self] _ = T₁ + T₂ := by rw [add_sub_cancel_right] have h2T₁ : T₁ = T₂ + T₃ := by simp [h2T₃, add_left_comm, ZModModule.add_self] have h2T₂ : T₂ = T₃ + T₁ := by simp [h2T₁, add_left_comm, ZModModule.add_self] have h1 : sum1 ≤ δ := by have h1 : sum1 ≤ 3 * I[T₁ : T₂] + 2 * H[T₃] - H[T₁] - H[T₂] := by subst h2T₃; exact ent_bsg hT₁ hT₂ have h2 : H[⟨T₂, T₃⟩] = H[⟨T₁, T₂⟩] := by rw [h2T₃, entropy_add_right', entropy_comm] <;> assumption have h3 : H[⟨T₁, T₂⟩] = H[⟨T₃, T₁⟩] := by rw [h2T₃, entropy_add_left, entropy_comm] <;> assumption simp_rw [mutualInfo_def] at h1 ⊢; linarith have h2 : p.η * sum2 ≤ p.η * (d[p.X₀₁ # T₁] - d[p.X₀₁ # X₁] + I[T₁ : T₃] / 2) := by have : sum2 = d[p.X₀₁ # T₁ | T₃] - d[p.X₀₁ # X₁] := by simp only [integral_sub .of_finite .of_finite, integral_const, measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul, sub_left_inj, sum2] simp_rw [condRuzsaDist'_eq_sum hT₁ hT₃, integral_eq_setIntegral (FiniteRange.null_of_compl _ T₃), integral_finset _ _ IntegrableOn.finset, Measure.map_apply hT₃ (.singleton _), smul_eq_mul] gcongr linarith [condRuzsaDist_le' ℙ ℙ p.hmeas1 hT₁ hT₃] have h3 : p.η * sum3 ≤ p.η * (d[p.X₀₂ # T₂] - d[p.X₀₂ # X₂] + I[T₂ : T₃] / 2) := by have : sum3 = d[p.X₀₂ # T₂ | T₃] - d[p.X₀₂ # X₂] := by simp only [integral_sub .of_finite .of_finite, integral_const, measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul, sub_left_inj, sum3] simp_rw [condRuzsaDist'_eq_sum hT₂ hT₃, integral_eq_setIntegral (FiniteRange.null_of_compl _ T₃), integral_finset _ _ IntegrableOn.finset, Measure.map_apply hT₃ (.singleton _), smul_eq_mul] gcongr linarith [condRuzsaDist_le' ℙ ℙ p.hmeas2 hT₂ hT₃] have h4 : sum4 ≤ δ + p.η * c[T₁ # T₂] + p.η * (I[T₁ : T₃] + I[T₂ : T₃]) / 2 := by suffices sum4 = sum1 + p.η * (sum2 + sum3) by linarith simp only [sum1, sum2, sum3, sum4, integral_add .of_finite .of_finite, integral_mul_left] have hk : k ≤ sum4 := by suffices (Measure.map T₃ ℙ)[fun _ ↦ k] ≤ sum4 by simpa using this refine integral_mono_ae .of_finite .of_finite $ ae_iff_of_countable.2 fun t ht ↦ ?_ have : IsProbabilityMeasure (ℙ[|T₃ ⁻¹' {t}]) := cond_isProbabilityMeasure (by simpa [hT₃] using ht) dsimp only linarith only [distance_ge_of_min' (μ := ℙ[|T₃ ⁻¹' {t}]) (μ' := ℙ[|T₃ ⁻¹' {t}]) p h_min hT₁ hT₂] exact hk.trans h4 include hT₁ hT₂ hT₃ hT h_min in /-- If $T_1, T_2, T_3$ are $G$-valued random variables with $T_1+T_2+T_3=0$ holds identically and - $$ \delta := \sum_{1 \leq i < j \leq 3} I[T_i;T_j]$$ Then there exist random variables $T'_1, T'_2$ such that $$ d[T'_1;T'_2] + \eta (d[X_1^0;T'_1] - d[X_1^0;X _1]) + \eta(d[X_2^0;T'_2] - d[X_2^0;X_2])$$ is at most $$\delta + \frac{\eta}{3} \biggl( \delta + \sum_{i=1}^2 \sum_{j = 1}^3 (d[X^0_i;T_j] - d[X^0_i; X_i]) \biggr).$$ -/
pfr/blueprint/src/chapter/entropy_pfr.tex:327
pfr/PFR/Endgame.lean:367
PFR
construct_good_prelim'
\begin{lemma}[Constructing good variables, I']\label{construct-good-prelim-improv}\lean{construct_good_prelim'}\leanok One has \begin{align*} k \leq \delta + \eta (& d[X^0_1;T_1|T_3]-d[X^0_1;X_1]) + \eta (d[X^0_2;T_2|T_3]-d[X^0_2;X_2]). \end{align*} \end{lemma} \begin{proof} \uses{entropic-bsg,distance-lower}\leanok We apply \Cref{entropic-bsg} with $(A,B) = (T_1, T_2)$ there. Since $T_1 + T_2 = T_3$, the conclusion is that \begin{align} \nonumber \sum_{t_3} \bbP[T_3 = t_3] & d[(T_1 | T_3 = t_3); (T_2 | T_3 = t_3)] \\ & \leq 3 \bbI[T_1 : T_2] + 2 \bbH[T_3] - \bbH[T_1] - \bbH[T_2].\label{bsg-t1t2'} \end{align} The right-hand side in~\eqref{bsg-t1t2'} can be rearranged as \begin{align*} & 2( \bbH[T_1] + \bbH[T_2] + \bbH[T_3]) - 3 \bbH[T_1,T_2] \\ & = 2(\bbH[T_1] + \bbH[T_2] + \bbH[T_3]) - \bbH[T_1,T_2] - \bbH[T_2,T_3] - \bbH[T_1, T_3] = \delta,\end{align*} using the fact (from \Cref{relabeled-entropy}) that all three terms $\bbH[T_i,T_j]$ are equal to $\bbH[T_1,T_2,T_3]$ and hence to each other. We also have \begin{align*} & \sum_{t_3} P[T_3 = t_3] \bigl(d[X^0_1; (T_1 | T_3=t_3)] - d[X^0_1;X_1]\bigr) \\ &\quad = d[X^0_1; T_1 | T_3] - d[X^0_1;X_1] \end{align*} and similarly \begin{align*} & \sum_{t_3} \bbP[T_3 = t_3] (d[X^0_2;(T_2 | T_3=t_3)] - d[X^0_2; X_2]) \\ &\quad\quad\quad\quad\quad\quad \leq d[X^0_2;T_2|T_3] - d[X^0_2;X_2]. \end{align*} Putting the above observations together, we have \begin{align*} \sum_{t_3} \bbP[T_3=t_3] \psi[(T_1 | T_3=t_3); (T_2 | T_3=t_3)] \leq \delta + \eta (d[X^0_1;T_1|T_3]-d[X^0_1;X_1]) \\ + \eta (d[X^0_2;T_2|T_3]-d[X^0_2;X_2]) \end{align*} where we introduce the notation \[\psi[Y_1; Y_2] := d[Y_1;Y_2] + \eta (d[X_1^0;Y_1] - d[X_1^0;X_1]) + \eta(d[X_2^0;Y_2] - d[X_2^0;X_2]).\] On the other hand, from \Cref{distance-lower} we have $k \leq \psi[Y_1;Y_2]$, and the claim follows. \end{proof}
lemma construct_good_prelim' : k ≤ δ + p.η * c[T₁ | T₃ # T₂ | T₃] := by let sum1 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ d[T₁; ℙ[|T₃ ⁻¹' {t}] # T₂; ℙ[|T₃ ⁻¹' {t}]]] let sum2 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ d[p.X₀₁; ℙ # T₁; ℙ[|T₃ ⁻¹' {t}]] - d[p.X₀₁ # X₁]] let sum3 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ d[p.X₀₂; ℙ # T₂; ℙ[|T₃ ⁻¹' {t}]] - d[p.X₀₂ # X₂]] let sum4 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ ψ[T₁; ℙ[|T₃ ⁻¹' {t}] # T₂; ℙ[|T₃ ⁻¹' {t}]]] have h2T₃ : T₃ = T₁ + T₂ := by calc T₃ = T₁ + T₂ + T₃ - T₃ := by simp [hT, ZModModule.neg_eq_self] _ = T₁ + T₂ := by rw [add_sub_cancel_right] have hP : IsProbabilityMeasure (Measure.map T₃ ℙ) := isProbabilityMeasure_map hT₃.aemeasurable -- control sum1 with entropic BSG have h1 : sum1 ≤ δ := by have h1 : sum1 ≤ 3 * I[T₁ : T₂] + 2 * H[T₃] - H[T₁] - H[T₂] := by subst h2T₃; exact ent_bsg hT₁ hT₂ have h2 : H[⟨T₂, T₃⟩] = H[⟨T₁, T₂⟩] := by rw [h2T₃, entropy_add_right', entropy_comm] <;> assumption have h3 : H[⟨T₁, T₂⟩] = H[⟨T₃, T₁⟩] := by rw [h2T₃, entropy_add_left, entropy_comm] <;> assumption simp_rw [mutualInfo_def] at h1 ⊢; linarith -- rewrite sum2 and sum3 as Rusza distances have h2 : sum2 = d[p.X₀₁ # T₁ | T₃] - d[p.X₀₁ # X₁] := by simp only [sum2, integral_sub .of_finite .of_finite, integral_const, measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul, sub_left_inj] simp_rw [condRuzsaDist'_eq_sum hT₁ hT₃, integral_eq_setIntegral (FiniteRange.null_of_compl _ T₃), integral_finset _ _ .finset, Measure.map_apply hT₃ (.singleton _), smul_eq_mul] have h3 : sum3 = d[p.X₀₂ # T₂ | T₃] - d[p.X₀₂ # X₂] := by simp only [sum3, integral_sub .of_finite .of_finite, integral_const, measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul, sub_left_inj] simp_rw [condRuzsaDist'_eq_sum hT₂ hT₃, integral_eq_setIntegral (FiniteRange.null_of_compl _ T₃), integral_finset _ _ .finset, Measure.map_apply hT₃ (.singleton _), smul_eq_mul] -- put all these estimates together to bound sum4 have h4 : sum4 ≤ δ + p.η * ((d[p.X₀₁ # T₁ | T₃] - d[p.X₀₁ # X₁]) + (d[p.X₀₂ # T₂ | T₃] - d[p.X₀₂ # X₂])) := by have : sum4 = sum1 + p.η * (sum2 + sum3) := by simp only [sum1, sum2, sum3, sum4, integral_add .of_finite .of_finite, integral_mul_left] rw [this, h2, h3, add_assoc, mul_add] linarith have hk : k ≤ sum4 := by suffices (Measure.map T₃ ℙ)[fun _ ↦ k] ≤ sum4 by simpa using this refine integral_mono_ae .of_finite .of_finite $ ae_iff_of_countable.2 fun t ht ↦ ?_ have : IsProbabilityMeasure (ℙ[|T₃ ⁻¹' {t}]) := cond_isProbabilityMeasure (by simpa [hT₃] using ht) dsimp only linarith only [distance_ge_of_min' (μ := ℙ[|T₃ ⁻¹' {t}]) (μ' := ℙ[|T₃ ⁻¹' {t}]) p h_min hT₁ hT₂] exact hk.trans h4 open Module include hT hT₁ hT₂ hT₃ h_min in omit [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] [IsProbabilityMeasure (ℙ : Measure Ω)] in /-- In fact $k$ is at most $$ \delta + \frac{\eta}{6} \sum_{i=1}^2 \sum_{1 \leq j,l \leq 3; j \neq l} (d[X^0_i;T_j|T_l] - d[X^0_i; X_i]).$$ -/
pfr/blueprint/src/chapter/improved_exponent.tex:19
pfr/PFR/ImprovedPFR.lean:326
PFR
cor_multiDist_chainRule
\begin{corollary}\label{cor-multid}\lean{cor_multiDist_chainRule}\leanok Let $G$ be an abelian group and let $m \geq 2$. Suppose that $X_{i,j}$, $1 \leq i, j \leq m$, are independent $G$-valued random variables. Then \begin{align*} &\bbI[ \bigl(\sum_{i=1}^m X_{i,j}\bigr)_{j =1}^{m} : \bigl(\sum_{j=1}^m X_{i,j}\bigr)_{i = 1}^m \; \big| \; \sum_{i=1}^m \sum_{j = 1}^m X_{i,j} ] \\ &\quad \leq \sum_{j=1}^{m-1} \Bigl(D[(X_{i, j})_{i = 1}^m] - D[ (X_{i, j})_{i = 1}^m \; \big| \; (X_{i,j} + \cdots + X_{i,m})_{i =1}^m ]\Bigr) \\ & \qquad\qquad\qquad\qquad + D[(X_{i,m})_{i=1}^m] - D[ \bigl(\sum_{j=1}^m X_{i,j}\bigr)_{i=1}^m ], \end{align*} where all the multidistances here involve the indexing set $\{1,\dots, m\}$. \end{corollary} \begin{proof}\uses{multidist-chain-rule-iter, add-entropy} In \Cref{multidist-chain-rule-iter} we take $G_d := G^d$ with the maps $\pi_d \colon G^m \to G^d$ for $d=1,\dots,m$ defined by \[ \pi_d(x_1,\dots,x_m) := (x_1,\dots,x_{d-1}, x_d + \cdots + x_m) \] with $\pi_0=0$. Since $\pi_{d-1}(x)$ can be obtained from $\pi_{d}(x)$ by applying a homomorphism, we obtain a sequence of the form~\eqref{g-seq}. Now we apply \Cref{multidist-chain-rule-iter} with $I = \{1,\dots, m\}$ and $X_i := (X_{i,j})_{j = 1}^m$. Using joint independence and \Cref{add-entropy}, we find that \[ D[ X_{[m]} ] = \sum_{j=1}^m D[ (X_{i,j})_{1 \leq i \leq m} ]. \] On the other hand, for $1 \leq j \leq m-1$, we see that once $\pi_{j}(X_i)$ is fixed, $\pi_{j+1}(X_i)$ is determined by $X_{i, j}$ and vice versa, so \[ D[ \pi_{j+1}(X_{[m]}) \; | \; \pi_{j}(X_{[m]}) ] = D[ (X_{i, j})_{1 \leq i \leq m} \; | \; \pi_{j}(X_{[m]} )]. \] Since the $X_{i,j}$ are jointly independent, we may further simplify: \[ D[ (X_{i, j})_{1 \leq i \leq m} \; | \; \pi_{j}(X_{[m]})] = D[ (X_{i,j})_{1 \leq i \leq m} \; | \; ( X_{i, j} + \cdots + X_{i, m})_{1 \leq i \leq m} ]. \] Putting all this into the conclusion of \Cref{multidist-chain-rule-iter}, we obtain \[ \sum_{j=1}^{m} D[ (X_{i,j})_{1 \leq i \leq m} ] \geq \begin{aligned}[t] &\sum_{j=1}^{m-1} D[ (X_{i,j})_{1 \leq i \leq m} \; | \; (X_{i,j} + \cdots + X_{i,m})_{1 \leq i \leq m} ] \\ &\!\!\!+ D[ \bigl(\sum_{j=1}^m X_{i,j}\bigr)_{1 \leq i \leq m}] \\ &\!\!\!+\bbI[ \bigl(\sum_{i=1}^m X_{i,j}\bigr)_{j =1}^{m} : \bigl(\sum_{j=1}^m X_{i,j}\bigr)_{i = 1}^m \; \big| \; \sum_{i=1}^m \sum_{j = 1}^m X_{i,j} ] \end{aligned} \] and the claim follows by rearranging. \end{proof}
lemma cor_multiDist_chainRule [Fintype G] {m:ℕ} (hm: m ≥ 1) {Ω : Type*} (hΩ : MeasureSpace Ω) (X : Fin (m + 1) × Fin (m + 1) → Ω → G) (h_indep : iIndepFun X) : I[fun ω ↦ (fun j ↦ ∑ i, X (i, j) ω) : fun ω ↦ (fun i ↦ ∑ j, X (i, j) ω) | ∑ p, X p] ≤ ∑ j, (D[fun i ↦ X (i, j); fun _ ↦ hΩ] - D[fun i ↦ X (i, j) | fun i ↦ ∑ k ∈ Finset.Ici j, X (i, k); fun _ ↦ hΩ]) + D[fun i ↦ X (i, m); fun _ ↦ hΩ] - D[fun i ↦ ∑ j, X (i, j); fun _ ↦ hΩ] := by sorry end multiDistance_chainRule
pfr/blueprint/src/chapter/torsion.tex:440
pfr/PFR/MoreRuzsaDist.lean:1489
PFR
diff_ent_le_rdist
\begin{lemma}[Distance controls entropy difference]\label{ruzsa-diff} \uses{ruz-dist-def} \lean{diff_ent_le_rdist}\leanok If $X,Y$ are $G$-valued random variables, then $$|\bbH[X]-H[Y]| \leq 2 d[X ;Y].$$ \end{lemma} \begin{proof} \uses{sumset-lower, neg-ent} \leanok Immediate from \Cref{sumset-lower} and \Cref{ruz-dist-def}, and also \Cref{neg-ent}. \end{proof}
/-- `|H[X] - H[Y]| ≤ 2 d[X ; Y]`. -/ lemma diff_ent_le_rdist [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] (hX : Measurable X) (hY : Measurable Y) : |H[X ; μ] - H[Y ; μ']| ≤ 2 * d[X ; μ # Y ; μ'] := by obtain ⟨ν, X', Y', _, hX', hY', hind, hIdX, hIdY, _, _⟩ := independent_copies_finiteRange hX hY μ μ' rw [← hIdX.rdist_eq hIdY, hind.rdist_eq hX' hY', ← hIdX.entropy_eq, ← hIdY.entropy_eq, abs_le] have := max_entropy_le_entropy_sub hX' hY' hind constructor · linarith[le_max_right H[X'; ν] H[Y'; ν]] · linarith[le_max_left H[X'; ν] H[Y'; ν]]
pfr/blueprint/src/chapter/distance.tex:128
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:243
PFR
diff_ent_le_rdist'
\begin{lemma}[Distance controls entropy growth]\label{ruzsa-growth} \uses{ruz-dist-def} \lean{diff_ent_le_rdist', diff_ent_le_rdist''}\leanok If $X,Y$ are independent $G$-valued random variables, then $$ \bbH[X-Y] - \bbH[X], \bbH[X-Y] - \bbH[Y] \leq 2d[X ;Y].$$ \end{lemma} \begin{proof} \uses{sumset-lower, neg-ent} \leanok Immediate from \Cref{sumset-lower} and \Cref{ruz-dist-def}, and also \Cref{neg-ent}. \end{proof}
/-- `H[X - Y] - H[X] ≤ 2d[X ; Y]`. -/ lemma diff_ent_le_rdist' [IsProbabilityMeasure μ] {Y : Ω → G} (hX : Measurable X) (hY : Measurable Y) (h : IndepFun X Y μ) [FiniteRange Y]: H[X - Y ; μ] - H[X ; μ] ≤ 2 * d[X ; μ # Y ; μ] := by rw [h.rdist_eq hX hY] linarith[max_entropy_le_entropy_sub hX hY h, le_max_right H[X ; μ] H[Y; μ]]
pfr/blueprint/src/chapter/distance.tex:138
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:254
PFR
diff_ent_le_rdist''
\begin{lemma}[Distance controls entropy growth]\label{ruzsa-growth} \uses{ruz-dist-def} \lean{diff_ent_le_rdist', diff_ent_le_rdist''}\leanok If $X,Y$ are independent $G$-valued random variables, then $$ \bbH[X-Y] - \bbH[X], \bbH[X-Y] - \bbH[Y] \leq 2d[X ;Y].$$ \end{lemma} \begin{proof} \uses{sumset-lower, neg-ent} \leanok Immediate from \Cref{sumset-lower} and \Cref{ruz-dist-def}, and also \Cref{neg-ent}. \end{proof}
/-- `H[X - Y] - H[Y] ≤ 2d[X ; Y]`. -/ lemma diff_ent_le_rdist'' [IsProbabilityMeasure μ] {Y : Ω → G} (hX : Measurable X) (hY : Measurable Y) (h : IndepFun X Y μ) [FiniteRange Y]: H[X - Y ; μ] - H[Y ; μ] ≤ 2 * d[X ; μ # Y ; μ] := by rw [h.rdist_eq hX hY] linarith[max_entropy_le_entropy_sub hX hY h, le_max_left H[X ; μ] H[Y; μ]]
pfr/blueprint/src/chapter/distance.tex:138
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:261
PFR
diff_rdist_le_1
\begin{lemma}[Upper bound on distance differences]\label{first-upper}\leanok \lean{diff_rdist_le_1, diff_rdist_le_2, diff_rdist_le_3, diff_rdist_le_4} We have \begin{align*} d[X^0_1; X_1+\tilde X_2] - d[X^0_1; X_1] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_2] - \tfrac{1}{4} \bbH[X_1]\\ d[X^0_2;X_2+\tilde X_1] - d[X^0_2; X_2] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_1] - \tfrac{1}{4} \bbH[X_2], \\ d[X_1^0;X_1|X_1+\tilde X_2] - d[X_1^0;X_1] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_1] - \tfrac{1}{4} \bbH[X_2] \\ d[X_2^0; X_2|X_2+\tilde X_1] - d[X_2^0; X_2] &\leq \tfrac{1}{2}k + \tfrac{1}{4} \bbH[X_2] - \tfrac{1}{4} \bbH[X_1]. \end{align*} \end{lemma} \begin{proof}\uses{first-useful} \leanok Immediate from \Cref{first-useful} (and recalling that $k$ is defined to be $d[X_1;X_2]$). \end{proof}
/--`d[X₀₁ # X₁ + X₂'] - d[X₀₁ # X₁] ≤ k/2 + H[X₂]/4 - H[X₁]/4`. -/ lemma diff_rdist_le_1 [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] : d[p.X₀₁ # X₁ + X₂'] - d[p.X₀₁ # X₁] ≤ k/2 + H[X₂]/4 - H[X₁]/4 := by have h : IndepFun X₁ X₂' := by simpa using h_indep.indepFun (show (0 : Fin 4) ≠ 2 by decide) convert condRuzsaDist_diff_le' ℙ p.hmeas1 hX₁ hX₂' h using 4 · exact (IdentDistrib.refl hX₁.aemeasurable).rdist_eq h₂ · exact h₂.entropy_eq include hX₁' hX₂ h_indep h₁ in
pfr/blueprint/src/chapter/entropy_pfr.tex:115
pfr/PFR/FirstEstimate.lean:93
PFR
diff_rdist_le_2
\begin{lemma}[Upper bound on distance differences]\label{first-upper}\leanok \lean{diff_rdist_le_1, diff_rdist_le_2, diff_rdist_le_3, diff_rdist_le_4} We have \begin{align*} d[X^0_1; X_1+\tilde X_2] - d[X^0_1; X_1] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_2] - \tfrac{1}{4} \bbH[X_1]\\ d[X^0_2;X_2+\tilde X_1] - d[X^0_2; X_2] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_1] - \tfrac{1}{4} \bbH[X_2], \\ d[X_1^0;X_1|X_1+\tilde X_2] - d[X_1^0;X_1] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_1] - \tfrac{1}{4} \bbH[X_2] \\ d[X_2^0; X_2|X_2+\tilde X_1] - d[X_2^0; X_2] &\leq \tfrac{1}{2}k + \tfrac{1}{4} \bbH[X_2] - \tfrac{1}{4} \bbH[X_1]. \end{align*} \end{lemma} \begin{proof}\uses{first-useful} \leanok Immediate from \Cref{first-useful} (and recalling that $k$ is defined to be $d[X_1;X_2]$). \end{proof}
/-- $$ d[X^0_2;X_2+\tilde X_1] - d[X^0_2; X_2] \leq \tfrac{1}{2} k + \tfrac{1}{4} \mathbb{H}[X_1] - \tfrac{1}{4} \mathbb{H}[X_2].$$ -/ lemma diff_rdist_le_2 [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] : d[p.X₀₂ # X₂ + X₁'] - d[p.X₀₂ # X₂] ≤ k/2 + H[X₁]/4 - H[X₂]/4 := by have h : IndepFun X₂ X₁' := by simpa using h_indep.indepFun (show (1 : Fin 4) ≠ 3 by decide) convert condRuzsaDist_diff_le' ℙ p.hmeas2 hX₂ hX₁' h using 4 · rw [rdist_symm] exact (IdentDistrib.refl hX₂.aemeasurable).rdist_eq h₁ · exact h₁.entropy_eq include h_indep hX₁ hX₂' h₂ in /-- $$ d[X_1^0;X_1|X_1+\tilde X_2] - d[X_1^0;X_1] \leq \tfrac{1}{2} k + \tfrac{1}{4} \mathbb{H}[X_1] - \tfrac{1}{4} \mathbb{H}[X_2].$$ -/
pfr/blueprint/src/chapter/entropy_pfr.tex:115
pfr/PFR/FirstEstimate.lean:102
PFR
diff_rdist_le_3
\begin{lemma}[Upper bound on distance differences]\label{first-upper}\leanok \lean{diff_rdist_le_1, diff_rdist_le_2, diff_rdist_le_3, diff_rdist_le_4} We have \begin{align*} d[X^0_1; X_1+\tilde X_2] - d[X^0_1; X_1] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_2] - \tfrac{1}{4} \bbH[X_1]\\ d[X^0_2;X_2+\tilde X_1] - d[X^0_2; X_2] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_1] - \tfrac{1}{4} \bbH[X_2], \\ d[X_1^0;X_1|X_1+\tilde X_2] - d[X_1^0;X_1] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_1] - \tfrac{1}{4} \bbH[X_2] \\ d[X_2^0; X_2|X_2+\tilde X_1] - d[X_2^0; X_2] &\leq \tfrac{1}{2}k + \tfrac{1}{4} \bbH[X_2] - \tfrac{1}{4} \bbH[X_1]. \end{align*} \end{lemma} \begin{proof}\uses{first-useful} \leanok Immediate from \Cref{first-useful} (and recalling that $k$ is defined to be $d[X_1;X_2]$). \end{proof}
lemma diff_rdist_le_3 [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] : d[p.X₀₁ # X₁ | X₁ + X₂'] - d[p.X₀₁ # X₁] ≤ k/2 + H[X₁]/4 - H[X₂]/4 := by have h : IndepFun X₁ X₂' := by simpa using h_indep.indepFun (show (0 : Fin 4) ≠ 2 by decide) convert condRuzsaDist_diff_le''' ℙ p.hmeas1 hX₁ hX₂' h using 3 · rw [(IdentDistrib.refl hX₁.aemeasurable).rdist_eq h₂] · apply h₂.entropy_eq include h_indep hX₂ hX₁' h₁ /-- $$ d[X_2^0; X_2|X_2+\tilde X_1] - d[X_2^0; X_2] \leq \tfrac{1}{2}k + \tfrac{1}{4} \mathbb{H}[X_2] - \tfrac{1}{4} \mathbb{H}[X_1].$$ -/
pfr/blueprint/src/chapter/entropy_pfr.tex:115
pfr/PFR/FirstEstimate.lean:114
PFR
diff_rdist_le_4
\begin{lemma}[Upper bound on distance differences]\label{first-upper}\leanok \lean{diff_rdist_le_1, diff_rdist_le_2, diff_rdist_le_3, diff_rdist_le_4} We have \begin{align*} d[X^0_1; X_1+\tilde X_2] - d[X^0_1; X_1] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_2] - \tfrac{1}{4} \bbH[X_1]\\ d[X^0_2;X_2+\tilde X_1] - d[X^0_2; X_2] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_1] - \tfrac{1}{4} \bbH[X_2], \\ d[X_1^0;X_1|X_1+\tilde X_2] - d[X_1^0;X_1] &\leq \tfrac{1}{2} k + \tfrac{1}{4} \bbH[X_1] - \tfrac{1}{4} \bbH[X_2] \\ d[X_2^0; X_2|X_2+\tilde X_1] - d[X_2^0; X_2] &\leq \tfrac{1}{2}k + \tfrac{1}{4} \bbH[X_2] - \tfrac{1}{4} \bbH[X_1]. \end{align*} \end{lemma} \begin{proof}\uses{first-useful} \leanok Immediate from \Cref{first-useful} (and recalling that $k$ is defined to be $d[X_1;X_2]$). \end{proof}
lemma diff_rdist_le_4 [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] : d[p.X₀₂ # X₂ | X₂ + X₁'] - d[p.X₀₂ # X₂] ≤ k/2 + H[X₂]/4 - H[X₁]/4 := by have h : IndepFun X₂ X₁' := by simpa using h_indep.indepFun (show (1 : Fin 4) ≠ 3 by decide) convert condRuzsaDist_diff_le''' ℙ p.hmeas2 hX₂ hX₁' h using 3 · rw [rdist_symm, (IdentDistrib.refl hX₂.aemeasurable).rdist_eq h₁] · apply h₁.entropy_eq include hX₁ hX₂ hX₁' hX₂' h₁ h₂ h_min in
pfr/blueprint/src/chapter/entropy_pfr.tex:115
pfr/PFR/FirstEstimate.lean:124
PFR
dist_diff_bound_1
\begin{lemma}[Bound on distance differences]\label{dist-diff-bound}\lean{dist_diff_bound_1, dist_diff_bound_2}\leanok We have \begin{align*} &\sum_{i=1}^2 \sum_{A,B \in \{U,V,W\}: A \neq B} d[X_i^0;A|B, S] - d[X_i^0;X_i]\\ &\qquad \leq 12 k + \frac{4(2 \eta k - I_1)}{1-\eta}. \end{align*} \end{lemma} \begin{proof}\uses{gen-ineq, relabeled-entropy-cond,second-estimate-aux}\leanok If we apply \Cref{gen-ineq} with $X_1:=X_1$, $Y:=X_1^0$ and $(X_2,X_3,X_4)$ equal to the $3!$ permutations of $(X_2,\tilde X_1,\tilde X_2)$, and sums (using the symmetry $\bbH[X|X+Y] = \bbH[Y|X+Y]$, which follows from \Cref{relabeled-entropy-cond}), we can bound $$ \sum_{A,B \in \{U,V,W\}: A \neq B} d[X_1^0;A|B, S] - d[X_1^0;X_1]$$ by \begin{align*} &\quad \tfrac{1}{4} (6d[X_1;X_2] + 6d[X_1;\tilde X_2]\\ &\qquad + 6d[X_1;\tilde X_1] + 2d[\tilde X_1;\tilde X_2] + 2 d[\tilde X_1;X_2] + 2d[X_2;\tilde X_2])\\ &\quad + \tfrac{1}{8} (2\bbH[X_1+X_2] + 2\bbH[X_1+\tilde X_1] + 2 \bbH[X_1+\tilde X_2] \\ &\qquad - 2\bbH[\tilde X_1+X_2] - 2\bbH[X_2+\tilde X_2] - 2\bbH[\tilde X_1+\tilde X_2])\\ &\qquad \qquad + \tfrac{1}{4} (\bbH[X_2|X_2+\tilde X_2] + \bbH[\tilde X_1|\tilde X_1+\tilde X_2] + \bbH[\tilde X_1|X_1+\tilde X_2] \\ &\qquad \qquad \qquad - \bbH[X_1|X_1+\tilde X_1] - \bbH[X_1|X_1+X_2] - \bbH[X_1|X_1+\tilde X_2]), \end{align*} which simplifies to \begin{align*} &\quad \tfrac{1}{4} (16k + 6d[X_1;X_1] + 2d[X_2;X_2])\\ &\qquad \qquad + \tfrac{1}{4} (H[X_1+\tilde X_1] - H[X_2+\tilde X_2] + d[X_2|X_2+\tilde X_2] - d[X_1|X_1+\tilde X_1]). \end{align*} A symmetric argument also bounds $$ \sum_{A,B \in \{U,V,W\}: A \neq B} d[X_2^0;A|B, S] - d[X_2^0;X_2]$$ by \begin{align*} &\quad \tfrac{1}{4} (16k + 6d[X_2;X_2] + 2d[X_1;X_1])\\ &\qquad \qquad + \tfrac{1}{4} (H[X_2+\tilde X_2] - H[X_1+\tilde X_1] + d[X_1|X_1+\tilde X_1] - d[X_2|X_2+\tilde X_2]). \end{align*} On the other hand, from \Cref{second-estimate-aux} one has $$ d[X_1;X_1] + d[X_2;X_2] \leq 2 k + \frac{2(2 \eta k - I_1)}{1-\eta}.$$ Summing the previous three estimates, we obtain the claim. \end{proof}
lemma dist_diff_bound_1 : (d[p.X₀₁ # U | ⟨V, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # U | ⟨W, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # V | ⟨U, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # V | ⟨W, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # W | ⟨U, S⟩] - d[p.X₀₁ # X₁]) + (d[p.X₀₁ # W | ⟨V, S⟩] - d[p.X₀₁ # X₁]) ≤ (16 * k + 6 * d[X₁ # X₁] + 2 * d[X₂ # X₂]) / 4 + (H[X₁ + X₁'] - H[X₂ + X₂']) / 4 + (H[X₂ | X₂ + X₂'] - H[X₁ | X₁ + X₁']) / 4 := by have I1 := gen_ineq_01 p.X₀₁ p.hmeas1 X₁ X₂ X₂' X₁' hX₁ hX₂ hX₂' hX₁' h_indep.reindex_four_abcd have I2 := gen_ineq_00 p.X₀₁ p.hmeas1 X₁ X₂ X₁' X₂' hX₁ hX₂ hX₁' hX₂' h_indep.reindex_four_abdc have I3 := gen_ineq_10 p.X₀₁ p.hmeas1 X₁ X₂' X₂ X₁' hX₁ hX₂' hX₂ hX₁' h_indep.reindex_four_acbd have I4 := gen_ineq_10 p.X₀₁ p.hmeas1 X₁ X₂' X₁' X₂ hX₁ hX₂' hX₁' hX₂ h_indep.reindex_four_acdb have I5 := gen_ineq_00 p.X₀₁ p.hmeas1 X₁ X₁' X₂ X₂' hX₁ hX₁' hX₂ hX₂' h_indep.reindex_four_adbc have I6 := gen_ineq_01 p.X₀₁ p.hmeas1 X₁ X₁' X₂' X₂ hX₁ hX₁' hX₂' hX₂ h_indep.reindex_four_adcb have C1 : U + X₂' + X₁' = S := by abel have C2 : W + X₂ + X₂' = S := by abel have C3 : X₁ + X₂' + X₂ + X₁' = S := by abel have C4 : X₁ + X₂' + X₁' + X₂ = S := by abel have C5 : W + X₂' + X₂ = S := by abel have C7 : X₂ + X₁' = V := by abel have C8 : X₁ + X₁' = W := by abel have C9 : d[X₁ # X₂'] = d[X₁ # X₂] := (IdentDistrib.refl hX₁.aemeasurable).rdist_eq h₂.symm have C10 : d[X₂ # X₁'] = d[X₁' # X₂] := rdist_symm have C11 : d[X₁ # X₁'] = d[X₁ # X₁] := (IdentDistrib.refl hX₁.aemeasurable).rdist_eq h₁.symm have C12 : d[X₁' # X₂'] = d[X₁ # X₂] := h₁.symm.rdist_eq h₂.symm have C13 : d[X₂ # X₂'] = d[X₂ # X₂] := (IdentDistrib.refl hX₂.aemeasurable).rdist_eq h₂.symm have C14 : d[X₁' # X₂] = d[X₁ # X₂] := h₁.symm.rdist_eq (IdentDistrib.refl hX₂.aemeasurable) have C15 : H[X₁' + X₂'] = H[U] := by apply ProbabilityTheory.IdentDistrib.entropy_eq have I : IdentDistrib (⟨X₁, X₂⟩) (⟨X₁', X₂'⟩) := h₁.prodMk h₂ (h_indep.indepFun zero_ne_one) (h_indep.indepFun (show 3 ≠ 2 by decide)) exact I.symm.comp measurable_add have C16 : H[X₂'] = H[X₂] := h₂.symm.entropy_eq have C17 : H[X₁'] = H[X₁] := h₁.symm.entropy_eq have C18 : d[X₂' # X₁'] = d[X₁' # X₂'] := rdist_symm have C19 : H[X₂' + X₁'] = H[U] := by rw [add_comm]; exact C15 have C20 : d[X₂' # X₂] = d[X₂ # X₂] := h₂.symm.rdist_eq (IdentDistrib.refl hX₂.aemeasurable) have C21 : H[V] = H[U] := by apply ProbabilityTheory.IdentDistrib.entropy_eq have I : IdentDistrib (⟨X₁', X₂⟩) (⟨X₁, X₂⟩) := by apply h₁.symm.prodMk (IdentDistrib.refl hX₂.aemeasurable) (h_indep.indepFun (show 3 ≠ 1 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp measurable_add have C22 : H[X₁ + X₂'] = H[X₁ + X₂] := by apply ProbabilityTheory.IdentDistrib.entropy_eq have I : IdentDistrib (⟨X₁, X₂'⟩) (⟨X₁, X₂⟩) := by apply (IdentDistrib.refl hX₁.aemeasurable).prodMk h₂.symm (h_indep.indepFun (show 0 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp measurable_add have C23 : X₂' + X₂ = X₂ + X₂' := by abel have C24 : H[X₁ | X₁ + X₂'] = H[X₁ | X₁ + X₂] := by apply IdentDistrib.condEntropy_eq hX₁ (hX₁.add hX₂') hX₁ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁, X₂'⟩) (⟨X₁, X₂⟩) := by exact (IdentDistrib.refl hX₁.aemeasurable).prodMk h₂.symm (h_indep.indepFun (show 0 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_fst.prodMk measurable_add) have C25 : H[X₂ | V] = H[X₂ | X₁ + X₂] := by apply IdentDistrib.condEntropy_eq hX₂ (hX₁'.add hX₂) hX₂ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁', X₂⟩) (⟨X₁, X₂⟩) := by exact h₁.symm.prodMk (IdentDistrib.refl hX₂.aemeasurable) (h_indep.indepFun (show 3 ≠ 1 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_snd.prodMk measurable_add) have C26 : H[X₂' | X₂' + X₁'] = H[X₂ | X₁ + X₂] := by rw [add_comm] apply IdentDistrib.condEntropy_eq hX₂' (hX₁'.add hX₂') hX₂ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁', X₂'⟩) (⟨X₁, X₂⟩) := h₁.symm.prodMk h₂.symm (h_indep.indepFun (show 3 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_snd.prodMk measurable_add) have C27 : H[X₂' | X₂ + X₂'] = H[X₂ | X₂ + X₂'] := by conv_lhs => rw [add_comm] apply IdentDistrib.condEntropy_eq hX₂' (hX₂'.add hX₂) hX₂ (hX₂.add hX₂') have I : IdentDistrib (⟨X₂', X₂⟩) (⟨X₂, X₂'⟩) := h₂.symm.prodMk h₂ (h_indep.indepFun (show 2 ≠ 1 by decide)) (h_indep.indepFun (show 1 ≠ 2 by decide)) exact I.comp (measurable_fst.prodMk measurable_add) have C28 : H[X₁' | X₁' + X₂'] = H[X₁ | X₁ + X₂] := by apply IdentDistrib.condEntropy_eq hX₁' (hX₁'.add hX₂') hX₁ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁', X₂'⟩) (⟨X₁, X₂⟩) := h₁.symm.prodMk h₂.symm (h_indep.indepFun (show 3 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_fst.prodMk measurable_add) have C29 : H[X₁' | V] = H[X₁ | X₁ + X₂] := by apply IdentDistrib.condEntropy_eq hX₁' (hX₁'.add hX₂) hX₁ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁', X₂⟩) (⟨X₁, X₂⟩) := h₁.symm.prodMk (IdentDistrib.refl hX₂.aemeasurable) (h_indep.indepFun (show 3 ≠ 1 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_fst.prodMk measurable_add) have C30 : H[X₂ | X₁ + X₂] = H[X₁ | X₁ + X₂] := by have := condEntropy_of_injective ℙ hX₁ (hX₁.add hX₂) _ (fun p ↦ add_right_injective p) convert this with ω simp [add_comm (X₁ ω), add_assoc (X₂ ω), ZModModule.add_self] simp only [C1, C2, C3, C4, C5, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30] at I1 I2 I3 I4 I5 I6 ⊢ linarith only [I1, I2, I3, I4, I5, I6] include hX₁ hX₂ hX₁' hX₂' h₁ h₂ h_indep in omit [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] in
pfr/blueprint/src/chapter/improved_exponent.tex:139
pfr/PFR/ImprovedPFR.lean:468
PFR
dist_diff_bound_2
\begin{lemma}[Bound on distance differences]\label{dist-diff-bound}\lean{dist_diff_bound_1, dist_diff_bound_2}\leanok We have \begin{align*} &\sum_{i=1}^2 \sum_{A,B \in \{U,V,W\}: A \neq B} d[X_i^0;A|B, S] - d[X_i^0;X_i]\\ &\qquad \leq 12 k + \frac{4(2 \eta k - I_1)}{1-\eta}. \end{align*} \end{lemma} \begin{proof}\uses{gen-ineq, relabeled-entropy-cond,second-estimate-aux}\leanok If we apply \Cref{gen-ineq} with $X_1:=X_1$, $Y:=X_1^0$ and $(X_2,X_3,X_4)$ equal to the $3!$ permutations of $(X_2,\tilde X_1,\tilde X_2)$, and sums (using the symmetry $\bbH[X|X+Y] = \bbH[Y|X+Y]$, which follows from \Cref{relabeled-entropy-cond}), we can bound $$ \sum_{A,B \in \{U,V,W\}: A \neq B} d[X_1^0;A|B, S] - d[X_1^0;X_1]$$ by \begin{align*} &\quad \tfrac{1}{4} (6d[X_1;X_2] + 6d[X_1;\tilde X_2]\\ &\qquad + 6d[X_1;\tilde X_1] + 2d[\tilde X_1;\tilde X_2] + 2 d[\tilde X_1;X_2] + 2d[X_2;\tilde X_2])\\ &\quad + \tfrac{1}{8} (2\bbH[X_1+X_2] + 2\bbH[X_1+\tilde X_1] + 2 \bbH[X_1+\tilde X_2] \\ &\qquad - 2\bbH[\tilde X_1+X_2] - 2\bbH[X_2+\tilde X_2] - 2\bbH[\tilde X_1+\tilde X_2])\\ &\qquad \qquad + \tfrac{1}{4} (\bbH[X_2|X_2+\tilde X_2] + \bbH[\tilde X_1|\tilde X_1+\tilde X_2] + \bbH[\tilde X_1|X_1+\tilde X_2] \\ &\qquad \qquad \qquad - \bbH[X_1|X_1+\tilde X_1] - \bbH[X_1|X_1+X_2] - \bbH[X_1|X_1+\tilde X_2]), \end{align*} which simplifies to \begin{align*} &\quad \tfrac{1}{4} (16k + 6d[X_1;X_1] + 2d[X_2;X_2])\\ &\qquad \qquad + \tfrac{1}{4} (H[X_1+\tilde X_1] - H[X_2+\tilde X_2] + d[X_2|X_2+\tilde X_2] - d[X_1|X_1+\tilde X_1]). \end{align*} A symmetric argument also bounds $$ \sum_{A,B \in \{U,V,W\}: A \neq B} d[X_2^0;A|B, S] - d[X_2^0;X_2]$$ by \begin{align*} &\quad \tfrac{1}{4} (16k + 6d[X_2;X_2] + 2d[X_1;X_1])\\ &\qquad \qquad + \tfrac{1}{4} (H[X_2+\tilde X_2] - H[X_1+\tilde X_1] + d[X_1|X_1+\tilde X_1] - d[X_2|X_2+\tilde X_2]). \end{align*} On the other hand, from \Cref{second-estimate-aux} one has $$ d[X_1;X_1] + d[X_2;X_2] \leq 2 k + \frac{2(2 \eta k - I_1)}{1-\eta}.$$ Summing the previous three estimates, we obtain the claim. \end{proof}
lemma dist_diff_bound_2 : ((d[p.X₀₂ # U | ⟨V, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # U | ⟨W, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # V | ⟨U, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # V | ⟨W, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # W | ⟨U, S⟩] - d[p.X₀₂ # X₂]) + (d[p.X₀₂ # W | ⟨V, S⟩] - d[p.X₀₂ # X₂])) ≤ (16 * k + 6 * d[X₂ # X₂] + 2 * d[X₁ # X₁]) / 4 + (H[X₂ + X₂'] - H[X₁ + X₁']) / 4 + (H[X₁ | X₁ + X₁'] - H[X₂ | X₂ + X₂']) / 4 := by have I1 := gen_ineq_01 p.X₀₂ p.hmeas2 X₂ X₁ X₂' X₁' hX₂ hX₁ hX₂' hX₁' h_indep.reindex_four_bacd have I2 := gen_ineq_00 p.X₀₂ p.hmeas2 X₂ X₁ X₁' X₂' hX₂ hX₁ hX₁' hX₂' h_indep.reindex_four_badc have I3 := gen_ineq_10 p.X₀₂ p.hmeas2 X₂ X₂' X₁ X₁' hX₂ hX₂' hX₁ hX₁' h_indep.reindex_four_bcad have I4 := gen_ineq_10 p.X₀₂ p.hmeas2 X₂ X₂' X₁' X₁ hX₂ hX₂' hX₁' hX₁ h_indep.reindex_four_bcda have I5 := gen_ineq_00 p.X₀₂ p.hmeas2 X₂ X₁' X₁ X₂' hX₂ hX₁' hX₁ hX₂' h_indep.reindex_four_bdac have I6 := gen_ineq_01 p.X₀₂ p.hmeas2 X₂ X₁' X₂' X₁ hX₂ hX₁' hX₂' hX₁ h_indep.reindex_four_bdca have C1 : X₂ + X₁ = X₁ + X₂ := by abel have C2 : X₁ + X₁' = W := by abel have C3 : U + X₂' + X₁' = S := by abel have C4 : X₂ + X₁' = V := by abel have C5 : X₂ + X₂' + X₁ + X₁' = S := by abel have C6 : X₂ + X₂' + X₁' + X₁ = S := by abel have C7 : V + X₁ + X₂' = S := by abel have C8 : V + X₂' + X₁ = S := by abel have C9 : d[X₂ # X₁] = d[X₁ # X₂] := rdist_symm have C10 : d[X₁ # X₂'] = d[X₁ # X₂] := ProbabilityTheory.IdentDistrib.rdist_eq (IdentDistrib.refl hX₁.aemeasurable) h₂.symm have C11 : d[X₂ # X₁'] = d[X₁ # X₂] := by rw [rdist_symm] exact ProbabilityTheory.IdentDistrib.rdist_eq h₁.symm (IdentDistrib.refl hX₂.aemeasurable) have C12 : d[X₂' # X₁'] = d[X₁' # X₂'] := rdist_symm have C13 : d[X₂' # X₁] = d[X₁ # X₂'] := rdist_symm have C14 : d[X₁' # X₁] = d[X₁ # X₁'] := rdist_symm have C15 : d[X₁' # X₂'] = d[X₁ # X₂] := ProbabilityTheory.IdentDistrib.rdist_eq h₁.symm h₂.symm have C16 : H[X₁' + X₂'] = H[X₁ + X₂] := by apply ProbabilityTheory.IdentDistrib.entropy_eq have I : IdentDistrib (⟨X₁, X₂⟩) (⟨X₁', X₂'⟩) := h₁.prodMk h₂ (h_indep.indepFun zero_ne_one) (h_indep.indepFun (show 3 ≠ 2 by decide)) exact I.symm.comp measurable_add have C17 : H[X₂' + X₁'] = H[X₁ + X₂] := by rw [add_comm]; exact C16 have C18 : H[X₁'] = H[X₁] := ProbabilityTheory.IdentDistrib.entropy_eq h₁.symm have C19 : H[X₂'] = H[X₂] := ProbabilityTheory.IdentDistrib.entropy_eq h₂.symm have C20 : H[X₁ + X₂'] = H[X₁ + X₂] := by apply ProbabilityTheory.IdentDistrib.entropy_eq have I : IdentDistrib (⟨X₁, X₂'⟩) (⟨X₁, X₂⟩) := (IdentDistrib.refl hX₁.aemeasurable).prodMk h₂.symm (h_indep.indepFun (show 0 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp measurable_add have C21 : H[X₁' | W] = H[X₁ | W] := by conv_rhs => rw [add_comm] apply IdentDistrib.condEntropy_eq hX₁' (hX₁'.add hX₁) hX₁ (hX₁.add hX₁') have I : IdentDistrib (⟨X₁', X₁⟩) (⟨X₁, X₁'⟩) := h₁.symm.prodMk h₁ (h_indep.indepFun (show 3 ≠ 0 by decide)) (h_indep.indepFun (show 0 ≠ 3 by decide)) exact I.comp (measurable_fst.prodMk measurable_add) have C22 : H[X₂' | X₂' + X₁] = H[X₂ | X₁ + X₂] := by rw [add_comm] apply IdentDistrib.condEntropy_eq hX₂' (hX₁.add hX₂') hX₂ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁, X₂'⟩) (⟨X₁, X₂⟩) := (IdentDistrib.refl hX₁.aemeasurable).prodMk h₂.symm (h_indep.indepFun (show 0 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_snd.prodMk measurable_add) have C23 : H[X₁ | X₁ + X₂'] = H[X₁ | X₁ + X₂] := by apply IdentDistrib.condEntropy_eq hX₁ (hX₁.add hX₂') hX₁ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁, X₂'⟩) (⟨X₁, X₂⟩) := (IdentDistrib.refl hX₁.aemeasurable).prodMk h₂.symm (h_indep.indepFun (show 0 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_fst.prodMk measurable_add) have C24 : H[X₂ | V] = H[X₂ | X₁ + X₂] := by apply IdentDistrib.condEntropy_eq hX₂ (hX₁'.add hX₂) hX₂ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁', X₂⟩) (⟨X₁, X₂⟩) := h₁.symm.prodMk (IdentDistrib.refl hX₂.aemeasurable) (h_indep.indepFun (show 3 ≠ 1 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_snd.prodMk measurable_add) have C25 : H[X₂' | X₂' + X₁'] = H[X₂ | X₁ + X₂] := by rw [add_comm] apply IdentDistrib.condEntropy_eq hX₂' (hX₁'.add hX₂') hX₂ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁', X₂'⟩) (⟨X₁, X₂⟩) := h₁.symm.prodMk h₂.symm (h_indep.indepFun (show 3 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_snd.prodMk measurable_add) have C26 : H[X₁' | X₁' + X₂'] = H[X₁ | X₁ + X₂] := by apply IdentDistrib.condEntropy_eq hX₁' (hX₁'.add hX₂') hX₁ (hX₁.add hX₂) have I : IdentDistrib (⟨X₁', X₂'⟩) (⟨X₁, X₂⟩) := h₁.symm.prodMk h₂.symm (h_indep.indepFun (show 3 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp (measurable_fst.prodMk measurable_add) have C27 : H[X₂ | X₁ + X₂] = H[X₁ | X₁ + X₂] := by have := condEntropy_of_injective ℙ hX₁ (hX₁.add hX₂) _ (fun p ↦ add_right_injective p) convert this with ω simp only [Pi.add_apply, add_comm (X₁ ω), add_assoc (X₂ ω), ZModModule.add_self, add_zero] have C28 : H[V] = H[U] := by apply ProbabilityTheory.IdentDistrib.entropy_eq have I : IdentDistrib (⟨X₁', X₂⟩) (⟨X₁, X₂⟩) := h₁.symm.prodMk (IdentDistrib.refl hX₂.aemeasurable) (h_indep.indepFun (show 3 ≠ 1 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp measurable_add have C29 : H[X₂' + X₁] = H[X₁ + X₂] := by rw [add_comm] apply ProbabilityTheory.IdentDistrib.entropy_eq have I : IdentDistrib (⟨X₁, X₂'⟩) (⟨X₁, X₂⟩) := (IdentDistrib.refl hX₁.aemeasurable).prodMk h₂.symm (h_indep.indepFun (show 0 ≠ 2 by decide)) (h_indep.indepFun zero_ne_one) exact I.comp measurable_add have C30 : d[X₁ # X₁'] = d[X₁ # X₁] := ProbabilityTheory.IdentDistrib.rdist_eq (IdentDistrib.refl hX₁.aemeasurable) h₁.symm have C31 : d[X₂ # X₂'] = d[X₂ # X₂] := ProbabilityTheory.IdentDistrib.rdist_eq (IdentDistrib.refl hX₂.aemeasurable) h₂.symm simp only [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C25, C26, C27, C28, C29, C30, C31] at I1 I2 I3 I4 I5 I6 ⊢ linarith only [I1, I2, I3, I4, I5, I6] include hX₁ hX₂ hX₁' hX₂' h₁ h₂ h_indep h_min in
pfr/blueprint/src/chapter/improved_exponent.tex:139
pfr/PFR/ImprovedPFR.lean:561
PFR
dist_le_of_sum_zero
\begin{lemma}\label{rho-BSG-triplet}\lean{dist_le_of_sum_zero}\leanok If $G$-valued random variables $T_1,T_2,T_3$ satisfy $T_1+T_2+T_3=0$, then $$d[X_1;X_2]\le 3\bbI[T_1:T_2] + (2\bbH[T_3]-\bbH[T_1]-\bbH[T_2])+ \eta(\rho(T_1|T_3)+\rho(T_2|T_3)-\rho(X_1)-\rho(X_2)).$$ \end{lemma} \begin{proof}\leanok\uses{entropic-bsg,phi-min-def} Conditioned on every $T_3=t$, $d[X_1;X_2]\le d[T_1|T_3=t;T_2|T_3=t]+\eta(\rho(T_1|T_3=t)+\rho(T_2|T_3=t)-\rho(X_1)-\rho(X_2))$ by \Cref{phi-min-def}. Then take the weighted average with weight $\mathbf{P}(T_3=t)$ and then apply \Cref{entropic-bsg} to bound the RHS. \end{proof}
lemma dist_le_of_sum_zero {Ω' : Type*} [MeasurableSpace Ω'] {μ : Measure Ω'} [IsProbabilityMeasure μ] {T₁ T₂ T₃ : Ω' → G} (hsum : T₁ + T₂ + T₃ = 0) (hT₁ : Measurable T₁) (hT₂ : Measurable T₂) (hT₃ : Measurable T₃) : k ≤ 3 * I[T₁ : T₂ ; μ] + (2 * H[T₃ ; μ] - H[T₁ ; μ] - H[T₂ ; μ]) + η * (ρ[T₁ | T₃ ; μ # A] + ρ[T₂ | T₃ ; μ # A] - ρ[X₁ # A] - ρ[X₂ # A]) := by let _ : MeasureSpace Ω' := ⟨μ⟩ have : μ = ℙ := rfl simp only [this] have : ∑ t, (ℙ (T₃ ⁻¹' {t})).toReal * d[ X₁ # X₂ ] ≤ ∑ t, (ℙ (T₃ ⁻¹' {t})).toReal * (d[T₁ ; ℙ[|T₃ ← t] # T₂ ; ℙ[|T₃ ← t]] + η * (ρ[T₁ ; ℙ[|T₃ ← t] # A] - ρ[X₁ # A]) + η * (ρ[T₂ ; ℙ[|T₃ ← t] # A] - ρ[X₂ # A])) := by apply Finset.sum_le_sum (fun t ht ↦ ?_) rcases eq_or_ne (ℙ (T₃ ⁻¹' {t})) 0 with h't | h't · simp [h't] have : IsProbabilityMeasure (ℙ[|T₃ ← t]) := cond_isProbabilityMeasure h't gcongr exact le_rdist_of_phiMinimizes' h_min hT₁ hT₂ have : k ≤ ∑ x : G, (ℙ (T₃ ⁻¹' {x})).toReal * d[T₁ ; ℙ[|T₃ ← x] # T₂ ; ℙ[|T₃ ← x]] + η * (ρ[T₁ | T₃ # A] - ρ[X₁ # A]) + η * (ρ[T₂ | T₃ # A] - ρ[X₂ # A]) := by have S : ∑ i : G, (ℙ (T₃ ⁻¹' {i})).toReal = 1 := by have : IsProbabilityMeasure (Measure.map T₃ ℙ) := isProbabilityMeasure_map hT₃.aemeasurable simp [← Measure.map_apply hT₃ (measurableSet_singleton _)] simp_rw [← Finset.sum_mul, S, mul_add, Finset.sum_add_distrib, ← mul_assoc, mul_comm _ η, mul_assoc, ← Finset.mul_sum, mul_sub, Finset.sum_sub_distrib, mul_sub, ← Finset.sum_mul, S] at this simpa [mul_sub, condRho, tsum_fintype] using this have J : ∑ x : G, (ℙ (T₃ ⁻¹' {x})).toReal * d[T₁ ; ℙ[|T₃ ← x] # T₂ ; ℙ[|T₃ ← x]] ≤ 3 * I[T₁ : T₂] + 2 * H[T₃] - H[T₁] - H[T₂] := by have h2T₃ : T₃ = T₁ + T₂ := calc T₃ = T₁ + T₂ + T₃ - T₃ := by rw [hsum, _root_.zero_sub]; simp [ZModModule.neg_eq_self] _ = T₁ + T₂ := by rw [add_sub_cancel_right] subst h2T₃ have := ent_bsg hT₁ hT₂ (μ := ℙ) simp_rw [integral_fintype _ Integrable.of_finite, Measure.map_apply hT₃ (measurableSet_singleton _)] at this exact this linarith include h_min in omit [IsProbabilityMeasure (ℙ : Measure Ω)] in /-- If $G$-valued random variables $T_1,T_2,T_3$ satisfy $T_1+T_2+T_3=0$, then $$d[X_1;X_2]\le 3\bbI[T_1:T_2\mid T_3] + (2\bbH[T_3]-\bbH[T_1]-\bbH[T_2])+ \eta(\rho(T_1|T_3)+\rho(T_2|T_3)-\rho(X_1)-\rho(X_2)).$$ -/
pfr/blueprint/src/chapter/further_improvement.tex:257
pfr/PFR/RhoFunctional.lean:1455
PFR
dist_le_of_sum_zero'
\begin{lemma}\label{rho-BSG-triplet-symmetrized}\lean{dist_le_of_sum_zero'}\leanok If $G$-valued random variables $T_1,T_2,T_3$ satisfy $T_1+T_2+T_3=0$, then $$d[X_1;X_2] \leq \sum_{1 \leq i<j \leq 3} \bbI[T_i:T_j] + \frac{\eta}{3} \sum_{1 \leq i<j \leq 3} (\rho(T_i|T_j) + \rho(T_j|T_i) -\rho(X_1)-\rho(X_2))$$ \end{lemma} \begin{proof}\leanok\uses{rho-BSG-triplet} Take the average of \Cref{rho-BSG-triplet} over all $6$ permutations of $T_1,T_2,T_3$. \end{proof}
lemma dist_le_of_sum_zero' {Ω' : Type*} [MeasureSpace Ω'] [IsProbabilityMeasure (ℙ : Measure Ω')] {T₁ T₂ T₃ : Ω' → G} (hsum : T₁ + T₂ + T₃ = 0) (hT₁ : Measurable T₁) (hT₂ : Measurable T₂) (hT₃ : Measurable T₃) : k ≤ I[T₁ : T₂] + I[T₁ : T₃] + I[T₂ : T₃] + (η / 3) * ((ρ[T₁ | T₂ # A] + ρ[T₂ | T₁ # A] - ρ[X₁ # A] - ρ[X₂ # A]) + (ρ[T₁ | T₃ # A] + ρ[T₃ | T₁ # A] - ρ[X₁ # A] - ρ[X₂ # A]) + (ρ[T₂ | T₃ # A] + ρ[T₃ | T₂ # A] - ρ[X₁ # A] - ρ[X₂ # A])) := by have := dist_le_of_sum_zero h_min hsum hT₁ hT₂ hT₃ (μ := ℙ) have : T₁ + T₃ + T₂ = 0 := by convert hsum using 1; abel have := dist_le_of_sum_zero h_min this hT₁ hT₃ hT₂ (μ := ℙ) have : T₂ + T₃ + T₁ = 0 := by convert hsum using 1; abel have := dist_le_of_sum_zero h_min this hT₂ hT₃ hT₁ (μ := ℙ) linarith include h_min in omit [IsProbabilityMeasure (ℙ : Measure Ω)] in /-- If $G$-valued random variables $T_1,T_2,T_3$ satisfy $T_1+T_2+T_3=0$, then $$d[X_1;X_2] \leq \sum_{1 \leq i < j \leq 3} \bbI[T_i:T_j] + \frac{\eta}{3} \sum_{1 \leq i < j \leq 3} (\rho(T_i|T_j) + \rho(T_j|T_i) -\rho(X_1)-\rho(X_2))$$ -/
pfr/blueprint/src/chapter/further_improvement.tex:266
pfr/PFR/RhoFunctional.lean:1527
PFR
dist_of_U_add_le
\begin{lemma}[Application of BSG] \label{lem:get-better}\lean{dist_of_U_add_le}\leanok Let $G$ be an abelian group, let $(T_1,T_2,T_3)$ be a $G^3$-valued random variable such that $T_1+T_2+T_3=0$ holds identically, and write \[ \delta := \bbI[T_1 : T_2] + \bbI[T_1 : T_3] + \bbI[T_2 : T_3]. \] Let $Y_1,\dots,Y_n$ be some further $G$-valued random variables and let $\alpha>0$ be a constant. Then there exists a random variable $U$ such that \begin{equation} \label{eq:get-better} d[U;U] + \alpha \sum_{i=1}^n d[Y_i;U] \leq \Bigl(2 + \frac{\alpha n}{2} \Bigr) \delta + \alpha \sum_{i=1}^n d[Y_i;T_2]. \end{equation} \end{lemma} \begin{proof}\uses{entropic-bsg, relabeled-entropy, first-useful} We apply \Cref{entropic-bsg} with $X=T_1$ and $Y=T_2$. Since $T_1+T_2=-T_3$, we find that \begin{align}\nonumber \sum_{z} p_{T_3}(z) & d[T_1 \,|\, T_3 \mathop{=} z;T_2 \,|\, T_3 \mathop{=} z] \\ \nonumber &\leq 3 \bbI[T_1 : T_2] + 2 \bbH[T_3] - \bbH[T_1] - \bbH[T_2] \\ &\ = \bbI[T_1 : T_2] + \bbI[T_1 : T_3] + \bbI[T_2 : T_3] = \delta,\label{514a} \end{align} where the last line follows from \Cref{relabeled-entropy} by observing \[ \bbH[T_1,T_2] = \bbH[T_1,T_3] = \bbH[T_2,T_3] = \bbH[T_1,T_2,T_3] \] since any two of $T_1,T_2,T_3$ determine the third. By~\eqref{514a} and the triangle inequality, \[ \sum_z p_{T_3}(z) d[T_2 \,|\, T_3 \mathop{=} z; T_2 \,|\, T_3\mathop{=}z] \leq 2 \delta \] and by \Cref{first-useful}, for each $Y_i$, \begin{align*} &\sum_z p_{T_3}(z) d[Y_i; T_2 \,|\, T_3 \mathop{=} z] \\ &\qquad= d[Y_i; T_2 \,|\, T_3] \leq d[Y_i;T_2] + \frac12 \bbI[T_2 : T_3] \leq d[Y_i;T_2] + \frac{\delta}{2}. \end{align*} Hence, \begin{align*} &\sum_z p_{T_3}(z) \bigg( d[T_2 \,|\, T_3 \mathop{=} z; T_2 \,|\, T_3 \mathop{=} z] + \alpha \sum_{i=1}^n d[Y_i;T_2 \,|\, T_3 \mathop{=} z] \bigg) \\ &\qquad \leq \Bigl(2 + \frac{\alpha n}{2} \Bigr) \delta + \alpha \sum_{i=1}^n d[Y_i; T_2], \end{align*} and the result follows by setting $U=(T_2 \,|\, T_3 \mathop{=} z)$ for some $z$ such that the quantity in parentheses on the left-hand side is at most the weighted average value. \end{proof}
lemma dist_of_U_add_le {G: Type*} [MeasureableFinGroup G] {Ω: Type*} [MeasureSpace Ω] (T₁ T₂ T₃ : Ω → G) (hsum: T₁ + T₂ + T₃ = 0) (n:ℕ) {Ω': Fin n → Type*} (hΩ': ∀ i, MeasureSpace (Ω' i)) (Y: ∀ i, (Ω' i) → G) {α:ℝ} (hα: α > 0): ∃ (Ω'':Type*) (hΩ'': MeasureSpace Ω'') (U: Ω'' → G), d[U # U] + α * ∑ i, d[Y i # U] ≤ (2 + α * n / 2) * (I[T₁ : T₂] + I[T₁ : T₃] + I[T₂ : T₃]) + α * ∑ i, d[Y i # T₂] := sorry
pfr/blueprint/src/chapter/torsion.tex:754
pfr/PFR/TorsionEndgame.lean:79
PFR
dist_of_X_U_H_le
\begin{theorem}[Entropy form of PFR]\label{main-entropy}\lean{dist_of_X_U_H_le}\leanok Suppose that $G$ is a finite abelian group of torsion $m$. Suppose that $X$ is a $G$-valued random variable. Then there exists a subgroup $H \leq G$ such that \[ d[X;U_H] \leq 64 m^3 d[X;X].\] \end{theorem} \begin{proof}\uses{k-vanish, ruzsa-triangle, tau-def, multi-zero, eta-def-multi, tau-ref, tau-min-exist-multi} Set $X^0 := X$. By \Cref{tau-min-exist-multi}, there exists a $\tau$-minimizer $X_{[m]} = (X_i)_{1 \leq i \leq m}$. By \Cref{k-vanish}, we have $D[X_{[m]}]=0$. By \Cref{tau-ref} and the pigeonhole principle, there exists $1 \leq i \leq m$ such that $d[X_i; X] \leq \frac{2}{\eta} d[X;X]$. By \Cref{multi-zero}, we have $d[X_i;U_H]=0$ for some subgroup $H \leq G$, hence by \Cref{ruzsa-triangle} we have $d[U_H; X] \leq \frac{2}{\eta} d[X;X]$. The claim then follows from \Cref{eta-def-multi}. \end{proof}
/-- Suppose that $G$ is a finite abelian group of torsion $m$. Suppose that $X$ is a $G$-valued random variable. Then there exists a subgroup $H \leq G$ such that \[ d[X;U_H] \leq 64 m^3 d[X;X].\] -/ lemma dist_of_X_U_H_le {G : Type*} [AddCommGroup G] [Fintype G] [MeasurableSpace G] [MeasurableSingletonClass G] (m:ℕ) (hm: m ≥ 2) (htorsion: ∀ x:G, m • x = 0) (Ω: Type*) [MeasureSpace Ω] (X: Ω → G): ∃ H : AddSubgroup G, ∃ Ω' : Type*, ∃ mΩ : MeasureSpace Ω', ∃ U : Ω' → G, IsUniform H U ∧ d[X # U] ≤ 64 * m^3 * d[X # X] := sorry /-- Suppose that $G$ is a finite abelian group of torsion $m$. If $A \subset G$ is non-empty and $|A+A| \leq K|A|$, then $A$ can be covered by at most $K ^ {(64m^3+2)/2}|A|^{1/2}/|H|^{1/2}$ translates of a subspace $H$ of $G$ with $|H|/|A| \in [K^{-64m^3}, K^{64m^3}]$ -/
pfr/blueprint/src/chapter/torsion.tex:857
pfr/PFR/TorsionEndgame.lean:86
PFR
dist_of_min_eq_zero
\begin{proposition}\label{phi-minimizer-zero-distance}\lean{dist_of_min_eq_zero}\leanok If $X_1,X_2$ is a $\phi$-minimizer, then $d[X_1;X_2] = 0$. \end{proposition} \begin{proof}\leanok \uses{rho-BSG-triplet-symmetrized,rho-increase-symmetrized,I1-I2-diff,phi-first-estimate,phi-second-estimate} Consider $T_1:=X_1+X_2,T_2:=X_1+\tilde X_1, T_3:=\tilde X_1 + X_2$, and $S=X_1+X_2+\tilde X_1 + \tilde X_2$. Note that $T_1+T_2+T_3=0$. First apply \Cref{rho-BSG-triplet-symmetrized} on $(T_1,T_2,T_3)$ when conditioned on $S$ to get \begin{align} \label{eq:further-bsg} d[X_1;X_2] &\leq \sum_{1 \leq i<j \leq 3} \bbI[T_i:T_j\mid S] + \frac{\eta}{3} \sum_{1 \leq i<j \leq 3} (\rho(T_i|T_j,S) + \rho(T_j|T_i,S) -\rho(X_1)-\rho(X_2))\nonumber\\ &= (I_1+2I_2) + \frac{\eta}{3} \sum_{1 \leq i<j \leq 3} (\rho(T_i|T_j,S) + \rho(T_j|T_i,S) -\rho(X_1)-\rho(X_2)). \end{align} Then apply \Cref{rho-increase-symmetrized} on $(X_1,X_2,\tilde X_1,\tilde X_2)$ and get $$\sum_{1 \leq i<j \leq 3} (\rho(T_i|T_j,S) + \rho(T_j|T_i,S) - \rho(X_1)-\rho(X_2))\le (4d[X_1;X_2]+d[X_1;X_2]+d[X_2;X_2])= 6 d[X_1;X_2]+(I_2-I_1)$$ by \Cref{I1-I2-diff}. Plug in the inequality above to (\ref{eq:further-bsg}), we get $$d[X_1;X_2] \le (I_1+2I_2)+2\eta d[X_1;X_2]+\frac{\eta}{3}(I_2-I_1).$$ By \Cref{phi-second-estimate} we can conclude that $$d[X_1;X_2] \le 8\eta d[X_1;X_2]-\frac{3-10\eta}{3-3\eta} (2\eta d[X_1;X_2]-I_1).$$ Finally by \Cref{phi-first-estimate} and $\eta<1$ we get that the second term is $\le 0$, and thus $d[X_1;X_2] \le 8\eta d[X_1;X_2]$. By the choice $\eta<1/8$ and the non-negativity of $d$ we have $d[X_1;X_2]=0$. \end{proof}
theorem dist_of_min_eq_zero (hA : A.Nonempty) (hη' : η < 1/8) : d[X₁ # X₂] = 0 := by let ⟨Ω', m', μ, Y₁, Y₂, Y₁', Y₂', hμ, h_indep, hY₁, hY₂, hY₁', hY₂', h_id1, h_id2, h_id1', h_id2'⟩ := independent_copies4_nondep hX₁ hX₂ hX₁ hX₂ ℙ ℙ ℙ ℙ rw [← h_id1.rdist_eq h_id2] let _ : MeasureSpace Ω' := ⟨μ⟩ have : IsProbabilityMeasure (ℙ : Measure Ω') := hμ have h'_min : phiMinimizes Y₁ Y₂ η A ℙ := phiMinimizes_of_identDistrib h_min h_id1.symm h_id2.symm exact dist_of_min_eq_zero' hη h'_min (h_id1.trans h_id1'.symm) (h_id2.trans h_id2'.symm) h_indep hY₁ hY₂ hY₁' hY₂' hA hη' open Filter open scoped Topology /-- For `η ≤ 1/8`, there exist phi-minimizers `X₁, X₂` at zero Rusza distance. For `η < 1/8`, all minimizers are fine, by `dist_of_min_eq_zero`. For `η = 1/8`, we use a limit of minimizers for `η < 1/8`, which exists by compactness. -/
pfr/blueprint/src/chapter/further_improvement.tex:315
pfr/PFR/RhoFunctional.lean:1860
PFR
distance_ge_of_min
\begin{lemma}[Distance lower bound]\label{distance-lower} \uses{tau-min-def}\leanok \lean{distance_ge_of_min} For any $G$-valued random variables $X'_1,X'_2$, one has $$ d[X'_1;X'_2] \geq k - \eta (d[X^0_1;X'_1] - d[X^0_1;X_1] ) - \eta (d[X^0_2;X'_2] - d[X^0_2;X_2] ).$$ \end{lemma} \begin{proof} \uses{tau-def, tau-min}\leanok Immediate from \Cref{tau-def} and \Cref{tau-min}. \end{proof}
lemma distance_ge_of_min (h : tau_minimizes p X₁ X₂) (h1 : Measurable X₁') (h2 : Measurable X₂') : d[X₁ # X₂] - p.η * (d[p.X₀₁ # X₁'] - d[p.X₀₁ # X₁]) - p.η * (d[p.X₀₂ # X₂'] - d[p.X₀₂ # X₂]) ≤ d[X₁' # X₂'] := by have Z := is_tau_min p h h1 h2 simp [tau] at Z linarith omit [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] [Fintype G] [IsProbabilityMeasure (ℙ : Measure Ω)] in
pfr/blueprint/src/chapter/entropy_pfr.tex:48
pfr/PFR/TauFunctional.lean:181
PFR
ent_bsg
\begin{lemma}[Balog-Szemer\'edi-Gowers]\label{entropic-bsg} \lean{ent_bsg}\leanok Let $A,B$ be $G$-valued random variables on $\Omega$, and set $Z := A+B$. Then \begin{equation}\label{2-bsg-takeaway} \sum_{z} \bbP[Z=z] d[(A | Z = z); (B | Z = z)] \leq 3 \bbI[A:B] + 2 \bbH[Z] - \bbH[A] - \bbH[B]. \end{equation} \end{lemma} \begin{proof} \uses{cond-indep-exist, cond-trial-ent, conditional-entropy-def,submodularity, copy-ent, relabeled-entropy, add-entropy, ruz-indep} \leanok Let $(A_1, B_1)$ and $(A_2, B_2)$ (and $Z'$, which by abuse of notation we call $Z$) be conditionally independent trials of $(A,B)$ relative to $Z$ as produced by \Cref{cond-indep-exist}, thus $(A_1,B_1)$ and $(A_2,B_2)$ are coupled through the random variable $A_1 + B_1 = A_2 + B_2$, which by abuse of notation we shall also call $Z$. Observe from \Cref{ruz-indep} that the left-hand side of~\eqref{2-bsg-takeaway} is \begin{equation}\label{lhs-to-bound} \bbH[A_1 - B_2| Z] - \bbH[A_1 | Z]/2 - \bbH[B_2 | Z]/2. \end{equation} since, crucially, $(A_1 | Z=z)$ and $(B_2 | Z=z)$ are independent for all $z$. Applying submodularity (\Cref{alt-submodularity}) gives \begin{equation}\label{bsg-31} \begin{split} &\bbH[A_1 - B_2] + \bbH[A_1 - B_2, A_1, B_1] \\ &\qquad \leq \bbH[A_1 - B_2, A_1] + \bbH[A_1 - B_2,B_1]. \end{split}\end{equation} We estimate the second, third and fourth terms appearing here. First note that, by \Cref{cond-trial-ent} and \Cref{relabeled-entropy} (noting that the tuple $(A_1 - B_2, A_1, B_1)$ determines the tuple $(A_1, A_2, B_1, B_2)$ since $A_1+B_1=A_2+B_2$) \begin{equation}\label{bsg-24} \bbH[A_1 - B_2, A_1, B_1] = \bbH[A_1, B_1, A_2, B_2,Z] = 2\bbH[A,B] - \bbH[Z].\end{equation} Next observe that \begin{equation}\label{bsg-23} \bbH[A_1 - B_2, A_1] = \bbH[A_1, B_2] \leq \bbH[A] + \bbH[B]. \end{equation} Finally, we have \begin{equation}\label{bsg-25} \bbH[A_1 - B_2, B_1] = \bbH[A_2 - B_1, B_1] = \bbH[A_2, B_1] \leq \bbH[A] + \bbH[B].\end{equation} Substituting~\eqref{bsg-24},~\eqref{bsg-23} and~\eqref{bsg-25} into~\eqref{bsg-31} yields \[\bbH[A_1 - B_2] \leq 2 \bbI[A:B] + \bbH[Z]\] and so by \Cref{cond-reduce} \[\bbH[A_1 - B_2 | Z] \leq 2 \bbI[A:B] + \bbH[Z].\] Since \begin{align*} \bbH[A_1 | Z] & = \bbH[A_1, A_1 + B_1] - \bbH[Z] \\ & = \bbH[A,B] - \bbH[Z] \\ & = \bbH[Z] - \bbI[A:B] - 2 \bbH[Z]- \bbH[A]-\bbH[B]\end{align*} and similarly for $\bbH[B_2 | Z]$, we see that~\eqref{lhs-to-bound} is bounded by $3 \bbI[A:B] + 2\bbH[Z]-\bbH[A]-\bbH[B]$ as claimed. \end{proof}
lemma ent_bsg [IsProbabilityMeasure μ] {A B : Ω → G} (hA : Measurable A) (hB : Measurable B) [Fintype G] : (μ.map (A + B))[fun z ↦ d[A ; μ[|(A + B) ⁻¹' {z}] # B ; μ[|(A + B) ⁻¹' {z}]]] ≤ 3 * I[A : B; μ] + 2 * H[A + B ; μ] - H[A ; μ] - H[B ; μ] := by let Z := A + B have hZ : Measurable Z := hA.add hB obtain ⟨Ω', _, AB₁, AB₂, Z', ν, _, hAB₁, hAB₂, hZ', hABZ, hABZ₁, hABZ₂, hZ₁, hZ₂⟩ := condIndep_copies' (⟨A, B⟩) Z (hA.prodMk hB) hZ μ (fun (a, b) c ↦ c = a + b) .of_discrete (Eventually.of_forall fun _ ↦ rfl) let A₁ := fun ω ↦ (AB₁ ω).1 let B₁ := fun ω ↦ (AB₁ ω).2 let A₂ := fun ω ↦ (AB₂ ω).1 let B₂ := fun ω ↦ (AB₂ ω).2 replace hZ₁ : Z' = A₁ + B₁ := funext hZ₁ replace hZ₂ : Z' = A₂ + B₂ := funext hZ₂ have hA₁ : Measurable A₁ := hAB₁.fst have hB₁ : Measurable B₁ := hAB₁.snd have hA₂ : Measurable A₂ := hAB₂.fst have hB₂ : Measurable B₂ := hAB₂.snd have hZZ' : IdentDistrib Z' Z ν μ := hABZ₁.comp measurable_snd have := calc H[⟨A₁, ⟨B₁, A₁ - B₂⟩⟩ ; ν] = H[⟨⟨A₁, B₁⟩, ⟨⟨A₂, B₂⟩, Z'⟩⟩ ; ν] := entropy_of_comp_eq_of_comp _ (hA₁.prodMk $ hB₁.prodMk $ hA₁.sub hB₂) (hAB₁.prodMk $ hAB₂.prodMk hZ') (fun (a, b, c) ↦ ((a, b), (b + c, a - c), a + b)) (fun ((a, b), (_c, d), _e) ↦ (a, b, a - d)) (by funext; simpa [sub_add_eq_add_sub, Prod.ext_iff, ← hZ₁, hZ₂, two_nsmul, ← add_sub_assoc, add_comm, eq_sub_iff_add_eq] using congr_fun (hZ₂.symm.trans hZ₁) _) rfl _ = H[⟨⟨A₁, B₁⟩, Z'⟩ ; ν] + H[⟨⟨A₂, B₂⟩, Z'⟩ ; ν] - H[Z' ; ν] := ent_of_cond_indep _ hAB₁ hAB₂ hZ' hABZ _ = 2 * H[⟨⟨A, B⟩, Z⟩ ; μ] - H[Z ; μ] := by rw [two_mul] congr 1 congr 1 <;> exact IdentDistrib.entropy_eq ‹_› exact hZZ'.entropy_eq _ = 2 * H[⟨A, B⟩ ; μ] - H[Z ; μ] := by congr 2 exact entropy_prod_comp (hA.prodMk hB) _ fun x ↦ x.1 + x.2 have := calc H[⟨A₁, A₁ - B₂⟩ ; ν] = H[⟨A₁, B₂⟩ ; ν] := entropy_sub_right hA₁ hB₂ _ _ ≤ H[A₁ ; ν] + H[B₂ ; ν] := entropy_pair_le_add hA₁ hB₂ _ _ = H[A ; μ] + H[B ; μ] := by congr 1 exact (hABZ₁.comp measurable_fst.fst).entropy_eq exact (hABZ₂.comp measurable_fst.snd).entropy_eq have := calc H[⟨B₁, A₁ - B₂⟩ ; ν] = H[⟨A₂, B₁⟩ ; ν] := by rw [entropy_comm hB₁ (show Measurable (A₁ - B₂) from hA₁.sub hB₂), ← entropy_sub_left' hA₂ hB₁, sub_eq_sub_iff_add_eq_add.2 $ hZ₁.symm.trans hZ₂] _ ≤ H[A₂ ; ν] + H[B₁ ; ν] := entropy_pair_le_add hA₂ hB₁ _ _ = H[A ; μ] + H[B ; μ] := by congr 1 exact (hABZ₂.comp measurable_fst.fst).entropy_eq exact (hABZ₁.comp measurable_fst.snd).entropy_eq have := calc _ ≤ _ := entropy_triple_add_entropy_le ν hA₁ hB₁ (show Measurable (A₁ - B₂) from hA₁.sub hB₂) _ ≤ _ := add_le_add ‹_› ‹_› have := calc H[A₁ - B₂ | Z' ; ν] ≤ H[A₁ - B₂ ; ν] := condEntropy_le_entropy _ (hA₁.sub hB₂) hZ' _ ≤ _ := le_sub_iff_add_le'.2 ‹_› _ = 2 * I[A : B ; μ] + H[Z ; μ] := by rw [‹H[⟨A₁, ⟨B₁, A₁ - B₂⟩⟩ ; ν] = _›, mutualInfo_def]; ring have hA₁Z := calc H[A₁ | Z' ; ν] _ = H[⟨A₁, B₁⟩ ; ν] - H[Z' ; ν] := by rw [chain_rule'', hZ₁, entropy_add_right, entropy_comm] <;> assumption _ = H[⟨A, B⟩ ; μ] - H[Z ; μ] := by congr 1 exact (hABZ₁.comp measurable_fst).entropy_eq exact hZZ'.entropy_eq _ = H[A ; μ] + H[B ; μ] - I[A : B ; μ] - H[Z ; μ] := by rw [← entropy_add_entropy_sub_mutualInfo] have hB₂Z := calc H[B₂ | Z' ; ν] _ = H[⟨A₂, B₂⟩ ; ν] - H[Z' ; ν] := by rw [chain_rule'', hZ₂, entropy_add_right', entropy_comm] <;> assumption _ = H[⟨A, B⟩ ; μ] - H[Z ; μ] := by congr 1 exact (hABZ₂.comp measurable_fst).entropy_eq exact hZZ'.entropy_eq _ = H[A ; μ] + H[B ; μ] - I[A : B ; μ] - H[Z ; μ] := by rw [← entropy_add_entropy_sub_mutualInfo] calc (μ.map Z)[fun z ↦ d[A ; μ[|Z ← z] # B ; μ[|Z ← z]]] = (ν.map Z')[fun z ↦ d[A₁ ; ν[|Z' ← z] # B₂ ; ν[|Z' ← z]]] := by rw [hZZ'.map_eq] refine integral_congr_ae $ Eventually.of_forall fun z ↦ ?_ have hAA₁ : IdentDistrib A₁ A (ν[|Z' ← z]) (μ[|Z ← z]) := (hABZ₁.comp $ measurable_fst.fst.prodMk measurable_snd).cond (.singleton z) hZ' hZ have hBB₂ : IdentDistrib B₂ B (ν[|Z' ← z]) (μ[|Z ← z]) := (hABZ₂.comp $ measurable_fst.snd.prodMk measurable_snd).cond .of_discrete hZ' hZ dsimp (config := {zeta := false}) [rdist] rw [← hAA₁.entropy_eq, ← hBB₂.entropy_eq, hAA₁.map_eq, hBB₂.map_eq] _ = (ν.map Z')[fun z ↦ H[A₁ - B₂ ; ν[|Z' ← z]] - H[A₁ ; ν[|Z' ← z]]/2 - H[B₂ ; ν[|Z' ← z]]/2] := by apply integral_congr_ae apply hABZ.mono intro z hz exact (hz.comp measurable_fst measurable_snd).rdist_eq hA₁ hB₂ _ = H[A₁ - B₂ | Z' ; ν] - H[A₁ | Z' ; ν] / 2 - H[B₂ | Z' ; ν] / 2 := by rw [integral_sub, integral_sub, integral_div, integral_div] rfl all_goals exact .of_finite _ ≤ 2 * I[A : B ; μ] + H[Z ; μ] - H[A₁ | Z' ; ν] / 2 - H[B₂ | Z' ; ν] / 2 := sub_le_sub_right (sub_le_sub_right ‹_› _) _ _ = _ := by rw [hA₁Z, hB₂Z]; ring end BalogSzemerediGowers variable (μ μ') in /-- Suppose that $(X, Z)$ and $(Y, W)$ are random variables, where $X, Y$ take values in an abelian group. Then $$d[X | Z ; Y | W] \leq d[X ; Y] + \tfrac{1}{2} I[X : Z] + \tfrac{1}{2} I[Y : W]$$ -/
pfr/blueprint/src/chapter/distance.tex:261
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1165
PFR
ent_of_proj_le
\begin{lemma}[Projection entropy and distance]\label{dist-projection}\lean{ent_of_proj_le}\leanok If $G$ is an additive group and $X$ is a $G$-valued random variable and $H\leq G$ is a finite subgroup then, with $\pi:G\to G/H$ the natural homomorphism we have (where $U_H$ is uniform on $H$) \[\mathbb{H}(\pi(X))\leq 2d[X;U_H].\] \end{lemma} \begin{proof} \uses{independent-exist, ruzsa-diff, chain-rule, shear-ent, submodularity, jensen-bound}\leanok WLOG, we make $X$, $U_H$ independent (\Cref{independent-exist}). Now by Lemmas \ref{submodularity}, \ref{shear-ent}, \ref{jensen-bound} \begin{align*} &\mathbb{H}(X-U_H|\pi(X)) \geq \mathbb{H}(X-U_H|X) &= \mathbb{H}(U_H) \\ &\mathbb{H}(X-U_H|\pi(X)) \leq \log |H| &= \mathbb{H}(U_H) \end{align*} By \Cref{chain-rule} \[\mathbb{H}(X-U_H)=\mathbb{H}(\pi(X))+\mathbb{H}(X-U_H|\pi(X))=\mathbb{H}(\pi(X))+\mathbb{H}(U_H)\] and therefore \[d[X;U_H]=\mathbb{H}(\pi(X))+\frac{\mathbb{H}(U_H)-\mathbb{H}(X)}{2}.\] Furthermore by \Cref{ruzsa-diff} \[d[X;U_H]\geq \frac{\lvert \mathbb{H}(X)-\mathbb{H}(U_H)\rvert}{2}.\] Adding these inequalities gives the result. \end{proof}
lemma ent_of_proj_le {UH: Ω' → G} [FiniteRange UH] [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] (hX : Measurable X) (hU : Measurable UH) {H : AddSubgroup G} (hH : Set.Finite (H : Set G)) -- TODO: infer from [FiniteRange UH]? (hunif : IsUniform H UH μ') : H[(QuotientAddGroup.mk' H) ∘ X; μ] ≤ 2 * d[X; μ # UH ; μ'] := by obtain ⟨ν, X', UH', hν, hX', hUH', h_ind, h_id_X', h_id_UH', _, _⟩ := independent_copies_finiteRange hX hU μ μ' replace hunif : IsUniform H UH' ν := IsUniform.of_identDistrib hunif h_id_UH'.symm .of_discrete rewrite [← (h_id_X'.comp (by fun_prop)).entropy_eq, ← h_id_X'.rdist_eq h_id_UH'] let π := ⇑(QuotientAddGroup.mk' H) let νq := Measure.map (π ∘ X') ν have : Countable (HasQuotient.Quotient G H) := Quotient.countable have : MeasurableSingletonClass (HasQuotient.Quotient G H) := { measurableSet_singleton := fun _ ↦ measurableSet_quotient.mpr .of_discrete } have : Finite H := hH have : H[X' - UH' | π ∘ X' ; ν] = H[UH' ; ν] := by have h_meas_le : ∀ y ∈ FiniteRange.toFinset (π ∘ X'), (νq {y}).toReal * H[X' - UH' | (π ∘ X') ← y ; ν] ≤ (νq {y}).toReal * H[UH' ; ν] := by intro x _ refine mul_le_mul_of_nonneg_left ?_ ENNReal.toReal_nonneg let ν' := ν[|π ∘ X' ← x] let π' := QuotientAddGroup.mk (s := H) have h_card : Nat.card (π' ⁻¹' {x}) = Nat.card H := Nat.card_congr <| (QuotientAddGroup.preimageMkEquivAddSubgroupProdSet H _).trans <| Equiv.prodUnique H _ have : Finite (π' ⁻¹' {x}) := Nat.finite_of_card_ne_zero <| h_card.trans_ne <| Nat.pos_iff_ne_zero.mp (Nat.card_pos) let H_x := (π' ⁻¹' {x}).toFinite.toFinset have h : ∀ᵐ ω ∂ν', (X' - UH') ω ∈ H_x := by let T : Set (G × G) := ((π' ∘ X') ⁻¹' {x})ᶜ let U : Set (G × G) := UH' ⁻¹' Hᶜ have h_subset : (X' - UH') ⁻¹' H_xᶜ ⊆ T ∪ U := fun ω hω ↦ Classical.byContradiction fun h ↦ by simp_all [not_or, T, U, H_x, π'] refine MeasureTheory.mem_ae_iff.mpr (le_zero_iff.mp ?_) calc _ ≤ ν' T + ν' U := (measure_mono h_subset).trans (measure_union_le T U) _ = ν' T + 0 := congrArg _ <| by simp only [ν', ProbabilityTheory.cond, Measure.smul_apply, smul_eq_mul] rw [le_zero_iff.mp <| (restrict_apply_le _ U).trans_eq hunif.measure_preimage_compl, mul_zero] _ = 0 := (add_zero _).trans <| by have : restrict ν (π ∘ X' ⁻¹' {x}) T = 0 := by simp [restrict_apply .of_discrete, T, π', π] simp only [ν', ProbabilityTheory.cond, Measure.smul_apply, smul_eq_mul] rw [this, mul_zero] convert entropy_le_log_card_of_mem (Measurable.sub hX' hUH') h simp_rw [hunif.entropy_eq' hH hUH', H_x, Set.Finite.mem_toFinset, h_card, SetLike.coe_sort_coe] have h_one : (∑ x ∈ FiniteRange.toFinset (π ∘ X'), (νq {x}).toReal) = 1 := by rewrite [Finset.sum_toReal_measure_singleton] apply (ENNReal.toReal_eq_one_iff _).mpr have := isProbabilityMeasure_map (μ := ν) <| .of_discrete (f := π ∘ X') rewrite [← measure_univ (μ := νq), ← FiniteRange.range] let rng := Set.range (π ∘ X') have h_compl : νq rngᶜ = 0 := ae_map_mem_range (π ∘ X') .of_discrete ν rw [← MeasureTheory.measure_add_measure_compl (MeasurableSet.of_discrete (s := rng)), h_compl, add_zero] have := FiniteRange.sub X' UH' have h_ge : H[X' - UH' | π ∘ X' ; ν] ≥ H[UH' ; ν] := calc _ ≥ H[X' - UH' | X' ; ν] := condEntropy_comp_ge ν hX' (hX'.sub hUH') π _ = H[UH' | X' ; ν] := condEntropy_sub_left hUH' hX' _ = H[UH' ; ν] := h_ind.symm.condEntropy_eq_entropy hUH' hX' have h_le : H[X' - UH' | π ∘ X' ; ν] ≤ H[UH' ; ν] := by rewrite [condEntropy_eq_sum _ _ _ .of_discrete] apply (Finset.sum_le_sum h_meas_le).trans rewrite [← Finset.sum_mul, h_one, one_mul] rfl exact h_le.ge_iff_eq.mp h_ge have : H[X' - UH' ; ν] = H[π ∘ X' ; ν] + H[UH' ; ν] := by calc _ = H[⟨X' - UH', π ∘ (X' - UH')⟩ ; ν] := (entropy_prod_comp (hX'.sub hUH') ν π).symm _ = H[⟨X' - UH', π ∘ X'⟩ ; ν] := by apply IdentDistrib.entropy_eq <| IdentDistrib.of_ae_eq (Measurable.aemeasurable .of_discrete) <| MeasureTheory.mem_ae_iff.mpr _ convert hunif.measure_preimage_compl ext; simp [π] _ = H[π ∘ X' ; ν] + H[UH' ; ν] := by rewrite [chain_rule ν (by exact hX'.sub hUH') .of_discrete] congr have : d[X' ; ν # UH' ; ν] = H[π ∘ X' ; ν] + (H[UH' ; ν] - H[X' ; ν]) / 2 := by rewrite [h_ind.rdist_eq hX' hUH'] linarith only [this] linarith only [this, (abs_le.mp (diff_ent_le_rdist hX' hUH' (μ := ν) (μ' := ν))).2]
pfr/blueprint/src/chapter/distance.tex:161
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:276
PFR
ent_of_sub_smul
\begin{lemma}[Sums of dilates I]\label{sum-dilate-I}\lean{ent_of_sub_smul, ent_of_sub_smul'}\leanok Let $X,Y,X'$ be independent $G$-valued random variables, with $X'$ a copy of $X$, and let $a$ be an integer. Then $$\bbH[X-(a+1)Y] \leq \bbH[X-aY] + \bbH[X-Y-X'] - \bbH[X]$$ and $$\bbH[X-(a-1)Y] \leq \bbH[X-aY] + \bbH[X-Y-X'] - \bbH[X].$$ \end{lemma} \begin{proof}\uses{ruzsa-triangle-improved, neg-ent}\leanok From \Cref{ruzsa-triangle-improved} we have $$ \bbH[(X-Y)-aY] \leq \bbH[(X-Y) - X'] + \bbH[X'-aY] - \bbH[X']$$ which gives the first inequality. Similarly from \Cref{ruzsa-triangle-improved} we have $$ \bbH[(X+Y)-aY] \leq \bbH[(X+Y) - X'] + \bbH[X'-aY] - \bbH[X']$$ which (when combined with \Cref{neg-ent}) gives the second inequality. \end{proof}
lemma ent_of_sub_smul {Y : Ω → G} {X' : Ω → G} [FiniteRange X] [FiniteRange Y] [FiniteRange X'] [IsProbabilityMeasure μ] (hX : Measurable X) (hY : Measurable Y) (hX' : Measurable X') (h_indep : iIndepFun ![X, Y, X'] μ) (hident : IdentDistrib X X' μ μ) {a : ℤ} : H[X - (a+1) • Y; μ] ≤ H[X - a • Y; μ] + H[X - Y - X'; μ] - H[X; μ] := by rw [add_smul, one_smul, add_comm, sub_add_eq_sub_sub] have iX'Y : IndepFun X' Y μ := h_indep.indepFun (show 2 ≠ 1 by simp) have iXY : IndepFun X Y μ := h_indep.indepFun (show 0 ≠ 1 by simp) have hident' : IdentDistrib (X' - a • Y) (X - a • Y) μ μ := by simp_rw [sub_eq_add_neg] apply hident.symm.add (IdentDistrib.refl (hY.const_smul a).neg.aemeasurable) · convert iX'Y.comp measurable_id (.of_discrete (f := fun y ↦ -(a • y))) using 1 · convert iXY.comp measurable_id (.of_discrete (f := fun y ↦ -(a • y))) using 1 have iXY_X' : IndepFun (⟨X, Y⟩) X' μ := h_indep.indepFun_prodMk (fun i ↦ (by fin_cases i <;> assumption)) 0 1 2 (show 0 ≠ 2 by simp) (show 1 ≠ 2 by simp) calc _ ≤ H[X - Y - X' ; μ] + H[X' - a • Y ; μ] - H[X' ; μ] := by refine ent_of_diff_le _ _ _ (hX.sub hY) (hY.const_smul a) hX' ?_ exact iXY_X'.comp (φ := fun (x, y) ↦ (x - y, a • y)) .of_discrete measurable_id _ = _ := by rw [hident.entropy_eq] simp only [add_comm, sub_left_inj, _root_.add_left_inj] exact hident'.entropy_eq /-- Let `X,Y,X'` be independent `G`-valued random variables, with `X'` a copy of `X`, and let `a` be an integer. Then `H[X - (a-1)Y] ≤ H[X - aY] + H[X - Y - X'] - H[X]` -/
pfr/blueprint/src/chapter/torsion.tex:125
pfr/PFR/MoreRuzsaDist.lean:532
PFR
ent_of_sub_smul'
\begin{lemma}[Sums of dilates I]\label{sum-dilate-I}\lean{ent_of_sub_smul, ent_of_sub_smul'}\leanok Let $X,Y,X'$ be independent $G$-valued random variables, with $X'$ a copy of $X$, and let $a$ be an integer. Then $$\bbH[X-(a+1)Y] \leq \bbH[X-aY] + \bbH[X-Y-X'] - \bbH[X]$$ and $$\bbH[X-(a-1)Y] \leq \bbH[X-aY] + \bbH[X-Y-X'] - \bbH[X].$$ \end{lemma} \begin{proof}\uses{ruzsa-triangle-improved, neg-ent}\leanok From \Cref{ruzsa-triangle-improved} we have $$ \bbH[(X-Y)-aY] \leq \bbH[(X-Y) - X'] + \bbH[X'-aY] - \bbH[X']$$ which gives the first inequality. Similarly from \Cref{ruzsa-triangle-improved} we have $$ \bbH[(X+Y)-aY] \leq \bbH[(X+Y) - X'] + \bbH[X'-aY] - \bbH[X']$$ which (when combined with \Cref{neg-ent}) gives the second inequality. \end{proof}
lemma ent_of_sub_smul' {Y : Ω → G} {X' : Ω → G} [FiniteRange X] [FiniteRange Y] [FiniteRange X'] [IsProbabilityMeasure μ] (hX : Measurable X) (hY : Measurable Y) (hX': Measurable X') (h_indep : iIndepFun ![X, Y, X'] μ) (hident : IdentDistrib X X' μ μ) {a : ℤ} : H[X - (a-1) • Y; μ] ≤ H[X - a • Y; μ] + H[X - Y - X'; μ] - H[X; μ] := by rw [sub_smul, one_smul, sub_eq_add_neg, neg_sub, add_sub] have iX'Y : IndepFun X' Y μ := h_indep.indepFun (show 2 ≠ 1 by simp) have iXY : IndepFun X Y μ := h_indep.indepFun (show 0 ≠ 1 by simp) have hident' : IdentDistrib (X' - a • Y) (X - a • Y) μ μ := by simp_rw [sub_eq_add_neg] apply hident.symm.add (IdentDistrib.refl (hY.const_smul a).neg.aemeasurable) · convert iX'Y.comp measurable_id (.of_discrete (f := fun y ↦ -(a • y))) using 1 · convert iXY.comp measurable_id (.of_discrete (f := fun y ↦ -(a • y))) using 1 have hident'' : IdentDistrib (-(X + Y - X')) (X - Y - X') μ μ := by simp_rw [neg_sub, ← sub_sub, sub_eq_add_neg, add_assoc] refine hident.symm.add ?_ ?_ ?_ rotate_left · rw [← neg_add] apply IndepFun.comp _ measurable_id measurable_neg refine h_indep.indepFun_add_right (fun i ↦ (by fin_cases i <;> assumption)) 2 0 1 (by simp) (by simp) · rw [← neg_add] apply IndepFun.comp _ measurable_id measurable_neg refine h_indep.indepFun_add_right (fun i ↦ (by fin_cases i <;> assumption)) 0 1 2 (by simp) (by simp) rw [add_comm, ← neg_add, ← neg_add] exact (IdentDistrib.refl hY.aemeasurable).add hident iXY.symm iX'Y.symm |>.neg have iXY_X' : IndepFun (⟨X, Y⟩) X' μ := h_indep.indepFun_prodMk (fun i ↦ (by fin_cases i <;> assumption)) 0 1 2 (show 0 ≠ 2 by simp) (show 1 ≠ 2 by simp) calc _ ≤ H[X + Y - X' ; μ] + H[X' - a • Y ; μ] - H[X' ; μ] := by refine ent_of_diff_le _ _ _ (hX.add hY) (hY.const_smul a) hX' ?_ exact iXY_X'.comp (φ := fun (x, y) ↦ (x + y, a • y)) .of_discrete measurable_id _ = H[- (X + Y - X') ; μ] + H[X - a • Y ; μ] - H[X ; μ] := by rw [hident.entropy_eq] simp only [hident'.entropy_eq, add_comm, sub_left_inj, _root_.add_right_inj] exact entropy_neg (hX.add hY |>.sub hX') |>.symm _ = _ := by rw [add_comm, hident''.entropy_eq] /-- Let `X,Y` be independent `G`-valued random variables, and let `a` be an integer. Then `H[X - aY] - H[X] ≤ 4 |a| d[X ; Y]`. -/
pfr/blueprint/src/chapter/torsion.tex:125
pfr/PFR/MoreRuzsaDist.lean:558
PFR
ent_of_sub_smul_le
\begin{lemma}[Sums of dilates II]\label{sum-dilate-II}\lean{ent_of_sub_smul_le}\leanok Let $X,Y$ be independent $G$-valued random variables, and let $a$ be an integer. Then $$\bbH[X-aY] - \bbH[X] \leq 4 |a| d[X;Y].$$ \end{lemma} \begin{proof}\uses{kv, ruz-indep, sign-flip, sum-dilate-I}\leanok From \Cref{kv} one has $$\bbH[Y-X+X'] - \bbH[Y-X] \leq \bbH[Y+X'] - \bbH[Y] = \bbH[Y+X] - \bbH[Y]$$ which by \Cref{ruz-indep} gives $$\bbH[X-Y-X'] -\bbH[X] \leq d[X;Y] + d[X;-Y]$$ and hence by \Cref{sign-flip} $$\bbH[X-Y-X'] - \bbH[X] \leq 4d[X;Y].$$ From \Cref{sum-dilate-I} we then have $$\bbH[X-(a\pm 1)Y] \leq \bbH[X-aY] + 4 d[X;Y]$$ and the claim now follows by an induction on $|a|$. \end{proof}
lemma ent_of_sub_smul_le {Y : Ω → G} [IsProbabilityMeasure μ] [Fintype G] (hX : Measurable X) (hY : Measurable Y) (h_indep : IndepFun X Y μ) {a : ℤ} : H[X - a • Y; μ] - H[X; μ] ≤ 4 * |a| * d[X ; μ # Y ; μ] := by obtain ⟨Ω', mΩ', μ', X₁', Y', X₂', hμ', h_indep', hX₁', hY', hX₂', idX₁, idY, idX₂⟩ := independent_copies3_nondep hX hY hX μ μ μ have iX₁Y : IndepFun X₁' Y' μ' := h_indep'.indepFun (show 0 ≠ 1 by simp) have iYX₂ : IndepFun Y' X₂' μ' := h_indep'.indepFun (show 1 ≠ 2 by simp) have iX₂nY : IndepFun X₂' (-Y') μ' := iYX₂.symm.comp measurable_id measurable_neg have inX₁YX₂ : iIndepFun ![-X₁', Y', X₂'] μ' := by convert h_indep'.comp ![-id, id, id] (by fun_prop) with i match i with | 0 => rfl | 1 => rfl | 2 => rfl have idX₁X₂' : IdentDistrib X₁' X₂' μ' μ' := idX₁.trans idX₂.symm have idX₁Y : IdentDistrib (⟨X, Y⟩) (⟨X₁', Y'⟩) μ μ' := IdentDistrib.prodMk idX₁.symm idY.symm h_indep iX₁Y have h1 : H[Y' - X₁' + X₂'; μ'] - H[Y' - X₁'; μ'] ≤ H[Y' + X₂'; μ'] - H[Y'; μ'] := by simp_rw [sub_eq_add_neg Y', add_comm Y' (-X₁')] exact kaimanovich_vershik inX₁YX₂ hX₁'.neg hY' hX₂' have h2 : H[X₁' - Y' - X₂'; μ'] - H[X₁'; μ'] ≤ d[X₁' ; μ' # Y' ; μ'] + d[X₁' ; μ' # -Y' ; μ'] := by rw [idX₁X₂'.rdist_eq (IdentDistrib.refl hY'.aemeasurable).neg, iX₁Y.rdist_eq hX₁' hY', iX₂nY.rdist_eq hX₂' hY'.neg, entropy_neg hY', idX₁X₂'.entropy_eq.symm] rw [show H[X₁' - Y' - X₂'; μ'] = H[-(X₁' - Y' - X₂'); μ'] from entropy_neg (hX₁'.sub hY' |>.sub hX₂') |>.symm] rw [show H[X₁' - Y'; μ'] = H[-(X₁' - Y'); μ'] from entropy_neg (hX₁'.sub hY') |>.symm] ring_nf rw [sub_eq_add_neg, add_comm, add_assoc, sub_neg_eq_add] gcongr convert sub_le_iff_le_add'.mp h1 using 1 · simp [sub_eq_add_neg, add_comm] · simp only [sub_eq_add_neg, neg_add_rev, neg_neg, add_comm, add_assoc] linarith have h3 : H[X₁' - Y' - X₂' ; μ'] - H[X₁'; μ'] ≤ 4 * d[X₁' ; μ' # Y' ; μ'] := calc _ ≤ d[X₁' ; μ' # Y' ; μ'] + d[X₁' ; μ' # -Y' ; μ'] := h2 _ ≤ d[X₁' ; μ' # Y' ; μ'] + 3 * d[X₁' ; μ' # Y' ; μ'] := by gcongr exact rdist_of_neg_le hX₁' hY' _ = _ := by ring_nf have h4 (a : ℤ) : H[X - (a + 1) • Y; μ] ≤ H[X₁' - a • Y'; μ'] + 4 * d[X₁' ; μ' # Y' ; μ'] := by calc _ = H[X₁' - (a + 1) • Y'; μ'] := IdentDistrib.entropy_eq <| idX₁Y.comp (show Measurable (fun xy ↦ (xy.1 - (a + 1) • xy.2)) by fun_prop) _ ≤ H[X₁' - a • Y'; μ'] + H[X₁' - Y' - X₂'; μ'] - H[X₁'; μ'] := ent_of_sub_smul hX₁' hY' hX₂' h_indep' idX₁X₂' _ ≤ H[X₁' - a • Y'; μ'] + 4 * d[X₁' ; μ' # Y' ; μ'] := by rw [add_sub_assoc] gcongr have h4' (a : ℤ) : H[X - (a - 1) • Y; μ] ≤ H[X₁' - a • Y'; μ'] + 4 * d[X₁' ; μ' # Y' ; μ'] := by calc _ = H[X₁' - (a - 1) • Y'; μ'] := IdentDistrib.entropy_eq <| idX₁Y.comp (show Measurable (fun xy ↦ (xy.1 - (a - 1) • xy.2)) by fun_prop) _ ≤ H[X₁' - a • Y'; μ'] + H[X₁' - Y' - X₂'; μ'] - H[X₁'; μ'] := ent_of_sub_smul' hX₁' hY' hX₂' h_indep' idX₁X₂' _ ≤ H[X₁' - a • Y'; μ'] + 4 * d[X₁' ; μ' # Y' ; μ'] := by rw [add_sub_assoc] gcongr have (a : ℤ) : H[X₁' - a • Y'; μ'] = H[X - a • Y; μ] := idX₁Y.symm.comp (show Measurable (fun xy ↦ (xy.1 - a • xy.2)) by fun_prop) |>.entropy_eq simp_rw [IdentDistrib.rdist_eq idX₁ idY, this] at h4 h4' set! n := |a| with ha have hn : 0 ≤ n := by simp [ha] lift n to ℕ using hn with n induction' n with n ih generalizing a · rw [← ha, abs_eq_zero.mp ha.symm] simp · rename_i m _ have : a ≠ 0 := by rw [ne_eq, ← abs_eq_zero, ← ha] exact NeZero.natCast_ne (m + 1) ℤ have : m = |a - 1| ∨ m = |a + 1| := by rcases lt_or_gt_of_ne this with h | h · right rw [abs_of_neg h] at ha rw [abs_of_nonpos (by exact h), neg_add, ← ha] norm_num · left rw [abs_of_pos h] at ha rw [abs_of_nonneg ?_, ← ha] swap; exact Int.sub_nonneg_of_le h norm_num rcases this with h | h · calc _ ≤ H[X - (a - 1) • Y; μ] - H[X; μ] + 4 * d[X ; μ # Y ; μ] := by nth_rw 1 [(a.sub_add_cancel 1).symm, sub_add_eq_add_sub _ H[X; μ]] gcongr exact h4 (a - 1) _ ≤ 4 * |a - 1| * d[X ; μ # Y ; μ] + 4 * d[X ; μ # Y ; μ] := by gcongr exact ih h h _ = 4 * |a| * d[X ; μ # Y ; μ] := by nth_rw 2 [← mul_one 4] rw [← add_mul, ← mul_add, ← ha, ← h] norm_num · calc _ ≤ H[X - (a + 1) • Y; μ] - H[X; μ] + 4 * d[X ; μ # Y ; μ] := by nth_rw 1 [(a.add_sub_cancel 1).symm, sub_add_eq_add_sub _ H[X; μ]] gcongr exact h4' (a + 1) _ ≤ 4 * |a + 1| * d[X ; μ # Y ; μ] + 4 * d[X ; μ # Y ; μ] := by gcongr exact ih h h _ = 4 * |a| * d[X ; μ # Y ; μ] := by nth_rw 2 [← mul_one 4] rw [← add_mul, ← mul_add, ← ha, ← h] norm_num
pfr/blueprint/src/chapter/torsion.tex:139
pfr/PFR/MoreRuzsaDist.lean:600
PFR
ent_of_sum_le_ent_of_sum
\begin{lemma}[Comparing sums]\label{compare-sums}\lean{ent_of_sum_le_ent_of_sum}\leanok Let $(X_i)_{1 \leq i \leq m}$ and $(Y_j)_{1 \leq j \leq l}$ be tuples of jointly independent random variables (so the $X$'s and $Y$'s are also independent of each other), and let $f: \{1,\dots,l\} \to \{1,\dots,m\}$ be a function, then $$ \bbH[\sum_{j=1}^l Y_j] \leq \bbH[ \sum_{i=1}^m X_i ] + \sum_{j=1}^l (\bbH[ Y_j - X_{f(j)}] - \bbH[X_{f(j)}]).$$ \end{lemma} \begin{proof}\uses{klm-1, kv, neg-ent, sumset-lower} Write $W := \sum_{i=1}^m X_i$. From \Cref{sumset-lower} we have $$ \bbH[\sum_{j=1}^l Y_j] \leq \bbH[-W + \sum_{j=1}^l Y_j]$$ while from \Cref{klm-1} one has $$ \bbH[-W + \sum_{j=1}^l Y_j] \leq \bbH[-W] + \sum_{j=1}^l \bbH[-W + Y_j] - \bbH[-W].$$ From \Cref{kv} one has $$ \bbH[-W + Y_j] - \bbH[-W] \leq \bbH[-X_{f(j)} + Y_j] - \bbH[-X_{f(j)}].$$ The claim now follows from \Cref{neg-ent} and some elementary algebra. \end{proof}
lemma ent_of_sum_le_ent_of_sum [IsProbabilityMeasure μ] {I : Type*} {s t : Finset I} (hdisj : Disjoint s t) (hs : Finset.Nonempty s) (ht : Finset.Nonempty t) (X : I → Ω → G) (hX : (i : I) → Measurable (X i)) (hX' : (i : I) → FiniteRange (X i)) (h_indep : iIndepFun X μ) (f : I → I) (hf : Finset.image f t ⊆ s) : H[∑ i ∈ t, X i; μ] ≤ H[∑ i ∈ s, X i; μ] + ∑ i ∈ t, (H[X i - X (f i); μ] - H[X (f i); μ]) := by sorry /-- Let `X,Y,X'` be independent `G`-valued random variables, with `X'` a copy of `X`, and let `a` be an integer. Then `H[X - (a+1)Y] ≤ H[X - aY] + H[X - Y - X'] - H[X]` -/
pfr/blueprint/src/chapter/torsion.tex:112
pfr/PFR/MoreRuzsaDist.lean:523
PFR
ent_ofsum_le
\begin{lemma}[Entropy bound on quadruple sum]\label{foursum-bound} \lean{ent_ofsum_le}\leanok With the same notation, we have \begin{equation} \label{HS-bound} \bbH[X_1+X_2+\tilde X_1+\tilde X_2] \le \tfrac{1}{2} \bbH[X_1]+\tfrac{1}{2} \bbH[X_2] + (2 + \eta) k - I_1. \end{equation} \end{lemma} \begin{proof}\uses{first-cond, first-fibre, first-upper, ruz-indep}\leanok Subtracting \Cref{first-cond} from \Cref{first-fibre}, and combining the resulting inequality with \Cref{first-upper} gives the bound \[ d[X_1+\tilde X_2;X_2+\tilde X_1] \le (1 + \eta) k - I_1, \] and the claim follows from \Cref{ruz-indep} and the definition of $k$. \end{proof}
lemma ent_ofsum_le [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] : H[X₁ + X₂ + X₁' + X₂'] ≤ H[X₁]/2 + H[X₂]/2 + (2+p.η)*k - I₁ := by let D := d[X₁ + X₂' # X₂ + X₁'] let Dcc := d[X₁ | X₁ + X₂' # X₂ | X₂ + X₁'] let D1 := d[p.X₀₁ # X₁] let Dc1 := d[p.X₀₁ # X₁ | X₁ + X₂'] let D2 := d[p.X₀₂ # X₂] let Dc2 := d[p.X₀₂ # X₂ | X₂ + X₁'] have lem68 : D + Dcc + I₁ = 2 * k := rdist_add_rdist_add_condMutual_eq _ _ _ _ hX₁ hX₂ hX₁' hX₂' h₁ h₂ h_indep have lem610 : Dcc ≥ k - p.η * (Dc1 - D1) - p.η * (Dc2 - D2) := condRuzsaDist_of_sums_ge p X₁ X₂ X₁' X₂' hX₁ hX₂ (by fun_prop) (by aesop) h_min have lem611c : Dc1 - D1 ≤ k / 2 + H[X₁] / 4 - H[X₂] / 4 := diff_rdist_le_3 p X₁ X₂ X₁' X₂' hX₁ hX₂' h₂ h_indep have lem611d : Dc2 - D2 ≤ k / 2 + H[X₂] / 4 - H[X₁] / 4 := diff_rdist_le_4 p X₁ X₂ X₁' X₂' hX₂ hX₁' h₁ h_indep have aux : D + I₁ ≤ (1 + p.η) * k := by calc D + I₁ ≤ k + p.η * (Dc1 - D1) + p.η * (Dc2 - D2) := ?_ _ ≤ k + p.η * (k / 2 + H[X₁] / 4 - H[X₂] / 4) + p.η * (k / 2 + H[X₂] / 4 - H[X₁] / 4) := ?_ _ = (1 + p.η) * k := by ring · convert add_le_add lem68.le (neg_le_neg lem610) using 1 <;> ring · refine add_le_add (add_le_add (le_refl _) ?_) ?_ · apply (mul_le_mul_left p.hη).mpr lem611c · apply (mul_le_mul_left p.hη).mpr lem611d have ent_sub_eq_ent_add : H[X₁ + X₂' - (X₂ + X₁')] = H[X₁ + X₂' + (X₂ + X₁')] := by simp [ZModModule.sub_eq_add] have rw₁ : X₁ + X₂' + (X₂ + X₁') = X₁ + X₂ + X₁' + X₂' := by abel have ind_aux : IndepFun (X₁ + X₂') (X₂ + X₁') := by exact iIndepFun.indepFun_add_add h_indep (fun i ↦ by fin_cases i <;> assumption) 0 2 1 3 (by decide) (by decide) (by decide) (by decide) have ind : D = H[X₁ + X₂' - (X₂ + X₁')] - H[X₁ + X₂'] / 2 - H[X₂ + X₁'] / 2 := ind_aux.rdist_eq (by fun_prop) (by fun_prop) rw [ind, ent_sub_eq_ent_add, rw₁] at aux have obs : H[X₁ + X₂ + X₁' + X₂'] ≤ H[X₁ + X₂'] / 2 + H[X₂ + X₁'] / 2 + (1 + p.η) * k - I₁ := by linarith have rw₂ : H[X₁ + X₂'] = k + H[X₁]/2 + H[X₂]/2 := by have HX₂_eq : H[X₂] = H[X₂'] := congr_arg (fun (μ : Measure G) ↦ measureEntropy (μ := μ)) h₂.map_eq have k_eq : k = H[X₁ - X₂'] - H[X₁] / 2 - H[X₂'] / 2 := by have k_eq_aux : k = d[X₁ # X₂'] := (IdentDistrib.refl hX₁.aemeasurable).rdist_eq h₂ rw [k_eq_aux] exact (h_indep.indepFun (show (0 : Fin 4) ≠ 2 by decide)).rdist_eq hX₁ hX₂' rw [k_eq, ← ZModModule.sub_eq_add, ← HX₂_eq] ring have rw₃ : H[X₂ + X₁'] = k + H[X₁]/2 + H[X₂]/2 := by have HX₁_eq : H[X₁] = H[X₁'] := congr_arg (fun (μ : Measure G) ↦ measureEntropy (μ := μ)) h₁.map_eq have k_eq' : k = H[X₁' - X₂] - H[X₁'] / 2 - H[X₂] / 2 := by have k_eq_aux : k = d[X₁' # X₂] := IdentDistrib.rdist_eq h₁ (IdentDistrib.refl hX₂.aemeasurable) rw [k_eq_aux] exact IndepFun.rdist_eq (h_indep.indepFun (show (3 : Fin 4) ≠ 1 by decide)) hX₁' hX₂ rw [add_comm X₂ X₁', k_eq', ← ZModModule.sub_eq_add, ← HX₁_eq] ring calc H[X₁ + X₂ + X₁' + X₂'] ≤ H[X₁ + X₂'] / 2 + H[X₂ + X₁'] / 2 + (1 + p.η) * k - I₁ := obs _ = (k + H[X₁] / 2 + H[X₂] / 2) / 2 + (k + H[X₁] / 2 + H[X₂] / 2) / 2 + (1 + p.η) * k - I₁ := by rw [rw₂, rw₃] _ = H[X₁] / 2 + H[X₂] / 2 + (2 + p.η) * k - I₁ := by ring
pfr/blueprint/src/chapter/entropy_pfr.tex:138
pfr/PFR/FirstEstimate.lean:150
PFR
entropic_PFR_conjecture
\begin{theorem}[Entropy version of PFR]\label{entropy-pfr} \lean{entropic_PFR_conjecture}\leanok Let $G = \F_2^n$, and suppose that $X^0_1, X^0_2$ are $G$-valued random variables. Then there is some subgroup $H \leq G$ such that \[ d[X^0_1;U_H] + d[X^0_2;U_H] \le 11 d[X^0_1;X^0_2], \] where $U_H$ is uniformly distributed on $H$. Furthermore, both $d[X^0_1;U_H]$ and $d[X^0_2;U_H]$ are at most $6 d[X^0_1;X^0_2]$. \end{theorem} \begin{proof} \uses{de-prop, tau-min, lem:100pc, ruzsa-triangle} \leanok Let $X_1, X_2$ be the $\tau$-minimizer from \Cref{tau-min}. From \Cref{de-prop}, $d[X_1;X_2]=0$. From \Cref{lem:100pc}, $d[X_1;U_H] = d[X_2; U_H] = 0$. Also from $\tau$-minimization we have $\tau[X_1;X_2] \leq \tau[X^0_2;X^0_1]$. Using this and the Ruzsa triangle inequality we can conclude. \end{proof}
theorem entropic_PFR_conjecture (hpη : p.η = 1/9): ∃ H : Submodule (ZMod 2) G, ∃ Ω : Type uG, ∃ mΩ : MeasureSpace Ω, ∃ U : Ω → G, IsProbabilityMeasure (ℙ : Measure Ω) ∧ Measurable U ∧ IsUniform H U ∧ d[p.X₀₁ # U] + d[p.X₀₂ # U] ≤ 11 * d[p.X₀₁ # p.X₀₂] := by obtain ⟨Ω', mΩ', X₁, X₂, hX₁, hX₂, _, htau_min⟩ := tau_minimizer_exists p have hdist : d[X₁ # X₂] = 0 := tau_strictly_decreases p hX₁ hX₂ htau_min hpη obtain ⟨H, U, hU, hH_unif, hdistX₁, hdistX₂⟩ := exists_isUniform_of_rdist_eq_zero hX₁ hX₂ hdist refine ⟨AddSubgroup.toZModSubmodule _ H, Ω', inferInstance, U, inferInstance, hU, hH_unif , ?_⟩ have h : τ[X₁ # X₂ | p] ≤ τ[p.X₀₂ # p.X₀₁ | p] := is_tau_min p htau_min p.hmeas2 p.hmeas1 rw [tau, tau, hpη] at h norm_num at h have : d[p.X₀₁ # p.X₀₂] = d[p.X₀₂ # p.X₀₁] := rdist_symm have : d[p.X₀₁ # U] ≤ d[p.X₀₁ # X₁] + d[X₁ # U] := rdist_triangle p.hmeas1 hX₁ hU have : d[p.X₀₂ # U] ≤ d[p.X₀₂ # X₂] + d[X₂ # U] := rdist_triangle p.hmeas2 hX₂ hU linarith
pfr/blueprint/src/chapter/entropy_pfr.tex:417
pfr/PFR/EntropyPFR.lean:46
PFR
entropic_PFR_conjecture_improv
\begin{theorem}[Improved entropy version of PFR]\label{entropy-pfr-improv}\lean{entropic_PFR_conjecture_improv}\leanok Let $G = \F_2^n$, and suppose that $X^0_1, X^0_2$ are $G$-valued random variables. Then there is some subgroup $H \leq G$ such that \[ d[X^0_1;U_H] + d[X^0_2;U_H] \le 10 d[X^0_1;X^0_2], \] where $U_H$ is uniformly distributed on $H$. Furthermore, both $d[X^0_1;U_H]$ and $d[X^0_2;U_H]$ are at most $6 d[X^0_1;X^0_2]$. \end{theorem} \begin{proof} \uses{de-prop-lim-improv, lem:100pc, ruzsa-triangle}\leanok Let $X_1, X_2$ be the good $\tau$-minimizer from \Cref{de-prop-lim-improv}. By construction, $d[X_1;X_2]=0$. From \Cref{lem:100pc}, $d[X_1;U_H] = d[X_2; U_H] = 0$. Also from $\tau$-minimization we have $\tau[X_1;X_2] \leq \tau[X^0_2;X^0_1]$. Using this and the Ruzsa triangle inequality we can conclude. \end{proof}
theorem entropic_PFR_conjecture_improv (hpη : p.η = 1/8) : ∃ (H : Submodule (ZMod 2) G) (Ω : Type uG) (mΩ : MeasureSpace Ω) (U : Ω → G), IsProbabilityMeasure (ℙ : Measure Ω) ∧ Measurable U ∧ IsUniform H U ∧ d[p.X₀₁ # U] + d[p.X₀₂ # U] ≤ 10 * d[p.X₀₁ # p.X₀₂] := by obtain ⟨Ω', mΩ', X₁, X₂, hX₁, hX₂, hP, htau_min, hdist⟩ := tau_minimizer_exists_rdist_eq_zero p obtain ⟨H, U, hU, hH_unif, hdistX₁, hdistX₂⟩ := exists_isUniform_of_rdist_eq_zero hX₁ hX₂ hdist refine ⟨AddSubgroup.toZModSubmodule 2 H, Ω', inferInstance, U, inferInstance, hU, hH_unif , ?_⟩ have h : τ[X₁ # X₂ | p] ≤ τ[p.X₀₂ # p.X₀₁ | p] := is_tau_min p htau_min p.hmeas2 p.hmeas1 rw [tau, tau, hpη] at h norm_num at h have : d[p.X₀₁ # p.X₀₂] = d[p.X₀₂ # p.X₀₁] := rdist_symm have : d[p.X₀₁ # U] ≤ d[p.X₀₁ # X₁] + d[X₁ # U] := rdist_triangle p.hmeas1 hX₁ hU have : d[p.X₀₂ # U] ≤ d[p.X₀₂ # X₂] + d[X₂ # U] := rdist_triangle p.hmeas2 hX₂ hU linarith /-- `entropic_PFR_conjecture_improv'`: For two $G$-valued random variables $X^0_1, X^0_2$, there is some subgroup $H \leq G$ such that $d[X^0_1;U_H] + d[X^0_2;U_H] \le 10 d[X^0_1;X^0_2]$., and d[X^0_1; U_H] and d[X^0_2; U_H] are at most 5/2 * d[X^0_1;X^0_2] -/
pfr/blueprint/src/chapter/improved_exponent.tex:197
pfr/PFR/ImprovedPFR.lean:814
PFR
entropy_of_W_le
\begin{lemma}[Entropy of $W$]\label{ent-w}\lean{entropy_of_W_le}\uses{more-random}\leanok We have $\bbH[W] \leq (2m-1)k + \frac1m \sum_{i=1}^m \bbH[X_i]$. \end{lemma} \begin{proof}\uses{multidist-def, multidist-ruzsa-IV, klm-1} Without loss of generality, we may take $X_1,\dots,X_m$ to be independent. Write $S = \sum_{i=1}^m X_i$. Note that for each $j \in \Z/m\Z$, the sum $Q_j$ from~\eqref{pqr-defs} above has the same distribution as $S$. By \Cref{klm-1} we have \begin{align*} \bbH[W] = \bbH[\sum_{j \in \Z/m\Z} Q_j] & \leq \bbH[S] + \sum_{j=2}^m (\bbH[Q_1+Q_j] - \bbH[S]) \\ & = \bbH[S] + (m-1) d[S;-S]. \end{align*} By \Cref{multidist-ruzsa-IV}, we have \begin{equation} \label{eq:s-bound} d[S; -S] \leq 2 k \end{equation} and hence \[ \bbH[W] \leq 2 k (m-1) + \bbH[S]. \] From \Cref{multidist-def} we have \begin{equation} \label{eq:ent-s} \bbH[S] = k + \frac1m \sum_{i=1}^m \bbH[X_i], \end{equation} and the claim follows. \end{proof}
/-- We have $\bbH[W] \leq (2m-1)k + \frac1m \sum_{i=1}^m \bbH[X_i]$. -/ lemma entropy_of_W_le : H[W] ≤ (2*p.m - 1) * k + (m:ℝ)⁻¹ * ∑ i, H[X i] := sorry
pfr/blueprint/src/chapter/torsion.tex:673
pfr/PFR/TorsionEndgame.lean:57
PFR
entropy_of_Z_two_le
\begin{lemma}[Entropy of $Z_2$]\label{ent-z2}\lean{entropy_of_Z_two_le}\uses{more-random}\leanok We have $\bbH[Z_2] \leq (8m^2-16m+1) k + \frac{1}{m} \sum_{i=1}^m \bbH[X_i]$. \end{lemma} \begin{proof}\uses{sum-dilate-II, klm-1} We observe \[ \bbH[Z_2] = \bbH[\sum_{j \in \Z/m\Z} j Q_j]. \] Applying \Cref{klm-1} one has \begin{align*} \bbH[Z_2] &\leq \sum_{i=2}^{m-1} \bbH[Q_1 + i Q_i] - (m-2) \bbH[S]. \end{align*} Using \Cref{sum-dilate-II} and~\eqref{eq:s-bound} we get \begin{align*} \bbH[Z_2] &\leq \bbH[S] + 4m (m-2) d[S;-S] \\ &\leq \bbH[S] + 8m (m-2) k. \end{align*} Applying~\eqref{eq:ent-s} gives the claim. \end{proof}
/-- We have $\bbH[Z_2] \leq (8m^2-16m+1) k + \frac{1}{m} \sum_{i=1}^m \bbH[X_i]$. -/ lemma entropy_of_Z_two_le : H[Z2] ≤ (8 * p.m^2 - 16 * p.m + 1) * k + (m:ℝ)⁻¹ * ∑ i, H[X i] := sorry
pfr/blueprint/src/chapter/torsion.tex:699
pfr/PFR/TorsionEndgame.lean:60
PFR
exists_isUniform_of_rdist_eq_zero
\begin{corollary}[General 100\% inverse theorem]\label{lem:100pc} \lean{exists_isUniform_of_rdist_eq_zero}\leanok Suppose that $X_1,X_2$ are $G$-valued random variables such that $d[X_1;X_2]=0$. Then there exists a subgroup $H \leq G$ such that $d[X_1;U_H] = d[X_2;U_H] = 0$. \end{corollary} \begin{proof}\uses{lem:100pc-self,ruzsa-triangle, ruzsa-nonneg}\leanok Using \Cref{ruzsa-triangle} and \Cref{ruzsa-nonneg} we have $d[X_1;X_1]=0$, hence by \Cref{lem:100pc-self} $d[X_1;U_H]=0$ for some subgroup $H$. By \Cref{ruzsa-triangle} and \Cref{ruzsa-nonneg} again we also have $d[X_2;U_H]$ as required. \end{proof}
theorem exists_isUniform_of_rdist_eq_zero {Ω' : Type*} [MeasureSpace Ω'] [IsProbabilityMeasure (ℙ : Measure Ω')] {X' : Ω' → G} (hX : Measurable X) (hX' : Measurable X') (hdist : d[X # X'] = 0) : ∃ H : AddSubgroup G, ∃ U : Ω → G, Measurable U ∧ IsUniform H U ∧ d[X # U] = 0 ∧ d[X' # U] = 0 := by have h' : d[X # X] = 0 := by apply le_antisymm _ (rdist_nonneg hX hX) calc d[X # X] ≤ d[X # X'] + d[X' # X] := rdist_triangle hX hX' hX _ = 0 := by rw [hdist, rdist_symm, hdist, zero_add] rcases exists_isUniform_of_rdist_self_eq_zero hX h' with ⟨H, U, hmeas, hunif, hd⟩ refine ⟨H, U, hmeas, hunif, hd, ?_⟩ apply le_antisymm _ (rdist_nonneg hX' hmeas) calc d[X' # U] ≤ d[X' # X] + d[X # U] := rdist_triangle hX' hX hmeas _ = 0 := by rw [hd, rdist_symm, hdist, zero_add]
pfr/blueprint/src/chapter/100_percent.tex:51
pfr/PFR/HundredPercent.lean:160
PFR
exists_isUniform_of_rdist_self_eq_zero
\begin{lemma}[Symmetric 100\% inverse theorem]\label{lem:100pc-self} \lean{exists_isUniform_of_rdist_self_eq_zero}\leanok Suppose that $X$ is a $G$-valued random variable such that $d[X ;X]=0$. Then there exists a subgroup $H \leq G$ such that $d[X ;U_H] = 0$. \end{lemma} \begin{proof}\uses{sym-group, sym-zero}\leanok Take $H$ to be the symmetry group of $X$, which is a group by \Cref{sym-group}. From \Cref{sym-zero}, $X-x_0$ is uniform on $H$, and $d[X ;X-x_0] = d[X ;X] \leq 0$, and the claim follows. \end{proof}
/-- If $d[X ;X]=0$, then there exists a subgroup $H \leq G$ such that $d[X ;U_H] = 0$. -/ theorem exists_isUniform_of_rdist_self_eq_zero (hX : Measurable X) (hdist : d[X # X] = 0) : ∃ H : AddSubgroup G, ∃ U : Ω → G, Measurable U ∧ IsUniform H U ∧ d[X # U] = 0 := by -- use for `U` a translate of `X` to make sure that `0` is in its support. obtain ⟨x₀, h₀⟩ : ∃ x₀, ℙ (X⁻¹' {x₀}) ≠ 0 := by by_contra! h have A a : (ℙ : Measure Ω).map X {a} = 0 := by rw [Measure.map_apply hX .of_discrete] exact h _ have B : (ℙ : Measure Ω).map X = 0 := by rw [← Measure.sum_smul_dirac (μ := (ℙ : Measure Ω).map X)] simp [A] have : IsProbabilityMeasure ((ℙ : Measure Ω).map X) := isProbabilityMeasure_map hX.aemeasurable exact IsProbabilityMeasure.ne_zero _ B refine ⟨symmGroup X hX, fun ω ↦ X ω - x₀, hX.sub_const _, isUniform_sub_const_of_rdist_eq_zero hX hdist h₀, ?_⟩ simp_rw [sub_eq_add_neg] suffices d[X # X + fun _ ↦ -x₀] = 0 by convert this rw [rdist_add_const hX hX] exact hdist /-- If $d[X_1;X_2]=0$, then there exists a subgroup $H \leq G$ such that $d[X_1;U_H] = d[X_2;U_H] = 0$. Follows from the preceding claim by the triangle inequality. -/
pfr/blueprint/src/chapter/100_percent.tex:41
pfr/PFR/HundredPercent.lean:136
PFR
first_estimate
\begin{lemma}[First estimate]\label{first-estimate} \lean{first_estimate}\leanok We have $I_1 \leq 2 \eta k$. \end{lemma} \begin{proof}\uses{first-fibre, first-dist-sum, first-cond, first-upper}\leanok Take a suitable linear combination of \Cref{first-fibre}, \Cref{first-dist-sum}, \Cref{first-cond}, and \Cref{first-upper}. \end{proof}
/-- We have $I_1 \leq 2 \eta k$ -/ lemma first_estimate [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] : I₁ ≤ 2 * p.η * k := by have v1 := rdist_add_rdist_add_condMutual_eq X₁ X₂ X₁' X₂' ‹_› ‹_› ‹_› ‹_› ‹_› ‹_› ‹_› have v2 := rdist_of_sums_ge p X₁ X₂ X₁' X₂' ‹_› ‹_› ‹_› ‹_› ‹_› have v3 := condRuzsaDist_of_sums_ge p X₁ X₂ X₁' X₂' ‹_› ‹_› ‹_› (by fun_prop) (by aesop) have v4 := (mul_le_mul_left p.hη).2 (diff_rdist_le_1 p X₁ X₂ X₁' X₂' ‹_› ‹_› ‹_› ‹_›) have v5 := (mul_le_mul_left p.hη).2 (diff_rdist_le_2 p X₁ X₂ X₁' X₂' ‹_› ‹_› ‹_› ‹_›) have v6 := (mul_le_mul_left p.hη).2 (diff_rdist_le_3 p X₁ X₂ X₁' X₂' ‹_› ‹_› ‹_› ‹_›) have v7 := (mul_le_mul_left p.hη).2 (diff_rdist_le_4 p X₁ X₂ X₁' X₂' ‹_› ‹_› ‹_› ‹_›) simp only [inv_eq_one_div] at * linarith [v1, v2, v3, v4, v5, v6, v7] include hX₁ hX₂ hX₁' hX₂' h₁ h₂ h_min in /-- $$\mathbb{H}[X_1+X_2+\tilde X_1+\tilde X_2] \le \tfrac{1}{2} \mathbb{H}[X_1]+\tfrac{1}{2} \mathbb{H}[X_2] + (2 + \eta) k - I_1.$$ -/
pfr/blueprint/src/chapter/entropy_pfr.tex:129
pfr/PFR/FirstEstimate.lean:132
PFR
gen_ineq_00
\begin{lemma}[General inequality]\label{gen-ineq}\lean{gen_ineq_00} \leanok Let $X_1, X_2, X_3, X_4$ be independent $G$-valued random variables, and let $Y$ be another $G$-valued random variable. Set $S := X_1+X_2+X_3+X_4$. Then \begin{align*} & d[Y; X_1+X_2|X_1 + X_3, S] - d[Y; X_1] \\ &\quad \leq \tfrac{1}{4} (d[X_1;X_2] + 2d[X_1;X_3] + d[X_2;X_4])\\ &\qquad \qquad + \tfrac{1}{4} (d[X_1|X_1+X_3;X_2|X_2+X_4] - d[X_3|X_3+X_4; X_1|X_1+X_2])\\ &\qquad \qquad + \tfrac{1}{8} (\bbH[X_1+X_2] - \bbH[X_3+X_4] + \bbH[X_2] - \bbH[X_3]\\ &\qquad \qquad \qquad + \bbH[X_2|X_2+X_4] - \bbH[X_1|X_1+X_3]). \end{align*} \end{lemma} \begin{proof}\uses{cond-dist-fact, first-useful, cor-fibre}\leanok On the one hand, by \Cref{cond-dist-fact} and two applications of \Cref{first-useful} we have \begin{align*} &d[Y;X_1+X_2|X_1 + X_3, S] \\ &\quad \leq d[Y;X_1+X_2|S] + \tfrac{1}{2} \bbI[X_1 + X_2 : X_1 + X_3|S] \\ &\quad \leq d[Y;X_1+X_2]\\ &\qquad + \tfrac{1}{2} (d[X_1+X_2;X_3+X_4] + \bbI[X_1 + X_2 : X_1 + X_3|S])\\ &\qquad + \tfrac{1}{4} (\bbH[X_1+X_2] - \bbH[X_3+X_4])\\ &\quad \leq d[Y;X_1] \\ &\qquad + \tfrac{1}{2} (d[X_1;X_2] + d[X_1+X_2;X_3+X_4] + \bbI[X_1 + X_2 : X_1 + X_3|S])\\ &\qquad + \tfrac{1}{4} (\bbH[X_1+X_2] - \bbH[X_3+X_4] + \bbH[X_2] - \bbH[X_1]). \end{align*} From \Cref{cor-fibre} (with $Y_1,Y_2,Y_3,Y_4$ set equal to $X_3, X_1, X_4, X_2$ respectively) one has $$ d[X_3+X_4; X_1+X_2] + d[X_3|X_3+X_4; X_1|X_1+X_2] $$ $$ + \bbI[X_3 + X_1 : X_1 + X_2|S] = d[X_3;X_1] + d[X_4;X_2].$$ Rearranging the mutual information and Ruzsa distances slightly, we conclude that \begin{align*} &d[Y;X_1+X_2|X_1 + X_3, S] \\ &\quad \leq d[Y;X_1] \\ &\qquad + \tfrac{1}{2} (d[X_1;X_2] + d[X_1;X_3] + d[X_2;X_4] - d[X_3|X_3+X_4; X_1|X_1+X_2])\\ &\qquad + \tfrac{1}{4} (\bbH[X_1+X_2] - \bbH[X_3+X_4] + \bbH[X_2] - \bbH[X_1]). \end{align*} On the other hand, $(X_1+X_2|X_1 + X_3, S)$ has an identical distribution to the independent sum of $(X_1|X_1+X_3)$ and $(X_2|X_2+X_4)$. We may therefore apply \Cref{first-useful} to conditioned variables $(X_1|X_1+X_3=s)$ and $(X_2|X_2+X_4=t)$ and average in $s,t$ to obtain the alternative bound \begin{align*} & d[Y;X_1+X_2|X_1 + X_3, S] \\ &\quad \leq d[Y;X_1|X_1+X_3] + \tfrac{1}{2} d[X_1|X_1+X_3; X_2|X_2+X_4] \\ &\qquad + \tfrac{1}{4} (\bbH[X_2|X_2+X_4] - \bbH[X_1|X_1+X_3]) \\ &\quad \leq d[Y;X_1] \\ &\qquad + \tfrac{1}{2} (d[X_1;X_3] + d[X_1|X_1+X_3;X_2|X_2+X_4])\\ &\qquad + \tfrac{1}{4} (\bbH[X_2|X_2+X_4] - \bbH[X_1|X_1+X_3] + \bbH[X_1] - \bbH[X_3]). \end{align*} If one takes the arithmetic mean of these two bounds and simplifies using \Cref{cor-fibre}, one obtains the claim. \end{proof}
lemma gen_ineq_00 : d[Y # Z₁ + Z₂ | ⟨Z₁ + Z₃, Sum⟩] - d[Y # Z₁] ≤ (d[Z₁ # Z₂] + 2 * d[Z₁ # Z₃] + d[Z₂ # Z₄]) / 4 + (d[Z₁ | Z₁ + Z₃ # Z₂ | Z₂ + Z₄] - d[Z₁ | Z₁ + Z₂ # Z₃ | Z₃ + Z₄]) / 4 + (H[Z₁ + Z₂] - H[Z₃ + Z₄] + H[Z₂] - H[Z₃] + H[Z₂ | Z₂ + Z₄] - H[Z₁ | Z₁ + Z₃]) / 8 := by have I1 := gen_ineq_aux1 Y hY Z₁ Z₂ Z₃ Z₄ hZ₁ hZ₂ hZ₃ hZ₄ h_indep have I2 := gen_ineq_aux2 Y hY Z₁ Z₂ Z₃ Z₄ hZ₁ hZ₂ hZ₃ hZ₄ h_indep linarith include hY hZ₁ hZ₂ hZ₃ hZ₄ h_indep in
pfr/blueprint/src/chapter/improved_exponent.tex:88
pfr/PFR/ImprovedPFR.lean:202
PFR
goursat
\begin{lemma}[Goursat type theorem]\label{goursat}\lean{goursat}\leanok Let $H$ be a subgroup of $G \times G'$. Then there exists a subgroup $H_0$ of $G$, a subgroup $H_1$ of $G'$, and a homomorphism $\phi: G \to G'$ such that $$ H := \{ (x, \phi(x) + y): x \in H_0, y \in H_1 \}.$$ In particular, $|H| = |H_0| |H_1|$. \end{lemma} \begin{proof}\uses{hb-thm}\leanok We can take $H_0$ to be the projection of $H$ to $G$, and $H_1$ to be the slice $H_1 := \{ y: (0,y) \in H \}$. One can construct $\phi$ on $H_0$ one generator at a time by the greedy algorithm, and then extend to $G$ by \Cref{hb-thm}. The cardinality bound is clear from direct counting. \end{proof}
lemma goursat (H : Submodule (ZMod 2) (G × G')) : ∃ (H₀ : Submodule (ZMod 2) G) (H₁ : Submodule (ZMod 2) G') (φ : G →+ G'), (∀ x : G × G', x ∈ H ↔ (x.1 ∈ H₀ ∧ x.2 - φ x.1 ∈ H₁)) ∧ Nat.card H = Nat.card H₀ * Nat.card H₁ := by obtain ⟨S₁, S₂, f, φ, hf, hf_inv⟩ := H.exists_equiv_fst_sndModFst use S₁, S₂, φ constructor ; swap · show Nat.card H = _ exact Eq.trans (Nat.card_eq_of_bijective f f.bijective) (Nat.card_prod S₁ S₂) · intro x · constructor · intro hx let x : H := { val := x, property := hx } · constructor · exact Set.mem_of_eq_of_mem (hf x).1.symm (f x).1.property · exact Set.mem_of_eq_of_mem (hf x).2.symm (f x).2.property · intro hx · let x₁ : S₁ := { val := x.1, property := hx.1 } let x₂ : S₂ := { val := x.2 - φ x.1, property := hx.2 } exact Set.mem_of_eq_of_mem (by rw [hf_inv, sub_add_cancel]) (f.symm (x₁, x₂)).property
pfr/blueprint/src/chapter/hom_pfr.tex:11
pfr/PFR/HomPFR.lean:39
PFR
hahn_banach
\begin{lemma}[Hahn-Banach type theorem]\label{hb-thm}\lean{hahn_banach}\leanok Let $H_0$ be a subgroup of $G$. Then every homomorphism $\phi: H_0 \to G'$ can be extended to a homomorphism $\tilde \phi: G \to G'$. \end{lemma} \begin{proof}\leanok By induction it suffices to treat the case where $H_0$ has index $2$ in $G$, but then the extension can be constructed by hand. \end{proof}
lemma hahn_banach (H₀ : AddSubgroup G) (φ : H₀ →+ G') : ∃ (φ' : G →+ G'), ∀ x : H₀, φ x = φ' x := by let H₀ := AddSubgroup.toZModSubmodule 2 H₀ let φ := (show H₀ →+ G' from φ).toZModLinearMap 2 obtain ⟨φ', hφ'⟩ := φ.exists_extend use φ'; intro x; show φ x = φ'.comp H₀.subtype x; rw [hφ'] /-- Let $H$ be a subgroup of $G \times G'$. Then there exists a subgroup $H_0$ of $G$, a subgroup $H_1$ of $G'$, and a homomorphism $\phi: G \to G'$ such that $$ H := \{ (x, \phi(x) + y): x \in H_0, y \in H_1 \}.$$ In particular, $|H| = |H_0| |H_1|$. -/
pfr/blueprint/src/chapter/hom_pfr.tex:5
pfr/PFR/HomPFR.lean:29
PFR
homomorphism_pfr
\begin{theorem}[Homomorphism form of PFR]\label{hom-pfr}\lean{homomorphism_pfr}\leanok Let $f: G \to G'$ be a function, and let $S$ denote the set $$ S := \{ f(x+y)-f(x)-f(y): x,y \in G \}.$$ Then there exists a homomorphism $\phi: G \to G'$ such that $$ |\{ f(x) - \phi(x): x \in G \}| \leq |S|^{10}.$$ \end{theorem} \begin{proof}\uses{goursat, pfr_aux-improv}\leanok Consider the graph $A \subset G \times G'$ defined by $$ A := \{ (x,f(x)): x \in G \}.$$ Clearly, $|A| = |G|$. By hypothesis, we have $$ A+A \subset \{ (x,f(x)+s): x \in G, s \in S\}$$ and hence $|A+A| \leq |S| |A|$. Applying \Cref{pfr-9-aux'}, we may find a subspace $H \subset G \times G'$ such that $|H|/ |A| \in [|S|^{-8}, |S|^{8}]$ and $A$ is covered by $c + H$ with $|c| \le |S|^5|A|^{1/2} / |H|^{1/2}$. If we let $H_0, H_1$ be as in \Cref{goursat}, this implies on taking projections that $G$ is covered by at most $|c|$ translates of $H_0$. This implies that $$ |c| |H_0| \geq |G|;$$ since $|H_0| |H_1| = |H|$, we conclude that $$ |H_1| \leq |c| |H|/|G| = |c| |H|/|A|.$$ By hypothesis, $A$ is covered by at most $|c|$ translates of $H$, and hence by at most $|c| |H_1|$ translates of $\{ (x,\phi(x)): x \in G \}$. As $\phi$ is a homomorphism, each such translate can be written in the form $\{ (x,\phi(x)+d): x \in G \}$ for some $d \in G'$. Since $$ |c| |H_1| \le |c|^2 \frac{|H|}{|A|} \le \left(|S|^5 \frac{|A|^{1/2}}{|H|^{1/2}}\right)^2 \frac{|H|}{|A|} = |S|^{10}, $$ the result follows. \end{proof}
theorem homomorphism_pfr (f : G → G') (S : Set G') (hS : ∀ x y : G, f (x+y) - (f x) - (f y) ∈ S) : ∃ (φ : G →+ G') (T : Set G'), Nat.card T ≤ Nat.card S ^ 10 ∧ ∀ x : G, (f x) - (φ x) ∈ T := by classical have : 0 < Nat.card G := Nat.card_pos let A := univ.graphOn f have hA_le : (Nat.card ↥(A + A) : ℝ) ≤ Nat.card S * Nat.card A := by let B := A - {0}×ˢS have hAB : A + A ⊆ B := by intro x hx obtain ⟨a, ha, a', ha', haa'⟩ := Set.mem_add.mp hx simp only [mem_graphOn, A] at ha ha' rw [Set.mem_sub] refine ⟨(x.1, f x.1), ?_, (0, f (a.1 + a'.1) - f a.1 - f a'.1), ?_⟩ · simp [A] · simp only [singleton_prod, mem_image, Prod.mk.injEq, true_and, exists_eq_right, Prod.mk_sub_mk, sub_zero] exact ⟨hS a.1 a'.1, by rw [← Prod.fst_add, ha.2, ha'.2, sub_sub, ← Prod.snd_add, haa', sub_sub_self]⟩ have hB_card : Nat.card B ≤ Nat.card S * Nat.card A := natCard_sub_le.trans_eq $ by simp only [mul_comm, Set.card_singleton_prod] norm_cast exact (Nat.card_mono (toFinite B) hAB).trans hB_card have hA_nonempty : A.Nonempty := by simp [A] obtain ⟨H, c, hcS, -, -, hAcH⟩ := better_PFR_conjecture_aux hA_nonempty hA_le have : 0 < Nat.card c := by have : c.Nonempty := by by_contra! H simp only [H, empty_add, subset_empty_iff] at hAcH simp [hAcH] at hA_nonempty exact this.natCard_pos c.toFinite obtain ⟨H₀, H₁, φ, hH₀₁, hH_card⟩ := goursat H have hG_card_le : Nat.card G ≤ Nat.card c * Nat.card H₀ := by let c' := Prod.fst '' c have hc'_card : Nat.card c' ≤ Nat.card c := Nat.card_image_le (toFinite c) have h_fstH : Prod.fst '' (H : Set (G × G')) = H₀:= by ext x; simpa [hH₀₁] using fun _ ↦ ⟨φ x, by simp⟩ have hG_cover : (univ : Set G) = c' + (H₀:Set G) := by apply (eq_univ_of_forall (fun g ↦ ?_)).symm have := image_subset Prod.fst hAcH rw [← AddHom.coe_fst, Set.image_add, AddHom.coe_fst, image_fst_graphOn] at this rw [← h_fstH] exact this (mem_univ g) apply_fun Nat.card at hG_cover rw [Nat.card_coe_set_eq, Set.ncard_univ] at hG_cover rw [hG_cover] calc Nat.card (c' + (H₀ : Set G)) ≤ Nat.card c' * Nat.card H₀ := natCard_add_le _ ≤ Nat.card c * Nat.card H₀ := by gcongr have : (Nat.card H₁ : ℝ) ≤ (Nat.card H / Nat.card A) * Nat.card c := by calc (Nat.card H₁ : ℝ) = (Nat.card H : ℝ) / Nat.card H₀ := by field_simp [hH_card, mul_comm] _ ≤ (Nat.card H : ℝ) / (Nat.card G / Nat.card c) := by gcongr rw [div_le_iff₀' (by positivity)] exact_mod_cast hG_card_le _ = (Nat.card H / Nat.card G : ℝ) * Nat.card c := by field_simp _ = (Nat.card H / Nat.card A) * Nat.card c := by congr; simp [-Nat.card_eq_fintype_card, A] let T := (fun p ↦ p.2 - φ p.1) '' (c + {0} ×ˢ (H₁: Set G')) have := calc A ⊆ c + H := hAcH _ ⊆ c + (({0} ×ˢ (H₁ : Set G')) + {(x, φ x) | x : G}) := by gcongr rintro ⟨g, g'⟩ hg simp only [SetLike.mem_coe, hH₀₁] at hg refine ⟨(0, g' - φ g), ?_, (g, φ g), ?_⟩ · simp only [singleton_prod, mem_image, SetLike.mem_coe, Prod.mk.injEq, true_and, exists_eq_right, hg.2] · simp only [mem_setOf_eq, Prod.mk.injEq, exists_eq_left, Prod.mk_add_mk, zero_add, true_and, sub_add_cancel] _ = ⋃ (a ∈ T), {(x, a + φ x) | x : G} := by rw [← add_assoc, ← vadd_eq_add, ← Set.iUnion_vadd_set, Set.biUnion_image] congr! 3 with a rw [← range, ← range, ← graphOn_univ_eq_range, ← graphOn_univ_eq_range, vadd_graphOn_univ] refine ⟨φ, T, ?_, ?_⟩ · have : (Nat.card T : ℝ) ≤ (Nat.card S : ℝ) ^ (10 : ℝ) := by calc (Nat.card T : ℝ) ≤ Nat.card (c + {(0 : G)} ×ˢ (H₁ : Set G')) := by norm_cast; apply Nat.card_image_le (toFinite _) _ ≤ Nat.card c * Nat.card H₁ := by norm_cast apply natCard_add_le.trans rw [Set.card_singleton_prod] ; rfl _ ≤ Nat.card c * ((Nat.card H / Nat.card A) * Nat.card c) := by gcongr _ = Nat.card c ^ 2 * (Nat.card H / Nat.card A) := by ring _ ≤ (Nat.card S ^ 5 * Nat.card A ^ (1 / 2 : ℝ) * Nat.card H ^ (-1 / 2 : ℝ)) ^ 2 * (Nat.card H / Nat.card A) := by gcongr _ = (Nat.card S : ℝ) ^ (10 : ℝ) := by rw [← Real.rpow_two, div_eq_mul_inv, div_eq_mul_inv, div_eq_mul_inv] have : 0 < Nat.card S := by have : S.Nonempty := ⟨f (0 + 0) - f 0 - f 0, hS 0 0⟩ exact this.natCard_pos S.toFinite have : 0 < Nat.card A := hA_nonempty.natCard_pos A.toFinite have : 0 < Nat.card H := H.nonempty.natCard_pos $ toFinite _ simp_rw [← Real.rpow_natCast] rpow_ring norm_num exact_mod_cast this · intro g specialize this (⟨g, by simp⟩ : (g, f g) ∈ A) simp only [mem_iUnion, mem_setOf_eq, Prod.mk.injEq, exists_eq_left] at this obtain ⟨t, ht, h⟩ := this rw [← h] convert ht abel
pfr/blueprint/src/chapter/hom_pfr.tex:19
pfr/PFR/HomPFR.lean:68
PFR
isUniform_sub_const_of_rdist_eq_zero
\begin{lemma}[Translate is uniform on symmetry group]\label{sym-zero} \lean{isUniform_sub_const_of_rdist_eq_zero}\leanok If $X$ is a $G$-valued random variable with $d[X ;X]=0$, and $x_0$ is a point with $P[X=x_0] > 0$, then $X-x_0$ is uniformly distributed on $\mathrm{Sym}[X]$. \end{lemma} \begin{proof}\uses{zero-large,sym-group-def,uniform-def}\leanok The law of $X-x_0$ is invariant under $\mathrm{Sym}[X]$, non-zero at the origin, and supported on $\mathrm{Sym}[X]$, giving the claim. \end{proof}
lemma isUniform_sub_const_of_rdist_eq_zero (hX : Measurable X) (hdist : d[X # X] = 0) {x₀ : G} (hx₀ : ℙ (X⁻¹' {x₀}) ≠ 0) : IsUniform (symmGroup X hX) (fun ω ↦ X ω - x₀) where eq_of_mem := by have B c z : (fun ω ↦ X ω - c) ⁻¹' {z} = X ⁻¹' {c + z} := by ext w; simp [sub_eq_iff_eq_add'] have A : ∀ (z : G), z ∈ symmGroup X hX → ℙ ((fun ω ↦ X ω - x₀) ⁻¹' {z}) = ℙ ((fun ω ↦ X ω - x₀) ⁻¹' {0}) := by intro z hz have : X ⁻¹' {x₀ + z} = (fun ω ↦ X ω - z) ⁻¹' {x₀} := by simp [B, add_comm] simp_rw [B, add_zero, this] have Z := (mem_symmGroup hX).1 (AddSubgroup.neg_mem (symmGroup X hX) hz) simp [← sub_eq_add_neg] at Z exact Z.symm.measure_mem_eq .of_discrete intro x hx y hy rw [A x hx, A y hy] measure_preimage_compl := by apply (measure_preimage_eq_zero_iff_of_countable (Set.to_countable _)).2 intro x hx contrapose! hx have B : (fun ω ↦ X ω - x₀) ⁻¹' {x} = X ⁻¹' {x₀ + x} := by ext w; simp [sub_eq_iff_eq_add'] rw [B] at hx simpa using sub_mem_symmGroup hX hdist hx hx₀
pfr/blueprint/src/chapter/100_percent.tex:32
pfr/PFR/HundredPercent.lean:112
PFR
iter_multiDist_chainRule
\begin{lemma}\label{multidist-chain-rule-iter}\lean{iter_multiDist_chainRule,iter_multiDist_chainRule'}\leanok Let $m$ be a positive integer. Suppose one has a sequence \begin{equation}\label{g-seq} G_m \to G_{m-1} \to \dots \to G_1 \to G_0 = \{0\} \end{equation} of homomorphisms between abelian groups $G_0,\dots,G_m$, and for each $d=0,\dots,m$, let $\pi_d : G_m \to G_d$ be the homomorphism from $G_m$ to $G_d$ arising from this sequence by composition (so for instance $\pi_m$ is the identity homomorphism and $\pi_0$ is the zero homomorphism). Let $X_{[m]} = (X_i)_{1 \leq i \leq m}$ be a jointly independent tuple of $G_m$-valued random variables. Then \begin{equation} \begin{split} D[ X_{[m]} ] &= \sum_{d=1}^m D[ \pi_d(X_{[m]}) \,|\, \pi_{d-1}(X_{[m]})] \\ &\quad + \sum_{d=1}^{m-1} \bbI[ \sum_i X_i : \pi_d(X_{[m]}) \; \big| \; \pi_d\big(\sum_i X_i\big), \pi_{d-1}(X_{[m]}) ]. \end{split}\label{chain-eq-cond'} \end{equation} In particular, by \Cref{conditional-nonneg}, \begin{align}\nonumber D[ X_{[m]} ] \geq & \sum_{d=1}^m D[ \pi_d(X_{[m]})|\pi_{d-1}(X_{[m]}) ] \\ & + \bbI[ \sum_i X_i : \pi_1(X_{[m]}) \; \big| \; \pi_1\bigl(\sum_i X_i\bigr) ].\label{chain-eq-cond''} \end{align} \end{lemma} \begin{proof}\uses{multidist-chain-rule-cond, conditional-nonneg}\leanok From \Cref{multidist-chain-rule-cond} (taking $Y_{[m]} = \pi_{d-1}(X_{[m]})$ and $\pi = \pi_d$ there, and noting that $\pi_d(X_{[m]})$ determines $Y_{[m]}$) we have \begin{align*} D[ X_{[m]} \,|\, \pi_{d-1}(X_{[m]}) ] &= D[ X_{[m]} \,|\, \pi_d(X_{[m]}) ] + D[ \pi_d(X_{[m]})\,|\,\pi_{d-1}(X_{[m]}) ] \\ &\quad + \bbI[ \sum_{i=1}^m X_i : \pi_d(X_{[m]}) \; \big| \; \pi_d\bigl(\sum_{i=1}^m X_i\bigr), \pi_{d-1}(X_{[m]}) ] \end{align*} for $d=1,\dots,m$. The claim follows by telescoping series, noting that $D[X_{[m]} | \pi_0(X_{[m]})] = D[X_{[m]}]$ and that $\pi_m(X_{[m]})=X_{[m]}$ (and also $\pi_m( \sum_i X_i ) = \sum_i X_i$). \end{proof}
lemma iter_multiDist_chainRule {m : ℕ} {G : Fin (m + 1) → Type*} [hG : ∀ i, MeasurableSpace (G i)] [hGs : ∀ i, MeasurableSingletonClass (G i)] [∀ i, AddCommGroup (G i)] [hGcounT : ∀ i, Fintype (G i)] {φ : ∀ i : Fin m, G (i.succ) →+ G i.castSucc} {π : ∀ d, G m →+ G d} (hcomp: ∀ i : Fin m, π i.castSucc = (φ i) ∘ (π i.succ)) {Ω : Type*} [hΩ : MeasureSpace Ω] {X : Fin m → Ω → (G m)} (hX : ∀ i, Measurable (X i)) (h_indep : iIndepFun X) (n : Fin (m + 1)) : D[X | fun i ↦ (π 0) ∘ X i; fun _ ↦ hΩ] = D[X | fun i ↦ (π n) ∘ X i; fun _ ↦ hΩ] + ∑ d ∈ Finset.Iio n, (D[fun i ↦ (π (d+1)) ∘ X i | fun i ↦ (π d) ∘ X i; fun _ ↦ hΩ] + I[∑ i, X i : fun ω ↦ (fun i ↦ (π (d+1)) (X i ω)) | ⟨(π (d+1)) ∘ ∑ i, X i, fun ω ↦ (fun i ↦ (π d) (X i ω))⟩]) := by set S := ∑ i, X i set motive := fun n:Fin (m + 1) ↦ D[X | fun i ↦ (π 0) ∘ X i; fun _ ↦ hΩ] = D[X | fun i ↦ (π n) ∘ X i; fun _ ↦ hΩ] + ∑ d ∈ Finset.Iio n, (D[fun i ↦ (π (d+1)) ∘ X i | fun i ↦ (π d) ∘ X i; fun _ ↦ hΩ] + I[S : fun ω ↦ (fun i ↦ (π (d+1)) (X i ω)) | ⟨(π (d+1)) ∘ S, fun ω ↦ (fun i ↦ (π d) (X i ω))⟩]) have zero : motive 0 := by have : (Finset.Iio 0 : Finset (Fin (m + 1))) = ∅ := rfl simp [motive, this] have succ : (n : Fin m) → motive n.castSucc → motive n.succ := by intro n hn dsimp [motive] at hn ⊢ have h2 : n.castSucc ∈ Finset.Iio n.succ := by simp only [Nat.succ_eq_add_one, Finset.mem_Iio, Fin.castSucc_lt_succ_iff, le_refl] rw [hn, ← Finset.add_sum_erase _ _ h2, Iio_of_succ_eq_Iic_of_castSucc, Finset.Iic_erase, ← add_assoc, ← add_assoc, Fin.coeSucc_eq_succ] congr 1 convert cond_multiDist_chainRule (X := X) (Y := fun i ↦ ⇑(π n.castSucc) ∘ X i) (π n.succ) hX ?_ ?_ . set g : G n.succ → G n.succ × G n.castSucc := fun x ↦ ⟨x, ⇑(φ n) x⟩ convert (condMultiDist_of_inj (f := g) (fun _ ↦ hΩ) X (fun i ↦ ⇑(π n.succ) ∘ X i) _).symm using 3 with i . ext ω . dsimp [g, prod] rw [hcomp n] simp [g, prod] intro x x' h simp [g] at h exact h.1 . intro _ exact Measurable.comp .of_discrete (hX _) set g : (G m) → (G m) × (G n.castSucc) := fun x ↦ ⟨x, ⇑(π n.castSucc) x⟩ convert iIndepFun.comp h_indep (fun _ ↦ g) _ intro _ exact .of_discrete exact Fin.induction zero succ n
pfr/blueprint/src/chapter/torsion.tex:408
pfr/PFR/MoreRuzsaDist.lean:1358
PFR
iter_multiDist_chainRule'
\begin{lemma}\label{multidist-chain-rule-iter}\lean{iter_multiDist_chainRule,iter_multiDist_chainRule'}\leanok Let $m$ be a positive integer. Suppose one has a sequence \begin{equation}\label{g-seq} G_m \to G_{m-1} \to \dots \to G_1 \to G_0 = \{0\} \end{equation} of homomorphisms between abelian groups $G_0,\dots,G_m$, and for each $d=0,\dots,m$, let $\pi_d : G_m \to G_d$ be the homomorphism from $G_m$ to $G_d$ arising from this sequence by composition (so for instance $\pi_m$ is the identity homomorphism and $\pi_0$ is the zero homomorphism). Let $X_{[m]} = (X_i)_{1 \leq i \leq m}$ be a jointly independent tuple of $G_m$-valued random variables. Then \begin{equation} \begin{split} D[ X_{[m]} ] &= \sum_{d=1}^m D[ \pi_d(X_{[m]}) \,|\, \pi_{d-1}(X_{[m]})] \\ &\quad + \sum_{d=1}^{m-1} \bbI[ \sum_i X_i : \pi_d(X_{[m]}) \; \big| \; \pi_d\big(\sum_i X_i\big), \pi_{d-1}(X_{[m]}) ]. \end{split}\label{chain-eq-cond'} \end{equation} In particular, by \Cref{conditional-nonneg}, \begin{align}\nonumber D[ X_{[m]} ] \geq & \sum_{d=1}^m D[ \pi_d(X_{[m]})|\pi_{d-1}(X_{[m]}) ] \\ & + \bbI[ \sum_i X_i : \pi_1(X_{[m]}) \; \big| \; \pi_1\bigl(\sum_i X_i\bigr) ].\label{chain-eq-cond''} \end{align} \end{lemma} \begin{proof}\uses{multidist-chain-rule-cond, conditional-nonneg}\leanok From \Cref{multidist-chain-rule-cond} (taking $Y_{[m]} = \pi_{d-1}(X_{[m]})$ and $\pi = \pi_d$ there, and noting that $\pi_d(X_{[m]})$ determines $Y_{[m]}$) we have \begin{align*} D[ X_{[m]} \,|\, \pi_{d-1}(X_{[m]}) ] &= D[ X_{[m]} \,|\, \pi_d(X_{[m]}) ] + D[ \pi_d(X_{[m]})\,|\,\pi_{d-1}(X_{[m]}) ] \\ &\quad + \bbI[ \sum_{i=1}^m X_i : \pi_d(X_{[m]}) \; \big| \; \pi_d\bigl(\sum_{i=1}^m X_i\bigr), \pi_{d-1}(X_{[m]}) ] \end{align*} for $d=1,\dots,m$. The claim follows by telescoping series, noting that $D[X_{[m]} | \pi_0(X_{[m]})] = D[X_{[m]}]$ and that $\pi_m(X_{[m]})=X_{[m]}$ (and also $\pi_m( \sum_i X_i ) = \sum_i X_i$). \end{proof}
lemma iter_multiDist_chainRule' {m : ℕ} (hm : m > 0) {G : Fin (m + 1) → Type*} [hG : ∀ i, MeasurableSpace (G i)] [hGs : ∀ i, MeasurableSingletonClass (G i)] [hGa : ∀ i, AddCommGroup (G i)] [hGcount : ∀ i, Fintype (G i)] {φ : ∀ i : Fin m, G (i.succ) →+ G i.castSucc} {π : ∀ d, G m →+ G d} (hπ0 : π 0 = 0) (hcomp : ∀ i : Fin m, π i.castSucc = (φ i) ∘ (π i.succ)) {Ω : Type*} [hΩ : MeasureSpace Ω] {X : Fin m → Ω → (G m)} (hX : ∀ i, Measurable (X i)) (h_indep : iIndepFun X) : D[X; fun _ ↦ hΩ] ≥ ∑ d : Fin m, D[fun i ↦ (π (d.succ)) ∘ X i | fun i ↦ (π d.castSucc) ∘ X i; fun _ ↦ hΩ] + I[∑ i : Fin m, X i : fun ω i ↦ (π 1) (X i ω)| ⇑(π 1) ∘ ∑ i : Fin m, X i] := by have : IsProbabilityMeasure (ℙ : Measure Ω) := h_indep.isProbabilityMeasure calc _ = D[X | fun i ↦ ⇑(π 0) ∘ X i ; fun _x ↦ hΩ] := by rw [hπ0] convert (condMultiDist_of_const (fun _ ↦ (0: G 0)) X).symm _ = D[X | fun i ↦ ⇑(π m) ∘ X i ; fun _ ↦ hΩ] + ∑ d ∈ Finset.Iio (m : Fin (m + 1)), (D[fun i ↦ ⇑(π (d + 1)) ∘ X i | fun i ↦ π d ∘ X i ; fun _ ↦ hΩ] + I[∑ i : Fin m, X i : fun ω i ↦ (π (d + 1)) (X i ω)|⟨⇑(π (d + 1)) ∘ ∑ i : Fin m, X i, fun ω i ↦ (π d) (X i ω)⟩]) := iter_multiDist_chainRule hcomp hX h_indep (m : Fin (m + 1)) _ ≥ ∑ d ∈ Finset.Iio (m : Fin (m + 1)), (D[fun i ↦ ⇑(π (d + 1)) ∘ X i | fun i ↦ π d ∘ X i ; fun _ ↦ hΩ] + I[∑ i : Fin m, X i : fun ω i ↦ (π (d + 1)) (X i ω)|⟨⇑(π (d + 1)) ∘ ∑ i : Fin m, X i, fun ω i ↦ (π d) (X i ω)⟩]) := by apply le_add_of_nonneg_left (condMultiDist_nonneg _ (fun _ => this) X _ hX) _ = ∑ d : Fin m, (D[fun i ↦ ⇑(π (d.succ)) ∘ X i | fun i ↦ ⇑(π d.castSucc) ∘ X i ; fun _ ↦ hΩ] + I[∑ i : Fin m, X i : fun ω i ↦ π d.succ (X i ω)|⟨π d.succ ∘ ∑ i : Fin m, X i, fun ω i ↦ π d (X i ω)⟩]) := by rw [sum_of_iio_last] congr with d rw [Fin.coeSucc_eq_succ, Fin.coe_eq_castSucc] _ ≥ _ := by rw [Finset.sum_add_distrib] gcongr have : NeZero m := ⟨hm.ne'⟩ let f (i : Fin m) := I[∑ i', X i' : fun ω i' ↦ π i.succ (X i' ω)| ⟨π i.succ ∘ ∑ i', X i', fun ω i' ↦ π i (X i' ω)⟩] have hf i : 0 ≤ f i := condMutualInfo_nonneg (by fun_prop) (by fun_prop) let F (x : G 1) : G 1 × (Fin m → G 0) := (x, fun _ ↦ 0) have hF : Injective F := fun x y ↦ congr_arg Prod.fst calc I[∑ i, X i : fun ω i ↦ π 1 (X i ω) | π 1 ∘ ∑ i, X i] = I[∑ i, X i : fun ω i ↦ π 1 (X i ω) | F ∘ π 1 ∘ ∑ i, X i] := by exact (condMutualInfo_of_inj (by fun_prop) (by fun_prop) (by fun_prop) _ hF).symm _ = f 0 := ?_ _ ≤ ∑ j, f j := Finset.single_le_sum (f := f) (fun _ _ ↦ hf _) (Finset.mem_univ _) . simp [f] simp [hπ0, AddMonoidHom.zero_apply, comp_apply, Finset.sum_apply, _root_.map_sum, F, Fin.succ_zero_eq_one'] congr any_goals congr! any_goals simp [Fin.succ_zero_eq_one'] simp [Function.comp_def] sorry /-- Let `G` be an abelian group and let `m ≥ 2`. Suppose that `X_{i,j}`, `1 ≤ i, j ≤ m`, are independent `G`-valued random variables. Then `I[(∑ i, X_{i,j})_{j=1}^m : (∑ j, X_{i,j})_{i=1}^m | ∑ i j, X_{i,j}]` is less than `∑_{j=1}^{m-1} (D[(X_{i, j})_{i=1}^m] - D[(X_{i, j})_{i = 1}^m | (X_{i,j} + ... + X_{i,m})_{i=1}^m])` `+ D[(X_{i,m})_{i=1}^m] - D[(∑ j, X_{i,j})_{i=1}^m],` where all the multidistances here involve the indexing set `{1, ..., m}`. -/
pfr/blueprint/src/chapter/torsion.tex:408
pfr/PFR/MoreRuzsaDist.lean:1427
PFR
kaimanovich_vershik
\begin{lemma}[Kaimanovich-Vershik-Madiman inequality]\label{kv} \lean{kaimanovich_vershik}\leanok Suppose that $X, Y, Z$ are independent $G$-valued random variables. Then \[ \bbH[X + Y + Z] - \bbH[X + Y] \leq \bbH[Y+ Z] - \bbH[Y]. \] \end{lemma} \begin{proof}\uses{submodularity, add-entropy, relabeled-entropy}\leanok From \Cref{submodularity} we have $$ \bbH[X, X + Y+ Z] + \bbH[Z, X + Y+ Z] \geq \bbH[X, Z, X + Y+ Z] + \bbH[X + Y+ Z].$$ However, using Lemmas \ref{add-entropy}, \ref{relabeled-entropy} repeatedly we have $\bbH[X, X + Y+ Z] = \bbH[X, Y+ Z] = \bbH[X] + \bbH[Y+ Z]$, $\bbH[Z, X + Y + Z] = \bbH[Z, X + Y] = \bbH[Z] + \bbH[X + Y]$ and $\bbH[X, Z, X + Y+ Z] = \bbH[X, Y, Z] = \bbH[X] + \bbH[Y] + \bbH[Z]$. The claim then follows from a calculation. \end{proof}
/-- The **Kaimanovich-Vershik inequality**. `H[X + Y + Z] - H[X + Y] ≤ H[Y + Z] - H[Y]`. -/ lemma kaimanovich_vershik {X Y Z : Ω → G} (h : iIndepFun ![X, Y, Z] μ) (hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) [FiniteRange X] [FiniteRange Z] [FiniteRange Y] : H[X + Y + Z ; μ] - H[X + Y ; μ] ≤ H[Y + Z ; μ] - H[Y ; μ] := by have : IsProbabilityMeasure μ := h.isProbabilityMeasure suffices (H[X ; μ] + H[Y ; μ] + H[Z ; μ]) + H[X + Y + Z ; μ] ≤ (H[X ; μ] + H[Y + Z ; μ]) + (H[Z ; μ] + H[X + Y ; μ]) by linarith have : ∀ (i : Fin 3), Measurable (![X, Y, Z] i) := fun i ↦ by fin_cases i <;> assumption convert entropy_triple_add_entropy_le μ hX hZ (show Measurable (X + (Y + Z)) by fun_prop) using 2 · calc H[X ; μ] + H[Y ; μ] + H[Z ; μ] = H[⟨X, Y⟩ ; μ] + H[Z ; μ] := by rw [IndepFun.entropy_pair_eq_add hX hY] convert h.indepFun (show 0 ≠ 1 by decide) _ = H[⟨⟨X, Y⟩, Z⟩ ; μ] := by rw [IndepFun.entropy_pair_eq_add (hX.prodMk hY) hZ] exact h.indepFun_prodMk this 0 1 2 (by decide) (by decide) _ = H[⟨X, ⟨Z , X + (Y + Z)⟩⟩ ; μ] := by apply entropy_of_comp_eq_of_comp μ (by fun_prop) (by fun_prop) (fun ((x, y), z) ↦ (x, z, x + y + z)) (fun (a, b, c) ↦ ((a, c - a - b), b)) all_goals { funext ω; dsimp [prod]; ext <;> dsimp; abel } · rw [add_assoc] · symm refine (entropy_add_right hX (by fun_prop) _).trans $ IndepFun.entropy_pair_eq_add hX (by fun_prop) ?_ exact h.indepFun_add_right this 0 1 2 (by decide) (by decide) · rw [eq_comm, ← add_assoc] refine (entropy_add_right' hZ (by fun_prop) _).trans $ IndepFun.entropy_pair_eq_add hZ (by fun_prop) ?_ exact h.indepFun_add_right this 2 0 1 (by decide) (by decide)
pfr/blueprint/src/chapter/distance.tex:237
pfr/PFR/ForMathlib/Entropy/RuzsaDist.lean:1111
PFR
kvm_ineq_I
\begin{lemma}[Kaimonovich--Vershik--Madiman inequality]\label{klm-1}\lean{kvm_ineq_I}\leanok If $n \geq 0$ and $X, Y_1, \dots, Y_n$ are jointly independent $G$-valued random variables, then $$\bbH\left[X + \sum_{i=1}^n Y_i\right] - \bbH[X] \leq \sum_{i=1}^n \left(\bbH[X+Y_i] - \bbH[X]\right).$$ \end{lemma} \begin{proof}\uses{kv}\leanok This is trivial for $n=0,1$, while the $n=2$ case is \Cref{kv}. Now suppose inductively that $n > 2$, and the claim was already proven for $n-1$. By a further application of \Cref{kv} one has $$ \bbH\left[X + \sum_{i=1}^n Y_i\right] - \bbH\left[X + \sum_{i=1}^{n-1} Y_i\right] \leq \bbH[X+Y_n] - \bbH[X].$$ By induction hypothesis one has $$ \bbH\left[X + \sum_{i=1}^{n-1} Y_i\right] - \bbH[X] \leq \sum_{i=1}^{n-1} \bbH[X+Y_i] - \bbH[X].$$ Summing the two inequalities, we obtain the claim. \end{proof}
lemma kvm_ineq_I {I : Type*} {i₀ : I} {s : Finset I} (hs : ¬ i₀ ∈ s) {Y : I → Ω → G} [∀ i, FiniteRange (Y i)] (hY : (i : I) → Measurable (Y i)) (h_indep : iIndepFun Y μ) : H[Y i₀ + ∑ i ∈ s, Y i ; μ] - H[Y i₀ ; μ] ≤ ∑ i ∈ s, (H[Y i₀ + Y i ; μ] - H[Y i₀ ; μ]) := by classical induction s using Finset.induction_on with | empty => simp | @insert i s hi IH => simp_rw [Finset.sum_insert hi] have his : i₀ ∉ s := fun h ↦ hs (Finset.mem_insert_of_mem h) have hii₀ : i ≠ i₀ := fun h ↦ hs (h ▸ Finset.mem_insert_self i s) let J := Fin 3 let S : J → Finset I := ![s, {i₀}, {i}] have h_dis : Set.univ.PairwiseDisjoint S := by intro j _ k _ hjk change Disjoint (S j) (S k) fin_cases j <;> fin_cases k <;> try exact (hjk rfl).elim all_goals simp_all [Fin.isValue, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Finset.disjoint_singleton_right, S, his, hi, hjk, hs] let φ : (j : J) → ((_ : S j) → G) → G | 0 => fun Ys ↦ ∑ i : s, Ys ⟨i.1, i.2⟩ | 1 => fun Ys ↦ Ys ⟨i₀, by simp [S]⟩ | 2 => fun Ys ↦ Ys ⟨i, by simp [S]⟩ have hφ : (j : J) → Measurable (φ j) := fun j ↦ .of_discrete have h_ind : iIndepFun ![∑ j ∈ s, Y j, Y i₀, Y i] μ := by convert iIndepFun.finsets_comp S h_dis h_indep hY φ hφ with j x fin_cases j <;> simp [φ, (s.sum_attach _).symm] have measSum : Measurable (∑ j ∈ s, Y j) := by convert Finset.measurable_sum s (fun j _ ↦ hY j) simp have hkv := kaimanovich_vershik h_ind measSum (hY i₀) (hY i) convert add_le_add (IH his) hkv using 1 · nth_rw 2 [add_comm (Y i₀)] norm_num congr 1 rw [add_comm _ (Y i₀), add_comm (Y i), add_assoc] · ring /-- If `n ≥ 1` and `X, Y₁, ..., Yₙ`$ are jointly independent `G`-valued random variables, then `d[Y i₀; μ # ∑ i ∈ s, Y i; μ] ≤ 2 * ∑ i ∈ s, d[Y i₀; μ # Y i; μ]`.-/
pfr/blueprint/src/chapter/torsion.tex:73
pfr/PFR/MoreRuzsaDist.lean:357
PFR
kvm_ineq_II
\begin{lemma}[Kaimonovich--Vershik--Madiman inequality, II]\label{klm-2}\lean{kvm_ineq_II}\leanok If $n \geq 1$ and $X, Y_1, \dots, Y_n$ are jointly independent $G$-valued random variables, then $$ d[X; \sum_{i=1}^n Y_i] \leq 2 \sum_{i=1}^n d[X; Y_i].$$ \end{lemma} \begin{proof}\uses{klm-1, neg-ent, ruz-indep, sumset-lower, ruzsa-diff}\leanok Applying \Cref{klm-1} with all the $Y_i$ replaced by $-Y_i$, and using \Cref{neg-ent} and \Cref{ruz-indep}, we obtain after some rearranging $$ d[X; \sum_{i=1}^n Y_i] + \frac{1}{2} (\bbH[\sum_{i=1}^n Y_i] - \bbH[X]) \leq \sum_{i=1}^n \left(d[X;Y_i] + \frac{1}{2} (\bbH[Y_i] - \bbH[X])\right).$$ From \Cref{sumset-lower} we have $$ \bbH[\sum_{i=1}^n Y_i] \geq \bbH[Y_i]$$ for all $i$; subtracting $\bbH[X]$ and averaging, we conclude that $$ \bbH[\sum_{i=1}^n Y_i] - \bbH[X] \geq \frac{1}{n} \sum_{i=1}^n \bbH[Y_i] - \bbH[X]$$ and thus $$ d[X; \sum_{i=1}^n Y_i] \leq \sum_{i=1}^n d[X;Y_i] + \frac{n-1}{2n} (\bbH[Y_i] - \bbH[X]).$$ From \Cref{ruzsa-diff} we have $$ \bbH[Y_i] - \bbH[X] \leq 2 d[X;Y_i].$$ Since $0 \leq \frac{n-1}{2n} \leq \frac{1}{2}$, the claim follows. \end{proof}
lemma kvm_ineq_II {I : Type*} {i₀ : I} {s : Finset I} (hs : ¬ i₀ ∈ s) (hs' : Finset.Nonempty s) {Y : I → Ω → G} [∀ i, FiniteRange (Y i)] (hY : (i : I) → Measurable (Y i)) (h_indep : iIndepFun Y μ) : d[Y i₀; μ # ∑ i ∈ s, Y i; μ] ≤ 2 * ∑ i ∈ s, d[Y i₀; μ # Y i; μ] := by classical have : IsProbabilityMeasure μ := h_indep.isProbabilityMeasure let φ i : G → G := if i = i₀ then id else - id have hφ i : Measurable (φ i) := .of_discrete let Y' i : Ω → G := φ i ∘ Y i have mnY : (i : I) → Measurable (Y' i) := fun i ↦ (hφ i).comp (hY i) have h_indep2 : IndepFun (Y i₀) (∑ i ∈ s, Y i) μ := iIndepFun.indepFun_finset_sum_of_not_mem h_indep (fun i ↦ hY i) hs |>.symm have ineq4 : d[Y i₀; μ # ∑ i ∈ s, Y i; μ] + 1/2 * (H[∑ i ∈ s, Y i; μ] - H[Y i₀; μ]) ≤ ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + 1/2 * (H[Y i; μ] - H[Y i₀; μ])) := by calc _ = H[Y i₀ - ∑ i ∈ s, Y i ; μ] - H[Y i₀ ; μ] := by rw [IndepFun.rdist_eq h_indep2 (hY i₀) (by fun_prop)] ring _ = H[Y' i₀ + ∑ x ∈ s, Y' x ; μ] - H[Y' i₀ ; μ] := by simp [Y', φ, sub_eq_add_neg, ← Finset.sum_neg_distrib] congr! 3 with i hi simp [ne_of_mem_of_not_mem hi hs, Pi.neg_comp] _ ≤ ∑ x ∈ s, (H[Y' i₀ + Y' x ; μ] - H[Y' i₀ ; μ]) := kvm_ineq_I hs mnY (h_indep.comp φ hφ) _ = ∑ i ∈ s, (H[Y i₀ - Y i ; μ] - H[Y i₀ ; μ]) := by congr! 1 with i hi; simp [Y', φ, ne_of_mem_of_not_mem hi hs, Pi.neg_comp, sub_eq_add_neg] _ = _ := by refine Finset.sum_congr rfl fun i hi ↦ ?_ rw [IndepFun.rdist_eq (h_indep.indepFun (ne_of_mem_of_not_mem hi hs).symm) (hY i₀) (hY i)] ring replace ineq4 : d[Y i₀; μ # ∑ i ∈ s, Y i; μ] ≤ ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + 1/2 * (H[Y i; μ] - H[Y i₀; μ])) - 1/2 * (H[∑ i ∈ s, Y i; μ] - H[Y i₀; μ]) := le_tsub_of_add_le_right ineq4 have ineq5 (j : I) (hj : j ∈ s) : H[Y j ; μ] ≤ H[∑ i ∈ s, Y i; μ] := max_entropy_le_entropy_sum hj hY h_indep have ineq6 : (s.card : ℝ)⁻¹ * ∑ i ∈ s, (H[Y i; μ] - H[Y i₀; μ]) ≤ H[∑ i ∈ s, Y i; μ] - H[Y i₀; μ] := by rw [inv_mul_le_iff₀ (by exact_mod_cast Finset.card_pos.mpr hs'), ← smul_eq_mul, Nat.cast_smul_eq_nsmul, ← Finset.sum_const] refine Finset.sum_le_sum fun i hi ↦ ?_ gcongr exact ineq5 i hi have ineq7 : d[Y i₀; μ # ∑ i ∈ s, Y i; μ] ≤ ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + (s.card - 1) / (2 * s.card) * (H[Y i; μ] - H[Y i₀; μ])) := by calc _ ≤ ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + 1/2 * (H[Y i; μ] - H[Y i₀; μ])) - 1/2 * (H[∑ i ∈ s, Y i; μ] - H[Y i₀; μ]) := ineq4 _ ≤ ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + 1/2 * (H[Y i; μ] - H[Y i₀; μ])) - 1/2 * ((s.card : ℝ)⁻¹ * ∑ i ∈ s, (H[Y i; μ] - H[Y i₀; μ])) := by gcongr _ = ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + 1/2 * (H[Y i; μ] - H[Y i₀; μ]) - 1/2 * ((s.card : ℝ)⁻¹ * (H[Y i; μ] - H[Y i₀; μ]))) := by rw [Finset.mul_sum, Finset.mul_sum, ← Finset.sum_sub_distrib] _ = ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + (s.card - 1) / (2 * s.card) * (H[Y i; μ] - H[Y i₀; μ])) := by refine Finset.sum_congr rfl fun i _ ↦ ?_ rw [add_sub_assoc, ← mul_assoc, ← sub_mul] field_simp have ineq8 (i : I) : H[Y i; μ] - H[Y i₀; μ] ≤ 2 * d[Y i₀; μ # Y i; μ] := by calc _ ≤ |H[Y i₀ ; μ] - H[Y i ; μ]| := by rw [← neg_sub] exact neg_le_abs _ _ ≤ 2 * d[Y i₀; μ # Y i; μ] := diff_ent_le_rdist (hY i₀) (hY i) calc _ ≤ ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + (s.card - 1) / (2 * s.card) * (H[Y i; μ] - H[Y i₀; μ])) := ineq7 _ ≤ ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + (s.card - 1) / s.card * d[Y i₀; μ # Y i; μ]) := by simp_rw [div_eq_mul_inv, mul_inv, mul_comm (2 : ℝ)⁻¹, mul_assoc] gcongr ∑ i ∈ s, (d[Y i₀ ; μ # Y i ; μ] + (s.card - 1) * ((s.card : ℝ)⁻¹ * ?_)) · simp only [sub_nonneg, Nat.one_le_cast] exact Nat.one_le_iff_ne_zero.mpr <| Finset.card_ne_zero.mpr hs' · exact (inv_mul_le_iff₀ zero_lt_two).mpr (ineq8 _) _ ≤ ∑ i ∈ s, (d[Y i₀; μ # Y i; μ] + d[Y i₀; μ # Y i; μ]) := by gcongr ∑ i ∈ s, (d[Y i₀ ; μ # Y i ; μ] + ?_) with i refine mul_le_of_le_one_left (rdist_nonneg (hY i₀) (hY i)) ?_ exact (div_le_one (Nat.cast_pos.mpr <| Finset.card_pos.mpr hs')).mpr (by simp) _ = 2 * ∑ i ∈ s, d[Y i₀ ; μ # Y i ; μ] := by ring_nf exact (Finset.sum_mul _ _ _).symm
pfr/blueprint/src/chapter/torsion.tex:84
pfr/PFR/MoreRuzsaDist.lean:398
PFR
kvm_ineq_III
\begin{lemma}[Kaimonovich--Vershik--Madiman inequality, III]\label{klm-3}\lean{kvm_ineq_III}\leanok If $n \geq 1$ and $X, Y_1, \dots, Y_n$ are jointly independent $G$-valued random variables, then $$d\left[X; \sum_{i=1}^n Y_i\right] \leq d\left[X; Y_1\right] + \frac{1}{2}\left(\bbH\left[ \sum_{i=1}^n Y_i\right] - \bbH[Y_1]\right).$$ \end{lemma} \begin{proof}\uses{kv, ruz-indep}\leanok From \Cref{kv} one has $$ \bbH\left[-X + \sum_{i=1}^n Y_i\right] \leq \bbH[ - X + Y_1 ] + \bbH\left[ \sum_{i=1}^n Y_i \right] - \bbH[Y_1].$$ The claim then follows from \Cref{ruz-indep} and some elementary algebra. \end{proof}
lemma kvm_ineq_III {I : Type*} {i₀ i₁ : I} {s : Finset I} (hs₀ : ¬ i₀ ∈ s) (hs₁ : ¬ i₁ ∈ s) (h01 : i₀ ≠ i₁) (Y : I → Ω → G) [∀ i, FiniteRange (Y i)] (hY : ∀ i, Measurable (Y i)) (h_indep : iIndepFun Y μ) : d[Y i₀; μ # Y i₁ + ∑ i ∈ s, Y i; μ] ≤ d[Y i₀; μ # Y i₁; μ] + (2 : ℝ)⁻¹ * (H[Y i₁ + ∑ i ∈ s, Y i; μ] - H[Y i₁; μ]) := by let J := Fin 3 let S : J → Finset I := ![{i₀}, {i₁}, s] have h_dis : Set.univ.PairwiseDisjoint S := by intro j _ k _ hjk change Disjoint (S j) (S k) fin_cases j <;> fin_cases k <;> try exact (hjk rfl).elim all_goals simp_all [Fin.isValue, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Finset.disjoint_singleton_right, S, hs₀, hs₁, h01, h01.symm] let φ : (j : J) → ((_ : S j) → G) → G | 0 => fun Ys ↦ Ys ⟨i₀, by simp [S]⟩ | 1 => fun Ys ↦ Ys ⟨i₁, by simp [S]⟩ | 2 => fun Ys ↦ ∑ i : s, Ys ⟨i.1, i.2⟩ have hφ : (j : J) → Measurable (φ j) := fun j ↦ .of_discrete have h_indep' : iIndepFun ![Y i₀, Y i₁, ∑ i ∈ s, Y i] μ := by convert iIndepFun.finsets_comp S h_dis h_indep hY φ hφ with j x fin_cases j <;> simp [φ, (s.sum_attach _).symm] exact kvm_ineq_III_aux (hY i₀) (hY i₁) (by fun_prop) h_indep' open Classical in /-- Let `X₁, ..., Xₘ` and `Y₁, ..., Yₗ` be tuples of jointly independent random variables (so the `X`'s and `Y`'s are also independent of each other), and let `f: {1,..., l} → {1,... ,m}` be a function, then `H[∑ j, Y j] ≤ H[∑ i, X i] + ∑ j, H[Y j - X f(j)] - H[X_{f(j)}]`.-/
pfr/blueprint/src/chapter/torsion.tex:102
pfr/PFR/MoreRuzsaDist.lean:493
PFR
multiDist
\begin{definition}[Multidistance]\label{multidist-def}\lean{multiDist}\leanok Let $m$ be a positive integer, and let $X_{[m]} = (X_i)_{1 \leq i \leq m}$ be an $m$-tuple of $G$-valued random variables $X_i$. Then we define \[ D[X_{[m]}] := \bbH[\sum_{i=1}^m \tilde X_i] - \frac{1}{m} \sum_{i=1}^m \bbH[\tilde X_i], \] where the $\tilde X_i$ are independent copies of the $X_i$. \end{definition}
def multiDist {m : ℕ} {Ω : Fin m → Type*} (hΩ : ∀ i, MeasureSpace (Ω i)) (X : ∀ i, (Ω i) → G) : ℝ := H[fun x ↦ ∑ i, x i; .pi (fun i ↦ (hΩ i).volume.map (X i))] - (m:ℝ)⁻¹ * ∑ i, H[X i] @[inherit_doc multiDist] notation3:max "D[" X " ; " hΩ "]" => multiDist hΩ X
pfr/blueprint/src/chapter/torsion.tex:164
pfr/PFR/MoreRuzsaDist.lean:717
PFR
multiDist_chainRule
\begin{lemma}[Multidistance chain rule]\label{multidist-chain-rule}\lean{multiDist_chainRule}\uses{multidist-def}\leanok Let $\pi \colon G \to H$ be a homomorphism of abelian groups and let $X_{[m]}$ be a tuple of jointly independent $G$-valued random variables. Then $D[X_{[m]}]$ is equal to \begin{equation} D[ X_{[m]} | \pi(X_{[m]}) ] +D[ \pi(X_{[m]}) ] + \bbI[ \sum_{i=1}^m X_i : \pi(X_{[m]}) \; \big| \; \pi\bigl(\sum_{i=1}^m X_i\bigr) ] \label{chain-eq} \end{equation} where $\pi(X_{[m]}) := (\pi(X_i))_{1 \leq i \leq m}$. \end{lemma} \begin{proof}\uses{conditional-mutual-alt, relabeled-entropy, chain-rule}\leanok For notational brevity during this proof, write $S := \sum_{i=1}^m X_i$. From \Cref{conditional-mutual-alt} and \Cref{relabeled-entropy}, noting that $\pi(S)$ is determined both by $S$ and by $\pi(X_{[m]})$, we have \begin{equation*} \bbI[S:\pi(X_{[m]})|\pi(S)] = \bbH[S]+\bbH[\pi(X_{[m]})]-\bbH[S,\pi(X_{[m]})]-\bbH[\pi(S)], \end{equation*} and by \Cref{chain-rule} the right-hand side is equal to \begin{equation*} \bbH[S]-\bbH[S|\pi(X_{[m]})]-\bbH[\pi(S)]. \end{equation*} Therefore, \begin{equation}\label{chain-1} \bbH[S]=\bbH[S|\pi(X_{[m]})]+\bbH[\pi(S)]+\bbI[S:\pi(X_{[m]})|\pi(S)]. \end{equation} From a further application of \Cref{chain-rule} and \Cref{relabeled-entropy} we have \begin{equation}\label{chain-2} \bbH[X_i] = \bbH[X_i \, | \, \pi(X_i)] + \bbH[\pi(X_i)] \end{equation} for all $1 \leq i \leq m$. Averaging~\eqref{chain-2} in $i$ and subtracting this from~\eqref{chain-1}, we obtain the claim from \Cref{multidist-def}. \end{proof}
lemma multiDist_chainRule {G H : Type*} [hG : MeasurableSpace G] [MeasurableSingletonClass G] [AddCommGroup G] [Fintype G] [hH : MeasurableSpace H] [MeasurableSingletonClass H] [AddCommGroup H] [Fintype H] (π : G →+ H) {m : ℕ} {Ω : Type*} (hΩ : MeasureSpace Ω) {X : Fin m → Ω → G} (hmes : ∀ i, Measurable (X i)) (h_indep : iIndepFun X) : D[X; fun _ ↦ hΩ] = D[X | fun i ↦ π ∘ X i; fun _ ↦ hΩ] + D[fun i ↦ π ∘ X i; fun _ ↦ hΩ] + I[∑ i, X i : fun ω ↦ (fun i ↦ π (X i ω)) | π ∘ (∑ i, X i)] := by have : IsProbabilityMeasure (ℙ : Measure Ω) := h_indep.isProbabilityMeasure set S := ∑ i, X i set piX := fun ω ↦ (fun i ↦ π (X i ω)) set avg_HX := (∑ i, H[X i]) / m set avg_HpiX := (∑ i, H[π ∘ X i])/m set avg_HXpiX := (∑ i, H[X i | π ∘ X i])/m have hSmes : Measurable S := by fun_prop have hpiXmes : Measurable piX := by rw [measurable_pi_iff] intro i exact Measurable.comp .of_discrete (hmes i) have eq1 : I[S : piX | π ∘ S] = H[S | π ∘ S] + H[piX | π ∘ S] - H[⟨S, piX⟩ | π ∘ S] := by rw [condMutualInfo_eq hSmes hpiXmes (Measurable.comp .of_discrete hSmes)] have eq1a : H[S | π ∘ S] = H[S] - H[π ∘ S] := condEntropy_comp_self hSmes .of_discrete have eq1b : H[piX | π ∘ S] = H[piX] - H[π ∘ S] := by set g := fun (y : Fin m → H) ↦ ∑ i, y i have : π ∘ S = g ∘ piX := by ext x simp only [comp_apply, Finset.sum_apply, _root_.map_sum, S, g, piX] rw [this] exact condEntropy_comp_self hpiXmes .of_discrete have eq1c : H[⟨S, piX⟩ | π ∘ S] = H[⟨S, piX⟩] - H[π ∘ S] := by set g := fun (x : G × (Fin m → H)) ↦ π x.1 have : π ∘ S = g ∘ ⟨S, piX⟩ := by ext x simp only [comp_apply, Finset.sum_apply, _root_.map_sum, S, g, piX] rw [this] apply condEntropy_comp_self (Measurable.prodMk hSmes hpiXmes) .of_discrete have eq2 : H[⟨S, piX⟩] = H[piX] + H[S | piX] := chain_rule _ hSmes hpiXmes have eq3 : D[X; fun _ ↦ hΩ] = H[S] - avg_HX := multiDist_indep _ _ h_indep have eq4 : D[X | fun i ↦ π ∘ X i; fun _ ↦ hΩ] = H[S | piX] - avg_HXpiX := by dsimp [S, piX] convert condMultiDist_eq (S := H) hmes _ _ . exact Fintype.sum_apply _ _ . intro i exact Measurable.comp .of_discrete (hmes i) set g : G → G × H := fun x ↦ ⟨x, π x⟩ change iIndepFun (fun i ↦ g ∘ X i) ℙ exact h_indep.comp _ fun _ ↦ .of_discrete have eq5: D[fun i ↦ π ∘ X i; fun _ ↦ hΩ] = H[π ∘ S] - avg_HpiX := by convert multiDist_indep _ (fun i ↦ π ∘ X i) _ . ext _ simp only [comp_apply, Finset.sum_apply, _root_.map_sum, S] apply iIndepFun.comp h_indep exact fun _ ↦ .of_discrete have eq6: avg_HX = avg_HpiX + avg_HXpiX := by dsimp [avg_HX, avg_HpiX, avg_HXpiX] rw [← add_div, ← Finset.sum_add_distrib] congr with i rw [condEntropy_comp_self (hmes i) .of_discrete] abel linarith only [eq1, eq1a, eq1b, eq1c, eq2, eq3, eq4, eq5, eq6] /-- Let `π : G → H` be a homomorphism of abelian groups. Let `I` be a finite index set and let `X_[m]` be a tuple of `G`-valued random variables. Let `Y_[m]` be another tuple of random variables (not necessarily `G`-valued). Suppose that the pairs `(X_i, Y_i)` are jointly independent of one another (but `X_i` need not be independent of `Y_i`). Then `D[X_[m] | Y_[m]] = D[X_[m] ,|, π(X_[m]), Y_[m]] + D[π(X_[m]) ,| , Y_[m]]` `+ I[∑ i, X_i : π(X_[m]) ; | ; π(∑ i, X_i), Y_[m]]`. -/
pfr/blueprint/src/chapter/torsion.tex:360
pfr/PFR/MoreRuzsaDist.lean:1111
PFR
multiDist_copy
\begin{lemma}[Multidistance of copy]\label{multidist-copy}\lean{multiDist_copy}\leanok If $X_{[m]} = (X_i)_{1 \leq i \leq m}$ and $Y_{[m]} = (Y_i)_{1 \leq i \leq m}$ are such that $X_i$ and $Y_i$ have the same distribution for each $i$, then $D[X_{[m]}] = D[Y_{[m]}]$. \end{lemma} \begin{proof}\uses{multidist-def}\leanok Clear from Lemma \ref{copy-ent}. \end{proof}
/-- If `X_i` has the same distribution as `Y_i` for each `i`, then `D[X_[m]] = D[Y_[m]]`. -/ lemma multiDist_copy {m : ℕ} {Ω : Fin m → Type*} {Ω' : Fin m → Type*} (hΩ : ∀ i, MeasureSpace (Ω i)) (hΩ': ∀ i, MeasureSpace (Ω' i)) (X : ∀ i, (Ω i) → G) (X' : ∀ i, (Ω' i) → G) (hident : ∀ i, IdentDistrib (X i) (X' i)) : D[X ; hΩ] = D[X' ; hΩ'] := by simp_rw [multiDist, IdentDistrib.entropy_eq (hident _), (hident _).map_eq]
pfr/blueprint/src/chapter/torsion.tex:171
pfr/PFR/MoreRuzsaDist.lean:723
PFR
multiDist_indep
\begin{lemma}[Multidistance of independent variables]\label{multidist-indep}\lean{multiDist_indep}\leanok If $X_{[m]} = (X_i)_{1 \leq i \leq m}$ are jointly independent, then $D[X_{[m]}] = \bbH[\sum_{i=1}^m X_i] - \frac{1}{m} \sum_{i=1}^m \bbH[X_i]$. \end{lemma} \begin{proof}\uses{multidist-def} Clear from definition. \end{proof}
/-- If `X_i` are independent, then `D[X_{[m]}] = H[∑_{i=1}^m X_i] - \frac{1}{m} \sum_{i=1}^m H[X_i]`. -/ lemma multiDist_indep {m : ℕ} {Ω : Type*} (hΩ : MeasureSpace Ω) (X : Fin m → Ω → G) (h_indep : iIndepFun X) : D[X ; fun _ ↦ hΩ] = H[∑ i, X i] - (∑ i, H[X i]) / m := by sorry
pfr/blueprint/src/chapter/torsion.tex:177
pfr/PFR/MoreRuzsaDist.lean:733
PFR
multiDist_nonneg
\begin{lemma}[Nonnegativity]\label{multidist-nonneg}\lean{multiDist_nonneg}\uses{multidist-def}\leanok For any such tuple, we have $D[X_{[m]}] \geq 0$. \end{lemma} \begin{proof}\uses{sumset-lower} From \Cref{sumset-lower} one has $$ \bbH[\sum_{i =1}^m \tilde X_i] \geq \bbH[\tilde X_i]$$ for each $1 \leq i \leq m$. Averaging over $i$, we obtain the claim. \end{proof}
/-- We have `D[X_[m]] ≥ 0`. -/ lemma multiDist_nonneg [Fintype G] {m : ℕ} {Ω : Fin m → Type*} (hΩ : ∀ i, MeasureSpace (Ω i)) (hprob : ∀ i, IsProbabilityMeasure (ℙ : Measure (Ω i))) (X : ∀ i, (Ω i) → G) (hX : ∀ i, Measurable (X i)) : 0 ≤ D[X ; hΩ] := by obtain ⟨A, mA, μA, Y, isProb, h_indep, hY⟩ := ProbabilityTheory.independent_copies' X hX (fun i => ℙ) convert multiDist_nonneg_of_indep ⟨μA⟩ Y (fun i => (hY i).1) h_indep using 1 apply multiDist_copy exact fun i => (hY i).2.symm
pfr/blueprint/src/chapter/torsion.tex:183
pfr/PFR/MoreRuzsaDist.lean:759