|
| 1 | +/- |
| 2 | +Copyright (c) 2024 Christian Merten. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Christian Merten |
| 5 | +-/ |
| 6 | +import Mathlib.Algebra.Exact |
| 7 | +import Mathlib.Algebra.Module.Submodule.Pointwise |
| 8 | +import Mathlib.LinearAlgebra.Basis.Basic |
| 9 | + |
| 10 | +/-! |
| 11 | +# Basis from a split exact sequence |
| 12 | +
|
| 13 | +Let `0 → K → M → P → 0` be a split exact sequence of `R`-modules, let `s : M → K` be a |
| 14 | +retraction of `f` and `v` be a basis of `M` indexed by `κ ⊕ σ`. Then |
| 15 | +if `s vᵢ = 0` for `i : κ` and `(s vⱼ)ⱼ` is linear independent for `j : σ`, then |
| 16 | +the images of `vᵢ` for `i : κ` form a basis of `P`. |
| 17 | +
|
| 18 | +We treat linear independence and the span condition separately. For convenience this |
| 19 | +is stated not for `κ ⊕ σ`, but for an arbitrary type `ι` with two maps `κ → ι` and `σ → ι`. |
| 20 | +-/ |
| 21 | + |
| 22 | +variable {R M K P : Type*} [Ring R] [AddCommGroup M] [AddCommGroup K] [AddCommGroup P] |
| 23 | +variable [Module R M] [Module R K] [Module R P] |
| 24 | +variable {f : K →ₗ[R] M} {g : M →ₗ[R] P} {s : M →ₗ[R] K} |
| 25 | +variable (hs : s ∘ₗ f = LinearMap.id) (hfg : Function.Exact f g) |
| 26 | +variable {ι κ σ : Type*} {v : ι → M} {a : κ → ι} {b : σ → ι} |
| 27 | +include hs hfg |
| 28 | + |
| 29 | +lemma LinearIndependent.linearIndependent_of_exact_of_retraction |
| 30 | + (hainj : Function.Injective a) (hsa : ∀ i, s (v (a i)) = 0) |
| 31 | + (hli : LinearIndependent R v) : |
| 32 | + LinearIndependent R (g ∘ v ∘ a) := by |
| 33 | + apply (LinearIndependent.comp hli a hainj).map |
| 34 | + rw [Submodule.disjoint_def, hfg.linearMap_ker_eq] |
| 35 | + rintro - hy ⟨y, rfl⟩ |
| 36 | + have hz : s (f y) = 0 := by |
| 37 | + revert hy |
| 38 | + generalize f y = x |
| 39 | + intro hy |
| 40 | + induction' hy using Submodule.span_induction with m hm |
| 41 | + · obtain ⟨i, rfl⟩ := hm |
| 42 | + apply hsa |
| 43 | + all_goals simp_all |
| 44 | + replace hs := DFunLike.congr_fun hs y |
| 45 | + simp only [LinearMap.coe_comp, Function.comp_apply, LinearMap.id_coe, id_eq] at hs |
| 46 | + rw [← hs, hz, map_zero] |
| 47 | + |
| 48 | +private lemma top_le_span_of_aux (v : κ ⊕ σ → M) |
| 49 | + (hg : Function.Surjective g) (hslzero : ∀ i, s (v (.inl i)) = 0) |
| 50 | + (hli : LinearIndependent R (s ∘ v ∘ .inr)) (hsp : ⊤ ≤ Submodule.span R (Set.range v)) : |
| 51 | + ⊤ ≤ Submodule.span R (Set.range <| g ∘ v ∘ .inl) := by |
| 52 | + rintro p - |
| 53 | + obtain ⟨m, rfl⟩ := hg p |
| 54 | + wlog h : m ∈ LinearMap.ker s |
| 55 | + · let x : M := f (s m) |
| 56 | + rw [show g m = g (m - f (s m)) by simp [hfg.apply_apply_eq_zero]] |
| 57 | + apply this hs hfg v hg hslzero hli hsp |
| 58 | + replace hs := DFunLike.congr_fun hs (s m) |
| 59 | + simp only [LinearMap.coe_comp, Function.comp_apply, LinearMap.id_coe, id_eq] at hs |
| 60 | + simp [hs] |
| 61 | + have : m ∈ Submodule.span R (Set.range v) := hsp trivial |
| 62 | + obtain ⟨c, rfl⟩ := Finsupp.mem_span_range_iff_exists_finsupp.mp this |
| 63 | + simp only [LinearMap.mem_ker, Finsupp.sum, map_sum, map_smul, |
| 64 | + Finset.sum_sum_eq_sum_toLeft_add_sum_toRight, map_add, hslzero, smul_zero, |
| 65 | + Finset.sum_const_zero, zero_add] at h |
| 66 | + replace hli := (linearIndependent_iff'.mp hli) c.support.toRight (c ∘ .inr) h |
| 67 | + simp only [Finset.mem_toRight, Finsupp.mem_support_iff, Function.comp_apply, not_imp_self] at hli |
| 68 | + simp only [Finsupp.sum, Finset.sum_sum_eq_sum_toLeft_add_sum_toRight, hli, zero_smul, |
| 69 | + Finset.sum_const_zero, add_zero, map_sum, map_smul] |
| 70 | + exact Submodule.sum_mem _ (fun i hi ↦ Submodule.smul_mem _ _ <| Submodule.subset_span ⟨i, rfl⟩) |
| 71 | + |
| 72 | +lemma Submodule.top_le_span_of_exact_of_retraction (hg : Function.Surjective g) |
| 73 | + (hsa : ∀ i, s (v (a i)) = 0) (hlib : LinearIndependent R (s ∘ v ∘ b)) |
| 74 | + (hab : Codisjoint (Set.range a) (Set.range b)) |
| 75 | + (hsp : ⊤ ≤ Submodule.span R (Set.range v)) : |
| 76 | + ⊤ ≤ Submodule.span R (Set.range <| g ∘ v ∘ a) := by |
| 77 | + apply top_le_span_of_aux hs hfg (Sum.elim (v ∘ a) (v ∘ b)) hg hsa hlib |
| 78 | + simp only [codisjoint_iff, Set.sup_eq_union, Set.top_eq_univ] at hab |
| 79 | + rwa [Set.Sum.elim_range, Set.range_comp, Set.range_comp, ← Set.image_union, hab, Set.image_univ] |
| 80 | + |
| 81 | +/-- Let `0 → K → M → P → 0` be a split exact sequence of `R`-modules, let `s : M → K` be a |
| 82 | +retraction of `f` and `v` be a basis of `M` indexed by `κ ⊕ σ`. Then |
| 83 | +if `s vᵢ = 0` for `i : κ` and `(s vⱼ)ⱼ` is linear independent for `j : σ`, then |
| 84 | +the images of `vᵢ` for `i : κ` form a basis of `P`. |
| 85 | +
|
| 86 | +For convenience this is stated for an arbitrary type `ι` with two maps `κ → ι` and `σ → ι`. -/ |
| 87 | +noncomputable def Basis.ofSplitExact (hg : Function.Surjective g) (v : Basis ι R M) |
| 88 | + (hainj : Function.Injective a) (hsa : ∀ i, s (v (a i)) = 0) |
| 89 | + (hlib : LinearIndependent R (s ∘ v ∘ b)) |
| 90 | + (hab : Codisjoint (Set.range a) (Set.range b)) : |
| 91 | + Basis κ R P := |
| 92 | + Basis.mk (v.linearIndependent.linearIndependent_of_exact_of_retraction hs hfg hainj hsa) |
| 93 | + (Submodule.top_le_span_of_exact_of_retraction hs hfg hg hsa hlib hab (by rw [v.span_eq])) |
0 commit comments