File: Mathlib/RingTheory/Smooth/Basic.lean

full_name: Algebra.formallySmooth_iff
code: /-- 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`.

See <https://stacks.math.columbia.edu/tag/00TI>.
-/
@[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)
goal: Algebra.FormallySmooth R A ↔
  ∀ ⦃B : Type u⦄ [inst : CommRing B] [inst_1 : Algebra R B] (I : Ideal B),
    I ^ 2 = ⊥ → Function.Surjective (Ideal.Quotient.mkₐ R I).comp

full_name: Algebra.FormallySmooth.comp_surjective
code: /-- 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`.

See <https://stacks.math.columbia.edu/tag/00TI>.
-/
@[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)
goal: I ^ 2 = ⊥ → Function.Surjective (Ideal.Quotient.mkₐ R I).comp

full_name: Algebra.FormallySmooth
code: /-- 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`.

See <https://stacks.math.columbia.edu/tag/00TI>.
-/
@[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)
goal: Prop

full_name: Algebra.FormallySmooth.exists_lift
code: theorem 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 
goal: ∃ f, (Ideal.Quotient.mkₐ R I).comp f = g

full_name: Algebra.FormallySmooth.lift
code: /-- 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 lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I)
    (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B 
goal: A →ₐ[R] B

full_name: Algebra.FormallySmooth.comp_lift
code: @[simp]
theorem 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 
goal: (Ideal.Quotient.mkₐ R I).comp (Algebra.FormallySmooth.lift I hI g) = g

full_name: Algebra.FormallySmooth.mk_lift
code: @[simp]
theorem 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 
goal: (Ideal.Quotient.mk I) ((Algebra.FormallySmooth.lift I hI g) x) = g x

full_name: Algebra.FormallySmooth.liftOfSurjective
code: /-- 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 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 
goal: A →ₐ[R] B

full_name: Algebra.FormallySmooth.liftOfSurjective_apply
code: @[simp]
theorem 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 
goal: g ((Algebra.FormallySmooth.liftOfSurjective f g hg hg') x) = f x

full_name: Algebra.FormallySmooth.comp_liftOfSurjective
code: @[simp]
theorem 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 
goal: g.comp (Algebra.FormallySmooth.liftOfSurjective f g hg hg') = f

full_name: Algebra.FormallySmooth.of_equiv
code: theorem of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B 
goal: Algebra.FormallySmooth R B

full_name: Algebra.FormallySmooth.mvPolynomial
code: instance mvPolynomial (σ : Type u) : FormallySmooth R (MvPolynomial σ R) 
goal: Algebra.FormallySmooth R (MvPolynomial σ R)

full_name: Algebra.FormallySmooth.polynomial
code: instance polynomial : FormallySmooth R R[X] 
goal: Algebra.FormallySmooth R (Polynomial R)

full_name: Algebra.FormallySmooth.comp
code: theorem comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B 
goal: Algebra.FormallySmooth R B

full_name: Algebra.FormallySmooth.of_split
code: theorem 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 
goal: Algebra.FormallySmooth R A

full_name: Algebra.FormallySmooth.iff_split_surjection
code: /-- 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 iff_split_surjection [FormallySmooth R P] :
    FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A 
goal: Algebra.FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A

full_name: Algebra.FormallySmooth.base_change
code: instance base_change [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) 
goal: Algebra.FormallySmooth B (B ⊗[R] A)

full_name: Algebra.FormallySmooth.of_isLocalization
code: theorem of_isLocalization : FormallySmooth R Rₘ 
goal: Algebra.FormallySmooth R Rₘ

full_name: Algebra.FormallySmooth.localization_base
code: theorem localization_base [FormallySmooth R Sₘ] : FormallySmooth Rₘ Sₘ 
goal: Algebra.FormallySmooth Rₘ Sₘ

full_name: Algebra.FormallySmooth.localization_map
code: theorem localization_map [FormallySmooth R S] : FormallySmooth Rₘ Sₘ 
goal: Algebra.FormallySmooth Rₘ Sₘ

full_name: Algebra.Smooth
code: /-- An `R` algebra `A` is smooth if it is formally smooth and of finite presentation.

In the stacks project, the definition of smooth is completely different, and tag
<https://stacks.math.columbia.edu/tag/00TN> proves that their definition is equivalent
to this.
-/
class Smooth [CommSemiring R] (A : Type u) [Semiring A] [Algebra R A] : Prop where
  formallySmooth : FormallySmooth R A := by infer_instance
  finitePresentation : FinitePresentation R A := by infer_instance
goal: Prop

full_name: Algebra.Smooth.formallySmooth
code: /-- An `R` algebra `A` is smooth if it is formally smooth and of finite presentation.

In the stacks project, the definition of smooth is completely different, and tag
<https://stacks.math.columbia.edu/tag/00TN> proves that their definition is equivalent
to this.
-/
class Smooth [CommSemiring R] (A : Type u) [Semiring A] [Algebra R A] : Prop where
  formallySmooth : FormallySmooth R A := by infer_instance
  finitePresentation : FinitePresentation R A := by infer_instance
goal: Algebra.FormallySmooth R A

full_name: Algebra.Smooth.finitePresentation
code: /-- An `R` algebra `A` is smooth if it is formally smooth and of finite presentation.

In the stacks project, the definition of smooth is completely different, and tag
<https://stacks.math.columbia.edu/tag/00TN> proves that their definition is equivalent
to this.
-/
class Smooth [CommSemiring R] (A : Type u) [Semiring A] [Algebra R A] : Prop where
  formallySmooth : FormallySmooth R A := by infer_instance
  finitePresentation : FinitePresentation R A := by infer_instance
goal: Algebra.FinitePresentation R A

full_name: Algebra.Smooth.of_equiv
code: /-- Being smooth is transported via algebra isomorphisms. -/
theorem of_equiv [Smooth R A] (e : A ≃ₐ[R] B) : Smooth R B 
goal: Algebra.Smooth R B

full_name: Algebra.Smooth.of_isLocalization_Away
code: /-- Localization at an element is smooth. -/
theorem of_isLocalization_Away (r : R) [IsLocalization.Away r A] : Smooth R A 
goal: Algebra.Smooth R A

full_name: Algebra.Smooth.comp
code: /-- Smooth is stable under composition. -/
theorem comp [Algebra A B] [IsScalarTower R A B] [Smooth R A] [Smooth A B] : Smooth R B 
goal: Algebra.Smooth R B

full_name: Algebra.Smooth.baseChange
code: /-- Smooth is stable under base change. -/
instance baseChange [Smooth R A] : Smooth B (B ⊗[R] A) 
goal: Algebra.Smooth B (B ⊗[R] A)