File size: 1,774 Bytes
8e4d533
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import Mathlib
import OAI.Geometry.Cannon.Modulus.Weights

namespace OAI

section
section
section
noncomputable section
section
section
section
section
section
open Set Topology
open Set Metric Topology
open Set Topology Filter Metric unitInterval
open scoped InnerProductSpace

namespace CannonCells

open Set

variable {X ι : Type*} [Fintype ι]

noncomputable def cost (C : ι → Set X) (w : ι → ℝ) (A : Set X) : ℝ :=
  ∑ i ∈ indices C A, w i

lemma cost_nonneg (C : ι → Set X) {w : ι → ℝ} (hw : ∀ i, 0 ≤ w i) (A : Set X) :
    0 ≤ cost C w A := Finset.sum_nonneg (fun i _ => hw i)

lemma indices_mono (C : ι → Set X) {A B : Set X} (h : A ⊆ B) : indices C A ⊆ indices C B := by
  intro i hi
  obtain ⟨x,hx,hxi⟩ := (mem_indices C A i).mp hi
  exact (mem_indices C B i).mpr ⟨x,h hx,hxi⟩

lemma cost_mono (C : ι → Set X) {w : ι → ℝ} (hw : ∀ i, 0 ≤ w i)
    {A B : Set X} (h : A ⊆ B) : cost C w A ≤ cost C w B := by
  classical
  exact Finset.sum_le_sum_of_subset_of_nonneg (indices_mono C h) (fun i _ _ => hw i)

lemma indices_union [DecidableEq ι] (C : ι → Set X) (A B : Set X) :
    indices C (A ∪ B) = indices C A ∪ indices C B := by
  classical
  ext i
  simp only [mem_indices,Finset.mem_union,union_inter_distrib_right,union_nonempty]

lemma cost_union_le (C : ι → Set X) {w : ι → ℝ} (hw : ∀ i, 0 ≤ w i) (A B : Set X) :
    cost C w (A ∪ B) ≤ cost C w A + cost C w B := by
  classical
  unfold cost
  rw [indices_union]
  have h := Finset.sum_union_inter (s₁ := indices C A) (s₂ := indices C B) (f := w)
  have hn : 0 ≤ ∑ i ∈ indices C A ∩ indices C B, w i :=
    Finset.sum_nonneg (fun i _ => hw i)
  linarith

end CannonCells

end
end
end
end
end
end
end
end
end

end OAI