Exact Lean source
Nonadditivity.PrescribedTest
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.ShiftNormNonadditivity.FreeBridgeMathlib.LinearAlgebra.Matrix.Kroneckerdependency
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
48 project constants, including generated, internal and private declarations.
48 declarations
Nonadditivity.PrescribedTest.branchEquivNonadditivity.PrescribedTest.branchEquiv.eq_1internal/detail/privateNonadditivity.PrescribedTest.branch_difference_same_tailNonadditivity.PrescribedTest.coreNonadditivity.PrescribedTest.core.eq_1internal/detail/privateNonadditivity.PrescribedTest.core_isHermitianNonadditivity.PrescribedTest.core_square_traceNonadditivity.PrescribedTest.core_traceNonadditivity.PrescribedTest.exists_prescribed_testNonadditivity.PrescribedTest.exists_prescribed_test._proof_1_1internal/detail/privateNonadditivity.PrescribedTest.exists_prescribed_test._proof_1_2internal/detail/privateNonadditivity.PrescribedTest.exists_prescribed_test._proof_1_3internal/detail/privateNonadditivity.PrescribedTest.freeNorm_testNonadditivity.PrescribedTest.freeNorm_test._proof_1_1internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test._simp_1_3internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test._simp_1_4internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test._simp_1_5internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test._simp_1_6internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test._simp_1_7internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test._simp_1_8internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test._simp_1_9internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test_eq_rpowNonadditivity.PrescribedTest.freeNorm_test_eq_rpow._proof_1_1internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test_eq_sqrtNonadditivity.PrescribedTest.freeNorm_test_eq_sqrt._proof_1_1internal/detail/privateNonadditivity.PrescribedTest.freeNorm_test_posNonadditivity.PrescribedTest.freeNorm_test_pos._proof_1_1internal/detail/privateNonadditivity.PrescribedTest.gamma_testNonadditivity.PrescribedTest.gamma_test._simp_1_3internal/detail/privateNonadditivity.PrescribedTest.shiftWordNonadditivity.PrescribedTest.shiftWord.eq_1internal/detail/privateNonadditivity.PrescribedTest.shiftWord_inverseNonadditivity.PrescribedTest.shiftWord_powers_injectiveNonadditivity.PrescribedTest.sum_core_smulNonadditivity.PrescribedTest.testNonadditivity.PrescribedTest.test.eq_1internal/detail/privateNonadditivity.PrescribedTest.testScaleNonadditivity.PrescribedTest.testScale._proof_1internal/detail/privateNonadditivity.PrescribedTest.testScale.eq_1internal/detail/privateNonadditivity.PrescribedTest.test_hsLengthNonadditivity.PrescribedTest.test_isHermitianNonadditivity.PrescribedTest.test_traceNonadditivity.PrescribedTest.unnormalizedNonadditivity.PrescribedTest.unnormalized.eq_1internal/detail/privateNonadditivity.PrescribedTest.unnormalized_isHermitianNonadditivity.PrescribedTest.unnormalized_polynomialNonadditivity.PrescribedTest.unnormalized_square_traceNonadditivity.PrescribedTest.unnormalized_trace
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.ShiftNorm7import Nonadditivity.FreeBridge8import Mathlib.LinearAlgebra.Matrix.Kronecker910/-! # The prescribed observable and its exact free norm1112The first tensor factor exchanges two distinct basis vectors, and all remaining13factors are scalar identities. Its free polynomial is an actual bilateral shift14plus its inverse. No spectral or norm hypothesis is assumed.15-/1617noncomputable section1819namespace Nonadditivity.PrescribedTest2021open FreeModel22open scoped BigOperators Matrix Kronecker2324variable {K : ℕ}2526def core (i j : Fin K) : Matrix (Fin K) (Fin K) ℂ :=27Matrix.single i j 1 + Matrix.single j i 12829theorem core_isHermitian (i j : Fin K) : (core i j).IsHermitian := by30change (core i j).conjTranspose = core i j31simp [core, Matrix.conjTranspose_add, Matrix.conjTranspose_single, add_comm]3233theorem core_trace (i j : Fin K) (hij : i ≠ j) : (core i j).trace = 0 := by34simp [core, Matrix.trace_add, hij, hij.symm]3536theorem core_square_trace (i j : Fin K) (hij : i ≠ j) :37(core i j * core i j).trace = 2 := by38norm_num [core, add_mul, mul_add, Matrix.single_mul_single_of_ne, hij, hij.symm,39Matrix.trace_add]4041def branchEquiv (K m : ℕ) : Fin K × Branch K m ≃ Branch K (m + 1) :=42Fin.consEquiv (fun _ => Fin K)4344def unnormalized (i j : Fin K) (m : ℕ) :45Matrix (Branch K (m + 1)) (Branch K (m + 1)) ℂ :=46((core i j) ⊗ₖ (1 : Matrix (Branch K m) (Branch K m) ℂ)).submatrix47(branchEquiv K m).symm (branchEquiv K m).symm4849theorem unnormalized_isHermitian (i j : Fin K) (m : ℕ) :50(unnormalized i j m).IsHermitian := by51apply Matrix.IsHermitian.submatrix52change ((core i j) ⊗ₖ (1 : Matrix (Branch K m) (Branch K m) ℂ)).conjTranspose = _53rw [Matrix.conjTranspose_kronecker, (core_isHermitian i j).eq,54Matrix.conjTranspose_one]5556theorem unnormalized_trace (i j : Fin K) (hij : i ≠ j) (m : ℕ) :57(unnormalized i j m).trace = 0 := by58rw [unnormalized, FreeBridge.trace_submatrix_equiv, Matrix.trace_kronecker,59core_trace i j hij, zero_mul]6061theorem unnormalized_square_trace (i j : Fin K) (hij : i ≠ j) (m : ℕ) :62(unnormalized i j m * unnormalized i j m).trace = 2 * (K : ℂ)^m := by63rw [unnormalized, Matrix.submatrix_mul_equiv, FreeBridge.trace_submatrix_equiv,64← Matrix.mul_kronecker_mul, one_mul, Matrix.trace_kronecker,65core_square_trace i j hij]66simp6768def testScale (K m : ℕ) : ℝ := (Real.sqrt (2 * (K : ℝ)^m))⁻¹6970def test (i j : Fin K) (m : ℕ) :71Matrix (Branch K (m + 1)) (Branch K (m + 1)) ℂ :=72(testScale K m : ℂ) • unnormalized i j m7374theorem test_isHermitian (i j : Fin K) (m : ℕ) :75(test i j m).IsHermitian := by76change ((testScale K m : ℂ) • unnormalized i j m).conjTranspose = _77rw [Matrix.conjTranspose_smul, (unnormalized_isHermitian i j m).eq]78simp [test]7980theorem test_trace (i j : Fin K) (hij : i ≠ j) (m : ℕ) : (test i j m).trace = 0 := by81simp [test, Matrix.trace_smul, unnormalized_trace i j hij]8283theorem test_hsLength (i j : Fin K) (hij : i ≠ j) (m : ℕ) :84AdjointPurity.hsLength (test i j m) = 1 := by85have hk : 0 < K := i.isLt.trans_le (Nat.le_refl K) |> Nat.zero_lt_of_lt86have hkr : (0 : ℝ) < K := by exact_mod_cast hk87have hs : 0 < Real.sqrt (2 * (K : ℝ)^m) := Real.sqrt_pos.mpr (by positivity)88have hsq := AdjointPurity.hsLength_sq_of_isHermitian (test i j m) (test_isHermitian i j m)89simp only [test, Matrix.smul_mul, Matrix.mul_smul, Matrix.trace_smul,90unnormalized_square_trace i j hij m] at hsq91have hreal : ((testScale K m : ℂ) • ((testScale K m : ℂ) • (2 * (K : ℂ)^m))).re =92testScale K m ^ 2 * (2 * (K : ℝ)^m) := by93simp only [smul_eq_mul]94have hc : (2 * (K : ℂ)^m) = ((2 * (K : ℝ)^m : ℝ) : ℂ) := by push_cast; rfl95rw [hc, ← Complex.ofReal_mul, ← Complex.ofReal_mul, Complex.ofReal_re]96ring97rw [hreal] at hsq98have hv : testScale K m ^ 2 * (2 * (K : ℝ)^m) = 1 := by99dsimp [testScale]100rw [inv_pow, Real.sq_sqrt (by positivity)]101exact inv_mul_cancel₀ (by positivity)102have hsq' : AdjointPurity.hsLength (test i j m) ^ 2 = 1 := by103exact hsq.trans hv104nlinarith [AdjointPurity.hsLength_nonneg (test i j m)]105106def shiftWord (i j : Fin K) (m : ℕ) : ProductFreeGroup K (m + 1) :=107Fin.cons ((FreeGroup.of i)⁻¹ * FreeGroup.of j) 1108109theorem shiftWord_inverse (i j : Fin K) (m : ℕ) :110shiftWord j i m = (shiftWord i j m)⁻¹ := by111funext k112cases k using Fin.cases <;> simp [shiftWord]113114theorem shiftWord_powers_injective (i j : Fin K) (hij : i ≠ j) (m : ℕ) :115Function.Injective (fun k : ℕ => shiftWord i j m ^ k) := by116let φ := FreeGroup.lift (fun k : Fin K =>117Multiplicative.ofAdd (if k = j then (1 : ℤ) else 0))118intro a b hab119have h := congrArg (fun w : ProductFreeGroup K (m + 1) =>120Multiplicative.toAdd (φ (w 0))) hab121simpa [φ, shiftWord, hij] using h122123theorem branch_difference_same_tail (i j : Fin K) (m : ℕ) (a : Branch K m) :124(branchWord (branchEquiv K m (i, a)))⁻¹ * branchWord (branchEquiv K m (j, a)) =125shiftWord i j m := by126funext k127cases k using Fin.cases <;> simp [branchWord, branchEquiv, shiftWord]128129theorem sum_core_smul {E : Type*} [AddCommGroup E] [Module ℂ E]130(i j : Fin K) (f : Fin K → Fin K → E) :131(∑ a, ∑ b, core i j a b • f a b) = f i j + f j i := by132classical133simp [core, Matrix.single_apply, add_smul, Finset.sum_add_distrib,134ite_smul, ite_and]135136theorem unnormalized_polynomial (i j : Fin K) (m : ℕ) :137(∑ a : Branch K (m + 1), ∑ b : Branch K (m + 1),138unnormalized i j m a b • leftRegular ((branchWord a)⁻¹ * branchWord b)) =139(K ^ m : ℂ) • (leftRegular (shiftWord i j m) + leftRegular (shiftWord i j m)⁻¹) := by140classical141rw [← (branchEquiv K m).sum_comp]142simp only [Fintype.sum_prod_type]143have hinner (a : Fin K) (t : Branch K m) :144(∑ b : Branch K (m + 1), unnormalized i j m (branchEquiv K m (a, t)) b •145leftRegular ((branchWord (branchEquiv K m (a, t)))⁻¹ * branchWord b)) =146∑ b : Fin K, core i j a b • leftRegular (shiftWord a b m) := by147rw [← (branchEquiv K m).sum_comp]148simp only [Fintype.sum_prod_type, unnormalized, Matrix.submatrix_apply,149Equiv.symm_apply_apply, Matrix.kronecker_apply, Matrix.one_apply]150simp only [mul_ite, mul_one, mul_zero, ite_smul, zero_smul]151simp [branch_difference_same_tail]152simp only [hinner]153rw [Finset.sum_comm]154simp only [sum_core_smul, Finset.sum_const, Finset.card_univ, Fintype.card_fun, Fintype.card_fin]155rw [shiftWord_inverse i j m]156rw [← Nat.cast_pow, Nat.cast_smul_eq_nsmul]157158theorem gamma_test (i j : Fin K) (m : ℕ) :159gamma (test i j m) =160((1 / (K : ℂ) ^ (m + 1)) * (testScale K m : ℂ) * (K : ℂ)^m) •161(leftRegular (shiftWord i j m) + leftRegular (shiftWord i j m)⁻¹) := by162simp only [gamma, test, Matrix.smul_apply, smul_eq_mul, mul_smul,163← Finset.smul_sum]164rw [unnormalized_polynomial, smul_smul, smul_smul]165166/-- The prescribed unit-HS observable has an exact strictly positive free norm. -/167theorem freeNorm_test (i j : Fin K) (hij : i ≠ j) (m : ℕ) :168freeNorm (test i j m) = 2 * testScale K m / K := by169classical170have hk : K ≠ 0 := by omega171have hkr : (K : ℝ) ≠ 0 := by exact_mod_cast hk172have hs : 0 ≤ testScale K m := by unfold testScale; positivity173simp only [freeNorm, gamma_test, norm_smul, norm_mul, norm_div, norm_one,174norm_pow, Complex.norm_natCast, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hs,175ShiftNorm.norm_shift_add_inverse _ (shiftWord_powers_injective i j hij m)]176rw [pow_succ]177field_simp178179theorem freeNorm_test_pos (i j : Fin K) (hij : i ≠ j) (m : ℕ) :1800 < freeNorm (test i j m) := by181have hk : 0 < K := by omega182rw [freeNorm_test i j hij m]183unfold testScale184positivity185186/-- An equivalent square-root form of the manuscript's exact lower bound. -/187theorem freeNorm_test_eq_sqrt (i j : Fin K) (hij : i ≠ j) (m : ℕ) :188freeNorm (test i j m) = Real.sqrt 2 / ((K : ℝ) * Real.sqrt ((K : ℝ)^m)) := by189have hk : 0 < K := by omega190have hkr : (0 : ℝ) < K := by exact_mod_cast hk191have htwo : Real.sqrt 2 ^ 2 = 2 := Real.sq_sqrt (by norm_num)192have hs : 0 < Real.sqrt ((K : ℝ)^m) := Real.sqrt_pos.mpr (by positivity)193rw [freeNorm_test i j hij m, testScale, Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 2)]194field_simp195nlinarith196197/-- The exact exponent and constant displayed in the manuscript. -/198theorem freeNorm_test_eq_rpow (i j : Fin K) (hij : i ≠ j) (m : ℕ) :199freeNorm (test i j m) = Real.sqrt 2 * (K : ℝ) ^ (-((m : ℝ) + 2) / 2) := by200have hk : (0 : ℝ) < K := by exact_mod_cast (show 0 < K by omega)201rw [freeNorm_test_eq_sqrt i j hij m]202have hs : Real.sqrt ((K : ℝ)^m) = (K : ℝ)^((m : ℝ) / 2) := by203rw [Real.sqrt_eq_rpow, ← Real.rpow_natCast, ← Real.rpow_mul hk.le]204congr 1205ring206rw [hs]207have he : -((m : ℝ) + 2) / 2 = -(1 + (m : ℝ) / 2) := by ring208rw [he, Real.rpow_neg hk.le, Real.rpow_add hk, Real.rpow_one, div_eq_mul_inv]209210/-- Every block length admits the specific traceless Hermitian unit test211whose free norm supplies the first quantitative error-factor lower bound. -/212theorem exists_prescribed_test {n : ℕ} (hK : 2 ≤ K) (hn : 1 ≤ n) :213∃ A : Matrix (Branch K n) (Branch K n) ℂ,214A.IsHermitian ∧ A.trace = 0 ∧ AdjointPurity.hsLength A = 1 ∧215freeNorm A = Real.sqrt 2 * (K : ℝ)^(-((n : ℝ) + 1) / 2) := by216cases n with217| zero => omega218| succ m =>219let i : Fin K := ⟨0, by omega⟩220let j : Fin K := ⟨1, by omega⟩221have hij : i ≠ j := by intro h; have := congrArg Fin.val h; simp [i, j] at this222refine ⟨test i j m, test_isHermitian i j m, test_trace i j hij m,223test_hsLength i j hij m, ?_⟩224simpa only [Nat.cast_add, Nat.cast_one, add_assoc, one_add_one_eq_two] using225freeNorm_test_eq_rpow i j hij m226227end Nonadditivity.PrescribedTest