File size: 4,935 Bytes
92416a2 | 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 | import Mathlib
import OAI.Computability.VertexCover.Reduction.SeparatorContinuousSumOdd
import OAI.Computability.VertexCover.Analysis.CanonicalGradientValid
import OAI.Computability.VertexCover.Analysis.BlockLawNegInvariant
namespace OAI
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
namespace VertexCover.GridCoupling
open MeasureTheory ProbabilityTheory
theorem block_measurePreserving {ι κ : Type*} [Fintype ι] [Fintype κ]
(p : ℕ) (hp : 0 < p) :
MeasurePreserving (fun s : ι → κ → ℝ => fun j k => index p hp (s j k))
(VertexCover.Cube.blockLaw ι κ)
(uniformOn (Set.univ : Set (ι → κ → Fin p))) := by
classical
let : NeZero p := ⟨hp.ne'⟩
have h := VertexCover.Product.piMap_measurePreserving (ι := ι)
(VertexCover.Cube.law κ) (uniformOn (Set.univ : Set (κ → Fin p)))
(fun s : κ → ℝ => fun k => index p hp (s k)) (vector_measurePreserving p hp)
simpa only [pi_uniformOn_univ, VertexCover.Cube.blockLaw] using h
theorem block_rounding_error_ae {ι κ : Type*} [Fintype ι] [Fintype κ]
(p : ℕ) (hp : 0 < p) :
∀ᵐ s ∂VertexCover.Cube.blockLaw ι κ, ∀ j k,
|s j k - midpoint p (index p hp (s j k))| ≤ 1/p := by
apply ae_all_iff.mpr
intro j
apply ae_all_iff.mpr
intro k
have h1 := measurePreserving_eval (fun _ : ι => VertexCover.Cube.law κ) j
have h2 := measurePreserving_eval (fun _ : κ => VertexCover.Cube.intervalLaw) k
exact (h2.comp h1).quasiMeasurePreserving.ae (rounding_error_ae p hp)
theorem midpoint_eq_gridRational (d : ℕ) (i : Fin (2*d+1)) :
midpoint (2*d+1) i = (VertexCover.LabelCover.gridRational d i : ℝ) := by
have hn : (2*(d:ℝ)+1) ≠ 0 := by positivity
simp only [midpoint, VertexCover.LabelCover.gridRational]
push_cast
field_simp
ring
end VertexCover.GridCoupling
namespace VertexCover.LabelCover
open MeasureTheory ProbabilityTheory
noncomputable def continuousSumCLM (Φ : LabelCover) {d : ℕ} (seed : Φ.Seeds d) :
(Fin d → Fin (Φ.WeightDimension d) → ℝ) →L[ℝ] (Φ.Coordinate d → ℝ) :=
LinearMap.toContinuousLinearMap {
toFun := Φ.continuousSum seed
map_add' := by
intro s t
simp only [continuousSum, Pi.add_apply, Φ.increment_add, Finset.sum_add_distrib]
map_smul' := by
intro a s
change (∑ j, Φ.increment (Φ.query seed j) (fun k => a*s j k)) = _
simp only [Φ.increment_mul]
ext p
simp [continuousSum, Finset.mul_sum]
}
theorem separator_continuousSum_continuous (Φ : LabelCover) {d : ℕ}
(A : Finset (Φ.Coordinate d → ℝ)) (hA : A.Nonempty) (seed : Φ.Seeds d) :
Continuous (fun s => Φ.separator A hA (Φ.continuousSum seed s)) :=
(Φ.separator_continuous A hA).comp (Φ.continuousSumCLM seed).continuous
theorem separator_continuousSum_mean_zero (Φ : LabelCover) {d : ℕ}
(A : Finset (Φ.Coordinate d → ℝ)) (hA : A.Nonempty) (seed : Φ.Seeds d) :
(∫ s, Φ.separator A hA (Φ.continuousSum seed s)
∂VertexCover.Cube.blockLaw (Fin d) (Fin (Φ.WeightDimension d))) = 0 := by
have h := integral_neg_eq_self
(fun s => Φ.separator A hA (Φ.continuousSum seed s))
(VertexCover.Cube.blockLaw (Fin d) (Fin (Φ.WeightDimension d)))
simp only [Φ.separator_continuousSum_odd, integral_neg] at h
linarith
noncomputable def roundedVertex (Φ : LabelCover) {d : ℕ} (seed : Φ.Seeds d)
(s : Fin d → Fin (Φ.WeightDimension d) → ℝ) : Φ.Vertex d :=
(seed, fun j k => VertexCover.GridCoupling.index (2*d+1) (by omega) (s j k))
theorem separator_rounding_error_ae (Φ : LabelCover) {d : ℕ}
(A : Finset (Φ.Coordinate d → ℝ)) (hA : A.Nonempty) (seed : Φ.Seeds d) :
∀ᵐ s ∂VertexCover.Cube.blockLaw (Fin d) (Fin (Φ.WeightDimension d)),
|Φ.separator A hA (Φ.continuousSum seed s) -
Φ.separator A hA (Φ.sumVector (Φ.roundedVertex seed s))| ≤
(d:ℝ)/(2*d+1) := by
filter_upwards [VertexCover.GridCoupling.block_rounding_error_ae
(ι := Fin d) (κ := Fin (Φ.WeightDimension d)) (2*d+1) (by omega)] with s hs
apply (Φ.separator_lipschitz A hA _ _).trans
rw [Φ.sumVector_eq_continuousSum]
have h := Φ.continuousSum_close seed s
(fun j k => (gridRational d ((Φ.roundedVertex seed s).2 j k) : ℝ))
(b := 1/(2*d+1)) (by positivity) (by
intro j k
simpa only [roundedVertex, ← VertexCover.GridCoupling.midpoint_eq_gridRational,
Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using hs j k)
simpa only [div_eq_mul_inv, one_mul, roundedVertex] using h
end VertexCover.LabelCover
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end OAI
|