File size: 6,194 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 | import OAI.Combinatorics.EditApproximation.Geometry.ChargedRandomExpansion
import OAI.Combinatorics.EditApproximation.Geometry.ChargedRandomMemo
namespace OAI
/-! Source reads and dictionary visits in the actual shared-cache evaluator
are bounded by the width of its projected table dependency expansion. -/
namespace EditApproximation
section Work
variable {Ο Ξ± : Type*} [DecidableEq Ξ±] {M J R : β} [NeZero M] [NeZero R]
(source target : List Ξ±) (N P H T S passes copies : β)
(factor : β β β) (multiplier : β β β) (tau eta kappa delta : β)
(group : β β β β PhysicalInternalNode M J β Fin R β
CellGroupDraws M (inputSmallLog N) (inputSmallLog N ^ 80))
(integer : β β β β PhysicalInternalNode M J β Fin R β β β TargetInterval target.length β β)
(initial : PhysicalEntry M J target.length β β)
variable
(readGroup : β β β β PhysicalInternalNode M J β Fin R β
GroupScalarKey M (inputSmallLog N) (inputSmallLog N ^ 80) β FiniteQuery Ο)
(readInteger : β β β β PhysicalInternalNode M J β Fin R β
(β Γ TargetInterval target.length) β β β FiniteQuery Ο)
(sourceAnswer : Ο β β)
local notation "mixedProgram" => chargedRandomGlobalQuery source target N P (inputSmallLog N)
(40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier
tau eta kappa delta readGroup readInteger initial
local notation "program" => SourceRanked.projectedBody ChargedPhysicalRequest.rank mixedProgram sourceAnswer
local notation "values" => chargedRequestValue source target N P (inputSmallLog N)
(40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier
tau eta kappa delta group integer initial
local notation "depth" => @ChargedPhysicalRequest.depth M J target.length passes copies T S
local notation "index" => @ChargedPhysicalRequest.index M J target.length passes copies T S
variable (hbody : β (request : ChargedPhysicalRequest M J target.length passes copies T S),
(chargedRandomGlobalQuery source target N P (inputSmallLog N)
(40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier
tau eta kappa delta readGroup readInteger initial request).value
(Sum.elim sourceAnswer (fun child : {child : ChargedPhysicalRequest M J target.length passes copies T S //
child.rank < request.rank} => chargedRequestValue source target N P (inputSmallLog N)
(40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier
tau eta kappa delta group integer initial child.val)) =
chargedRequestValue source target N P (inputSmallLog N)
(40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier
tau eta kappa delta group integer initial request)
include hbody
theorem chargedRandomMemoEvaluate_requests_le_widthWork
(sourceBudget bits : β)
(encode : Sum Ο (ChargedPhysicalRequest M J target.length passes copies T S) β β)
(hinjective : Function.Injective encode) (hbounded : β key, encode key < 2 ^ bits)
(hsource : β key, (mixedProgram key).cost
(Sum.elim sourceAnswer (fun next => values next.val))
(Sum.elim (fun _ => 1) (fun _ => 0)) β€ sourceBudget)
(root : ChargedPhysicalRequest M J target.length passes copies T S) :
(chargedRandomMemoEvaluate source target N P (inputSmallLog N)
(40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier
tau eta kappa delta readGroup readInteger initial sourceAnswer bits encode root).requests β€
(sourceBudget + 1) *
(chargedRandomDependencyTree source target N P H T S passes copies factor multiplier
tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody root).widthWork
M source.length := by
apply (SourceRanked.memo_requests_le_source_factor ChargedPhysicalRequest.rank mixedProgram
sourceAnswer values hbody sourceBudget hsource bits encode hinjective hbounded root).trans
apply Nat.mul_le_mul_left
calc
rankedUncachedCalls ChargedPhysicalRequest.rank program root =
(chargedRandomDependencyTree source target N P H T S passes copies factor multiplier
tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody root).nodeCount :=
(queryDependencyExpansion_nodes depth index program
(chargedRandomRequestList_progress source target N P H T S passes copies factor multiplier
tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody) root).symm
_ β€ _ := DependencyExpansion.nodeCount_le_widthWork _ _ _
theorem chargedRandomMemoEvaluate_dictionaryVisits_le_widthWork
(sourceBudget bits : β)
(encode : Sum Ο (ChargedPhysicalRequest M J target.length passes copies T S) β β)
(hinjective : Function.Injective encode) (hbounded : β key, encode key < 2 ^ bits)
(hsource : β key, (mixedProgram key).cost
(Sum.elim sourceAnswer (fun next => values next.val))
(Sum.elim (fun _ => 1) (fun _ => 0)) β€ sourceBudget)
(root : ChargedPhysicalRequest M J target.length passes copies T S) :
(chargedRandomMemoEvaluate source target N P (inputSmallLog N)
(40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier
tau eta kappa delta readGroup readInteger initial sourceAnswer bits encode root).dictionaryVisits β€
(sourceBudget + 1) *
(chargedRandomDependencyTree source target N P H T S passes copies factor multiplier
tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody root).widthWork
M source.length * (2 * (bits + 1)) := by
exact (rankedMemoEvaluate_resource_bounds _ _ bits encode (.inr root) .empty).2.1.trans
(Nat.mul_le_mul_right _
(chargedRandomMemoEvaluate_requests_le_widthWork source target N P H T S passes copies
factor multiplier tau eta kappa delta group integer initial readGroup readInteger sourceAnswer
hbody sourceBudget bits encode hinjective hbounded hsource root))
end Work
end EditApproximation
end OAI
|