-- Module: Mathlib.RingTheory.Etale.QuasiFinite
Goal:
R : Type u
S : Type v
T : Type u_1
inst : CommRing R
inst_1 : CommRing S
inst_2 : CommRing T
inst_3 : Algebra R S
inst_4 : Algebra R T
inst_5 : Algebra.FiniteType R T
inst_6 : Algebra.IsIntegral R S
f : S →ₐ[R] T
g : S
hg :
  Function.Surjective.{v + 1, u_1 + 1} (α := Away g) (β := Away (M := T) ((f : (a : S) → T) g : T))
    (⇑(awayMapₐ f g) : (a : Away g) → Away ((f : (a : S) → T) g))
p : Ideal R
inst_7 : p.IsPrime
hgp : IsUnit (M := p.Fiber S) (1 ⊗ₜ[R] g)
this_1 :
  IsClosed (X := PrimeSpectrum R)
    (Set.image (α := PrimeSpectrum S) (PrimeSpectrum.comap (algebraMap R S)) (PrimeSpectrum.zeroLocus {g}))
r : R
hpr : { asIdeal := p, isPrime := inst_7 : PrimeSpectrum R } ∈ (↑(PrimeSpectrum.basicOpen r) : Set (PrimeSpectrum R))
hrg :
  (↑(PrimeSpectrum.basicOpen r) : Set (PrimeSpectrum R)) ⊆
    (Set.image (α := PrimeSpectrum S) (PrimeSpectrum.comap (algebraMap R S)) (PrimeSpectrum.zeroLocus {g}))ᶜ
this_2 :
  IsLocalization.Away.{u_1, u_1} (R := T) ((f.toRingHom : (a : S) → T) ((algebraMap R S : (a : R) → S) r : S) : T)
    (Away (M := T) ((algebraMap R T : (a : R) → T) r : T))
h₁ :
  RingHom.IsIntegral.{u, v} (R := Away r) (A := Away (M := S) ((algebraMap R S : (a : R) → S) r : S))
    (awayMap (algebraMap R S) r)
x : T
n : ℕ
this :
  ∃ (a : S) (k : ℕ) (l : ℕ),
    HMul.hMul (β := T) (HPow.hPow (α := T) ((algebraMap R T : (a : R) → T) r : T) (l + n)) ((f : (a : S) → T) a : T) =
      HPow.hPow (α := T) ((algebraMap R T : (a : R) → T) r : T) (l + k) * x
⊢ ∃ (a : Away (M := S) ((algebraMap R S : (a : R) → S) r : S)),
    Eq (α := Away (M := T) ((algebraMap R T : (a : R) → T) r : T))
      (((IsLocalization.Away.map (Away (M := S) ((algebraMap R S : (a : R) → S) r : S))
                (Away (M := T) ((algebraMap R T : (a : R) → T) r : T)) f.toRingHom ((algebraMap R S : (a : R) → S) r) :
              RingHom.{v, u_1} (Away (M := S) ((algebraMap R S : (a : R) → S) r : S))
                (Away (M := T) ((algebraMap R T : (a : R) → T) r : T))) :
            (a : Away ((algebraMap R S : (a : R) → S) r)) → Away ((algebraMap R T : (a : R) → T) r))
          a :
        Away (M := T) ((algebraMap R T : (a : R) → T) r : T))
      (IsLocalization.mk' (Away (M := T) ((algebraMap R T : (a : R) → T) r : T)) x
          (Subtype.mk (p := fun (x : T) ↦
            Membership.mem (γ := Submonoid T) (Submonoid.powers ((algebraMap R T : (a : R) → T) r) : Submonoid T) x)
            ((fun (x : ℕ) ↦ HPow.hPow (α := T) ((algebraMap R T : (a : R) → T) r : T) x) n) ⋯) :
        Away (M := T) ((algebraMap R T : (a : R) → T) r : T))

Tactic:
simpa [(IsLocalization.mk'_surjective (.powers (algebraMap R S r))).exists,
          IsLocalization.Away.map, IsLocalization.map_mk', IsLocalization.mk'_eq_iff_eq,
          ← map_pow, Submonoid.mem_powers_iff, IsLocalization.Away.map, IsLocalization.map_mk',
          IsLocalization.mk'_eq_iff_eq, ← map_mul, ← mul_assoc, ← pow_add,
          IsLocalization.eq_iff_exists (.powers (algebraMap R T r))]

Premises used: IsLocalization.map_mk', IsLocalization.mk'_surjective, Algebra.algebraMap, Function.Surjective.exists, mul_assoc, pow_add, map_pow, IsLocalization.mk'_eq_iff_eq, map_mul, IsLocalization.Away.map, Submonoid.powers, Submonoid.mem_powers_iff, DFunLike.coe, IsLocalization.eq_iff_exists