Source context 4 commands
Surrounding namespaces, section variables, and local commands at this declaration.
@[expose] public section
noncomputable section
universe u v w t z
open scoped TensorProduct Matrixtheorem retraction_of_unit_maximalMinors
{T C V κ ι : Type*} [CommRing T] [AddCommGroup C] [Module T C]
[AddCommGroup V] [Module T V] [Fintype κ] [Finite ι] [DecidableEq κ]
(b : Module.Basis ι T V) (v : κ → C) (g : C →ₗ[T] V) (d : T)
(hd : IsUnit d) (hv : Submodule.span T (Set.range v) = ⊤)
(hminor : d ∈ Ideal.span (Set.range fun c : κ → ι =>
((Matrix.of fun j i => b.repr (g (v j)) i).submatrix _root_.id c).det)) :
∃ l : V →ₗ[T] C, l.comp g = LinearMap.id := by
classical
let _ : Fintype ι := Fintype.ofFinite ι
let bκ := Pi.basisFun T κ
let F : (κ → T) →ₗ[T] C := bκ.constr T v
have hF : Function.Surjective F := by
apply LinearMap.range_eq_top.mp
rw [show F = bκ.constr T v from rfl, Module.Basis.constr_range, hv]
let A : Matrix κ ι T := Matrix.of fun j i => b.repr (g (v j)) i
obtain ⟨S, hS⟩ := Matrix.exists_mul_eq_smul_one_of_mem_span_maximalMinors A d hminor
let U : V →ₗ[T] (κ → T) := Matrix.toLin b bκ S.transpose
have hA : LinearMap.toMatrix bκ b (g.comp F) = A.transpose := by
apply Matrix.ext
intro i j
rw [LinearMap.toMatrix_apply, LinearMap.comp_apply]
change b.repr (g ((bκ.constr T v) (bκ j))) i = _
rw [Module.Basis.constr_basis]
rfl
have hUF : U.comp (g.comp F) = d • (LinearMap.id : (κ → T) →ₗ[T] (κ → T)) := by
apply (LinearMap.toMatrix bκ bκ).injective
rw [LinearMap.toMatrix_comp bκ b bκ, hA]
change LinearMap.toMatrix b bκ (Matrix.toLin b bκ S.transpose) * A.transpose = _
rw [LinearMap.toMatrix_toLin, ← Matrix.transpose_mul, hS,
Matrix.transpose_smul, Matrix.transpose_one, map_smul, LinearMap.toMatrix_id]
have hsplit : (F.comp U).comp g = d • (LinearMap.id : C →ₗ[T] C) := by
apply LinearMap.ext
intro x
obtain ⟨y, rfl⟩ := hF x
have hy := LinearMap.congr_fun hUF y
change U (g (F y)) = d • y at hy
change F (U (g (F y))) = d • F y
rw [hy, map_smul]
refine ⟨(↑hd.unit⁻¹ : T) • F.comp U, ?_⟩
rw [LinearMap.smul_comp, hsplit, smul_smul, hd.val_inv_mul, one_smul]