awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (goal)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : P.toExtension.Ring
hx : x ∈ P.toExtension.ker
e_2 : ↥Q.toExtension.ker = ↥Q.ker
⊢ Eq (α := P.toExtension.Ring →ₐ[R] Q.toExtension.Ring)
    (Extension.Hom.toAlgHom
      (Extension.Hom.comp (P' := toExtension (Q.comp P)) (Hom.toExtensionHom (Q.ofComp P))
        (Hom.toExtensionHom (Q.toComp P))))
    (AlgHom.comp (IsScalarTower.toAlgHom R S Q.toExtension.Ring) (IsScalarTower.toAlgHom R P.Ring S))
have e_a : ∀ (i : σ),
  Eq (α := Q.toExtension.Ring)
    ((Extension.Hom.toAlgHom
            (Extension.Hom.comp (P' := toExtension (Q.comp P)) (Hom.toExtensionHom (Q.ofComp P))
              (Hom.toExtensionHom (Q.toComp P))) :
          (a : MvPolynomial σ R) → Q.toExtension.Ring)
        (X i) :
      Q.toExtension.Ring)
    ((AlgHom.comp (IsScalarTower.toAlgHom R S Q.toExtension.Ring) (IsScalarTower.toAlgHom R P.Ring S) :
          (a : MvPolynomial σ R) → Q.toExtension.Ring)
        (X i) :
      Q.toExtension.Ring)
Tactic: refine MvPolynomial.algHom_ext fun i ↦ ?_
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (goal)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : P.toExtension.Ring
hx : x ∈ P.toExtension.ker
e_2 : ↥Q.toExtension.ker = ↥Q.ker
i : σ
⊢ Eq (α := Q.toExtension.Ring)
    ((Extension.Hom.toAlgHom
            (Extension.Hom.comp (P' := toExtension (Q.comp P)) (Hom.toExtensionHom (Q.ofComp P))
              (Hom.toExtensionHom (Q.toComp P))) :
          (a : MvPolynomial σ R) → Q.toExtension.Ring)
        (X i) :
      Q.toExtension.Ring)
    ((AlgHom.comp (IsScalarTower.toAlgHom R S Q.toExtension.Ring) (IsScalarTower.toAlgHom R P.Ring S) :
          (a : MvPolynomial σ R) → Q.toExtension.Ring)
        (X i) :
      Q.toExtension.Ring)
have e_a : Eq (α := Q.Ring)
  ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring)
      ((Hom.toAlgHom (Q.toComp P) : (a : P.Ring) → (Q.comp P).Ring) (X i)) :
    Q.Ring)
  ((AlgHom.comp (IsScalarTower.toAlgHom R S Q.toExtension.Ring) (IsScalarTower.toAlgHom R P.Ring S) :
        (a : MvPolynomial σ R) → Q.toExtension.Ring)
      (X i) :
    Q.toExtension.Ring)
Tactic: change (Q.ofComp P).toAlgHom ((Q.toComp P).toAlgHom (X i)) = _
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (goal)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Extension.Cotangent (toExtension (Q.comp P))
hx :
  Eq (α := Q.toExtension.Cotangent)
    ((Extension.Cotangent.map (Hom.toExtensionHom (Q.ofComp P)) :
          (a : (Q.comp P).toExtension.Cotangent) → Q.toExtension.Cotangent)
        x :
      Q.toExtension.Cotangent)
    (0 : Q.toExtension.Cotangent)
⊢ Membership.mem (γ := Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (LinearMap.range (M := T ⊗[S] P.toExtension.Cotangent)
      (LinearMap.liftBaseChange T (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))))
    x
have h2 : ∀ (x : Generators.Ring (Q.comp P))
  (hx' :
    Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x)
  (hx :
    Eq (α := Q.toExtension.Cotangent)
      ((Extension.Cotangent.map (Hom.toExtensionHom (Q.ofComp P)) :
            (a : (Q.comp P).toExtension.Cotangent) → Q.toExtension.Cotangent)
          ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
            (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
              Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P))))
                (Extension.ker (toExtension (Q.comp P))) x)
              x hx')) :
        Q.toExtension.Cotangent)
      (0 : Q.toExtension.Cotangent)),
  Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (LinearMap.range (M := T ⊗[S] P.toExtension.Cotangent)
      (LinearMap.liftBaseChange T (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
Tactic: obtain ⟨⟨x : (Q.comp P).Ring, hx'⟩, rfl⟩ := Extension.Cotangent.mk_surjective x
Cleared hypotheses: x, hx
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (hypothesis)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Generators.Ring (Q.comp P)
hx' : Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x
hx :
  Eq (α := Q.toExtension.Cotangent)
    ((Extension.Cotangent.map (Hom.toExtensionHom (Q.ofComp P)) :
          (a : (Q.comp P).toExtension.Cotangent) → Q.toExtension.Cotangent)
        ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
          (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
            Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P))))
              (Extension.ker (toExtension (Q.comp P))) x)
            x hx')) :
      Q.toExtension.Cotangent)
    (0 : Q.toExtension.Cotangent)
