Pratik Patil

ClassicalSSAKernel.lean

1module23public import SubentropyCertificates.SliceProducts4import Mathlib.Algebra.Order.BigOperators.Group.Finset56/-! Strong subadditivity of the reciprocal determinant products for finite7classical tables. Indices are ordered A, B, C and B is the middle label. -/8@[expose] public section9noncomputable section10open scoped BigOperators11namespace SubentropyCertificates.ClassicalSSA12variable {A B C : Type*} [Fintype A] [Fintype B] [Fintype C]1314def marginalAB (p : A × B × C → ℝ) (u : A × B) := ∑ k, p (u.1,u.2,k)15def marginalBC (p : A × B × C → ℝ) (u : B × C) := ∑ i, p (i,u.1,u.2)16def marginalB (p : A × B × C → ℝ) (j : B) := ∑ i, ∑ k, p (i,j,k)1718/-- Positive joint mass occurs only when the first (respectively last)19label is the selected function of the middle label. -/20def determined (p : A × B × C → ℝ) : Prop :=21  (∃ f : B → A, ∀ i j k, 0 < p (i,j,k) → i = f j) ∨22  (∃ g : B → C, ∀ i j k, 0 < p (i,j,k) → k = g j)2324private theorem kernel_factors (t : ℝ) (p : A × B × C → ℝ) :25    let q := fun j i k => p (i,j,k)26    kernel t (marginalAB p) = (∏ j, rows t Finset.univ (q j)) ∧27    kernel t (marginalBC p) = (∏ j, cols t Finset.univ (q j)) ∧28    kernel t p = (∏ j, cells t Finset.univ (q j)) ∧29    kernel t (marginalB p) = ∏ j, factor t (mass Finset.univ (q j)) := by30  simp only [kernel, rows, cols, cells, marginalAB, marginalBC, marginalB, mass, rowMass,31    colMass, Fintype.prod_prod_type]32  exact ⟨Finset.prod_comm, trivial, Finset.prod_comm, trivial⟩3334/-- The pointwise part of thm:classical_ssa. No normalization is needed. -/35theorem classical_ssa_kernel (p : A × B × C → ℝ) (hp : ∀ u, 0 ≤ p u) {t : ℝ} (ht : 0 ≤ t) :36    kernel t (marginalAB p) + kernel t (marginalBC p) ≤ kernel t p + kernel t (marginalB p) := by37  rcases ht.eq_or_lt with h | h38  · subst t; simp [kernel, factor]39  obtain ⟨hx,hy,ha,hd⟩ := kernel_factors t p40  rw [hx,hy,ha,hd]41  exact (slice_product_comparison h _ (fun j i k => hp (i,j,k))).14243omit [Fintype B] in44private theorem select_label [Nonempty A] (q : B → A → C → ℝ) (hq : ∀ j i k, 0 ≤ q j i k) :45    (∀ j, ¬ varies Finset.univ (rowMass (q j))) ↔46      ∃ f : B → A, ∀ j i k, 0 < q j i k → i = f j := by47  classical48  have hpos (j : B) (i : A) : 0 < rowMass (q j) i ↔ ∃ k, 0 < q j i k := by49    constructor50    · intro h51      by_contra! hn52      have hz := Finset.sum_eq_zero (s := Finset.univ) (fun k _ => le_antisymm (hn k) (hq j i k))53      exact h.ne' hz54    · rintro ⟨k,h⟩55      exact h.trans_le (Finset.single_le_sum (fun k _ => hq j i k) (Finset.mem_univ k))56  constructor57  · intro H58    have chooseLabel (j : B) : ∃ i : A, ∀ l k, 0 < q j l k → l=i := by59      by_cases has : ∃ i, 0 < rowMass (q j) i60      · obtain ⟨i,hi⟩ := has61        refine ⟨i,fun l k hk => ?_⟩62        by_contra hn63        exact H j ⟨i,Finset.mem_univ _,l,Finset.mem_univ _,hn,hi,(hpos j l).mpr ⟨k,hk⟩⟩64      · exact ⟨Classical.arbitrary A,fun l k h => False.elim (has ⟨l,(hpos j l).mpr ⟨k,h⟩⟩)⟩65    choose f hf using chooseLabel66    exact ⟨f,hf⟩67  · rintro ⟨f,hf⟩ j ⟨i,_,l,_,hli,hi,hl⟩68    obtain ⟨k,hk⟩ := (hpos j i).mp hi69    obtain ⟨m,hm⟩ := (hpos j l).mp hl70    exact hli ((hf j l m hm).trans (hf j i k hk).symm)7172/-- At every positive t, equality is precisely global determinism on73one side. The nonempty outer alphabets allow total functions on zero slices. -/74theorem classical_ssa_kernel_eq_iff [Nonempty A] [Nonempty C]75    (p : A × B × C → ℝ) (hp : ∀ u, 0 ≤ p u) {t : ℝ} (ht : 0 < t) :76    kernel t (marginalAB p) + kernel t (marginalBC p) = kernel t p + kernel t (marginalB p) ↔77      determined p := by78  obtain ⟨hx,hy,ha,hd⟩ := kernel_factors t p79  rw [hx,hy,ha,hd, (slice_product_comparison ht _ (fun j i k => hp (i,j,k))).2]80  unfold determined81  apply or_congr82  · rw [select_label _ (fun j i k => hp (i,j,k))]83    exact exists_congr fun _ => forall_comm84  · change (∀ j, ¬ varies Finset.univ (rowMass (fun k i => p (i,j,k)))) ↔ _85    rw [select_label _ (fun j k i => hp (i,j,k))]86    apply exists_congr87    intro g88    constructor89    · exact fun h i j k => h j k i90    · exact fun h j k i => h i j k9192end SubentropyCertificates.ClassicalSSA

Axioms used

Choose a statement to see which axioms its proof uses.