Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.FreeEmbedding

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

Direct imports

  • Mathlib.GroupTheory.FreeGroup.Reduce dependency
  • Mathlib.Algebra.Group.Units.Equiv dependency
  • Mathlib.GroupTheory.Perm.Basic dependency
  • Mathlib.Data.Int.Basic dependency
  • Mathlib.Data.Nat.Log dependency
  • Mathlib.Logic.Equiv.Fintype dependency
  • Mathlib.Data.Fintype.Card dependency
  • Mathlib.Data.Fintype.EquivFin dependency
  • Mathlib.Data.Fintype.Prod dependency
  • Lean.Elab.Tactic.Omega dependency

Imported by project modules

3 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

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

115 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Mathlib.GroupTheory.FreeGroup.Reduce7import Mathlib.Algebra.Group.Units.Equiv8import Mathlib.GroupTheory.Perm.Basic9import Mathlib.Data.Int.Basic10import Mathlib.Data.Nat.Log11import Mathlib.Logic.Equiv.Fintype12import Mathlib.Data.Fintype.Card13import Mathlib.Data.Fintype.EquivFin14import Mathlib.Data.Fintype.Prod15import Lean.Elab.Tactic.Omega1617/-!18# Explicit free subgroup of the free group on two generators1920The binary covering graph construction proves the manuscript's short21embedding lemma, with generator length bound `2 * Nat.log 2 (K-1) + 1`.22A concrete finite state permutation representation proves injectivity,23without a topological covering-space hypothesis or an assumed free basis.24The file also includes the elementary conjugate construction `x^i y x^-i`25with length bound `2*K-1`.26-/2728namespace Nonadditivity.FreeEmbedding2930abbrev Two := FreeGroup Bool3132def x : Two := FreeGroup.of false33def y : Two := FreeGroup.of true3435/-- The `i`th conjugate in the explicit infinite free subgroup. -/36def conjugate (i : ℕ) : Two := x ^ i * y * (x ^ i)⁻¹3738private def leftRegular (G : Type*) [Group G] : G →* Equiv.Perm G where39  toFun := Equiv.mulLeft40  map_one' := by ext z; simp41  map_mul' g h := by ext z; simp4243private def shift : FreeGroup ℤ ≃* FreeGroup ℤ :=44  FreeGroup.freeGroupCongr (Equiv.addRight (1 : ℤ))4546private theorem shift_of (i : ℤ) :47    shift (FreeGroup.of i) = FreeGroup.of (i + 1) := by48  change FreeGroup.map (Equiv.addRight (1 : ℤ)) (FreeGroup.of i) = _49  rw [FreeGroup.map.of]50  rfl5152private def witnessAction : Two →* Equiv.Perm (FreeGroup ℤ) :=53  FreeGroup.lift (fun b : Bool => if b then Equiv.mulLeft (FreeGroup.of (0 : ℤ))54    else shift.toEquiv)5556private theorem witness_x : witnessAction x = shift.toEquiv := by57  simp [witnessAction, x]5859private theorem witness_y :60    witnessAction y = leftRegular (FreeGroup ℤ) (FreeGroup.of (0 : ℤ)) := by61  simp [witnessAction, y, leftRegular]6263private theorem automorphism_conjugation (G : Type*) [Group G]64    (e : G ≃* G) (g : G) :65    e.toEquiv * leftRegular G g * e.toEquiv⁻¹ = leftRegular G (e g) := by66  ext z67  change e (g * e.symm z) = e g * z68  rw [map_mul, e.apply_symm_apply]6970private theorem conjugate_succ (i : ℕ) :71    conjugate (i + 1) = x * conjugate i * x⁻¹ := by72  simp only [conjugate, pow_succ', mul_inv_rev, mul_assoc]7374private theorem witness_conjugate (i : ℕ) :75    witnessAction (conjugate i) =76      leftRegular (FreeGroup ℤ) (FreeGroup.of (i : ℤ)) := by77  induction i with78  | zero => simpa [conjugate] using witness_y79  | succ i hi =>80      rw [conjugate_succ, map_mul, map_mul, map_inv, hi, witness_x,81        automorphism_conjugation, shift_of]82      simp8384/-- The actual homomorphism sending generator `i` to `x^i y x^-i`. -/85def embedding (K : ℕ) : FreeGroup (Fin K) →* Two :=86  FreeGroup.lift (fun i => conjugate i.val)8788@[simp] theorem embedding_of (K : ℕ) (i : Fin K) :89    embedding K (FreeGroup.of i) = conjugate i.val := by90  simp [embedding]9192private theorem map_injective {α β : Type*} [Nonempty α]93    (f : α → β) (hf : Function.Injective f) :94    Function.Injective (FreeGroup.map f) := by95  classical96  have hleft : Function.LeftInverse (FreeGroup.map (Function.invFun f))97      (FreeGroup.map f) := by98    intro g99    rw [FreeGroup.map.comp]100    rw [Function.invFun_comp hf]101    exact FreeGroup.map.id g102  exact hleft.injective103104/-- Injectivity is proved by a concrete permutation representation of `F₂`.105The representation recovers each word in the independent integer-indexed106generators of `FreeGroup ℤ`. -/107theorem embedding_injective {K : ℕ} (hK : 0 < K) :108    Function.Injective (embedding K) := by109  haveI : Nonempty (Fin K) := ⟨⟨0, hK⟩⟩110  let index : Fin K → ℤ := fun i => i.val111  have hindex : Function.Injective index := by112    intro i j hij113    apply Fin.ext114    change (i.val : ℤ) = j.val at hij115    exact_mod_cast hij116  have hmap : Function.Injective (FreeGroup.map index) := map_injective index hindex117  have haction : witnessAction.comp (embedding K) =118      (leftRegular (FreeGroup ℤ)).comp (FreeGroup.map index) := by119    apply FreeGroup.ext_hom120    intro i121    simp only [MonoidHom.comp_apply, embedding_of, FreeGroup.map.of]122    exact witness_conjugate i.val123  intro g h heq124  apply hmap125  have heq' := congrArg (fun p : Equiv.Perm (FreeGroup ℤ) => p 1)126    (congrArg witnessAction heq)127  change (witnessAction.comp (embedding K) g) 1 =128    (witnessAction.comp (embedding K) h) 1 at heq'129  rw [haction] at heq'130  simpa [leftRegular] using heq'131132/-- The explicit generators have at most `2*i+1` letters. -/133theorem norm_conjugate_le (i : ℕ) :134    FreeGroup.norm (conjugate i) ≤ 2 * i + 1 := by135  calc136    FreeGroup.norm (conjugate i) ≤137        FreeGroup.norm (x ^ i * y) + FreeGroup.norm ((x ^ i)⁻¹) :=138      FreeGroup.norm_mul_le _ _139    _ ≤ (FreeGroup.norm (x ^ i) + FreeGroup.norm y) +140        FreeGroup.norm ((x ^ i)⁻¹) :=141      Nat.add_le_add_right (FreeGroup.norm_mul_le _ _) _142    _ = 2 * i + 1 := by143      rw [FreeGroup.norm_inv_eq]144      simp [x, y, FreeGroup.norm_of_pow, FreeGroup.norm_of]145      omega146147/-- A uniform bound for the generator images of the concrete embedding. -/148theorem norm_embedding_of_le (K : ℕ) (i : Fin K) :149    FreeGroup.norm (embedding K (FreeGroup.of i)) ≤ 2 * K - 1 := by150  rw [embedding_of]151  have hi := i.isLt152  exact (norm_conjugate_le i.val).trans (by omega)153154end Nonadditivity.FreeEmbedding155156namespace Nonadditivity.FreeEmbedding.Covering157158private def child (b : Bool) (v : ℕ) : ℕ := 2 * v + if b then 2 else 1159160private theorem child_pos (b : Bool) (v : ℕ) : 0 < child b v := by161  cases b <;> simp [child]162163private theorem child_injective (b : Bool) : Function.Injective (child b) := by164  intro v w h165  cases b <;> simp [child] at h <;> omega166167private theorem child_pair_injective {b c : Bool} {v w : ℕ}168    (h : child b v = child c w) : b = c ∧ v = w := by169  cases b <;> cases c <;> simp [child] at h ⊢ <;> omega170171private def treeEdge (M : ℕ) (e : Bool × Fin M) : Prop := child e.1 e.2.val < M172173private instance treeEdgeDecidable (M : ℕ) : DecidablePred (treeEdge M) :=174  fun e => inferInstanceAs (Decidable (child e.1 e.2.val < M))175176private abbrev TreeEdges (M : ℕ) := {e : Bool × Fin M // treeEdge M e}177private abbrev ExtraEdges (M : ℕ) := {e : Bool × Fin M // ¬ treeEdge M e}178179private def partialTarget (M : ℕ) (b : Bool) :180    {v : Fin M // child b v.val < M} → Fin M :=181  fun v => ⟨child b v.val, v.property⟩182183private theorem partialTarget_injective (M : ℕ) (b : Bool) :184    Function.Injective (partialTarget M b) := by185  intro v w h186  apply Subtype.ext187  apply Fin.ext188  apply child_injective b189  exact congrArg Fin.val h190191/-- Each partial labelled binary-tree map is completed to an actual permutation. -/192private noncomputable def transition (M : ℕ) (b : Bool) : Equiv.Perm (Fin M) :=193  (Equiv.ofInjective (partialTarget M b) (partialTarget_injective M b)).extendSubtype194195private theorem transition_tree (M : ℕ) (b : Bool) (v : Fin M)196    (h : child b v.val < M) :197    (transition M b v).val = child b v.val := by198  unfold transition199  rw [Equiv.extendSubtype_apply_of_mem _ v h]200  rfl201202private noncomputable def edgeLabel (M : ℕ) (b : Bool) (v : Fin M) :203    FreeGroup (ExtraEdges M) :=204  if h : treeEdge M (b, v) then 1 else FreeGroup.of ⟨(b, v), h⟩205206private theorem edgeLabel_tree (M : ℕ) (b : Bool) (v : Fin M)207    (h : child b v.val < M) : edgeLabel M b v = 1 := by208  simp [edgeLabel, treeEdge, h]209210private noncomputable def skew (M : ℕ) (b : Bool) :211    Equiv.Perm (Fin M × FreeGroup (ExtraEdges M)) where212  toFun z := (transition M b z.1, edgeLabel M b z.1 * z.2)213  invFun z := ((transition M b).symm z.1,214    (edgeLabel M b ((transition M b).symm z.1))⁻¹ * z.2)215  left_inv z := by simp216  right_inv z := by simp217218private theorem skew_apply (M : ℕ) (b : Bool)219    (v : Fin M) (g : FreeGroup (ExtraEdges M)) :220    skew M b (v, g) = (transition M b v, edgeLabel M b v * g) := rfl221222private noncomputable def action (M : ℕ) :223    Two →* Equiv.Perm (Fin M × FreeGroup (ExtraEdges M)) := FreeGroup.lift (skew M)224225private theorem action_of (M : ℕ) (b : Bool) : action M (FreeGroup.of b) = skew M b := by226  simp [action]227228private def parent (v : ℕ) : ℕ := (v - 1) / 2229private def parentLabel (v : ℕ) : Bool := decide (v % 2 = 0)230231private theorem parent_lt {v : ℕ} (h : 0 < v) : parent v < v := by232  unfold parent233  omega234235private theorem child_parent {v : ℕ} (h : 0 < v) :236    child (parentLabel v) (parent v) = v := by237  simp only [child, parentLabel, parent]238  split <;> simp_all <;> omega239240private def path (v : ℕ) : Two :=241  if v = 0 then 1 else FreeGroup.of (parentLabel v) * path (parent v)242termination_by v243decreasing_by apply parent_lt; omega244245private theorem path_zero : path 0 = 1 := by rw [path]; simp246247private theorem path_pos {v : ℕ} (h : 0 < v) :248    path v = FreeGroup.of (parentLabel v) * path (parent v) := by249  rw [path]250  simp [Nat.ne_of_gt h]251252private theorem path_action (M : ℕ) (hM : 0 < M) (v : ℕ) (hv : v < M)253    (g : FreeGroup (ExtraEdges M)) :254    action M (path v) (⟨0, hM⟩, g) = (⟨v, hv⟩, g) := by255  induction v using Nat.strong_induction_on with256  | h v ih =>257      by_cases hz : v = 0258      · subst v259        simp [path_zero]260      · have hp : parent v < v := parent_lt (Nat.pos_of_ne_zero hz)261        have hpM : parent v < M := hp.trans hv262        have hchild : child (parentLabel v) (parent v) = v :=263          child_parent (Nat.pos_of_ne_zero hz)264        rw [path_pos (Nat.pos_of_ne_zero hz), map_mul, Equiv.Perm.mul_apply,265          ih (parent v) hp hpM, action_of, skew_apply]266        have hc : child (parentLabel v) (⟨parent v, hpM⟩ : Fin M).val < M := by267          simpa [hchild] using hv268        rw [edgeLabel_tree M (parentLabel v) ⟨parent v, hpM⟩ hc, one_mul]269        congr 1270        apply Fin.ext271        rw [transition_tree M (parentLabel v) ⟨parent v, hpM⟩ hc]272        exact hchild273274private theorem path_inverse_action (M : ℕ) (hM : 0 < M) (v : Fin M)275    (g : FreeGroup (ExtraEdges M)) :276    action M (path v.val)⁻¹ (v, g) = (⟨0, hM⟩, g) := by277  apply (action M (path v.val)).injective278  rw [map_inv]279  change (action M (path v.val)) ((action M (path v.val)).symm (v, g)) = _280  rw [Equiv.apply_symm_apply]281  exact (path_action M hM v.val v.isLt g).symm282283private theorem norm_path_le (v : ℕ) : FreeGroup.norm (path v) ≤ Nat.log 2 (v + 1) := by284  induction v using Nat.strong_induction_on with285  | h v ih =>286      by_cases hz : v = 0287      · subst v; simp [path_zero, FreeGroup.norm_one]288      · have hv : 0 < v := Nat.pos_of_ne_zero hz289        have hp : parent v < v := parent_lt hv290        have hparent : parent v + 1 = (v + 1) / 2 := by unfold parent; omega291        have hlog : 1 ≤ Nat.log 2 (v + 1) :=292          (Nat.le_log_iff_pow_le (by decide) (by omega)).2 (by simp; omega)293        calc294          FreeGroup.norm (path v) ≤295              FreeGroup.norm (FreeGroup.of (parentLabel v)) +296              FreeGroup.norm (path (parent v)) := by297            rw [path_pos hv]298            exact FreeGroup.norm_mul_le _ _299          _ ≤ 1 + Nat.log 2 (parent v + 1) := by300            rw [FreeGroup.norm_of]301            exact Nat.add_le_add_left (ih (parent v) hp) 1302          _ = Nat.log 2 (v + 1) := by303            rw [hparent, Nat.log_div_base]304            omega305306private noncomputable def basedLoop (M : ℕ) (e : ExtraEdges M) : Two :=307  (path (transition M e.val.1 e.val.2).val)⁻¹ *308    FreeGroup.of e.val.1 * path e.val.2.val309310private theorem basedLoop_action (M : ℕ) (hM : 0 < M) (e : ExtraEdges M)311    (g : FreeGroup (ExtraEdges M)) :312    action M (basedLoop M e) (⟨0, hM⟩, g) =313      (⟨0, hM⟩, FreeGroup.of e * g) := by314  rw [basedLoop, map_mul, map_mul, Equiv.Perm.mul_apply, Equiv.Perm.mul_apply,315    path_action M hM e.val.2.val e.val.2.isLt g, action_of, skew_apply]316  have he : edgeLabel M e.val.1 e.val.2 = FreeGroup.of e := by317    simp [edgeLabel, e.property]318  rw [he]319  exact path_inverse_action M hM (transition M e.val.1 e.val.2) (FreeGroup.of e * g)320321private noncomputable def loopMap (M : ℕ) : FreeGroup (ExtraEdges M) →* Two :=322  FreeGroup.lift (basedLoop M)323324private theorem loopMap_action (M : ℕ) (hM : 0 < M) (w : FreeGroup (ExtraEdges M))325    (g : FreeGroup (ExtraEdges M)) :326    action M (loopMap M w) (⟨0, hM⟩, g) = (⟨0, hM⟩, w * g) := by327  induction w using FreeGroup.induction_on generalizing g with328  | C1 => simp329  | of e =>330      simpa [loopMap] using basedLoop_action M hM e g331  | inv_of e he =>332      apply (action M (loopMap M (FreeGroup.of e))).injective333      simp only [map_inv]334      change (action M (loopMap M (FreeGroup.of e)))335          ((action M (loopMap M (FreeGroup.of e))).symm (⟨0, hM⟩, g)) =336        (action M (loopMap M (FreeGroup.of e)))337          (⟨0, hM⟩, (FreeGroup.of e)⁻¹ * g)338      rw [Equiv.apply_symm_apply, he]339      simp340  | mul u v hu hv =>341      rw [map_mul, map_mul, Equiv.Perm.mul_apply, hv, hu]342      simp [mul_assoc]343344private theorem loopMap_injective (M : ℕ) (hM : 0 < M) :345    Function.Injective (loopMap M) := by346  intro u v huv347  have h := congrArg (fun w => action M w (⟨0, hM⟩, 1)) huv348  simpa [loopMap_action M hM] using congrArg Prod.snd h349350private theorem norm_basedLoop_le (M : ℕ) (e : ExtraEdges M) :351    FreeGroup.norm (basedLoop M e) ≤ 2 * Nat.log 2 M + 1 := by352  have hsource : Nat.log 2 (e.val.2.val + 1) ≤ Nat.log 2 M :=353    Nat.log_monotone (by omega)354  have htarget : Nat.log 2 ((transition M e.val.1 e.val.2).val + 1) ≤ Nat.log 2 M :=355    Nat.log_monotone (by have h := (transition M e.val.1 e.val.2).isLt; omega)356  calc357    FreeGroup.norm (basedLoop M e) ≤358        FreeGroup.norm ((path (transition M e.val.1 e.val.2).val)⁻¹ *359          FreeGroup.of e.val.1) + FreeGroup.norm (path e.val.2.val) :=360      FreeGroup.norm_mul_le _ _361    _ ≤ (FreeGroup.norm ((path (transition M e.val.1 e.val.2).val)⁻¹) +362        FreeGroup.norm (FreeGroup.of e.val.1)) + FreeGroup.norm (path e.val.2.val) :=363      Nat.add_le_add_right (FreeGroup.norm_mul_le _ _) _364    _ ≤ (Nat.log 2 M + 1) + Nat.log 2 M := by365      rw [FreeGroup.norm_inv_eq, FreeGroup.norm_of]366      exact Nat.add_le_add367        (Nat.add_le_add_right ((norm_path_le _).trans htarget) 1)368        ((norm_path_le _).trans hsource)369    _ = 2 * Nat.log 2 M + 1 := by omega370371private def treeTarget (M : ℕ) (hM : 0 < M) :372    TreeEdges M → {v : Fin M // v ≠ ⟨0, hM⟩} := fun e =>373  ⟨⟨child e.val.1 e.val.2.val, e.property⟩, by374    intro h375    have hv := congrArg Fin.val h376    have hp := child_pos e.val.1 e.val.2.val377    change child e.val.1 e.val.2.val = 0 at hv378    omega⟩379380private theorem treeTarget_injective (M : ℕ) (hM : 0 < M) :381    Function.Injective (treeTarget M hM) := by382  intro e f hef383  have hchild : child e.val.1 e.val.2.val = child f.val.1 f.val.2.val :=384    congrArg (fun z => z.val.val) hef385  obtain ⟨hb, hv⟩ := child_pair_injective hchild386  apply Subtype.ext387  exact Prod.ext hb (Fin.ext hv)388389private theorem extraEdges_card (M : ℕ) (hM : 0 < M) :390    M + 1 ≤ Fintype.card (ExtraEdges M) := by391  classical392  have htree := Fintype.card_le_of_injective (treeTarget M hM) (treeTarget_injective M hM)393  have hnonroot : Fintype.card {v : Fin M // v ≠ ⟨0, hM⟩} = M - 1 := by394    rw [Fintype.card_subtype_compl]395    simp396  rw [hnonroot] at htree397  have hcomp : Fintype.card (ExtraEdges M) = 2 * M - Fintype.card (TreeEdges M) := by398    rw [Fintype.card_subtype_compl]399    simp400  omega401402private noncomputable def edgeIndex (M : ℕ) (hM : 0 < M) : Fin (M + 1) ↪ ExtraEdges M :=403  Classical.choice (Function.Embedding.nonempty_of_card_le (by404    simpa using extraEdges_card M hM))405406/-- The binary covering graph gives `M+1` independent based loops in `F₂`. -/407noncomputable def shortEmbedding (M : ℕ) (hM : 0 < M) : FreeGroup (Fin (M + 1)) →* Two :=408  (loopMap M).comp (FreeGroup.map (edgeIndex M hM))409410theorem shortEmbedding_injective (M : ℕ) (hM : 0 < M) :411    Function.Injective (shortEmbedding M hM) := by412  haveI : Nonempty (Fin (M + 1)) := ⟨0⟩413  exact (loopMap_injective M hM).comp414    (Nonadditivity.FreeEmbedding.map_injective (edgeIndex M hM) (edgeIndex M hM).injective)415416theorem norm_shortEmbedding_of_le (M : ℕ) (hM : 0 < M) (i : Fin (M + 1)) :417    FreeGroup.norm (shortEmbedding M hM (FreeGroup.of i)) ≤ 2 * Nat.log 2 M + 1 := by418  simp only [shortEmbedding, MonoidHom.comp_apply, FreeGroup.map.of, loopMap,419    FreeGroup.lift_apply_of]420  exact norm_basedLoop_le M _421422end Nonadditivity.FreeEmbedding.Covering423424namespace Nonadditivity.FreeEmbedding425426/-- The manuscript's embedding, obtained by completing the labelled binary427tree on `K-1` vertices and selecting `K` of its non-tree based loops. -/428noncomputable def logarithmicEmbedding (K : ℕ) (hK : 2 ≤ K) :429    FreeGroup (Fin K) →* Two :=430  (Covering.shortEmbedding (K - 1) (by omega)).comp431    (FreeGroup.freeGroupCongr (finCongr (by omega : K = K - 1 + 1))).toMonoidHom432433theorem logarithmicEmbedding_injective (K : ℕ) (hK : 2 ≤ K) :434    Function.Injective (logarithmicEmbedding K hK) :=435  (Covering.shortEmbedding_injective (K - 1) (by omega)).comp436    (FreeGroup.freeGroupCongr (finCongr (by omega : K = K - 1 + 1))).injective437438/-- Exact generator word length in the short free-group embedding.439`Nat.log 2 (K-1)` is the integer floor of the binary logarithm. -/440theorem norm_logarithmicEmbedding_of_le (K : ℕ) (hK : 2 ≤ K) (i : Fin K) :441    FreeGroup.norm (logarithmicEmbedding K hK (FreeGroup.of i)) ≤442      2 * Nat.log 2 (K - 1) + 1 := by443  unfold logarithmicEmbedding444  change FreeGroup.norm (Covering.shortEmbedding (K - 1) (by omega)445    (FreeGroup.map (finCongr (by omega : K = K - 1 + 1)) (FreeGroup.of i))) ≤ _446  rw [FreeGroup.map.of]447  exact Covering.norm_shortEmbedding_of_le (K - 1) (by omega) _448449/-- Unconditional existence form of the short embedding lemma. -/450theorem exists_short_embedding (K : ℕ) (hK : 2 ≤ K) :451    ∃ f : FreeGroup (Fin K) →* FreeGroup Bool,452      Function.Injective f ∧ ∀ i : Fin K,453        FreeGroup.norm (f (FreeGroup.of i)) ≤ 2 * Nat.log 2 (K - 1) + 1 :=454  ⟨logarithmicEmbedding K hK, logarithmicEmbedding_injective K hK,455    norm_logarithmicEmbedding_of_le K hK⟩456457end Nonadditivity.FreeEmbedding