awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e_1 : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e_1
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hgq : ((algebraMap R'' S : (a : R'') → S) g : S) ∉ q
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this : Algebra.IsIntegral R' (Localization.Away e₀)
a : R'
b : S
b' : R''
m : ℕ
e : (algebraMap R'' S : (a : R'') → S) b' = HPow.hPow (α := S) ((algebraMap R'' S : (a : R'') → S) g : S) m * b
⊢ ∃ (b_1 : R' ⊗[R] R'') (m : ℕ),
    ((AlgHom.toRingHom
              (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
            R' ⊗[R] R'' →+* R' ⊗[R] S) :
          (a : R' ⊗[R] R'') → R' ⊗[R] S)
        b_1 =
      HPow.hPow (α := R' ⊗[R] S)
          (((AlgHom.toRingHom
                    (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) :
                      R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
                  R' ⊗[R] R'' →+* R' ⊗[R] S) :
                (a : R' ⊗[R] R'') → R' ⊗[R] S)
              (e₀ * 1 ⊗ₜ[R] g) :
            R' ⊗[R] S)
          m *
        a ⊗ₜ[R] b

Tactic:
⟨e₀ ^ m * a ⊗ₜ b', m, ?_⟩

Premises used: HMul.hMul, HPow.hPow, Exists.intro, TensorProduct.tmul
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e_1 : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e_1
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hgq : ((algebraMap R'' S : (a : R'') → S) g : S) ∉ q
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this : Algebra.IsIntegral R' (Localization.Away e₀)
a : R'
b : S
b' : R''
m : ℕ
e : (algebraMap R'' S : (a : R'') → S) b' = HPow.hPow (α := S) ((algebraMap R'' S : (a : R'') → S) g : S) m * b
H₁ :
  ((AlgHom.toRingHom
            (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
          R' ⊗[R] R'' →+* R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      (e₀ ^ m * a ⊗ₜ[R] b') =
    HPow.hPow (α := R' ⊗[R] S)
        (((AlgHom.toRingHom
                  (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) :
                    R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
                R' ⊗[R] R'' →+* R' ⊗[R] S) :
              (a : R' ⊗[R] R'') → R' ⊗[R] S)
            (e₀ * 1 ⊗ₜ[R] g) :
          R' ⊗[R] S)
        m *
      a ⊗ₜ[R] b
⊢ ∃ (b_1 : R' ⊗[R] R'') (m : ℕ),
    ((AlgHom.toRingHom
              (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
            R' ⊗[R] R'' →+* R' ⊗[R] S) :
          (a : R' ⊗[R] R'') → R' ⊗[R] S)
        b_1 =
      HPow.hPow (α := R' ⊗[R] S)
          (((AlgHom.toRingHom
                    (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) :
                      R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
                  R' ⊗[R] R'' →+* R' ⊗[R] S) :
                (a : R' ⊗[R] R'') → R' ⊗[R] S)
              (e₀ * 1 ⊗ₜ[R] g) :
            R' ⊗[R] S)
          m *
        a ⊗ₜ[R] b

Tactic:
refine ⟨e₀ ^ m * a ⊗ₜ b', m, ?_⟩
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e_1 : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e_1
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hgq : ((algebraMap R'' S : (a : R'') → S) g : S) ∉ q
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this : Algebra.IsIntegral R' (Localization.Away e₀)
a : R'
b : S
b' : R''
m : ℕ
e : (algebraMap R'' S : (a : R'') → S) b' = HPow.hPow (α := S) ((algebraMap R'' S : (a : R'') → S) g : S) m * b
⊢ ((AlgHom.toRingHom
            (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
          R' ⊗[R] R'' →+* R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      (e₀ ^ m * a ⊗ₜ[R] b') =
    HPow.hPow (α := R' ⊗[R] S)
        (((AlgHom.toRingHom
                  (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) :
                    R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
                R' ⊗[R] R'' →+* R' ⊗[R] S) :
              (a : R' ⊗[R] R'') → R' ⊗[R] S)
            (e₀ * 1 ⊗ₜ[R] g) :
          R' ⊗[R] S)
        m *
      a ⊗ₜ[R] b

Tactic:
simp [e, mul_pow, mul_assoc]

Premises used: mul_assoc, mul_pow
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hgq : ((algebraMap R'' S : (a : R'') → S) g : S) ∉ q
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this : Algebra.IsIntegral R' (Localization.Away e₀)
contrapose :
  ∀
    (hgq :
      ¬IsUnit (M := P.Fiber (Localization.Away e₀))
          (1 ⊗ₜ[R']
            (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g))),
    Membership.mem (α := S) q ((algebraMap R'' S : (a : R'') → S) g : S)
⊢ IsUnit (M := P.Fiber (Localization.Away e₀))
    (1 ⊗ₜ[R'] (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g))

Tactic:
contrapose hgq
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this : Algebra.IsIntegral R' (Localization.Away e₀)
hgq :
  ¬IsUnit (M := P.Fiber (Localization.Away e₀))
      (1 ⊗ₜ[R']
        (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g))
obtain :
  ∀ (m : Ideal (P.Fiber (Localization.Away e₀))),
    m.IsMaximal →
      ∀
        (hm :
          Ideal.span
              {1 ⊗ₜ[R']
                  (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀)
                    (1 ⊗ₜ[R] g)} ≤
            m),
        Membership.mem (α := S) q ((algebraMap R'' S : (a : R'') → S) g : S)
⊢ Membership.mem (α := S) q ((algebraMap R'' S : (a : R'') → S) g : S)

Tactic:
obtain ⟨m, _, hm⟩ := Ideal.exists_le_maximal _ (Ideal.span_singleton_eq_top.not.mpr hgq)

Premises used: Iff.mpr, Iff.not, Ideal.span_singleton_eq_top, Ideal.exists_le_maximal
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this : Algebra.IsIntegral R' (Localization.Away e₀)
hgq :
  ¬IsUnit (M := P.Fiber (Localization.Away e₀))
      (1 ⊗ₜ[R']
        (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g))
m : Ideal (P.Fiber (Localization.Away e₀))
left : m.IsMaximal
hm :
  Ideal.span
      {1 ⊗ₜ[R']
          (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g)} ≤
    m
⊢ Eq (α := Ideal (R' ⊗[R] R''))
    (Ideal.comap (F := R' ⊗[R] R'' →+* P.ResidueField ⊗[R'] Localization.Away e₀)
      (RingHom.comp (AlgHom.toRingHom TensorProduct.includeRight) (algebraMap (R' ⊗[R] R'') (Localization.Away e₀))) m)
    (Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
      (AlgHom.toRingHom
        (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
      P')

Tactic:
have := H (m.comap (Algebra.TensorProduct.includeRight.toRingHom.comp (algebraMap _ _)))
      inferInstance (m.comap_liesOver P (Algebra.TensorProduct.includeRight.comp
        (IsScalarTower.toAlgHom _ _ _)))
        (Ideal.notMem_of_isUnit (m.comap Algebra.TensorProduct.includeRight)
        (IsLocalization.Away.algebraMap_isUnit _))
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this_1 : Algebra.IsIntegral R' (Localization.Away e₀)
hgq :
  ¬IsUnit (M := P.Fiber (Localization.Away e₀))
      (1 ⊗ₜ[R']
        (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g))
m : Ideal (P.Fiber (Localization.Away e₀))
left : m.IsMaximal
hm :
  Ideal.span
      {1 ⊗ₜ[R']
          (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g)} ≤
    m
this :
  Eq (α := Ideal (R' ⊗[R] R''))
    (Ideal.comap (F := R' ⊗[R] R'' →+* P.ResidueField ⊗[R'] Localization.Away e₀)
      (RingHom.comp (AlgHom.toRingHom TensorProduct.includeRight) (algebraMap (R' ⊗[R] R'') (Localization.Away e₀))) m)
    (Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
      (AlgHom.toRingHom
        (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
      P')
rw :
  Membership.mem (α := S) (γ := Ideal S)
    (Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P')
    ((algebraMap R'' S : (a : R'') → S) g : S)
⊢ Membership.mem (α := S) q ((algebraMap R'' S : (a : R'') → S) g : S)

Tactic:
rw [← hP'q]
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this_1 : Algebra.IsIntegral R' (Localization.Away e₀)
hgq :
  ¬IsUnit (M := P.Fiber (Localization.Away e₀))
      (1 ⊗ₜ[R']
        (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g))
m : Ideal (P.Fiber (Localization.Away e₀))
left : m.IsMaximal
hm :
  Ideal.span
      {1 ⊗ₜ[R']
          (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g)} ≤
    m
this :
  Eq (α := Ideal (R' ⊗[R] R''))
    (Ideal.comap (F := R' ⊗[R] R'' →+* P.ResidueField ⊗[R'] Localization.Away e₀)
      (RingHom.comp (AlgHom.toRingHom TensorProduct.includeRight) (algebraMap (R' ⊗[R] R'') (Localization.Away e₀))) m)
    (Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
      (AlgHom.toRingHom
        (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
      P')
⊢ Membership.mem (α := S) (γ := Ideal S)
    (Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P')
    ((algebraMap R'' S : (a : R'') → S) g : S)

Tactic:
this.le ((Ideal.span_singleton_le_iff_mem _).mp hm :)

Premises used: Quotient.liftOn', Set.Mem, AddCon.liftOn, setOf, Eq.le, List.foldl, Ideal.span_singleton_le_iff_mem, Quotient, Set.preimage, Iff.mp, TensorProduct, TensorProduct.tmul, AddCon.Quotient, AddCon.toQuotient, FreeAddMonoid.sumAux
-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u_2
S : Type u_3
R' : Type u_4
R'' : Type u_5
inst : CommRing R
inst_1 : CommRing S
inst_2 : Algebra R S
inst_3 : FiniteType R S
inst_4 : CommRing R'
inst_5 : Algebra R R'
inst_6 : CommRing R''
inst_7 : Algebra R R''
inst_8 : Algebra R'' S
inst_9 : Algebra.IsIntegral R R''
inst_10 : IsScalarTower R R'' S
q : Ideal S
P : Ideal R'
inst_11 : P.IsPrime
e : R' ⊗[R] S
e₀ : R' ⊗[R] R''
he₀ : IsIdempotentElem e₀
he₀e :
  ((TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S) :
        (a : R' ⊗[R] R'') → R' ⊗[R] S)
      e₀ =
    e
P' : Ideal (R' ⊗[R] S)
hP'q : Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P' = q
H :
  ∀ (P'' : Ideal (R' ⊗[R] R'')),
    P''.IsPrime →
      P''.LiesOver P →
        e₀ ∉ P'' →
          P'' =
            Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
              (AlgHom.toRingHom
                (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
              P'
g : R''
hg :
  Function.Surjective.{u_5 + 1, u_3 + 1} (α := Localization.Away g) (β :=
    Localization.Away (M := S) ((algebraMap R'' S : (a : R'') → S) g : S))
    (⇑(Localization.awayMap (algebraMap R'' S) g) :
      (a : Localization.Away g) → Localization.Away ((algebraMap R'' S : (a : R'') → S) g))
this_1 : Algebra.IsIntegral R' (Localization.Away e₀)
hgq :
  ¬IsUnit (M := P.Fiber (Localization.Away e₀))
      (1 ⊗ₜ[R']
        (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g))
m : Ideal (P.Fiber (Localization.Away e₀))
left : m.IsMaximal
hm :
  Ideal.span
      {1 ⊗ₜ[R']
          (algebraMap (R' ⊗[R] R'') (Localization.Away e₀) : (a : R' ⊗[R] R'') → Localization.Away e₀) (1 ⊗ₜ[R] g)} ≤
    m
this :
  Eq (α := Ideal (R' ⊗[R] R''))
    (Ideal.comap (F := R' ⊗[R] R'' →+* P.ResidueField ⊗[R'] Localization.Away e₀)
      (RingHom.comp (AlgHom.toRingHom TensorProduct.includeRight) (algebraMap (R' ⊗[R] R'') (Localization.Away e₀))) m)
    (Ideal.comap (F := R' ⊗[R] R'' →+* R' ⊗[R] S)
      (AlgHom.toRingHom
        (TensorProduct.map (AlgHom.id R' R') (IsScalarTower.toAlgHom R R'' S) : R' ⊗[R] R'' →ₐ[R'] R' ⊗[R] S))
      P')
⊢ Membership.mem (α := S) (γ := Ideal S)
    (Ideal.comap (F := S →+* R' ⊗[R] S) (AlgHom.toRingHom TensorProduct.includeRight) P')
    ((algebraMap R'' S : (a : R'') → S) g : S)

Tactic:
exact this.le ((Ideal.span_singleton_le_iff_mem _).mp hm :)

Premises used: Eq.le, Ideal.span_singleton_le_iff_mem, Iff.mp