Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathClassData

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

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

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

27 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathClasses78/-! # Exploration statistics descend to the actual path quotient910Repeated colored edges, discovery times, important times and the defect are11invariant under the literal vertex-and-local-color equivalence.12-/13noncomputable section14namespace Nonadditivity.HaarPathGraph15variable {V : Type*} {d : ℕ}1617theorem edge_eq_iff {x y x' y' : V} {c c' : HaarPathProfiles.Color d} :18    edge x c y=edge x' c' y' ↔19      (x=x' ∧ c=c' ∧ y=y') ∨ (x=y' ∧ c=flipColor c' ∧ y=x') := by20  obtain ⟨g,b⟩ := c21  obtain ⟨g',b'⟩ := c'22  cases b <;> cases b' <;> simp [edge,flipColor,Prod.mk.injEq]23  all_goals tauto24end Nonadditivity.HaarPathGraph2526namespace Nonadditivity.HaarPathClasses27open HaarPathGraph HaarPathProfiles28variable {V : Type*} {d m : ℕ} [DecidableEq V]29variable {P Q : Path V d m}3031namespace SamePattern3233theorem incidenceVertex_iff (h : SamePattern P Q) (a b : Incidence m) :34    incidenceVertex P a=incidenceVertex P b ↔35      incidenceVertex Q a=incidenceVertex Q b := by36  simpa only [incidenceVertex_eq] using h.1 (incidenceIndex a) (incidenceIndex b)3738theorem firstVisit_iff (h : SamePattern P Q) (i : Fin m) :39    P.FirstVisit i ↔ Q.FirstVisit i := by40  simp only [Path.FirstVisit]41  constructor42  · intro hi j hj he43    exact hi j hj ((h.1 j i.succ).mpr he)44  · intro hi j hj he45    exact hi j hj ((h.1 j i.succ).mp he)4647theorem firstTimes_eq (h : SamePattern P Q) : P.firstTimes=Q.firstTimes := by48  ext i49  simpa only [Path.mem_firstTimes] using h.firstVisit_iff i5051theorem edgeAt_eq_iff (h : SamePattern P Q) (i j : Fin m) :52    P.edgeAt i=P.edgeAt j ↔ Q.edgeAt i=Q.edgeAt j := by53  simp only [Path.edgeAt,edge_eq_iff]54  have hf : P.vertex i.castSucc=P.vertex j.castSucc →55      (P.colors i=P.colors j ↔ Q.colors i=Q.colors j) := by56    intro hv57    exact h.2 (i,true) (j,true) hv58  have hr : P.vertex i.castSucc=P.vertex j.succ →59      (P.colors i=flipColor (P.colors j) ↔ Q.colors i=flipColor (Q.colors j)) := by60    intro hv61    exact h.2 (i,true) (j,false) hv62  constructor63  · rintro (⟨hs,hc,ht⟩ | ⟨hs,hc,ht⟩)64    · exact Or.inl ⟨(h.1 _ _).mp hs,(hf hs).mp hc,(h.1 _ _).mp ht⟩65    · exact Or.inr ⟨(h.1 _ _).mp hs,(hr hs).mp hc,(h.1 _ _).mp ht⟩66  · rintro (⟨hs,hc,ht⟩ | ⟨hs,hc,ht⟩)67    · have hs' := (h.1 _ _).mpr hs68      exact Or.inl ⟨hs',(hf hs').mpr hc,(h.1 _ _).mpr ht⟩69    · have hs' := (h.1 _ _).mpr hs70      exact Or.inr ⟨hs',(hr hs').mpr hc,(h.1 _ _).mpr ht⟩7172theorem edgeAt_mem_treeEdges_iff (h : SamePattern P Q) (i : Fin m) :73    P.edgeAt i∈P.treeEdges ↔ Q.edgeAt i∈Q.treeEdges := by74  simp only [Path.treeEdges,Finset.mem_image]75  constructor76  · rintro ⟨j,hj,he⟩77    exact ⟨j,h.firstTimes_eq ▸ hj,(h.edgeAt_eq_iff j i).mp he⟩78  · rintro ⟨j,hj,he⟩79    exact ⟨j,h.firstTimes_eq.symm ▸ hj,(h.edgeAt_eq_iff j i).mpr he⟩8081theorem importantTimes_eq (h : SamePattern P Q) : P.importantTimes=Q.importantTimes := by82  ext i83  simp only [Path.importantTimes,Finset.mem_filter,Finset.mem_univ,true_and]84  exact not_congr (h.edgeAt_mem_treeEdges_iff i)8586theorem vertices_card_eq (h : SamePattern P Q) (hm : 0 < m) :87    P.vertices.card=Q.vertices.card := by88  have hp := P.card_firstTimes hm89  have hq := Q.card_firstTimes hm90  rw [h.firstTimes_eq] at hp91  omega9293end SamePattern9495/-- Relabeling an arbitrary edge list by a bijection preserves its exact96singleton count; the statement is about literal multiplicities. -/97theorem singletonEdges_map_card {E : Type*} [DecidableEq E]98    (l : List E) (σ : Equiv.Perm E) :99    (HaarPathMultiplicity.singletonEdges (l.map σ)).card =100      (HaarPathMultiplicity.singletonEdges l).card := by101  classical102  have he : HaarPathMultiplicity.singletonEdges (l.map σ) =103      (HaarPathMultiplicity.singletonEdges l).image σ := by104    ext e105    simp only [HaarPathMultiplicity.singletonEdges,Finset.mem_filter,List.mem_toFinset,106      List.mem_map,Finset.mem_image]107    constructor108    · rintro ⟨⟨x,hx,rfl⟩,hc⟩109      refine ⟨x,⟨hx,?_⟩,rfl⟩110      simpa only [List.count_map_of_injective l σ σ.injective] using hc111    · rintro ⟨x,⟨hx,hc⟩,rfl⟩112      refine ⟨⟨x,hx,rfl⟩,?_⟩113      simpa only [List.count_map_of_injective l σ σ.injective] using hc114  rw [he,Finset.card_image_of_injective _ σ.injective]115116namespace SamePattern117118theorem singleton_card_eq [Fintype V] (h : SamePattern P Q) :119    (HaarPathMultiplicity.singletonEdges P.edgeList).card =120      (HaarPathMultiplicity.singletonEdges Q.edgeList).card := by121  obtain ⟨σ,hσ⟩ := exists_perm_of_kernel_eq P.edgeAt Q.edgeAt h.edgeAt_eq_iff122  have he : P.edgeList.map σ=Q.edgeList := by123    simp only [Path.edgeList,List.map_ofFn]124    apply congrArg List.ofFn125    funext i126    exact hσ i127  rw [←he,singletonEdges_map_card]128129theorem defectTwice_eq [Fintype V] (h : SamePattern P Q) (hm : 0 < m) :130    P.defectTwice=Q.defectTwice := by131  simp only [Path.defectTwice,h.vertices_card_eq hm,h.singleton_card_eq]132133end SamePattern134135/-- The important-position finset is an honest function on BC path classes. -/136def classImportantTimes (C : PathClass V d m) : Finset (Fin m) :=137  Quotient.lift Path.importantTimes138    (fun _ _ (h : SamePattern _ _) => h.importantTimes_eq) C139140/-- The defect is an honest function on nonempty path classes. -/141def classDefectTwice [Fintype V] (hm : 0 < m) (C : PathClass V d m) : ℕ :=142  Quotient.lift Path.defectTwice143    (fun _ _ (h : SamePattern _ _) => h.defectTwice_eq hm) C144145/-- The corrected exploration budget holds directly on genuine equivalence146classes, with no representative or graph invariant supplied by the caller. -/147theorem classImportantTimes_card_le [Fintype V] (hm : 0 < m) (C : PathClass V d m) :148    (classImportantTimes C).card ≤ classDefectTwice hm C+2 := by149  induction C using Quotient.inductionOn with150  | h P => exact P.card_importantTimes_le hm151152end Nonadditivity.HaarPathClasses