File size: 8,491 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 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | import OAI.Geometry.PinnedDistances.Variance
namespace OAI
universe u1 u2 u3 u4 u5 u6 u7
section
noncomputable section
open NumberField
open scoped BigOperators
noncomputable section
open MeasureTheory
open scoped Topology
noncomputable section
open MeasureTheory
open scoped Topology ENNReal
noncomputable section
open MeasureTheory NumberField
open scoped BigOperators
noncomputable section
open scoped BigOperators
open MeasureTheory
namespace WeakPinned.Global
open Hierarchy
variable {P : Type u1} [Fintype P] [DecidableEq P]
variable {K : Type u2} [Field K] [NumberField K]
variable (Z : P β K) (hZ : Function.Injective Z)
def cellMass (C : Finset P) : β :=
(β v : InfinitePlace K, Arithmetic.archWeight v * β« Ο, (arch Z v Ο).mass C βGrid.fullLaw) +
(Module.finrank β K : β)β»ΒΉ * β v β badPlaces Z hZ, (finite Z hZ v).mass C
lemma cellMass_nonneg (C : Finset P) : 0 β€ cellMass Z hZ C := by
exact add_nonneg
(Finset.sum_nonneg (fun v _ => mul_nonneg (Arithmetic.archWeight_nonneg v)
(integral_nonneg (fun Ο => (arch Z v Ο).mass_nonneg C))))
(mul_nonneg (by positivity) (Finset.sum_nonneg (fun v _ => (finite Z hZ v).mass_nonneg C)))
lemma cellMass_singleton (C : Finset P) (hC : C.card β€ 1) : cellMass Z hZ C = 0 := by
simp only [cellMass, Depth.mass_singleton _ C hC, integral_zero, mul_zero, Finset.sum_const_zero, add_zero]
lemma cellMass_overlap (hn : 2 β€ Fintype.card P) (x y : P) (hxy : x β y) :
(β C, cellMass Z hZ C * (if x β C β§ y β C then (1 : β) else 0)) = L Z hZ x y hxy := by
simp only [cellMass, add_mul, Finset.sum_add_distrib, Finset.sum_mul,
mul_assoc, L]
rw [β Finset.mul_sum]
congr 1
Β· rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro v _
rw [β Finset.mul_sum, Depth.averaged_mass_overlap (arch Z v) (arch_measurable Z hZ v)
(arch_integrable Z hZ v) hn x y hxy]
Β· congr 1
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro v _
exact (finite Z hZ v).mass_overlap hn x y hxy
end WeakPinned.Global
namespace WeakPinned.Variance
variable {P : Type u3} [Fintype P] [DecidableEq P]
/-- Finite linear model of the actual occurrence integral on expressions
vanishing on singleton and empty cells. Multiplicities are in m. -/
def weightedIntegral (m : Finset P β β) (f : Finset P β β) : β := β C, m C * f C
def weightedOverlap (m : Finset P β β) (x y : P) : β :=
weightedIntegral m (fun C => if x β C β§ y β C then 1 else 0)
lemma weighted_cancel (m : Finset P β β) (b : β) (S : P β β)
(hL : β x y, x β y β weightedOverlap m x y = b+S x+S y)
(B : Finset P) (hB : 2 β€ B.card) : weightedIntegral m (signedCell B) = 0 := by
have he : weightedIntegral m (signedCell B) =
β x, β y, signedPair B x y * weightedOverlap m x y := by
simp only [weightedIntegral, signedCell_eq]
have hc (C : Finset P) : (β x β C, β y β C, signedPair B x y) =
β x, β y, signedPair B x y * (if x β C β§ y β C then (1:β) else 0) := by
simp only [mul_ite, mul_one, mul_zero, ite_and]
simp only [Finset.sum_ite_irrel, Finset.sum_const_zero]
simp
simp_rw [hc, Finset.mul_sum]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro x _
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro y _
simp only [weightedOverlap, weightedIntegral, Finset.mul_sum]
apply Finset.sum_congr rfl
intro C _
ring
rw [he]
exact variance_cancel B hB _ b S hL
lemma weighted_variance {I : Type u4} [Fintype I]
(m : Finset P β β) (hm : β C, 0 β€ m C) (b : β) (S : P β β)
(hL : β x y, x β y β weightedOverlap m x y = b+S x+S y)
(w : I β β) (B : I β Finset P) (T M Ξ΅ Ο : β)
(hw : β i, 0 β€ w i) (hW : (β i, w i) β€ 1)
(hT : 1 β€ T) (hM : 0 β€ M) (hΞ΅ : 0 β€ Ξ΅) (hΟ : 0 < Ο)
(hscale : Ο * Fintype.card P β€ T)
(hB : β i, 2 β€ (B i).card)
(hk : β i, 1 / (((B i).card : β)-1) β€ Ξ΅)
(hn : 1 / ((Fintype.card P : β)-1) β€ Ξ΅)
(hdom : β x, (β i, w i * prob (B i) x) β€ M * prob Finset.univ x) :
weightedIntegral m (varianceCell w B T) β€
(2*Ξ΅*(M+1)/Ο)*weightedIntegral m (pairCell Finset.univ) +
4*M*weightedIntegral m (fun C => if (C.card : β) β€ T then pairCell Finset.univ C else 0) := by
have hh := Finset.sum_le_sum (s := Finset.univ) (fun C _ =>
mul_le_mul_of_nonneg_left
(varianceCell_bound w B T M Ξ΅ Ο hw hW hT hM hΞ΅ hΟ hscale hB hk hn hdom C) (hm C))
simp only [mul_add, Finset.sum_add_distrib] at hh
have hz : (β C, m C * β i, w i * signedCell (B i) C) = 0 := by
simp_rw [Finset.mul_sum]
rw [Finset.sum_comm]
have hi (i : I) : (β C, m C * (w i * signedCell (B i) C)) = 0 := by
calc
_ = w i * weightedIntegral m (signedCell (B i)) := by
simp only [weightedIntegral, Finset.mul_sum]
apply Finset.sum_congr rfl
intro C _
ring
_ = 0 := by rw [weighted_cancel m b S hL _ (hB i),mul_zero]
simp_rw [hi]
exact Finset.sum_const_zero
rw [hz,zero_add] at hh
simp only [β mul_add] at hh
change weightedIntegral m (varianceCell w B T) β€ _ at hh
have heβ : (β C, m C * (2*Ξ΅*(M+1)/Ο * pairCell Finset.univ C)) =
(2*Ξ΅*(M+1)/Ο)*weightedIntegral m (pairCell Finset.univ) := by
simp only [weightedIntegral, Finset.mul_sum]
apply Finset.sum_congr rfl
intro C _
ring
have heβ : (β C, m C * (4*M*(if (C.card : β) β€ T then pairCell Finset.univ C else 0))) =
4*M*weightedIntegral m (fun C => if (C.card : β) β€ T then pairCell Finset.univ C else 0) := by
simp only [weightedIntegral, Finset.mul_sum]
apply Finset.sum_congr rfl
intro C _
ring
rwa [heβ,heβ] at hh
end WeakPinned.Variance
namespace WeakPinned.Global
open Hierarchy Variance
variable {P : Type u5} [Fintype P] [DecidableEq P]
variable {K : Type u6} [Field K] [NumberField K]
variable (Zβ Zβ : P β K) (hβ : Function.Injective Zβ) (hβ : Function.Injective Zβ)
def totalMass (C : Finset P) : β := cellMass Zβ hβ C + cellMass Zβ hβ C
def totalPotential (x : P) : β := S Zβ hβ x + S Zβ hβ x
def baseConstant : β := 2*Grid.kappa - M Zβ hβ - M Zβ hβ
lemma totalMass_nonneg (C : Finset P) : 0 β€ totalMass Zβ Zβ hβ hβ C :=
add_nonneg (cellMass_nonneg Zβ hβ C) (cellMass_nonneg Zβ hβ C)
lemma totalPotential_nonneg (x : P) : 0 β€ totalPotential Zβ Zβ hβ hβ x :=
add_nonneg (S_nonneg Zβ hβ x) (S_nonneg Zβ hβ x)
lemma totalMass_overlap (hn : 2 β€ Fintype.card P) (x y : P) (hxy : x β y) :
weightedOverlap (totalMass Zβ Zβ hβ hβ) x y =
baseConstant Zβ Zβ hβ hβ + totalPotential Zβ Zβ hβ hβ x + totalPotential Zβ Zβ hβ hβ y := by
simp only [weightedOverlap,weightedIntegral,totalMass,add_mul,Finset.sum_add_distrib]
rw [cellMass_overlap Zβ hβ hn x y hxy,cellMass_overlap Zβ hβ hn x y hxy,
coordinate_overlap_identity Zβ hβ hn x y hxy,coordinate_overlap_identity Zβ hβ hn x y hxy]
simp only [baseConstant,totalPotential]
ring
/-- Unconditional arithmetic-hierarchy instance of the quantitative variance
bound. The overlap identity follows from the product formula, and the
family hypotheses are exactly finite sampling data. -/
theorem arithmetic_variance {I : Type u7} [Fintype I]
(hnP : 2 β€ Fintype.card P)
(w : I β β) (B : I β Finset P) (T Mβ Ξ΅ Ο : β)
(hw : β i, 0 β€ w i) (hW : (β i, w i) β€ 1)
(hT : 1 β€ T) (hM : 0 β€ Mβ) (hΞ΅ : 0 β€ Ξ΅) (hΟ : 0 < Ο)
(hscale : Ο * Fintype.card P β€ T)
(hB : β i, 2 β€ (B i).card)
(hk : β i, 1 / (((B i).card : β)-1) β€ Ξ΅)
(hn : 1 / ((Fintype.card P : β)-1) β€ Ξ΅)
(hdom : β x, (β i, w i * prob (B i) x) β€ Mβ * prob Finset.univ x) :
weightedIntegral (totalMass Zβ Zβ hβ hβ) (varianceCell w B T) β€
(2*Ξ΅*(Mβ+1)/Ο)*weightedIntegral (totalMass Zβ Zβ hβ hβ) (pairCell Finset.univ) +
4*Mβ*weightedIntegral (totalMass Zβ Zβ hβ hβ)
(fun C => if (C.card : β) β€ T then pairCell Finset.univ C else 0) :=
weighted_variance _ (totalMass_nonneg Zβ Zβ hβ hβ) _ _
(totalMass_overlap Zβ Zβ hβ hβ hnP) w B T Mβ Ξ΅ Ο hw hW hT hM hΞ΅ hΟ hscale hB hk hn hdom
end WeakPinned.Global
end
end
end
end
end
end
end OAI
|