@@ -41,35 +41,37 @@ section
41
41
42
42
variables [has_scalar R ℝ]
43
43
44
+ /- The useless `0` multiplication in `smul` is to make sure that
45
+ `restrict_scalars.semimodule ℝ ℂ ℂ = complex.semimodule` definitionally. -/
44
46
instance : has_scalar R ℂ :=
45
- { smul := λ r x, ⟨r • x.re, r • x.im⟩ }
47
+ { smul := λ r x, ⟨r • x.re - 0 * x.im , r • x.im + 0 * x.re ⟩ }
46
48
47
- lemma smul_re (r : R) (z : ℂ) : (r • z).re = r • z.re := rfl
48
- lemma smul_im (r : R) (z : ℂ) : (r • z).im = r • z.im := rfl
49
+ lemma smul_re (r : R) (z : ℂ) : (r • z).re = r • z.re := by simp [(•)]
50
+ lemma smul_im (r : R) (z : ℂ) : (r • z).im = r • z.im := by simp [(•)]
49
51
50
52
@[simp] lemma smul_coe {x : ℝ} {z : ℂ} : x • z = x * z :=
51
53
by ext; simp [smul_re, smul_im]
52
54
53
55
end
54
56
55
57
instance [has_scalar R ℝ] [has_scalar S ℝ] [smul_comm_class R S ℝ] : smul_comm_class R S ℂ :=
56
- { smul_comm := λ r s x, ext (smul_comm _ _ _) ( smul_comm _ _ _) }
58
+ { smul_comm := λ r s x, by ext; simp [smul_re, smul_im, smul_comm] }
57
59
58
60
instance [has_scalar R S] [has_scalar R ℝ] [has_scalar S ℝ] [is_scalar_tower R S ℝ] :
59
61
is_scalar_tower R S ℂ :=
60
- { smul_assoc := λ r s x, ext (smul_assoc _ _ _) ( smul_assoc _ _ _) }
62
+ { smul_assoc := λ r s x, by ext; simp [smul_re, smul_im, smul_assoc] }
61
63
62
64
instance [monoid R] [mul_action R ℝ] : mul_action R ℂ :=
63
- { one_smul := λ x, ext (one_smul _ _) ( one_smul _ _) ,
64
- mul_smul := λ r s x, ext (mul_smul _ _ _) ( mul_smul _ _ _) }
65
+ { one_smul := λ x, by ext; simp [smul_re, smul_im, one_smul] ,
66
+ mul_smul := λ r s x, by ext; simp [smul_re, smul_im, mul_smul] }
65
67
66
68
instance [semiring R] [distrib_mul_action R ℝ] : distrib_mul_action R ℂ :=
67
- { smul_add := λ r x y, ext (smul_add _ _ _) ( smul_add _ _ _) ,
68
- smul_zero := λ r, ext (smul_zero _) (smul_zero _) }
69
+ { smul_add := λ r x y, by ext; simp [smul_re, smul_im, smul_add] ,
70
+ smul_zero := λ r, by ext; simp [smul_re, smul_im, smul_zero] }
69
71
70
72
instance [semiring R] [semimodule R ℝ] : semimodule R ℂ :=
71
- { add_smul := λ r s x, ext (add_smul _ _ _) ( add_smul _ _ _) ,
72
- zero_smul := λ r, ext (zero_smul _ _) ( zero_smul _ _) }
73
+ { add_smul := λ r s x, by ext; simp [smul_re, smul_im, add_smul] ,
74
+ zero_smul := λ r, by ext; simp [smul_re, smul_im, zero_smul] }
73
75
74
76
instance [comm_semiring R] [algebra R ℝ] : algebra R ℂ :=
75
77
{ smul := (•),
0 commit comments