File size: 3,986 Bytes
695bd70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Geometry.SingularHomology.SimplexSubdivisionMesh

namespace OAI

noncomputable section

open Set Metric

namespace Problem340.SimplexSubdivision

variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]

def BarycentricCell : (n : ℕ) → (Fin (n + 1) → E) → (Fin (n + 1) → E) → Prop
  | 0, v, w => w = v
  | n + 1, v, w => ∃ i : Fin (n + 2), ∃ u : Fin (n + 1) → E,
      BarycentricCell n (v ∘ i.succAbove) u ∧
        w = Fin.cons (faceCenter v Finset.univ) u

lemma meshRatio_monotone_step (n : ℕ) :
    (n : ℝ) / (n + 1) ≤ (n + 1) / (n + 2) := by
  apply (div_le_div_iff₀ (by positivity) (by positivity)).2
  nlinarith

theorem BarycentricCell.carrier_and_mesh {n : ℕ} {v w : Fin (n + 1) → E}
    (h : BarycentricCell n v w) (D : ℝ) (hD0 : 0 ≤ D)
    (hD : ∀ i j, dist (v i) (v j) ≤ D) :
    Set.range w ⊆ convexHull ℝ (Set.range v) ∧
      ∀ i j, dist (w i) (w j) ≤ ((n : ℝ) / (n + 1)) * D := by
  induction n with
  | zero =>
      change w = v at h
      subst w
      refine ⟨subset_convexHull ℝ _, ?_⟩
      intro i j
      have hij : i = j := Fin.ext (by omega)
      simp [hij]
  | succ n ih =>
      obtain ⟨i, u, hu, rfl⟩ := h
      obtain ⟨hcarrier, hmesh⟩ := ih hu (fun j k => hD _ _)
      have hface : Set.range (v ∘ i.succAbove) ⊆ Set.range v := by
        rintro _ ⟨j, rfl⟩
        exact ⟨i.succAbove j, rfl⟩
      have hchild : Set.range u ⊆ convexHull ℝ (Set.range v) :=
        hcarrier.trans (convexHull_mono hface)
      have hcenter : faceCenter v Finset.univ ∈ convexHull ℝ (Set.range v) := by
        simpa only [Finset.coe_univ, Set.image_univ] using
          faceCenter_mem_convexHull v (Finset.univ_nonempty : (Finset.univ : Finset (Fin (n + 2))).Nonempty)
      have hrad (j : Fin (n + 1)) :
          dist (faceCenter v Finset.univ) (u j) ≤
            (((n + 1 : ℕ) : ℝ) / ((n + 1 : ℕ) + 1)) * D := by
        apply dist_faceCenter_of_mem_convexHull_le_mesh v Finset.univ_nonempty
          (n + 1) (by simp) D hD0 (fun a _ b _ => hD a b)
        simpa only [Finset.coe_univ, Set.image_univ] using hchild (Set.mem_range_self j)
      refine ⟨?_, ?_⟩
      · rintro _ ⟨j, rfl⟩
        refine Fin.cases ?_ (fun k => ?_) j
        · exact hcenter
        · exact hchild (Set.mem_range_self k)
      · intro j k
        refine Fin.cases ?_ (fun j => ?_) j
        · refine Fin.cases ?_ (fun k => ?_) k
          · simp only [Fin.cons_zero, dist_self]
            positivity
          · simpa only [Fin.cons_zero, Fin.cons_succ] using hrad k
        · refine Fin.cases ?_ (fun k => ?_) k
          · simpa only [Fin.cons_zero, Fin.cons_succ, dist_comm] using hrad j
          · simp only [Fin.cons_succ]
            apply (hmesh j k).trans
            apply mul_le_mul_of_nonneg_right _ hD0
            simpa only [Nat.cast_add, Nat.cast_one, add_assoc, one_add_one_eq_two] using
              meshRatio_monotone_step n

theorem BarycentricCell.carrier {n : ℕ} {v w : Fin (n + 1) → E}
    (h : BarycentricCell n v w) : Set.range w ⊆ convexHull ℝ (Set.range v) := by
  exact (h.carrier_and_mesh (Metric.diam (Set.range v)) Metric.diam_nonneg
    (fun i j => Metric.dist_le_diam_of_mem (Set.finite_range v).isBounded
      (Set.mem_range_self i) (Set.mem_range_self j))).1

theorem BarycentricCell.diam_le {n : ℕ} {v w : Fin (n + 1) → E}
    (h : BarycentricCell n v w) :
    Metric.diam (convexHull ℝ (Set.range w)) ≤
      ((n : ℝ) / (n + 1)) * Metric.diam (convexHull ℝ (Set.range v)) := by
  rw [convexHull_diam, convexHull_diam]
  have hmesh := (h.carrier_and_mesh (Metric.diam (Set.range v)) Metric.diam_nonneg
    (fun i j => Metric.dist_le_diam_of_mem (Set.finite_range v).isBounded
      (Set.mem_range_self i) (Set.mem_range_self j))).2
  apply Metric.diam_le_of_forall_dist_le (by positivity)
  rintro _ ⟨i, rfl⟩ _ ⟨j, rfl⟩
  exact hmesh i j

end Problem340.SimplexSubdivision

end

end OAI