File size: 5,788 Bytes
f0f05de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
120
121
122
123
124
125
126
import OAI.Combinatorics.BalancedRyser.Probability.ConditionalOrderVariance
import OAI.Combinatorics.BalancedRyser.Profiles.ProfileDetectionConcentration

namespace OAI

open MeasureTheory ProbabilityTheory
open scoped BigOperators

namespace Balanced.ConditionalOrderDetection

open ConditionalOrderVariance UncoveredSampling

variable {F : Type*} [Field F] [Fintype F] [DecidableEq F]

noncomputable def planeObservable (U V : Finset (Line F))
    (I : Finset U) (J : Finset V) (p : OrderPair U V) : ℝ :=
  planeFraction (populationLines U (I.map p.1.toEmbedding))
    (populationLines V (J.map p.2.toEmbedding))

noncomputable def targetObservable (U V : Finset (Line F))
    (I : Finset U) (J : Finset V) (x : U) (p : OrderPair U V) : ℝ :=
  targetFraction x.val (populationLines U (I.map p.1.toEmbedding))
    (populationLines V (J.map p.2.toEmbedding))

private theorem finite_memLp {Ω : Type*} [Fintype Ω]
    [MeasurableSpace Ω] [MeasurableSingletonClass Ω]
    (μ : Measure Ω) [IsFiniteMeasure μ] (f : Ω → ℝ) : MemLp f 2 μ := by
  apply MemLp.of_bound (measurable_of_countable f).aestronglyMeasurable
    (∑ ω, |f ω|)
  apply Filter.Eventually.of_forall
  intro ω
  simp only [Real.norm_eq_abs]
  exact Finset.single_le_sum (fun z _ => abs_nonneg (f z)) (Finset.mem_univ ω)

section Conditional

variable (U V : Finset (Line F))
variable [MeasurableSpace (OrderPair U V)] [MeasurableSingletonClass (OrderPair U V)]
variable (I : Finset U) (J : Finset V) (i x : U)

theorem unmarked_probability_le_of_mean_gap
    (hUV : Disjoint U V) (hi : i ∉ I) {ε : ℝ} (hε : 0 < ε)
    (hgap : 2 * ε <
      |(∫ p, targetObservable U V I J x p ∂(conditionedOrderLaw U V i x).toMeasure) -
        ∫ p, planeObservable U V I J p ∂(conditionedOrderLaw U V i x).toMeasure|) :
    (conditionedOrderLaw U V i x).toMeasure.real
      {p | |targetObservable U V I J x p - planeObservable U V I J p| ≤ ε} ≤
      32 * ((I.card : ℝ) + J.card) / ((Fintype.card F : ℝ)^2 * ε^2) := by
  have h := ProfileDetectionConcentration.unmarked_probability_le_of_mean_gap
    (finite_memLp _ (targetObservable U V I J x))
    (finite_memLp _ (planeObservable U V I J)) hε hgap
  have htarget := target_conditioned_order_measure_variance_le U V hUV I J i x hi
  have hplane := plane_conditioned_order_measure_variance_le U V I J i x hi
  calc
    _ ≤ 4 * (variance (targetObservable U V I J x)
        (conditionedOrderLaw U V i x).toMeasure +
      variance (planeObservable U V I J)
        (conditionedOrderLaw U V i x).toMeasure) / ε^2 := h
    _ ≤ 4 * (4 * ((I.card : ℝ) + J.card) / (Fintype.card F : ℝ)^2 +
        4 * ((I.card : ℝ) + J.card) / (Fintype.card F : ℝ)^2) / ε^2 := by
      gcongr
      · exact htarget
      · exact hplane
    _ = _ := by ring

