Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish Lemma 3.23 #58

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions PFR/entropy_basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ lemma entropy_assoc [MeasurableSingletonClass S] [MeasurableSingletonClass T] [M
exact entropy_comp_of_injective μ (hX.prod_mk (hY.prod_mk hZ)) _
(Equiv.prodAssoc S T U).symm.injective |>.symm

variable [AddGroup S] in
/-- $H[X,X+Y] = H[X,Y]$. -/
lemma entropy_add_right {Y : Ω → S}
(hX : Measurable X) (hY : Measurable Y) (μ : Measure Ω) :
H[⟨ X, X + Y ⟩; μ] = H[⟨ X, Y ⟩ ; μ] := by
change H[(Equiv.refl _).prodShear Equiv.addLeft ∘ ⟨ X, Y ⟩ ; μ] = H[⟨ X, Y ⟩ ; μ]
exact entropy_comp_of_injective μ (hX.prod_mk hY) _ (Equiv.injective _)

end entropy

section condEntropy
Expand Down Expand Up @@ -500,6 +508,15 @@ lemma entropy_pair_eq_add' (hX : Measurable X) (hY : Measurable Y) {μ : Measure
H[⟨ X, Y ⟩ ; μ] = H[X ; μ] + H[Y ; μ] :=
(entropy_pair_eq_add hX hY).2 h

variable [AddGroup S] in
/-- $I[X : X + Y] = H[X + Y] - H[Y]$ iff $X, Y$ are independent. -/
lemma mutualInformation_add_right {Y : Ω → S} (hX : Measurable X) (hY : Measurable Y) {μ : Measure Ω}
[IsProbabilityMeasure μ] (h: IndepFun X Y μ) :
I[X : X + Y ; μ] = H[X + Y; μ] - H[Y; μ] := by
rw [mutualInformation_def, entropy_add_right hX hY, entropy_pair_eq_add' hX hY h]
abel


/-- The conditional mutual information $I[X:Y|Z]$ is the mutual information of $X|Z=z$ and $Y|Z=z$, integrated over $z$. -/
noncomputable
def condMutualInformation (X : Ω → S) (Y : Ω → T) (Z : Ω → U) (μ : Measure Ω := by volume_tac) :
Expand Down
59 changes: 43 additions & 16 deletions PFR/ruzsa_distance.lean
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,25 @@ notation3:max "d[" X " # " Y " | " W "]" => cond_rdist' X Y W MeasureTheory.Meas
/-- If $(X,Z)$ and $(Y,W)$ are independent, then
$$ d[X | Z ; Y | W] = H[X'-Y'|Z', W'] - H[X'|Z']/2 - H[Y'|W']/2$$
-/
lemma cond_rdist_of_indep [MeasurableSpace S] [MeasurableSpace T] {X : Ω → G} {Z : Ω → S} {Y : Ω → G} {W : Ω → T} (h : IndepFun (⟨X, Z⟩) (⟨ Y, W ⟩) μ) : d[X | Z ; μ # Y | W ; μ] = H[X-Y | ⟨ Z, W ⟩ ; μ] - H[X | Z ; μ]/2 - H[Y | W ; μ]/2 := by sorry
lemma cond_rdist_of_indep [MeasurableSpace S] [MeasurableSpace T]
{X : Ω → G} {Z : Ω → S} {Y : Ω → G} {W : Ω → T}
(h : IndepFun (⟨X, Z⟩) (⟨ Y, W ⟩) μ) :
d[X | Z ; μ # Y | W ; μ] = H[X-Y | ⟨ Z, W ⟩ ; μ] - H[X | Z ; μ]/2 - H[Y | W ; μ]/2 := by sorry

lemma cond_rdist'_of_indep [MeasurableSpace T] {X : Ω → G} {Y : Ω → G} {W : Ω → T} (h : IndepFun X (⟨ Y, W ⟩) μ) : d[X ; μ # Y | W ; μ] = H[X-Y | W ; μ] - H[X ; μ]/2 - H[Y | W ; μ]/2 := by sorry
lemma cond_rdist'_of_indep [MeasurableSpace T] {X : Ω → G} {Y : Ω → G} {W : Ω → T}
(h : IndepFun X (⟨ Y, W ⟩) μ) :
d[X ; μ # Y | W ; μ] = H[X-Y | W ; μ] - H[X ; μ]/2 - H[Y | W ; μ]/2 := by sorry

lemma cond_rdist_of_copy [MeasurableSpace S] [MeasurableSpace T] {X : Ω → G} {Z : Ω → S} {Y : Ω' → G} {W : Ω' → T} {X' : Ω'' → G} {Z' : Ω'' → S} {Y' : Ω''' → G} {W' : Ω''' → T} (h1 : IdentDistrib (⟨X, Z⟩) (⟨X', Z'⟩) μ μ'') (h2 : IdentDistrib (⟨Y, W⟩) (⟨Y', W'⟩) μ' μ''') : d[X | Z ; μ # Y | W ; μ'] = d[X' | Z' ; μ'' # Y' | W' ; μ'''] := by sorry
lemma cond_rdist_of_copy [MeasurableSpace S] [MeasurableSpace T]
{X : Ω → G} {Z : Ω → S} {Y : Ω' → G} {W : Ω' → T}
{X' : Ω'' → G} {Z' : Ω'' → S} {Y' : Ω''' → G} {W' : Ω''' → T}
(h1 : IdentDistrib (⟨X, Z⟩) (⟨X', Z'⟩) μ μ'') (h2 : IdentDistrib (⟨Y, W⟩) (⟨Y', W'⟩) μ' μ''') :
d[X | Z ; μ # Y | W ; μ'] = d[X' | Z' ; μ'' # Y' | W' ; μ'''] := by sorry

lemma cond_rdist'_of_copy [MeasurableSpace T] {X : Ω → G} {Y : Ω' → G} {W : Ω' → T} {X' : Ω'' → G} {Y' : Ω''' → G} {W' : Ω''' → T} (h1 : IdentDistrib X X' μ μ'') (h2 : IdentDistrib (⟨Y, W⟩) (⟨Y', W'⟩) μ' μ''') : d[X ; μ # Y | W ; μ'] = d[X' ; μ'' # Y' | W' ; μ'''] := by sorry
lemma cond_rdist'_of_copy [MeasurableSpace T]
{X : Ω → G} {Y : Ω' → G} {W : Ω' → T} {X' : Ω'' → G} {Y' : Ω''' → G} {W' : Ω''' → T}
(h1 : IdentDistrib X X' μ μ'') (h2 : IdentDistrib (⟨Y, W⟩) (⟨Y', W'⟩) μ' μ''') :
d[X ; μ # Y | W ; μ'] = d[X' ; μ'' # Y' | W' ; μ'''] := by sorry


/-- The **Kaimonovich-Vershik inequality**. $$H[X + Y + Z] - H[X + Y] \leq H[Y+Z] - H[Y].$$ -/
Expand Down Expand Up @@ -443,11 +455,12 @@ protected lemma ProbabilityTheory.IdentDistrib.snd {X : Ω → Ω''} {Y : Ω →
rw [←Measure.snd_map_prod_mk hX,show (fun a => (X a, Y a)) = ⟨X, Y⟩ by rfl,h.3,
Measure.snd_map_prod_mk hX']

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].$$
-/
lemma condDist_le [Fintype S] [Fintype T] (X : Ω → G) (Z : Ω → S) (Y : Ω' → G) (W : Ω' → T)
[IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] [Nonempty S] [Nonempty T]
lemma condDist_le [Fintype S] [Fintype T] {X : Ω → G} {Z : Ω → S} {Y : Ω' → G} {W : Ω' → T}
[IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] [Nonempty S]
(hX : Measurable X) (hZ : Measurable Z) (hY : Measurable Y) (hW : Measurable 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):= Measurable.prod_mk hX hZ
Expand Down Expand Up @@ -478,7 +491,11 @@ lemma condDist_le [Fintype S] [Fintype T] (X : Ω → G) (Z : Ω → S) (Y : Ω'
have h := condEntropy_le_entropy ν (X := X' - Y') (Y := (⟨Z',W'⟩)) (hX'.sub hY') (Measurable.prod hZ' hW')
linarith [h,entropy_nonneg Z' ν,entropy_nonneg W' ν]

lemma condDist_le' [Fintype T] (X : Ω → G) (Y : Ω' → G) (W : Ω' → T) : d[X ; μ # Y|W ; μ'] ≤ d[X ; μ # Y ; μ'] + I[Y : W ; μ']/2 := by sorry
variable (μ μ') in
lemma condDist_le' [Fintype T] {X : Ω → G} {Y : Ω' → G} {W : Ω' → T}
[IsProbabilityMeasure μ] [IsProbabilityMeasure μ']
(hX : Measurable X) (hY : Measurable Y) (hW : Measurable W) :
d[X ; μ # Y|W ; μ'] ≤ d[X ; μ # Y ; μ'] + I[Y : W ; μ']/2 := by sorry


variable (μ) in
Expand All @@ -487,8 +504,8 @@ lemma comparison_of_ruzsa_distances
{X : Ω → G} {Y : Ω' → G} {Z : Ω' → G}
(hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') :
d[X; μ # Y+Z ; μ'] - d[X; μ # Y ; μ'] ≤ (H[Y + Z; μ'] - H[Y; μ']) / 2 ∧
(ElementaryAddCommGroup G 2 →
(H[Y + Z; μ'] - H[Y; μ']) / 2 = d[Y; μ' # Z; μ'] / 2 + H[Z; μ'] / 4 - H[Y; μ'] / 4) := by
(ElementaryAddCommGroup G 2 →
H[Y + Z; μ'] - H[Y; μ'] = d[Y; μ' # Z; μ'] + H[Z; μ'] / 2 - H[Y; μ'] / 2) := by
obtain ⟨Ω'', mΩ'', μ'', X', Y', Z', hμ, hi, hX', hY', hZ', h2X', h2Y', h2Z'⟩ :=
independent_copies3_nondep hX hY hZ μ μ' μ'
have hY'Z' : IndepFun Y' Z' μ'' := hi.indepFun (show (1 : Fin 3) ≠ 2 by decide)
Expand Down Expand Up @@ -525,29 +542,39 @@ lemma condDist_diff_le {Ω' : Type u} [MeasurableSpace Ω'] {μ' : Measure Ω'}
d[X; μ # Y+Z ; μ'] - d[X; μ # Y ; μ'] ≤ (H[Y + Z; μ'] - H[Y; μ']) / 2 :=
(comparison_of_ruzsa_distances μ hX hY hZ h).1

variable (μ) [ElementaryAddCommGroup G 2] in
lemma entropy_sub_entropy_eq_condDist_add {Ω' : Type u} [MeasurableSpace Ω'] {μ' : Measure Ω'}
[IsFiniteMeasure μ']
{X : Ω → G} {Y : Ω' → G} {Z : Ω' → G}
(hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') :
H[Y + Z; μ'] - H[Y; μ'] = d[Y; μ' # Z; μ'] + H[Z; μ'] / 2 - H[Y; μ'] / 2 :=
(comparison_of_ruzsa_distances μ hX hY hZ h).2 ‹_›

variable (μ) [ElementaryAddCommGroup G 2] in
lemma condDist_diff_le' {Ω' : Type u} [MeasurableSpace Ω'] {μ' : Measure Ω'} [IsFiniteMeasure μ']
{X : Ω → G} {Y : Ω' → G} {Z : Ω' → G}
(hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') :
d[X; μ # Y + Z; μ'] - d[X; μ # Y; μ'] ≤
d[Y; μ' # Z; μ'] / 2 + H[Z; μ'] / 4 - H[Y; μ'] / 4 := by
obtain ⟨h1, h2⟩ := comparison_of_ruzsa_distances μ hX hY hZ h
rwa [h2 ‹_›] at h1
linarith [condDist_diff_le μ hX hY hZ h, entropy_sub_entropy_eq_condDist_add μ hX hY hZ h]

variable (μ) in
lemma condDist_diff_le'' {Ω' : Type u} [MeasurableSpace Ω'] {μ' : Measure Ω'} [IsFiniteMeasure μ']
lemma condDist_diff_le'' {Ω' : Type u} [MeasurableSpace Ω'] {μ' : Measure Ω'}
[IsProbabilityMeasure μ] [IsProbabilityMeasure μ']
{X : Ω → G} {Y : Ω' → G} {Z : Ω' → G}
(hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') :
d[X ; μ # Y|Y+Z ; μ'] - d[X ; μ # Y ; μ'] ≤ (H[Y+Z ; μ'] - H[Z ; μ'])/2 := by
sorry
rw [← mutualInformation_add_right hY hZ h]
linarith [condDist_le' μ μ' hX hY (hY.add' hZ)]

variable (μ) in
lemma condDist_diff_le''' {Ω' : Type u} [MeasurableSpace Ω'] {μ' : Measure Ω'} [IsFiniteMeasure μ']
variable (μ) [ElementaryAddCommGroup G 2] in
lemma condDist_diff_le''' {Ω' : Type u} [MeasurableSpace Ω'] {μ' : Measure Ω'}
[IsProbabilityMeasure μ] [IsProbabilityMeasure μ']
{X : Ω → G} {Y : Ω' → G} {Z : Ω' → G}
(hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) (h : IndepFun Y Z μ') :
d[X ; μ # Y|Y+Z ; μ'] - d[X ; μ # Y ; μ'] ≤
d[Y ; μ' # Z ; μ']/2 + H[Y ; μ']/4 - H[Z ; μ']/4 := by
sorry
linarith [condDist_diff_le'' μ hX hY hZ h, entropy_sub_entropy_eq_condDist_add μ hX hY hZ h]


/-- Let $X, Y, Z, Z'$ be random variables taking values in some abelian group, and with $Y, Z, Z'$ independent. Then we have
Expand Down
2 changes: 1 addition & 1 deletion blueprint/src/chapter/distance.tex
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ \chapter{Entropic Ruzsa calculus}
\end{lemma}

\begin{proof}
\uses{ruz-copy, ruz-lean, independent-exist, kv, ruz-indep, relabeled-entropy, cond-dist-fact}
\uses{ruz-copy, ruz-lean, 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 Lemma \ref{independent-exist} and Lemma \ref{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 Lemma \ref{kv} gives the required bound. The second form of the result is immediate Lemma \ref{ruz-indep}.
Expand Down
Loading