Theorem: IsLocalization.isLocalization_iff_of_base_ringEquiv
File: Mathlib/RingTheory/Localization/Basic.lean

tactic: letI : Algebra P S := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra
state_before: R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
⊢ IsLocalization M S ↔ IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S

tactic: refine' ⟨fun _ => isLocalization_of_base_ringEquiv M S h, _⟩
state_before: R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
⊢ IsLocalization M S ↔ IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S

tactic: intro H
state_before: R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
⊢ IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S → IsLocalization M S

tactic: convert isLocalization_of_base_ringEquiv (Submonoid.map (RingEquiv.toMonoidHom h) M) S h.symm
state_before: R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ IsLocalization M S

tactic: rw [RingHom.algebraMap_toAlgebra, RingHom.comp_assoc]
state_before: case h.e'_6
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ inst✝¹ = RingHom.toAlgebra (RingHom.comp (algebraMap P S) (RingEquiv.toRingHom (RingEquiv.symm (RingEquiv.symm h))))

tactic: simp only [RingHom.comp_id, RingEquiv.symm_symm, RingEquiv.symm_toRingHom_comp_toRingHom]
state_before: case h.e'_6
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ inst✝¹ =
    RingHom.toAlgebra
      (RingHom.comp (algebraMap R S)
        (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm h))
          (RingEquiv.toRingHom (RingEquiv.symm (RingEquiv.symm h)))))

tactic: apply Algebra.algebra_ext
state_before: case h.e'_6
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ inst✝¹ = RingHom.toAlgebra (algebraMap R S)

tactic: intro r
state_before: case h.e'_6.h
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ ∀ (r : R), ↑(algebraMap R S) r = ↑(algebraMap R S) r

tactic: rw [RingHom.algebraMap_toAlgebra]
state_before: case h.e'_6.h
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
r : R
⊢ ↑(algebraMap R S) r = ↑(algebraMap R S) r

tactic: erw [Submonoid.map_equiv_eq_comap_symm, Submonoid.comap_map_eq_of_injective]
state_before: case h.e'_3
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ M = Submonoid.map (RingEquiv.toMonoidHom (RingEquiv.symm h)) (Submonoid.map (RingEquiv.toMonoidHom h) M)

tactic: exact h.toEquiv.injective
state_before: case h.e'_3.hf
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_3
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_2
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ Injective ↑(MulEquiv.toMonoidHom (MulEquiv.symm (RingEquiv.toMulEquiv (RingEquiv.symm h))))