File size: 8,958 Bytes
dd14c26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
import Mathlib
import OAI.Probability.LatticeSurface.Coercivity.SparseColor
import OAI.Probability.LatticeSurface.Coercivity.SparseParameters
import OAI.Probability.LatticeSurface.Convexity.BoundedBase
import OAI.Probability.LatticeSurface.Convexity.BrunnMinkowski
import OAI.Probability.LatticeSurface.Convexity.CubePrekopa
import OAI.Probability.LatticeSurface.Convexity.GradientWindows
import OAI.Probability.LatticeSurface.Convexity.QuantileTransport
import OAI.Probability.LatticeSurface.Convexity.WeightedPrekopa
import OAI.Probability.LatticeSurface.Dynamics.DisplacementInequality
import OAI.Probability.LatticeSurface.Geometry.BlockVolume
import OAI.Probability.LatticeSurface.Geometry.CapCentral
import OAI.Probability.LatticeSurface.Geometry.CapCompact
import OAI.Probability.LatticeSurface.Geometry.CapContract
import OAI.Probability.LatticeSurface.Geometry.CapCoordinates
import OAI.Probability.LatticeSurface.Geometry.CapMatching
import OAI.Probability.LatticeSurface.Geometry.CapOrient
import OAI.Probability.LatticeSurface.Geometry.CapReflection
import OAI.Probability.LatticeSurface.Geometry.CapSmall
import OAI.Probability.LatticeSurface.Geometry.CapSplit
import OAI.Probability.LatticeSurface.Geometry.CapUnpin
import OAI.Probability.LatticeSurface.Geometry.CapWeld
import OAI.Probability.LatticeSurface.Geometry.TriangularCover
import OAI.Probability.LatticeSurface.Geometry.TriangularGeometry
import OAI.Probability.LatticeSurface.Moments.ControlledGradients

namespace OAI

open Set MeasureTheory Filter

open scoped Topology

noncomputable section

namespace FacetVolume

end FacetVolume

namespace ExtremalEdges

open scoped ENNReal

end ExtremalEdges

noncomputable section

open MeasureTheory Set

open scoped ENNReal

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V : Type*}

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V : Type*}

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V : Type*}

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V : Type*}

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V : Type*}

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V : Type*}

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V : Type*}

end ExtremalEdges

noncomputable section

namespace ExtremalEdges

open Finset

variable {V I : Type*} [Fintype V] [Fintype I]

attribute [local instance] Classical.propDecidable

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V I : Type*} [Fintype V] [Fintype I]

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

end ExtremalEdges

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

variable {V : Type*} [Fintype V]

end ExtremalEdges

open MeasureTheory

open scoped ENNReal

noncomputable section

namespace TriangularLipschitz

end TriangularLipschitz

namespace SparseBlocks

attribute [local instance] Classical.propDecidable

def Adj (x y : Vertex) : Prop :=
  y = (x.1+1,x.2) ∨ y = (x.1-1,x.2) ∨
  y = (x.1,x.2+1) ∨ y = (x.1,x.2-1) ∨
  y = (x.1+1,x.2-1) ∨ y = (x.1-1,x.2+1)

def latticeDist (x y : Vertex) : ℝ :=
  max (max |(x.1 : ℝ)-y.1| |(x.2 : ℝ)-y.2|)
    |((x.1 : ℝ)-y.1)+((x.2 : ℝ)-y.2)|

def height (V : Finset Vertex) (h : V → ℝ) (x : Vertex) : ℝ :=
  if hx : x ∈ V then h ⟨x,hx⟩ else 0

def body (V : Finset Vertex) : Set (V → ℝ) :=
  {h | ∀ x y, Adj x y → |height V h x-height V h y| ≤ 1}

def block (p : Parameters) (z : Vertex) : Set Vertex :=
  {x | (p.L:ℤ)*z.1 ≤ x.1 ∧ x.1 ≤ (p.L:ℤ)*(z.1+1) ∧
       (p.L:ℤ)*z.2 ≤ x.2 ∧ x.2 ≤ (p.L:ℤ)*(z.2+1)}

def enlarged (p : Parameters) (z : Vertex) : Set Vertex :=
  {x | (p.L:ℤ)*(z.1-1) ≤ x.1 ∧ x.1 ≤ (p.L:ℤ)*(z.1+2) ∧
       (p.L:ℤ)*(z.2-1) ≤ x.2 ∧ x.2 ≤ (p.L:ℤ)*(z.2+2)}

def face (p : Parameters) (z : Vertex) (i : Fin 4) : Vertex :=
  let a := (p.L:ℤ)*z.1; let b := (p.L:ℤ)*z.2; let n : ℤ := p.L/2
  if i = 0 then (a,b+n) else if i = 1 then (a+p.L,b+n)
  else if i = 2 then (a+n,b) else (a+n,b+p.L)

def neighbor (p : Parameters) (z : Vertex) (i : Fin 4) : Vertex :=
  let v := face p z i
  if i = 0 then (v.1,v.2+1) else if i = 1 then (v.1,v.2-1)
  else if i = 2 then (v.1+1,v.2) else (v.1-1,v.2)