⊢ Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (LinearMap.range (M := T ⊗[S] P.toExtension.Cotangent)
      (LinearMap.liftBaseChange T (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
have hx₁ : Membership.mem (α := Q.Ring) (HPow.hPow (β := ℕ) Q.ker 2)
  ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) x : Q.Ring)
Tactic: replace hx : (Q.ofComp P).toAlgHom x ∈ Q.ker ^ 2 := by
      simpa only [map_mk, val_mk, val_zero, Ideal.toCotangent_eq_zero] using congr(($hx).val)
Cleared hypotheses: hx
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (hypothesis)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Generators.Ring (Q.comp P)
hx' : Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x
hx :
  Membership.mem (α := Q.Ring) (HPow.hPow (β := ℕ) Q.ker 2)
    ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) x : Q.Ring)
⊢ Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (LinearMap.range (M := T ⊗[S] P.toExtension.Cotangent)
      (LinearMap.liftBaseChange T (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
have hx₁ : ∃ x_1 ∈ HMul.hMul (α := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) (ker (Q.comp P)),
  Eq (α := Q.Ring) ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) x_1 : Q.Ring)
    ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) x : Q.Ring)
Tactic: rw [pow_two, ← map_ofComp_ker (P := P), ← Ideal.map_mul, Ideal.mem_map_iff_of_surjective
      _ (toAlgHom_ofComp_surjective Q P)] at hx
Cleared hypotheses: hx
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (goal)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Generators.Ring (Q.comp P)
hx' : Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x
hx :
  ∃ x_1 ∈ HMul.hMul (α := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) (ker (Q.comp P)),
    Eq (α := Q.Ring) ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) x_1 : Q.Ring)
      ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) x : Q.Ring)
