[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso f
H : P (f ≫ g)
⊢ P g
[PROOFSTEP]
convert hP.2 (f ≫ g) (asIso f).symm.commRingCatIsoToRingEquiv H
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso f
H : P (f ≫ g)
⊢ g = comp (f ≫ g) (RingEquiv.toRingHom (Iso.commRingCatIsoToRingEquiv (asIso f).symm))
[PROOFSTEP]
exact (IsIso.inv_hom_id_assoc _ _).symm
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso g
H : P (f ≫ g)
⊢ P f
[PROOFSTEP]
convert hP.1 (f ≫ g) (asIso g).symm.commRingCatIsoToRingEquiv H
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso g
H : P (f ≫ g)
⊢ f = comp (RingEquiv.toRingHom (Iso.commRingCatIsoToRingEquiv (asIso g).symm)) (f ≫ g)
[PROOFSTEP]
change f = f ≫ g ≫ inv g
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso g
H : P (f ≫ g)
⊢ f = f ≫ g ≫ inv g
[PROOFSTEP]
simp
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
⊢ P (Localization.awayMap f r) ↔ P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
let e₁ : R' ≃+* Localization.Away r := (IsLocalization.algEquiv (Submonoid.powers r) _ _).toRingEquiv
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
⊢ P (Localization.awayMap f r) ↔ P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
let e₂ : Localization.Away (f r) ≃+* S' := (IsLocalization.algEquiv (Submonoid.powers (f r)) _ _).toRingEquiv
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ P (Localization.awayMap f r) ↔ P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
refine' (hP.cancel_left_isIso e₁.toCommRingCatIso.hom (CommRingCat.ofHom _)).symm.trans _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ P
      ((RingEquiv.toCommRingCatIso e₁).hom ≫
        CommRingCat.ofHom
          (IsLocalization.map (Localization.Away (↑f r)) f
            (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ↔
    P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
refine' (hP.cancel_right_isIso (CommRingCat.ofHom _) e₂.toCommRingCatIso.hom).symm.trans _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ P
      (CommRingCat.ofHom
          ((RingEquiv.toCommRingCatIso e₁).hom ≫
            CommRingCat.ofHom
              (IsLocalization.map (Localization.Away (↑f r)) f
                (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
        (RingEquiv.toCommRingCatIso e₂).hom) ↔
    P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
rw [← eq_iff_iff]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ P
      (CommRingCat.ofHom
          ((RingEquiv.toCommRingCatIso e₁).hom ≫
            CommRingCat.ofHom
              (IsLocalization.map (Localization.Away (↑f r)) f
                (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
        (RingEquiv.toCommRingCatIso e₂).hom) =
    P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
congr 1
  -- Porting Note : Here, the proof used to have a huge `simp` involving `[anonymous]`, which didn't
    -- work out anymore. The issue seemed to be that it couldn't handle a term in which Ring
    -- homomorphisms were repeatedly casted to the bundled category and back. Here we resolve the
    -- problem by converting the goal to a more straightforward form.
[GOAL]
case e_x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ CommRingCat.ofHom
        ((RingEquiv.toCommRingCatIso e₁).hom ≫
          CommRingCat.ofHom
            (IsLocalization.map (Localization.Away (↑f r)) f
              (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
      (RingEquiv.toCommRingCatIso e₂).hom =
    IsLocalization.Away.map R' S' f r
[PROOFSTEP]
let e :=
  (e₂ : Localization.Away (f r) →+* S').comp
    (((IsLocalization.map (Localization.Away (f r)) f
            (by rintro x ⟨n, rfl⟩; use n; simp : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (f r)))) :
          Localization.Away r →+* Localization.Away (f r)).comp
      (e₁ : R' →+* Localization.Away r))
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))
[PROOFSTEP]
rintro x ⟨n, rfl⟩
[GOAL]
case intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
n : ℕ
⊢ (fun x x_1 => x ^ x_1) r n ∈ Submonoid.comap f (Submonoid.powers (↑f r))
[PROOFSTEP]
use n
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
n : ℕ
⊢ (fun x x_1 => x ^ x_1) (↑f r) n = ↑f ((fun x x_1 => x ^ x_1) r n)
[PROOFSTEP]
simp
[GOAL]
case e_x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
⊢ CommRingCat.ofHom
        ((RingEquiv.toCommRingCatIso e₁).hom ≫
          CommRingCat.ofHom
            (IsLocalization.map (Localization.Away (↑f r)) f
              (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
      (RingEquiv.toCommRingCatIso e₂).hom =
    IsLocalization.Away.map R' S' f r
[PROOFSTEP]
suffices e = IsLocalization.Away.map R' S' f r by convert this
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
this : e = IsLocalization.Away.map R' S' f r
⊢ CommRingCat.ofHom
        ((RingEquiv.toCommRingCatIso e₁).hom ≫
          CommRingCat.ofHom
            (IsLocalization.map (Localization.Away (↑f r)) f
              (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
      (RingEquiv.toCommRingCatIso e₂).hom =
    IsLocalization.Away.map R' S' f r
[PROOFSTEP]
convert this
[GOAL]
case e_x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
⊢ e = IsLocalization.Away.map R' S' f r
[PROOFSTEP]
apply IsLocalization.ringHom_ext (Submonoid.powers r) _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
⊢ comp e (algebraMap R R') = comp (IsLocalization.Away.map R' S' f r) (algebraMap R R')
[PROOFSTEP]
ext1 x
[GOAL]
case a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
x : R
⊢ ↑(comp e (algebraMap R R')) x = ↑(comp (IsLocalization.Away.map R' S' f r) (algebraMap R R')) x
[PROOFSTEP]
dsimp [IsLocalization.Away.map]
[GOAL]
case a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
x : R
⊢ ↑(IsLocalization.map S' (id S) (_ : Submonoid.powers (↑f r) ≤ Submonoid.comap (id S) (Submonoid.powers (↑f r))))
      (↑(IsLocalization.map (Localization.Away (↑f r)) f
            (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
        (↑(IsLocalization.map (Localization.Away r) (id R)
              (_ : Submonoid.powers r ≤ Submonoid.comap (id R) (Submonoid.powers r)))
          (↑(algebraMap R R') x))) =
    ↑(IsLocalization.map S' f (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))
      (↑(algebraMap R R') x)
[PROOFSTEP]
simp only [IsLocalization.map_eq, id_apply, RingHomCompTriple.comp_apply]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
⊢ RespectsIso P
[PROOFSTEP]
constructor
[GOAL]
case left
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
⊢ ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (e : S ≃+* T),
    P f → P (comp (RingEquiv.toRingHom e) f)
[PROOFSTEP]
introv H
[GOAL]
case left
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : R →+* S
e : S ≃+* T
H : P f
⊢ P (comp (RingEquiv.toRingHom e) f)
[PROOFSTEP]
skip
[GOAL]
case left
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : R →+* S
e : S ≃+* T
H : P f
⊢ P (comp (RingEquiv.toRingHom e) f)
[PROOFSTEP]
apply hP
[GOAL]
case left.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : R →+* S
e : S ≃+* T
H : P f
⊢ P f
case left.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : R →+* S
e : S ≃+* T
H : P f
⊢ P (RingEquiv.toRingHom e)
[PROOFSTEP]
exacts [H, hP' e]
[GOAL]
case right
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
⊢ ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : S →+* T) (e : R ≃+* S),
    P f → P (comp f (RingEquiv.toRingHom e))
[PROOFSTEP]
introv H
[GOAL]
case right
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : S →+* T
e : R ≃+* S
H : P f
⊢ P (comp f (RingEquiv.toRingHom e))
[PROOFSTEP]
skip
[GOAL]
case right
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : S →+* T
e : R ≃+* S
H : P f
⊢ P (comp f (RingEquiv.toRingHom e))
[PROOFSTEP]
apply hP
[GOAL]
case right.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : S →+* T
e : R ≃+* S
H : P f
⊢ P (RingEquiv.toRingHom e)
case right.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : S →+* T
e : R ≃+* S
H : P f
⊢ P f
[PROOFSTEP]
exacts [hP' e, H]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
⊢ StableUnderBaseChange P
[PROOFSTEP]
introv R h H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
⊢ P (algebraMap R' S')
[PROOFSTEP]
let e := h.symm.1.equiv
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
⊢ P (algebraMap R' S')
[PROOFSTEP]
let f' := Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
⊢ P (algebraMap R' S')
[PROOFSTEP]
have : ∀ x, e x = f' x := by
  intro x
  change e.toLinearMap.restrictScalars R x = f'.toLinearMap x
  congr 1
  apply TensorProduct.ext'
  intro x y
  simp [IsBaseChange.equiv_tmul, Algebra.smul_def]
    -- Porting Note: This had a lot of implicit inferences which didn't resolve anymore.
      -- Added those in
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
⊢ ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
[PROOFSTEP]
intro x
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x : TensorProduct R R' S
⊢ ↑e x = ↑f' x
[PROOFSTEP]
change e.toLinearMap.restrictScalars R x = f'.toLinearMap x
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x : TensorProduct R R' S
⊢ ↑(↑R ↑e) x = ↑(AlgHom.toLinearMap f') x
[PROOFSTEP]
congr 1
[GOAL]
case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x : TensorProduct R R' S
⊢ ↑R ↑e = AlgHom.toLinearMap f'
[PROOFSTEP]
apply TensorProduct.ext'
[GOAL]
case e_a.H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x : TensorProduct R R' S
⊢ ∀ (x : R') (y : S), ↑(↑R ↑e) (x ⊗ₜ[R] y) = ↑(AlgHom.toLinearMap f') (x ⊗ₜ[R] y)
[PROOFSTEP]
intro x y
[GOAL]
case e_a.H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x✝ : TensorProduct R R' S
x : R'
y : S
⊢ ↑(↑R ↑e) (x ⊗ₜ[R] y) = ↑(AlgHom.toLinearMap f') (x ⊗ₜ[R] y)
[PROOFSTEP]
simp [IsBaseChange.equiv_tmul, Algebra.smul_def]
  -- Porting Note: This had a lot of implicit inferences which didn't resolve anymore.
    -- Added those in
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ P (algebraMap R' S')
[PROOFSTEP]
convert
  h₁.1 (_ : R' →+* TensorProduct R R' S) (_ : TensorProduct R R' S ≃+* S') (h₂ H : P (_ : R' →+* TensorProduct R R' S))
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ algebraMap R' S' = comp (RingEquiv.toRingHom ?m.221851) Algebra.TensorProduct.includeLeftRingHom
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ TensorProduct R R' S ≃+* S'
[PROOFSTEP]
swap
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ TensorProduct R R' S ≃+* S'
[PROOFSTEP]
refine' { e with map_mul' := fun x y => _ }
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x y : TensorProduct R R' S
⊢ Equiv.toFun
      { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
        right_inv := (_ : Function.RightInverse e.invFun e.toFun) }
      (x * y) =
    Equiv.toFun
        { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
          right_inv := (_ : Function.RightInverse e.invFun e.toFun) }
        x *
      Equiv.toFun
        { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
          right_inv := (_ : Function.RightInverse e.invFun e.toFun) }
        y
[PROOFSTEP]
change e (x * y) = e x * e y
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x y : TensorProduct R R' S
⊢ ↑e (x * y) = ↑e x * ↑e y
[PROOFSTEP]
simp_rw [this]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x y : TensorProduct R R' S
⊢ ↑(Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')) (x * y) =
    ↑(Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')) x *
      ↑(Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')) y
[PROOFSTEP]
exact map_mul f' _ _
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ algebraMap R' S' =
    comp
      (RingEquiv.toRingHom
        {
          toEquiv :=
            { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
              right_inv := (_ : Function.RightInverse e.invFun e.toFun) },
          map_mul' := (_ : ∀ (x y : TensorProduct R R' S), ↑e (x * y) = ↑e x * ↑e y),
          map_add' :=
            (_ :
              ∀ (x y : TensorProduct R R' S),
                AddHom.toFun e.toAddHom (x + y) = AddHom.toFun e.toAddHom x + AddHom.toFun e.toAddHom y) })
      Algebra.TensorProduct.includeLeftRingHom
[PROOFSTEP]
ext x
[GOAL]
case h.e'_5.a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x : R'
⊢ ↑(algebraMap R' S') x =
    ↑(comp
          (RingEquiv.toRingHom
            {
              toEquiv :=
                { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
                  right_inv := (_ : Function.RightInverse e.invFun e.toFun) },
              map_mul' := (_ : ∀ (x y : TensorProduct R R' S), ↑e (x * y) = ↑e x * ↑e y),
              map_add' :=
                (_ :
                  ∀ (x y : TensorProduct R R' S),
                    AddHom.toFun e.toAddHom (x + y) = AddHom.toFun e.toAddHom x + AddHom.toFun e.toAddHom y) })
          Algebra.TensorProduct.includeLeftRingHom)
      x
[PROOFSTEP]
change
  _ =
    e
      (x ⊗ₜ[R] 1)
        --Porting note: Had `dsimp only [e]` here, which didn't work anymore
[GOAL]
case h.e'_5.a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x : R'
⊢ ↑(algebraMap R' S') x = ↑e (x ⊗ₜ[R] 1)
[PROOFSTEP]
rw [h.symm.1.equiv_tmul, Algebra.smul_def, AlgHom.toLinearMap_apply, map_one, mul_one]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
⊢ P pushout.inl
[PROOFSTEP]
rw [←
  show _ = pushout.inl from colimit.isoColimitCocone_ι_inv ⟨_, CommRingCat.pushoutCoconeIsColimit f g⟩ WalkingSpan.left,
  hP'.cancel_right_isIso]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
⊢ P
    (NatTrans.app
      { cocone := CommRingCat.pushoutCocone f g, isColimit := CommRingCat.pushoutCoconeIsColimit f g }.cocone.ι
      WalkingSpan.left)
[PROOFSTEP]
letI := f.toAlgebra
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
this : Algebra ↑R ↑S := toAlgebra f
⊢ P
    (NatTrans.app
      { cocone := CommRingCat.pushoutCocone f g, isColimit := CommRingCat.pushoutCoconeIsColimit f g }.cocone.ι
      WalkingSpan.left)
[PROOFSTEP]
letI := g.toAlgebra
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
this✝ : Algebra ↑R ↑S := toAlgebra f
this : Algebra ↑R ↑T := toAlgebra g
⊢ P
    (NatTrans.app
      { cocone := CommRingCat.pushoutCocone f g, isColimit := CommRingCat.pushoutCoconeIsColimit f g }.cocone.ι
      WalkingSpan.left)
[PROOFSTEP]
dsimp only [CommRingCat.pushoutCocone_inl, PushoutCocone.ι_app_left]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
this✝ : Algebra ↑R ↑S := toAlgebra f
this : Algebra ↑R ↑T := toAlgebra g
⊢ P Algebra.TensorProduct.includeLeftRingHom
[PROOFSTEP]
apply hP R T S (TensorProduct R S T)
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
this✝ : Algebra ↑R ↑S := toAlgebra f
this : Algebra ↑R ↑T := toAlgebra g
⊢ P (algebraMap ↑R ↑T)
[PROOFSTEP]
exact H
