@@ -5,22 +5,25 @@ Authors: Andreas Swerdlow
5
5
-/
6
6
import algebra.module.linear_map
7
7
import linear_algebra.bilinear_map
8
+ import linear_algebra.matrix.basis
8
9
9
10
/-!
10
11
# Sesquilinear form
11
12
12
- This file defines a sesquilinear form over a module. The definition requires a ring antiautomorphism
13
- on the scalar ring. Basic ideas such as
14
- orthogonality are also introduced.
13
+ This files provides properties about sesquilinear forms. The maps considered are of the form
14
+ `M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] R`, where `I₁ : R₁ →+* R` and `I₂ : R₂ →+* R` are ring homomorphisms and
15
+ `M₁` is a module over `R₁` and `M₂` is a module over `R₂`.
16
+ Sesquilinear forms are the special case that `M₁ = M₂`, `R₁ = R₂ = R`, and `I₁ = ring_hom.id R`.
17
+ Taking additionally `I₂ = ring_hom.id R`, then one obtains bilinear forms.
15
18
16
- A sesquilinear form on an `R`-module `M`, is a function from `M × M` to `R`, that is linear in the
17
- first argument and antilinear in the second, with respect to an antiautomorphism on `R` (an
18
- antiisomorphism from `R` to `R`).
19
+ These forms are a special case of the bilinear maps defined in `bilinear_map.lean` and all basic
20
+ lemmas about construction and elementary calculations are found there.
19
21
20
- ## Notations
22
+ ## Main declarations
21
23
22
- Given any term `S` of type `sesq_form`, due to a coercion, can use the notation `S x y` to
23
- refer to the function field, ie. `S x y = S.sesq x y`.
24
+ * `is_ortho`: states that two vectors are orthogonal with respect to a sesquilinear form
25
+ * `is_symm`, `is_alt`: states that a sesquilinear form is symmetric and alternating, respectively
26
+ * `orthogonal_bilin`: provides the orthogonal complement with respect to sesquilinear form
24
27
25
28
## References
26
29
@@ -33,68 +36,107 @@ Sesquilinear form,
33
36
34
37
open_locale big_operators
35
38
39
+ variables {R R₁ R₂ R₃ M M₁ M₂ K K₁ K₂ V V₁ V₂ n: Type *}
40
+
36
41
namespace linear_map
37
42
43
+ /-! ### Orthogonal vectors -/
44
+
38
45
section comm_ring
39
46
40
47
-- the `ₗ` subscript variables are for special cases about linear (as opposed to semilinear) maps
41
- variables {R : Type *} {M : Type *} [comm_semiring R] [add_comm_monoid M] [module R M]
42
- {I : R →+* R}
48
+ variables [comm_semiring R] [comm_semiring R₁] [add_comm_monoid M₁] [module R₁ M₁]
49
+ [comm_semiring R₂] [add_comm_monoid M₂] [module R₂ M₂]
50
+ {I₁ : R₁ →+* R} {I₂ : R₂ →+* R} {I₁' : R₁ →+* R}
43
51
44
52
/-- The proposition that two elements of a sesquilinear form space are orthogonal -/
45
- def is_ortho (B : M →ₗ[R ] M →ₛₗ[I] R) (x y) : Prop := B x y = 0
53
+ def is_ortho (B : M₁ →ₛₗ[I₁ ] M₂ →ₛₗ[I₂ ] R) (x y) : Prop := B x y = 0
46
54
47
- lemma is_ortho_def {B : M →ₗ[R ] M →ₛₗ[I] R} {x y : M } :
55
+ lemma is_ortho_def {B : M₁ →ₛₗ[I₁ ] M₂ →ₛₗ[I₂ ] R} {x y} :
48
56
B.is_ortho x y ↔ B x y = 0 := iff.rfl
49
57
50
- lemma is_ortho_zero_left (B : M →ₗ[R ] M →ₛₗ[I] R) (x) : is_ortho B (0 : M) x :=
58
+ lemma is_ortho_zero_left (B : M₁ →ₛₗ[I₁ ] M₂ →ₛₗ[I₂ ] R) (x) : is_ortho B (0 : M₁ ) x :=
51
59
by { dunfold is_ortho, rw [ map_zero B, zero_apply] }
52
60
53
- lemma is_ortho_zero_right (B : M →ₗ[R ] M →ₛₗ[I] R) (x) : is_ortho B x (0 : M) :=
61
+ lemma is_ortho_zero_right (B : M₁ →ₛₗ[I₁ ] M₂ →ₛₗ[I₂ ] R) (x) : is_ortho B x (0 : M₂ ) :=
54
62
map_zero (B x)
55
63
64
+ /-- A set of vectors `v` is orthogonal with respect to some bilinear form `B` if and only
65
+ if for all `i ≠ j`, `B (v i) (v j) = 0`. For orthogonality between two elements, use
66
+ `bilin_form.is_ortho` -/
67
+ def is_Ortho {n : Type *} (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] R) (v : n → M₁) : Prop :=
68
+ pairwise (B.is_ortho on v)
56
69
57
- end comm_ring
58
- section is_domain
70
+ lemma is_Ortho_def {n : Type *} {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] R} {v : n → M₁} :
71
+ B.is_Ortho v ↔ ∀ i j : n, i ≠ j → B (v i) (v j) = 0 := iff.rfl
59
72
60
- variables {R : Type *} {M : Type *} [comm_ring R] [is_domain R] [add_comm_group M]
61
- [module R M]
62
- {I : R ≃+* R}
63
- {B : M →ₗ[R] M →ₛₗ[I.to_ring_hom] R}
73
+ end comm_ring
74
+ section field
64
75
76
+ variables [field K] [field K₁] [add_comm_group V₁] [module K₁ V₁]
77
+ [field K₂] [add_comm_group V₂] [module K₂ V₂]
78
+ {I₁ : K₁ →+* K} {I₂ : K₂ →+* K} {I₁' : K₁ →+* K}
79
+ {J₁ : K →+* K} {J₂ : K →+* K}
65
80
66
- lemma ortho_smul_left {x y} {a : R} (ha : a ≠ 0 ) : (is_ortho B x y) ↔ (is_ortho B (a • x) y) :=
81
+ -- todo: this also holds for [comm_ring R] [is_domain R] when J₁ is invertible
82
+ lemma ortho_smul_left {B : V₁ →ₛₗ[I₁] V₂ →ₛₗ[I₂] K} {x y} {a : K₁} (ha : a ≠ 0 ) :
83
+ (is_ortho B x y) ↔ (is_ortho B (a • x) y) :=
67
84
begin
68
85
dunfold is_ortho,
69
86
split; intro H,
70
- { rw [map_smul, smul_apply, H, smul_zero] },
71
- { rw [map_smul, smul_apply , smul_eq_zero] at H,
87
+ { rw [map_smulₛₗ₂, H, smul_zero]},
88
+ { rw [map_smulₛₗ₂ , smul_eq_zero] at H,
72
89
cases H,
73
- { trivial },
90
+ { rw I₁.map_eq_zero at H, trivial },
74
91
{ exact H }}
75
92
end
76
93
77
- lemma ortho_smul_right {x y} {a : R} {ha : a ≠ 0 } : (is_ortho B x y) ↔ (is_ortho B x (a • y)) :=
94
+ -- todo: this also holds for [comm_ring R] [is_domain R] when J₂ is invertible
95
+ lemma ortho_smul_right {B : V₁ →ₛₗ[I₁] V₂ →ₛₗ[I₂] K} {x y} {a : K₂} {ha : a ≠ 0 } :
96
+ (is_ortho B x y) ↔ (is_ortho B x (a • y)) :=
78
97
begin
79
98
dunfold is_ortho,
80
99
split; intro H,
81
100
{ rw [map_smulₛₗ, H, smul_zero] },
82
101
{ rw [map_smulₛₗ, smul_eq_zero] at H,
83
102
cases H,
84
- { rw [ring_equiv.to_ring_hom_eq_coe, ring_equiv.coe_to_ring_hom] at H,
103
+ { simp at H,
85
104
exfalso,
86
- exact ha (I.map_eq_zero_iff.mp H) },
105
+ exact ha H },
87
106
{ exact H }}
88
107
end
89
108
90
- end is_domain
109
+ /-- A set of orthogonal vectors `v` with respect to some sesquilinear form `B` is linearly
110
+ independent if for all `i`, `B (v i) (v i) ≠ 0`. -/
111
+ lemma linear_independent_of_is_Ortho {B : V₁ →ₛₗ[I₁] V₁ →ₛₗ[I₁'] K} {v : n → V₁}
112
+ (hv₁ : B.is_Ortho v) (hv₂ : ∀ i, ¬ B.is_ortho (v i) (v i)) : linear_independent K₁ v :=
113
+ begin
114
+ classical,
115
+ rw linear_independent_iff',
116
+ intros s w hs i hi,
117
+ have : B (s.sum $ λ (i : n), w i • v i) (v i) = 0 ,
118
+ { rw [hs, map_zero, zero_apply] },
119
+ have hsum : s.sum (λ (j : n), I₁(w j) * B (v j) (v i)) = I₁(w i) * B (v i) (v i),
120
+ { apply finset.sum_eq_single_of_mem i hi,
121
+ intros j hj hij,
122
+ rw [is_Ortho_def.1 hv₁ _ _ hij, mul_zero], },
123
+ simp_rw [B.map_sum₂, map_smulₛₗ₂, smul_eq_mul, hsum] at this ,
124
+ apply I₁.map_eq_zero.mp,
125
+ exact eq_zero_of_ne_zero_of_mul_right_eq_zero (hv₂ i) this ,
126
+ end
127
+
128
+ end field
129
+
130
+ variables [comm_ring R] [add_comm_group M] [module R M]
131
+ [comm_ring R₁] [add_comm_group M₁] [module R₁ M₁]
132
+ {I : R →+* R} {I₁ : R₁ →+* R} {I₂ : R₁ →+* R}
133
+ {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] R}
134
+ {B' : M →ₗ[R] M →ₛₗ[I] R}
91
135
92
- variables {R : Type *} {M : Type *} [comm_ring R] [add_comm_group M] [module R M]
93
- {I : R →+* R}
94
- {B : M →ₗ[R] M →ₛₗ[I] R}
136
+ /-! ### Reflexive bilinear forms -/
95
137
96
138
/-- The proposition that a sesquilinear form is reflexive -/
97
- def is_refl (B : M →ₗ[R ] M →ₛₗ[I] R) : Prop :=
139
+ def is_refl (B : M₁ →ₛₗ[I₁ ] M₁ →ₛₗ[I₂ ] R) : Prop :=
98
140
∀ (x y), B x y = 0 → B y x = 0
99
141
100
142
namespace is_refl
@@ -107,25 +149,29 @@ lemma ortho_comm {x y} : is_ortho B x y ↔ is_ortho B y x := ⟨eq_zero H, eq_z
107
149
108
150
end is_refl
109
151
152
+ /-! ### Symmetric bilinear forms -/
153
+
110
154
/-- The proposition that a sesquilinear form is symmetric -/
111
155
def is_symm (B : M →ₗ[R] M →ₛₗ[I] R) : Prop :=
112
- ∀ (x y), ( I (B x y) ) = B y x
156
+ ∀ (x y), I (B x y) = B y x
113
157
114
158
namespace is_symm
115
159
116
- variable (H : B.is_symm)
160
+ variable (H : B' .is_symm)
117
161
include H
118
162
119
- protected lemma eq (x y) : (I (B x y)) = B y x := H x y
163
+ protected lemma eq (x y) : (I (B' x y)) = B' y x := H x y
120
164
121
- lemma is_refl : B.is_refl := λ x y H1, by { rw [←H], simp [H1] }
165
+ lemma is_refl : B' .is_refl := λ x y H1, by { rw [←H], simp [H1] }
122
166
123
- lemma ortho_comm {x y} : is_ortho B x y ↔ is_ortho B y x := H.is_refl.ortho_comm
167
+ lemma ortho_comm {x y} : is_ortho B' x y ↔ is_ortho B' y x := H.is_refl.ortho_comm
124
168
125
169
end is_symm
126
170
171
+ /-! ### Alternating bilinear forms -/
172
+
127
173
/-- The proposition that a sesquilinear form is alternating -/
128
- def is_alt (B : M →ₗ[R ] M →ₛₗ[I] R) : Prop := ∀ (x : M) , B x x = 0
174
+ def is_alt (B : M₁ →ₛₗ[I₁ ] M₁ →ₛₗ[I₂ ] R) : Prop := ∀ x , B x x = 0
129
175
130
176
namespace is_alt
131
177
@@ -146,11 +192,115 @@ end
146
192
lemma is_refl : B.is_refl :=
147
193
begin
148
194
intros x y h,
149
- rw [← neg H, h, neg_zero],
195
+ rw [←neg H, h, neg_zero],
150
196
end
151
197
152
198
lemma ortho_comm {x y} : is_ortho B x y ↔ is_ortho B y x := H.is_refl.ortho_comm
153
199
154
200
end is_alt
155
201
156
202
end linear_map
203
+
204
+ namespace submodule
205
+
206
+ /-! ### The orthogonal complement -/
207
+
208
+ variables [comm_ring R] [comm_ring R₁] [add_comm_group M₁] [module R₁ M₁]
209
+ {I₁ : R₁ →+* R} {I₂ : R₁ →+* R}
210
+ {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] R}
211
+
212
+ /-- The orthogonal complement of a submodule `N` with respect to some bilinear form is the set of
213
+ elements `x` which are orthogonal to all elements of `N`; i.e., for all `y` in `N`, `B x y = 0`.
214
+
215
+ Note that for general (neither symmetric nor antisymmetric) bilinear forms this definition has a
216
+ chirality; in addition to this "left" orthogonal complement one could define a "right" orthogonal
217
+ complement for which, for all `y` in `N`, `B y x = 0`. This variant definition is not currently
218
+ provided in mathlib. -/
219
+ def orthogonal_bilin (N : submodule R₁ M₁) (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] R) : submodule R₁ M₁ :=
220
+ { carrier := { m | ∀ n ∈ N, B.is_ortho n m },
221
+ zero_mem' := λ x _, B.is_ortho_zero_right x,
222
+ add_mem' := λ x y hx hy n hn,
223
+ by rw [linear_map.is_ortho, map_add, show B n x = 0 , by exact hx n hn,
224
+ show B n y = 0 , by exact hy n hn, zero_add],
225
+ smul_mem' := λ c x hx n hn,
226
+ by rw [linear_map.is_ortho, linear_map.map_smulₛₗ, show B n x = 0 , by exact hx n hn,
227
+ smul_zero] }
228
+
229
+ variables {N L : submodule R₁ M₁}
230
+
231
+ @[simp] lemma mem_orthogonal_bilin_iff {m : M₁} :
232
+ m ∈ N.orthogonal_bilin B ↔ ∀ n ∈ N, B.is_ortho n m := iff.rfl
233
+
234
+ lemma orthogonal_bilin_le (h : N ≤ L) : L.orthogonal_bilin B ≤ N.orthogonal_bilin B :=
235
+ λ _ hn l hl, hn l (h hl)
236
+
237
+ lemma le_orthogonal_bilin_orthogonal_bilin (b : B.is_refl) :
238
+ N ≤ (N.orthogonal_bilin B).orthogonal_bilin B :=
239
+ λ n hn m hm, b _ _ (hm n hn)
240
+
241
+ end submodule
242
+
243
+ namespace linear_map
244
+
245
+ section orthogonal
246
+
247
+ variables [field K] [add_comm_group V] [module K V]
248
+ [field K₁] [add_comm_group V₁] [module K₁ V₁]
249
+ {J : K →+* K} {J₁ : K₁ →+* K} {J₁' : K₁ →+* K}
250
+
251
+ -- ↓ This lemma only applies in fields as we require `a * b = 0 → a = 0 ∨ b = 0`
252
+ lemma span_singleton_inf_orthogonal_eq_bot
253
+ (B : V₁ →ₛₗ[J₁] V₁ →ₛₗ[J₁'] K) (x : V₁) (hx : ¬ B.is_ortho x x) :
254
+ (K₁ ∙ x) ⊓ submodule.orthogonal_bilin (K₁ ∙ x) B = ⊥ :=
255
+ begin
256
+ rw ← finset.coe_singleton,
257
+ refine eq_bot_iff.2 (λ y h, _),
258
+ rcases mem_span_finset.1 h.1 with ⟨μ, rfl⟩,
259
+ have := h.2 x _,
260
+ { rw finset.sum_singleton at this ⊢,
261
+ suffices hμzero : μ x = 0 ,
262
+ { rw [hμzero, zero_smul, submodule.mem_bot] },
263
+ change B x (μ x • x) = 0 at this , rw [map_smulₛₗ, smul_eq_mul] at this ,
264
+ exact or.elim (zero_eq_mul.mp this.symm)
265
+ (λ y, by { simp at y, exact y })
266
+ (λ hfalse, false.elim $ hx hfalse) },
267
+ { rw submodule.mem_span; exact λ _ hp, hp $ finset.mem_singleton_self _ }
268
+ end
269
+
270
+ -- ↓ This lemma only applies in fields since we use the `mul_eq_zero`
271
+ lemma orthogonal_span_singleton_eq_to_lin_ker {B : V →ₗ[K] V →ₛₗ[J] K} (x : V) :
272
+ submodule.orthogonal_bilin (K ∙ x) B = (B x).ker :=
273
+ begin
274
+ ext y,
275
+ simp_rw [submodule.mem_orthogonal_bilin_iff, linear_map.mem_ker,
276
+ submodule.mem_span_singleton ],
277
+ split,
278
+ { exact λ h, h x ⟨1 , one_smul _ _⟩ },
279
+ { rintro h _ ⟨z, rfl⟩,
280
+ rw [is_ortho, map_smulₛₗ₂, smul_eq_zero],
281
+ exact or.intro_right _ h }
282
+ end
283
+
284
+
285
+ -- todo: Generalize this to sesquilinear maps
286
+ lemma span_singleton_sup_orthogonal_eq_top {B : V →ₗ[K] V →ₗ[K] K}
287
+ {x : V} (hx : ¬ B.is_ortho x x) :
288
+ (K ∙ x) ⊔ submodule.orthogonal_bilin (K ∙ x) B = ⊤ :=
289
+ begin
290
+ rw orthogonal_span_singleton_eq_to_lin_ker,
291
+ exact (B x).span_singleton_sup_ker_eq_top hx,
292
+ end
293
+
294
+
295
+ -- todo: Generalize this to sesquilinear maps
296
+ /-- Given a bilinear form `B` and some `x` such that `B x x ≠ 0`, the span of the singleton of `x`
297
+ is complement to its orthogonal complement. -/
298
+ lemma is_compl_span_singleton_orthogonal {B : V →ₗ[K] V →ₗ[K] K}
299
+ {x : V} (hx : ¬ B.is_ortho x x) : is_compl (K ∙ x) (submodule.orthogonal_bilin (K ∙ x) B) :=
300
+ { inf_le_bot := eq_bot_iff.1 $
301
+ (span_singleton_inf_orthogonal_eq_bot B x hx),
302
+ top_le_sup := eq_top_iff.1 $ span_singleton_sup_orthogonal_eq_top hx }
303
+
304
+ end orthogonal
305
+
306
+ end linear_map
0 commit comments