Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPermutationSupport

Download original .lean · View on GitHub · Jump to source

Direct imports

  • Mathlib.GroupTheory.Perm.Support dependency
  • Mathlib.Data.Fintype.EquivFin dependency
  • Mathlib.Data.Fintype.Powerset dependency
  • Mathlib.Data.Fintype.Perm dependency
  • Mathlib.Data.Nat.Choose.Bounds dependency
  • Mathlib.Tactic dependency

Imported by project modules

2 direct reverse imports

Relationships above come from literal import commands. The declarations below link to types and references extracted from Lean’s environment. Source text is complete and unchanged.

Declarations in this module

39 project constants, including generated, internal and private declarations.

39 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Mathlib.GroupTheory.Perm.Support7import Mathlib.Data.Fintype.EquivFin8import Mathlib.Data.Fintype.Powerset9import Mathlib.Data.Fintype.Perm10import Mathlib.Data.Nat.Choose.Bounds11import Mathlib.Tactic1213/-! # Permutation support counting and Hamming distance1415A permutation moving exactly `d` points is encoded by a list of its moved16points and their images. This gives a polynomial, rather than factorial,17bound at every fixed support size.18-/1920noncomputable section21namespace Nonadditivity.HaarPermutationSupport22open scoped BigOperators2324variable {ι : Type*} [Fintype ι] [DecidableEq ι]2526abbrev SupportSize (ι : Type*) [Fintype ι] [DecidableEq ι] (d : ℕ) :=27  {σ : Equiv.Perm ι // σ.support.card = d}2829def enumerate {d : ℕ} (σ : SupportSize ι d) : Fin d ≃ ↥σ.val.support :=30  Fintype.equivOfCardEq (by simpa only [Fintype.card_fin, Fintype.card_coe] using σ.property.symm)3132def code {d : ℕ} (σ : SupportSize ι d) : Fin d → ι × ι :=33  fun i => ((enumerate σ i).val, σ.val (enumerate σ i).val)3435theorem code_injective (d : ℕ) : Function.Injective (code (ι := ι) (d := d)) := by36  intro σ τ h37  apply Subtype.ext38  apply Equiv.ext39  intro x40  have he (i : Fin d) : code σ i = code τ i := congrFun h i41  by_cases hx : x ∈ σ.val.support42  · obtain ⟨i, hi⟩ := (enumerate σ).surjective ⟨x,hx⟩43    have hfirst := congrArg Prod.fst (he i)44    have hsecond := congrArg Prod.snd (he i)45    change (enumerate σ i).val = (enumerate τ i).val at hfirst46    change σ.val (enumerate σ i).val = τ.val (enumerate τ i).val at hsecond47    rw [hi] at hfirst hsecond48    simpa only [← hfirst] using hsecond49  · have hy : x ∉ τ.val.support := by50      intro hy51      obtain ⟨i, hi⟩ := (enumerate τ).surjective ⟨x,hy⟩52      have hfirst := congrArg Prod.fst (he i)53      change (enumerate σ i).val = (enumerate τ i).val at hfirst54      rw [hi] at hfirst55      change (enumerate σ i).val = x at hfirst56      exact hx (by rw [← hfirst]; exact (enumerate σ i).property)57    have hs : σ.val x = x := by simpa using hx58    have ht : τ.val x = x := by simpa using hy59    exact hs.trans ht.symm6061/-- The support-size layer has at most `card(ι)^(2*d)` permutations. -/62theorem card_supportSize_le (d : ℕ) :63    Fintype.card (SupportSize ι d) ≤ (Fintype.card ι)^(2*d) := by64  have h := Fintype.card_le_of_injective (code (ι := ι) (d := d)) (code_injective d)65  simpa only [Fintype.card_fun, Fintype.card_prod, Fintype.card_fin, ← pow_two,66    ← pow_mul] using h6768def distance (σ τ : Equiv.Perm ι) : ℕ :=69  (Finset.univ.filter (fun x => σ x ≠ τ x)).card7071@[simp] theorem distance_self (σ : Equiv.Perm ι) : distance σ σ = 0 := by72  simp [distance]7374theorem distance_symm (σ τ : Equiv.Perm ι) : distance σ τ = distance τ σ := by75  unfold distance76  congr 177  ext x78  simp [ne_comm]7980theorem distance_triangle (σ κ τ : Equiv.Perm ι) :81    distance σ τ ≤ distance σ κ + distance κ τ := by82  apply (Finset.card_le_card (show Finset.univ.filter (fun x => σ x ≠ τ x) ⊆83    Finset.univ.filter (fun x => σ x ≠ κ x) ∪84      Finset.univ.filter (fun x => κ x ≠ τ x) from ?_)).trans (Finset.card_union_le _ _)85  intro x hx86  simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_union] at hx ⊢87  by_cases h : σ x = κ x88  · exact Or.inr (fun ht => hx (h.trans ht))89  · exact Or.inl h9091theorem distance_eq_support (σ τ : Equiv.Perm ι) :92    distance σ τ = (σ⁻¹*τ).support.card := by93  unfold distance94  congr 195  ext x96  simp only [Finset.mem_filter, Finset.mem_univ, true_and, Equiv.Perm.mem_support,97    Equiv.Perm.mul_apply]98  constructor99  · intro h he100    apply h101    have hh := congrArg σ he102    simpa using hh.symm103  · intro h he104    apply h105    rw [← he]106    simp107108theorem distance_le_card (σ τ : Equiv.Perm ι) : distance σ τ ≤ Fintype.card ι :=109  (Finset.card_filter_le _ _).trans_eq (Finset.card_univ)110111theorem two_le_distance_of_ne (σ τ : Equiv.Perm ι) (h : σ ≠ τ) : 2 ≤ distance σ τ := by112  rw [distance_eq_support]113  apply Equiv.Perm.two_le_card_support_of_ne_one114  intro he115  apply h116  have hh := congrArg (fun π : Equiv.Perm ι => σ*π) he117  simpa [mul_assoc] using hh.symm118119def distanceLayerEquiv (σ : Equiv.Perm ι) (d : ℕ) :120    {τ : Equiv.Perm ι // distance σ τ = d} ≃ SupportSize ι d where121  toFun τ := ⟨σ⁻¹*τ.val, by rw [← distance_eq_support]; exact τ.property⟩122  invFun τ := ⟨σ*τ.val, by rw [distance_eq_support, inv_mul_cancel_left]; exact τ.property⟩123  left_inv τ := by apply Subtype.ext; simp124  right_inv τ := by apply Subtype.ext; simp125126theorem card_distance_layer_le (σ : Equiv.Perm ι) (d : ℕ) :127    Fintype.card {τ : Equiv.Perm ι // distance σ τ = d} ≤ (Fintype.card ι)^(2*d) := by128  rw [Fintype.card_congr (distanceLayerEquiv σ d)]129  exact card_supportSize_le d130131def supportCode {d : ℕ} (σ : SupportSize ι d) :132    Σ s : {s : Finset ι // s.card=d}, Equiv.Perm ↥s.val :=133  ⟨⟨σ.val.support,σ.property⟩, σ.val.subtypePerm (fun _ => Equiv.Perm.apply_mem_support)⟩134135theorem recover_supportCode {d : ℕ} (σ : SupportSize ι d) :136    Equiv.Perm.ofSubtype (supportCode σ).2 = σ.val := by137  apply (Equiv.Perm.ofSubtype_eq_iff (fun _ => Equiv.Perm.apply_mem_support)).mpr138  exact ⟨Finset.Subset.refl _, fun _ => rfl⟩139140theorem supportCode_injective (d : ℕ) : Function.Injective (supportCode (ι := ι) (d := d)) := by141  intro σ τ h142  apply Subtype.ext143  rw [← recover_supportCode σ, ← recover_supportCode τ]144  exact congrArg (fun z : Σ s : {s : Finset ι // s.card=d}, Equiv.Perm ↥s.val =>145    Equiv.Perm.ofSubtype z.2) h146147/-- The sharper support-layer bound keeps the required moment exponent. -/148theorem card_supportSize_le_pow (d : ℕ) :149    Fintype.card (SupportSize ι d) ≤ (Fintype.card ι)^d := by150  have h := Fintype.card_le_of_injective (supportCode (ι := ι) (d := d)) (supportCode_injective d)151  have hc (s : {s : Finset ι // s.card=d}) : Fintype.card (Equiv.Perm ↥s.val) = d.factorial := by152    rw [Fintype.card_perm, Fintype.card_coe, s.property]153  rw [Fintype.card_sigma] at h154  simp_rw [hc] at h155  simp only [Finset.sum_const, Finset.card_univ, Fintype.card_finset_len, nsmul_eq_mul] at h156  norm_cast at h157  apply h.trans158  rw [Nat.mul_comm, ← Nat.descFactorial_eq_factorial_mul_choose]159  exact Nat.descFactorial_le_pow _ _160161theorem card_distance_layer_le_pow (σ : Equiv.Perm ι) (d : ℕ) :162    Fintype.card {τ : Equiv.Perm ι // distance σ τ = d} ≤ (Fintype.card ι)^d := by163  rw [Fintype.card_congr (distanceLayerEquiv σ d)]164  exact card_supportSize_le_pow d165166end Nonadditivity.HaarPermutationSupport