@@ -19,9 +19,9 @@ This file contains results about bases in normed affine spaces.
19
19
20
20
* `continuous_barycentric_coord`
21
21
* `is_open_map_barycentric_coord`
22
- * `interior_convex_hull_aff_basis `
22
+ * `affine_basis.interior_convex_hull `
23
23
* `exists_subset_affine_independent_span_eq_top_of_open`
24
- * `interior_convex_hull_nonempty_iff_aff_span_eq_top `
24
+ * `interior_convex_hull_nonempty_iff_affine_span_eq_top `
25
25
-/
26
26
27
27
section barycentric
@@ -54,9 +54,9 @@ to this basis.
54
54
55
55
TODO Restate this result for affine spaces (instead of vector spaces) once the definition of
56
56
convexity is generalised to this setting. -/
57
- lemma interior_convex_hull_aff_basis {ι E : Type *} [finite ι] [normed_add_comm_group E]
57
+ lemma affine_basis.interior_convex_hull {ι E : Type *} [finite ι] [normed_add_comm_group E]
58
58
[normed_space ℝ E] (b : affine_basis ι ℝ E) :
59
- interior (convex_hull ℝ (range b.points)) = { x | ∀ i, 0 < b.coord i x } :=
59
+ interior (convex_hull ℝ (range b.points)) = {x | ∀ i, 0 < b.coord i x} :=
60
60
begin
61
61
casesI subsingleton_or_nontrivial ι,
62
62
{ -- The zero-dimensional case.
66
66
{ -- The positive-dimensional case.
67
67
haveI : finite_dimensional ℝ E := b.finite_dimensional,
68
68
have : convex_hull ℝ (range b.points) = ⋂ i, (b.coord i)⁻¹' Ici 0 ,
69
- { rw convex_hull_affine_basis_eq_nonneg_barycentric b, ext, simp, },
69
+ { rw [ convex_hull_affine_basis_eq_nonneg_barycentric b, set_of_forall], refl },
70
70
ext,
71
71
simp only [this , interior_Inter, ← is_open_map.preimage_interior_eq_interior_preimage
72
72
(is_open_map_barycentric_coord b _) (continuous_barycentric_coord b _),
@@ -81,77 +81,77 @@ open affine_map
81
81
82
82
/-- Given a set `s` of affine-independent points belonging to an open set `u`, we may extend `s` to
83
83
an affine basis, all of whose elements belong to `u`. -/
84
- lemma exists_subset_affine_independent_span_eq_top_of_open {s u : set P} (hu : is_open u)
84
+ lemma is_open.exists_between_affine_independent_span_eq_top {s u : set P} (hu : is_open u)
85
85
(hsu : s ⊆ u) (hne : s.nonempty) (h : affine_independent ℝ (coe : s → P)) :
86
86
∃ t : set P, s ⊆ t ∧ t ⊆ u ∧ affine_independent ℝ (coe : t → P) ∧ affine_span ℝ t = ⊤ :=
87
87
begin
88
88
obtain ⟨q, hq⟩ := hne,
89
- obtain ⟨ε, hε , hεu⟩ := metric.is_open_iff.mp hu q ( hsu hq),
89
+ obtain ⟨ε, ε 0 , hεu⟩ := metric.nhds_basis_closed_ball.mem_iff. 1 (hu.mem_nhds $ hsu hq),
90
90
obtain ⟨t, ht₁, ht₂, ht₃⟩ := exists_subset_affine_independent_affine_span_eq_top h,
91
- let f : P → P := λ y, line_map q y (ε / 2 / ( dist y q) ),
91
+ let f : P → P := λ y, line_map q y (ε / dist y q),
92
92
have hf : ∀ y, f y ∈ u,
93
- { intros y,
94
- apply hεu,
95
- simp only [metric.mem_ball, f, line_map_apply, dist_vadd_left, norm_smul, real.norm_eq_abs,
96
- dist_eq_norm_vsub V y q],
97
- cases eq_or_ne (∥y -ᵥ q∥) 0 with hyq hyq, { rwa [hyq, mul_zero], },
98
- rw [← norm_pos_iff, norm_norm] at hyq,
99
- calc abs (ε / 2 / ∥y -ᵥ q∥) * ∥y -ᵥ q∥
100
- = ε / 2 / ∥y -ᵥ q∥ * ∥y -ᵥ q∥ : by rw [abs_div, abs_of_pos (half_pos hε), abs_of_pos hyq]
101
- ... = ε / 2 : div_mul_cancel _ (ne_of_gt hyq)
102
- ... < ε : half_lt_self hε, },
103
- have hεyq : ∀ (y ∉ s), ε / 2 / dist y q ≠ 0 ,
104
- { simp only [ne.def, div_eq_zero_iff, or_false, dist_eq_zero, bit0_eq_zero, one_ne_zero,
105
- not_or_distrib, ne_of_gt hε, true_and, not_false_iff],
106
- exact λ y h1 h2, h1 (h2.symm ▸ hq) },
93
+ { refine λ y, hεu _,
94
+ simp only [f],
95
+ rw [metric.mem_closed_ball, line_map_apply, dist_vadd_left, norm_smul, real.norm_eq_abs,
96
+ dist_eq_norm_vsub V y q, abs_div, abs_of_pos ε0 , abs_of_nonneg (norm_nonneg _), div_mul_comm],
97
+ exact mul_le_of_le_one_left ε0 .le (div_self_le_one _) },
98
+ have hεyq : ∀ y ∉ s, ε / dist y q ≠ 0 ,
99
+ from λ y hy, div_ne_zero ε0 .ne' (dist_ne_zero.2 (ne_of_mem_of_not_mem hq hy).symm),
107
100
classical,
108
101
let w : t → ℝˣ := λ p, if hp : (p : P) ∈ s then 1 else units.mk0 _ (hεyq ↑p hp),
109
102
refine ⟨set.range (λ (p : t), line_map q p (w p : ℝ)), _, _, _, _⟩,
110
103
{ intros p hp, use ⟨p, ht₁ hp⟩, simp [w, hp], },
111
- { intros y hy,
112
- simp only [set.mem_range, set_coe.exists, subtype.coe_mk] at hy,
113
- obtain ⟨p, hp, hyq⟩ := hy,
114
- by_cases hps : p ∈ s;
115
- simp only [w, hps, line_map_apply_one, units.coe_mk0, dif_neg, dif_pos, not_false_iff,
116
- units.coe_one, subtype.coe_mk] at hyq;
117
- rw ← hyq;
118
- [exact hsu hps, exact hf p], },
104
+ { rintros y ⟨⟨p, hp⟩, rfl⟩,
105
+ by_cases hps : p ∈ s; simp only [w, hps, line_map_apply_one, units.coe_mk0, dif_neg, dif_pos,
106
+ not_false_iff, units.coe_one, subtype.coe_mk];
107
+ [exact hsu hps, exact hf p], },
119
108
{ exact (ht₂.units_line_map ⟨q, ht₁ hq⟩ w).range, },
120
109
{ rw [affine_span_eq_affine_span_line_map_units (ht₁ hq) w, ht₃], },
121
110
end
122
111
123
- lemma interior_convex_hull_nonempty_iff_aff_span_eq_top [finite_dimensional ℝ V] {s : set V} :
112
+ lemma is_open.exists_subset_affine_independent_span_eq_top {u : set P} (hu : is_open u)
113
+ (hne : u.nonempty) :
114
+ ∃ s ⊆ u, affine_independent ℝ (coe : s → P) ∧ affine_span ℝ s = ⊤ :=
115
+ begin
116
+ rcases hne with ⟨x, hx⟩,
117
+ rcases hu.exists_between_affine_independent_span_eq_top (singleton_subset_iff.mpr hx)
118
+ (singleton_nonempty _) (affine_independent_of_subsingleton _ _) with ⟨s, -, hsu, hs⟩,
119
+ exact ⟨s, hsu, hs⟩
120
+ end
121
+
122
+ /-- The affine span of a nonempty open set is `⊤`. -/
123
+ lemma is_open.affine_span_eq_top {u : set P} (hu : is_open u) (hne : u.nonempty) :
124
+ affine_span ℝ u = ⊤ :=
125
+ let ⟨s, hsu, hs, hs'⟩ := hu.exists_subset_affine_independent_span_eq_top hne
126
+ in top_unique $ hs' ▸ affine_span_mono _ hsu
127
+
128
+ lemma affine_span_eq_top_of_nonempty_interior {s : set V}
129
+ (hs : (interior $ convex_hull ℝ s).nonempty) :
130
+ affine_span ℝ s = ⊤ :=
131
+ top_unique $ is_open_interior.affine_span_eq_top hs ▸
132
+ (affine_span_mono _ interior_subset).trans_eq (affine_span_convex_hull _)
133
+
134
+ lemma affine_basis.centroid_mem_interior_convex_hull {ι} [fintype ι] (b : affine_basis ι ℝ V) :
135
+ finset.univ.centroid ℝ b.points ∈ interior (convex_hull ℝ (range b.points)) :=
136
+ begin
137
+ haveI := b.nonempty,
138
+ simp only [b.interior_convex_hull, mem_set_of_eq, b.coord_apply_centroid (finset.mem_univ _),
139
+ inv_pos, nat.cast_pos, finset.card_pos, finset.univ_nonempty, forall_true_iff]
140
+ end
141
+
142
+ lemma interior_convex_hull_nonempty_iff_affine_span_eq_top [finite_dimensional ℝ V] {s : set V} :
124
143
(interior (convex_hull ℝ s)).nonempty ↔ affine_span ℝ s = ⊤ :=
125
144
begin
126
- split,
127
- { rintros ⟨x, hx⟩,
128
- obtain ⟨u, hu₁, hu₂, hu₃⟩ := mem_interior.mp hx,
129
- let t : set V := {x},
130
- obtain ⟨b, hb₁, hb₂, hb₃, hb₄⟩ := exists_subset_affine_independent_span_eq_top_of_open hu₂
131
- (singleton_subset_iff.mpr hu₃) (singleton_nonempty x)
132
- (affine_independent_of_subsingleton ℝ (coe : t → V)),
133
- rw [eq_top_iff, ← hb₄, ← affine_span_convex_hull s],
134
- mono,
135
- exact hb₂.trans hu₁, },
136
- { intros h,
137
- obtain ⟨t, hts, h_tot, h_ind⟩ := exists_affine_independent ℝ V s,
138
- suffices : (interior (convex_hull ℝ (range (coe : t → V)))).nonempty,
139
- { rw [subtype.range_coe_subtype, set_of_mem_eq] at this ,
140
- apply nonempty.mono _ this ,
141
- mono* },
142
- haveI : fintype t := fintype_of_fin_dim_affine_independent ℝ h_ind,
143
- use finset.centroid ℝ (finset.univ : finset t) (coe : t → V),
144
- rw [h, ← @set_of_mem_eq V t, ← subtype.range_coe_subtype] at h_tot,
145
- let b : affine_basis t ℝ V := ⟨coe, h_ind, h_tot⟩,
146
- rw interior_convex_hull_aff_basis b,
147
- have htne : (finset.univ : finset t).nonempty,
148
- { simpa [finset.univ_nonempty_iff] using
149
- affine_subspace.nonempty_of_affine_span_eq_top ℝ V V h_tot, },
150
- simp [finset.centroid_def, b.coord_apply_combination_of_mem (finset.mem_univ _)
151
- (finset.sum_centroid_weights_eq_one_of_nonempty ℝ (finset.univ : finset t) htne),
152
- finset.centroid_weights_apply, nat.cast_pos, inv_pos, finset.card_pos.mpr htne], },
145
+ refine ⟨affine_span_eq_top_of_nonempty_interior, λ h, _⟩,
146
+ obtain ⟨t, hts, b, hb⟩ := affine_basis.exists_affine_subbasis h,
147
+ suffices : (interior (convex_hull ℝ (range b.points))).nonempty,
148
+ { rw [hb, subtype.range_coe_subtype, set_of_mem_eq] at this ,
149
+ refine this.mono _,
150
+ mono* },
151
+ lift t to finset V using b.finite_set,
152
+ exact ⟨_, b.centroid_mem_interior_convex_hull⟩
153
153
end
154
154
155
155
lemma convex.interior_nonempty_iff_affine_span_eq_top [finite_dimensional ℝ V] {s : set V}
156
156
(hs : convex ℝ s) : (interior s).nonempty ↔ affine_span ℝ s = ⊤ :=
157
- by rw [← interior_convex_hull_nonempty_iff_aff_span_eq_top , hs.convex_hull_eq]
157
+ by rw [← interior_convex_hull_nonempty_iff_affine_span_eq_top , hs.convex_hull_eq]
0 commit comments