File size: 9,233 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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
import Mathlib
import OAI.Probability.LatticeSurface.Coercivity.SparseAmbient
import OAI.Probability.LatticeSurface.Coercivity.SparseColor
import OAI.Probability.LatticeSurface.Coercivity.SparseGradients
import OAI.Probability.LatticeSurface.Coercivity.SparseModel
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
import OAI.Probability.LatticeSurface.Moments.OrderedGradients

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

end SparseBlocks

namespace SparseBlocks

attribute [local instance] Classical.propDecidable

end SparseBlocks

namespace SparseBlocks

attribute [local instance] Classical.propDecidable

end SparseBlocks

namespace ExtremalEdges

attribute [local instance] Classical.propDecidable

end ExtremalEdges

namespace SparseBlocks

attribute [local instance] Classical.propDecidable

end SparseBlocks

namespace SparseBlocks

attribute [local instance] Classical.propDecidable

local instance (sort : Sort*) : DecidableEq sort := Classical.typeDecidableEq sort

def sites (L : ℕ) (z : Vertex) : Finset Vertex :=
  Finset.Icc ((L:ℤ)*(z.1-1)) ((L:ℤ)*(z.1+2)) ×ˢ
    Finset.Icc ((L:ℤ)*(z.2-1)) ((L:ℤ)*(z.2+2))

@[simp] lemma mem_sites (L : ℕ) (z x : Vertex) : x ∈ sites L z ↔
    (L:ℤ)*(z.1-1) ≤ x.1 ∧ x.1 ≤ (L:ℤ)*(z.1+2) ∧
    (L:ℤ)*(z.2-1) ≤ x.2 ∧ x.2 ≤ (L:ℤ)*(z.2+2) := by
  simp only [sites,Finset.mem_product,Finset.mem_Icc]
  tauto

lemma mem_enlarged (p : Parameters) (z x : Vertex) :
    x ∈ enlarged p z ↔ x ∈ sites p.L z := (mem_sites p.L z x).symm

def origin (L : ℕ) (z : Vertex) : Vertex := ((L:ℤ)*(z.1-1),(L:ℤ)*(z.2-1))

def translate (L : ℕ) (z : Vertex) (x : TriangularLipschitz.BoxVertex (3*L)) : Vertex :=
  x.val + origin L z

lemma translate_injective (L : ℕ) (z : Vertex) : Function.Injective (translate L z) := by
  intro x y hxy
  exact Subtype.ext (add_right_cancel hxy)

lemma translate_mem (L : ℕ) (z : Vertex) (x : TriangularLipschitz.BoxVertex (3*L)) :
    translate L z x ∈ sites L z := by
  have hx := TriangularLipschitz.mem_box.mp x.property
  simp only [translate,origin,mem_sites,Prod.add_def]
  push_cast at hx
  simp only [mul_sub,mul_add,mul_one,mul_two]
  constructor <;> omega

lemma translate_surj (L : ℕ) (z : Vertex) (x : Vertex) (hx : x ∈ sites L z) :
    ∃ y, translate L z y = x := by
  have hx' := (mem_sites L z x).mp hx
  let y : TriangularLipschitz.BoxVertex (3*L) := ⟨x-origin L z,by
    simp only [TriangularLipschitz.mem_box,origin,Prod.sub_def]
    push_cast
    simp only [mul_sub,mul_add,mul_one,mul_two] at hx' ⊢
    constructor <;> constructor <;> omega⟩
  refine ⟨y,?_⟩
  simp [translate,y]

lemma translate_adj (L : ℕ) (z : Vertex) (x y : TriangularLipschitz.BoxVertex (3*L)) :
    Adj (translate L z x) (translate L z y) ↔ TriangularLipschitz.Adj x.val y.val := by
  have hh := adj_sub (translate L z x) (translate L z y) (origin L z)
  simpa only [Adj,TriangularLipschitz.Adj] using (show Adj (translate L z x) (translate L z y) ↔ Adj x.val y.val from by simpa only [translate,add_sub_cancel_right] using hh.symm)

