File size: 3,774 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | import OAI.Computability.PerfectCompleteness.Construction.OriginalChildScalarAssemblyLemmas
import OAI.Computability.PerfectCompleteness.Reduction.FixedCallBudgetLemmas
import OAI.Computability.PerfectCompleteness.Repetition.CutChildCleanLawLemmas
namespace OAI
section
namespace PerfectCompleteness.FixedCleanRate
open ChildBlockCardinality ProjectedCleanRate
noncomputable section
theorem zeroProbability_lower (branch : Nat β Nat) (height t calls : Nat)
(rows : Nat β Nat) :
1 / (bound branch height t calls rows : β) β€
zeroProbability branch height t calls rows := by
let ids : RecursiveSpaces.Slots branch height β Fin t β Nat := fun _ _ => 0
rw [β raw_zero_probability branch height t calls rows ids,
CleanTreeFactors.rawLaw_uniform]
exact cleanLowerBound_le_probability
(slots := ProjectedCardinality.projectedSlots ids)
theorem conservative_coefficient_le {calls budget cost : Nat}
(hcalls : calls β€ budget) (hcost : 0 < cost)
(branch : Nat β Nat) (height t : Nat) (rows : Nat β Nat) :
FixedBranching.cleanRate cost (bound branch height t budget rows : β) β€
coefficient cost branch height t calls rows := by
have hbound : (bound branch height t calls rows : β) β€
(bound branch height t budget rows : β) := by
exact_mod_cast FixedCallBudget.child_bound_mono hcalls branch height t rows
have hpositive : (0 : β) < bound branch height t calls rows :=
Nat.cast_pos.mpr (shape_bound_pos branch height t calls rows)
have hzero : 1 / (bound branch height t budget rows : β) β€
zeroProbability branch height t calls rows :=
(one_div_le_one_div_of_le hpositive hbound).trans
(zeroProbability_lower branch height t calls rows)
have hden : (0 : β) < 48000 * cost := by
have : (0 : β) < cost := by exact_mod_cast hcost
positivity
calc
_ = (1 / (bound branch height t budget rows : β)) / (48000 * cost) := by
unfold FixedBranching.cleanRate
ring
_ β€ _ := div_le_div_of_nonneg_right hzero hden.le
theorem decay_le_conservative {calls budget cost cube : Nat}
(hcalls : calls β€ budget) (hcost : 0 < cost) (hcube : 2 β€ cube)
(branch : Nat β Nat) (height t : Nat) (rows : Nat β Nat) :
(1 - coefficient cost branch height t calls rows / (cube : β) ^ 2) ^ (cube ^ 3) β€
(1 - FixedBranching.cleanRate cost
(bound branch height t budget rows : β) / (cube : β) ^ 2) ^ (cube ^ 3) := by
have hc : (2 : β) β€ cube := by exact_mod_cast hcube
have hsquare : (1 : β) β€ (cube : β) ^ 2 := by nlinarith
have hden : (0 : β) < (cube : β) ^ 2 := by positivity
have hcoef := (coefficient_bounds hcost branch height t calls rows).2
have hbase : 0 β€ 1 - coefficient cost branch height t calls rows / (cube : β) ^ 2 := by
have := (div_le_one hden).mpr (hcoef.trans hsquare)
linarith
apply pow_le_pow_leftβ hbase
have h := div_le_div_of_nonneg_right
(conservative_coefficient_le hcalls hcost branch height t rows) hden.le
linarith
variable {Ξ΄ : β} {hΞ΄ : 0 < Ξ΄} (p : FixedParameters.Parameters Ξ΄ hΞ΄)
theorem actual_clean_error {calls : Nat} (hcalls : calls β€ FixedParameters.calls p.plan)
(height : Nat) :
(1 - coefficient p.alphabetCost (FixedParameters.branch p) height
(FixedRows.sourceLength p.plan hΞ΄) calls (FixedRows.rows p.plan) /
(p.cubeSize height : β) ^ 2) ^ (p.cubeSize height ^ 3) < p.accuracy := by
have hdecay := decay_le_conservative hcalls p.alphabetCost_pos
(p.cube_errors height).1 (FixedParameters.branch p) height
(FixedRows.sourceLength p.plan hΞ΄) (FixedRows.rows p.plan)
exact hdecay.trans_lt (p.cube_errors height).2.2.2.2
end
end PerfectCompleteness.FixedCleanRate
end
end OAI
|