File size: 2,349 Bytes
e63eb7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Combinatorics.EditApproximation.Queries.QueryPhysicalProgram
import OAI.Combinatorics.EditApproximation.Queries.QueryFamilyScalarReads

namespace OAI

/-! The charged local refinement uses the independent source
family, with computed scalar guards and pass/copy addresses. -/

namespace EditApproximation

section Family
variable {α : Type*} {M J R : ℕ} [NeZero M] (source target : List α)
  (N P F exponent H Q eM eF : ℕ) (hP : 0 < P) (hM : M = 2 ^ eM) (hF : F = 2 ^ eF)
  (tau a eta kappa delta : BinaryFraction) (passes copies pass copy T S t : ℕ) (ht : 0 < t)
  (node : PhysicalNode M J) (hbelow : node.1.val < J) (time : Fin R)
  (q : TargetInterval target.length)

def queryFamilyRefinement :
    BitQuery (Sum (PhysicalFamilyScalarKey (M := M) (J := J) (R := R)
      target N P F exponent H Q passes copies)
      {child : PhysicalTableRequest M J target.length // child.combinedRank T S <
        (PhysicalTableRequest.refinement pass copy node T t q).combinedRank T S}) BinaryFraction :=
  queryPhysicalRandomDataRequest source target N P F exponent H Q eM eF hP hM hF
    tau a eta kappa delta copies pass copy T S t ht node hbelow
    (queryFamilyGroupRead target N P F exponent H Q passes copies pass copy ⟨node, hbelow⟩ time)
    (queryFamilyOnlineRead target N P F exponent H Q passes copies pass copy ⟨node, hbelow⟩ time) q

theorem queryFamilyRefinement_refines :
    BitQuery.Refines (fun word value => word.value = value)
      (queryFamilyRefinement source target N P F exponent H Q eM eF hP hM hF tau a eta kappa delta
        passes copies pass copy T S t ht node hbelow time q)
      (physicalRandomDataRequestQuery source target N P F exponent H Q tau.value a.value eta.value
        kappa.value delta.value pass copy T S t ht node hbelow
        (physicalFamilyGroupRead target N P F exponent H Q passes copies pass copy ⟨node, hbelow⟩ time)
        (physicalFamilyOnlineRead target N P F exponent H Q passes copies pass copy ⟨node, hbelow⟩ time) q) := by
  apply queryPhysicalRandomDataRequest_refines
  · intro key
    exact queryFamilyGroupRead_refines target N P F exponent H Q passes copies pass copy _ time key
  · intro key range
    exact queryFamilyOnlineRead_refines target N P F exponent H Q passes copies pass copy _ time key range

end Family
end EditApproximation

end OAI