File size: 5,741 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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | import OAI.MeasureTheory.Falconer.Recursion.BranchPotential
import OAI.MeasureTheory.Falconer.Recursion.SourceBranchDepth
namespace OAI
namespace PlanarFalconer
theorem branch_nonlow_indicator_sum (label : β β BranchLabel) (n : β) :
(β j β Finset.range n, if label j = .low then 0 else 1) = branchNonlowCount label n := by
have htot := branch_count_total label n
have hsum : branchCount label n .low +
(β j β Finset.range n, if label j = .low then 0 else 1) = n := by
simp only [branchCount,β Finset.sum_add_distrib]
calc
_ = β _j β Finset.range n, (1:β) := by
apply Finset.sum_congr rfl
intro j _
by_cases hj : label j = .low <;> simp [hj]
_ = n := by simp
omega
theorem branch_nonlow_loss_sum (label : β β BranchLabel) (n : β) (loss : β) :
(β j β Finset.range n, if label j = .low then 0 else loss) =
(branchNonlowCount label n:β)*loss := by
have hcast := congrArg (fun k : β => (k:β)) (branch_nonlow_indicator_sum label n)
simp only [Nat.cast_sum,Nat.cast_ite,Nat.cast_zero,Nat.cast_one] at hcast
calc
_ = β j β Finset.range n, (if label j = .low then (0:β) else 1)*loss := by
apply Finset.sum_congr rfl
intro j _
by_cases hj : label j = .low <;> simp [hj]
_ = _ := by rw [β Finset.sum_mul,hcast]
noncomputable def branchExponent (A : β β β) (lam sig eps : β)
(s : BranchState) (label : BranchLabel) (u : BranchState) : β :=
-2*(A u.start-A s.start)+branchCost A s label u+
(if label = .low then 0 else 4000*(lam+sig))+eps
theorem branch_exponent_sum (A : β β β) (lam sig eps : β)
(state : β β BranchState) (label : β β BranchLabel) (n : β) :
(β j β Finset.range n, branchExponent A lam sig eps (state j) (label j) (state (j+1))) =
2*A (state 0).start-2*A (state n).start+
(β j β Finset.range n, branchCost A (state j) (label j) (state (j+1)))+
(branchNonlowCount label n:β)*(4000*(lam+sig))+(n:β)*eps := by
simp only [branchExponent,Finset.sum_add_distrib]
rw [profile_increments_telescope A (fun j => (state j).start) n,branch_nonlow_loss_sum]
simp
theorem source_branch_exponent {A : β β β} {N n : β} {lam sig kap eta : β}
(hN : 0 < N) (hlam : 0 β€ lam) (hsig : 0 < sig) (hkap : 0 < kap) (hkap1 : kap β€ 1)
(heta : 0 < eta) (hceil : β10*sig*(N:β)ββ < sourcePolicyBlock N kap)
(hslack : sig*(N:β) β€ sourcePolicyBlock N kap)
(hqratio : (sourcePolicyBlock N kap:β)/(N:β) β€ 2*kap)
(hA : DiscreteProfileLipschitz A N)
(b : PolicyBranch A N (sourcePolicyBlock N kap) sig n)
(hinit : (b.state 0).start+10*sourcePolicyBlock N kap β€ (b.state 0).finish) :
let eps := eta/(2*(1+20/kap+1/sig))
(β j β Finset.range n, branchExponent A lam sig eps (b.state j) (b.label j) (b.state (j+1))) +
(200*(sourcePolicyBlock N kap:β)/N+12*lam+eta/2) β€
2*A (b.state 0).start-potential A (b.state 0).start (b.state 0).finish
(10*sourcePolicyBlock N kap)+500*kap+10^6*(lam+sig)/kap+eta := by
dsimp only
have hq := sourcePolicyBlock_pos hN hkap
have hc := b.costs_le_final_start hN hq hslack hA hinit
have hb := source_branch_count_bounds hN hsig hkap hkap1 hceil b
let D : β := 1+20/kap+1/sig
have hD : 0 < D := by dsimp [D]; positivity
have heps : 0 β€ eta/(2*D) := by positivity
have htime : (n:β)*(eta/(2*D)) β€ eta/2 := by
have hn : (n:β) β€ D := by dsimp [D]; linarith [hb.2.2]
calc
_ β€ D*(eta/(2*D)) := mul_le_mul_of_nonneg_right hn heps
_ = eta/2 := by field_simp
have hloss : (branchNonlowCount b.label n:β)*(4000*(lam+sig)) β€ 80000*(lam+sig)/kap := by
calc
_ β€ (20/kap)*(4000*(lam+sig)) := mul_le_mul_of_nonneg_right hb.1 (by positivity)
_ = _ := by ring
have hlamK : lam β€ (lam+sig)/kap := by
apply (le_div_iffβ hkap).mpr
have hh := mul_le_mul_of_nonneg_left hkap1 hlam
linarith
have hbudget : 0 β€ (lam+sig)/kap := by positivity
rw [branch_exponent_sum]
dsimp only [D] at htime
simp only [mul_div_assoc] at hc hloss β’
nlinarith
theorem uniform_source_branch_exponent {lam sig kap eta : β}
(hlam : 0 β€ lam) (hsig : 0 < sig) (hkap : 0 < kap) (hkap1 : kap β€ 1)
(hgap : sig < kap/1000) (heta : 0 < eta) :
β Nβ : β, 0 < Nβ β§ β N β₯ Nβ, β A : β β β,
DiscreteProfileLipschitz A N β β n : β,
β b : PolicyBranch A N (sourcePolicyBlock N kap) sig n,
(b.state 0).start+10*sourcePolicyBlock N kap β€ (b.state 0).finish β
(β j β Finset.range n, branchExponent A lam sig (eta/(2*(1+20/kap+1/sig)))
(b.state j) (b.label j) (b.state (j+1))) +
(200*(sourcePolicyBlock N kap:β)/N+12*lam+eta/2) β€
2*A (b.state 0).start-potential A (b.state 0).start (b.state 0).finish
(10*sourcePolicyBlock N kap)+500*kap+10^6*(lam+sig)/kap+eta := by
obtain β¨Nβ,hNβ,hββ© := uniform_source_ceiling_slack hsig hgap
obtain β¨Nβ,hNββ© := exists_nat_gt (1/kap)
refine β¨max Nβ Nβ,by omega,?_β©
intro N hN A hA n b hi
have hNp : 0 < N := by omega
have hNR : (0:β) < N := Nat.cast_pos.mpr hNp
have hkn : 1 < kap*(N:β) := by
have hh := (div_lt_iffβ hkap).mp (hNβ.trans_le (Nat.cast_le.mpr (show Nβ β€ N by omega)))
linarith
have hq : (sourcePolicyBlock N kap:β) < kap*N+1 :=
Nat.ceil_lt_add_one (mul_nonneg hkap.le hNR.le)
have hqr : (sourcePolicyBlock N kap:β)/(N:β) β€ 2*kap :=
(div_le_iffβ hNR).mpr (by linarith)
exact source_branch_exponent hNp hlam hsig hkap hkap1 heta
(hβ N (by omega)).1 (hβ N (by omega)).2.2 hqr hA b hi
end PlanarFalconer
end OAI
|