Exact Lean source
Nonadditivity.QuantitativeNet
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.NetMathlib.MeasureTheory.Measure.Lebesgue.EqHaardependencyMathlib.Data.Set.Finite.LemmasdependencyMathlib.Order.Interval.Finset.Natdependency
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
8 project constants, including generated, internal and private declarations.
8 declarations
Nonadditivity.QuantitativeNet.card_le_of_separatedNonadditivity.QuantitativeNet.exists_symmetric_inverse_nat_netNonadditivity.QuantitativeNet.exists_symmetric_unitSphereNet_containingNonadditivity.QuantitativeNet.exists_symmetric_unitSphereNet_containing._proof_1_1internal/detail/privateNonadditivity.QuantitativeNet.exists_symmetric_unitSphereNet_with_testNonadditivity.QuantitativeNet.exists_symmetric_unitSphereNet_with_test._simp_1_1internal/detail/privateNonadditivity.QuantitativeNet.exists_symmetric_unitSphereNet_with_test._simp_1_2internal/detail/private_private.Nonadditivity.QuantitativeNet.0.Nonadditivity.QuantitativeNet.separated_insertinternal/detail/private
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.Net7import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar8import Mathlib.Data.Set.Finite.Lemmas9import Mathlib.Order.Interval.Finset.Nat1011/-! # Sharp finite-dimensional nets1213The cardinality estimate is proved by comparing disjoint Haar-measurable14balls. Maximality is taken among symmetric separated sets, so imposing15negation symmetry does not double the volume bound.16-/1718noncomputable section1920namespace Nonadditivity.QuantitativeNet2122open Metric MeasureTheory Module23open scoped ENNReal2425variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]26[FiniteDimensional ℝ E]2728/-- The usual packing bound, with its exact radius and dimension. -/29theorem card_le_of_separated (s : Finset E) {δ R : ℝ} (hδ : 0 < δ) (hR : 0 ≤ R)30(hs : ∀ x ∈ s, ‖x‖ ≤ R)31(hsep : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → δ ≤ dist x y) :32(s.card : ℝ) ≤ (1 + 2 * R / δ) ^ finrank ℝ E := by33classical34borelize E35let μ : Measure E := Measure.addHaar36let r : ℝ := δ / 237let ρ : ℝ := R + δ / 238have hr : 0 < r := by dsimp [r]; positivity39have hρ : 0 < ρ := by dsimp [ρ]; linarith40let A : Set E := ⋃ x ∈ s, ball x r41have hdisj : Set.Pairwise (s : Set E) (fun x y => Disjoint (ball x r) (ball y r)) := by42intro x hx y hy hxy43apply ball_disjoint_ball44calc45r + r = δ := by dsimp [r]; ring46_ ≤ dist x y := hsep x hx y hy hxy47have hsub : A ⊆ ball (0 : E) ρ := by48refine Set.iUnion₂_subset fun x hx => ball_subset_ball' ?_49change r + dist x 0 ≤ ρ50rw [dist_zero_right]51dsimp [r, ρ]52linarith [hs x hx]53have hvol : (s.card : ℝ≥0∞) * ENNReal.ofReal (r ^ finrank ℝ E) * μ (ball 0 1) ≤54ENNReal.ofReal (ρ ^ finrank ℝ E) * μ (ball 0 1) := by55calc56(s.card : ℝ≥0∞) * ENNReal.ofReal (r ^ finrank ℝ E) * μ (ball 0 1) = μ A := by57rw [show A = ⋃ x ∈ s, ball x r from rfl,58measure_biUnion_finset hdisj (fun x _ => measurableSet_ball)]59simp only [μ.addHaar_ball_of_pos _ hr, Finset.sum_const, nsmul_eq_mul, mul_assoc]60_ ≤ μ (ball (0 : E) ρ) := measure_mono hsub61_ = _ := μ.addHaar_ball_of_pos _ hρ62have hcancel : (s.card : ℝ≥0∞) * ENNReal.ofReal (r ^ finrank ℝ E) ≤63ENNReal.ofReal (ρ ^ finrank ℝ E) :=64(ENNReal.mul_le_mul_iff_left (measure_ball_pos μ (0 : E) zero_lt_one).ne'65measure_ball_lt_top.ne).1 hvol66have hreal : (s.card : ℝ) * r ^ finrank ℝ E ≤ ρ ^ finrank ℝ E := by67simpa only [ENNReal.toReal_mul, ENNReal.toReal_natCast,68ENNReal.toReal_ofReal (pow_nonneg hr.le _)] using69ENNReal.toReal_le_of_le_ofReal (pow_nonneg hρ.le _) hcancel70have hratio : ρ / r = 1 + 2 * R / δ := by71dsimp [ρ, r]72field_simp73ring74calc75(s.card : ℝ) ≤ ρ ^ finrank ℝ E / r ^ finrank ℝ E :=76(le_div_iff₀ (pow_pos hr _)).mpr hreal77_ = (1 + 2 * R / δ) ^ finrank ℝ E := by rw [← div_pow, hratio]7879omit [NormedSpace ℝ E] [FiniteDimensional ℝ E] in80/-- Strict separation permits adding a point outside all closed net balls. -/81private theorem separated_insert [DecidableEq E] {s : Finset E} {δ : ℝ} {x : E}82(hs : ∀ y ∈ s, ∀ z ∈ s, y ≠ z → δ < dist y z)83(hx : ∀ y ∈ s, δ < dist x y) :84∀ y ∈ insert x s, ∀ z ∈ insert x s, y ≠ z → δ < dist y z := by85classical86intro y hy z hz hyz87rcases Finset.mem_insert.mp hy with rfl | hys88· rcases Finset.mem_insert.mp hz with rfl | hzs89· exact (hyz rfl).elim90· exact hx z hzs91· rcases Finset.mem_insert.mp hz with rfl | hzs92· simpa only [dist_comm] using hx y hys93· exact hs y hys z hzs hyz9495/-- A symmetric separated seed extends to a symmetric unit-sphere net,96without increasing the sharp packing bound. -/97theorem exists_symmetric_unitSphereNet_containing (seeds : Finset E) {δ : ℝ}98(hδ : 0 < δ) (hδtwo : δ < 2)99(hseed_norm : ∀ x ∈ seeds, ‖x‖ = 1)100(hseed_neg : ∀ x ∈ seeds, -x ∈ seeds)101(hseed_sep : ∀ x ∈ seeds, ∀ y ∈ seeds, x ≠ y → δ < dist x y) :102∃ tests : Finset E, seeds ⊆ tests ∧103(∀ x ∈ tests, ‖x‖ = 1) ∧ (∀ x ∈ tests, -x ∈ tests) ∧104(∀ x ∈ tests, ∀ y ∈ tests, x ≠ y → δ < dist x y) ∧105UnitSphereNet tests δ ∧106(tests.card : ℝ) ≤ (1 + 2 / δ) ^ finrank ℝ E := by107classical108let admissible : Finset E → Prop := fun s => seeds ⊆ s ∧109(∀ x ∈ s, ‖x‖ = 1) ∧ (∀ x ∈ s, -x ∈ s) ∧110(∀ x ∈ s, ∀ y ∈ s, x ≠ y → δ < dist x y)111have hcard (s : Finset E) (hs : admissible s) :112(s.card : ℝ) ≤ (1 + 2 / δ) ^ finrank ℝ E := by113simpa only [mul_one] using card_le_of_separated s hδ (by norm_num : (0 : ℝ) ≤ 1)114(fun x hx => (hs.2.1 x hx).le) (fun x hx y hy hxy => (hs.2.2.2 x hx y hy hxy).le)115let cards : Set ℕ := {m | ∃ s : Finset E, admissible s ∧ s.card = m}116obtain ⟨N, hN⟩ := exists_nat_gt ((1 + 2 / δ) ^ finrank ℝ E)117have hcards_finite : cards.Finite := by118apply (Set.finite_Iic N).subset119rintro m ⟨s, hs, rfl⟩120exact (Nat.cast_lt.mp ((hcard s hs).trans_lt hN)).le121have hcards_nonempty : cards.Nonempty :=122⟨seeds.card, seeds, ⟨Finset.Subset.refl seeds, hseed_norm, hseed_neg, hseed_sep⟩, rfl⟩123obtain ⟨m, hm, hmax⟩ := Set.exists_max_image cards id hcards_finite hcards_nonempty124obtain ⟨s, hs, hsm⟩ := hm125have hnet : UnitSphereNet s δ := by126intro x hx127by_contra hnot128have hfar : ∀ y ∈ s, δ < dist x y := by129intro y hy130exact lt_of_not_ge (fun hxy => hnot ⟨y, hy, hxy⟩)131have hxnot : x ∉ s := by132intro hxs133have := hfar x hxs134rw [dist_self] at this135exact (not_lt_of_ge hδ.le) this136have hnormneg : ‖-x‖ = 1 := by simpa only [norm_neg]137have hfarneg : ∀ y ∈ s, δ < dist (-x) y := by138intro y hy139simpa only [← dist_neg_neg (-x) y, neg_neg] using hfar (-y) (hs.2.2.1 y hy)140have hdistneg : dist x (-x) = 2 := by141rw [dist_eq_norm, sub_neg_eq_add, ← two_smul ℝ x, norm_smul, Real.norm_two, hx]142ring143let t : Finset E := insert x (insert (-x) s)144have hst : s ⊆ t := fun y hy => Finset.mem_insert_of_mem (Finset.mem_insert_of_mem hy)145have ht : admissible t := by146refine ⟨hs.1.trans hst, ?_, ?_, ?_⟩147· intro y hy148rcases Finset.mem_insert.mp hy with rfl | hy149· exact hx150rcases Finset.mem_insert.mp hy with rfl | hy151· exact hnormneg152· exact hs.2.1 y hy153· intro y hy154rcases Finset.mem_insert.mp hy with rfl | hy155· exact Finset.mem_insert_of_mem (Finset.mem_insert_self _ _)156rcases Finset.mem_insert.mp hy with rfl | hy157· simpa only [neg_neg] using Finset.mem_insert_self x (insert (-x) s)158· exact hst (hs.2.2.1 y hy)159· apply separated_insert (separated_insert hs.2.2.2 hfarneg)160intro y hy161rcases Finset.mem_insert.mp hy with rfl | hy162· simpa only [hdistneg] using hδtwo163· exact hfar y hy164have hmax' : t.card ≤ s.card := by165have := hmax t.card ⟨t, ht, rfl⟩166simpa only [id_eq, ← hsm] using this167have hstrict : s.card < t.card := by168calc169s.card < (insert x s).card := by rw [Finset.card_insert_of_notMem hxnot]; omega170_ ≤ t.card := Finset.card_le_card (by171intro y hy172rcases Finset.mem_insert.mp hy with rfl | hy173· exact Finset.mem_insert_self _ _174· exact hst hy)175exact (not_lt_of_ge hmax') hstrict176exact ⟨s, hs.1, hs.2.1, hs.2.2.1, hs.2.2.2, hnet, hcard s hs⟩177178/-- The prescribed test and its negative can be included without any179cardinality overhead. -/180theorem exists_symmetric_unitSphereNet_with_test (a : E) (ha : ‖a‖ = 1)181{δ : ℝ} (hδ : 0 < δ) (hδtwo : δ < 2) :182∃ tests : Finset E, a ∈ tests ∧ -a ∈ tests ∧183(∀ x ∈ tests, ‖x‖ = 1) ∧ (∀ x ∈ tests, -x ∈ tests) ∧184(∀ x ∈ tests, ∀ y ∈ tests, x ≠ y → δ < dist x y) ∧185UnitSphereNet tests δ ∧186(tests.card : ℝ) ≤ (1 + 2 / δ) ^ finrank ℝ E := by187classical188have hd : dist a (-a) = 2 := by189rw [dist_eq_norm, sub_neg_eq_add, ← two_smul ℝ a, norm_smul, Real.norm_two, ha]190ring191have hn : ∀ x ∈ ({a, -a} : Finset E), ‖x‖ = 1 := by192intro x hx193simp only [Finset.mem_insert, Finset.mem_singleton] at hx194rcases hx with rfl | rfl <;> simpa only [norm_neg] using ha195have hneg : ∀ x ∈ ({a, -a} : Finset E), -x ∈ ({a, -a} : Finset E) := by196intro x hx197simp only [Finset.mem_insert, Finset.mem_singleton] at hx ⊢198rcases hx with rfl | rfl199· exact Or.inr rfl200· exact Or.inl (neg_neg a)201have hsep : ∀ x ∈ ({a, -a} : Finset E), ∀ y ∈ ({a, -a} : Finset E),202x ≠ y → δ < dist x y := by203intro x hx y hy hxy204simp only [Finset.mem_insert, Finset.mem_singleton] at hx hy205rcases hx with rfl | rfl <;> rcases hy with rfl | rfl206· exact (hxy rfl).elim207· simpa only [hd] using hδtwo208· rw [dist_comm, hd]209exact hδtwo210· exact (hxy rfl).elim211obtain ⟨tests, hmem, htests⟩ :=212exists_symmetric_unitSphereNet_containing {a, -a} hδ hδtwo hn hneg hsep213exact ⟨tests, hmem (by simp), hmem (by simp), htests⟩214215/-- Exact appendix net bound at radius `1/n`. -/216theorem exists_symmetric_inverse_nat_net (a : E) (ha : ‖a‖ = 1)217(n : ℕ) (hn : 1 ≤ n) :218∃ tests : Finset E, a ∈ tests ∧ -a ∈ tests ∧219(∀ x ∈ tests, ‖x‖ = 1) ∧ (∀ x ∈ tests, -x ∈ tests) ∧220(∀ x ∈ tests, ∀ y ∈ tests, x ≠ y → 1 / (n : ℝ) < dist x y) ∧221UnitSphereNet tests (1 / (n : ℝ)) ∧222(tests.card : ℝ) ≤ (1 + 2 * (n : ℝ)) ^ finrank ℝ E := by223have hn' : (1 : ℝ) ≤ n := by exact_mod_cast hn224have hn0 : (0 : ℝ) < n := by linarith225have hδ : 0 < 1 / (n : ℝ) := by positivity226have hδtwo : 1 / (n : ℝ) < 2 := by227apply (div_lt_iff₀ hn0).mpr228linarith229obtain ⟨tests, ha, hneg, hnorm, hsymm, hsep, hnet, hcard⟩ :=230exists_symmetric_unitSphereNet_with_test a ha hδ hδtwo231refine ⟨tests, ha, hneg, hnorm, hsymm, hsep, hnet, ?_⟩232simpa only [div_eq_mul_inv, one_mul, inv_inv] using hcard233234end Nonadditivity.QuantitativeNet