import Mathlib.Algebra.Algebra.Basic import Mathlib.Algebra.Module.Equiv.Basic /-! # Rank One Algebra Retraction -/ namespace OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.RankOneAlgebraRetraction noncomputable section /-! A module that embeds in its coefficient ring and has a split distinguished element is generated by that element. For an algebra with a linear retraction of its unit, such an embedding forces every element to be a scalar. -/ universe u v theorem linear_splitElement_spans {R : Type u} [CommRing R] {M : Type v} [AddCommGroup M] [Module R M] (v : M) (σ φ : M →ₗ[R] R) (hσ : σ v = 1) (hφ : Function.Injective φ) (x : M) : x = σ x • v := by have hc : φ v • x = φ x • v := by apply hφ simp only [LinearMap.map_smul, smul_eq_mul, mul_comm] have hs : φ v * σ x = φ x := by have H := congrArg σ hc simpa only [LinearMap.map_smul, smul_eq_mul, hσ, mul_one] using H apply hφ rw [LinearMap.map_smul, smul_eq_mul] exact hs.symm.trans (mul_comm _ _) theorem algebraMap_bijective_of_linearEmbedding {R : Type u} [CommRing R] {A : Type v} [CommRing A] [Algebra R A] (σ φ : A →ₗ[R] R) (hσ : σ 1 = 1) (hφ : Function.Injective φ) : Function.Bijective (algebraMap R A) := by have hs (r : R) : σ (algebraMap R A r) = r := by have H := σ.map_smul r (1 : A) simpa only [Algebra.smul_def, mul_one, hσ, smul_eq_mul, Algebra.algebraMap_self, RingHom.id_apply] using H refine ⟨Function.LeftInverse.injective hs, fun x => ?_⟩ refine ⟨σ x, ?_⟩ have H := linear_splitElement_spans (1 : A) σ φ hσ hφ x simpa only [Algebra.smul_def, mul_one] using H.symm end end OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.RankOneAlgebraRetraction