-- Mathlib/RingTheory/Smooth/Basic.lean
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

Proof state:
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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 ⋯ (i.comp f)) I
x : P
hx : x ∈ RingHom.ker f.toRingHom ^ 2
this : x ∈ Ideal.comap (lift I ⋯ (i.comp f)) (I ^ 2)
⊢ (lift I ⋯ (i.comp f)) x = 0

Tactic:
rwa [hI] at this

Result:
no goals

Proof state:
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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 ⋯ (i.comp f)) I

Tactic:
rintro x (hx : f x = 0)

Result:
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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 ⋯ (i.comp f)) I

Proof state:
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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.toRingHom ^ 2 →ₐ[R] C :=
  Ideal.Quotient.liftₐ (RingHom.ker f.toRingHom ^ 2) (lift I ⋯ (i.comp f)) ⋯
⊢ i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R I).comp l

Tactic:
apply AlgHom.coe_ringHom_injective

Result:
case a
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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.toRingHom ^ 2 →ₐ[R] C :=
  Ideal.Quotient.liftₐ (RingHom.ker f.toRingHom ^ 2) (lift I ⋯ (i.comp f)) ⋯
⊢ ↑(i.comp f.kerSquareLift) = ↑((Ideal.Quotient.mkₐ R I).comp l)

Proof state:
case comp_surjective
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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.toRingHom ^ 2 →ₐ[R] C :=
  Ideal.Quotient.liftₐ (RingHom.ker f.toRingHom ^ 2) (lift I ⋯ (i.comp f)) ⋯
this : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R I).comp l
⊢ ∃ a, (Ideal.Quotient.mkₐ R I).comp a = i

Tactic:
exact ⟨l.comp g, by rw [← AlgHom.comp_assoc, ← this, AlgHom.comp_assoc, hg, AlgHom.comp_id]⟩

Result:
no goals

Proof state:
R : Type u
inst✝⁵ : CommRing R
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
f : P →ₐ[R] A
inst✝ : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp g = AlgHom.id R A
⊢ FormallySmooth R A

Tactic:
constructor

Result:
case comp_surjective
R : Type u
inst✝⁵ : CommRing R
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
f : P →ₐ[R] A
inst✝ : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp g = AlgHom.id 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

Proof state:
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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 ⋯ (i.comp f)) x) = i (f x)
⊢ x ∈ Ideal.comap (lift I ⋯ (i.comp f)) I

Tactic:
rwa [hx, map_zero, ← Ideal.Quotient.mk_eq_mk, Submodule.Quotient.mk_eq_zero] at this

Result:
no goals

Proof state:
case comp_surjective
R : Type u
inst✝⁵ : CommRing R
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
f : P →ₐ[R] A
inst✝ : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp g = AlgHom.id 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

Tactic:
intro C _ _ I hI i

Result:
case comp_surjective
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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, (Ideal.Quotient.mkₐ R I).comp a = i

Proof state:
case comp_surjective
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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.toRingHom ^ 2 →ₐ[R] C :=
  Ideal.Quotient.liftₐ (RingHom.ker f.toRingHom ^ 2) (lift I ⋯ (i.comp f)) ⋯
⊢ ∃ a, (Ideal.Quotient.mkₐ R I).comp a = i

Tactic:
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

Result:
case comp_surjective
R : Type u
inst✝⁷ : CommRing R
P A : Type u
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : CommRing P
inst✝³ : Algebra R P
f : P →ₐ[R] A
inst✝² : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp 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.toRingHom ^ 2 →ₐ[R] C :=
  Ideal.Quotient.liftₐ (RingHom.ker f.toRingHom ^ 2) (lift I ⋯ (i.comp f)) ⋯
this : i.comp f.kerSquareLift = (Ideal.Quotient.mkₐ R I).comp l
⊢ ∃ a, (Ideal.Quotient.mkₐ R I).comp a = i