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

Commit e282089

Browse files
committed
feat(linear_algebra/sesquilinear_form): preliminary results for nondegeneracy (#12269)
Several lemmas needed to define nondegenerate bilinear forms and show that the canonical pairing of the algebraic dual is nondegenerate. Add domain restriction of bilinear maps in the second component and in both compenents. Some type-class generalizations for symmetric, alternating, and reflexive sesquilinear forms.
1 parent 076490a commit e282089

File tree

6 files changed

+139
-27
lines changed

6 files changed

+139
-27
lines changed

src/algebra/quandle.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def to_envel_group.map {R : Type*} [rack R] {G : Type*} [group G] :
595595
{ to_fun := λ x, quotient.lift_on x (to_envel_group.map_aux f)
596596
(λ a b ⟨hab⟩, to_envel_group.map_aux.well_def f hab),
597597
map_one' := begin
598-
change quotient.lift_on ⟦unit⟧ (to_envel_group.map_aux f) _ = 1,
598+
change quotient.lift_on ⟦rack.pre_envel_group.unit⟧ (to_envel_group.map_aux f) _ = 1,
599599
simp [to_envel_group.map_aux],
600600
end,
601601
map_mul' := λ x y, quotient.induction_on₂ x y (λ x y, begin

src/linear_algebra/bilinear_form.lean

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -634,11 +634,6 @@ end
634634

635635
end basis
636636

637-
end bilin_form
638-
639-
640-
namespace bilin_form
641-
642637
/-- The proposition that a bilinear form is reflexive -/
643638
def is_refl (B : bilin_form R M) : Prop := ∀ (x y : M), B x y = 0 → B y x = 0
644639

@@ -748,7 +743,6 @@ lemma is_adjoint_pair.sub (h : is_adjoint_pair B₁ B₁' f₁ g₁) (h' : is_ad
748743
is_adjoint_pair B₁ B₁' (f₁ - f₁') (g₁ - g₁') :=
749744
λ x y, by rw [linear_map.sub_apply, linear_map.sub_apply, sub_left, sub_right, h, h']
750745

751-
variables {M₂' : Type*} [add_comm_monoid M₂'] [module R₂ M₂']
752746
variables {B₂' : bilin_form R₂ M₂'} {f₂ f₂' : M₂ →ₗ[R₂] M₂'} {g₂ g₂' : M₂' →ₗ[R₂] M₂}
753747

754748
lemma is_adjoint_pair.smul (c : R₂) (h : is_adjoint_pair B₂ B₂' f₂ g₂) :

src/linear_algebra/bilinear_map.lean

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Kenny Lau, Mario Carneiro
55
-/
66

77
import linear_algebra.basic
8+
import linear_algebra.basis
89

910
/-!
1011
# Basics on bilinear maps
@@ -29,6 +30,8 @@ commuting actions, and `ρ₁₂ : R →+* R₂` and `σ₁₂ : S →+* S₂`.
2930
bilinear
3031
-/
3132

33+
variables {ι₁ ι₂ : Type*}
34+
3235
namespace linear_map
3336

3437
section semiring
@@ -89,6 +92,9 @@ theorem ext₂ {f g : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P}
8992
(H : ∀ m n, f m n = g m n) : f = g :=
9093
linear_map.ext (λ m, linear_map.ext $ λ n, H m n)
9194

95+
lemma congr_fun₂ {f g : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P} (h : f = g) (x y) : f x y = g x y :=
96+
linear_map.congr_fun (linear_map.congr_fun h x) y
97+
9298
section
9399

94100
local attribute [instance] smul_comm_class.symm
@@ -106,6 +112,9 @@ end
106112

107113
@[simp] theorem flip_apply (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (m : M) (n : N) : flip f n m = f m n := rfl
108114

115+
@[simp] lemma flip_flip [smul_comm_class R₂ S₂ P] (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) :
116+
f.flip.flip = f := linear_map.ext₂ (λ x y, ((f.flip).flip_apply _ _).trans (f.flip_apply _ _))
117+
109118
open_locale big_operators
110119

111120
variables {R}
@@ -134,6 +143,24 @@ theorem map_sum₂ {ι : Type*} (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂]
134143
f (∑ i in t, x i) y = ∑ i in t, f (x i) y :=
135144
(flip f y).map_sum
136145

146+
/-- Restricting a bilinear map in the second entry -/
147+
def dom_restrict₂ (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (q : submodule S N) :
148+
M →ₛₗ[ρ₁₂] q →ₛₗ[σ₁₂] P :=
149+
{ to_fun := λ m, (f m).dom_restrict q,
150+
map_add' := λ m₁ m₂, linear_map.ext $ λ _, by simp only [map_add, dom_restrict_apply, add_apply],
151+
map_smul' := λ c m, linear_map.ext $ λ _, by simp only [map_smulₛₗ, dom_restrict_apply,
152+
smul_apply]}
153+
154+
lemma dom_restrict₂_apply (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (q : submodule S N) (x : M) (y : q) :
155+
f.dom_restrict₂ q x y = f x y := rfl
156+
157+
/-- Restricting a bilinear map in both components -/
158+
def dom_restrict₁₂ (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (p : submodule R M) (q : submodule S N) :
159+
p →ₛₗ[ρ₁₂] q →ₛₗ[σ₁₂] P := (f.dom_restrict p).dom_restrict₂ q
160+
161+
lemma dom_restrict₁₂_apply (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (p : submodule R M) (q : submodule S N)
162+
(x : p) (y : q) : f.dom_restrict₁₂ p q x y = f x y := rfl
163+
137164
end semiring
138165

139166
section comm_semiring
@@ -243,7 +270,13 @@ end comm_semiring
243270

244271
section comm_ring
245272

246-
variables {R M : Type*} [comm_ring R] [add_comm_group M] [module R M]
273+
variables {R R₂ S S₂ M N P : Type*}
274+
variables [comm_ring R] [comm_ring S] [comm_ring R₂] [comm_ring S₂]
275+
variables [add_comm_group M] [add_comm_group N] [add_comm_group P]
276+
variables [module R M] [module S N] [module R₂ P] [module S₂ P]
277+
variables [smul_comm_class S₂ R₂ P]
278+
variables {ρ₁₂ : R →+* R₂} {σ₁₂ : S →+* S₂}
279+
variables (b₁ : basis ι₁ R M) (b₂ : basis ι₂ S N)
247280

248281
lemma lsmul_injective [no_zero_smul_divisors R M] {x : R} (hx : x ≠ 0) :
249282
function.injective (lsmul R M x) :=
@@ -253,6 +286,22 @@ lemma ker_lsmul [no_zero_smul_divisors R M] {a : R} (ha : a ≠ 0) :
253286
(linear_map.lsmul R M a).ker = ⊥ :=
254287
linear_map.ker_eq_bot_of_injective (linear_map.lsmul_injective ha)
255288

289+
290+
/-- Two bilinear maps are equal when they are equal on all basis vectors. -/
291+
lemma ext_basis {B B' : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P}
292+
(h : ∀ i j, B (b₁ i) (b₂ j) = B' (b₁ i) (b₂ j)) : B = B' :=
293+
b₁.ext $ λ i, b₂.ext $ λ j, h i j
294+
295+
/-- Write out `B x y` as a sum over `B (b i) (b j)` if `b` is a basis. -/
296+
lemma sum_repr_mul_repr_mul {B : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P} (x y) :
297+
(b₁.repr x).sum (λ i xi, (b₂.repr y).sum (λ j yj, (ρ₁₂ xi) • (σ₁₂ yj) • B (b₁ i) (b₂ j))) =
298+
B x y :=
299+
begin
300+
conv_rhs { rw [← b₁.total_repr x, ← b₂.total_repr y] },
301+
simp_rw [finsupp.total_apply, finsupp.sum, map_sum₂, map_sum, map_smulₛₗ₂, map_smulₛₗ],
302+
end
303+
304+
256305
end comm_ring
257306

258307
end linear_map

src/linear_algebra/linear_pmap.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ This version works for modules over division rings. -/
113113
mk_span_singleton' x y $ λ c hc, (smul_eq_zero.1 hc).elim
114114
(λ hc, by rw [hc, zero_smul]) (λ hx', absurd hx' hx)
115115

116+
lemma mk_span_singleton_apply' (K : Type*) {E F : Type*} [division_ring K]
117+
[add_comm_group E] [module K E] [add_comm_group F] [module K F] {x : E} (hx : x ≠ 0) (y : F):
118+
(mk_span_singleton x y hx).to_fun
119+
⟨x, (submodule.mem_span_singleton_self x : x ∈ submodule.span K {x})⟩ = y :=
120+
begin
121+
convert linear_pmap.mk_span_singleton_apply x y _ (1 : K) _;
122+
simp [submodule.mem_span_singleton_self],
123+
end
124+
116125
/-- Projection to the first coordinate as a `linear_pmap` -/
117126
protected def fst (p : submodule R E) (p' : submodule R F) : linear_pmap R (E × F) E :=
118127
{ domain := p.prod p',

src/linear_algebra/matrix/bilinear_form.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ begin
179179
simp only [bilin_form.to_matrix'_apply, bilin_form.comp_apply, transpose_apply, matrix.mul_apply,
180180
linear_map.to_matrix', linear_equiv.coe_mk, sum_mul],
181181
rw sum_comm,
182-
conv_lhs { rw ← sum_repr_mul_repr_mul (pi.basis_fun R₃ n) (l _) (r _) },
182+
conv_lhs { rw ← bilin_form.sum_repr_mul_repr_mul (pi.basis_fun R₃ n) (l _) (r _) },
183183
rw finsupp.sum_fintype,
184184
{ apply sum_congr rfl,
185185
rintros i' -,
@@ -310,7 +310,7 @@ begin
310310
simp only [bilin_form.to_matrix_apply, bilin_form.comp_apply, transpose_apply, matrix.mul_apply,
311311
linear_map.to_matrix', linear_equiv.coe_mk, sum_mul],
312312
rw sum_comm,
313-
conv_lhs { rw ← sum_repr_mul_repr_mul b },
313+
conv_lhs { rw ← bilin_form.sum_repr_mul_repr_mul b },
314314
rw finsupp.sum_fintype,
315315
{ apply sum_congr rfl,
316316
rintros i' -,

src/linear_algebra/sesquilinear_form.lean

Lines changed: 77 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Authors: Andreas Swerdlow
66
import algebra.module.linear_map
77
import linear_algebra.bilinear_map
88
import linear_algebra.matrix.basis
9+
import linear_algebra.dual
10+
import linear_algebra.linear_pmap
911

1012
/-!
1113
# Sesquilinear form
@@ -52,24 +54,38 @@ variables [comm_semiring R] [comm_semiring R₁] [add_comm_monoid M₁] [module
5254
/-- The proposition that two elements of a sesquilinear form space are orthogonal -/
5355
def is_ortho (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] R) (x y) : Prop := B x y = 0
5456

55-
lemma is_ortho_def {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] R} {x y} :
56-
B.is_ortho x y ↔ B x y = 0 := iff.rfl
57+
lemma is_ortho_def {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] R} {x y} : B.is_ortho x y ↔ B x y = 0 := iff.rfl
5758

5859
lemma is_ortho_zero_left (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] R) (x) : is_ortho B (0 : M₁) x :=
59-
by { dunfold is_ortho, rw [ map_zero B, zero_apply] }
60+
by { dunfold is_ortho, rw [ map_zero B, zero_apply] }
6061

6162
lemma is_ortho_zero_right (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] R) (x) : is_ortho B x (0 : M₂) :=
62-
map_zero (B x)
63+
map_zero (B x)
64+
65+
lemma is_ortho_flip {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] R} {x y} :
66+
B.is_ortho x y ↔ B.flip.is_ortho y x :=
67+
by simp_rw [is_ortho_def, flip_apply]
6368

6469
/-- A set of vectors `v` is orthogonal with respect to some bilinear form `B` if and only
6570
if for all `i ≠ j`, `B (v i) (v j) = 0`. For orthogonality between two elements, use
6671
`bilin_form.is_ortho` -/
67-
def is_Ortho {n : Type*} (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] R) (v : n → M₁) : Prop :=
72+
def is_Ortho (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] R) (v : n → M₁) : Prop :=
6873
pairwise (B.is_ortho on v)
6974

70-
lemma is_Ortho_def {n : Type*} {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] R} {v : n → M₁} :
75+
lemma is_Ortho_def {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] R} {v : n → M₁} :
7176
B.is_Ortho v ↔ ∀ i j : n, i ≠ j → B (v i) (v j) = 0 := iff.rfl
7277

78+
lemma is_Ortho_flip (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] R) {v : n → M₁} :
79+
B.is_Ortho v ↔ B.flip.is_Ortho v :=
80+
begin
81+
simp_rw is_Ortho_def,
82+
split; intros h i j hij,
83+
{ rw flip_apply,
84+
exact h j i (ne.symm hij) },
85+
simp_rw flip_apply at h,
86+
exact h j i (ne.symm hij),
87+
end
88+
7389
end comm_ring
7490
section field
7591

@@ -127,14 +143,15 @@ end
127143

128144
end field
129145

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

136147
/-! ### Reflexive bilinear forms -/
137148

149+
section reflexive
150+
151+
variables [comm_semiring R] [comm_semiring R₁] [add_comm_monoid M₁] [module R₁ M₁]
152+
{I₁ : R₁ →+* R} {I₂ : R₁ →+* R}
153+
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] R}
154+
138155
/-- The proposition that a sesquilinear form is reflexive -/
139156
def is_refl (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] R) : Prop :=
140157
∀ (x y), B x y = 0 → B y x = 0
@@ -148,28 +165,56 @@ lemma eq_zero : ∀ {x y}, B x y = 0 → B y x = 0 := λ x y, H x y
148165
lemma ortho_comm {x y} : is_ortho B x y ↔ is_ortho B y x := ⟨eq_zero H, eq_zero H⟩
149166

150167
end is_refl
168+
end reflexive
151169

152170
/-! ### Symmetric bilinear forms -/
153171

172+
section symmetric
173+
174+
variables [comm_semiring R] [add_comm_monoid M] [module R M]
175+
{I : R →+* R} {B : M →ₛₗ[I] M →ₗ[R] R}
176+
154177
/-- The proposition that a sesquilinear form is symmetric -/
155-
def is_symm (B : M →ₗ[R] M →ₛₗ[I] R) : Prop :=
178+
def is_symm (B : M →ₛₗ[I] M →ₗ[R] R) : Prop :=
156179
∀ (x y), I (B x y) = B y x
157180

158181
namespace is_symm
159182

160-
variable (H : B'.is_symm)
161-
include H
183+
protected lemma eq (H : B.is_symm) (x y) : I (B x y) = B y x := H x y
162184

163-
protected lemma eq (x y) : (I (B' x y)) = B' y x := H x y
185+
lemma is_refl (H : B.is_symm) : B.is_refl := λ x y H1, by { rw ←H.eq, simp [H1] }
164186

165-
lemma is_refl : B'.is_refl := λ x y H1, by { rw [←H], simp [H1] }
187+
lemma ortho_comm (H : B.is_symm) {x y} : is_ortho B x y ↔ is_ortho B y x := H.is_refl.ortho_comm
166188

167-
lemma ortho_comm {x y} : is_ortho B' x y ↔ is_ortho B' y x := H.is_refl.ortho_comm
189+
lemma dom_restrict_symm (H : B.is_symm) (p : submodule R M) : (B.dom_restrict₁₂ p p).is_symm :=
190+
begin
191+
intros x y,
192+
simp_rw dom_restrict₁₂_apply,
193+
exact H x y,
194+
end
168195

169196
end is_symm
170197

198+
lemma is_symm_iff_eq_flip {B : M →ₗ[R] M →ₗ[R] R} : B.is_symm ↔ B = B.flip :=
199+
begin
200+
split; intro h,
201+
{ ext,
202+
rw [←h, flip_apply, ring_hom.id_apply] },
203+
intros x y,
204+
conv_lhs { rw h },
205+
rw [flip_apply, ring_hom.id_apply],
206+
end
207+
208+
end symmetric
209+
210+
171211
/-! ### Alternating bilinear forms -/
172212

213+
section alternating
214+
215+
variables [comm_ring R] [comm_semiring R₁] [add_comm_monoid M₁] [module R₁ M₁]
216+
{I₁ : R₁ →+* R} {I₂ : R₁ →+* R} {I : R₁ →+* R} {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] R}
217+
173218
/-- The proposition that a sesquilinear form is alternating -/
174219
def is_alt (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] R) : Prop := ∀ x, B x x = 0
175220

@@ -199,6 +244,21 @@ lemma ortho_comm {x y} : is_ortho B x y ↔ is_ortho B y x := H.is_refl.ortho_co
199244

200245
end is_alt
201246

247+
lemma is_alt_iff_eq_neg_flip [no_zero_divisors R] [char_zero R] {B : M₁ →ₛₗ[I] M₁ →ₛₗ[I] R} :
248+
B.is_alt ↔ B = -B.flip :=
249+
begin
250+
split; intro h,
251+
{ ext,
252+
simp_rw [neg_apply, flip_apply],
253+
exact (h.neg _ _).symm },
254+
intros x,
255+
let h' := congr_fun₂ h x x,
256+
simp only [neg_apply, flip_apply, ←add_eq_zero_iff_eq_neg] at h',
257+
exact add_self_eq_zero.mp h',
258+
end
259+
260+
end alternating
261+
202262
end linear_map
203263

204264
namespace submodule

0 commit comments

Comments
 (0)