@@ -189,7 +189,14 @@ instance : add_comm_group (P1 →ᵃ[k] V2) :=
189
189
zero_add := λ f, ext $ λ p, zero_add (f p),
190
190
add_zero := λ f, ext $ λ p, add_zero (f p),
191
191
add_comm := λ f g, ext $ λ p, add_comm (f p) (g p),
192
- add_left_neg := λ f, ext $ λ p, add_left_neg (f p) }
192
+ add_left_neg := λ f, ext $ λ p, add_left_neg (f p),
193
+ nsmul := λ n f, ⟨n • f, n • f.linear, λ p v, by simp⟩,
194
+ nsmul_zero' := λ f, ext $ λ p, add_monoid.nsmul_zero' _,
195
+ nsmul_succ' := λ n f, ext $ λ p, add_monoid.nsmul_succ' _ _,
196
+ zsmul := λ z f, ⟨z • f, z • f.linear, λ p v, by simp⟩,
197
+ zsmul_zero' := λ f, ext $ λ p, sub_neg_monoid.zsmul_zero' _,
198
+ zsmul_succ' := λ z f, ext $ λ p, sub_neg_monoid.zsmul_succ' _ _,
199
+ zsmul_neg' := λ z f, ext $ λ p, sub_neg_monoid.zsmul_neg' _ _, }
193
200
194
201
@[simp, norm_cast] lemma coe_zero : ⇑(0 : P1 →ᵃ[k] V2) = 0 := rfl
195
202
@[simp] lemma zero_linear : (0 : P1 →ᵃ[k] V2).linear = 0 := rfl
@@ -502,36 +509,69 @@ end affine_map
502
509
503
510
namespace affine_map
504
511
505
- variables {k : Type *} {V1 : Type *} {P1 : Type *} {V2 : Type *} [comm_ring k]
506
- [add_comm_group V1] [module k V1] [affine_space V1 P1] [add_comm_group V2] [module k V2]
512
+ variables {R k V1 P1 V2 : Type *}
513
+
514
+ section ring
515
+ variables [ring k] [add_comm_group V1] [affine_space V1 P1] [add_comm_group V2]
516
+ variables [module k V1] [module k V2]
507
517
include V1
508
518
509
- /-- If `k` is a commutative ring, then the set of affine maps with codomain in a `k`-module
510
- is a `k`-module. -/
511
- instance : module k (P1 →ᵃ[k] V2) :=
519
+ section distrib_mul_action
520
+ variables [monoid R] [distrib_mul_action R V2] [smul_comm_class k R V2]
521
+
522
+ /-- The space of affine maps to a module inherits an `R`-action from the action on its codomain. -/
523
+ instance : distrib_mul_action R (P1 →ᵃ[k] V2) :=
512
524
{ smul := λ c f, ⟨c • f, c • f.linear, λ p v, by simp [smul_add]⟩,
513
525
one_smul := λ f, ext $ λ p, one_smul _ _,
514
526
mul_smul := λ c₁ c₂ f, ext $ λ p, mul_smul _ _ _,
515
527
smul_add := λ c f g, ext $ λ p, smul_add _ _ _,
516
- smul_zero := λ c, ext $ λ p, smul_zero _,
517
- add_smul := λ c₁ c₂ f, ext $ λ p, add_smul _ _ _,
518
- zero_smul := λ f, ext $ λ p, zero_smul _ _ }
528
+ smul_zero := λ c, ext $ λ p, smul_zero _ }
529
+
530
+ @[simp] lemma coe_smul (c : R) (f : P1 →ᵃ[k] V2) : ⇑(c • f) = c • f := rfl
531
+
532
+ @[simp] lemma smul_linear (t : R) (f : P1 →ᵃ[k] V2) : (t • f).linear = t • f.linear := rfl
533
+
534
+ instance [distrib_mul_action Rᵐᵒᵖ V2] [is_central_scalar R V2] :
535
+ is_central_scalar R (P1 →ᵃ[k] V2) :=
536
+ { op_smul_eq_smul := λ r x, ext $ λ _, op_smul_eq_smul _ _ }
537
+
538
+ end distrib_mul_action
539
+
540
+ section module
541
+ variables [semiring R] [module R V2] [smul_comm_class k R V2]
519
542
520
- @[simp] lemma coe_smul (c : k) (f : P1 →ᵃ[k] V2) : ⇑(c • f) = c • f := rfl
543
+ /-- The space of affine maps taking values in an `R`-module is an `R`-module. -/
544
+ instance : module R (P1 →ᵃ[k] V2) :=
545
+ { smul := (•),
546
+ add_smul := λ c₁ c₂ f, ext $ λ p, add_smul _ _ _,
547
+ zero_smul := λ f, ext $ λ p, zero_smul _ _,
548
+ .. affine_map.distrib_mul_action }
521
549
522
- @[simp] lemma smul_linear (t : k) (f : P1 →ᵃ[k] V2) : (t • f).linear = t • f.linear := rfl
550
+ variables (R)
523
551
524
552
/-- The space of affine maps between two modules is linearly equivalent to the product of the
525
553
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
526
- linear part. -/
527
- @[simps] def to_const_prod_linear_map : (V1 →ᵃ[k] V2) ≃ₗ[k] V2 × (V1 →ₗ[k] V2) :=
554
+ linear part.
555
+
556
+ See note [bundled maps over different rings]-/
557
+ @[simps] def to_const_prod_linear_map : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) :=
528
558
{ to_fun := λ f, ⟨f 0 , f.linear⟩,
529
559
inv_fun := λ p, p.2 .to_affine_map + const k V1 p.1 ,
530
560
left_inv := λ f, by { ext, rw f.decomp, simp, },
531
561
right_inv := by { rintros ⟨v, f⟩, ext; simp, },
532
562
map_add' := by simp,
533
563
map_smul' := by simp, }
534
564
565
+ end module
566
+
567
+ end ring
568
+
569
+ section comm_ring
570
+
571
+ variables [comm_ring k] [add_comm_group V1] [affine_space V1 P1] [add_comm_group V2]
572
+ variables [module k V1] [module k V2]
573
+ include V1
574
+
535
575
/-- `homothety c r` is the homothety (also known as dilation) about `c` with scale factor `r`. -/
536
576
def homothety (c : P1) (r : k) : P1 →ᵃ[k] P1 :=
537
577
r • (id k P1 -ᵥ const k P1 c) +ᵥ const k P1 c
@@ -575,4 +615,6 @@ def homothety_affine (c : P1) : k →ᵃ[k] (P1 →ᵃ[k] P1) :=
575
615
⇑(homothety_affine c : k →ᵃ[k] _) = homothety c :=
576
616
rfl
577
617
618
+ end comm_ring
619
+
578
620
end affine_map
0 commit comments