-- Mathlib/RingTheory/Smooth/Pi.lean
theorem pi_iff [Finite I] :
    FormallySmooth R (Π i, A i) ↔ ∀ i, FormallySmooth R (A i)

Proof state:
case h.e_6.h.a
R : Type (max u v)
I : Type u
A : I → Type (max u v)
inst✝⁵ : CommRing R
inst✝⁴ : (i : I) → CommRing (A i)
inst✝³ : (i : I) → Algebra R (A i)
inst✝² : Finite I
val✝ : Fintype I
H : ∀ (i : I), FormallySmooth R (A i)
B : Type (max u v)
inst✝¹ : CommRing B
inst✝ : Algebra R B
J : Ideal B
hJ : J ^ 2 = ⊥
g : ((i : I) → A i) →ₐ[R] B ⧸ J
hJ' : ∀ x ∈ RingHom.ker (Ideal.Quotient.mk J), IsNilpotent x
e : I → B
he : CompleteOrthogonalIdempotents e
he' : ∀ (i : I), (Ideal.Quotient.mk J) (e i) = g (Pi.single i 1)
iso : B ≃ₐ[R] (i : I) → B ⧸ Ideal.span {1 - e i} :=
  let __spread.0 :=
    Pi.algHom R (fun i => B ⧸ Ideal.span {1 - e i}) fun i => Ideal.Quotient.mkₐ R (Ideal.span {1 - e i});
  let __spread.1 := Equiv.ofBijective ⇑(Pi.ringHom fun i => Ideal.Quotient.mk (Ideal.span {1 - e i})) ⋯;
  { toFun := (↑↑__spread.0.toRingHom).toFun, invFun := __spread.1.invFun, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯,
    map_add' := ⋯, commutes' := ⋯ }