def bad (p : Parameters) (V : Finset Vertex) (h : V → ℝ) (z : Vertex) : Prop :=
  enlarged p z ⊆ (V : Set Vertex) ∧
  ((∃ x ∈ block p z, ∃ y ∈ block p z, Adj x y ∧
      1-p.δ < |height V h x-height V h y|) ∨
   (∃ x ∈ enlarged p z, ∃ y ∈ enlarged p z, p.k₀ ≤ latticeDist x y ∧
      (1-p.δ₀)*latticeDist x y < |height V h x-height V h y|) ∨
   (∃ i : Fin 4, |height V h (neighbor p z i)-height V h (face p z i)| < p.s₀))

def thickBad (p : Parameters) (V : Finset Vertex) (h : V → ℝ)
    (m : ℕ) (z : Vertex) : Prop :=
  ∃ w, |w.1-z.1| ≤ m ∧ |w.2-z.2| ≤ m ∧ bad p V h w

end SparseBlocks

namespace SparseBlocks

attribute [local instance] Classical.propDecidable

lemma adj_symm {x y : Vertex} (h : Adj x y) : Adj y x :=
  TriangularLipschitz.adj_symm h

lemma adj_ne {x y : Vertex} (h : Adj x y) : x ≠ y :=
  TriangularLipschitz.adj_ne h

def finiteGraph (B : Finset Vertex) : SimpleGraph B :=
  TriangularLipschitz.latticeGraph.induce (B : Set Vertex)

def fixed (B V : Finset Vertex) : Set B := {x | x.val ∉ V}

def indexEquiv (B V : Finset Vertex) (hVB : V ⊆ B) : V ≃ ExtremalEdges.Free (fixed B V) where
  toFun x := ⟨⟨x,hVB x.property⟩, by simp [fixed]⟩
  invFun x := ⟨x.val.val, by simpa [fixed] using x.property⟩
  left_inv _ := rfl
  right_inv _ := rfl

def coordinates (B V : Finset Vertex) (hVB : V ⊆ B) :
    (V → ℝ) ≃ᵐ (ExtremalEdges.Free (fixed B V) → ℝ) :=
  MeasurableEquiv.piCongrLeft (fun _ : ExtremalEdges.Free (fixed B V) => ℝ) (indexEquiv B V hVB)

lemma preserving_coordinates (B V : Finset Vertex) (hVB : V ⊆ B) :
    MeasurePreserving (coordinates B V hVB) :=
  volume_measurePreserving_piCongrLeft _ (indexEquiv B V hVB)

lemma coordinates_height (B V : Finset Vertex) (hVB : V ⊆ B)
    (h : V → ℝ) (x : B) :
    ExtremalEdges.height (fixed B V) (coordinates B V hVB h) x = height V h x.val := by
  by_cases hx : x.val ∈ V
  · have hxp : x ∉ fixed B V := by intro hxp; exact hxp hx
    rw [ExtremalEdges.height, dite_eq_right hxp, height, dite_eq_left hx]
    change (Equiv.piCongrLeft (fun _ : ExtremalEdges.Free (fixed B V) => ℝ)
      (indexEquiv B V hVB)) h ⟨x, by simpa [fixed] using hx⟩ = h ⟨x.val,hx⟩
    rw [Equiv.piCongrLeft_apply_eq_cast]
    rfl
  · simp [ExtremalEdges.height, fixed, height, hx]

lemma body_coordinates (B V : Finset Vertex) (hVB : V ⊆ B)
    (hcollar : ∀ x ∈ V, ∀ y, Adj x y → y ∈ B) :
    (coordinates B V hVB) ⁻¹' ExtremalEdges.body (finiteGraph B) (fixed B V) = body V := by
  ext h
  constructor
  · intro hh x y hxy
    by_cases hx : x ∈ V
    · have hyB := hcollar x hx y hxy
      have hb := hh ⟨x,hVB hx⟩ ⟨y,hyB⟩ (show (finiteGraph B).Adj _ _ from hxy)
      simpa only [coordinates_height] using hb
    · by_cases hy : y ∈ V
      · have hxB := hcollar y hy x (adj_symm hxy)
        have hb := hh ⟨x,hxB⟩ ⟨y,hVB hy⟩ (show (finiteGraph B).Adj _ _ from hxy)
        simpa only [coordinates_height] using hb
      · simp [height,hx,hy]
  · intro hh x y hxy
    simpa only [coordinates_height] using hh x.val y.val hxy

lemma continuous_height (V : Finset Vertex) (x : Vertex) :
    Continuous (fun h : V → ℝ => height V h x) := by
  unfold height
  split_ifs with hx
  · exact continuous_apply (⟨x,hx⟩ : V)
  · exact continuous_const

lemma closed_body (V : Finset Vertex) : IsClosed (body V) := by
  simp only [body, Set.ofPred_forall]
  exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_iInter fun _ =>
    isClosed_le ((continuous_height V x).sub (continuous_height V y)).abs continuous_const

lemma volume_body_coordinates (B V : Finset Vertex) (hVB : V ⊆ B)
    (hcollar : ∀ x ∈ V, ∀ y, Adj x y → y ∈ B) :
    volume (ExtremalEdges.body (finiteGraph B) (fixed B V)) = volume (body V) := by
  rw [← body_coordinates B V hVB hcollar]
  exact ((preserving_coordinates B V hVB).measure_preimage
    (ExtremalEdges.closed_conditionalBody (finiteGraph B) (fixed B V) (fun _ => 0)).measurableSet.nullMeasurableSet).symm

end SparseBlocks

end
end
end
end

end OAI