Offline · exact source
Exact Lean source

PhysicalFlatRateBounded

formalization/Cloning/PhysicalFlatRateBounded.lean

Source hash: a4cf9a4f8d5ddda935844e039ba9d49db46a10ebb650d1a8029b2eb54bb1ebe2

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

In the dependency map: Projector optimum

Declarations in this module
1import Cloning.PhysicalFlatRateRounded
2 
3/-! The all-channel upper rate for every bounded rounding of γn. -/
4noncomputable section
5open scoped Topology
6open Filter Asymptotics
7namespace Cloning.PhysicalFlatConverse
8set_option maxHeartbeats 1200000
9 
10theorem ratio_error_of_sample_error (m n : ℕ) (γ B : ℝ) (hn : 1≤n)
11    (h : |(m:ℝ)-γ*n|≤B) : |(m:ℝ)/(n:ℝ)-γ|≤B/(n:ℝ) := by
12  have hn0 : (0:ℝ)<n := by exact_mod_cast (show 0<n by omega)
13  have he : (m:ℝ)/(n:ℝ)-γ=((m:ℝ)-γ*n)/(n:ℝ) := by field_simp <;> ring
14  rw [he,abs_div,abs_of_pos hn0]
15  exact div_le_div_of_nonneg_right h hn0.le
16 
17theorem ratio_tendsto_of_bounded_rounding (m : ℕ→ℕ) (γ : ℝ)
18    (hround : ∃B : ℝ,∀ᶠ (n : ℕ) in atTop,|(m n:ℝ)-γ*n|≤B) :
19    Tendsto (fun n : ℕ=>(m n:ℝ)/(n:ℝ)) atTop (𝓝 γ) := by
20  obtain ⟨B,hB⟩ := hround
21  have hi : Tendsto (fun n : ℕ=>B/(n:ℝ)) atTop (𝓝 0) := by
22    have h := (tendsto_inv_atTop_zero.comp tendsto_natCast_atTop_atTop).const_mul B
23    simpa only [mul_zero,← div_eq_mul_inv] using h
24  have hz : Tendsto (fun n : ℕ=>|(m n:ℝ)/(n:ℝ)-γ|) atTop (𝓝 0) :=
25    squeeze_zero' (Eventually.of_forall (fun _=>abs_nonneg _))
26      (by filter_upwards [hB,eventually_ge_atTop 1] with n hb hn
27          exact ratio_error_of_sample_error (m n) n γ B hn hb) hi
28  exact tendsto_iff_norm_sub_tendsto_zero.mpr (by simpa only [Real.norm_eq_abs] using hz)
29 
30/-- Arbitrary bounded rounding, with no convergence or rate assumption on
31any quantum output or moment. -/
32theorem eventually_minimaxValue_bounded_rounding_rate (r k : ℕ) (hr : 0<r)
33    (m : ℕ→ℕ) (γ : ℝ) (hγ : 1<γ)
34    (hround : ∃B : ℝ,∀ᶠ (n : ℕ) in atTop,|(m n:ℝ)-γ*n|≤B) :
35    ∃C : ℝ,0≤C ∧ ∀ᶠ (n : ℕ) in atTop,
36      minimaxValue r k hr n (m n)≤γ^(-(((r*k:ℕ):ℝ)/2))+C/(n:ℝ) := by
37  obtain ⟨B0,hB0⟩ := hround
38  let B := max B0 0
39  have hB : 0≤B := le_max_right _ _
40  have hb : ∀ᶠ (n : ℕ) in atTop,|(m n:ℝ)-γ*n|≤B :=
41    hB0.mono (fun _ h=>h.trans (le_max_left _ _))
42  let p : ℝ := -(((r*k:ℕ):ℝ)/2)
43  let x : ℕ→ℝ := fun n=>(m n:ℝ)/(n:ℝ)
44  let D := flatConverseRateConstant r k
45  have hD : 0≤D := flatConverseRateConstant_nonneg r k
46  have hg : 0<γ := zero_lt_one.trans hγ
47  have hx : Tendsto x atTop (𝓝 γ) := ratio_tendsto_of_bounded_rounding m γ ⟨B,hb⟩
48  have hd := Real.hasDerivAt_rpow_const (p := p) (Or.inl hg.ne')
49  obtain ⟨L,hL,hLbound⟩ := (hd.isBigO_sub.comp_tendsto hx).exists_pos
50  have he : ∀ᶠ (n : ℕ) in atTop,|x n^p-γ^p|≤(L*B)/(n:ℝ) := by
51    filter_upwards [hLbound.bound,hb,eventually_ge_atTop 1] with n hbound hb hn
52    have hh : |x n^p-γ^p|≤L*|x n-γ| := by
53      simpa only [Function.comp_apply,Real.norm_eq_abs] using hbound
54    exact hh.trans (by
55      simpa only [mul_div_assoc] using mul_le_mul_of_nonneg_left
56        (ratio_error_of_sample_error (m n) n γ B hn hb) hL.le)
57  have hpow := hd.continuousAt.tendsto.comp hx
58  have hub : ∀ᶠ (n : ℕ) in atTop,x n^p≤γ^p+1 :=
59    hpow.eventually (eventually_le_nhds (by linarith))
60  have hmn : ∀ᶠ (n : ℕ) in atTop,n≤m n := by
61    filter_upwards [hx.eventually (eventually_ge_nhds hγ),eventually_ge_atTop 1] with n hn hn1
62    have hnR : (0:ℝ)<n := by exact_mod_cast (show 0<n by omega)
63    have h := (le_div_iff₀ hnR).mp hn
64    have hR : (n:ℝ)≤m n := by simpa only [one_mul] using h
65    exact_mod_cast hR
66  refine ⟨L*B+(γ^p+1)*D,by positivity,?_⟩
67  filter_upwards [he,hub,hmn,eventually_minimaxValue_rate r k hr,eventually_ge_atTop 1]
68    with n he hub hmn hbound hn
69  have hnR : (0:ℝ)<n := by exact_mod_cast (show 0<n by omega)
70  have hf : x n^p≤γ^p+(L*B)/(n:ℝ) := by
71    have hh := le_abs_self (x n^p-γ^p)
72    linarith
73  have hm := hbound (m n) hmn
74  change minimaxValue r k hr n (m n)≤x n^p*(1+D/(n:ℝ)) at hm
75  apply hm.trans
76  have hm2 := mul_le_mul_of_nonneg_right hub (div_nonneg hD hnR.le)
77  change x n^p*(1+D/(n:ℝ))≤γ^p+(L*B+(γ^p+1)*D)/(n:ℝ)
78  calc
79    _ = x n^p+x n^p*(D/(n:ℝ)) := by ring
80    _ ≤ (γ^p+(L*B)/(n:ℝ))+(γ^p+1)*(D/(n:ℝ)) := add_le_add hf hm2
81    _ = _ := by ring
82 
83/-- The manuscript convention m_n=γn+O(1) suffices. -/
84theorem eventually_minimaxValue_of_sample_remainder_isBigO (r k : ℕ) (hr : 0<r)
85    (m : ℕ→ℕ) (γ : ℝ) (hγ : 1<γ)
86    (hround : (fun n : ℕ=>(m n:ℝ)-γ*n)=O[atTop] (fun _ : ℕ=>(1:ℝ))) :
87    ∃C : ℝ,0≤C ∧ ∀ᶠ (n : ℕ) in atTop,
88      minimaxValue r k hr n (m n)≤γ^(-(((r*k:ℕ):ℝ)/2))+C/(n:ℝ) := by
89  obtain ⟨B,hB,hbound⟩ := hround.exists_pos
90  apply eventually_minimaxValue_bounded_rounding_rate r k hr m γ hγ
91  exact ⟨B,by simpa only [Real.norm_eq_abs,abs_one,mul_one] using hbound.bound⟩
92 
93/-- Only the upper excess is asserted here; a matching lower rate is a
94separate quantitative achievability question. -/
95theorem minimaxValue_upper_excess_isBigO (r k : ℕ) (hr : 0<r)
96    (m : ℕ→ℕ) (γ : ℝ) (hγ : 1<γ)
97    (hround : (fun n : ℕ=>(m n:ℝ)-γ*n)=O[atTop] (fun _ : ℕ=>(1:ℝ))) :
98    (fun n : ℕ=>max (minimaxValue r k hr n (m n)-γ^(-(((r*k:ℕ):ℝ)/2))) 0)
99      =O[atTop] (fun n : ℕ=>1/(n:ℝ)) := by
100  obtain ⟨C,hC,hbound⟩ := eventually_minimaxValue_of_sample_remainder_isBigO r k hr m γ hγ hround
101  apply IsBigO.of_bound C
102  filter_upwards [hbound] with n hn
103  rw [Real.norm_eq_abs,abs_of_nonneg (le_max_right _ _),Real.norm_eq_abs,
104    abs_of_nonneg (by positivity : (0:ℝ)≤1/(n:ℝ)),mul_one_div]
105  exact max_le (by linarith) (div_nonneg hC (Nat.cast_nonneg n))
106 
107end Cloning.PhysicalFlatConverse