@@ -28,19 +28,17 @@ section barycentric
28
28
variables {ι 𝕜 E P : Type *} [nondiscrete_normed_field 𝕜] [complete_space 𝕜]
29
29
variables [normed_group E] [normed_space 𝕜 E] [finite_dimensional 𝕜 E]
30
30
variables [metric_space P] [normed_add_torsor E P]
31
- variables {p : ι → P} (h_ind : affine_independent 𝕜 p) (h_tot : affine_span 𝕜 (set.range p) = ⊤ )
31
+ variables (b : affine_basis ι 𝕜 P )
32
32
33
33
@[continuity]
34
- lemma continuous_barycentric_coord (i : ι) : continuous (barycentric_coord h_ind h_tot i) :=
34
+ lemma continuous_barycentric_coord (i : ι) : continuous (b.coord i) :=
35
35
affine_map.continuous_of_finite_dimensional _
36
36
37
37
local attribute [instance] finite_dimensional.complete
38
38
39
39
lemma is_open_map_barycentric_coord [nontrivial ι] (i : ι) :
40
- is_open_map (barycentric_coord h_ind h_tot i) :=
41
- open_mapping_affine
42
- (continuous_barycentric_coord h_ind h_tot i)
43
- (surjective_barycentric_coord h_ind h_tot i)
40
+ is_open_map (b.coord i) :=
41
+ open_mapping_affine (continuous_barycentric_coord b i) (b.surjective_coord i)
44
42
45
43
end barycentric
46
44
@@ -53,27 +51,26 @@ to this basis.
53
51
TODO Restate this result for affine spaces (instead of vector spaces) once the definition of
54
52
convexity is generalised to this setting. -/
55
53
lemma interior_convex_hull_aff_basis {ι E : Type *} [fintype ι] [normed_group E] [normed_space ℝ E]
56
- {p : ι → E} (h_ind : affine_independent ℝ p) (h_tot : affine_span ℝ (range p) = ⊤ ) :
57
- interior (convex_hull ℝ (range p )) = { x | ∀ i, 0 < barycentric_coord h_ind h_tot i x } :=
54
+ (b : affine_basis ι ℝ E ) :
55
+ interior (convex_hull ℝ (range b.points )) = { x | ∀ i, 0 < b.coord i x } :=
58
56
begin
59
57
cases subsingleton_or_nontrivial ι with h h,
60
58
{ -- The zero-dimensional case.
61
59
haveI := h,
62
- suffices : range p = univ, { simp [this ], },
63
- refine affine_subspace.eq_univ_of_subsingleton_span_eq_top _ h_tot ,
60
+ suffices : range (b.points) = univ, { simp [this ], },
61
+ refine affine_subspace.eq_univ_of_subsingleton_span_eq_top _ b.tot ,
64
62
rw ← image_univ,
65
- exact subsingleton.image subsingleton_of_subsingleton p , },
63
+ exact subsingleton.image subsingleton_of_subsingleton b.points , },
66
64
{ -- The positive-dimensional case.
67
65
haveI : finite_dimensional ℝ E,
68
66
{ classical,
69
67
obtain ⟨i⟩ := (infer_instance : nonempty ι),
70
- have b := basis_of_aff_ind_span_eq_top h_ind h_tot i,
71
- exact finite_dimensional.of_fintype_basis b, },
72
- have : convex_hull ℝ (range p) = ⋂ i, (barycentric_coord h_ind h_tot i)⁻¹' Ici 0 ,
73
- { rw convex_hull_affine_basis_eq_nonneg_barycentric h_ind h_tot, ext, simp, },
68
+ exact finite_dimensional.of_fintype_basis (b.basis_of i), },
69
+ have : convex_hull ℝ (range b.points) = ⋂ i, (b.coord i)⁻¹' Ici 0 ,
70
+ { rw convex_hull_affine_basis_eq_nonneg_barycentric b, ext, simp, },
74
71
ext,
75
72
simp only [this , interior_Inter_of_fintype, ← is_open_map.preimage_interior_eq_interior_preimage
76
- (continuous_barycentric_coord h_ind h_tot _) (is_open_map_barycentric_coord h_ind h_tot _),
73
+ (continuous_barycentric_coord b _) (is_open_map_barycentric_coord b _),
77
74
interior_Ici, mem_Inter, mem_set_of_eq, mem_Ioi, mem_preimage], },
78
75
end
79
76
@@ -140,17 +137,17 @@ begin
140
137
obtain ⟨t, hts, h_tot, h_ind⟩ := exists_affine_independent ℝ V s,
141
138
suffices : (interior (convex_hull ℝ (range (coe : t → V)))).nonempty,
142
139
{ rw [subtype.range_coe_subtype, set_of_mem_eq] at this ,
143
- apply nonempty.mono _ this ,
140
+ apply nonempty.mono _ this ,
144
141
mono* },
145
142
haveI : fintype t := fintype_of_fin_dim_affine_independent ℝ h_ind,
146
143
use finset.centroid ℝ (finset.univ : finset t) (coe : t → V),
147
144
rw [h, ← @set_of_mem_eq V t, ← subtype.range_coe_subtype] at h_tot,
148
- rw interior_convex_hull_aff_basis h_ind h_tot,
145
+ let b : affine_basis t ℝ V := ⟨coe, h_ind, h_tot⟩,
146
+ rw interior_convex_hull_aff_basis b,
149
147
have htne : (finset.univ : finset t).nonempty,
150
148
{ simpa [finset.univ_nonempty_iff] using
151
149
affine_subspace.nonempty_of_affine_span_eq_top ℝ V V h_tot, },
152
- simp [finset.centroid_def,
153
- barycentric_coord_apply_combination_of_mem h_ind h_tot (finset.mem_univ _)
150
+ simp [finset.centroid_def, b.coord_apply_combination_of_mem (finset.mem_univ _)
154
151
(finset.sum_centroid_weights_eq_one_of_nonempty ℝ (finset.univ : finset t) htne),
155
152
finset.centroid_weights_apply, nat.cast_pos, inv_pos, finset.card_pos.mpr htne], },
156
153
end
0 commit comments