File size: 4,754 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
import OAI.Analysis.CircleDomains.Topology.EqualScaleCellSeparation

namespace OAI

/-! Equal-scale three-dimensional cells, colored by sixteen residues
in each coordinate. Enlarged balls in one color are disjoint. -/
open Set Function Metric
noncomputable section
namespace CircleDomainRigidity

abbrev GraphGridColor := (Fin 16 Γ— Fin 16) Γ— Fin 16
abbrev GraphGridIndex := (β„€ Γ— β„€) Γ— β„€
abbrev GraphSpace := (ℝ Γ— ℝ) Γ— ℝ

def graphGridInterval (r : Fin 16) (k : β„€) (s : ℝ) : Set ℝ :=
  Icc ((16*(k:ℝ)+(r:β„•))*s) ((16*(k:ℝ)+(r:β„•)+1)*s)

def graphGridCell (r : GraphGridColor) (k : GraphGridIndex) (s : ℝ) : Set GraphSpace :=
  (graphGridInterval r.1.1 k.1.1 s Γ—Λ’ graphGridInterval r.1.2 k.1.2 s) Γ—Λ’
    graphGridInterval r.2 k.2 s

lemma graphGridCell_dist_gt {s : ℝ} (hs : 0 < s) (r : GraphGridColor)
    {k l : GraphGridIndex} (hkl : k β‰  l) {x y : GraphSpace}
    (hx : x ∈ graphGridCell r k s) (hy : y ∈ graphGridCell r l s) :
    8*s < dist x y := by
  by_cases hβ‚€ : k.1.1 = l.1.1
  Β· by_cases h₁ : k.1.2 = l.1.2
    Β· have hβ‚‚ : k.2 β‰  l.2 := by
        intro h
        exact hkl (Prod.ext (Prod.ext hβ‚€ h₁) h)
      have hh := equal_scale_cell_separation hs hβ‚‚ (r.2:β„•) hx.2 hy.2
      exact hh.trans_le (by
        rw [Prod.dist_eq,Real.dist_eq]
        exact le_max_right _ _)
    Β· have hh := equal_scale_cell_separation hs h₁ (r.1.2:β„•) hx.1.2 hy.1.2
      exact hh.trans_le (by
        rw [Prod.dist_eq,Prod.dist_eq,Real.dist_eq]
        exact (le_max_right _ _).trans (le_max_left _ _))
  Β· have hh := equal_scale_cell_separation hs hβ‚€ (r.1.1:β„•) hx.1.1 hy.1.1
    exact hh.trans_le (by
      rw [Prod.dist_eq,Prod.dist_eq,Real.dist_eq]
      exact (le_max_left _ _).trans (le_max_left _ _))

lemma graphGridCell_enlarged_disjoint {s : ℝ} (hs : 0 < s) (r : GraphGridColor)
    {k l : GraphGridIndex} (hkl : k β‰  l) {x y : GraphSpace}
    (hx : x ∈ graphGridCell r k s) (hy : y ∈ graphGridCell r l s) :
    Disjoint (closedBall x (4*s)) (closedBall y (4*s)) := by
  apply Set.disjoint_left.mpr
  intro z hzx hzy
  have ht := dist_triangle x z y
  rw [dist_comm x z] at ht
  have hle : dist x y ≀ 8*s := by
    linarith [mem_closedBall.mp hzx, mem_closedBall.mp hzy]
  exact (not_lt_of_ge hle) (graphGridCell_dist_gt hs r hkl hx hy)

lemma exists_graphGridInterval {s : ℝ} (hs : 0 < s) (x : ℝ) :
    βˆƒ (r : Fin 16) (k : β„€), x ∈ graphGridInterval r k s := by
  let n : β„€ := Int.floor (x/s)
  have hn0 : 0 ≀ n % 16 := Int.emod_nonneg _ (by norm_num)
  have hn16 : n % 16 < 16 := Int.emod_lt_of_pos _ (by norm_num)
  let r : Fin 16 := ⟨(n%16).toNat,by omega⟩
  refine ⟨r,n/16,?_⟩
  have he : (16:ℝ)*(n/16:β„€)+(r:β„•) = (n:ℝ) := by
    have hr : ((r:β„•):ℝ) = ((n%16:β„€):ℝ) := by
      dsimp only [r]
      exact_mod_cast (Int.natCast_toNat_eq_self.mpr hn0)
    rw [hr]
    have hh : (16:β„€)*(n/16)+n%16 = n := by simpa only [add_comm] using Int.emod_add_mul_ediv n 16
    exact_mod_cast hh
  change (16*(n/16:β„€)+(r:β„•))*s ≀ x ∧ x ≀ (16*(n/16:β„€)+(r:β„•)+1)*s
  rw [he]
  have hlo := (le_div_iffβ‚€ hs).mp (Int.floor_le (x/s))
  have hhi := (div_lt_iffβ‚€ hs).mp (Int.lt_floor_add_one (x/s))
  exact ⟨hlo,hhi.le⟩

lemma exists_graphGridCell {s : ℝ} (hs : 0 < s) (x : GraphSpace) :
    βˆƒ (r : GraphGridColor) (k : GraphGridIndex), x ∈ graphGridCell r k s := by
  obtain ⟨rβ‚€,kβ‚€,hβ‚€βŸ© := exists_graphGridInterval hs x.1.1
  obtain ⟨r₁,k₁,hβ‚βŸ© := exists_graphGridInterval hs x.1.2
  obtain ⟨rβ‚‚,kβ‚‚,hβ‚‚βŸ© := exists_graphGridInterval hs x.2
  exact ⟨((rβ‚€,r₁),rβ‚‚),((kβ‚€,k₁),kβ‚‚),⟨⟨hβ‚€,hβ‚βŸ©,hβ‚‚βŸ©βŸ©

lemma graphGridCell_dist_le {s : ℝ} (r : GraphGridColor) (k : GraphGridIndex)
    {x y : GraphSpace} (hx : x ∈ graphGridCell r k s) (hy : y ∈ graphGridCell r k s) :
    dist x y ≀ s := by
  have hcoord {a x y : ℝ} (hx : x ∈ Icc a (a+s)) (hy : y ∈ Icc a (a+s)) :
      |x-y| ≀ s := abs_le.mpr ⟨by linarith [hx.1,hy.2],by linarith [hx.2,hy.1]⟩
  have hβ‚€ := hcoord (a := (16*(k.1.1:ℝ)+(r.1.1:β„•))*s)
    (by simpa only [graphGridInterval,add_mul,one_mul] using hx.1.1)
    (by simpa only [graphGridInterval,add_mul,one_mul] using hy.1.1)
  have h₁ := hcoord (a := (16*(k.1.2:ℝ)+(r.1.2:β„•))*s)
    (by simpa only [graphGridInterval,add_mul,one_mul] using hx.1.2)
    (by simpa only [graphGridInterval,add_mul,one_mul] using hy.1.2)
  have hβ‚‚ := hcoord (a := (16*(k.2:ℝ)+(r.2:β„•))*s)
    (by simpa only [graphGridInterval,add_mul,one_mul] using hx.2)
    (by simpa only [graphGridInterval,add_mul,one_mul] using hy.2)
  simpa only [Prod.dist_eq,Real.dist_eq,max_le_iff] using And.intro (And.intro hβ‚€ h₁) hβ‚‚

end CircleDomainRigidity

end

end OAI