state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
R : Type u inst✝⁸ : CommSemiring R A : Type u inst✝⁷ : CommSemiring A inst✝⁶ : Algebra R A B : Type u inst✝⁵ : Semiring B inst✝⁴ : Algebra R B inst✝³ : Algebra A B inst✝² : IsScalarTower R A B inst✝¹ : FormallyUnramified R A inst✝ : FormallyUnramified A B ⊢ FormallyUnramified R B
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by
constructor
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁸ : CommSemiring R A : Type u inst✝⁷ : CommSemiring A inst✝⁶ : Algebra R A B : Type u inst✝⁵ : Semiring B inst✝⁴ : Algebra R B inst✝³ : Algebra A B inst✝² : IsScalarTower R A B inst✝¹ : FormallyUnramified R A inst✝ : FormallyUnramified A B ⊢ ∀ ⦃B_1 : Type u⦄ [inst : CommRing B_1] [inst_1 : Algebra R B_1] (I : Ideal B_1), I ^ 2 = ⊥ → Function.Injective (AlgHom.comp (Ideal.Quotient.mkₐ R I))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor
intro C _ _ I hI f₁ f₂ e
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e
have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc])
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ ⊢ AlgHom.comp (Ideal.Quotient.mkₐ R I) (AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) = AlgHom.comp (Ideal.Quotient.mkₐ R I) (AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by
rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ e' : AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B) = AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B) ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc])
letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc])
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ e' : AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B) = AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B) this : Algebra A C := RingHom.toAlgebra ↑(AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra
let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl }
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ e' : AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B) = AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B) this : Algebra A C := RingHom.toAlgebra ↑(AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) F₁ : B →ₐ[A] C := { toRingHom := ↑f₁, commutes' := (_ : ∀ (r : A), OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r) = OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r)) } ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl }
let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm }
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl }
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ e' : AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B) = AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B) this : Algebra A C := RingHom.toAlgebra ↑(AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) F₁ : B →ₐ[A] C := { toRingHom := ↑f₁, commutes' := (_ : ∀ (r : A), OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r) = OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r)) } F₂ : B →ₐ[A] C := { toRingHom := ↑f₂, commutes' := (_ : ∀ (x : A), (AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B)) x = (AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) x) } ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm }
ext1 x
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm }
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective.H R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ e' : AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B) = AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B) this : Algebra A C := RingHom.toAlgebra ↑(AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) F₁ : B →ₐ[A] C := { toRingHom := ↑f₁, commutes' := (_ : ∀ (r : A), OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r) = OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r)) } F₂ : B →ₐ[A] C := { toRingHom := ↑f₂, commutes' := (_ : ∀ (x : A), (AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B)) x = (AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) x) } x : B ⊢ f₁ x = f₂ x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x
change F₁ x = F₂ x
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective.H R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ e' : AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B) = AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B) this : Algebra A C := RingHom.toAlgebra ↑(AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) F₁ : B →ₐ[A] C := { toRingHom := ↑f₁, commutes' := (_ : ∀ (r : A), OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r) = OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r)) } F₂ : B →ₐ[A] C := { toRingHom := ↑f₂, commutes' := (_ : ∀ (x : A), (AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B)) x = (AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) x) } x : B ⊢ F₁ x = F₂ x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x
congr
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
case comp_injective.H.e_a R : Type u inst✝¹⁰ : CommSemiring R A : Type u inst✝⁹ : CommSemiring A inst✝⁸ : Algebra R A B : Type u inst✝⁷ : Semiring B inst✝⁶ : Algebra R B inst✝⁵ : Algebra A B inst✝⁴ : IsScalarTower R A B inst✝³ : FormallyUnramified R A inst✝² : FormallyUnramified A B C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[R] C e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ e' : AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B) = AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B) this : Algebra A C := RingHom.toAlgebra ↑(AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) F₁ : B →ₐ[A] C := { toRingHom := ↑f₁, commutes' := (_ : ∀ (r : A), OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r) = OneHom.toFun (↑↑↑f₁) ((algebraMap A B) r)) } F₂ : B →ₐ[A] C := { toRingHom := ↑f₂, commutes' := (_ : ∀ (x : A), (AlgHom.comp f₂ (IsScalarTower.toAlgHom R A B)) x = (AlgHom.comp f₁ (IsScalarTower.toAlgHom R A B)) x) } x : B ⊢ F₁ = F₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr
exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e)
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr
Mathlib.RingTheory.Etale.288_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B
Mathlib_RingTheory_Etale
R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : CommSemiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : Semiring B inst✝³ : Algebra R B inst✝² : Algebra A B inst✝¹ : IsScalarTower R A B inst✝ : FormallyUnramified R B ⊢ FormallyUnramified A B
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by
constructor
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by
Mathlib.RingTheory.Etale.304_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : CommSemiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : Semiring B inst✝³ : Algebra R B inst✝² : Algebra A B inst✝¹ : IsScalarTower R A B inst✝ : FormallyUnramified R B ⊢ ∀ ⦃B_1 : Type u⦄ [inst : CommRing B_1] [inst_1 : Algebra A B_1] (I : Ideal B_1), I ^ 2 = ⊥ → Function.Injective (AlgHom.comp (Ideal.Quotient.mkₐ A I))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor
intro Q _ _ I e f₁ f₂ e'
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor
Mathlib.RingTheory.Etale.304_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁹ : CommSemiring R A : Type u inst✝⁸ : CommSemiring A inst✝⁷ : Algebra R A B : Type u inst✝⁶ : Semiring B inst✝⁵ : Algebra R B inst✝⁴ : Algebra A B inst✝³ : IsScalarTower R A B inst✝² : FormallyUnramified R B Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra A Q I : Ideal Q e : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[A] Q e' : AlgHom.comp (Ideal.Quotient.mkₐ A I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ A I) f₂ ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e'
letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e'
Mathlib.RingTheory.Etale.304_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁹ : CommSemiring R A : Type u inst✝⁸ : CommSemiring A inst✝⁷ : Algebra R A B : Type u inst✝⁶ : Semiring B inst✝⁵ : Algebra R B inst✝⁴ : Algebra A B inst✝³ : IsScalarTower R A B inst✝² : FormallyUnramified R B Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra A Q I : Ideal Q e : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[A] Q e' : AlgHom.comp (Ideal.Quotient.mkₐ A I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ A I) f₂ this : Algebra R Q := RingHom.toAlgebra (RingHom.comp (algebraMap A Q) (algebraMap R A)) ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra
letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra
Mathlib.RingTheory.Etale.304_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁹ : CommSemiring R A : Type u inst✝⁸ : CommSemiring A inst✝⁷ : Algebra R A B : Type u inst✝⁶ : Semiring B inst✝⁵ : Algebra R B inst✝⁴ : Algebra A B inst✝³ : IsScalarTower R A B inst✝² : FormallyUnramified R B Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra A Q I : Ideal Q e : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[A] Q e' : AlgHom.comp (Ideal.Quotient.mkₐ A I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ A I) f₂ this✝ : Algebra R Q := RingHom.toAlgebra (RingHom.comp (algebraMap A Q) (algebraMap R A)) this : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl
refine' AlgHom.restrictScalars_injective R _
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl
Mathlib.RingTheory.Etale.304_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁹ : CommSemiring R A : Type u inst✝⁸ : CommSemiring A inst✝⁷ : Algebra R A B : Type u inst✝⁶ : Semiring B inst✝⁵ : Algebra R B inst✝⁴ : Algebra A B inst✝³ : IsScalarTower R A B inst✝² : FormallyUnramified R B Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra A Q I : Ideal Q e : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[A] Q e' : AlgHom.comp (Ideal.Quotient.mkₐ A I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ A I) f₂ this✝ : Algebra R Q := RingHom.toAlgebra (RingHom.comp (algebraMap A Q) (algebraMap R A)) this : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl ⊢ AlgHom.restrictScalars R f₁ = AlgHom.restrictScalars R f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _
refine' FormallyUnramified.ext I ⟨2, e⟩ _
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _
Mathlib.RingTheory.Etale.304_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁹ : CommSemiring R A : Type u inst✝⁸ : CommSemiring A inst✝⁷ : Algebra R A B : Type u inst✝⁶ : Semiring B inst✝⁵ : Algebra R B inst✝⁴ : Algebra A B inst✝³ : IsScalarTower R A B inst✝² : FormallyUnramified R B Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra A Q I : Ideal Q e : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[A] Q e' : AlgHom.comp (Ideal.Quotient.mkₐ A I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ A I) f₂ this✝ : Algebra R Q := RingHom.toAlgebra (RingHom.comp (algebraMap A Q) (algebraMap R A)) this : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl ⊢ ∀ (x : B), (Ideal.Quotient.mk I) ((AlgHom.restrictScalars R f₁) x) = (Ideal.Quotient.mk I) ((AlgHom.restrictScalars R f₂) x)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _
intro x
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _
Mathlib.RingTheory.Etale.304_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁹ : CommSemiring R A : Type u inst✝⁸ : CommSemiring A inst✝⁷ : Algebra R A B : Type u inst✝⁶ : Semiring B inst✝⁵ : Algebra R B inst✝⁴ : Algebra A B inst✝³ : IsScalarTower R A B inst✝² : FormallyUnramified R B Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra A Q I : Ideal Q e : I ^ 2 = ⊥ f₁ f₂ : B →ₐ[A] Q e' : AlgHom.comp (Ideal.Quotient.mkₐ A I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ A I) f₂ this✝ : Algebra R Q := RingHom.toAlgebra (RingHom.comp (algebraMap A Q) (algebraMap R A)) this : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl x : B ⊢ (Ideal.Quotient.mk I) ((AlgHom.restrictScalars R f₁) x) = (Ideal.Quotient.mk I) ((AlgHom.restrictScalars R f₂) x)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x
exact AlgHom.congr_fun e' x
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x
Mathlib.RingTheory.Etale.304_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B
Mathlib_RingTheory_Etale
R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A ⊢ FormallySmooth R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by
constructor
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
case comp_surjective R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A ⊢ ∀ ⦃B : Type u⦄ [inst : CommRing B] [inst_1 : Algebra R B] (I : Ideal B), I ^ 2 = ⊥ → Function.Surjective (AlgHom.comp (Ideal.Quotient.mkₐ R I))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor
intro C _ _ I hI i
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
case comp_surjective R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ R I) a = i
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i
let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I ⊢ P ⧸ RingHom.ker ↑f ^ 2 →ₐ[R] C
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by
refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I ⊢ ∀ a ∈ RingHom.ker ↑f ^ 2, (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) a = 0
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _
have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I ⊢ RingHom.ker f ≤ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) I
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by
rintro x (hx : f x = 0)
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I x : P hx : f x = 0 ⊢ x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) I
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0)
have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _)
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0)
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I x : P hx : f x = 0 this : (Ideal.Quotient.mk I) ((lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) x) = i (f x) ⊢ x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) I
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _)
rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _)
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I this : RingHom.ker f ≤ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) I ⊢ ∀ a ∈ RingHom.ker ↑f ^ 2, (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) a = 0
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this
intro x hx
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I this : RingHom.ker f ≤ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) I x : P hx : x ∈ RingHom.ker ↑f ^ 2 ⊢ (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) x = 0
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx
have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I this✝ : RingHom.ker f ≤ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) I x : P hx : x ∈ RingHom.ker ↑f ^ 2 this : x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) (I ^ 2) ⊢ (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) x = 0
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx
rwa [hI] at this
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
case comp_surjective R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I l : P ⧸ RingHom.ker ↑f ^ 2 →ₐ[R] C := Ideal.Quotient.liftₐ (RingHom.ker ↑f ^ 2) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) (_ : ∀ x ∈ RingHom.ker ↑f ^ 2, x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) ⊥) ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ R I) a = i
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this
have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I l : P ⧸ RingHom.ker ↑f ^ 2 →ₐ[R] C := Ideal.Quotient.liftₐ (RingHom.ker ↑f ^ 2) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) (_ : ∀ x ∈ RingHom.ker ↑f ^ 2, x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) ⊥) ⊢ AlgHom.comp i (AlgHom.kerSquareLift f) = AlgHom.comp (Ideal.Quotient.mkₐ R I) l
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by
apply AlgHom.coe_ringHom_injective
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
case a R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I l : P ⧸ RingHom.ker ↑f ^ 2 →ₐ[R] C := Ideal.Quotient.liftₐ (RingHom.ker ↑f ^ 2) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) (_ : ∀ x ∈ RingHom.ker ↑f ^ 2, x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) ⊥) ⊢ ↑(AlgHom.comp i (AlgHom.kerSquareLift f)) = ↑(AlgHom.comp (Ideal.Quotient.mkₐ R I) l)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective
apply Ideal.Quotient.ringHom_ext
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
case a.h R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I l : P ⧸ RingHom.ker ↑f ^ 2 →ₐ[R] C := Ideal.Quotient.liftₐ (RingHom.ker ↑f ^ 2) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) (_ : ∀ x ∈ RingHom.ker ↑f ^ 2, x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) ⊥) ⊢ RingHom.comp (↑(AlgHom.comp i (AlgHom.kerSquareLift f))) (Ideal.Quotient.mk (RingHom.ker ↑f ^ 2)) = RingHom.comp (↑(AlgHom.comp (Ideal.Quotient.mkₐ R I) l)) (Ideal.Quotient.mk (RingHom.ker ↑f ^ 2))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext
ext x
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
case a.h.a R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I l : P ⧸ RingHom.ker ↑f ^ 2 →ₐ[R] C := Ideal.Quotient.liftₐ (RingHom.ker ↑f ^ 2) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) (_ : ∀ x ∈ RingHom.ker ↑f ^ 2, x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) ⊥) x : P ⊢ (RingHom.comp (↑(AlgHom.comp i (AlgHom.kerSquareLift f))) (Ideal.Quotient.mk (RingHom.ker ↑f ^ 2))) x = (RingHom.comp (↑(AlgHom.comp (Ideal.Quotient.mkₐ R I) l)) (Ideal.Quotient.mk (RingHom.ker ↑f ^ 2))) x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x
exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
case comp_surjective R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I l : P ⧸ RingHom.ker ↑f ^ 2 →ₐ[R] C := Ideal.Quotient.liftₐ (RingHom.ker ↑f ^ 2) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) (_ : ∀ x ∈ RingHom.ker ↑f ^ 2, x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) ⊥) this : AlgHom.comp i (AlgHom.kerSquareLift f) = AlgHom.comp (Ideal.Quotient.mkₐ R I) l ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ R I) a = i
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm
exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁸ : CommRing R inst✝⁷ : CommSemiring S P A : Type u inst✝⁶ : CommRing A inst✝⁵ : Algebra R A inst✝⁴ : CommRing P inst✝³ : Algebra R P I✝ : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝² : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra R C I : Ideal C hI : I ^ 2 = ⊥ i : A →ₐ[R] C ⧸ I l : P ⧸ RingHom.ker ↑f ^ 2 →ₐ[R] C := Ideal.Quotient.liftₐ (RingHom.ker ↑f ^ 2) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) (_ : ∀ x ∈ RingHom.ker ↑f ^ 2, x ∈ Ideal.comap (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp i f)) ⊥) this : AlgHom.comp i (AlgHom.kerSquareLift f) = AlgHom.comp (Ideal.Quotient.mkₐ R I) l ⊢ AlgHom.comp (Ideal.Quotient.mkₐ R I) (AlgHom.comp l g) = i
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by
rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by
Mathlib.RingTheory.Etale.330_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P ⊢ FormallySmooth R A ↔ ∃ g, AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by
constructor
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mp R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P ⊢ FormallySmooth R A → ∃ g, AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor ·
intro
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor ·
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mp R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A ⊢ ∃ g, AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro
have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mp R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) ⊢ ∃ g, AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩
have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot]
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) ⊢ RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by
rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot]
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mp R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) sqz : RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0 ⊢ ∃ g, AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot]
refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot]
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mp R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) sqz : RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0 ⊢ AlgHom.comp (AlgHom.kerSquareLift f) (lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj))) = AlgHom.id R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩
ext x
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mp.H R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) sqz : RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0 x : A ⊢ (AlgHom.comp (AlgHom.kerSquareLift f) (lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj)))) x = (AlgHom.id R A) x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x
have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x)
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mp.H R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) sqz : RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0 x : A this : ↑(Ideal.quotientKerAlgEquivOfSurjective surj) ((Ideal.Quotient.mk (RingHom.ker ↑(AlgHom.kerSquareLift f))) ((lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj))) x)) = ↑(Ideal.quotientKerAlgEquivOfSurjective surj) (↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj)) x) ⊢ (AlgHom.comp (AlgHom.kerSquareLift f) (lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj)))) x = (AlgHom.id R A) x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this
erw [AlgEquiv.apply_symm_apply] at this
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mp.H R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) sqz : RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0 x : A this : ↑(Ideal.quotientKerAlgEquivOfSurjective surj) ((Ideal.Quotient.mk (RingHom.ker ↑(AlgHom.kerSquareLift f))) ((lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj))) x)) = x ⊢ (AlgHom.comp (AlgHom.kerSquareLift f) (lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj)))) x = (AlgHom.id R A) x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this
conv_rhs => rw [← this, AlgHom.id_apply]
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) sqz : RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0 x : A this : ↑(Ideal.quotientKerAlgEquivOfSurjective surj) ((Ideal.Quotient.mk (RingHom.ker ↑(AlgHom.kerSquareLift f))) ((lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj))) x)) = x | (AlgHom.id R A) x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs =>
rw [← this, AlgHom.id_apply]
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs =>
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) sqz : RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0 x : A this : ↑(Ideal.quotientKerAlgEquivOfSurjective surj) ((Ideal.Quotient.mk (RingHom.ker ↑(AlgHom.kerSquareLift f))) ((lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj))) x)) = x | (AlgHom.id R A) x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs =>
rw [← this, AlgHom.id_apply]
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs =>
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P a✝ : FormallySmooth R A surj : Function.Surjective ⇑(AlgHom.kerSquareLift f) sqz : RingHom.ker ↑(AlgHom.kerSquareLift f) ^ 2 = 0 x : A this : ↑(Ideal.quotientKerAlgEquivOfSurjective surj) ((Ideal.Quotient.mk (RingHom.ker ↑(AlgHom.kerSquareLift f))) ((lift (RingHom.ker ↑(AlgHom.kerSquareLift f)) (_ : ∃ n, RingHom.ker ↑(AlgHom.kerSquareLift f) ^ n = 0) ↑(AlgEquiv.symm (Ideal.quotientKerAlgEquivOfSurjective surj))) x)) = x | (AlgHom.id R A) x
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs =>
rw [← this, AlgHom.id_apply]
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs =>
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mpr R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P ⊢ (∃ g, AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A) → FormallySmooth R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl ·
rintro ⟨g, hg⟩
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl ·
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
case mpr.intro R S : Type u inst✝⁶ : CommRing R inst✝⁵ : CommSemiring S P A : Type u inst✝⁴ : CommRing A inst✝³ : Algebra R A inst✝² : CommRing P inst✝¹ : Algebra R P I : Ideal P f : P →ₐ[R] A hf : Function.Surjective ⇑f inst✝ : FormallySmooth R P g : A →ₐ[R] P ⧸ RingHom.ker ↑f ^ 2 hg : AlgHom.comp (AlgHom.kerSquareLift f) g = AlgHom.id R A ⊢ FormallySmooth R A
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩;
exact FormallySmooth.of_split f g hg
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩;
Mathlib.RingTheory.Etale.351_0.sEffwLG8zJBnQIt
/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
Mathlib_RingTheory_Etale
R S : Type u inst✝³ : CommRing R inst✝² : CommRing S inst✝¹ : Algebra R S inst✝ : FormallyUnramified R S ⊢ Subsingleton (Ω[S⁄R])
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by
rw [← not_nontrivial_iff_subsingleton]
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by
Mathlib.RingTheory.Etale.397_0.sEffwLG8zJBnQIt
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
R S : Type u inst✝³ : CommRing R inst✝² : CommRing S inst✝¹ : Algebra R S inst✝ : FormallyUnramified R S ⊢ ¬Nontrivial (Ω[S⁄R])
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton]
intro h
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton]
Mathlib.RingTheory.Etale.397_0.sEffwLG8zJBnQIt
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
R S : Type u inst✝³ : CommRing R inst✝² : CommRing S inst✝¹ : Algebra R S inst✝ : FormallyUnramified R S h : Nontrivial (Ω[S⁄R]) ⊢ False
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h
obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h
Mathlib.RingTheory.Etale.397_0.sEffwLG8zJBnQIt
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mk.intro.intro R S : Type u inst✝³ : CommRing R inst✝² : CommRing S inst✝¹ : Algebra R S inst✝ : FormallyUnramified R S h : Nontrivial (Ω[S⁄R]) f₁ f₂ : { f // AlgHom.comp (AlgHom.kerSquareLift (TensorProduct.lmul' R)) f = AlgHom.id R S } e : f₁ ≠ f₂ ⊢ False
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial
apply e
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial
Mathlib.RingTheory.Etale.397_0.sEffwLG8zJBnQIt
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mk.intro.intro R S : Type u inst✝³ : CommRing R inst✝² : CommRing S inst✝¹ : Algebra R S inst✝ : FormallyUnramified R S h : Nontrivial (Ω[S⁄R]) f₁ f₂ : { f // AlgHom.comp (AlgHom.kerSquareLift (TensorProduct.lmul' R)) f = AlgHom.id R S } e : f₁ ≠ f₂ ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e
ext1
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e
Mathlib.RingTheory.Etale.397_0.sEffwLG8zJBnQIt
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mk.intro.intro.a R S : Type u inst✝³ : CommRing R inst✝² : CommRing S inst✝¹ : Algebra R S inst✝ : FormallyUnramified R S h : Nontrivial (Ω[S⁄R]) f₁ f₂ : { f // AlgHom.comp (AlgHom.kerSquareLift (TensorProduct.lmul' R)) f = AlgHom.id R S } e : f₁ ≠ f₂ ⊢ ↑f₁ = ↑f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1
apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm)
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1
Mathlib.RingTheory.Etale.397_0.sEffwLG8zJBnQIt
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
R S : Type u inst✝³ : CommRing R inst✝² : CommRing S inst✝¹ : Algebra R S inst✝ : FormallyUnramified R S h : Nontrivial (Ω[S⁄R]) f₁ f₂ : { f // AlgHom.comp (AlgHom.kerSquareLift (TensorProduct.lmul' R)) f = AlgHom.id R S } e : f₁ ≠ f₂ ⊢ IsNilpotent (RingHom.ker ↑(AlgHom.kerSquareLift (TensorProduct.lmul' R)))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm)
rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift]
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm)
Mathlib.RingTheory.Etale.397_0.sEffwLG8zJBnQIt
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
R S : Type u inst✝³ : CommRing R inst✝² : CommRing S inst✝¹ : Algebra R S inst✝ : FormallyUnramified R S h : Nontrivial (Ω[S⁄R]) f₁ f₂ : { f // AlgHom.comp (AlgHom.kerSquareLift (TensorProduct.lmul' R)) f = AlgHom.id R S } e : f₁ ≠ f₂ ⊢ IsNilpotent (Ideal.cotangentIdeal (RingHom.ker ↑(TensorProduct.lmul' R)))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift]
exact ⟨_, Ideal.cotangentIdeal_square _⟩
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift]
Mathlib.RingTheory.Etale.397_0.sEffwLG8zJBnQIt
instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
R S : Type u inst✝² : CommRing R inst✝¹ : CommRing S inst✝ : Algebra R S ⊢ FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by
constructor
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mp R S : Type u inst✝² : CommRing R inst✝¹ : CommRing S inst✝ : Algebra R S ⊢ FormallyUnramified R S → Subsingleton (Ω[S⁄R])
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor ·
intros
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor ·
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mp R S : Type u inst✝² : CommRing R inst✝¹ : CommRing S inst✝ : Algebra R S a✝ : FormallyUnramified R S ⊢ Subsingleton (Ω[S⁄R])
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros;
infer_instance
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros;
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mpr R S : Type u inst✝² : CommRing R inst✝¹ : CommRing S inst✝ : Algebra R S ⊢ Subsingleton (Ω[S⁄R]) → FormallyUnramified R S
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance ·
intro H
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance ·
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mpr R S : Type u inst✝² : CommRing R inst✝¹ : CommRing S inst✝ : Algebra R S H : Subsingleton (Ω[S⁄R]) ⊢ FormallyUnramified R S
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H
constructor
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mpr.comp_injective R S : Type u inst✝² : CommRing R inst✝¹ : CommRing S inst✝ : Algebra R S H : Subsingleton (Ω[S⁄R]) ⊢ ∀ ⦃B : Type u⦄ [inst : CommRing B] [inst_1 : Algebra R B] (I : Ideal B), I ^ 2 = ⊥ → Function.Injective (AlgHom.comp (Ideal.Quotient.mkₐ R I))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor
intro B _ _ I hI f₁ f₂ e
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mpr.comp_injective R S : Type u inst✝⁴ : CommRing R inst✝³ : CommRing S inst✝² : Algebra R S H : Subsingleton (Ω[S⁄R]) B : Type u inst✝¹ : CommRing B inst✝ : Algebra R B I : Ideal B hI : I ^ 2 = ⊥ f₁ f₂ : S →ₐ[R] B e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e
letI := f₁.toRingHom.toAlgebra
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mpr.comp_injective R S : Type u inst✝⁴ : CommRing R inst✝³ : CommRing S inst✝² : Algebra R S H : Subsingleton (Ω[S⁄R]) B : Type u inst✝¹ : CommRing B inst✝ : Algebra R B I : Ideal B hI : I ^ 2 = ⊥ f₁ f₂ : S →ₐ[R] B e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ this : Algebra S B := RingHom.toAlgebra ↑f₁ ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra
haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mpr.comp_injective R S : Type u inst✝⁴ : CommRing R inst✝³ : CommRing S inst✝² : Algebra R S H : Subsingleton (Ω[S⁄R]) B : Type u inst✝¹ : CommRing B inst✝ : Algebra R B I : Ideal B hI : I ^ 2 = ⊥ f₁ f₂ : S →ₐ[R] B e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ this✝ : Algebra S B := RingHom.toAlgebra ↑f₁ this : IsScalarTower R S B ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm
have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
case mpr.comp_injective R S : Type u inst✝⁴ : CommRing R inst✝³ : CommRing S inst✝² : Algebra R S H : Subsingleton (Ω[S⁄R]) B : Type u inst✝¹ : CommRing B inst✝ : Algebra R B I : Ideal B hI : I ^ 2 = ⊥ f₁ f₂ : S →ₐ[R] B e : AlgHom.comp (Ideal.Quotient.mkₐ R I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ R I) f₂ this✝¹ : Algebra S B := RingHom.toAlgebra ↑f₁ this✝ : IsScalarTower R S B this : Subsingleton { f // AlgHom.comp (Ideal.Quotient.mkₐ R I) f = IsScalarTower.toAlgHom R S (B ⧸ I) } ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton
exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩)
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton
Mathlib.RingTheory.Etale.409_0.sEffwLG8zJBnQIt
theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R])
Mathlib_RingTheory_Etale
R : Type u inst✝⁵ : CommSemiring R A : Type u inst✝⁴ : Semiring A inst✝³ : Algebra R A B : Type u inst✝² : CommSemiring B inst✝¹ : Algebra R B inst✝ : FormallyUnramified R A ⊢ FormallyUnramified B (B ⊗[R] A)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by
constructor
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by
Mathlib.RingTheory.Etale.436_0.sEffwLG8zJBnQIt
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁵ : CommSemiring R A : Type u inst✝⁴ : Semiring A inst✝³ : Algebra R A B : Type u inst✝² : CommSemiring B inst✝¹ : Algebra R B inst✝ : FormallyUnramified R A ⊢ ∀ ⦃B_1 : Type u⦄ [inst : CommRing B_1] [inst_1 : Algebra B B_1] (I : Ideal B_1), I ^ 2 = ⊥ → Function.Injective (AlgHom.comp (Ideal.Quotient.mkₐ B I))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor
intro C _ _ I hI f₁ f₂ e
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor
Mathlib.RingTheory.Etale.436_0.sEffwLG8zJBnQIt
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallyUnramified R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B ⊗[R] A →ₐ[B] C e : AlgHom.comp (Ideal.Quotient.mkₐ B I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ B I) f₂ ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e
letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e
Mathlib.RingTheory.Etale.436_0.sEffwLG8zJBnQIt
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallyUnramified R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B ⊗[R] A →ₐ[B] C e : AlgHom.comp (Ideal.Quotient.mkₐ B I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ B I) f₂ this : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra
haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra
Mathlib.RingTheory.Etale.436_0.sEffwLG8zJBnQIt
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_injective R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallyUnramified R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B ⊗[R] A →ₐ[B] C e : AlgHom.comp (Ideal.Quotient.mkₐ B I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ B I) f₂ this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C ⊢ f₁ = f₂
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl
ext : 1
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl
Mathlib.RingTheory.Etale.436_0.sEffwLG8zJBnQIt
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_injective.ha R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallyUnramified R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B ⊗[R] A →ₐ[B] C e : AlgHom.comp (Ideal.Quotient.mkₐ B I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ B I) f₂ this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C ⊢ AlgHom.comp f₁ TensorProduct.includeLeft = AlgHom.comp f₂ TensorProduct.includeLeft
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 ·
exact Subsingleton.elim _ _
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 ·
Mathlib.RingTheory.Etale.436_0.sEffwLG8zJBnQIt
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_injective.hb R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallyUnramified R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f₁ f₂ : B ⊗[R] A →ₐ[B] C e : AlgHom.comp (Ideal.Quotient.mkₐ B I) f₁ = AlgHom.comp (Ideal.Quotient.mkₐ B I) f₂ this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C ⊢ AlgHom.comp (AlgHom.restrictScalars R f₁) TensorProduct.includeRight = AlgHom.comp (AlgHom.restrictScalars R f₂) TensorProduct.includeRight
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ ·
exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x)
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ ·
Mathlib.RingTheory.Etale.436_0.sEffwLG8zJBnQIt
instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A)
Mathlib_RingTheory_Etale
R : Type u inst✝⁵ : CommSemiring R A : Type u inst✝⁴ : Semiring A inst✝³ : Algebra R A B : Type u inst✝² : CommSemiring B inst✝¹ : Algebra R B inst✝ : FormallySmooth R A ⊢ FormallySmooth B (B ⊗[R] A)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by
constructor
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective R : Type u inst✝⁵ : CommSemiring R A : Type u inst✝⁴ : Semiring A inst✝³ : Algebra R A B : Type u inst✝² : CommSemiring B inst✝¹ : Algebra R B inst✝ : FormallySmooth R A ⊢ ∀ ⦃B_1 : Type u⦄ [inst : CommRing B_1] [inst_1 : Algebra B B_1] (I : Ideal B_1), I ^ 2 = ⊥ → Function.Surjective (AlgHom.comp (Ideal.Quotient.mkₐ B I))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor
intro C _ _ I hI f
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ B I) a = f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f
letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ B I) a = f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra
haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ B I) a = f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl
refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective.refine'_1 R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C ⊢ A →ₐ[R] C
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ ·
exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight)
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ ·
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective.refine'_2 R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C ⊢ AlgHom.comp (Ideal.Quotient.mkₐ B I) (TensorProduct.productLeftAlgHom (ofId B C) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp (AlgHom.restrictScalars R f) TensorProduct.includeRight))) = f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) ·
apply AlgHom.restrictScalars_injective R
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) ·
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective.refine'_2.a R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C ⊢ AlgHom.restrictScalars R (AlgHom.comp (Ideal.Quotient.mkₐ B I) (TensorProduct.productLeftAlgHom (ofId B C) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp (AlgHom.restrictScalars R f) TensorProduct.includeRight)))) = AlgHom.restrictScalars R f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R
apply TensorProduct.ext'
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective.refine'_2.a.H R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C ⊢ ∀ (a : B) (b : A), (AlgHom.restrictScalars R (AlgHom.comp (Ideal.Quotient.mkₐ B I) (TensorProduct.productLeftAlgHom (ofId B C) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp (AlgHom.restrictScalars R f) TensorProduct.includeRight))))) (a ⊗ₜ[R] b) = (AlgHom.restrictScalars R f) (a ⊗ₜ[R] b)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext'
intro b a
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext'
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective.refine'_2.a.H R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C b : B a : A ⊢ (AlgHom.restrictScalars R (AlgHom.comp (Ideal.Quotient.mkₐ B I) (TensorProduct.productLeftAlgHom (ofId B C) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp (AlgHom.restrictScalars R f) TensorProduct.includeRight))))) (b ⊗ₜ[R] a) = (AlgHom.restrictScalars R f) (b ⊗ₜ[R] a)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a
suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply]
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this✝¹ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this✝ : IsScalarTower R B C b : B a : A this : (algebraMap B (C ⧸ I)) b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) ⊢ (AlgHom.restrictScalars R (AlgHom.comp (Ideal.Quotient.mkₐ B I) (TensorProduct.productLeftAlgHom (ofId B C) (lift I (_ : ∃ n, I ^ n = 0) (AlgHom.comp (AlgHom.restrictScalars R f) TensorProduct.includeRight))))) (b ⊗ₜ[R] a) = (AlgHom.restrictScalars R f) (b ⊗ₜ[R] a)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by
simpa [Algebra.ofId_apply]
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
case comp_surjective.refine'_2.a.H R : Type u inst✝⁷ : CommSemiring R A : Type u inst✝⁶ : Semiring A inst✝⁵ : Algebra R A B : Type u inst✝⁴ : CommSemiring B inst✝³ : Algebra R B inst✝² : FormallySmooth R A C : Type u inst✝¹ : CommRing C inst✝ : Algebra B C I : Ideal C hI : I ^ 2 = ⊥ f : B ⊗[R] A →ₐ[B] C ⧸ I this✝ : Algebra R C := RingHom.toAlgebra (RingHom.comp (algebraMap B C) (algebraMap R B)) this : IsScalarTower R B C b : B a : A ⊢ (algebraMap B (C ⧸ I)) b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply]
rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one]
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply]
Mathlib.RingTheory.Etale.447_0.sEffwLG8zJBnQIt
instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A)
Mathlib_RingTheory_Etale
R S Rₘ Sₘ : Type u inst✝¹² : CommRing R inst✝¹¹ : CommRing S inst✝¹⁰ : CommRing Rₘ inst✝⁹ : CommRing Sₘ M : Submonoid R inst✝⁸ : Algebra R S inst✝⁷ : Algebra R Sₘ inst✝⁶ : Algebra S Sₘ inst✝⁵ : Algebra R Rₘ inst✝⁴ : Algebra Rₘ Sₘ inst✝³ : IsScalarTower R Rₘ Sₘ inst✝² : IsScalarTower R S Sₘ inst✝¹ : IsLocalization M Rₘ inst✝ : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ ⊢ FormallySmooth R Rₘ
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by
constructor
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
case comp_surjective R S Rₘ Sₘ : Type u inst✝¹² : CommRing R inst✝¹¹ : CommRing S inst✝¹⁰ : CommRing Rₘ inst✝⁹ : CommRing Sₘ M : Submonoid R inst✝⁸ : Algebra R S inst✝⁷ : Algebra R Sₘ inst✝⁶ : Algebra S Sₘ inst✝⁵ : Algebra R Rₘ inst✝⁴ : Algebra Rₘ Sₘ inst✝³ : IsScalarTower R Rₘ Sₘ inst✝² : IsScalarTower R S Sₘ inst✝¹ : IsLocalization M Rₘ inst✝ : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ ⊢ ∀ ⦃B : Type u⦄ [inst : CommRing B] [inst_1 : Algebra R B] (I : Ideal B), I ^ 2 = ⊥ → Function.Surjective (AlgHom.comp (Ideal.Quotient.mkₐ R I))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor
intro Q _ _ I e f
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
case comp_surjective R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ R I) a = f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f
have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes]
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I ⊢ ∀ (x : ↥M), IsUnit ((algebraMap R Q) ↑x)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by
intro x
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I x : ↥M ⊢ IsUnit ((algebraMap R Q) ↑x)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x
apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I x : ↥M ⊢ IsUnit ((Ideal.Quotient.mk I) ((algebraMap R Q) ↑x))
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp
convert (IsLocalization.map_units Rₘ x).map f
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
case h.e'_3 R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I x : ↥M ⊢ (Ideal.Quotient.mk I) ((algebraMap R Q) ↑x) = f ((algebraMap R Rₘ) ↑x)
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f
simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes]
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
case comp_surjective R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I this : ∀ (x : ↥M), IsUnit ((algebraMap R Q) ↑x) ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ R I) a = f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes]
let this : Rₘ →ₐ[R] Q := { IsLocalization.lift this with commutes' := IsLocalization.lift_eq this }
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes]
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
case comp_surjective R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I this✝ : ∀ (x : ↥M), IsUnit ((algebraMap R Q) ↑x) this : Rₘ →ₐ[R] Q := let src := IsLocalization.lift this✝; { toRingHom := { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0), map_add' := (_ : ∀ (x y : Rₘ), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) }, commutes' := (_ : ∀ (x : R), (IsLocalization.lift this✝) ((algebraMap R Rₘ) x) = (algebraMap R Q) x) } ⊢ ∃ a, AlgHom.comp (Ideal.Quotient.mkₐ R I) a = f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes] let this : Rₘ →ₐ[R] Q := { IsLocalization.lift this with commutes' := IsLocalization.lift_eq this }
use this
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes] let this : Rₘ →ₐ[R] Q := { IsLocalization.lift this with commutes' := IsLocalization.lift_eq this }
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
case h R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I this✝ : ∀ (x : ↥M), IsUnit ((algebraMap R Q) ↑x) this : Rₘ →ₐ[R] Q := let src := IsLocalization.lift this✝; { toRingHom := { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0), map_add' := (_ : ∀ (x y : Rₘ), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) }, commutes' := (_ : ∀ (x : R), (IsLocalization.lift this✝) ((algebraMap R Rₘ) x) = (algebraMap R Q) x) } ⊢ AlgHom.comp (Ideal.Quotient.mkₐ R I) this = f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes] let this : Rₘ →ₐ[R] Q := { IsLocalization.lift this with commutes' := IsLocalization.lift_eq this } use this
apply AlgHom.coe_ringHom_injective
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes] let this : Rₘ →ₐ[R] Q := { IsLocalization.lift this with commutes' := IsLocalization.lift_eq this } use this
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale
case h.a R S Rₘ Sₘ : Type u inst✝¹⁴ : CommRing R inst✝¹³ : CommRing S inst✝¹² : CommRing Rₘ inst✝¹¹ : CommRing Sₘ M : Submonoid R inst✝¹⁰ : Algebra R S inst✝⁹ : Algebra R Sₘ inst✝⁸ : Algebra S Sₘ inst✝⁷ : Algebra R Rₘ inst✝⁶ : Algebra Rₘ Sₘ inst✝⁵ : IsScalarTower R Rₘ Sₘ inst✝⁴ : IsScalarTower R S Sₘ inst✝³ : IsLocalization M Rₘ inst✝² : IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ Q : Type u inst✝¹ : CommRing Q inst✝ : Algebra R Q I : Ideal Q e : I ^ 2 = ⊥ f : Rₘ →ₐ[R] Q ⧸ I this✝ : ∀ (x : ↥M), IsUnit ((algebraMap R Q) ↑x) this : Rₘ →ₐ[R] Q := let src := IsLocalization.lift this✝; { toRingHom := { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0), map_add' := (_ : ∀ (x y : Rₘ), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) }, commutes' := (_ : ∀ (x : R), (IsLocalization.lift this✝) ((algebraMap R Rₘ) x) = (algebraMap R Q) x) } ⊢ ↑(AlgHom.comp (Ideal.Quotient.mkₐ R I) this) = ↑f
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.Kaehler #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" /-! # Formally étale morphisms An `R`-algebra `A` is formally étale (resp. unramified, smooth) if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly (resp. at most, at least) one lift `A →ₐ[R] B`. We show that the property extends onto nilpotent ideals, and that these properties are stable under `R`-algebra homomorphisms and compositions. -/ -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) /-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyUnramified : Prop where comp_injective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_unramified Algebra.FormallyUnramified /-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth /-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal `I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`. -/ @[mk_iff] class FormallyEtale : Prop where comp_bijective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_etale Algebra.FormallyEtale variable {R A} theorem FormallyEtale.iff_unramified_and_smooth : FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff] simp_rw [← forall_and] rfl #align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] : FormallyUnramified R A := (FormallyEtale.iff_unramified_and_smooth.mp h).1 #align algebra.formally_etale.to_unramified Algebra.FormallyEtale.to_unramified instance (priority := 100) FormallyEtale.to_smooth [h : FormallyEtale R A] : FormallySmooth R A := (FormallyEtale.iff_unramified_and_smooth.mp h).2 #align algebra.formally_etale.to_smooth Algebra.FormallyEtale.to_smooth theorem FormallyEtale.of_unramified_and_smooth [h₁ : FormallyUnramified R A] [h₂ : FormallySmooth R A] : FormallyEtale R A := FormallyEtale.iff_unramified_and_smooth.mpr ⟨h₁, h₂⟩ #align algebra.formally_etale.of_unramified_and_smooth Algebra.FormallyEtale.of_unramified_and_smooth theorem FormallyUnramified.lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B) (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by revert g₁ g₂ change Function.Injective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallyUnramified.comp_injective I hI · intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e apply h₁ apply h₂ ext x replace e := AlgHom.congr_fun e x dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢ rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq] #align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique theorem FormallyUnramified.ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B} (H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H) #align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext theorem FormallyUnramified.lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ := FormallyUnramified.lift_unique _ hf _ _ (by ext x have := RingHom.congr_fun h x simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk, RingHom.mem_ker, map_sub, sub_eq_zero]) #align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom theorem FormallyUnramified.ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) : g₁ = g₂ := FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h) #align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext' theorem FormallyUnramified.lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C] [Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C)) (g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ := FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h) #align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique' theorem FormallySmooth.exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` square-zero, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem FormallySmooth.comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem FormallySmooth.mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] /-- For a formally smooth `R`-algebra `A` and a map `f : A →ₐ[R] B ⧸ I` with `I` nilpotent, this is an arbitrary lift `A →ₐ[R] B`. -/ noncomputable def FormallySmooth.liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem FormallySmooth.liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective rw [AlgEquiv.apply_symm_apply, Ideal.quotientKerAlgEquivOfSurjective, Ideal.quotientKerAlgEquivOfRightInverse.apply] exact (Ideal.kerLiftAlg_mk _ _).symm #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem FormallySmooth.comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] theorem FormallySmooth.of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id] #align algebra.formally_smooth.of_equiv Algebra.FormallySmooth.of_equiv theorem FormallyUnramified.of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e' rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc] congr 1 refine' FormallyUnramified.comp_injective I hI _ rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc] #align algebra.formally_unramified.of_equiv Algebra.FormallyUnramified.of_equiv theorem FormallyEtale.of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.of_equiv e, FormallySmooth.of_equiv e⟩ #align algebra.formally_etale.of_equiv Algebra.FormallyEtale.of_equiv end OfEquiv section Polynomial open scoped Polynomial variable (R : Type u) [CommSemiring R] instance FormallySmooth.mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) := by constructor intro C _ _ I _ f have : ∀ s : σ, ∃ c : C, Ideal.Quotient.mk I c = f (MvPolynomial.X s) := fun s => Ideal.Quotient.mk_surjective _ choose g hg using this refine' ⟨MvPolynomial.aeval g, _⟩ ext s rw [← hg, AlgHom.comp_apply, MvPolynomial.aeval_X] rfl #align algebra.formally_smooth.mv_polynomial Algebra.FormallySmooth.mvPolynomial instance FormallySmooth.polynomial : FormallySmooth R R[X] := FormallySmooth.of_equiv (MvPolynomial.pUnitAlgEquiv R) #align algebra.formally_smooth.polynomial Algebra.FormallySmooth.polynomial end Polynomial section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] theorem FormallySmooth.comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ #align algebra.formally_smooth.comp Algebra.FormallySmooth.comp theorem FormallyUnramified.comp [FormallyUnramified R A] [FormallyUnramified A B] : FormallyUnramified R B := by constructor intro C _ _ I hI f₁ f₂ e have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x change F₁ x = F₂ x congr exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e) #align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp theorem FormallyUnramified.of_comp [FormallyUnramified R B] : FormallyUnramified A B := by constructor intro Q _ _ I e f₁ f₂ e' letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine' AlgHom.restrictScalars_injective R _ refine' FormallyUnramified.ext I ⟨2, e⟩ _ intro x exact AlgHom.congr_fun e' x #align algebra.formally_unramified.of_comp Algebra.FormallyUnramified.of_comp theorem FormallyEtale.comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B := FormallyEtale.iff_unramified_and_smooth.mpr ⟨FormallyUnramified.comp R A B, FormallySmooth.comp R A B⟩ #align algebra.formally_etale.comp Algebra.FormallyEtale.comp end Comp section OfSurjective variable {R S : Type u} [CommRing R] [CommSemiring S] variable {P A : Type u} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P] variable (I : Ideal P) (f : P →ₐ[R] A) (hf : Function.Surjective f) theorem FormallySmooth.of_split [FormallySmooth R P] (g : A →ₐ[R] P ⧸ (RingHom.ker f.toRingHom) ^ 2) (hg : f.kerSquareLift.comp g = AlgHom.id R A) : FormallySmooth R A := by constructor intro C _ _ I hI i let l : P ⧸ (RingHom.ker f.toRingHom) ^ 2 →ₐ[R] C := by refine' Ideal.Quotient.liftₐ _ (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) _ have : RingHom.ker f ≤ I.comap (FormallySmooth.lift I ⟨2, hI⟩ (i.comp f)) := by rintro x (hx : f x = 0) have : _ = i (f x) := (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x : _) rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this intro x hx have := (Ideal.pow_right_mono this 2).trans (Ideal.le_comap_pow _ 2) hx rwa [hI] at this have : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R _).comp l := by apply AlgHom.coe_ringHom_injective apply Ideal.Quotient.ringHom_ext ext x exact (FormallySmooth.mk_lift I ⟨2, hI⟩ (i.comp f) x).symm exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩ #align algebra.formally_smooth.of_split Algebra.FormallySmooth.of_split /-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra, then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section. Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits a retraction. -/ theorem FormallySmooth.iff_split_surjection [FormallySmooth R P] : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by constructor · intro have surj : Function.Surjective f.kerSquareLift := fun x => ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩ have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot] refine' ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom, _⟩ ext x have := (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg (FormallySmooth.mk_lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x) -- Porting note: was -- dsimp at this -- rw [AlgEquiv.apply_symm_apply] at this erw [AlgEquiv.apply_symm_apply] at this conv_rhs => rw [← this, AlgHom.id_apply] -- Porting note: lean3 was not finished here: -- obtain ⟨y, e⟩ := -- Ideal.Quotient.mk_surjective -- (FormallySmooth.lift _ ⟨2, sqz⟩ -- (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom -- x) -- dsimp at e ⊢ -- rw [← e] -- rfl · rintro ⟨g, hg⟩; exact FormallySmooth.of_split f g hg #align algebra.formally_smooth.iff_split_surjection Algebra.FormallySmooth.iff_split_surjection end OfSurjective section UnramifiedDerivation open scoped TensorProduct variable {R S : Type u} [CommRing R] [CommRing S] [Algebra R S] instance FormallyUnramified.subsingleton_kaehlerDifferential [FormallyUnramified R S] : Subsingleton (Ω[S⁄R]) := by rw [← not_nontrivial_iff_subsingleton] intro h obtain ⟨f₁, f₂, e⟩ := (KaehlerDifferential.endEquiv R S).injective.nontrivial apply e ext1 apply FormallyUnramified.lift_unique' _ _ _ _ (f₁.2.trans f₂.2.symm) rw [← AlgHom.toRingHom_eq_coe, AlgHom.ker_kerSquareLift] exact ⟨_, Ideal.cotangentIdeal_square _⟩ #align algebra.formally_unramified.subsingleton_kaehler_differential Algebra.FormallyUnramified.subsingleton_kaehlerDifferential theorem FormallyUnramified.iff_subsingleton_kaehlerDifferential : FormallyUnramified R S ↔ Subsingleton (Ω[S⁄R]) := by constructor · intros; infer_instance · intro H constructor intro B _ _ I hI f₁ f₂ e letI := f₁.toRingHom.toAlgebra haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R S).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton exact Subtype.ext_iff.mp (@Subsingleton.elim _ this ⟨f₁, rfl⟩ ⟨f₂, e.symm⟩) #align algebra.formally_unramified.iff_subsingleton_kaehler_differential Algebra.FormallyUnramified.iff_subsingleton_kaehlerDifferential end UnramifiedDerivation section BaseChange open scoped TensorProduct variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable (B : Type u) [CommSemiring B] [Algebra R B] instance FormallyUnramified.base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by constructor intro C _ _ I hI f₁ f₂ e letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 · exact Subsingleton.elim _ _ · exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) #align algebra.formally_unramified.base_change Algebra.FormallyUnramified.base_change instance FormallySmooth.base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by constructor intro C _ _ I hI f letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine' ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) _, _⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R apply TensorProduct.ext' intro b a suffices algebraMap B _ b * f (1 ⊗ₜ[R] a) = f (b ⊗ₜ[R] a) by simpa [Algebra.ofId_apply] rw [← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] #align algebra.formally_smooth.base_change Algebra.FormallySmooth.base_change instance FormallyEtale.base_change [FormallyEtale R A] : FormallyEtale B (B ⊗[R] A) := FormallyEtale.iff_unramified_and_smooth.mpr ⟨inferInstance, inferInstance⟩ #align algebra.formally_etale.base_change Algebra.FormallyEtale.base_change end BaseChange section Localization variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ] variable (M : Submonoid R) variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ] variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ] -- Porting note: no longer supported -- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes] let this : Rₘ →ₐ[R] Q := { IsLocalization.lift this with commutes' := IsLocalization.lift_eq this } use this apply AlgHom.coe_ringHom_injective
refine' IsLocalization.ringHom_ext M _
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ := by constructor intro Q _ _ I e f have : ∀ x : M, IsUnit (algebraMap R Q x) := by intro x apply (IsNilpotent.isUnit_quotient_mk_iff ⟨2, e⟩).mp convert (IsLocalization.map_units Rₘ x).map f simp only [Ideal.Quotient.mk_algebraMap, AlgHom.commutes] let this : Rₘ →ₐ[R] Q := { IsLocalization.lift this with commutes' := IsLocalization.lift_eq this } use this apply AlgHom.coe_ringHom_injective
Mathlib.RingTheory.Etale.482_0.sEffwLG8zJBnQIt
theorem FormallySmooth.of_isLocalization : FormallySmooth R Rₘ
Mathlib_RingTheory_Etale