theorem unmarked_probability_le_of_profile_gap
    (hUV : Disjoint U V) (hi : i ∉ I) {a b ε : ℝ}
    (hε : 0 < ε) (hgap : 3 * ε < |a - b|)
    (hTa : |(∫ p, targetObservable U V I J x p
        ∂(conditionedOrderLaw U V i x).toMeasure) - a| ≤ ε / 2)
    (hPb : |(∫ p, planeObservable U V I J p
        ∂(conditionedOrderLaw U V i x).toMeasure) - b| ≤ ε / 2) :
    (conditionedOrderLaw U V i x).toMeasure.real
      {p | |targetObservable U V I J x p - planeObservable U V I J p| ≤ ε} ≤
      32 * ((I.card : ℝ) + J.card) / ((Fintype.card F : ℝ)^2 * ε^2) := by
  apply unmarked_probability_le_of_mean_gap U V I J i x hUV hi hε
  have h₁ := abs_sub_le a
    (∫ p, targetObservable U V I J x p ∂(conditionedOrderLaw U V i x).toMeasure) b
  have h₂ := abs_sub_le
    (∫ p, targetObservable U V I J x p ∂(conditionedOrderLaw U V i x).toMeasure)
    (∫ p, planeObservable U V I J p ∂(conditionedOrderLaw U V i x).toMeasure) b
  rw [abs_sub_comm a
    (∫ p, targetObservable U V I J x p ∂(conditionedOrderLaw U V i x).toMeasure)] at h₁
  linarith

theorem marked_probability_ge_of_profile_gap
    (hUV : Disjoint U V) (hi : i ∉ I) {a b ε : ℝ}
    (hε : 0 < ε) (hgap : 3 * ε < |a - b|)
    (hTa : |(∫ p, targetObservable U V I J x p
        ∂(conditionedOrderLaw U V i x).toMeasure) - a| ≤ ε / 2)
    (hPb : |(∫ p, planeObservable U V I J p
        ∂(conditionedOrderLaw U V i x).toMeasure) - b| ≤ ε / 2) :
    1 - 32 * ((I.card : ℝ) + J.card) / ((Fintype.card F : ℝ)^2 * ε^2) ≤
      (conditionedOrderLaw U V i x).toMeasure.real
        {p | ε < |targetObservable U V I J x p - planeObservable U V I J p|} := by
  rw [ProfileDetectionConcentration.marked_probability_eq
    (finite_memLp _ (targetObservable U V I J x))
    (finite_memLp _ (planeObservable U V I J))]
  exact sub_le_sub_left
    (unmarked_probability_le_of_profile_gap U V I J i x hUV hi hε hgap hTa hPb) 1

theorem unmarked_probability_le_scaled
    (hUV : Disjoint U V) (hi : i ∉ I) {a b ε C : ℝ}
    (hε : 0 < ε) (hgap : 3 * ε < |a - b|)
    (hTa : |(∫ p, targetObservable U V I J x p
        ∂(conditionedOrderLaw U V i x).toMeasure) - a| ≤ ε / 2)
    (hPb : |(∫ p, planeObservable U V I J p
        ∂(conditionedOrderLaw U V i x).toMeasure) - b| ≤ ε / 2)
    (hsize : (I.card : ℝ) + J.card ≤ C * Fintype.card F) :
    (conditionedOrderLaw U V i x).toMeasure.real
      {p | |targetObservable U V I J x p - planeObservable U V I J p| ≤ ε} ≤
      32 * C / ((Fintype.card F : ℝ) * ε^2) := by
  have hq : (Fintype.card F : ℝ) ≠ 0 := by positivity
  calc
    _ ≤ 32 * ((I.card : ℝ) + J.card) / ((Fintype.card F : ℝ)^2 * ε^2) :=
      unmarked_probability_le_of_profile_gap U V I J i x hUV hi hε hgap hTa hPb
    _ ≤ 32 * (C * Fintype.card F) / ((Fintype.card F : ℝ)^2 * ε^2) := by
      gcongr
    _ = _ := by field_simp

end Conditional

end Balanced.ConditionalOrderDetection

end OAI