@@ -39,6 +39,7 @@ section ordered_comm_semiring
39
39
40
40
variables (R : Type *) [ordered_comm_semiring R]
41
41
variables {M : Type *} [add_comm_monoid M] [module R M]
42
+ variables {N : Type *} [add_comm_monoid N] [module R N]
42
43
variables (ι : Type *) [decidable_eq ι]
43
44
44
45
/-- Two vectors are in the same ray if some positive multiples of them are equal (in the typical
@@ -90,6 +91,24 @@ lemma same_ray.pos_smul_left {v₁ v₂ : M} {r : R} (h : same_ray R v₁ v₂)
90
91
same_ray R (r • v₁) v₂ :=
91
92
transitive_same_ray R M (same_ray_pos_smul_left v₁ hr) h
92
93
94
+ /-- If two vectors are on the same ray then they remain so after appling a linear map. -/
95
+ lemma same_ray.map {v₁ v₂ : M} (f : M →ₗ[R] N)
96
+ (h : same_ray R v₁ v₂) : same_ray R (f v₁) (f v₂) :=
97
+ let ⟨r₁, r₂, hr₁, hr₂, h⟩ := h in
98
+ ⟨r₁, r₂, hr₁, hr₂, by rw [←f.map_smul, ←f.map_smul, h]⟩
99
+
100
+ /-- If two vectors are on the same ray then they remain so after appling a linear equivalence. -/
101
+ @[simp] lemma same_ray_map_iff {v₁ v₂ : M} (e : M ≃ₗ[R] N) :
102
+ same_ray R (e v₁) (e v₂) ↔ same_ray R v₁ v₂ :=
103
+ ⟨λ h, by simpa using same_ray.map e.symm.to_linear_map h, same_ray.map e.to_linear_map⟩
104
+
105
+ /-- If two vectors are on the same ray then both scaled by the same action are also on the same
106
+ ray. -/
107
+ lemma same_ray.smul {S : Type *} [has_scalar S M] [smul_comm_class R S M] {v₁ v₂ : M} (s : S)
108
+ (h : same_ray R v₁ v₂) : same_ray R (s • v₁) (s • v₂) :=
109
+ let ⟨r₁, r₂, hr₁, hr₂, h⟩ := h in
110
+ ⟨r₁, r₂, hr₁, hr₂, by rw [smul_comm r₁ s v₁, smul_comm r₂ s v₂, h]⟩
111
+
93
112
variables (R M)
94
113
95
114
/-- The setoid of the `same_ray` relation for elements of a module. -/
@@ -153,8 +172,61 @@ begin
153
172
exact same_ray_pos_smul_left v hr
154
173
end
155
174
175
+ /-- An equivalence between modules implies an equivalence between ray vectors. -/
176
+ def ray_vector.map_linear_equiv (e : M ≃ₗ[R] N) : ray_vector M ≃ ray_vector N :=
177
+ equiv.subtype_equiv e.to_equiv $ λ _, e.map_ne_zero_iff.symm
178
+
179
+ /-- An equivalence between modules implies an equivalence between rays. -/
180
+ def module.ray.map [nontrivial R] (e : M ≃ₗ[R] N) : module.ray R M ≃ module.ray R N :=
181
+ quotient.congr (ray_vector.map_linear_equiv e) $ λ ⟨a, ha⟩ ⟨b, hb⟩, (same_ray_map_iff _).symm
182
+
183
+ @[simp] lemma module.ray.map_apply [nontrivial R] (e : M ≃ₗ[R] N) (v : M) (hv : v ≠ 0 ) :
184
+ module.ray.map e (ray_of_ne_zero _ v hv) = ray_of_ne_zero _ (e v) (e.map_ne_zero_iff.2 hv) := rfl
185
+
186
+ @[simp] lemma module.ray.map_refl [nontrivial R] :
187
+ (module.ray.map $ linear_equiv.refl R M) = equiv.refl _ :=
188
+ equiv.ext $ module.ray.ind R $ λ _ _, rfl
189
+
190
+ @[simp] lemma module.ray.map_symm [nontrivial R] (e : M ≃ₗ[R] N) :
191
+ (module.ray.map e).symm = module.ray.map e.symm := rfl
192
+
193
+ section action
194
+ variables {G : Type *} [group G] [nontrivial R] [distrib_mul_action G M] [smul_comm_class R G M]
195
+
196
+ /-- Any invertible action preserves the non-zeroness of ray vectors. This is primarily of interest
197
+ when `G = units R` -/
198
+ instance : mul_action G (ray_vector M) :=
199
+ { smul := λ r, (subtype.map ((•) r) $ λ a, (smul_ne_zero_iff_ne _).2 ),
200
+ mul_smul := λ a b m, subtype.ext $ mul_smul a b _,
201
+ one_smul := λ m, subtype.ext $ one_smul _ _ }
202
+
203
+ /-- Any invertible action preserves the non-zeroness of rays. This is primarily of interest when
204
+ `G = units R` -/
205
+ instance : mul_action G (module.ray R M) :=
206
+ { smul := λ r, quotient.map ((•) r) (λ a b, same_ray.smul _),
207
+ mul_smul := λ a b, quotient.ind $ by exact(λ m, congr_arg quotient.mk $ mul_smul a b _),
208
+ one_smul := quotient.ind $ by exact (λ m, congr_arg quotient.mk $ one_smul _ _), }
209
+
210
+ /-- The action via `linear_equiv.apply_distrib_mul_action` corresponds to `module.ray.map`. -/
211
+ @[simp] lemma module.ray.linear_equiv_smul_eq_map (e : M ≃ₗ[R] M) (v : module.ray R M) :
212
+ e • v = module.ray.map e v := rfl
213
+
214
+ @[simp] lemma smul_ray_of_ne_zero (g : G) (v : M) (hv) :
215
+ g • ray_of_ne_zero R v hv = ray_of_ne_zero R (g • v) ((smul_ne_zero_iff_ne _).2 hv) := rfl
216
+
217
+ end action
218
+
156
219
namespace module.ray
157
220
221
+ /-- Scaling by a positive unit is a no-op. -/
222
+ lemma units_smul_of_pos [nontrivial R] (u : units R) (hu : 0 < (u : R)) (v : module.ray R M) :
223
+ u • v = v :=
224
+ begin
225
+ induction v using module.ray.ind,
226
+ rw [smul_ray_of_ne_zero, ray_eq_iff],
227
+ exact same_ray_pos_smul_left _ hu,
228
+ end
229
+
158
230
/-- An arbitrary `ray_vector` giving a ray. -/
159
231
def some_ray_vector [nontrivial R] (x : module.ray R M) : ray_vector M :=
160
232
quotient.out x
@@ -258,6 +330,15 @@ begin
258
330
exact x_hv (eq_zero_of_same_ray_self_neg h)
259
331
end
260
332
333
+ /-- Scaling by a negative unit is negation. -/
334
+ lemma units_smul_of_neg [nontrivial R] (u : units R) (hu : (u : R) < 0 ) (v : module.ray R M) :
335
+ u • v = -v :=
336
+ begin
337
+ induction v using module.ray.ind,
338
+ rw [smul_ray_of_ne_zero, ←ray_neg, ray_eq_iff, ←same_ray_neg_swap, units.smul_def, ←neg_smul],
339
+ exact same_ray_pos_smul_left _ (neg_pos_of_neg hu),
340
+ end
341
+
261
342
end module.ray
262
343
263
344
namespace basis
@@ -286,9 +367,12 @@ begin
286
367
exact same_ray_pos_smul_left _ hr,
287
368
end
288
369
370
+ section
371
+ variables [no_zero_smul_divisors R M]
372
+
289
373
/-- A nonzero vector is in the same ray as a multiple of itself if and only if that multiple
290
374
is positive. -/
291
- @[simp] lemma same_ray_smul_right_iff [no_zero_smul_divisors R M] {v : M} (hv : v ≠ 0 ) (r : R) :
375
+ @[simp] lemma same_ray_smul_right_iff {v : M} (hv : v ≠ 0 ) (r : R) :
292
376
same_ray R v (r • v) ↔ 0 < r :=
293
377
begin
294
378
split,
304
388
305
389
/-- A multiple of a nonzero vector is in the same ray as that vector if and only if that multiple
306
390
is positive. -/
307
- @[simp] lemma same_ray_smul_left_iff [no_zero_smul_divisors R M] {v : M} (hv : v ≠ 0 ) (r : R) :
391
+ @[simp] lemma same_ray_smul_left_iff {v : M} (hv : v ≠ 0 ) (r : R) :
308
392
same_ray R (r • v) v ↔ 0 < r :=
309
393
begin
310
394
rw (symmetric_same_ray R M).iff,
@@ -313,22 +397,44 @@ end
313
397
314
398
/-- The negation of a nonzero vector is in the same ray as a multiple of that vector if and
315
399
only if that multiple is negative. -/
316
- @[simp] lemma same_ray_neg_smul_right_iff [no_zero_smul_divisors R M] {v : M} (hv : v ≠ 0 )
317
- (r : R) : same_ray R (-v) (r • v) ↔ r < 0 :=
400
+ @[simp] lemma same_ray_neg_smul_right_iff {v : M} (hv : v ≠ 0 ) (r : R) :
401
+ same_ray R (-v) (r • v) ↔ r < 0 :=
318
402
begin
319
403
rw [←same_ray_neg_iff, neg_neg, ←neg_smul, same_ray_smul_right_iff hv (-r)],
320
404
exact right.neg_pos_iff
321
405
end
322
406
323
407
/-- A multiple of a nonzero vector is in the same ray as the negation of that vector if and
324
408
only if that multiple is negative. -/
325
- @[simp] lemma same_ray_neg_smul_left_iff [no_zero_smul_divisors R M] {v : M} (hv : v ≠ 0 )
326
- (r : R) : same_ray R (r • v) (-v) ↔ r < 0 :=
409
+ @[simp] lemma same_ray_neg_smul_left_iff {v : M} (hv : v ≠ 0 ) (r : R) :
410
+ same_ray R (r • v) (-v) ↔ r < 0 :=
327
411
begin
328
412
rw [←same_ray_neg_iff, neg_neg, ←neg_smul, same_ray_smul_left_iff hv (-r)],
329
413
exact left.neg_pos_iff
330
414
end
331
415
416
+ /-- A nonzero vector is in the same ray as a multiple of itself if and only if that multiple
417
+ is positive. -/
418
+ @[simp] lemma units_smul_eq_self_iff {u : units R} {v : module.ray R M} :
419
+ u • v = v ↔ (0 : R) < u :=
420
+ begin
421
+ induction v using module.ray.ind with v hv,
422
+ rw [smul_ray_of_ne_zero, ray_eq_iff, units.smul_def],
423
+ exact same_ray_smul_left_iff hv _,
424
+ end
425
+
426
+ /-- A nonzero vector is in the same ray as a multiple of itself if and only if that multiple
427
+ is positive. -/
428
+ @[simp] lemma units_smul_eq_neg_iff {u : units R} {v : module.ray R M} :
429
+ u • v = -v ↔ ↑u < (0 : R) :=
430
+ begin
431
+ induction v using module.ray.ind with v hv,
432
+ rw [smul_ray_of_ne_zero, ←ray_neg, ray_eq_iff, units.smul_def],
433
+ exact same_ray_neg_smul_left_iff hv _,
434
+ end
435
+
436
+ end
437
+
332
438
namespace basis
333
439
334
440
variables [fintype ι]
0 commit comments