⊢ Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (LinearMap.range (M := T ⊗[S] P.toExtension.Cotangent)
      (LinearMap.liftBaseChange T (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
have h2 : ∀ (y : Generators.Ring (Q.comp P))
  (hy : y ∈ HMul.hMul (α := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) (ker (Q.comp P)))
  (e :
    Eq (α := Q.Ring) ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) y : Q.Ring)
      ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) x : Q.Ring)),
  Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (LinearMap.range (M := T ⊗[S] P.toExtension.Cotangent)
      (LinearMap.liftBaseChange T (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
Tactic: obtain ⟨y, hy, e⟩ := hx
Cleared hypotheses: hx
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (hypothesis)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Generators.Ring (Q.comp P)
hx' : Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x
y : Generators.Ring (Q.comp P)
hy : y ∈ HMul.hMul (α := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) (ker (Q.comp P))
e :
  Eq (α := Q.Ring) ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) y : Q.Ring)
    ((Hom.toAlgHom (Q.ofComp P) : (a : (Q.comp P).Ring) → Q.Ring) x : Q.Ring)
⊢ Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (LinearMap.range (M := T ⊗[S] P.toExtension.Cotangent)
      (LinearMap.liftBaseChange T (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
have e₁ : Membership.mem (γ := Ideal (Generators.Ring (Q.comp P)))
  (Ideal.map (F := P.Ring →ₐ[R] Generators.Ring (Q.comp P)) (Hom.toAlgHom (Q.toComp P)) P.ker) (x - y)
Tactic: rw [eq_comm, ← sub_eq_zero, ← map_sub, ← RingHom.mem_ker, ← map_toComp_ker] at e
Cleared hypotheses: e
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (goal)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Generators.Ring (Q.comp P)
hx' : Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x
y : Generators.Ring (Q.comp P)
hy : y ∈ HMul.hMul (α := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) (ker (Q.comp P))
e :
  Membership.mem (γ := Ideal (Generators.Ring (Q.comp P)))
    (Ideal.map (F := P.Ring →ₐ[R] Generators.Ring (Q.comp P)) (Hom.toAlgHom (Q.toComp P)) P.ker) (x - y)
⊢ Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (LinearMap.range (M := T ⊗[S] P.toExtension.Cotangent)
      (LinearMap.liftBaseChange T (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
have h2 : Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
  Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
  (Submodule.span T
    (↑(LinearMap.range (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))) :
      Set (Q.comp P).toExtension.Cotangent))
  ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
      (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
        Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
          x)
        x hx') :
    Extension.Cotangent (toExtension (Q.comp P)))
Tactic: rw [LinearMap.range_liftBaseChange]
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (hypothesis)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Generators.Ring (Q.comp P)
hx' : Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x
y : Generators.Ring (Q.comp P)
hy : y ∈ HMul.hMul (α := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) (ker (Q.comp P))
e :
  Membership.mem (γ := Ideal (Generators.Ring (Q.comp P)))
    (Ideal.map (F := P.Ring →ₐ[R] Generators.Ring (Q.comp P)) (Hom.toAlgHom (Q.toComp P)) P.ker) (x - y)
z : ↥(ker (Q.comp P)) :=
  Subtype.mk (p := fun (x : Generators.Ring (Q.comp P)) ↦
    Membership.mem (γ := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) x) (x - y) ⋯
⊢ Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (Submodule.span T
      (↑(LinearMap.range (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))) :
        Set (Q.comp P).toExtension.Cotangent))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
have hz : Membership.mem (γ := Ideal (Generators.Ring (Q.comp P)))
  (Ideal.map (F := P.Ring →+* Generators.Ring (Q.comp P)) (AlgHom.toRingHom (Hom.toAlgHom (Q.toComp P))) P.ker)
  (↑z : (Q.comp P).Ring)
Tactic: have hz : z.1 ∈ P.ker.map (Q.toComp P).toAlgHom.toRingHom := e
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (hypothesis)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Generators.Ring (Q.comp P)
hx' : Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x
y : Generators.Ring (Q.comp P)
hy : y ∈ HMul.hMul (α := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) (ker (Q.comp P))
e :
  Membership.mem (γ := Ideal (Generators.Ring (Q.comp P)))
    (Ideal.map (F := P.Ring →ₐ[R] Generators.Ring (Q.comp P)) (Hom.toAlgHom (Q.toComp P)) P.ker) (x - y)
z : ↥(ker (Q.comp P)) :=
  Subtype.mk (p := fun (x : Generators.Ring (Q.comp P)) ↦
    Membership.mem (γ := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) x) (x - y) ⋯
hz :
  Membership.mem (γ := Ideal (Generators.Ring (Q.comp P)))
    (Ideal.map (F := P.Ring →+* Generators.Ring (Q.comp P)) (AlgHom.toRingHom (Hom.toAlgHom (Q.toComp P))) P.ker)
    (↑z : (Q.comp P).Ring)
⊢ Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (Submodule.span T
      (↑(LinearMap.range (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))) :
        Set (Q.comp P).toExtension.Cotangent))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
have this : Eq (α := Extension.Cotangent (toExtension (Q.comp P)))
  ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
      (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
        Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
          x)
        x hx') :
    Extension.Cotangent (toExtension (Q.comp P)))
  ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent) z :
    Extension.Cotangent (toExtension (Q.comp P)))