J' : (i : I) → Ideal (B ⧸ Ideal.span {1 - e i}) := fun i => Ideal.map (Ideal.Quotient.mk (Ideal.span {1 - e i})) J
ι : (i : I) → B ⧸ J →ₐ[R] (B ⧸ Ideal.span {1 - e i}) ⧸ J' i :=
  fun i => Ideal.quotientMapₐ (J' i) (IsScalarTower.toAlgHom R B (B ⧸ Ideal.span {1 - e i})) ⋯
hι : ∀ (i : I) (x : B ⧸ J), (ι i) x = 0 → (Ideal.Quotient.mk J) (e i) * x = 0
a : (i : I) → A i →ₐ[R] B ⧸ Ideal.span {1 - e i}
ha : ∀ (i : I) (x : A i), (Ideal.Quotient.mk (J' i)) ((a i) x) = (ι i) (g (Pi.single i x))
x✝ : (i : I) → A i
i : I
x : A i
y : B
hy : (Ideal.Quotient.mk (Ideal.span {1 - e i})) y = (a i) x
hy' : (Ideal.Quotient.mk (Ideal.span {1 - e i})) (y * e i) = (a i) x
⊢ iso
      (iso.symm
        ((Pi.algHom R (fun i => B ⧸ Ideal.span {1 - e i}) fun i => (a i).comp (Pi.evalAlgHom R A i)) (Pi.single i x))) =
    iso (y * e i)

Tactic:
ext j

Result:
case h.e_6.h.a.h
R : Type (max u v)
I : Type u
A : I → Type (max u v)
inst✝⁵ : CommRing R
inst✝⁴ : (i : I) → CommRing (A i)
inst✝³ : (i : I) → Algebra R (A i)
inst✝² : Finite I
val✝ : Fintype I
H : ∀ (i : I), FormallySmooth R (A i)
B : Type (max u v)
inst✝¹ : CommRing B
inst✝ : Algebra R B
J : Ideal B
hJ : J ^ 2 = ⊥
g : ((i : I) → A i) →ₐ[R] B ⧸ J
hJ' : ∀ x ∈ RingHom.ker (Ideal.Quotient.mk J), IsNilpotent x
e : I → B
he : CompleteOrthogonalIdempotents e
he' : ∀ (i : I), (Ideal.Quotient.mk J) (e i) = g (Pi.single i 1)
iso : B ≃ₐ[R] (i : I) → B ⧸ Ideal.span {1 - e i} :=
  let __spread.0 :=
    Pi.algHom R (fun i => B ⧸ Ideal.span {1 - e i}) fun i => Ideal.Quotient.mkₐ R (Ideal.span {1 - e i});
  let __spread.1 := Equiv.ofBijective ⇑(Pi.ringHom fun i => Ideal.Quotient.mk (Ideal.span {1 - e i})) ⋯;
  { toFun := (↑↑__spread.0.toRingHom).toFun, invFun := __spread.1.invFun, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯,
    map_add' := ⋯, commutes' := ⋯ }
J' : (i : I) → Ideal (B ⧸ Ideal.span {1 - e i}) := fun i => Ideal.map (Ideal.Quotient.mk (Ideal.span {1 - e i})) J
ι : (i : I) → B ⧸ J →ₐ[R] (B ⧸ Ideal.span {1 - e i}) ⧸ J' i :=
  fun i => Ideal.quotientMapₐ (J' i) (IsScalarTower.toAlgHom R B (B ⧸ Ideal.span {1 - e i})) ⋯
hι : ∀ (i : I) (x : B ⧸ J), (ι i) x = 0 → (Ideal.Quotient.mk J) (e i) * x = 0
a : (i : I) → A i →ₐ[R] B ⧸ Ideal.span {1 - e i}
ha : ∀ (i : I) (x : A i), (Ideal.Quotient.mk (J' i)) ((a i) x) = (ι i) (g (Pi.single i x))
x✝ : (i : I) → A i
i : I
x : A i
y : B
hy : (Ideal.Quotient.mk (Ideal.span {1 - e i})) y = (a i) x
hy' : (Ideal.Quotient.mk (Ideal.span {1 - e i})) (y * e i) = (a i) x
j : I
⊢ iso
      (iso.symm
        ((Pi.algHom R (fun i => B ⧸ Ideal.span {1 - e i}) fun i => (a i).comp (Pi.evalAlgHom R A i)) (Pi.single i x)))
      j =
    iso (y * e i) j

Proof state:
case intro.mpr.comp_surjective
R : Type (max u v)
I : Type u
A : I → Type (max u v)
inst✝⁵ : CommRing R
inst✝⁴ : (i : I) → CommRing (A i)
inst✝³ : (i : I) → Algebra R (A i)
inst✝² : Finite I
val✝ : Fintype I
H : ∀ (i : I), FormallySmooth R (A i)
B : Type (max u v)
inst✝¹ : CommRing B
inst✝ : Algebra R B
J : Ideal B
hJ : J ^ 2 = ⊥
g : ((i : I) → A i) →ₐ[R] B ⧸ J
hJ' : ∀ x ∈ RingHom.ker (Ideal.Quotient.mk J), IsNilpotent x
⊢ ∃ a, (Ideal.Quotient.mkₐ R J).comp a = g

Tactic:
obtain ⟨e, he, he'⟩ := ((CompleteOrthogonalIdempotents.single A).map
  g.toRingHom).lift_of_isNilpotent_ker (Ideal.Quotient.mk J) hJ'
    fun _ ↦ Ideal.Quotient.mk_surjective _

Result:
case intro.mpr.comp_surjective.intro.intro
R : Type (max u v)
I : Type u
A : I → Type (max u v)
inst✝⁵ : CommRing R
inst✝⁴ : (i : I) → CommRing (A i)
inst✝³ : (i : I) → Algebra R (A i)
inst✝² : Finite I
val✝ : Fintype I
H : ∀ (i : I), FormallySmooth R (A i)
B : Type (max u v)
inst✝¹ : CommRing B
inst✝ : Algebra R B
J : Ideal B
hJ : J ^ 2 = ⊥
g : ((i : I) → A i) →ₐ[R] B ⧸ J
hJ' : ∀ x ∈ RingHom.ker (Ideal.Quotient.mk J), IsNilpotent x
e : I → B
he : CompleteOrthogonalIdempotents e
he' : ⇑(Ideal.Quotient.mk J) ∘ e = ⇑g.toRingHom ∘ fun x => Pi.single x 1
⊢ ∃ a, (Ideal.Quotient.mkₐ R J).comp a = g