Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.FiniteSetFactorization

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

Direct imports

Imported by project modules

2 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

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

112 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.RegularDilation7import Nonadditivity.MatrixNormReindex8import Mathlib.LinearAlgebra.Matrix.Kronecker9import Mathlib.Data.Fintype.Prod1011/-!12# Positive Gram assembly over a finite difference support1314Every nonidentity word contributes half a positive modulus block.  Summing15over all such words avoids a choice of inverse-orbit representatives,16including the involution case.  The resulting coefficient matrix is17independent of the unitary representation at which it is evaluated.18The literal dilation coefficients and zero-column padding give the exact19factorization norm identity for every nonempty finite matrix representation.20Its scalar correction is bounded by `|S|` times the original polynomial's21actual infinite left regular norm.22-/2324noncomputable section25set_option backward.isDefEq.respectTransparency false2627namespace Nonadditivity.FiniteSetFactorization2829open scoped BigOperators ComplexOrder MatrixOrder Matrix.Norms.L2Operator Kronecker3031section MatrixBlocks3233variable {ζ ι ν : Type*} [Fintype ζ] [DecidableEq ζ]34  [Fintype ι] [DecidableEq ι] [Fintype ν] [DecidableEq ν]3536/-- Select one coefficient block. -/37def selector (g : ζ) : Matrix ι (ζ × ι) ℂ := fun i p => if p = (g, i) then 1 else 03839theorem selector_mul_adjoint (g h : ζ) :40    selector (ι := ι) g * (selector h).conjTranspose =41      if g = h then (1 : Matrix ι ι ℂ) else 0 := by42  ext i j43  by_cases hgh : g = h <;> by_cases hij : i = j <;>44    simp [Matrix.mul_apply, selector, Matrix.conjTranspose_apply,45      Prod.mk.injEq, Matrix.one_apply, hgh, hij, eq_comm]4647/-- Place a matrix in a specified coefficient block. -/48def place (g h : ζ) (A : Matrix ι ι ℂ) : Matrix (ζ × ι) (ζ × ι) ℂ :=49  (selector g).conjTranspose * A * selector h5051theorem place_posSemidef (g : ζ) (A : Matrix ι ι ℂ) (hA : A.PosSemidef) :52    (place g g A).PosSemidef := hA.conjTranspose_mul_mul_same _5354/-- Insert the full positive polar block at two coefficient rows. -/55def polarInsertion (g h : ζ) (c : Matrix ι ι ℂ) : Matrix (ζ × ι) (ζ × ι) ℂ :=56  let J := Matrix.fromRows (selector g) (selector h)57  J.conjTranspose *58    Matrix.fromBlocks (CFC.abs c.conjTranspose) c c.conjTranspose (CFC.abs c) * J5960theorem polarInsertion_posSemidef (g h : ζ) (c : Matrix ι ι ℂ) :61    (polarInsertion g h c).PosSemidef :=62  (Linearization.modulus_block_posSemidef c).conjTranspose_mul_mul_same _6364omit [Fintype ζ] in65theorem polarInsertion_eq (g h : ζ) (c : Matrix ι ι ℂ) :66    polarInsertion g h c =67      place g g (CFC.abs c.conjTranspose) + place g h c +68      place h g c.conjTranspose + place h h (CFC.abs c) := by69  simp only [polarInsertion, Matrix.conjTranspose_fromRows_eq_fromCols_conjTranspose,70    Matrix.fromCols_mul_fromBlocks, Matrix.fromCols_mul_fromRows,71    Matrix.add_mul, place]72  abel7374/-- The unitary block column used to evaluate the coefficient matrix. -/75def unitaryColumn (U : ζ → unitary (Matrix ν ν ℂ)) :76    Matrix ((ζ × ι) × ν) (ι × ν) ℂ :=77  ∑ g, (selector (ι := ι) g).conjTranspose ⊗ₖ (U g : Matrix ν ν ℂ)7879theorem select_unitaryColumn (U : ζ → unitary (Matrix ν ν ℂ)) (g : ζ) :80    (selector (ι := ι) g ⊗ₖ (1 : Matrix ν ν ℂ)) * unitaryColumn U =81      (1 : Matrix ι ι ℂ) ⊗ₖ (U g : Matrix ν ν ℂ) := by82  rw [unitaryColumn, Matrix.mul_sum]83  simp only [← Matrix.mul_kronecker_mul, selector_mul_adjoint, Matrix.one_mul]84  rw [Finset.sum_eq_single g]85  · simp86  · intro h hh hne87    simp [Ne.symm hne]88  · simp8990/-- Literal evaluation of a block coefficient matrix. -/91def evaluate (U : ζ → unitary (Matrix ν ν ℂ))92    (G : Matrix (ζ × ι) (ζ × ι) ℂ) : Matrix (ι × ν) (ι × ν) ℂ :=93  (unitaryColumn U).conjTranspose * (G ⊗ₖ (1 : Matrix ν ν ℂ)) * unitaryColumn U9495theorem evaluate_add (U : ζ → unitary (Matrix ν ν ℂ))96    (A B : Matrix (ζ × ι) (ζ × ι) ℂ) :97    evaluate U (A + B) = evaluate U A + evaluate U B := by98  simp [evaluate, Matrix.add_kronecker, Matrix.mul_add, Matrix.add_mul]99100theorem evaluate_smul (U : ζ → unitary (Matrix ν ν ℂ)) (r : ℝ)101    (A : Matrix (ζ × ι) (ζ × ι) ℂ) :102    evaluate U (r • A) = r • evaluate U A := by103  simp [evaluate, Matrix.smul_kronecker]104105theorem evaluate_sum {κ : Type*} (U : ζ → unitary (Matrix ν ν ℂ)) (s : Finset κ)106    (A : κ → Matrix (ζ × ι) (ζ × ι) ℂ) :107    evaluate U (∑ k ∈ s, A k) = ∑ k ∈ s, evaluate U (A k) := by108  classical109  induction s using Finset.induction_on with110  | empty => simp [evaluate]111  | insert k s hk ih => simp [hk, evaluate_add, ih]112113theorem evaluate_place (U : ζ → unitary (Matrix ν ν ℂ))114    (g h : ζ) (A : Matrix ι ι ℂ) :115    evaluate U (place g h A) =116      A ⊗ₖ ((U g : Matrix ν ν ℂ).conjTranspose * (U h : Matrix ν ν ℂ)) := by117  have hk : place g h A ⊗ₖ (1 : Matrix ν ν ℂ) =118      (selector (ι := ι) g ⊗ₖ (1 : Matrix ν ν ℂ)).conjTranspose *119      (A ⊗ₖ (1 : Matrix ν ν ℂ)) *120      (selector (ι := ι) h ⊗ₖ (1 : Matrix ν ν ℂ)) := by121    simp only [place, Matrix.conjTranspose_kronecker, Matrix.conjTranspose_one,122      ← Matrix.mul_kronecker_mul, Matrix.one_mul]123  have heq : evaluate U (place g h A) =124      ((selector (ι := ι) g ⊗ₖ (1 : Matrix ν ν ℂ)) * unitaryColumn U).conjTranspose *125      (A ⊗ₖ (1 : Matrix ν ν ℂ)) *126      ((selector (ι := ι) h ⊗ₖ (1 : Matrix ν ν ℂ)) * unitaryColumn U) := by127    rw [evaluate, hk]128    simp only [Matrix.conjTranspose_mul, Matrix.mul_assoc]129  rw [heq, select_unitaryColumn, select_unitaryColumn]130  simp only [Matrix.conjTranspose_kronecker, Matrix.conjTranspose_one,131    ← Matrix.mul_kronecker_mul, Matrix.one_mul, Matrix.mul_one]132133theorem evaluate_polarInsertion (U : ζ → unitary (Matrix ν ν ℂ))134    (g h : ζ) (c : Matrix ι ι ℂ) :135    evaluate U (polarInsertion g h c) =136      CFC.abs c.conjTranspose ⊗ₖ (1 : Matrix ν ν ℂ) +137      c ⊗ₖ ((U g : Matrix ν ν ℂ).conjTranspose * (U h : Matrix ν ν ℂ)) +138      c.conjTranspose ⊗ₖ ((U h : Matrix ν ν ℂ).conjTranspose * (U g : Matrix ν ν ℂ)) +139      CFC.abs c ⊗ₖ (1 : Matrix ν ν ℂ) := by140  rw [polarInsertion_eq]141  simp only [evaluate_add, evaluate_place]142  simp only [← Matrix.star_eq_conjTranspose, Unitary.coe_star_mul_self]143144end MatrixBlocks145146section FiniteSupport147148variable {G ι ν : Type*} [Group G] [DecidableEq G]149  [Fintype ι] [DecidableEq ι] [Fintype ν] [DecidableEq ν]150151abbrev Support (S : Finset G) := {g : G // g ∈ S}152abbrev NonidentityWords (S : Finset G) :=153  {w : G // w ∈ (Linearization.differenceSupport S).erase 1}154155private theorem exists_pair (S : Finset G) (w : NonidentityWords S) :156    ∃ p : Support S × Support S, p.1.val⁻¹ * p.2.val = w.val := by157  obtain ⟨g, hg, h, hh, heq⟩ :=158    Linearization.mem_differenceSupport.mp (Finset.mem_erase.mp w.property).2159  exact ⟨(⟨g, hg⟩, ⟨h, hh⟩), heq⟩160161/-- A genuine representing pair `g,h ∈ S` for each difference word. -/162def representative (S : Finset G) (w : NonidentityWords S) : Support S × Support S :=163  Classical.choose (exists_pair S w)164165theorem representative_spec (S : Finset G) (w : NonidentityWords S) :166    (representative S w).1.val⁻¹ * (representative S w).2.val = w.val :=167  Classical.choose_spec (exists_pair S w)168169def inverseWords (S : Finset G) : NonidentityWords S ≃ NonidentityWords S where170  toFun w := ⟨w.val⁻¹, Finset.mem_erase.mpr ⟨by171      have hw := (Finset.mem_erase.mp w.property).1172      simpa using hw,173    Linearization.inv_mem_differenceSupport (Finset.mem_erase.mp w.property).2⟩⟩174  invFun w := ⟨w.val⁻¹, Finset.mem_erase.mpr ⟨by175      have hw := (Finset.mem_erase.mp w.property).1176      simpa using hw,177    Linearization.inv_mem_differenceSupport (Finset.mem_erase.mp w.property).2⟩⟩178  left_inv w := by apply Subtype.ext; simp179  right_inv w := by apply Subtype.ext; simp180181/-- All nonidentity words contribute half of the positive polar block. -/182def nonconstantGram (S : Finset G) (c : G → Matrix ι ι ℂ) :183    Matrix (Support S × ι) (Support S × ι) ℂ :=184  ∑ w : NonidentityWords S, (1 / 2 : ℝ) •185    polarInsertion (representative S w).1 (representative S w).2 (c w.val)186187theorem nonconstantGram_posSemidef (S : Finset G) (c : G → Matrix ι ι ℂ) :188    (nonconstantGram S c).PosSemidef := by189  apply Matrix.posSemidef_sum190  intro w hw191  exact (polarInsertion_posSemidef _ _ _).smul (by norm_num : 0 ≤ (1 / 2 : ℝ))192193/-- The exact constant contribution from the nonidentity moduli. -/194def diagonalCorrection (S : Finset G) (c : G → Matrix ι ι ℂ) : Matrix ι ι ℂ :=195  ∑ w : NonidentityWords S, CFC.abs (c w.val)196197theorem diagonalCorrection_posSemidef (S : Finset G) (c : G → Matrix ι ι ℂ) :198    (diagonalCorrection S c).PosSemidef := by199  apply Matrix.posSemidef_sum200  intro w hw201  exact Matrix.LE.le.posSemidef (CFC.abs_nonneg _)202203/-- A finite-dimensional unitary representation restricted to the support. -/204def restrictedRepresentation (S : Finset G) (π : G →* unitary (Matrix ν ν ℂ)) :205    Support S → unitary (Matrix ν ν ℂ) := fun g => π g.val206207omit [DecidableEq G] in208theorem representation_difference (π : G →* unitary (Matrix ν ν ℂ)) (g h : G) :209    (π g : Matrix ν ν ℂ).conjTranspose * (π h : Matrix ν ν ℂ) =210      (π (g⁻¹ * h) : Matrix ν ν ℂ) := by211  rw [map_mul, map_inv]212  rfl213214theorem evaluate_representative_polar (S : Finset G) (c : G → Matrix ι ι ℂ)215    (π : G →* unitary (Matrix ν ν ℂ)) (w : NonidentityWords S) :216    evaluate (restrictedRepresentation S π)217        (polarInsertion (representative S w).1 (representative S w).2 (c w.val)) =218      CFC.abs (c w.val).conjTranspose ⊗ₖ (1 : Matrix ν ν ℂ) +219      c w.val ⊗ₖ (π w.val : Matrix ν ν ℂ) +220      (c w.val).conjTranspose ⊗ₖ (π w.val⁻¹ : Matrix ν ν ℂ) +221      CFC.abs (c w.val) ⊗ₖ (1 : Matrix ν ν ℂ) := by222  rw [evaluate_polarInsertion]223  unfold restrictedRepresentation224  rw [representation_difference, representation_difference, representative_spec]225  have hinv : (representative S w).2.val⁻¹ * (representative S w).1.val = w.val⁻¹ := by226    rw [← representative_spec S w]227    simp228  rw [hinv]229230private theorem inverse_modulus_sum (S : Finset G) (c : G → Matrix ι ι ℂ)231    (hstar : ∀ w ∈ Linearization.differenceSupport S, c w⁻¹ = (c w).conjTranspose) :232    (∑ w : NonidentityWords S, CFC.abs (c w.val).conjTranspose) = diagonalCorrection S c := by233  unfold diagonalCorrection234  apply Fintype.sum_equiv (inverseWords S)235  intro w236  rw [← hstar w.val (Finset.mem_erase.mp w.property).2]237  rfl238239omit [Fintype ι] [DecidableEq ι] in240private theorem inverse_polynomial_sum (S : Finset G) (c : G → Matrix ι ι ℂ)241    (hstar : ∀ w ∈ Linearization.differenceSupport S, c w⁻¹ = (c w).conjTranspose)242    (π : G →* unitary (Matrix ν ν ℂ)) :243    (∑ w : NonidentityWords S,244      (c w.val).conjTranspose ⊗ₖ (π w.val⁻¹ : Matrix ν ν ℂ)) =245      ∑ w : NonidentityWords S, c w.val ⊗ₖ (π w.val : Matrix ν ν ℂ) := by246  apply Fintype.sum_equiv (inverseWords S)247  intro w248  rw [← hstar w.val (Finset.mem_erase.mp w.property).2]249  rfl250251omit [Fintype ι] [DecidableEq ι] [Fintype ν] in252private theorem sum_kronecker_one {κ : Type*} [Fintype κ]253    (A : κ → Matrix ι ι ℂ) :254    (∑ k, A k ⊗ₖ (1 : Matrix ν ν ℂ)) = (∑ k, A k) ⊗ₖ (1 : Matrix ν ν ℂ) := by255  ext i j256  simp only [Matrix.sum_apply, Matrix.kroneckerMap_apply, Finset.sum_mul]257258/-- Evaluation of the sum of half-blocks is exactly the nonconstant259polynomial plus its sum of coefficient moduli. -/260theorem evaluate_nonconstantGram (S : Finset G) (c : G → Matrix ι ι ℂ)261    (hstar : ∀ w ∈ Linearization.differenceSupport S, c w⁻¹ = (c w).conjTranspose)262    (π : G →* unitary (Matrix ν ν ℂ)) :263    evaluate (restrictedRepresentation S π) (nonconstantGram S c) =264      (∑ w : NonidentityWords S, c w.val ⊗ₖ (π w.val : Matrix ν ν ℂ)) +265      diagonalCorrection S c ⊗ₖ (1 : Matrix ν ν ℂ) := by266  unfold nonconstantGram267  rw [evaluate_sum]268  simp only [evaluate_smul, evaluate_representative_polar]269  rw [← Finset.smul_sum]270  simp only [Finset.sum_add_distrib]271  rw [sum_kronecker_one, inverse_modulus_sum S c hstar,272    inverse_polynomial_sum S c hstar π, sum_kronecker_one]273  change (1 / 2 : ℝ) •274    (diagonalCorrection S c ⊗ₖ (1 : Matrix ν ν ℂ) +275      (∑ w : NonidentityWords S, c w.val ⊗ₖ (π w.val : Matrix ν ν ℂ)) +276      (∑ w : NonidentityWords S, c w.val ⊗ₖ (π w.val : Matrix ν ν ℂ)) +277      diagonalCorrection S c ⊗ₖ (1 : Matrix ν ν ℂ)) = _278  module279280private theorem one_mem_differenceSupport (S : Finset G) (hS : (1 : G) ∈ S) :281    (1 : G) ∈ Linearization.differenceSupport S :=282  Linearization.mem_differenceSupport.mpr ⟨1, hS, 1, hS, by simp⟩283284private theorem sum_words_eq {A : Type*} [AddCommMonoid A] (S : Finset G) (f : G → A) :285    (∑ w : NonidentityWords S, f w.val) =286      ∑ w ∈ (Linearization.differenceSupport S).erase 1, f w :=287  (Finset.sum_subtype (p := fun w => w ∈ (Linearization.differenceSupport S).erase 1)288    ((Linearization.differenceSupport S).erase 1) (fun _ => Iff.rfl) f).symm289290/-- The literal matrix polynomial on `S⁻¹S`. -/291def polynomial (S : Finset G) (c : G → Matrix ι ι ℂ)292    (π : G →* unitary (Matrix ν ν ℂ)) : Matrix (ι × ν) (ι × ν) ℂ :=293  ∑ w ∈ Linearization.differenceSupport S, c w ⊗ₖ (π w : Matrix ν ν ℂ)294295omit [Fintype ι] [DecidableEq ι] in296theorem polynomial_decompose (S : Finset G) (hS : (1 : G) ∈ S)297    (c : G → Matrix ι ι ℂ) (π : G →* unitary (Matrix ν ν ℂ)) :298    polynomial S c π =299      (∑ w : NonidentityWords S, c w.val ⊗ₖ (π w.val : Matrix ν ν ℂ)) +300      c 1 ⊗ₖ (1 : Matrix ν ν ℂ) := by301  have h := Finset.sum_erase_add (Linearization.differenceSupport S)302    (fun w => c w ⊗ₖ (π w : Matrix ν ν ℂ)) (one_mem_differenceSupport S hS)303  rw [sum_words_eq S (fun w => c w ⊗ₖ (π w : Matrix ν ν ℂ))]304  simpa only [polynomial,305    map_one, Submonoid.coe_one] using h.symm306307/-- The additive scalar is chosen from the actual coefficient moduli. -/308def theta (S : Finset G) (c : G → Matrix ι ι ℂ) : ℝ :=309  ‖diagonalCorrection S c + CFC.abs (c 1)‖310311theorem theta_nonneg (S : Finset G) (c : G → Matrix ι ι ℂ) : 0 ≤ theta S c := norm_nonneg _312313def constantCorrection (S : Finset G) (c : G → Matrix ι ι ℂ) : Matrix ι ι ℂ :=314  algebraMap ℝ (Matrix ι ι ℂ) (theta S c) + c 1 - diagonalCorrection S c315316theorem constantCorrection_posSemidef (S : Finset G) (hS : (1 : G) ∈ S)317    (c : G → Matrix ι ι ℂ)318    (hstar : ∀ w ∈ Linearization.differenceSupport S, c w⁻¹ = (c w).conjTranspose) :319    (constantCorrection S c).PosSemidef := by320  apply Linearization.constant_correction_posSemidef321    (diagonalCorrection S c) (c 1) (diagonalCorrection_posSemidef S c)322  simpa only [inv_one] using (hstar 1 (one_mem_differenceSupport S hS)).symm323324/-- The positive coefficient matrix with the exact constant correction. -/325def gramMatrix (S : Finset G) (hS : (1 : G) ∈ S) (c : G → Matrix ι ι ℂ) :326    Matrix (Support S × ι) (Support S × ι) ℂ :=327  nonconstantGram S c + place (⟨1, hS⟩ : Support S) ⟨1, hS⟩ (constantCorrection S c)328329theorem gramMatrix_posSemidef (S : Finset G) (hS : (1 : G) ∈ S)330    (c : G → Matrix ι ι ℂ)331    (hstar : ∀ w ∈ Linearization.differenceSupport S, c w⁻¹ = (c w).conjTranspose) :332    (gramMatrix S hS c).PosSemidef :=333  (nonconstantGram_posSemidef S c).add334    (place_posSemidef _ _ (constantCorrection_posSemidef S hS c hstar))335336private theorem algebraMap_kronecker_one (r : ℝ) :337    algebraMap ℝ (Matrix ι ι ℂ) r ⊗ₖ (1 : Matrix ν ν ℂ) =338      algebraMap ℝ (Matrix (ι × ν) (ι × ν) ℂ) r := by339  simp [Algebra.algebraMap_eq_smul_one, Matrix.smul_kronecker]340341/-- The full Gram evaluation identity, proved from the assembled coefficients. -/342theorem evaluate_gramMatrix (S : Finset G) (hS : (1 : G) ∈ S)343    (c : G → Matrix ι ι ℂ)344    (hstar : ∀ w ∈ Linearization.differenceSupport S, c w⁻¹ = (c w).conjTranspose)345    (π : G →* unitary (Matrix ν ν ℂ)) :346    evaluate (restrictedRepresentation S π) (gramMatrix S hS c) =347      polynomial S c π + algebraMap ℝ (Matrix (ι × ν) (ι × ν) ℂ) (theta S c) := by348  rw [gramMatrix, evaluate_add, evaluate_nonconstantGram S c hstar π, evaluate_place]349  have hunit :350      ((restrictedRepresentation S π) (⟨1, hS⟩ : Support S) : Matrix ν ν ℂ).conjTranspose *351      ((restrictedRepresentation S π) (⟨1, hS⟩ : Support S) : Matrix ν ν ℂ) = 1 := by352    simp [restrictedRepresentation]353  rw [hunit, add_assoc, ← Matrix.add_kronecker]354  have hcor : diagonalCorrection S c + constantCorrection S c =355      c 1 + algebraMap ℝ (Matrix ι ι ℂ) (theta S c) := by356    unfold constantCorrection357    abel358  rw [hcor, Matrix.add_kronecker, algebraMap_kronecker_one,359    polynomial_decompose S hS c π]360  abel361362theorem theta_eq_modulus_sum_norm (S : Finset G) (hS : (1 : G) ∈ S)363    (c : G → Matrix ι ι ℂ) :364    theta S c = ‖∑ w ∈ Linearization.differenceSupport S, CFC.abs (c w)‖ := by365  unfold theta diagonalCorrection366  congr 1367  rw [sum_words_eq S (fun w => CFC.abs (c w))]368  exact Finset.sum_erase_add _ _ (one_mem_differenceSupport S hS)369370/-- The scalar bound uses the actual infinite left regular polynomial. -/371theorem theta_le_card_mul_regularNorm (S : Finset G) (hS : (1 : G) ∈ S)372    (c : G → Matrix ι ι ℂ) :373    theta S c ≤ (S.card : ℝ) *374      ‖RegularCoefficientEnergy.regularPolynomial (Linearization.differenceSupport S) c‖ := by375  rw [theta_eq_modulus_sum_norm S hS]376  exact RegularCoefficientEnergy.differenceSupport_modulus_sum_norm_le S c377378/-- Genuine square-root coefficients, independent of the representation. -/379def factorCoefficient (S : Finset G) (hS : (1 : G) ∈ S) (c : G → Matrix ι ι ℂ)380    (g : Support S) : Matrix (Support S × ι) ι ℂ :=381  CFC.sqrt (gramMatrix S hS c) * (selector g).conjTranspose382383/-- The actual evaluated factor polynomial. -/384def factorPolynomial (S : Finset G) (hS : (1 : G) ∈ S) (c : G → Matrix ι ι ℂ)385    (π : G →* unitary (Matrix ν ν ℂ)) :386    Matrix ((Support S × ι) × ν) (ι × ν) ℂ :=387  ∑ g : Support S, factorCoefficient S hS c g ⊗ₖ (π g.val : Matrix ν ν ℂ)388389theorem factorPolynomial_eq (S : Finset G) (hS : (1 : G) ∈ S)390    (c : G → Matrix ι ι ℂ) (π : G →* unitary (Matrix ν ν ℂ)) :391    factorPolynomial S hS c π =392      (CFC.sqrt (gramMatrix S hS c) ⊗ₖ (1 : Matrix ν ν ℂ)) *393        unitaryColumn (restrictedRepresentation S π) := by394  unfold factorPolynomial factorCoefficient unitaryColumn restrictedRepresentation395  rw [Matrix.mul_sum]396  simp only [← Matrix.mul_kronecker_mul, Matrix.one_mul]397398/-- Universal finite-dimensional Gram factorization of the literal polynomial.399The Gram identity is a conclusion, rather than a supplied assumption. -/400theorem factorPolynomial_gram (S : Finset G) (hS : (1 : G) ∈ S)401    (c : G → Matrix ι ι ℂ)402    (hstar : ∀ w ∈ Linearization.differenceSupport S, c w⁻¹ = (c w).conjTranspose)403    (π : G →* unitary (Matrix ν ν ℂ)) :404    (factorPolynomial S hS c π).conjTranspose * factorPolynomial S hS c π =405      polynomial S c π + algebraMap ℝ (Matrix (ι × ν) (ι × ν) ℂ) (theta S c) := by406  have hG := gramMatrix_posSemidef S hS c hstar407  have hR := Linearization.positive_sqrt_gram (gramMatrix S hS c) hG408  rw [factorPolynomial_eq, Linearization.gram_factorization]409  simp only [Matrix.conjTranspose_kronecker, ← Matrix.mul_kronecker_mul,410    Matrix.conjTranspose_one, Matrix.one_mul, hR]411  exact evaluate_gramMatrix S hS c hstar π412413/-- The unconditional squared norm resulting from this Gram construction. -/414theorem factorPolynomial_norm_sq (S : Finset G) (hS : (1 : G) ∈ S)415    (c : G → Matrix ι ι ℂ)416    (hstar : ∀ w ∈ Linearization.differenceSupport S, c w⁻¹ = (c w).conjTranspose)417    (π : G →* unitary (Matrix ν ν ℂ)) :418    ‖factorPolynomial S hS c π‖ ^ 2 =419      ‖polynomial S c π + algebraMap ℝ (Matrix (ι × ν) (ι × ν) ℂ) (theta S c)‖ := by420  rw [pow_two, ← Matrix.l2_opNorm_conjTranspose_mul_self,421    factorPolynomial_gram S hS c hstar π]422423/-- The square coefficient matrices in the manuscript; the identity support424block supplies the zero-column padding of the rectangular factor. -/425def paddedCoefficient (S : Finset G) (hS : (1 : G) ∈ S) (c : G → Matrix ι ι ℂ)426    (g : Support S) : Matrix (Support S × ι) (Support S × ι) ℂ :=427  factorCoefficient S hS c g * selector (⟨1, hS⟩ : Support S)428429def paddedPolynomial (S : Finset G) (hS : (1 : G) ∈ S) (c : G → Matrix ι ι ℂ)430    (π : G →* unitary (Matrix ν ν ℂ)) :431    Matrix ((Support S × ι) × ν) ((Support S × ι) × ν) ℂ :=432  ∑ g : Support S, paddedCoefficient S hS c g ⊗ₖ (π g.val : Matrix ν ν ℂ)433434theorem paddedPolynomial_eq (S : Finset G) (hS : (1 : G) ∈ S)435    (c : G → Matrix ι ι ℂ) (π : G →* unitary (Matrix ν ν ℂ)) :436    paddedPolynomial S hS c π = factorPolynomial S hS c π *437      (selector (⟨1, hS⟩ : Support S) ⊗ₖ (1 : Matrix ν ν ℂ)) := by438  unfold paddedPolynomial paddedCoefficient factorPolynomial439  rw [Matrix.sum_mul]440  simp only [← Matrix.mul_kronecker_mul, Matrix.mul_one]441442theorem paddedPolynomial_norm (S : Finset G) (hS : (1 : G) ∈ S)443    (c : G → Matrix ι ι ℂ) (π : G →* unitary (Matrix ν ν ℂ)) :444    ‖paddedPolynomial S hS c π‖ = ‖factorPolynomial S hS c π‖ := by445  rw [paddedPolynomial_eq]446  apply Linearization.right_isometry_mul_norm447  simp only [Matrix.conjTranspose_kronecker, Matrix.conjTranspose_one,448    ← Matrix.mul_kronecker_mul, selector_mul_adjoint, ite_true, Matrix.one_mul,449    Matrix.one_kronecker_one]450451end FiniteSupport452453section Dilation454455variable {G ι ν : Type*} [Group G] [DecidableEq G]456  [Fintype ι] [DecidableEq ι] [Fintype ν] [DecidableEq ν]457458omit [Group G] [DecidableEq G] [DecidableEq ι] in459/-- The square coefficients have the exact manuscript dimension `2*m*B`. -/460theorem coefficient_dimension (S : Finset G) :461    Fintype.card (Support S × (ι ⊕ ι)) = 2 * Fintype.card ι * S.card := by462  have hcard : Fintype.card (Support S) = S.card :=463    Fintype.card_of_subtype S (fun _ => Iff.rfl)464  rw [Fintype.card_prod, Fintype.card_sum, hcard]465  ring466467/-- Actual Hermitian dilation coefficients of an arbitrary polynomial. -/468def dilationCoefficient (a : G → Matrix ι ι ℂ) (w : G) : Matrix (ι ⊕ ι) (ι ⊕ ι) ℂ :=469  Matrix.fromBlocks 0 (a w) (a w⁻¹).conjTranspose 0470471omit [DecidableEq G] [Fintype ι] [DecidableEq ι] in472theorem dilationCoefficient_inverse (a : G → Matrix ι ι ℂ) (w : G) :473    dilationCoefficient a w⁻¹ = (dilationCoefficient a w).conjTranspose := by474  simp [dilationCoefficient, Matrix.fromBlocks_conjTranspose]475476private theorem inverse_support_sum {A : Type*} [AddCommMonoid A]477    (S : Finset G) (f : G → A) :478    (∑ w ∈ Linearization.differenceSupport S, f w⁻¹) =479      ∑ w ∈ Linearization.differenceSupport S, f w := by480  apply Finset.sum_bij (fun w _ => w⁻¹)481  · intro w hw482    exact Linearization.inv_mem_differenceSupport hw483  · intro w hw v hv heq484    exact inv_injective heq485  · intro w hw486    exact ⟨w⁻¹, Linearization.inv_mem_differenceSupport hw, by simp⟩487  · intro w hw488    rfl489490omit [Fintype ι] [DecidableEq ι] in491theorem polynomial_adjoint (S : Finset G) (a : G → Matrix ι ι ℂ)492    (π : G →* unitary (Matrix ν ν ℂ)) :493    (polynomial S a π).conjTranspose =494      ∑ w ∈ Linearization.differenceSupport S,495        (a w⁻¹).conjTranspose ⊗ₖ (π w : Matrix ν ν ℂ) := by496  have hstar (w : G) : (π w : Matrix ν ν ℂ).conjTranspose =497      (π w⁻¹ : Matrix ν ν ℂ) := by498    rw [map_inv]499    rfl500  unfold polynomial501  simp only [Matrix.conjTranspose_sum, Matrix.conjTranspose_kronecker, hstar]502  have h := inverse_support_sum S503    (fun w => (a w⁻¹).conjTranspose ⊗ₖ (π w : Matrix ν ν ℂ))504  simpa only [inv_inv] using h505506omit [Fintype ι] [DecidableEq ι] in507/-- The coefficient assembly evaluates to the actual Hermitian dilation,508up to the explicit permutation that distributes a product over a sum. -/509theorem polynomial_dilation (S : Finset G) (a : G → Matrix ι ι ℂ)510    (π : G →* unitary (Matrix ν ν ℂ)) :511    Matrix.reindex (Equiv.sumProdDistrib ι ι ν) (Equiv.sumProdDistrib ι ι ν)512        (polynomial S (dilationCoefficient a) π) =513      Linearization.hermitianDilation (polynomial S a π) := by514  rw [Linearization.hermitianDilation, polynomial_adjoint]515  ext i j516  cases i with517  | inl i =>518      cases j with519      | inl j => simp [polynomial, dilationCoefficient, Matrix.reindex_apply,520          Matrix.sum_apply, Matrix.kroneckerMap_apply]521      | inr j => simp [polynomial, dilationCoefficient, Matrix.reindex_apply,522          Matrix.sum_apply, Matrix.kroneckerMap_apply]523  | inr i =>524      cases j with525      | inl j => simp [polynomial, dilationCoefficient, Matrix.reindex_apply,526          Matrix.sum_apply, Matrix.kroneckerMap_apply]527      | inr j => simp [polynomial, dilationCoefficient, Matrix.reindex_apply,528          Matrix.sum_apply, Matrix.kroneckerMap_apply]529530private theorem reindex_shift {κ μ : Type*} [Fintype κ] [Fintype μ]531    [DecidableEq κ] [DecidableEq μ]532    (e : κ ≃ μ) (A : Matrix κ κ ℂ) (θ : ℝ) :533    Matrix.reindex e e (A + algebraMap ℝ (Matrix κ κ ℂ) θ) =534      Matrix.reindex e e A + algebraMap ℝ (Matrix μ μ ℂ) θ := by535  ext i j536  simp [Matrix.reindex_apply, Algebra.algebraMap_eq_smul_one, Matrix.smul_apply,537    Matrix.one_apply, e.symm.injective.eq_iff]538539/-- The actual dilation, rather than general Hermiticity, supplies the exact540additive norm identity.  In particular no such identity is claimed for an541arbitrary self-adjoint coefficient polynomial. -/542theorem shifted_dilation_polynomial_norm [Nonempty ι] [Nonempty ν]543    (S : Finset G) (a : G → Matrix ι ι ℂ)544    (π : G →* unitary (Matrix ν ν ℂ)) (θ : ℝ) (hθ : 0 ≤ θ) :545    ‖polynomial S (dilationCoefficient a) π +546      algebraMap ℝ (Matrix ((ι ⊕ ι) × ν) ((ι ⊕ ι) × ν) ℂ) θ‖ =547        ‖polynomial S a π‖ + θ := by548  have h := MatrixNormReindex.reindex_norm (Equiv.sumProdDistrib ι ι ν)549    (polynomial S (dilationCoefficient a) π +550      algebraMap ℝ (Matrix ((ι ⊕ ι) × ν) ((ι ⊕ ι) × ν) ℂ) θ)551  rw [reindex_shift, polynomial_dilation,552    Linearization.shifted_dilation_norm _ θ hθ] at h553  exact h.symm554555/-- The square factor polynomial in the appendix has exactly the original556polynomial norm plus its explicit constant as squared norm. -/557theorem paddedPolynomial_dilation_norm_sq [Nonempty ι] [Nonempty ν]558    (S : Finset G) (hS : (1 : G) ∈ S) (a : G → Matrix ι ι ℂ)559    (π : G →* unitary (Matrix ν ν ℂ)) :560    ‖paddedPolynomial S hS (dilationCoefficient a) π‖ ^ 2 =561      ‖polynomial S a π‖ + theta S (dilationCoefficient a) := by562  rw [paddedPolynomial_norm, factorPolynomial_norm_sq S hS (dilationCoefficient a)563    (fun w _ => dilationCoefficient_inverse a w) π]564  exact shifted_dilation_polynomial_norm S a π _ (theta_nonneg S _)565566/-- The exact finite representation identity of Appendix A, with actual567representation-independent square coefficient matrices. -/568theorem paddedPolynomial_dilation_norm_identity [Nonempty ι] [Nonempty ν]569    (S : Finset G) (hS : (1 : G) ∈ S) (a : G → Matrix ι ι ℂ)570    (π : G →* unitary (Matrix ν ν ℂ)) :571    ‖polynomial S a π‖ = ‖paddedPolynomial S hS (dilationCoefficient a) π‖ ^ 2 -572      theta S (dilationCoefficient a) := by573  linarith [paddedPolynomial_dilation_norm_sq S hS a π]574575/-- The exact Appendix A correction bound for the original polynomial,576with the regular dilation norm equality proved on the actual infinite577square-summable Hilbert spaces. -/578theorem theta_dilation_le_card_mul_regularNorm (S : Finset G) (hS : (1 : G) ∈ S)579    (a : G → Matrix ι ι ℂ) :580    theta S (dilationCoefficient a) ≤ (S.card : ℝ) *581      ‖RegularCoefficientEnergy.regularPolynomial (Linearization.differenceSupport S) a‖ := by582  have h := theta_le_card_mul_regularNorm S hS (dilationCoefficient a)583  have hnorm :584      ‖RegularCoefficientEnergy.regularPolynomial (Linearization.differenceSupport S)585        (dilationCoefficient a)‖ =586      ‖RegularCoefficientEnergy.regularPolynomial (Linearization.differenceSupport S) a‖ := by587    simpa only [dilationCoefficient, RegularDilation.dilationCoefficient] using588      RegularDilation.dilation_polynomial_norm (Linearization.differenceSupport S)589        (fun _ hw => Linearization.inv_mem_differenceSupport hw) a590  rwa [hnorm] at h591592/-- The finite representation form of the complete finite-set factorization593lemma.  The witnessing scalar and coefficient matrices are the explicit594constructions above and therefore do not depend on the representation. -/595theorem exists_finite_factorization [Nonempty ι] [Nonempty ν]596    (S : Finset G) (hS : (1 : G) ∈ S) (a : G → Matrix ι ι ℂ) :597    ∃ (θ : ℝ)598      (b : Support S → Matrix (Support S × (ι ⊕ ι)) (Support S × (ι ⊕ ι)) ℂ),599      0 ≤ θ ∧ θ ≤ (S.card : ℝ) *600        ‖RegularCoefficientEnergy.regularPolynomial (Linearization.differenceSupport S) a‖ ∧601      ∀ π : G →* unitary (Matrix ν ν ℂ),602        ‖polynomial S a π‖ =603          ‖∑ g : Support S, b g ⊗ₖ (π g.val : Matrix ν ν ℂ)‖ ^ 2 - θ := by604  refine ⟨theta S (dilationCoefficient a), paddedCoefficient S hS (dilationCoefficient a),605    theta_nonneg S _, theta_dilation_le_card_mul_regularNorm S hS a, ?_⟩606  intro π607  exact paddedPolynomial_dilation_norm_identity S hS a π608609end Dilation610611end Nonadditivity.FiniteSetFactorization