Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarTimeCompositionReverse

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

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

20 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarTimeCompositions78/-! # Reversing actual positive time compositions -/9namespace Nonadditivity.HaarTimeCompositions10open scoped BigOperators1112/-- The recursive finite set contains exactly the positive lists of the13prescribed length and total duration. -/14theorem mem_compositions_iff {cuts n : ℕ} {t : List ℕ} :15    t ∈ compositions cuts n ↔16      t.length=cuts+1 ∧ t.sum=n ∧ ∀ a ∈ t, 0 < a := by17  constructor18  · intro ht19    exact ⟨length_of_mem ht,sum_of_mem ht,positive_of_mem ht⟩20  · intro ht21    induction cuts generalizing n t with22    | zero =>23        obtain ⟨hl,hs,hp⟩ := ht24        cases t with25        | nil => simp at hl26        | cons a t =>27            have ht : t=[] := List.length_eq_zero_iff.mp (by simp only [List.length_cons] at hl; omega)28            subst t29            have ha := hp a (by simp)30            simp only [List.sum_cons,List.sum_nil,Nat.add_zero] at hs31            subst n32            simp [compositions,show a ≠ 0 by omega]33    | succ cuts ih =>34        obtain ⟨hl,hs,hp⟩ := ht35        cases t with36        | nil => simp at hl37        | cons a t =>38            have ha := hp a (by simp)39            have ht : t.length=cuts+1 := by simp only [List.length_cons] at hl; omega40            have hs' : t.sum=n-((a-1)+1) := by41              simp only [List.sum_cons] at hs42              omega43            have hp' : ∀ b ∈ t, 0 < b := fun b hb => hp b (by simp [hb])44            have hm := ih ⟨ht,hs',hp'⟩45            simp only [compositions,Finset.mem_biUnion,Finset.mem_range,Finset.mem_image]46            refine ⟨a-1,?_,t,hm,?_⟩47            · simp only [List.sum_cons] at hs48              omega49            · congr 150              omega5152@[simp] theorem mem_compositions_reverse_iff {cuts n : ℕ} {t : List ℕ} :53    t.reverse ∈ compositions cuts n ↔ t ∈ compositions cuts n := by54  simp only [mem_compositions_iff,List.length_reverse,List.sum_reverse,List.mem_reverse]5556theorem reverse_mem_compositions {cuts n : ℕ} {t : List ℕ}57    (ht : t ∈ compositions cuts n) : t.reverse ∈ compositions cuts n :=58  mem_compositions_reverse_iff.mpr ht5960/-- Reversal is an actual permutation of the duration indexing type. -/61def reverseEquiv (cuts n : ℕ) : compositions cuts n ≃ compositions cuts n where62  toFun t := ⟨t.val.reverse,reverse_mem_compositions t.property⟩63  invFun t := ⟨t.val.reverse,reverse_mem_compositions t.property⟩64  left_inv t := Subtype.ext (List.reverse_reverse t.val)65  right_inv t := Subtype.ext (List.reverse_reverse t.val)6667/-- Reverse chronological and chronological duration sums agree exactly. -/68theorem sum_reverse {R : Type*} [AddCommMonoid R] (cuts n : ℕ) (f : List ℕ → R) :69    ∑ t ∈ compositions cuts n, f t.reverse = ∑ t ∈ compositions cuts n, f t := by70  apply Finset.sum_bij (fun t _ => t.reverse)71  · intro t ht72    exact reverse_mem_compositions ht73  · intro t ht u hu he74    simpa only [List.reverse_reverse] using congrArg List.reverse he75  · intro t ht76    exact ⟨t.reverse,reverse_mem_compositions ht,List.reverse_reverse t⟩77  · intro t ht78    rfl7980end Nonadditivity.HaarTimeCompositions