@@ -7,6 +7,7 @@ import Mathlib.RingTheory.FiniteStability
77import Mathlib.RingTheory.Ideal.Quotient.Nilpotent
88import Mathlib.RingTheory.Localization.Away.AdjoinRoot
99import Mathlib.RingTheory.Smooth.Kaehler
10+ import Mathlib.RingTheory.Unramified.Basic
1011
1112/-!
1213
@@ -381,6 +382,8 @@ open scoped Polynomial in
381382instance polynomial (R : Type *) [CommRing R] :
382383 FormallySmooth R R[X] := .of_equiv (MvPolynomial.pUnitAlgEquiv.{_, 0 } R)
383384
385+ instance : FormallySmooth R R := .of_equiv (MvPolynomial.isEmptyAlgEquiv R Empty)
386+
384387end Polynomial
385388
386389section Comp
@@ -397,8 +400,41 @@ theorem comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := b
397400 apply_fun AlgHom.restrictScalars R at e'
398401 exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩
399402
403+ lemma of_restrictScalars [FormallyUnramified R A] [FormallySmooth R B] :
404+ FormallySmooth A B := by
405+ refine iff_comp_surjective.mpr fun C _ _ I hI f ↦ ?_
406+ algebraize [(algebraMap A C).comp (algebraMap R A)]
407+ obtain ⟨g, hg⟩ := Algebra.FormallySmooth.comp_surjective _ _ I hI (f.restrictScalars R)
408+ suffices g.comp (IsScalarTower.toAlgHom R A B) = IsScalarTower.toAlgHom R A C from
409+ ⟨{ __ := g, commutes' x := congr($this x) }, AlgHom.ext fun x ↦ congr($hg x)⟩
410+ apply Algebra.FormallyUnramified.comp_injective _ hI
411+ rw [← AlgHom.comp_assoc, hg]
412+ exact AlgHom.ext f.commutes
413+
400414end Comp
401415
416+ section surjective
417+
418+ variable {R : Type *} [CommRing R]
419+ variable {P A : Type *} [CommRing A] [Algebra R A] [CommRing P] [Algebra R P]
420+ variable (f : P →ₐ[R] A)
421+
422+ lemma iff_of_surjective (h : Function.Surjective (algebraMap R A)) :
423+ Algebra.FormallySmooth R A ↔ IsIdempotentElem (RingHom.ker (algebraMap R A)) := by
424+ rw [Algebra.FormallySmooth.iff_split_surjection (Algebra.ofId R A) h]
425+ constructor
426+ · intro ⟨g, hg⟩
427+ let e : A ≃ₐ[R] R ⧸ RingHom.ker (algebraMap R A) ^ 2 :=
428+ .ofAlgHom _ _ (Ideal.Quotient.algHom_ext _ (by ext)) hg
429+ rw [IsIdempotentElem, ← pow_two, ← Ideal.mk_ker (I := _ ^ 2 ), ← Ideal.Quotient.algebraMap_eq,
430+ ← e.toAlgHom.comp_algebraMap, RingHom.ker_comp_of_injective _ (by exact e.injective)]
431+ · intro H
432+ let e := (Ideal.quotientEquivAlgOfEq _ ((pow_two _).trans H)).trans
433+ (Ideal.quotientKerAlgEquivOfSurjective (f := Algebra.ofId R A) h)
434+ exact ⟨e.symm.toAlgHom, AlgHom.ext <| h.forall.mpr fun x ↦ by simp⟩
435+
436+ end surjective
437+
402438section BaseChange
403439
404440open scoped TensorProduct
0 commit comments