@@ -4,6 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Oliver Nash
5
5
-/
6
6
import Mathlib.LinearAlgebra.Dual
7
+ import Mathlib.LinearAlgebra.Matrix.Basis
8
+ import Mathlib.LinearAlgebra.Matrix.BaseChange
9
+ import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix
7
10
8
11
/-!
9
12
# Perfect pairings of modules
@@ -21,6 +24,7 @@ to connect 1 and 2.
21
24
22
25
* `PerfectPairing`
23
26
* `PerfectPairing.flip`
27
+ * `PerfectPairing.dual`
24
28
* `PerfectPairing.toDualLeft`
25
29
* `PerfectPairing.toDualRight`
26
30
* `PerfectPairing.restrict`
@@ -161,6 +165,11 @@ include p in
161
165
theorem reflexive_right : IsReflexive R N :=
162
166
p.flip.reflexive_left
163
167
168
+ include p in
169
+ theorem finrank_eq [Module.Finite R M] [Module.Free R M] :
170
+ finrank R M = finrank R N :=
171
+ ((Module.Free.chooseBasis R M).toDualEquiv.trans p.toDualRight.symm).finrank_eq
172
+
164
173
private lemma restrict_aux
165
174
{M' N' : Type *} [AddCommGroup M'] [Module R M'] [AddCommGroup N'] [Module R N']
166
175
(i : M' →ₗ[R] M) (j : N' →ₗ[R] N)
@@ -206,6 +215,61 @@ section RestrictScalars
206
215
207
216
open Submodule (span)
208
217
218
+ /-- If a perfect pairing over a field `L` takes values in a subfield `K` along two `K`-subspaces
219
+ whose `L` span is full, then these subspaces induce a `K`-structure in the sense of
220
+ [ *Algebra I*, Bourbaki : Chapter II, §8.1 Definition 1 ] [bourbaki1989 ]. -/
221
+ lemma exists_basis_basis_of_span_eq_top_of_mem_algebraMap
222
+ {K L : Type *} [Field K] [Field L] [Algebra K L]
223
+ [Module L M] [Module L N] [Module K M] [Module K N] [IsScalarTower K L M]
224
+ (p : PerfectPairing L M N)
225
+ (M' : Submodule K M) (N' : Submodule K N)
226
+ (hM : span L (M' : Set M) = ⊤)
227
+ (hN : span L (N' : Set N) = ⊤)
228
+ (hp : ∀ᵉ (x ∈ M') (y ∈ N'), p x y ∈ (algebraMap K L).range) :
229
+ ∃ (n : ℕ) (b : Basis (Fin n) L M) (b' : Basis (Fin n) K M'), ∀ i, b i = b' i := by
230
+ classical
231
+ have : IsReflexive L M := p.reflexive_left
232
+ have : IsReflexive L N := p.reflexive_right
233
+ obtain ⟨v, hv₁, hv₂, hv₃⟩ := exists_linearIndependent L (M' : Set M)
234
+ rw [hM] at hv₂
235
+ let b : Basis _ L M := Basis.mk hv₃ <| by rw [← hv₂, Subtype.range_coe_subtype, Set.setOf_mem_eq]
236
+ have : Fintype v := Set.Finite.fintype <| Module.Finite.finite_basis b
237
+ set v' : v → M' := fun i ↦ ⟨i, hv₁ (Subtype.coe_prop i)⟩
238
+ have hv' : LinearIndependent K v' := by
239
+ replace hv₃ := hv₃.restrict_scalars (R := K) <| by
240
+ simp_rw [← Algebra.algebraMap_eq_smul_one]
241
+ exact NoZeroSMulDivisors.algebraMap_injective K L
242
+ rw [show ((↑) : v → M) = M'.subtype ∘ v' from rfl] at hv₃
243
+ exact hv₃.of_comp
244
+ suffices span K (Set.range v') = ⊤ by
245
+ let e := (Module.Finite.finite_basis b).equivFin
246
+ let b' : Basis _ K M' := Basis.mk hv' (by rw [this])
247
+ exact ⟨_, b.reindex e, b'.reindex e, fun i ↦ by simp [b, b']⟩
248
+ suffices span K v = M' by
249
+ apply Submodule.map_injective_of_injective M'.injective_subtype
250
+ rw [Submodule.map_span, ← Set.image_univ, Set.image_image]
251
+ simpa
252
+ refine le_antisymm (Submodule.span_le.mpr hv₁) fun m hm ↦ ?_
253
+ obtain ⟨w, hw₁, hw₂, hw₃⟩ := exists_linearIndependent L (N' : Set N)
254
+ rw [hN] at hw₂
255
+ let bN : Basis _ L N := Basis.mk hw₃ <| by rw [← hw₂, Subtype.range_coe_subtype, Set.setOf_mem_eq]
256
+ have : Fintype w := Set.Finite.fintype <| Module.Finite.finite_basis bN
257
+ have e : v ≃ w := Fintype.equivOfCardEq <| by rw [← Module.finrank_eq_card_basis b,
258
+ ← Module.finrank_eq_card_basis bN, p.finrank_eq]
259
+ let bM := bN.dualBasis.map p.toDualLeft.symm
260
+ have hbM (j : w) (x : M) (hx : x ∈ M') : bM.repr x j = p x (j : N) := by simp [bM, bN]
261
+ have hj (j : w) : bM.repr m j ∈ (algebraMap K L).range := (hbM _ _ hm) ▸ hp m hm j (hw₁ j.2 )
262
+ replace hp (i : w) (j : v) :
263
+ (bN.dualBasis.map p.toDualLeft.symm).toMatrix b i j ∈ (algebraMap K L).fieldRange := by
264
+ simp only [Basis.toMatrix, Basis.map_repr, LinearEquiv.symm_symm, LinearEquiv.trans_apply,
265
+ toDualLeft_apply, Basis.dualBasis_repr]
266
+ exact hp (b j) (by simpa [b] using hv₁ j.2 ) (bN i) (by simpa [bN] using hw₁ i.2 )
267
+ have hA (i j) : b.toMatrix bM i j ∈ (algebraMap K L).range :=
268
+ Matrix.mem_subfield_of_mul_eq_one_of_mem_subfield_left e _ (by simp) hp i j
269
+ have h_span : span K v = span K (Set.range b) := by simp [b]
270
+ rw [h_span, Basis.mem_span_iff_repr_mem, ← Basis.toMatrix_mulVec_repr bM b m]
271
+ exact fun i ↦ Subring.sum_mem _ fun j _ ↦ Subring.mul_mem _ (hA i j) (hj j)
272
+
209
273
variable {S : Type *}
210
274
[CommRing S] [Algebra S R] [Module S M] [Module S N] [IsScalarTower S R M] [IsScalarTower S R N]
211
275
[NoZeroSMulDivisors S R] [Nontrivial R]
@@ -272,18 +336,23 @@ def restrictScalars
272
336
p.flip.restrictScalarsAux_surjective j i h₂ (fun m n ↦ hp n m)⟩}
273
337
274
338
/-- Restriction of scalars for a perfect pairing taking values in a subfield. -/
275
- def restrictScalarsField {K : Type *} [Field K] [Algebra K R ]
276
- [Module K M] [Module K N] [IsScalarTower K R M] [IsScalarTower K R N]
277
- [Module K M'] [Module K N'] [FiniteDimensional K M']
339
+ def restrictScalarsField {K L : Type *} [Field K] [Field L] [ Algebra K L ]
340
+ [Module L M] [Module L N] [Module K M] [Module K N] [IsScalarTower K L M] [IsScalarTower K L N]
341
+ [Module K M'] [Module K N']
278
342
(i : M' →ₗ[K] M) (j : N' →ₗ[K] N)
279
343
(hi : Injective i) (hj : Injective j)
280
- (hM : span R (LinearMap.range i : Set M) = ⊤)
281
- (hN : span R (LinearMap.range j : Set N) = ⊤)
282
- (hp : ∀ m n, p (i m) (j n) ∈ (algebraMap K R).range) :
283
- PerfectPairing K M' N' :=
284
- PerfectPairing.mkOfInjective _
285
- (p.restrictScalarsAux_injective i j hi hN hp)
344
+ (hM : span L (LinearMap.range i : Set M) = ⊤)
345
+ (hN : span L (LinearMap.range j : Set N) = ⊤)
346
+ (p : PerfectPairing L M N)
347
+ (hp : ∀ m n, p (i m) (j n) ∈ (algebraMap K L).range) :
348
+ PerfectPairing K M' N' := by
349
+ suffices FiniteDimensional K M' from mkOfInjective _ (p.restrictScalarsAux_injective i j hi hN hp)
286
350
(p.flip.restrictScalarsAux_injective j i hj hM (fun m n ↦ hp n m))
351
+ obtain ⟨n, -, b', -⟩ := p.exists_basis_basis_of_span_eq_top_of_mem_algebraMap _ _ hM hN <| by
352
+ rintro - ⟨m, rfl⟩ - ⟨n, rfl⟩
353
+ exact hp m n
354
+ have : FiniteDimensional K (LinearMap.range i) := FiniteDimensional.of_fintype_basis b'
355
+ exact Finite.equiv (LinearEquiv.ofInjective i hi).symm
287
356
288
357
end RestrictScalars
289
358
@@ -341,6 +410,12 @@ def toPerfectPairing : PerfectPairing R N M where
341
410
342
411
end LinearEquiv
343
412
413
+ /-- A perfect pairing induces a perfect pairing between dual spaces. -/
414
+ def PerfectPairing.dual (p : PerfectPairing R M N) :
415
+ PerfectPairing R (Dual R M) (Dual R N) :=
416
+ let _i := p.reflexive_right
417
+ (p.toDualRight.symm.trans (evalEquiv R N)).toPerfectPairing
418
+
344
419
namespace Submodule
345
420
346
421
open LinearEquiv
0 commit comments