Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathPrefixTree

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

Direct imports

Imported by project modules

1 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

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

8 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathFreshRuns7import Nonadditivity.HaarPathClassData89/-! # Relabelling and tree-route reconstruction for known prefixes1011Prefix incidence patterns give actual vertex and local-color permutations.12Those permutations identify the complete discovery trees, so a reduced old13route is determined by its marked endpoint in the already decoded tree.14-/15noncomputable section16namespace Nonadditivity.HaarPathClasses17open HaarPathGraph HaarPathProfiles18variable {V : Type*} {d m : ℕ} [DecidableEq V]19variable {P Q : Path V d m} {k : ℕ}2021/-- Literal relabelling of the portion already decoded. -/22def PrefixRelabeled (P Q : Path V d m) (k : ℕ) : Prop :=23  ∃ τ : Equiv.Perm V, ∃ β : V → Equiv.Perm (Color d),24    (∀ j : Fin (m+1), j.val ≤ k → τ (P.vertex j)=Q.vertex j) ∧25    ∀ a : Incidence m, a.1.val < k →26      β (incidenceVertex P a) (incidenceColor P a)=incidenceColor Q a2728/-- A prefix pattern supplies actual permutations, including arbitrary29extensions on every vertex or color that has not yet been encountered. -/30theorem prefixSamePattern_relabeled [Fintype V]31    (h : PrefixSamePattern P Q k) : PrefixRelabeled P Q k := by32  classical33  obtain ⟨τ,hτ⟩ := exists_perm_of_kernel_eq34    (fun j : {j : Fin (m+1) // j.val ≤ k} => P.vertex j.val)35    (fun j : {j : Fin (m+1) // j.val ≤ k} => Q.vertex j.val)36    (fun a b => h.1 a.val b.val a.property b.property)37  have hlocal (v : V) : ∃ β : Equiv.Perm (Color d),38      ∀ a : {a : Incidence m // a.1.val < k ∧ incidenceVertex P a=v},39        β (incidenceColor P a.val)=incidenceColor Q a.val := by40    apply exists_perm_of_kernel_eq41    intro a b42    exact h.2 a.val b.val a.property.1 b.property.143      (a.property.2.trans b.property.2.symm)44  choose β hβ using hlocal45  refine ⟨τ,β,fun j hj => hτ ⟨j,hj⟩,fun a ha => ?_⟩46  exact hβ (incidenceVertex P a) ⟨a,ha,rfl⟩4748theorem prefixSamePattern_firstVisit_iff49    (h : PrefixSamePattern P Q k) (i : Fin m) (hi : i.val < k) :50    P.FirstVisit i ↔ Q.FirstVisit i := by51  constructor52  · intro hp j hj he53    exact hp j hj ((h.1 j i.succ (by omega) (by simp; omega)).mpr he)54  · intro hq j hj he55    exact hq j hj ((h.1 j i.succ (by omega) (by simp; omega)).mp he)5657/-- The vertex permutation of a known prefix identifies its actual discovery58tree with that of the other path. No final-graph data is used. -/59def prefixTreeIso (h : PrefixSamePattern P Q k) (τ : Equiv.Perm V)60    (hτ : ∀ j : Fin (m+1), j.val ≤ k → τ (P.vertex j)=Q.vertex j) :61    P.discoveryGraph k ≃g Q.discoveryGraph k where62  toEquiv := τ63  map_rel_iff' := by64    intro x y65    constructor66    · rintro ⟨i,hi,hik,hxy⟩67      have hP := (prefixSamePattern_firstVisit_iff h i hik).mpr hi68      have hs := hτ i.castSucc (by simp; omega)69      have ht := hτ i.succ (by simp; omega)70      refine ⟨i,hP,hik,?_⟩71      rcases hxy with ⟨hx,hy⟩ | ⟨hx,hy⟩72      · exact Or.inl ⟨τ.injective (hx.trans hs.symm),τ.injective (hy.trans ht.symm)⟩73      · exact Or.inr ⟨τ.injective (hx.trans ht.symm),τ.injective (hy.trans hs.symm)⟩74    · rintro ⟨i,hi,hik,hxy⟩75      have hQ := (prefixSamePattern_firstVisit_iff h i hik).mp hi76      have hs := hτ i.castSucc (by simp; omega)77      have ht := hτ i.succ (by simp; omega)78      refine ⟨i,hQ,hik,?_⟩79      rcases hxy with ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩80      · exact Or.inl ⟨hs,ht⟩81      · exact Or.inr ⟨ht,hs⟩8283/-- Reduced tree routes between corresponding marked endpoints agree after84transport through the decoded prefix. This is the non-circular tree-run85reconstruction step. -/86theorem prefix_tree_route_reconstruction87    (h : PrefixSamePattern P Q k) (τ : Equiv.Perm V)88    (hτ : ∀ j : Fin (m+1), j.val ≤ k → τ (P.vertex j)=Q.vertex j)89    {x y : V} (a : (P.discoveryGraph k).Walk x y)90    (b : (Q.discoveryGraph k).Walk (τ x) (τ y))91    (ha : a.edges.IsChain (· ≠ ·)) (hb : b.edges.IsChain (· ≠ ·)) :92    a.map (prefixTreeIso h τ hτ).toHom=b := by93  let e := prefixTreeIso h τ hτ94  have hap := ((P.discoveryGraph_isAcyclic k).isPath_iff_isChain a).mpr ha95  have hbp := ((Q.discoveryGraph_isAcyclic k).isPath_iff_isChain b).mpr hb96  have ham : (a.map e.toHom).IsPath := SimpleGraph.Walk.map_isPath_of_injective e.injective hap97  exact congrArg Subtype.val ((Q.discoveryGraph_isAcyclic k).path_unique98    ⟨a.map e.toHom,ham⟩ ⟨b,hbp⟩)99100end Nonadditivity.HaarPathClasses