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

Commit e37daad

Browse files
committed
feat(linear_algebra/sesquilinear_form): Add orthogonality properties (#10992)
Generalize lemmas about orthogonality from bilinear forms to sesquilinear forms.
1 parent b52cb02 commit e37daad

File tree

2 files changed

+195
-41
lines changed

2 files changed

+195
-41
lines changed

src/linear_algebra/bilinear_map.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,20 @@ section semiring
3737
variables {R : Type*} [semiring R] {S : Type*} [semiring S]
3838
variables {R₂ : Type*} [semiring R₂] {S₂ : Type*} [semiring S₂]
3939
variables {M : Type*} {N : Type*} {P : Type*}
40+
variables {M₂ : Type*} {N₂ : Type*} {P₂ : Type*}
4041
variables {Nₗ : Type*} {Pₗ : Type*}
4142
variables {M' : Type*} {N' : Type*} {P' : Type*}
4243

4344
variables [add_comm_monoid M] [add_comm_monoid N] [add_comm_monoid P]
45+
variables [add_comm_monoid M₂] [add_comm_monoid N₂] [add_comm_monoid P₂]
4446
variables [add_comm_monoid Nₗ] [add_comm_monoid Pₗ]
4547
variables [add_comm_group M'] [add_comm_group N'] [add_comm_group P']
4648
variables [module R M] [module S N] [module R₂ P] [module S₂ P]
49+
variables [module R M₂] [module S N₂] [module R P₂] [module S₂ P₂]
4750
variables [module R Pₗ] [module S Pₗ]
4851
variables [module R M'] [module S N'] [module R₂ P'] [module S₂ P']
4952
variables [smul_comm_class S₂ R₂ P] [smul_comm_class S R Pₗ] [smul_comm_class S₂ R₂ P']
53+
variables [smul_comm_class S₂ R P₂]
5054
variables {ρ₁₂ : R →+* R₂} {σ₁₂ : S →+* S₂}
5155

5256
variables (ρ₁₂ σ₁₂)
@@ -120,7 +124,7 @@ theorem map_sub₂ (f : M' →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P') (x y z)
120124
theorem map_add₂ (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (x₁ x₂ y) : f (x₁ + x₂) y = f x₁ y + f x₂ y :=
121125
(flip f y).map_add _ _
122126

123-
theorem map_smul₂ (f : M →ₗ[R] N →ₗ[S] Pₗ) (r : R) (x y) : f (r • x) y = r • f x y :=
127+
theorem map_smul₂ (f : M →ₗ[R] N₂ →ₛₗ[σ₁₂] P₂) (r : R) (x y) : f (r • x) y = r • f x y :=
124128
(flip f y).map_smul _ _
125129

126130
theorem map_smulₛₗ₂ (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (r : R) (x y) : f (r • x) y = (ρ₁₂ r) • f x y :=

src/linear_algebra/sesquilinear_form.lean

Lines changed: 190 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@ Authors: Andreas Swerdlow
55
-/
66
import algebra.module.linear_map
77
import linear_algebra.bilinear_map
8+
import linear_algebra.matrix.basis
89

910
/-!
1011
# Sesquilinear form
1112
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.
1518
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.
1921
20-
## Notations
22+
## Main declarations
2123
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
2427
2528
## References
2629
@@ -33,68 +36,107 @@ Sesquilinear form,
3336

3437
open_locale big_operators
3538

39+
variables {R R₁ R₂ R₃ M M₁ M₂ K K₁ K₂ V V₁ V₂ n: Type*}
40+
3641
namespace linear_map
3742

43+
/-! ### Orthogonal vectors -/
44+
3845
section comm_ring
3946

4047
-- 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}
4351

4452
/-- 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
4654

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} :
4856
B.is_ortho x y ↔ B x y = 0 := iff.rfl
4957

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 :=
5159
by { dunfold is_ortho, rw [ map_zero B, zero_apply] }
5260

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) :=
5462
map_zero (B x)
5563

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)
5669

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
5972

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
6475

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}
6580

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) :=
6784
begin
6885
dunfold is_ortho,
6986
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,
7289
cases H,
73-
{ trivial },
90+
{ rw I₁.map_eq_zero at H, trivial },
7491
{ exact H }}
7592
end
7693

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)) :=
7897
begin
7998
dunfold is_ortho,
8099
split; intro H,
81100
{ rw [map_smulₛₗ, H, smul_zero] },
82101
{ rw [map_smulₛₗ, smul_eq_zero] at H,
83102
cases H,
84-
{ rw [ring_equiv.to_ring_hom_eq_coe, ring_equiv.coe_to_ring_hom] at H,
103+
{ simp at H,
85104
exfalso,
86-
exact ha (I.map_eq_zero_iff.mp H) },
105+
exact ha H },
87106
{ exact H }}
88107
end
89108

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}
91135

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 -/
95137

96138
/-- 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 :=
98140
∀ (x y), B x y = 0 → B y x = 0
99141

100142
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
107149

108150
end is_refl
109151

152+
/-! ### Symmetric bilinear forms -/
153+
110154
/-- The proposition that a sesquilinear form is symmetric -/
111155
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
113157

114158
namespace is_symm
115159

116-
variable (H : B.is_symm)
160+
variable (H : B'.is_symm)
117161
include H
118162

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
120164

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] }
122166

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
124168

125169
end is_symm
126170

171+
/-! ### Alternating bilinear forms -/
172+
127173
/-- 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
129175

130176
namespace is_alt
131177

@@ -146,11 +192,115 @@ end
146192
lemma is_refl : B.is_refl :=
147193
begin
148194
intros x y h,
149-
rw [← neg H, h, neg_zero],
195+
rw [←neg H, h, neg_zero],
150196
end
151197

152198
lemma ortho_comm {x y} : is_ortho B x y ↔ is_ortho B y x := H.is_refl.ortho_comm
153199

154200
end is_alt
155201

156202
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

Comments
 (0)