Exact Lean source
SampleRatioThreshold
formalization/Cloning/SampleRatioThreshold.lean
Source hash: 90a0f90e54e1948d43396028f248e194ba0c19d0c5dccaefd449f0464aa18c56
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.
Declarations in this module
1import Mathlib.Analysis.SpecialFunctions.Pow.Real
2import Mathlib.Data.Nat.Choose.Basic
3import Mathlib.Tactic
4
5/-! Exact inversion of the power-fidelity sample threshold and its finite
6binomial sufficient bound. The quantity here is the input/additional-copy ratio. -/
7noncomputable section
8open scoped BigOperators
9namespace Cloning.SampleRatio
10
11def threshold (a ε : ℝ) : ℝ := 1 / ((1-ε)^(-1/a)-1)
12
13theorem threshold_denominator_pos {a ε : ℝ} (ha : 0<a) (hε : 0<ε) (hε1 : ε<1) :
14 0 < (1-ε)^(-1/a)-1 := by
15 have he : 1 < (1-ε)^(-1/a) := by
16 have h := Real.rpow_lt_rpow_of_neg (sub_pos.mpr hε1)
17 (show 1-ε<1 by linarith)
18 (show (-1:ℝ)/a<0 from div_neg_of_neg_of_pos (by norm_num) ha)
19 simpa using h
20 linarith
21
22theorem threshold_pos {a ε : ℝ} (ha : 0<a) (hε : 0<ε) (hε1 : ε<1) :
23 0 < threshold a ε := one_div_pos.mpr (threshold_denominator_pos ha hε hε1)
24
25/-- Exact threshold, before taking any small-error limit. -/
26theorem power_fidelity_iff {a ε R : ℝ} (ha : 0<a) (hε : 0<ε) (hε1 : ε<1)
27 (hR : 0<R) :
28 1-ε ≤ (1+R⁻¹)^(-a) ↔ threshold a ε ≤ R := by
29 have hbase : 0 < 1+R⁻¹ := by positivity
30 have hpow := Real.le_rpow_inv_iff_of_neg hbase (sub_pos.mpr hε1) (neg_neg_of_pos ha)
31 have hexp : (-a)⁻¹ = -1/a := by simp [div_eq_mul_inv]
32 rw [hexp] at hpow
33 rw [← hpow]
34 unfold threshold
35 rw [div_le_iff₀ (threshold_denominator_pos ha hε hε1)]
36 constructor
37 · intro h
38 have hh := mul_le_mul_of_nonneg_left h hR.le
39 rw [mul_add, mul_inv_cancel₀ hR.ne'] at hh
40 nlinarith
41 · intro h
42 have hh : 1/R ≤ (1-ε)^(-1/a)-1 := (div_le_iff₀ hR).mpr (by nlinarith)
43 simpa only [one_div] using (show 1+1/R ≤ (1-ε)^(-1/a) by linarith)
44
45/-- Each finite symmetric-dimension factor is at least its unshifted value. -/
46theorem shifted_ratio_lower {N M j : ℝ} (hN : 0<N) (hM : 0≤M) (hj : 0≤j) :
47 N/(N+M) ≤ (N+j)/(N+M+j) := by
48 rw [div_le_div_iff₀ (by linarith : 0<N+M) (by linarith : 0<N+M+j)]
49 nlinarith [mul_nonneg hM hj]
50
51theorem finite_product_lower (a N M : ℕ) (hN : 0<N) :
52 ((N:ℝ)/(N+M))^a ≤ ∏ j ∈ Finset.range a,
53 ((N:ℝ)+j+1)/((N:ℝ)+M+j+1) := by
54 have hn : (0:ℝ)<N := by exact_mod_cast hN
55 calc
56 ((N:ℝ)/(N+M))^a = ∏ _j ∈ Finset.range a, (N:ℝ)/(N+M) := by simp [div_pow]
57 _ ≤ _ := Finset.prod_le_prod (fun _ _ => by positivity) (fun j _ => by
58 convert shifted_ratio_lower hn (Nat.cast_nonneg M)
59 (show (0:ℝ)≤j+1 by positivity) using 1 <;> ring_nf)
60
61end Cloning.SampleRatio