Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathTransport

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

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

53 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathClassData7import Nonadditivity.HaarPathChainProfiles8import Nonadditivity.HaarPathDecomposition910/-! # Transport of the actual suppressed graph under path equivalence -/11noncomputable section12set_option backward.isDefEq.respectTransparency false13set_option maxHeartbeats 120000014namespace Nonadditivity.HaarPathClasses15open HaarPathGraph HaarPathProfiles16variable {V : Type*} [Fintype V] [DecidableEq V] {d m : ℕ}1718def incidenceDart (P : Path V d m) (a : Incidence m) : Dart V d :=19  if a.2 then P.traversal a.1 else reverse (P.traversal a.1)2021def flipIncidence (a : Incidence m) : Incidence m := (a.1,!a.2)2223@[simp] theorem source_incidenceDart (P : Path V d m) (a : Incidence m) :24    source (incidenceDart P a)=incidenceVertex P a := by25  obtain ⟨i,b⟩ := a26  cases b <;> simp [incidenceDart,incidenceVertex,Path.traversal]2728@[simp] theorem color_incidenceDart (P : Path V d m) (a : Incidence m) :29    color (incidenceDart P a)=incidenceColor P a := by30  obtain ⟨i,b⟩ := a31  cases b <;> simp [incidenceDart,incidenceColor,Path.traversal]3233@[simp] theorem incidenceDart_flip (P : Path V d m) (a : Incidence m) :34    incidenceDart P (flipIncidence a)=reverse (incidenceDart P a) := by35  obtain ⟨i,b⟩ := a36  cases b <;> simp [incidenceDart,flipIncidence]3738lemma dart_eq_iff_source_color_target (q r : Dart V d) : q=r ↔39    source q=source r ∧ color q=color r ∧ source (reverse q)=source (reverse r) := by40  obtain ⟨⟨x,a,y⟩,b⟩ := q41  obtain ⟨⟨x',a',y'⟩,b'⟩ := r42  cases b <;> cases b' <;> simp [source,color,reverse,Prod.mk.injEq] <;> tauto4344lemma incidenceDart_mem (P : Path V d m) (a : Incidence m) : incidenceDart P a ∈ P.darts := by45  obtain ⟨i,b⟩ := a46  cases b47  · exact P.reverse_traversal_mem i48  · exact P.traversal_mem i4950lemma exists_incidenceDart (P : Path V d m) {q : Dart V d} (hq : q ∈ P.darts) :51    ∃ a : Incidence m, incidenceDart P a=q := by52  obtain ⟨he,_⟩ := Finset.mem_product.mp hq53  obtain ⟨i,hi⟩ := List.mem_ofFn.mp (List.mem_toFinset.mp he)54  obtain ⟨e,b⟩ := q55  change edge (P.vertex i.castSucc) (P.colors i) (P.vertex i.succ)=e at hi56  subst e57  cases hc : P.colors i with58  | mk a c =>59    cases b <;> cases c60    · exact ⟨(i,true),by simp [incidenceDart,Path.traversal,dart,hc]⟩61    · exact ⟨(i,false),by simp [incidenceDart,Path.traversal,dart,reverse,hc]⟩62    · exact ⟨(i,false),by simp [incidenceDart,Path.traversal,dart,reverse,hc]⟩63    · exact ⟨(i,true),by simp [incidenceDart,Path.traversal,dart,hc]⟩6465namespace SamePattern66variable {P Q : Path V d m} (h : SamePattern P Q)67include h6869theorem incidenceDart_eq_iff (a b : Incidence m) :70    incidenceDart P a=incidenceDart P b ↔ incidenceDart Q a=incidenceDart Q b := by71  simp only [dart_eq_iff_source_color_target, source_incidenceDart,color_incidenceDart,72    ←incidenceDart_flip]73  constructor74  · rintro ⟨hv,hc,ht⟩75    exact ⟨(h.incidenceVertex_iff a b).mp hv,(h.2 a b hv).mp hc,76      (h.incidenceVertex_iff _ _).mp ht⟩77  · rintro ⟨hv,hc,ht⟩78    have hv' := (h.incidenceVertex_iff a b).mpr hv79    exact ⟨hv',(h.2 a b hv').mpr hc,(h.incidenceVertex_iff _ _).mpr ht⟩8081/-- Concrete permutations extending the finite observable vertex/dart maps. -/82def vertexPerm : Equiv.Perm V := Classical.choose (exists_perm_of_kernel_eq P.vertex Q.vertex h.1)83def dartPerm : Equiv.Perm (Dart V d) := Classical.choose84  (exists_perm_of_kernel_eq (incidenceDart P) (incidenceDart Q) h.incidenceDart_eq_iff)8586@[simp] theorem vertexPerm_apply (i : Fin (m+1)) : h.vertexPerm (P.vertex i)=Q.vertex i :=87  Classical.choose_spec (exists_perm_of_kernel_eq P.vertex Q.vertex h.1) i8889@[simp] theorem dartPerm_apply (a : Incidence m) : h.dartPerm (incidenceDart P a)=incidenceDart Q a :=90  Classical.choose_spec91    (exists_perm_of_kernel_eq (incidenceDart P) (incidenceDart Q) h.incidenceDart_eq_iff) a9293theorem dartPerm_mem_iff (q : Dart V d) : h.dartPerm q ∈ Q.darts ↔ q ∈ P.darts := by94  constructor95  · intro hq96    obtain ⟨a,ha⟩ := exists_incidenceDart Q hq97    have he : incidenceDart P a=q := h.dartPerm.injective ((h.dartPerm_apply a).trans ha)98    exact he ▸ incidenceDart_mem P a99  · intro hq100    obtain ⟨a,rfl⟩ := exists_incidenceDart P hq101    rw [h.dartPerm_apply]102    exact incidenceDart_mem Q a103104theorem source_dartPerm {q : Dart V d} (hq : q ∈ P.darts) :105    source (h.dartPerm q)=h.vertexPerm (source q) := by106  obtain ⟨a,rfl⟩ := exists_incidenceDart P hq107  simp only [dartPerm_apply,source_incidenceDart,incidenceVertex_eq,vertexPerm_apply]108109theorem dartPerm_reverse {q : Dart V d} (hq : q ∈ P.darts) :110    h.dartPerm (reverse q)=reverse (h.dartPerm q) := by111  obtain ⟨a,rfl⟩ := exists_incidenceDart P hq112  rw [←incidenceDart_flip,h.dartPerm_apply,h.dartPerm_apply,incidenceDart_flip]113114theorem vertexPerm_mem_vertices_iff (v : V) : h.vertexPerm v ∈ Q.vertices ↔ v ∈ P.vertices := by115  simp only [Path.vertices,Finset.mem_image,Finset.mem_univ,true_and]116  constructor117  · rintro ⟨i,hi⟩118    exact ⟨i,h.vertexPerm.injective ((h.vertexPerm_apply i.castSucc).trans hi)⟩119  · rintro ⟨i,rfl⟩120    exact ⟨i,(h.vertexPerm_apply i.castSucc).symm⟩121122/-- The transport preserves incidence degree, including loops twice. -/123theorem degree_vertexPerm (v : V) : Q.degree (h.vertexPerm v)=P.degree v := by124  have he : Q.darts.filter (fun q => source q=h.vertexPerm v) =125      (P.darts.filter (fun q => source q=v)).image h.dartPerm := by126    ext q127    constructor128    · intro hq129      have hq' := Finset.mem_filter.mp hq130      let r := h.dartPerm.symm q131      have hr : r ∈ P.darts := (h.dartPerm_mem_iff r).mp (by simpa [r] using hq'.1)132      refine Finset.mem_image.mpr ⟨r,Finset.mem_filter.mpr ⟨hr,?_⟩,by simp [r]⟩133      apply h.vertexPerm.injective134      rw [←h.source_dartPerm hr]135      simpa [r] using hq'.2136    · rintro hq137      obtain ⟨r,hr,rfl⟩ := Finset.mem_image.mp hq138      obtain ⟨hr,hs⟩ := Finset.mem_filter.mp hr139      exact Finset.mem_filter.mpr ⟨(h.dartPerm_mem_iff r).mpr hr,by rw [h.source_dartPerm hr,hs]⟩140  unfold Path.degree141  rw [he,Finset.card_image_of_injective _ h.dartPerm.injective]142143theorem vertexPerm_mem_core_iff (v : V) :144    h.vertexPerm v ∈ Q.coreVertices ↔ v ∈ P.coreVertices := by145  simp only [Path.coreVertices,Finset.mem_filter,h.vertexPerm_mem_vertices_iff,146    h.degree_vertexPerm,←h.vertexPerm_apply 0,h.vertexPerm.injective.eq_iff]147148theorem source_reverse_dartPerm {q : Dart V d} (hq : q ∈ P.darts) :149    source (reverse (h.dartPerm q))=h.vertexPerm (source (reverse q)) := by150  rw [←h.dartPerm_reverse hq]151  exact h.source_dartPerm (P.reverse_mem hq)152153/-- Degree-two stopping chains are preserved as literal lists of transported darts. -/154theorem toCore_map {l : List (Dart V d)} (hl : P.ToCore l) :155    Q.ToCore (l.map h.dartPerm) := by156  induction hl with157  | last a ha hc =>158    apply Path.ToCore.last159    · exact (h.dartPerm_mem_iff a).mpr ha160    · rw [h.source_reverse_dartPerm ha]161      exact (h.vertexPerm_mem_core_iff _).mpr hc162  | cons a b l ha hc hj hr ht ih =>163    apply Path.ToCore.cons164    · exact (h.dartPerm_mem_iff a).mpr ha165    · rw [h.source_reverse_dartPerm ha,h.vertexPerm_mem_core_iff]166      exact hc167    · rw [h.source_reverse_dartPerm ha,h.source_dartPerm (P.toCore_head_mem ht),hj]168    · rw [←h.dartPerm_reverse ha]169      exact fun he => hr (h.dartPerm.injective he)170    · exact ih171172/-- Transport of a complete oriented chain, including both core endpoints. -/173def coreChainMap (c : P.CoreChain) : Q.CoreChain := by174  refine ⟨c.val.map h.dartPerm,h.toCore_map c.property.1,?_⟩175  obtain ⟨a,l,he,hc⟩ := c.property.2176  have ha : a ∈ P.darts := P.toCore_head_mem (he ▸ c.property.1)177  refine ⟨h.dartPerm a,l.map h.dartPerm,by simp [he],?_⟩178  rw [h.source_dartPerm ha,h.vertexPerm_mem_core_iff]179  exact hc180181@[simp] theorem coreChainMap_val (c : P.CoreChain) :182    (h.coreChainMap c).val=c.val.map h.dartPerm := rfl183184@[simp] theorem coreChainMap_length (c : P.CoreChain) :185    (h.coreChainMap c).val.length=c.val.length := by simp186187theorem symm : SamePattern Q P := samePattern_equivalence.symm h188189theorem dartPerm_symm_apply {q : Dart V d} (hq : q ∈ P.darts) :190    h.symm.dartPerm (h.dartPerm q)=q := by191  obtain ⟨a,rfl⟩ := exists_incidenceDart P hq192  rw [h.dartPerm_apply,h.symm.dartPerm_apply]193194theorem coreChainMap_symm_apply (c : P.CoreChain) : h.symm.coreChainMap (h.coreChainMap c)=c := by195  apply Subtype.ext196  simp only [coreChainMap_val,List.map_map]197  calc198    _ = c.val.map id := List.map_congr_left (fun q hq =>199      h.dartPerm_symm_apply (P.toCore_mem c.property.1 hq))200    _ = _ := List.map_id _201202/-- The actual bijection of oriented suppressed chains. -/203def coreChainEquiv : P.CoreChain ≃ Q.CoreChain where204  toFun := h.coreChainMap205  invFun := h.symm.coreChainMap206  left_inv := h.coreChainMap_symm_apply207  right_inv c := by208    have he := h.symm.coreChainMap_symm_apply c209    convert he using 1210211@[simp] theorem coreChainEquiv_apply (c : P.CoreChain) : h.coreChainEquiv c=h.coreChainMap c := rfl212213/-- Orientation reversal commutes with the transported chain bijection. -/214theorem coreChainMap_reverse (c : P.CoreChain) :215    h.coreChainMap (P.coreChainReverse c)=Q.coreChainReverse (h.coreChainMap c) := by216  apply Subtype.ext217  change (c.val.reverse.map reverse).map h.dartPerm=(c.val.map h.dartPerm).reverse.map reverse218  simp only [List.map_map,List.map_reverse]219  apply congrArg List.reverse220  apply List.map_congr_left221  intro q hq222  exact h.dartPerm_reverse (P.toCore_mem c.property.1 hq)223224/-- Transport is pointwise in the original traversal time. -/225@[simp] theorem dartPerm_traversal (i : Fin m) : h.dartPerm (P.traversal i)=Q.traversal i :=226  h.dartPerm_apply (i,true)227228theorem traversalList_map : P.traversalList.map h.dartPerm=Q.traversalList := by229  simp only [Path.traversalList,List.map_ofFn]230  congr 1231  funext i232  exact h.dartPerm_traversal i233234/-- Every chain occurrence and every cut position is transported unchanged.235The chain colors may change; its length and traversal interval do not. -/236theorem chain_decomposition_map (cs : List P.CoreChain)237    (hc : (cs.map Subtype.val).flatten=P.traversalList) :238    ((cs.map h.coreChainMap).map Subtype.val).flatten=Q.traversalList := by239  rw [←h.traversalList_map,←hc,List.map_flatten]240  simp only [List.map_map,coreChainMap_val,Function.comp_def]241  rfl242243end SamePattern244end Nonadditivity.HaarPathClasses