Exact Lean source
Nonadditivity.GaussianCertificates
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
3 project constants, including generated, internal and private declarations.
3 declarations
Nonadditivity.GaussianCertificates.exists_isometry_and_observable_testsNonadditivity.GaussianCertificates.exists_isometry_and_observable_tests._proof_1_1internal/detail/privateNonadditivity.GaussianCertificates.net_budget_lt_one
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.GaussianQuadratic78/-! # A concrete Gaussian union budget for the one-block construction910All probability estimates are derived in `GaussianQuadratic`. This file fixes11explicit constants for combining the isometry and observable tests.12-/1314noncomputable section1516open MeasureTheory ProbabilityTheory Real17open scoped BigOperators1819namespace Nonadditivity.GaussianCertificates2021/-- The two finite nets fit inside the proved Gaussian probability budget. -/22theorem net_budget_lt_one (K N : ℕ) (hK : 4096 ≤ K) (hN : K ^ 2 ≤ N) :232 * (9 : ℝ) ^ (2 * N) * exp (-(K : ℝ) * N / 128) +242 * ((5 : ℝ) ^ (K ^ 2) * (9 : ℝ) ^ (2 * N)) *25exp (-(63 / 2 : ℝ) * N) < 1 := by26have hKr : (4096 : ℝ) ≤ K := by exact_mod_cast hK27have hNr : (K : ℝ) ^ 2 ≤ N := by exact_mod_cast hN28have hNpos : (1 : ℝ) ≤ N := by nlinarith29have h9 : (9 : ℝ) ≤ exp 8 := by linarith [add_one_le_exp (8 : ℝ)]30have h5 : (5 : ℝ) ≤ exp 4 := by linarith [add_one_le_exp (4 : ℝ)]31have hp9 : (9 : ℝ) ^ (2 * N) ≤ exp (16 * N) := by32calc33_ ≤ (exp 8) ^ (2 * N) := pow_le_pow_left₀ (by norm_num) h9 _34_ = _ := by rw [← exp_nat_mul]; congr 1; push_cast; ring35have hp5 : (5 : ℝ) ^ (K ^ 2) ≤ exp (4 * N) := by36calc37_ ≤ (exp 4) ^ (K ^ 2) := pow_le_pow_left₀ (by norm_num) h5 _38_ = exp (4 * (K : ℝ) ^ 2) := by rw [← exp_nat_mul]; congr 1; push_cast; ring39_ ≤ _ := exp_le_exp.mpr (by nlinarith)40have hfirst : 2 * (9 : ℝ) ^ (2 * N) * exp (-(K : ℝ) * N / 128) ≤412 * exp (-10 * N) := by42calc43_ ≤ 2 * exp (16 * N) * exp (-(K : ℝ) * N / 128) := by gcongr44_ = 2 * exp (16 * N - (K : ℝ) * N / 128) := by45rw [mul_assoc, ← exp_add]46congr 247ring48_ ≤ _ := by49gcongr50nlinarith [mul_nonneg (by linarith : 0 ≤ (K : ℝ) - 4096) (by positivity : 0 ≤ (N : ℝ))]51have hsecond : 2 * ((5 : ℝ) ^ (K ^ 2) * (9 : ℝ) ^ (2 * N)) *52exp (-(63 / 2 : ℝ) * N) ≤ 2 * exp (-10 * N) := by53calc54_ ≤ 2 * (exp (4 * N) * exp (16 * N)) * exp (-(63 / 2 : ℝ) * N) := by gcongr55_ = 2 * exp (-(23 / 2 : ℝ) * N) := by56rw [mul_assoc, mul_assoc, ← exp_add, ← exp_add]57congr 258ring59_ ≤ _ := by gcongr; linarith60have hlast : 4 * exp (-10 * (N : ℝ)) < 1 := by61rw [show -10 * (N : ℝ) = -(10 * N) by ring, exp_neg]62apply (mul_inv_lt_iff₀ (exp_pos _)).mpr63linarith [add_one_le_exp (10 * (N : ℝ))]64linarith65666768/-- A concrete Gaussian sample simultaneously passes the two net families.69The premises are only deterministic norm, trace, and cardinality inequalities. -/70theorem exists_isometry_and_observable_tests71{E J₀ J₁ : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]72[FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]73[Fintype J₀] [Fintype J₁]74(K N : ℕ) (hK : 4096 ≤ K) (hN : K ^ 2 ≤ N)75(T₀ : J₀ → E →L[ℝ] E) (T₁ : J₁ → E →L[ℝ] E)76(hT₀ : ∀ j, (T₀ j).toLinearMap.IsSymmetric)77(hT₁ : ∀ j, (T₁ j).toLinearMap.IsSymmetric)78(hnorm₀ : ∀ j, (2 * (K : ℝ) * N) * ‖T₀ j‖ ≤ 1)79(hnorm₁ : ∀ j, (2 * (K : ℝ) * N) * ‖T₁ j‖ ≤ 1)80(hvar₀ : ∀ j, (2 * (K : ℝ) * N) *81((T₀ j).toLinearMap * (T₀ j).toLinearMap).trace ℝ E ≤ 1)82(hvar₁ : ∀ j, (2 * (K : ℝ) ^ 2 * N) *83((T₁ j).toLinearMap * (T₁ j).toLinearMap).trace ℝ E ≤ 1)84(hcard₀ : (Fintype.card J₀ : ℝ) ≤ (9 : ℝ) ^ (2 * N))85(hcard₁ : (Fintype.card J₁ : ℝ) ≤ (5 : ℝ) ^ (K ^ 2) * (9 : ℝ) ^ (2 * N)) :86∃ z : E,87(∀ j, |inner ℝ (T₀ j z) z - (T₀ j).toLinearMap.trace ℝ E| < 1 / 4) ∧88(∀ j, |inner ℝ (T₁ j z) z - (T₁ j).toLinearMap.trace ℝ E| < 64 / K) := by89have hKpos : (0 : ℝ) < K := by exact_mod_cast (by omega : 0 < K)90have hNpos : (0 : ℝ) < N := by91have : 0 < N := lt_of_lt_of_le (pow_pos (by omega : 0 < K) _) hN92exact_mod_cast this93let T : J₀ ⊕ J₁ → E →L[ℝ] E := Sum.elim T₀ T₁94let s : J₀ ⊕ J₁ → ℝ := Sum.elim (fun _ => (K : ℝ) * N / 16) (fun _ => (K : ℝ) * N / 2)95let t : J₀ ⊕ J₁ → ℝ := Sum.elim (fun _ => 1 / 4) (fun _ => 64 / (K : ℝ))96have hsym (j) : (T j).toLinearMap.IsSymmetric := by97cases j with98| inl j => exact hT₀ j99| inr j => exact hT₁ j100have hsmall (j) : s j * ‖T j‖ ≤ 1 / 4 := by101cases j with102| inl j => dsimp [s, T]; nlinarith [hnorm₀ j]103| inr j => dsimp [s, T]; nlinarith [hnorm₁ j]104have hb₀ (j : J₀) : -(K : ℝ) * N / 16 * (1 / 4) +1054 * ((K : ℝ) * N / 16) ^ 2 *106((T₀ j).toLinearMap * (T₀ j).toLinearMap).trace ℝ E ≤ -(K : ℝ) * N / 128 := by107have hv := mul_le_mul_of_nonneg_left (hvar₀ j)108(show 0 ≤ (K : ℝ) * N / 128 by positivity)109nlinarith110have hb₁ (j : J₁) : -((K : ℝ) * N / 2) * (64 / (K : ℝ)) +1114 * ((K : ℝ) * N / 2) ^ 2 *112((T₁ j).toLinearMap * (T₁ j).toLinearMap).trace ℝ E ≤ -(63 / 2 : ℝ) * N := by113have hv := mul_le_mul_of_nonneg_left (hvar₁ j) (show 0 ≤ (N : ℝ) / 2 by positivity)114have hcancel : -((K : ℝ) * N / 2) * (64 / (K : ℝ)) = -32 * N := by115field_simp116ring117rw [hcancel]118nlinarith119have hbudget : (∑ j, 2 * exp (-s j * t j +1204 * s j ^ 2 * ((T j).toLinearMap * (T j).toLinearMap).trace ℝ E)) < 1 := by121calc122_ ≤ (∑ _ : J₀, 2 * exp (-(K : ℝ) * N / 128)) +123∑ _ : J₁, 2 * exp (-(63 / 2 : ℝ) * N) := by124rw [Fintype.sum_sum_type]125apply add_le_add126· apply Finset.sum_le_sum127intro j _128dsimp [s, t, T]129gcongr130convert hb₀ j using 1; ring131· apply Finset.sum_le_sum132intro j _133dsimp [s, t, T]134gcongr135exact hb₁ j136_ ≤ 2 * (9 : ℝ) ^ (2 * N) * exp (-(K : ℝ) * N / 128) +1372 * ((5 : ℝ) ^ (K ^ 2) * (9 : ℝ) ^ (2 * N)) * exp (-(63 / 2 : ℝ) * N) := by138simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]139calc140_ ≤ ((9 : ℝ) ^ (2 * N)) * (2 * exp (-(K : ℝ) * N / 128)) +141((5 : ℝ) ^ (K ^ 2) * (9 : ℝ) ^ (2 * N)) * (2 * exp (-(63 / 2 : ℝ) * N)) := by142gcongr143_ = _ := by ring144_ < 1 := net_budget_lt_one K N hK hN145obtain ⟨z, hz⟩ := GaussianQuadratic.exists_simultaneous_quadratic_bounds T hsym s t146(fun j => by cases j <;> dsimp [s] <;> positivity) hsmall hbudget147exact ⟨z, fun j => hz (.inl j), fun j => hz (.inr j)⟩148149end Nonadditivity.GaussianCertificates