lemma translate_dist (L : ℕ) (z : Vertex) (x y : TriangularLipschitz.BoxVertex (3*L)) :
    latticeDist (translate L z x) (translate L z y) =
      TriangularLipschitz.latticeDist x.val y.val := by
  simp only [latticeDist,TriangularLipschitz.latticeDist,translate,Prod.add_def,
    Int.cast_add,add_sub_add_right_eq_sub]

lemma card_sites (L : ℕ) (z : Vertex) : (sites L z).card = (3*L+1)^2 := by
  simp only [sites,Finset.card_product,Int.card_Icc]
  have hh (a : ℤ) : ((L:ℤ)*(a+2)+1-(L:ℤ)*(a-1)).toNat = 3*L+1 := by
    have he : (L:ℤ)*(a+2)+1-(L:ℤ)*(a-1) = (3*L+1 : ℕ) := by push_cast;ring
    rw [he,Int.toNat_natCast]
  rw [hh,hh,pow_two]

lemma sites_disjoint {L : ℕ} (hL : 0 < L) {z w : Vertex}
    (hzw : 3 < |z.1-w.1| ∨ 3 < |z.2-w.2|) : Disjoint (sites L z) (sites L w) := by
  apply Finset.disjoint_left.mpr
  intro x hx hy
  have hx' := (mem_sites L z x).mp hx
  have hy' := (mem_sites L w x).mp hy
  have hL' : (0:ℤ) < L := by exact_mod_cast hL
  rcases hzw with h | h
  all_goals simp only [abs_eq_max_neg] at h
  · have hh : z.1-w.1 > 3 ∨ w.1-z.1 > 3 := by omega
    rcases hh with hh | hh
    · have := mul_lt_mul_of_pos_left (show w.1+2 < z.1-1 by omega) hL'
      omega
    · have := mul_lt_mul_of_pos_left (show z.1+2 < w.1-1 by omega) hL'
      omega
  · have hh : z.2-w.2 > 3 ∨ w.2-z.2 > 3 := by omega
    rcases hh with hh | hh
    · have := mul_lt_mul_of_pos_left (show w.2+2 < z.2-1 by omega) hL'
      omega
    · have := mul_lt_mul_of_pos_left (show z.2+2 < w.2-1 by omega) hL'
      omega

lemma L_pos (p : Parameters) : 0 < p.L := by
  have hδ : 0 < p.δ₀ := p.δpos.trans_le p.δle
  have hk : (0:ℝ) < (p.k₀:ℝ)+2 := by positivity
  have hh := (div_pos (mul_pos (by norm_num) hk) hδ).trans_le p.Llarge
  exact_mod_cast hh

lemma block_subset_sites (p : Parameters) (z : Vertex) : block p z ⊆ (sites p.L z : Set Vertex) := by
  intro x hx
  have hL : (0:ℤ) ≤ p.L := Int.natCast_nonneg _
  change _ ∧ _ ∧ _ ∧ _ at hx
  apply (mem_sites p.L z x).mpr
  have h1 := mul_le_mul_of_nonneg_left (show z.1-1 ≤ z.1 by omega) hL
  have h2 := mul_le_mul_of_nonneg_left (show z.1+1 ≤ z.1+2 by omega) hL
  have h3 := mul_le_mul_of_nonneg_left (show z.2-1 ≤ z.2 by omega) hL
  have h4 := mul_le_mul_of_nonneg_left (show z.2+1 ≤ z.2+2 by omega) hL
  omega

lemma face_neighbor_sites (p : Parameters) (z : Vertex) (i : Fin 4) :
    face p z i ∈ sites p.L z ∧ neighbor p z i ∈ sites p.L z ∧
      Adj (neighbor p z i) (face p z i) := by
  have hL : (0:ℤ) < p.L := by exact_mod_cast L_pos p
  have hhalf : (0:ℤ) ≤ (p.L:ℤ)/2 ∧ (p.L:ℤ)/2 ≤ p.L := by omega
  fin_cases i <;>
    norm_num [face,neighbor,mem_sites,Adj,Prod.mk.injEq,Fin.ext_iff,mul_add,mul_sub,mul_one,mul_two] <;>
    omega

end SparseBlocks

end
end
end
end

end OAI