Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit bd3695a

Browse files
RemyDegennesgouezel
andcommitted
feat(data/complex/is_R_or_C): add linear maps for is_R_or_C.re, im, conj and of_real (#6621)
Add continuous linear maps and linear isometries (when applicable) for the following `is_R_or_C` functions: `re`, `im`, `conj` and `of_real`. Rename the existing continuous linear maps defined in complex.basic to adopt the naming convention of is_R_or_C. Co-authored-by: Rémy Degenne <remydegenne@gmail.com> Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
1 parent 998a382 commit bd3695a

File tree

5 files changed

+165
-96
lines changed

5 files changed

+165
-96
lines changed

src/analysis/complex/basic.lean

Lines changed: 34 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ This file registers `ℂ` as a normed field, expresses basic properties of the n
1717
tools on the real vector space structure of `ℂ`. Notably, in the namespace `complex`,
1818
it defines functions:
1919
20-
* `continuous_linear_map.re`
21-
* `continuous_linear_map.im`
22-
* `continuous_linear_map.of_real`
20+
* `re_clm`
21+
* `im_clm`
22+
* `of_real_clm`
23+
* `conj_clm`
2324
24-
They are bundled versions of the real part, the imaginary part, and the embedding of `ℝ` in `ℂ`,
25-
as continuous `ℝ`-linear maps.
25+
They are bundled versions of the real part, the imaginary part, the embedding of `ℝ` in `ℂ`, and
26+
the complex conjugate as continuous `ℝ`-linear maps. The last two are also bundled as linear
27+
isometries in `of_real_li` and `conj_li`.
2628
2729
We also register the fact that `ℂ` is an `is_R_or_C` field.
2830
-/
@@ -74,80 +76,64 @@ by rw [norm_int, _root_.abs_of_nonneg]; exact int.cast_nonneg.2 hn
7476
open continuous_linear_map
7577

7678
/-- Continuous linear map version of the real part function, from `ℂ` to `ℝ`. -/
77-
def continuous_linear_map.re : ℂ →L[ℝ] ℝ :=
78-
linear_map.re.mk_continuous 1 (λ x, by simp [real.norm_eq_abs, abs_re_le_abs])
79+
def re_clm : ℂ →L[ℝ] ℝ := re_lm.mk_continuous 1 (λ x, by simp [real.norm_eq_abs, abs_re_le_abs])
7980

80-
@[continuity] lemma continuous_re : continuous re := continuous_linear_map.re.continuous
81+
@[continuity] lemma continuous_re : continuous re := re_clm.continuous
8182

82-
@[simp] lemma continuous_linear_map.re_coe :
83-
(coe (continuous_linear_map.re) : ℂ →ₗ[ℝ] ℝ) = linear_map.re := rfl
83+
@[simp] lemma re_clm_coe : (coe (re_clm) : ℂ →ₗ[ℝ] ℝ) = re_lm := rfl
8484

85-
@[simp] lemma continuous_linear_map.re_apply (z : ℂ) :
86-
(continuous_linear_map.re : ℂ → ℝ) z = z.re := rfl
85+
@[simp] lemma re_clm_apply (z : ℂ) : (re_clm : ℂ → ℝ) z = z.re := rfl
8786

88-
@[simp] lemma continuous_linear_map.re_norm :
89-
∥continuous_linear_map.re∥ = 1 :=
87+
@[simp] lemma re_clm_norm : ∥re_clm∥ = 1 :=
9088
le_antisymm (linear_map.mk_continuous_norm_le _ zero_le_one _) $
91-
calc 1 = ∥continuous_linear_map.re 1∥ : by simp
92-
... ≤ ∥continuous_linear_map.re∥ : unit_le_op_norm _ _ (by simp)
89+
calc 1 = ∥re_clm 1∥ : by simp
90+
... ≤ ∥re_clm∥ : unit_le_op_norm _ _ (by simp)
9391

9492
/-- Continuous linear map version of the real part function, from `ℂ` to `ℝ`. -/
95-
def continuous_linear_map.im : ℂ →L[ℝ] ℝ :=
96-
linear_map.im.mk_continuous 1 (λ x, by simp [real.norm_eq_abs, abs_im_le_abs])
93+
def im_clm : ℂ →L[ℝ] ℝ := im_lm.mk_continuous 1 (λ x, by simp [real.norm_eq_abs, abs_im_le_abs])
9794

98-
@[continuity] lemma continuous_im : continuous im := continuous_linear_map.im.continuous
95+
@[continuity] lemma continuous_im : continuous im := im_clm.continuous
9996

100-
@[simp] lemma continuous_linear_map.im_coe :
101-
(coe (continuous_linear_map.im) : ℂ →ₗ[ℝ] ℝ) = linear_map.im := rfl
97+
@[simp] lemma im_clm_coe : (coe (im_clm) : ℂ →ₗ[ℝ] ℝ) = im_lm := rfl
10298

103-
@[simp] lemma continuous_linear_map.im_apply (z : ℂ) :
104-
(continuous_linear_map.im : ℂ → ℝ) z = z.im := rfl
99+
@[simp] lemma im_clm_apply (z : ℂ) : (im_clm : ℂ → ℝ) z = z.im := rfl
105100

106-
@[simp] lemma continuous_linear_map.im_norm :
107-
∥continuous_linear_map.im∥ = 1 :=
101+
@[simp] lemma im_clm_norm : ∥im_clm∥ = 1 :=
108102
le_antisymm (linear_map.mk_continuous_norm_le _ zero_le_one _) $
109-
calc 1 = ∥continuous_linear_map.im I∥ : by simp
110-
... ≤ ∥continuous_linear_map.im∥ : unit_le_op_norm _ _ (by simp)
103+
calc 1 = ∥im_clm I∥ : by simp
104+
... ≤ ∥im_clm∥ : unit_le_op_norm _ _ (by simp)
111105

112106
/-- The complex-conjugation function from `ℂ` to itself is an isometric linear map. -/
113-
def linear_isometry.conj : ℂ →ₗᵢ[ℝ] ℂ := ⟨linear_map.conj, λ x, by simp⟩
107+
def conj_li : ℂ →ₗᵢ[ℝ] ℂ := ⟨conj_lm, λ x, by simp⟩
114108

115109
/-- Continuous linear map version of the conj function, from `ℂ` to `ℂ`. -/
116-
def continuous_linear_map.conj : ℂ →L[ℝ] ℂ := linear_isometry.conj.to_continuous_linear_map
110+
def conj_clm : ℂ →L[ℝ] ℂ := conj_li.to_continuous_linear_map
117111

118-
lemma isometry_conj : isometry (conj : ℂ → ℂ) := linear_isometry.conj.isometry
112+
lemma isometry_conj : isometry (conj : ℂ → ℂ) := conj_li.isometry
119113

120-
@[continuity] lemma continuous_conj : continuous conj := continuous_linear_map.conj.continuous
114+
@[continuity] lemma continuous_conj : continuous conj := conj_clm.continuous
121115

122-
@[simp] lemma continuous_linear_map.conj_coe :
123-
(coe (continuous_linear_map.conj) : ℂ →ₗ[ℝ] ℂ) = linear_map.conj := rfl
116+
@[simp] lemma conj_clm_coe : (coe (conj_clm) : ℂ →ₗ[ℝ] ℂ) = conj_lm := rfl
124117

125-
@[simp] lemma continuous_linear_map.conj_apply (z : ℂ) :
126-
(continuous_linear_map.conj : ℂ → ℂ) z = z.conj := rfl
118+
@[simp] lemma conj_clm_apply (z : ℂ) : (conj_clm : ℂ → ℂ) z = z.conj := rfl
127119

128-
@[simp] lemma continuous_linear_map.conj_norm :
129-
∥continuous_linear_map.conj∥ = 1 :=
130-
linear_isometry.conj.norm_to_continuous_linear_map
120+
@[simp] lemma conj_clm_norm : ∥conj_clm∥ = 1 := conj_li.norm_to_continuous_linear_map
131121

132122
/-- Linear isometry version of the canonical embedding of `ℝ` in `ℂ`. -/
133-
def linear_isometry.of_real : ℝ →ₗᵢ[ℝ] ℂ := ⟨linear_map.of_real, λ x, by simp⟩
123+
def of_real_li : ℝ →ₗᵢ[ℝ] ℂ := ⟨of_real_lm, λ x, by simp⟩
134124

135125
/-- Continuous linear map version of the canonical embedding of `ℝ` in `ℂ`. -/
136-
def continuous_linear_map.of_real : ℝ →L[ℝ] ℂ := linear_isometry.of_real.to_continuous_linear_map
126+
def of_real_clm : ℝ →L[ℝ] ℂ := of_real_li.to_continuous_linear_map
137127

138-
lemma isometry_of_real : isometry (coe : ℝ → ℂ) := linear_isometry.of_real.isometry
128+
lemma isometry_of_real : isometry (coe : ℝ → ℂ) := of_real_li.isometry
139129

140130
@[continuity] lemma continuous_of_real : continuous (coe : ℝ → ℂ) := isometry_of_real.continuous
141131

142-
@[simp] lemma continuous_linear_map.of_real_coe :
143-
(coe (continuous_linear_map.of_real) : ℝ →ₗ[ℝ] ℂ) = linear_map.of_real := rfl
132+
@[simp] lemma of_real_clm_coe : (coe (of_real_clm) : ℝ →ₗ[ℝ] ℂ) = of_real_lm := rfl
144133

145-
@[simp] lemma continuous_linear_map.of_real_apply (x : ℝ) :
146-
(continuous_linear_map.of_real : ℝ → ℂ) x = x := rfl
134+
@[simp] lemma of_real_clm_apply (x : ℝ) : (of_real_clm : ℝ → ℂ) x = x := rfl
147135

148-
@[simp] lemma continuous_linear_map.of_real_norm :
149-
∥continuous_linear_map.of_real∥ = 1 :=
150-
linear_isometry.of_real.norm_to_continuous_linear_map
136+
@[simp] lemma of_real_clm_norm : ∥of_real_clm∥ = 1 := of_real_li.norm_to_continuous_linear_map
151137

152138
noncomputable instance : is_R_or_C ℂ :=
153139
{ re := ⟨complex.re, complex.zero_re, complex.add_re⟩,

src/analysis/complex/real_deriv.lean

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ differentiable at this point, with a derivative equal to the real part of the co
2424
theorem has_strict_deriv_at.real_of_complex (h : has_strict_deriv_at e e' z) :
2525
has_strict_deriv_at (λx:ℝ, (e x).re) e'.re z :=
2626
begin
27-
have A : has_strict_fderiv_at (coe : ℝ → ℂ) continuous_linear_map.of_real z :=
28-
continuous_linear_map.of_real.has_strict_fderiv_at,
27+
have A : has_strict_fderiv_at (coe : ℝ → ℂ) of_real_clm z := of_real_clm.has_strict_fderiv_at,
2928
have B : has_strict_fderiv_at e
3029
((continuous_linear_map.smul_right 1 e' : ℂ →L[ℂ] ℂ).restrict_scalars ℝ)
31-
(continuous_linear_map.of_real z) :=
30+
(of_real_clm z) :=
3231
h.has_strict_fderiv_at.restrict_scalars ℝ,
33-
have C : has_strict_fderiv_at re continuous_linear_map.re (e (continuous_linear_map.of_real z)) :=
34-
continuous_linear_map.re.has_strict_fderiv_at,
32+
have C : has_strict_fderiv_at re re_clm (e (of_real_clm z)) := re_clm.has_strict_fderiv_at,
3533
simpa using (C.comp z (B.comp z A)).has_strict_deriv_at
3634
end
3735

@@ -40,24 +38,21 @@ differentiable at this point, with a derivative equal to the real part of the co
4038
theorem has_deriv_at.real_of_complex (h : has_deriv_at e e' z) :
4139
has_deriv_at (λx:ℝ, (e x).re) e'.re z :=
4240
begin
43-
have A : has_fderiv_at (coe : ℝ → ℂ) continuous_linear_map.of_real z :=
44-
continuous_linear_map.of_real.has_fderiv_at,
41+
have A : has_fderiv_at (coe : ℝ → ℂ) of_real_clm z := of_real_clm.has_fderiv_at,
4542
have B : has_fderiv_at e ((continuous_linear_map.smul_right 1 e' : ℂ →L[ℂ] ℂ).restrict_scalars ℝ)
46-
(continuous_linear_map.of_real z) :=
43+
(of_real_clm z) :=
4744
h.has_fderiv_at.restrict_scalars ℝ,
48-
have C : has_fderiv_at re continuous_linear_map.re (e (continuous_linear_map.of_real z)) :=
49-
continuous_linear_map.re.has_fderiv_at,
45+
have C : has_fderiv_at re re_clm (e (of_real_clm z)) := re_clm.has_fderiv_at,
5046
simpa using (C.comp z (B.comp z A)).has_deriv_at
5147
end
5248

5349
theorem times_cont_diff_at.real_of_complex {n : with_top ℕ} (h : times_cont_diff_at ℂ n e z) :
5450
times_cont_diff_at ℝ n (λ x : ℝ, (e x).re) z :=
5551
begin
5652
have A : times_cont_diff_at ℝ n (coe : ℝ → ℂ) z,
57-
from continuous_linear_map.of_real.times_cont_diff.times_cont_diff_at,
53+
from of_real_clm.times_cont_diff.times_cont_diff_at,
5854
have B : times_cont_diff_at ℝ n e z := h.restrict_scalars ℝ,
59-
have C : times_cont_diff_at ℝ n re (e z),
60-
from continuous_linear_map.re.times_cont_diff.times_cont_diff_at,
55+
have C : times_cont_diff_at ℝ n re (e z), from re_clm.times_cont_diff.times_cont_diff_at,
6156
exact C.comp z (B.comp z A)
6257
end
6358

src/analysis/normed_space/hahn_banach.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ begin
111111
≤ ∥g∥ : g.extend_to_𝕜.op_norm_le_bound g.op_norm_nonneg (norm_bound _)
112112
... = ∥fr∥ : hnormeq
113113
... ≤ ∥re_clm∥ * ∥f∥ : continuous_linear_map.op_norm_comp_le _ _
114-
... = ∥f∥ : by rw [norm_re_clm, one_mul] },
114+
... = ∥f∥ : by rw [re_clm_norm, one_mul] },
115115
{ exact f.op_norm_le_bound g.extend_to_𝕜.op_norm_nonneg (λ x, h x ▸ g.extend_to_𝕜.le_op_norm x) },
116116
end
117117

src/data/complex/is_R_or_C.lean

Lines changed: 108 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ end
144144
ext_iff.2 $ by simp
145145
@[simp, norm_cast, priority 900] lemma of_real_mul (r s : ℝ) : ((r * s : ℝ) : K) = r * s :=
146146
ext_iff.2 $ by simp
147+
@[simp, norm_cast] lemma of_real_smul (r x : ℝ) : r • (x : K) = (r : K) * (x : K) :=
148+
by { simp_rw [← smul_eq_mul, of_real_alg r], simp, }
149+
147150
lemma of_real_mul_re (r : ℝ) (z : K) : re (↑r * z) = r * re z :=
148151
by simp only [mul_re, of_real_im, zero_mul, of_real_re, sub_zero]
149152
lemma of_real_mul_im (r : ℝ) (z : K) : im (↑r * z) = r * (im z) :=
@@ -154,12 +157,6 @@ lemma smul_re : ∀ (r : ℝ) (z : K), re (r • z) = r * (re z) :=
154157
lemma smul_im : ∀ (r : ℝ) (z : K), im (r • z) = r * (im z) :=
155158
λ r z, by { rw algebra.smul_def, apply of_real_mul_im }
156159

157-
/-- The real part in a `is_R_or_C` field, as a linear map. -/
158-
noncomputable def re_lm : K →ₗ[ℝ] ℝ :=
159-
{ map_smul' := smul_re, .. re }
160-
161-
@[simp] lemma re_lm_coe : (re_lm : K → ℝ) = re := rfl
162-
163160
/-! ### The imaginary unit, `I` -/
164161

165162
/-- The imaginary unit. -/
@@ -195,6 +192,17 @@ lemma conj_inj (z w : K) : conj z = conj w ↔ z = w := conj_bijective.1.eq_iff
195192
lemma conj_eq_zero {z : K} : conj z = 0 ↔ z = 0 :=
196193
ring_hom.map_eq_zero conj
197194

195+
lemma conj_eq_re_sub_im (z : K) : conj z = re z - (im z) * I := by { rw ext_iff, simp, }
196+
197+
lemma conj_smul (r : ℝ) (z : K) : conj (r • z) = r • conj z :=
198+
begin
199+
simp_rw conj_eq_re_sub_im,
200+
simp only [smul_re, smul_im, of_real_mul],
201+
rw smul_sub,
202+
simp_rw of_real_alg,
203+
simp,
204+
end
205+
198206
lemma eq_conj_iff_real {z : K} : conj z = z ↔ ∃ r : ℝ, z = (r : K) :=
199207
begin
200208
split,
@@ -563,21 +571,6 @@ begin
563571
simp [of_real_im, mul_im, conj_im, conj_re, mul_comm],
564572
end
565573

566-
/-- The real part in a `is_R_or_C` field, as a continuous linear map. -/
567-
noncomputable def re_clm : K →L[ℝ] ℝ :=
568-
re_lm.mk_continuous 1 $ by { simp only [norm_eq_abs, re_lm_coe, one_mul], exact abs_re_le_abs }
569-
570-
@[simp] lemma norm_re_clm : ∥(re_clm : K →L[ℝ] ℝ)∥ = 1 :=
571-
begin
572-
apply le_antisymm (linear_map.mk_continuous_norm_le _ zero_le_one _),
573-
convert continuous_linear_map.ratio_le_op_norm _ (1 : K),
574-
simp,
575-
end
576-
577-
@[simp, norm_cast] lemma re_clm_coe : ((re_clm : K →L[ℝ] ℝ) : K →ₗ[ℝ] ℝ) = re_lm := rfl
578-
579-
@[simp] lemma re_clm_apply : ((re_clm : K →L[ℝ] ℝ) : K → ℝ) = re := rfl
580-
581574
/-! ### Cauchy sequences -/
582575

583576
theorem is_cau_seq_re (f : cau_seq K abs) : is_cau_seq abs' (λ n, re (f n)) :=
@@ -707,6 +700,100 @@ by simp [is_R_or_C.abs, abs, real.sqrt_mul_self_eq_abs]
707700

708701
end cleanup_lemmas
709702

703+
section linear_maps
704+
705+
variables {K : Type*} [is_R_or_C K]
706+
707+
/-- The real part in a `is_R_or_C` field, as a linear map. -/
708+
noncomputable def re_lm : K →ₗ[ℝ] ℝ :=
709+
{ map_smul' := smul_re, .. re }
710+
711+
@[simp] lemma re_lm_coe : (re_lm : K → ℝ) = re := rfl
712+
713+
/-- The real part in a `is_R_or_C` field, as a continuous linear map. -/
714+
noncomputable def re_clm : K →L[ℝ] ℝ :=
715+
re_lm.mk_continuous 1 $ by
716+
{ simp only [norm_eq_abs, re_lm_coe, one_mul, abs_to_real], exact abs_re_le_abs, }
717+
718+
@[simp] lemma re_clm_norm : ∥(re_clm : K →L[ℝ] ℝ)∥ = 1 :=
719+
begin
720+
apply le_antisymm (linear_map.mk_continuous_norm_le _ zero_le_one _),
721+
convert continuous_linear_map.ratio_le_op_norm _ (1 : K),
722+
simp,
723+
end
724+
725+
@[simp, norm_cast] lemma re_clm_coe : ((re_clm : K →L[ℝ] ℝ) : K →ₗ[ℝ] ℝ) = re_lm := rfl
726+
727+
@[simp] lemma re_clm_apply : ((re_clm : K →L[ℝ] ℝ) : K → ℝ) = re := rfl
728+
729+
@[continuity] lemma continuous_re : continuous (re : K → ℝ) := re_clm.continuous
730+
731+
/-- The imaginary part in a `is_R_or_C` field, as a linear map. -/
732+
noncomputable def im_lm : K →ₗ[ℝ] ℝ :=
733+
{ map_smul' := smul_im, .. im }
734+
735+
@[simp] lemma im_lm_coe : (im_lm : K → ℝ) = im := rfl
736+
737+
/-- The imaginary part in a `is_R_or_C` field, as a continuous linear map. -/
738+
noncomputable def im_clm : K →L[ℝ] ℝ :=
739+
im_lm.mk_continuous 1 $ by
740+
{ simp only [norm_eq_abs, re_lm_coe, one_mul, abs_to_real], exact abs_im_le_abs, }
741+
742+
@[simp, norm_cast] lemma im_clm_coe : ((im_clm : K →L[ℝ] ℝ) : K →ₗ[ℝ] ℝ) = im_lm := rfl
743+
744+
@[simp] lemma im_clm_apply : ((im_clm : K →L[ℝ] ℝ) : K → ℝ) = im := rfl
745+
746+
@[continuity] lemma continuous_im : continuous (im : K → ℝ) := im_clm.continuous
747+
748+
/-- Conjugate as a linear map -/
749+
noncomputable def conj_lm : K →ₗ[ℝ] K :=
750+
{ to_fun := λ x, conj x, map_add' := by simp, map_smul' := conj_smul, }
751+
752+
@[simp] lemma conj_lm_coe : (conj_lm : K → K) = conj := rfl
753+
754+
/-- Conjugate as a linear isometry -/
755+
noncomputable def conj_li : K →ₗᵢ[ℝ] K :=
756+
{ to_linear_map := conj_lm, norm_map' := by simp [norm_eq_abs] }
757+
758+
@[simp] lemma conj_li_apply : (conj_li : K → K) = conj := rfl
759+
760+
/-- Conjugate as a continuous linear map -/
761+
noncomputable def conj_clm : K →L[ℝ] K := conj_li.to_continuous_linear_map
762+
763+
@[simp] lemma conj_clm_coe : ((conj_clm : K →L[ℝ] K) : K →ₗ[ℝ] K) = conj_lm := rfl
764+
765+
@[simp] lemma conj_clm_apply : (conj_clm : K → K) = conj := rfl
766+
767+
@[simp] lemma conj_clm_norm : ∥(conj_clm : K →L[ℝ] K)∥ = 1 := conj_li.norm_to_continuous_linear_map
768+
769+
@[continuity] lemma continuous_conj : continuous (conj : K → K) := conj_li.continuous
770+
771+
/-- The `ℝ → K` coercion, as a linear map -/
772+
noncomputable def of_real_lm : ℝ →ₗ[ℝ] K :=
773+
{ to_fun := λ x, (x : K), map_add' := by simp, map_smul' := by simp, }
774+
775+
@[simp] lemma of_real_lm_coe : (of_real_lm : ℝ → K) = coe := rfl
776+
777+
/-- The ℝ → K coercion, as a linear isometry -/
778+
noncomputable def of_real_li : ℝ →ₗᵢ[ℝ] K :=
779+
{ to_linear_map := of_real_lm, norm_map' := by simp [norm_eq_abs] }
780+
781+
@[simp] lemma of_real_li_apply : ((of_real_li : ℝ →ₗᵢ[ℝ] K) : ℝ → K) = coe := rfl
782+
783+
/-- The `ℝ → K` coercion, as a continuous linear map -/
784+
noncomputable def of_real_clm : ℝ →L[ℝ] K := of_real_li.to_continuous_linear_map
785+
786+
@[simp] lemma of_real_clm_coe : ((of_real_clm : ℝ →L[ℝ] K) : ℝ →ₗ[ℝ] K) = of_real_lm := rfl
787+
788+
@[simp] lemma of_real_clm_apply : (of_real_clm : ℝ → K) = coe := rfl
789+
790+
@[simp] lemma of_real_clm_norm : ∥(of_real_clm : ℝ →L[ℝ] K)∥ = 1 :=
791+
of_real_li.norm_to_continuous_linear_map
792+
793+
@[continuity] lemma continuous_of_real : continuous (coe : ℝ → K) := of_real_li.continuous
794+
795+
end linear_maps
796+
710797
end is_R_or_C
711798

712799
section normalization

0 commit comments

Comments
 (0)