Tactic: have : Extension.Cotangent.mk (P := (Q.comp P).toExtension) ⟨x, hx'⟩ =
      Extension.Cotangent.mk z := by
      ext; simpa only [val_mk, Ideal.toCotangent_eq, sub_sub_cancel, pow_two, z]
-- Lean 4 proof step from Mathlib.RingTheory.Kaehler.JacobiZariski (goal)
Goal:
R : Type u₁
S : Type u₂
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
T : Type u₃
inst_3 : CommRing T
inst_4 : Algebra R T
inst_5 : Algebra S T
inst_6 : IsScalarTower R S T
ι : Type w₁
σ : Type w₂
Q : Generators S T ι
P : Generators R S σ
x : Generators.Ring (Q.comp P)
hx' : Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P))) x
y : Generators.Ring (Q.comp P)
hy : y ∈ HMul.hMul (α := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) (ker (Q.comp P))
e :
  Membership.mem (γ := Ideal (Generators.Ring (Q.comp P)))
    (Ideal.map (F := P.Ring →ₐ[R] Generators.Ring (Q.comp P)) (Hom.toAlgHom (Q.toComp P)) P.ker) (x - y)
z : ↥(ker (Q.comp P)) :=
  Subtype.mk (p := fun (x : Generators.Ring (Q.comp P)) ↦
    Membership.mem (γ := Ideal (Generators.Ring (Q.comp P))) (ker (Q.comp P)) x) (x - y) ⋯
hz :
  Membership.mem (γ := Ideal (Generators.Ring (Q.comp P)))
    (Ideal.map (F := P.Ring →+* Generators.Ring (Q.comp P)) (AlgHom.toRingHom (Hom.toAlgHom (Q.toComp P))) P.ker)
    (↑z : (Q.comp P).Ring)
this :
  Eq (α := Extension.Cotangent (toExtension (Q.comp P)))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent) z :
      Extension.Cotangent (toExtension (Q.comp P)))
⊢ Membership.mem (α := Extension.Cotangent (toExtension (Q.comp P))) (γ :=
    Submodule T (Extension.Cotangent (toExtension (Q.comp P))))
    (Submodule.span T
      (↑(LinearMap.range (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))) :
        Set (Q.comp P).toExtension.Cotangent))
    ((Extension.Cotangent.mk : (a : ↥(Q.comp P).toExtension.ker) → (Q.comp P).toExtension.Cotangent)
        (Subtype.mk (p := fun (x : Extension.Ring (toExtension (Q.comp P))) ↦
          Membership.mem (γ := Ideal (Extension.Ring (toExtension (Q.comp P)))) (Extension.ker (toExtension (Q.comp P)))
            x)
          x hx') :
      Extension.Cotangent (toExtension (Q.comp P)))
have h2 : (↑z : (Q.comp P).toExtension.Ring) ∈
  Submodule.map (Submodule.subtype (Extension.ker (toExtension (Q.comp P))))
    (Submodule.comap Extension.Cotangent.mk
      (Submodule.restrictScalars (Generators.Ring (Q.comp P))
        (Submodule.span T
          (↑(LinearMap.range (Extension.Cotangent.map (Hom.toExtensionHom (Q.toComp P)))) :
            Set (Q.comp P).toExtension.Cotangent))))
Tactic: rw [this, ← Submodule.restrictScalars_mem (Q.comp P).Ring, ← Submodule.mem_comap,
      ← Submodule.span_singleton_le_iff_mem, ← Submodule.map_le_map_iff_of_injective
      (f := Submodule.subtype _) Subtype.val_injective, Submodule.map_subtype_span_singleton,
      Submodule.span_singleton_le_iff_mem]