Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathColorNormalization

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

Direct imports

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

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

6 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathFreshRuns78/-! # Local color normalization of actual path incidence patterns910At each newly discovered vertex, the incoming color and the immediately11following outgoing color are distinct. An actual local permutation sends12them to two fixed labels. Thus every internal fresh-run incidence is forced13in the normalized pattern, while the full color alphabet remains `2d`.14The normalized labels are incidence data, not a new globally colored path.15-/1617noncomputable section18namespace Nonadditivity.HaarPathClasses19open HaarPathGraph HaarPathProfiles2021/-- A permutation of a finite alphabet may normalize any ordered distinct22pair to any other ordered distinct pair. -/23theorem exists_perm_map_pair {E : Type*} [Fintype E]24    (a b c d : E) (hab : a≠b) (hcd : c≠d) :25    ∃ σ : Equiv.Perm E, σ a=c ∧ σ b=d := by26  obtain ⟨σ,hσ⟩ := exists_perm_of_kernel_eq27    (fun t : Bool => if t then b else a) (fun t : Bool => if t then d else c)28    (by intro s t; cases s <;> cases t <;> simp [hab,hcd,Ne.symm hab,Ne.symm hcd])29  exact ⟨σ,by simpa using hσ false,by simpa using hσ true⟩3031variable {V : Type*} [DecidableEq V] {d m : ℕ}3233/-- One actual permutation per vertex simultaneously normalizes every first34arrival and its next departure. There is exactly one first arrival at each35non-root visited vertex. -/36theorem exists_local_color_normalization (P : Path V d m) (hm : 0<m)37    (c₀ c₁ : Color d) (hc : c₀≠c₁) :38    ∃ β : V → Equiv.Perm (Color d),39      β (P.vertex 0) (P.colors ⟨0,hm⟩)=c₀ ∧40      (∀ i : Fin m, P.FirstVisit i →41        β (P.vertex i.succ) (flipColor (P.colors i))=c₀) ∧42      (∀ i j : Fin m, P.FirstVisit i → i.val+1=j.val →43        β (P.vertex i.succ) (P.colors j)=c₁) := by44  classical45  have hlocal (v : V) : ∃ σ : Equiv.Perm (Color d),46      (v=P.vertex 0 → σ (P.colors ⟨0,hm⟩)=c₀) ∧47      (∀ i : Fin m, P.FirstVisit i → P.vertex i.succ=v →48        σ (flipColor (P.colors i))=c₀) ∧49      (∀ i j : Fin m, P.FirstVisit i → i.val+1=j.val → P.vertex i.succ=v →50        σ (P.colors j)=c₁) := by51    by_cases hv : v=P.vertex 052    · refine ⟨Equiv.swap (P.colors ⟨0,hm⟩) c₀,?_,?_,?_⟩53      · intro _; simp54      · intro i hi hiv55        exact (P.firstVisit_terminal_ne_root hi (hiv.trans hv)).elim56      · intro i j hi hij hiv57        exact (P.firstVisit_terminal_ne_root hi (hiv.trans hv)).elim58    · by_cases hex : ∃ i : Fin m, P.FirstVisit i ∧ P.vertex i.succ=v59      · obtain ⟨i,hi,hiv⟩ := hex60        let j : Fin m := ⟨i.val+1,P.firstVisit_not_last hi⟩61        have hij : i.val+1=j.val := rfl62        have hdist : flipColor (P.colors i)≠P.colors j := Ne.symm (P.reduced i j hij)63        obtain ⟨σ,hσ₀,hσ₁⟩ := exists_perm_map_pair64          (flipColor (P.colors i)) (P.colors j) c₀ c₁ hdist hc65        refine ⟨σ,fun h => (hv h).elim,?_,?_⟩66        · intro k hk hkv67          have he : k=i := P.firstVisit_terminal_injective68            ((P.mem_firstTimes k).mpr hk) ((P.mem_firstTimes i).mpr hi) (hkv.trans hiv.symm)69          subst k70          exact hσ₀71        · intro k l hk hkl hkv72          have he : k=i := P.firstVisit_terminal_injective73            ((P.mem_firstTimes k).mpr hk) ((P.mem_firstTimes i).mpr hi) (hkv.trans hiv.symm)74          subst k75          have he : l=j := Fin.ext (hkl.symm.trans hij)76          subst l77          exact hσ₁78      · refine ⟨Equiv.refl _,fun h => (hv h).elim,?_,?_⟩79        · intro i hi hiv80          exact (hex ⟨i,hi,hiv⟩).elim81        · intro i j hi hij hiv82          exact (hex ⟨i,hi,hiv⟩).elim83  choose β hβ using hlocal84  exact ⟨β,(hβ _).1 rfl,fun i hi => (hβ _).2.1 i hi rfl,85    fun i j hi hij => (hβ _).2.2 i j hi hij rfl⟩8687/-- Locally normalized incidence colors, retaining both orientations. -/88def normalizedIncidenceColor (P : Path V d m) (β : V → Equiv.Perm (Color d))89    (a : Incidence m) : Color d := β (incidenceVertex P a) (incidenceColor P a)9091omit [DecidableEq V] in92/-- Normalization preserves the actual local equality pattern exactly. -/93theorem normalizedIncidenceColor_eq_iff (P : Path V d m)94    (β : V → Equiv.Perm (Color d)) (a b : Incidence m)95    (hv : incidenceVertex P a=incidenceVertex P b) :96    normalizedIncidenceColor P β a=normalizedIncidenceColor P β b ↔97      incidenceColor P a=incidenceColor P b := by98  simp only [normalizedIncidenceColor,hv]99  exact (β (incidenceVertex P b)).injective.eq_iff100101/-- Four local labels suffice for the two-generator Haar problem. -/102theorem color_two_card : Fintype.card (Color 2)=4 := by simp [Color]103104end Nonadditivity.HaarPathClasses