Theorem: Submonoid.LocalizationMap.lift_surjective_iff
File: Mathlib/GroupTheory/MonoidLocalization.lean

tactic: constructor
state_before: M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
⊢ Surjective ↑(lift f hg) ↔ ∀ (v : P), ∃ x, v * ↑g ↑x.snd = ↑g x.fst

tactic: intro H v
state_before: case mp
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
⊢ Surjective ↑(lift f hg) → ∀ (v : P), ∃ x, v * ↑g ↑x.snd = ↑g x.fst

tactic: obtain ⟨z, hz⟩ := H v
state_before: case mp
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
H : Surjective ↑(lift f hg)
v : P
⊢ ∃ x, v * ↑g ↑x.snd = ↑g x.fst

tactic: obtain ⟨x, hx⟩ := f.surj z
state_before: case mp.intro
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
H : Surjective ↑(lift f hg)
v : P
z : N
hz : ↑(lift f hg) z = v
⊢ ∃ x, v * ↑g ↑x.snd = ↑g x.fst

tactic: use x
state_before: case mp.intro.intro
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
H : Surjective ↑(lift f hg)
v : P
z : N
hz : ↑(lift f hg) z = v
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ∃ x, v * ↑g ↑x.snd = ↑g x.fst

tactic: rw [← hz, f.eq_mk'_iff_mul_eq.2 hx, lift_mk', mul_assoc, mul_comm _ (g ↑x.2)]
state_before: case mp.intro.intro
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
H : Surjective ↑(lift f hg)
v : P
z : N
hz : ↑(lift f hg) z = v
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ v * ↑g ↑x.snd = ↑g x.fst

tactic: erw [IsUnit.mul_liftRight_inv (g.restrict S) hg, mul_one]
state_before: case mp.intro.intro
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
H : Surjective ↑(lift f hg)
v : P
z : N
hz : ↑(lift f hg) z = v
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑g x.fst * (↑g ↑x.snd * ↑(↑(IsUnit.liftRight (MonoidHom.restrict g S) hg) x.snd)⁻¹) = ↑g x.fst

tactic: intro H v
state_before: case mpr
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
⊢ (∀ (v : P), ∃ x, v * ↑g ↑x.snd = ↑g x.fst) → Surjective ↑(lift f hg)

tactic: obtain ⟨x, hx⟩ := H v
state_before: case mpr
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
H : ∀ (v : P), ∃ x, v * ↑g ↑x.snd = ↑g x.fst
v : P
⊢ ∃ a, ↑(lift f hg) a = v

tactic: use f.mk' x.1 x.2
state_before: case mpr.intro
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
H : ∀ (v : P), ∃ x, v * ↑g ↑x.snd = ↑g x.fst
v : P
x : M × { x // x ∈ S }
hx : v * ↑g ↑x.snd = ↑g x.fst
⊢ ∃ a, ↑(lift f hg) a = v

tactic: rw [lift_mk', mul_inv_left hg, mul_comm, ← hx]
state_before: case mpr.intro
M : Type u_3
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_1
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
H : ∀ (v : P), ∃ x, v * ↑g ↑x.snd = ↑g x.fst
v : P
x : M × { x // x ∈ S }
hx : v * ↑g ↑x.snd = ↑g x.fst
⊢ ↑(lift f hg) (mk' f x.fst x.snd) = v