Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.NetPolynomial

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

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

87 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.CollinsYounProduct7import Nonadditivity.ObservableDimension8import Nonadditivity.PrescribedTest9import Nonadditivity.RegularFactorization1011/-! # A finite family of observable tests as one actual polynomial1213Diagonal coefficient matrices give a direct sum on the genuine vector-valued14regular Hilbert space. Its norm is the maximum of the scalar test norms.15-/1617noncomputable section18set_option backward.isDefEq.respectTransparency false19set_option maxHeartbeats 8000002021namespace Nonadditivity.NetPolynomial2223open scoped BigOperators ENNReal Matrix Matrix.Norms.L2Operator24open RegularCoefficientEnergy (CoefficientSpace)2526section Slices27variable {G J : Type*} [Fintype J] [DecidableEq J]2829/-- One scalar coordinate of a vector-valued square-summable function. -/30def slice (j : J) (f : RegularCoefficientEnergy.Hilbert G J) : FreeModel.Hilbert G :=31  ⟨fun g => f g j, by32    apply memℓp_gen33    simp only [ENNReal.toReal_ofNat, Real.rpow_two]34    refine Summable.of_nonneg_of_le (fun _ => sq_nonneg _) (fun g => ?_)35      (by simpa using f.property.summable (by norm_num))36    rw [EuclideanSpace.norm_sq_eq]37    exact Finset.single_le_sum (fun i _ => sq_nonneg ‖f g i‖) (Finset.mem_univ j)⟩3839omit [DecidableEq J] in40@[simp] theorem slice_apply (j : J) (f : RegularCoefficientEnergy.Hilbert G J) (g : G) :41    slice j f g = f g j := rfl4243omit [DecidableEq J] in44theorem slice_energy (f : RegularCoefficientEnergy.Hilbert G J) :45    ‖f‖ ^ 2 = ∑ j, ‖slice j f‖ ^ 2 := by46  rw [MatrixRegularRestriction.norm_sq]47  simp_rw [EuclideanSpace.norm_sq_eq, MatrixRegularRestriction.norm_sq]48  exact Summable.tsum_finsetSum (fun j _ => by49    simpa using (slice j f).property.summable (by norm_num))5051/-- Include one scalar block isometrically in the coefficient direct sum. -/52def embed (j : J) (f : FreeModel.Hilbert G) : RegularCoefficientEnergy.Hilbert G J :=53  ⟨fun g => EuclideanSpace.single j (f g), by54    apply memℓp_gen55    simpa using f.property.summable (by norm_num)⟩5657@[simp] theorem slice_embed (j k : J) (f : FreeModel.Hilbert G) :58    slice j (embed k f) = if j = k then f else 0 := by59  ext g60  by_cases h : j = k <;> simp [slice, embed, EuclideanSpace.single_apply, h]6162theorem embed_norm (j : J) (f : FreeModel.Hilbert G) : ‖embed j f‖ = ‖f‖ := by63  apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp64  rw [MatrixRegularRestriction.norm_sq, MatrixRegularRestriction.norm_sq]65  simp [embed]6667omit [DecidableEq J] in68theorem slice_norm_le (j : J) (f : RegularCoefficientEnergy.Hilbert G J) :69    ‖slice j f‖ ≤ ‖f‖ := by70  apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mp71  rw [slice_energy]72  exact Finset.single_le_sum (fun i _ => sq_nonneg ‖slice i f‖) (Finset.mem_univ j)73end Slices7475section Polynomial76variable {G J I : Type*} [Group G] [Fintype J] [DecidableEq J] [Fintype I]7778/-- The diagonal coefficient `diag_j a_{ij}`. -/79def diagonalCoefficient (a : I → J → ℂ) (i : I) : Matrix J J ℂ :=80  Matrix.diagonal (a i)8182/-- The literal matrix-coefficient regular polynomial on `ℓ²(G;ℂ^J)`. -/83def regularPolynomial (w : I → G) (a : I → J → ℂ) :84    RegularCoefficientEnergy.Hilbert G J →L[ℂ] RegularCoefficientEnergy.Hilbert G J :=85  MatrixRegularRestriction.coefficientPolynomial w86    (fun i => RegularCoefficientEnergy.coefficientOperator (diagonalCoefficient a i))8788def scalarPolynomial (w : I → G) (a : I → J → ℂ) (j : J) :89    FreeModel.Hilbert G →L[ℂ] FreeModel.Hilbert G :=90  ∑ i, a i j • FreeModel.leftRegular (w i)9192omit [Fintype I] in93@[simp] theorem diagonalCoefficient_apply (a : I → J → ℂ) (i : I)94    (x : CoefficientSpace J) (j : J) :95    RegularCoefficientEnergy.coefficientOperator (diagonalCoefficient a i) x j =96      a i j * x j := by97  change ((Matrix.diagonal (a i)) *ᵥ x.ofLp) j = _98  simp [Matrix.mulVec, dotProduct, Matrix.diagonal_apply]99100/-- Coordinate compression is exactly the requested scalar test. -/101theorem slice_regularPolynomial (w : I → G) (a : I → J → ℂ)102    (j : J) (f : RegularCoefficientEnergy.Hilbert G J) :103    slice j (regularPolynomial w a f) = scalarPolynomial w a j (slice j f) := by104  ext g105  simp only [slice_apply, regularPolynomial, MatrixRegularRestriction.coefficientPolynomial_apply,106    WithLp.ofLp_sum, Finset.sum_apply, diagonalCoefficient_apply, scalarPolynomial, ContinuousLinearMap.sum_apply,107    ContinuousLinearMap.smul_apply, lp.coeFn_sum, Finset.sum_apply, lp.coeFn_smul,108    Pi.smul_apply, FreeModel.leftRegular_apply, smul_eq_mul]109110theorem regularPolynomial_norm_le (w : I → G) (a : I → J → ℂ)111    {C : ℝ} (hC : 0 ≤ C) (h : ∀ j, ‖scalarPolynomial w a j‖ ≤ C) :112    ‖regularPolynomial w a‖ ≤ C := by113  apply ContinuousLinearMap.opNorm_le_bound _ hC114  intro f115  apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hC (norm_nonneg _))).mp116  rw [slice_energy, mul_pow, slice_energy, Finset.mul_sum]117  apply Finset.sum_le_sum118  intro j _119  rw [slice_regularPolynomial, ← mul_pow]120  apply pow_le_pow_left₀ (norm_nonneg _)121  exact ((scalarPolynomial w a j).le_opNorm (slice j f)).trans122    (mul_le_mul_of_nonneg_right (h j) (norm_nonneg _))123124/-- No test norm exceeds the norm of the combined polynomial. -/125theorem scalarPolynomial_norm_le (w : I → G) (a : I → J → ℂ) (j : J) :126    ‖scalarPolynomial w a j‖ ≤ ‖regularPolynomial w a‖ := by127  apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _)128  intro f129  have h := (slice_norm_le j (regularPolynomial w a (embed j f))).trans130    ((regularPolynomial w a).le_opNorm (embed j f))131  simpa [slice_regularPolynomial, slice_embed, embed_norm] using h132133/-- The combined operator norm is exactly the finite maximum of test norms,134written as the canonical supremum norm on the finite family. -/135theorem regularPolynomial_norm (w : I → G) (a : I → J → ℂ) :136    ‖regularPolynomial w a‖ = ‖fun j => scalarPolynomial w a j‖ := by137  apply le_antisymm138  · exact regularPolynomial_norm_le w a (norm_nonneg _) (norm_le_pi_norm _)139  · exact (pi_norm_le_iff_of_nonneg (norm_nonneg _)).mpr (scalarPolynomial_norm_le w a)140end Polynomial141142section Tests143open FreeModel FiniteRealization144variable {K n : ℕ} {J : Type*} [Fintype J] [DecidableEq J]145146/-- The coefficients in the manuscript, with the branch pair as term index. -/147def testCoefficient (A : J → Matrix (Branch K n) (Branch K n) ℂ)148    (p : Branch K n × Branch K n) (j : J) : ℂ := (1 / (K : ℂ)^n) * A j p.1 p.2149150def testWord (p : Branch K n × Branch K n) : ProductFreeGroup K n :=151  (branchWord p.1)⁻¹ * branchWord p.2152153def regularTestPolynomial (A : J → Matrix (Branch K n) (Branch K n) ℂ) :=154  regularPolynomial testWord (testCoefficient A)155156omit [Fintype J] [DecidableEq J] in157@[simp] theorem scalar_testPolynomial158    (A : J → Matrix (Branch K n) (Branch K n) ℂ) (j : J) :159    scalarPolynomial testWord (testCoefficient A) j = gamma (A j) := by160  simp only [scalarPolynomial, testCoefficient, testWord, gamma, Fintype.sum_prod_type,161    Finset.smul_sum, mul_smul]162163theorem regularTestPolynomial_norm (A : J → Matrix (Branch K n) (Branch K n) ℂ) :164    ‖regularTestPolynomial A‖ = ‖fun j => gamma (A j)‖ := by165  rw [regularTestPolynomial, regularPolynomial_norm]166  simp only [scalar_testPolynomial]167168theorem test_norm_le (A : J → Matrix (Branch K n) (Branch K n) ℂ) (j : J) :169    freeNorm (A j) ≤ ‖regularTestPolynomial A‖ := by170  simpa only [scalar_testPolynomial, freeNorm] using171    scalarPolynomial_norm_le testWord (testCoefficient A) j172173/-- The actual combined regular polynomial satisfies the proved Collins--Youn174bound for every finite family of traceless unit Hilbert--Schmidt tests. -/175theorem regularTestPolynomial_norm_le (hK : 2 ≤ K) (hn : 1 ≤ n)176    (A : J → Matrix (Branch K n) (Branch K n) ℂ)177    (htrace : ∀ j, (A j).trace = 0) (hhs : ∀ j, AdjointPurity.hsLength (A j) = 1) :178    ‖regularTestPolynomial A‖ ≤ c K n := by179  apply regularPolynomial_norm_le _ _ (c_pos hK hn).le180  intro j181  rw [scalar_testPolynomial]182  exact freeNorm_le_of_collinsYoun (CollinsYounProduct.collinsYounBound hK hn)183    (A j) (htrace j) (hhs j)184end Tests185186section FiniteMatrices187variable {J V I : Type*} [Fintype J] [DecidableEq J]188  [Fintype V] [DecidableEq V] [Fintype I]189190/-- Finite direct sums form an injective star-algebra homomorphism. -/191def blockDiagonalHom :192    (J → Matrix V V ℂ) →⋆ₐ[ℂ] Matrix (V × J) (V × J) ℂ where193  toFun := Matrix.blockDiagonal194  map_zero' := Matrix.blockDiagonal_zero195  map_one' := Matrix.blockDiagonal_one196  map_add' := Matrix.blockDiagonal_add197  map_mul' := Matrix.blockDiagonal_mul198  commutes' z := by199    ext ⟨x,j⟩ ⟨y,k⟩200    simp only [Algebra.algebraMap_eq_smul_one, Matrix.blockDiagonal_smul,201      Matrix.blockDiagonal_one]202  map_star' A := by203    exact (Matrix.blockDiagonal_conjTranspose A).symm204205/-- The actual Euclidean operator norm of a finite block diagonal matrix. -/206theorem blockDiagonal_norm (A : J → Matrix V V ℂ) :207    ‖Matrix.blockDiagonal A‖ = ‖A‖ := by208  letI : CStarAlgebra (Matrix V V ℂ) := { }209  letI : CStarAlgebra (Matrix (V × J) (V × J) ℂ) := { }210  exact NonUnitalStarAlgHom.norm_map (blockDiagonalHom (J := J) (V := V))211    Matrix.blockDiagonal_injective A212213/-- Finite-dimensional evaluation of exactly the same diagonal coefficients. -/214def finitePolynomial (U : I → Matrix V V ℂ) (a : I → J → ℂ) :215    Matrix (V × J) (V × J) ℂ :=216  ∑ i, Matrix.kronecker (U i) (diagonalCoefficient a i)217218omit [Fintype J] [Fintype V] [DecidableEq V] in219/-- The coefficient polynomial is literally the direct sum of scalar tests;220the tensor factors are written with the representation coordinate first. -/221theorem finitePolynomial_eq_blockDiagonal (U : I → Matrix V V ℂ) (a : I → J → ℂ) :222    finitePolynomial U a = Matrix.blockDiagonal (fun j => ∑ i, a i j • U i) := by223  ext ⟨x,j⟩ ⟨y,k⟩224  simp only [finitePolynomial, Matrix.sum_apply, Matrix.kronecker, Matrix.kroneckerMap, Matrix.of_apply,225    diagonalCoefficient, Matrix.diagonal_apply, Matrix.blockDiagonal_apply,226    Matrix.smul_apply, smul_eq_mul]227  by_cases h : j = k228  · subst k229    simp only [ite_true]230    exact Finset.sum_congr rfl (fun i _ => mul_comm _ _)231  · simp [h]232233theorem finitePolynomial_norm (U : I → Matrix V V ℂ) (a : I → J → ℂ) :234    ‖finitePolynomial U a‖ = ‖fun j => ∑ i, a i j • U i‖ := by235  rw [finitePolynomial_eq_blockDiagonal, blockDiagonal_norm]236237omit [Fintype J] [Fintype V] [DecidableEq V] in238/-- Self-adjoint test blocks give an actual self-adjoint combined matrix. -/239theorem blockDiagonal_isHermitian (A : J → Matrix V V ℂ)240    (hA : ∀ j, (A j).IsHermitian) : (Matrix.blockDiagonal A).IsHermitian := by241  change (Matrix.blockDiagonal A).conjTranspose = _242  rw [Matrix.blockDiagonal_conjTranspose]243  congr 1244  funext j245  exact (hA j).eq246247omit [Fintype J] [Fintype V] [DecidableEq V] in248/-- Negation-paired tests make the combined matrix similar to its negative249by a literal permutation of coefficient coordinates. -/250theorem blockDiagonal_negation_reindex (A : J → Matrix V V ℂ)251    (e : J ≃ J) (he : ∀ j, A (e j) = - A j) :252    (Matrix.blockDiagonal A).submatrix (Equiv.prodCongr (Equiv.refl V) e)253      (Equiv.prodCongr (Equiv.refl V) e) = - Matrix.blockDiagonal A := by254  ext ⟨x,j⟩ ⟨y,k⟩255  simp only [Matrix.submatrix_apply, Equiv.prodCongr_apply,256    Matrix.blockDiagonal_apply, Matrix.neg_apply]257  by_cases h : j = k258  · subst k259    simp [he]260  · simp [h]261262/-- Exact spectral symmetry for the finite negation-paired polynomial. -/263theorem blockDiagonal_spectrum_neg (A : J → Matrix V V ℂ)264    (e : J ≃ J) (he : ∀ j, A (e j) = - A j) :265    spectrum ℂ (-Matrix.blockDiagonal A) = spectrum ℂ (Matrix.blockDiagonal A) := by266  let q := MatrixNormReindex.reindexStarAlgEquiv267    (Equiv.prodCongr (Equiv.refl V) e).symm268  have hq : q (Matrix.blockDiagonal A) = - Matrix.blockDiagonal A :=269    blockDiagonal_negation_reindex A e he270  rw [← hq]271  exact AlgEquiv.spectrum_eq q.toAlgEquiv _272end FiniteMatrices273274section RegularSymmetry275variable {G J I : Type*} [Group G] [Fintype J] [DecidableEq J] [Fintype I]276277/-- Reindex the finite coefficient coordinate inside the actual regular Hilbert space. -/278def permutationFunction (e : J ≃ J) (f : RegularCoefficientEnergy.Hilbert G J) :279    RegularCoefficientEnergy.Hilbert G J :=280  ⟨fun g => LinearIsometryEquiv.piLpCongrLeft 2 ℂ ℂ e.symm (f g), by281    apply memℓp_gen282    simpa only [LinearIsometryEquiv.norm_map] using f.property.summable (by norm_num)⟩283284omit [Group G] [DecidableEq J] in285@[simp] theorem permutationFunction_apply (e : J ≃ J)286    (f : RegularCoefficientEnergy.Hilbert G J) (g : G) (j : J) :287    permutationFunction e f g j = f g (e j) := rfl288289def permutationIsometry (e : J ≃ J) :290    RegularCoefficientEnergy.Hilbert G J ≃ₗᵢ[ℂ] RegularCoefficientEnergy.Hilbert G J where291  toFun := permutationFunction e292  invFun := permutationFunction e.symm293  left_inv := by intro f; ext g j; simp294  right_inv := by intro f; ext g j; simp295  map_add' := by intro f h; ext g j; rfl296  map_smul' := by intro z f; ext g j; rfl297  norm_map' := by298    intro f299    apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp300    rw [MatrixRegularRestriction.norm_sq, MatrixRegularRestriction.norm_sq]301    exact tsum_congr (fun g => congrArg (fun x : ℝ => x^2)302      ((LinearIsometryEquiv.piLpCongrLeft 2 ℂ ℂ e.symm).norm_map (f g)))303304omit [Group G] [DecidableEq J] in305@[simp] theorem permutationIsometry_apply (e : J ≃ J)306    (f : RegularCoefficientEnergy.Hilbert G J) (g : G) (j : J) :307    permutationIsometry e f g j = f g (e j) := rfl308309omit [Group G] [DecidableEq J] in310@[simp] theorem permutationIsometry_symm_apply (e : J ≃ J)311    (f : RegularCoefficientEnergy.Hilbert G J) (g : G) (j : J) :312    (permutationIsometry e).symm f g j = f g (e.symm j) := rfl313314/-- Negation pairing acts by genuine unitary conjugation on the regular polynomial. -/315theorem regularPolynomial_negation_conjugate (w : I → G) (a : I → J → ℂ)316    (e : J ≃ J) (he : ∀ i j, a i (e j) = -a i j) :317    (permutationIsometry (G := G) e).conjStarAlgEquiv (regularPolynomial w a) =318      -regularPolynomial w a := by319  ext f g j320  simp only [LinearIsometryEquiv.conjStarAlgEquiv_apply_apply, permutationIsometry_apply,321    regularPolynomial, MatrixRegularRestriction.coefficientPolynomial_apply,322    WithLp.ofLp_sum, Finset.sum_apply, diagonalCoefficient_apply,323    permutationIsometry_symm_apply, Equiv.symm_apply_apply, he,324    ContinuousLinearMap.neg_apply, lp.coeFn_neg, Pi.neg_apply, WithLp.ofLp_neg]325  simp only [neg_mul, Finset.sum_neg_distrib]326327/-- Exact spectral symmetry holds in the actual infinite regular representation. -/328theorem regularPolynomial_spectrum_neg (w : I → G) (a : I → J → ℂ)329    (e : J ≃ J) (he : ∀ i j, a i (e j) = -a i j) :330    spectrum ℝ (-regularPolynomial w a) = spectrum ℝ (regularPolynomial w a) := by331  rw [← regularPolynomial_negation_conjugate w a e he]332  exact AlgEquiv.spectrum_eq333    ((permutationIsometry (G := G) e).conjStarAlgEquiv.toAlgEquiv.restrictScalars ℝ) _334end RegularSymmetry335336section RegularSelfAdjoint337variable {G J I : Type*} [Group G] [DecidableEq G] [Fintype J] [DecidableEq J] [Fintype I]338339omit [DecidableEq G] in340theorem regularPolynomial_eq_terms (w : I → G) (a : I → J → ℂ) :341    regularPolynomial w a = ∑ i, RegularFactorization.term (diagonalCoefficient a i) (w i) := by342  apply Finset.sum_congr rfl343  intro i _344  ext f g j345  rfl346347/-- Adjoint of the literal matrix-coefficient regular polynomial. -/348theorem regularPolynomial_adjoint (w : I → G) (a : I → J → ℂ) :349    (regularPolynomial w a).adjoint =350      ∑ i, RegularFactorization.term (diagonalCoefficient a i).conjTranspose (w i)⁻¹ := by351  rw [regularPolynomial_eq_terms]352  simp only [map_sum, RegularFactorization.term_adjoint]353end RegularSelfAdjoint354355section SelfAdjointTests356open FreeModel357variable {K n : ℕ} {J : Type*} [Fintype J] [DecidableEq J]358359/-- Every Hermitian test produces a self-adjoint block; the combined regular360operator is therefore self-adjoint on the actual infinite Hilbert space. -/361theorem regularTestPolynomial_selfAdjoint362    (A : J → Matrix (Branch K n) (Branch K n) ℂ) (hA : ∀ j, (A j).IsHermitian) :363    IsSelfAdjoint (regularTestPolynomial A) := by364  classical365  change (regularTestPolynomial A).adjoint = _366  rw [regularTestPolynomial, regularPolynomial_adjoint, regularPolynomial_eq_terms]367  rw [Fintype.sum_prod_type, Fintype.sum_prod_type, Finset.sum_comm]368  apply Finset.sum_congr rfl369  intro a _370  apply Finset.sum_congr rfl371  intro b _372  have hc : (diagonalCoefficient (testCoefficient A) (b,a)).conjTranspose =373      diagonalCoefficient (testCoefficient A) (a,b) := by374    ext j k375    simp only [Matrix.conjTranspose_apply, diagonalCoefficient, Matrix.diagonal_apply]376    by_cases h : j = k377    · subst k378      simp only [ite_true, testCoefficient, star_mul, star_div₀, star_one, star_pow,379        star_natCast]380      have hh := congrArg (fun M : Matrix (Branch K n) (Branch K n) ℂ => M a b) (hA j).eq381      simpa only [Matrix.conjTranspose_apply, mul_comm] using congrArg382        (fun z : ℂ => (1 / (K : ℂ)^n) * z) hh383    · simp [h, Ne.symm h]384  rw [hc]385  congr 1386387/-- Negation-paired observable tests give exact spectral symmetry without388introducing a doubled coefficient space. -/389theorem regularTestPolynomial_spectrum_neg390    (A : J → Matrix (Branch K n) (Branch K n) ℂ)391    (e : J ≃ J) (he : ∀ j, A (e j) = - A j) :392    spectrum ℝ (-regularTestPolynomial A) = spectrum ℝ (regularTestPolynomial A) := by393  apply regularPolynomial_spectrum_neg _ _ e394  intro p j395  simp only [testCoefficient, he, Matrix.neg_apply, mul_neg]396end SelfAdjointTests397398section ObservableNets399open FreeModel FiniteRealization400variable {K n : ℕ}401402/-- The literal combined regular polynomial of a finite observable net. -/403def netRegularPolynomial (tests : Finset (ObservableSpace (Branch K n))) :404    RegularCoefficientEnergy.Hilbert (ProductFreeGroup K n) tests →L[ℂ]405      RegularCoefficientEnergy.Hilbert (ProductFreeGroup K n) tests := by406  classical407  exact regularTestPolynomial (fun j : tests => observableMatrix j.val)408409/-- Negation symmetry of the net gives an actual permutation of its test indices. -/410def netNegationEquiv (tests : Finset (ObservableSpace (Branch K n)))411    (hsymm : ∀ x ∈ tests, -x ∈ tests) : tests ≃ tests where412  toFun x := ⟨-x.val, hsymm x.val x.property⟩413  invFun x := ⟨-x.val, hsymm x.val x.property⟩414  left_inv x := by ext; simp415  right_inv x := by ext; simp416417theorem netRegularPolynomial_norm_le (hK : 2 ≤ K) (hn : 1 ≤ n)418    (tests : Finset (ObservableSpace (Branch K n)))419    (hnorm : ∀ x ∈ tests, ‖x‖ = 1) : ‖netRegularPolynomial tests‖ ≤ c K n := by420  classical421  apply regularTestPolynomial_norm_le hK hn422  · intro j423    exact observableMatrix_trace_zero j.val424  · intro j425    rw [← observable_norm_eq_hsLength]426    exact hnorm j.val j.property427428theorem netRegularPolynomial_test_le (tests : Finset (ObservableSpace (Branch K n)))429    (x : ObservableSpace (Branch K n)) (hx : x ∈ tests) :430    freeNorm (observableMatrix x) ≤ ‖netRegularPolynomial tests‖ := by431  classical432  exact test_norm_le (fun j : tests => observableMatrix j.val) ⟨x,hx⟩433434theorem netRegularPolynomial_selfAdjoint (tests : Finset (ObservableSpace (Branch K n))) :435    IsSelfAdjoint (netRegularPolynomial tests) := by436  classical437  exact regularTestPolynomial_selfAdjoint _ (fun j => observableMatrix_isHermitian j.val)438439theorem netRegularPolynomial_spectrum_neg (tests : Finset (ObservableSpace (Branch K n)))440    (hsymm : ∀ x ∈ tests, -x ∈ tests) :441    spectrum ℝ (-netRegularPolynomial tests) = spectrum ℝ (netRegularPolynomial tests) := by442  classical443  apply regularTestPolynomial_spectrum_neg _ (netNegationEquiv tests hsymm)444  intro j445  rfl446447/-- The symmetric test net has its positive norm endpoint in its real spectrum. -/448theorem netRegularPolynomial_norm_mem_spectrum (tests : Finset (ObservableSpace (Branch K n)))449    (hne : tests.Nonempty) (hsymm : ∀ x ∈ tests, -x ∈ tests) :450    ‖netRegularPolynomial tests‖ ∈ spectrum ℝ (netRegularPolynomial tests) := by451  classical452  letI : Nonempty tests := hne.to_subtype453  rcases CStarAlgebra.norm_or_neg_norm_mem_spectrum454    (netRegularPolynomial_selfAdjoint tests) with h | h455  · exact h456  · have hneg : ‖netRegularPolynomial tests‖ ∈ spectrum ℝ (-netRegularPolynomial tests) := by457      rw [← spectrum.neg_eq]458      exact h459    rwa [netRegularPolynomial_spectrum_neg tests hsymm] at hneg460461/-- A real positive spectral endpoint gives the exact positive shift norm. -/462theorem shifted_norm_of_norm_mem_spectrum {H : Type*} [NormedAddCommGroup H]463    [InnerProductSpace ℂ H] [CompleteSpace H] [Nontrivial H]464    (T : H →L[ℂ] H) (hT : ‖T‖ ∈ spectrum ℝ T) (θ : ℝ) (hθ : 0 ≤ θ) :465    ‖T + algebraMap ℝ (H →L[ℂ] H) θ‖ = ‖T‖ + θ := by466  apply le_antisymm467  · calc468      _ ≤ ‖T‖ + ‖algebraMap ℝ (H →L[ℂ] H) θ‖ := norm_add_le _ _469      _ = ‖T‖ + θ := by rw [norm_algebraMap', Real.norm_eq_abs, abs_of_nonneg hθ]470  · have hm : ‖T‖ + θ ∈ spectrum ℝ (T + algebraMap ℝ (H →L[ℂ] H) θ) := by471      rw [← spectrum.add_singleton_eq]472      exact Set.add_mem_add hT (Set.mem_singleton θ)473    have h := spectrum.norm_le_norm_of_mem hm474    simpa only [Real.norm_eq_abs, abs_of_nonneg (add_nonneg (norm_nonneg T) hθ)] using h475476/-- Exact shift identity for Step 3's first, undoubled shortening. -/477theorem netRegularPolynomial_shifted_norm (tests : Finset (ObservableSpace (Branch K n)))478    (hne : tests.Nonempty) (hsymm : ∀ x ∈ tests, -x ∈ tests) (θ : ℝ) (hθ : 0 ≤ θ) :479    ‖netRegularPolynomial tests + algebraMap ℝ480      (RegularCoefficientEnergy.Hilbert (ProductFreeGroup K n) tests →L[ℂ]481        RegularCoefficientEnergy.Hilbert (ProductFreeGroup K n) tests) θ‖ =482      ‖netRegularPolynomial tests‖ + θ := by483  classical484  letI : Nonempty tests := hne.to_subtype485  exact shifted_norm_of_norm_mem_spectrum (netRegularPolynomial tests)486    (netRegularPolynomial_norm_mem_spectrum tests hne hsymm) θ hθ487488/-- Step 1 assembled on actual matrices and actual regular operators: a sharp,489negation-symmetric net, prescribed positive lower bound, Collins--Youn upper490bound, with no analytic inputs. Self-adjointness and spectral symmetry are491provided by `netRegularPolynomial_selfAdjoint` and `netRegularPolynomial_spectrum_neg`. -/492theorem exists_net_polynomial (hK : 2 ≤ K) (hn : 1 ≤ n) :493    ∃ tests : Finset (ObservableSpace (Branch K n)), tests.Nonempty ∧494      (∀ x ∈ tests, ‖x‖ = 1) ∧ (∀ x ∈ tests, -x ∈ tests) ∧495      UnitSphereNet tests (1 / (n : ℝ)) ∧496      (tests.card : ℝ) ≤ (1 + 2 * (n : ℝ)) ^ (K ^ (2*n) - 1) ∧497      Real.sqrt 2 * (K : ℝ)^(-((n : ℝ)+1)/2) ≤ ‖netRegularPolynomial tests‖ ∧498      ‖netRegularPolynomial tests‖ ≤ c K n := by499  classical500  letI : NeZero K := ⟨by omega⟩501  obtain ⟨A, hA, ht, hh, hfree⟩ := PrescribedTest.exists_prescribed_test (K := K) (n := n) hK hn502  obtain ⟨tests, ha, _, hnorm, hsymm, _, hnet, hcard⟩ :=503    ObservableDimension.exists_symmetric_observable_net_for_matrix A hA ht hh n hn504  refine ⟨tests, ⟨_,ha⟩, hnorm, hsymm, hnet, ?_, ?_,505    netRegularPolynomial_norm_le hK hn tests hnorm⟩506  · simpa only [Branch, Fintype.card_fun, Fintype.card_fin, ← pow_mul, Nat.mul_comm n 2]507      using hcard508  · rw [← hfree]509    exact netRegularPolynomial_test_le tests (matrixObservable A hA ht) ha510end ObservableNets511512end Nonadditivity.NetPolynomial