-- Mathlib/RingTheory/RingHom/Locally.lean
/-- If `P` is stable under base change, then so is `Locally P`. -/
lemma locally_isStableUnderBaseChange (hPi : RespectsIso P) (hPb : IsStableUnderBaseChange P) :
    IsStableUnderBaseChange (Locally P)

Proof state:
case h.e
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hPi : RespectsIso fun {R S} [CommRing R] [CommRing S] => P
hPb : IsStableUnderBaseChange fun {R S} [CommRing R] [CommRing S] => P
R S T : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
s : Set T
hsone : Ideal.span s = ⊤
hs : ∀ t ∈ s, (fun {R S} [CommRing R] [CommRing S] => P) ((algebraMap T (Localization.Away t)).comp (algebraMap R T))
this✝⁴ : (a : ↑s) → Algebra (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a) :=
  fun a => (Algebra.TensorProduct.map (AlgHom.id R S) (IsScalarTower.toAlgHom R T (Localization.Away ↑a))).toAlgebra
this✝³ : (a : ↑s) → Algebra T (S ⊗[R] Localization.Away ↑a) :=
  fun a => ((algebraMap (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)).comp (algebraMap T (S ⊗[R] T))).toAlgebra
this✝² : ∀ (a : ↑s), IsScalarTower T (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
this✝¹ : ∀ (a : ↑s), IsScalarTower T (Localization.Away ↑a) (S ⊗[R] Localization.Away ↑a)
this✝ : ∀ (a : ↑s), IsScalarTower S (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
this : ∀ (a : ↑s), Algebra.IsPushout T (Localization.Away ↑a) (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
a : ↑s
⊢ IsLocalization.Away ((fun a => Algebra.TensorProduct.includeRight ↑a) a) =
    IsLocalization (Algebra.algebraMapSubmonoid (S ⊗[R] T) (Submonoid.powers ↑a))

Tactic:
simp only [Algebra.TensorProduct.includeRight_apply, Algebra.algebraMapSubmonoid,
  Submonoid.map_powers]

Result:
case h.e
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hPi : RespectsIso fun {R S} [CommRing R] [CommRing S] => P
hPb : IsStableUnderBaseChange fun {R S} [CommRing R] [CommRing S] => P
R S T : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
s : Set T
hsone : Ideal.span s = ⊤
hs : ∀ t ∈ s, (fun {R S} [CommRing R] [CommRing S] => P) ((algebraMap T (Localization.Away t)).comp (algebraMap R T))
this✝⁴ : (a : ↑s) → Algebra (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a) :=
  fun a => (Algebra.TensorProduct.map (AlgHom.id R S) (IsScalarTower.toAlgHom R T (Localization.Away ↑a))).toAlgebra
this✝³ : (a : ↑s) → Algebra T (S ⊗[R] Localization.Away ↑a) :=
  fun a => ((algebraMap (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)).comp (algebraMap T (S ⊗[R] T))).toAlgebra
this✝² : ∀ (a : ↑s), IsScalarTower T (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
this✝¹ : ∀ (a : ↑s), IsScalarTower T (Localization.Away ↑a) (S ⊗[R] Localization.Away ↑a)
this✝ : ∀ (a : ↑s), IsScalarTower S (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
this : ∀ (a : ↑s), Algebra.IsPushout T (Localization.Away ↑a) (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
a : ↑s
⊢ IsLocalization.Away (1 ⊗ₜ[R] ↑a) = IsLocalization (Submonoid.powers ((algebraMap T (S ⊗[R] T)) ↑a))

Proof state:
case intro.intro.refine_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hPi : RespectsIso fun {R S} [CommRing R] [CommRing S] => P
hPb : IsStableUnderBaseChange fun {R S} [CommRing R] [CommRing S] => P
R S T : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
s : Set T
hsone : Ideal.span s = ⊤
hs : ∀ t ∈ s, (fun {R S} [CommRing R] [CommRing S] => P) ((algebraMap T (Localization.Away t)).comp (algebraMap R T))
this✝⁴ : (a : ↑s) → Algebra (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a) :=
  fun a => (Algebra.TensorProduct.map (AlgHom.id R S) (IsScalarTower.toAlgHom R T (Localization.Away ↑a))).toAlgebra
this✝³ : (a : ↑s) → Algebra T (S ⊗[R] Localization.Away ↑a) :=
  fun a => ((algebraMap (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)).comp (algebraMap T (S ⊗[R] T))).toAlgebra
this✝² : ∀ (a : ↑s), IsScalarTower T (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
this✝¹ : ∀ (a : ↑s), IsScalarTower T (Localization.Away ↑a) (S ⊗[R] Localization.Away ↑a)
this✝ : ∀ (a : ↑s), IsScalarTower S (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
this : ∀ (a : ↑s), Algebra.IsPushout T (Localization.Away ↑a) (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)
a : ↑s
⊢ IsBaseChange (Localization.Away ↑a) (IsScalarTower.toAlgHom T (S ⊗[R] T) (S ⊗[R] Localization.Away ↑a)).toLinearMap

Tactic:
exact Algebra.IsPushout.out

Result:
no goals