Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarProfileWordReverse

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

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

9 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarCoreChainWords7import Nonadditivity.HaarCoreChainReverseAddress8import Nonadditivity.HaarPathProfileReverse910/-! # Reversing an arbitrary word in an actual core-chain profile1112The chosen reduced word on one orientation determines a word in the actual13opposite profile. This is a map of literal finite profile families, with the14precise reversed index formula and inverse free-group evaluation.15-/16noncomputable section17set_option backward.isDefEq.respectTransparency false18set_option maxHeartbeats 100000019namespace Nonadditivity.HaarPathGraph.Path20open HaarPathProfiles HaarProfileCoefficient2122theorem ofFn_flip_rev {d j k : ℕ} (hj : j=k) (w : Fin k → Color d) :23    List.ofFn (fun i : Fin j => flipColor (w (Fin.cast hj i.rev))) =24      FreeGroup.invRev (List.ofFn w) := by25  subst j26  apply List.ext_getElem27  · simp [FreeGroup.invRev]28  · intro i hi hj29    simp only [List.getElem_ofFn,FreeGroup.invRev,List.getElem_map,30      List.getElem_reverse,List.length_map,List.length_ofFn,Fin.cast_refl]31    apply congrArg flipColor32    apply congrArg w33    apply Fin.ext34    simp only [id_eq,Fin.val_rev]35    omega3637variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)3839def reverseProfileWord (c : P.CoreChain)40    (w : Words d c.val.length (P.coreChainProfile c).val) :41    Words d (P.coreChainReverse c).val.length42      (P.coreChainProfile (P.coreChainReverse c)).val := by43  refine ⟨fun i => flipColor (w.val (Fin.cast (P.coreChainReverse_length c) i.rev)),?_⟩44  rw [ofFn_flip_rev]45  refine ⟨reduced_invRev w.property.1,?_,?_,?_⟩46  · rw [P.coreChainProfile_reverse_first]47    simp only [FreeGroup.invRev,List.head?_reverse,List.getLast?_map,48      w.property.2.2.1,Option.map_some]49    rfl50  · rw [P.coreChainProfile_reverse_last]51    simp only [FreeGroup.invRev,List.getLast?_reverse,List.head?_map,52      w.property.2.1,Option.map_some]53    rfl54  · intro a55    rw [P.coreChainProfile_reverse_count]56    change ((List.ofFn w.val).map flipColor).reverse.count a = _57    rw [List.count_reverse]58    rw [←flipColor_involutive a,59      List.count_map_of_injective _ flipColor flipColor_involutive.injective,60      flipColor_involutive]61    exact w.property.2.2.2 _6263@[simp] theorem reverseProfileWord_val (c : P.CoreChain)64    (w : Words d c.val.length (P.coreChainProfile c).val)65    (i : Fin (P.coreChainReverse c).val.length) :66    (P.reverseProfileWord c w).val i =67      flipColor (w.val (Fin.cast (P.coreChainReverse_length c) i.rev)) := rfl6869theorem reverseProfileWord_ofFn (c : P.CoreChain)70    (w : Words d c.val.length (P.coreChainProfile c).val) :71    List.ofFn (P.reverseProfileWord c w).val = FreeGroup.invRev (List.ofFn w.val) :=72  ofFn_flip_rev _ _7374@[simp] theorem reverseProfileWord_word (c : P.CoreChain)75    (w : Words d c.val.length (P.coreChainProfile c).val) :76    word (P.reverseProfileWord c w)=(word w)⁻¹ := by77  unfold word78  rw [P.reverseProfileWord_ofFn,FreeGroup.inv_mk]7980/-- Reversing the chosen signed word twice restores its literal letter list. -/81theorem reverseProfileWord_twice_ofFn (c : P.CoreChain)82    (w : Words d c.val.length (P.coreChainProfile c).val) :83    List.ofFn (P.reverseProfileWord (P.coreChainReverse c) (P.reverseProfileWord c w)).val =84      List.ofFn w.val := by85  rw [P.reverseProfileWord_ofFn,P.reverseProfileWord_ofFn,FreeGroup.invRev_invRev]8687/-- The actual profile-family elements are involutive, allowing for the88dependent equality between the twice-reversed chain and the original chain. -/89theorem reverseProfileWord_involutive (c : P.CoreChain)90    (w : Words d c.val.length (P.coreChainProfile c).val) :91    HEq (P.reverseProfileWord (P.coreChainReverse c) (P.reverseProfileWord c w)) w := by92  have hh (c' : P.CoreChain) (he : c'=c)93      (w' : Words d c'.val.length (P.coreChainProfile c').val)94      (hw : List.ofFn w'.val=List.ofFn w.val) : HEq w' w := by95    subst c'96    exact heq_of_eq (Subtype.ext (List.ofFn_injective hw))97  exact hh _ (P.coreChainReverse_involutive c) _ (P.reverseProfileWord_twice_ofFn c w)9899end Nonadditivity.HaarPathGraph.Path